API¶
oclubs Module.
Service Access¶
oclubs Module.
-
oclubs.access.
done
(commit=True)[source]¶ Finish a request.
Parameters: commit (bool) – If true, save the data; else discard it.
Main Relational Database¶
Module to access main relational database, which is currently MariaDB.
This module compiles SQL statements with security in mind, executes them, and returns data from the execution.
-
class
oclubs.access.database.
RawSQL
(sql)[source]¶ Bases:
object
Class to signal a raw SQL part of a query. - DANGEROUS!
Parameters: sql (basestring) – the raw SQL to use -
sql
¶ The raw SQL passed in.
-
-
oclubs.access.database.
delete_rows
(table, conds)[source]¶ Execute a
DELETE
on a table.Parameters: - table (basestring) – table name
- conds (list or dict) – conditions
Returns: number of rows deleted
Return type: Raises: NoRow – if no row was deleted
-
oclubs.access.database.
expand_cond
(cond)[source]¶ Change the input SQL condition into a dict.
Parameters: cond (list or dict) – the input SQL matching condition Return type: dict
-
oclubs.access.database.
fetch_info
(info)[source]¶ Execute a simple
SELECT
without a table.Parameters: info (basestring) – the information to select Returns: the selected information
-
oclubs.access.database.
fetch_multirow
(table, coldict, conds, **kwargs)[source]¶ Execute a
SELECT
on a table, returning the value for rows.Parameters: - table (basestring) – table name
- coldict (dict) – column specification, with keys as the column name and values as the corresponding keys of the returned dic
- conds (list or dict) – conditions
Returns: the selected rows
Return type: list of dict
-
oclubs.access.database.
fetch_onecol
(table, col, conds, **kwargs)[source]¶ Execute a
SELECT
on a table, returning the values for a column.Parameters: - table (basestring) – table name
- col (basestring) – column name
- conds (list or dict) – conditions
Returns: the selected column
Return type:
-
oclubs.access.database.
fetch_oneentry
(table, col, conds, **kwargs)[source]¶ Execute a
SELECT
on a table, returning the value for an entry.Parameters: - table (basestring) – table name
- col (basestring) – column name
- conds (list or dict) – conditions
Returns: the selected entry
Raises: NoRow – if no row was selected
-
oclubs.access.database.
fetch_onerow
(table, coldict, conds, **kwargs)[source]¶ Execute a
SELECT
on a table, returning the value for a row.Parameters: - table (basestring) – table name
- coldict (dict) – column specification, with keys as the column name and values as the corresponding keys of the returned dict
- conds (list or dict) – conditions
Returns: the selected row, with keys specified in coldict
Return type: Raises: NoRow – if no row was selected
-
oclubs.access.database.
insert_or_update_row
(table, insert, update)[source]¶ Execute an
INSERT
on a table, withON DUPLICATE KEY UPDATE
.Parameters: - table (basestring) – table name
- coldict (dict) – inserted data, with keys as the column name and values as the corresponding values
- update (dict) – updated data, with keys as the column name and values as the corresponding values
Returns: the id of the inserted row
Return type:
-
oclubs.access.database.
insert_row
(table, insert)[source]¶ Execute an
INSERT
on a table.Parameters: - table (basestring) – table name
- insert (dict) – inserted data, with keys as the column name and values as the corresponding values
Returns: the id of the inserted row
Return type: Raises: AlreadyExists – if the row already exists and insertion would result in duplicate keys
-
oclubs.access.database.
update_row
(table, update, conds)[source]¶ Execute an
UPDATE
on a table.Parameters: - table (basestring) – table name
- update (dict) – updated data, with keys as the column name and values as the corresponding values
- conds (list or dict) – conditions
Returns: number of rows updated
Return type: Raises: NoRow – if no row was updated
SHSID Authoritative Database¶
Module to access SHSID authortative database, which is currently IBM DB2.
Only accessing student data is implemented.
Search Engine¶
Module to access Elasticsearch search engine.
This module has delayed functions to create/update/delete documents on the engine, and to search within all the documents.
-
oclubs.access.elasticsearch.
create
(*args, **kwargs)[source]¶ Create an Elasticsearch document.
Parameters: - doc_type (basestring) – document type
- doc_id – document id, will be converted into basestring
- data (dict) – new document data
-
oclubs.access.elasticsearch.
delete
(*args, **kwargs)[source]¶ Delete an Elasticsearch document.
Parameters: - doc_type (basestring) – document type
- doc_id – document id, will be converted into basestring
-
oclubs.access.elasticsearch.
get
(doc_type, doc_id, fields=True)[source]¶ Get an Elasticsearch document.
Parameters: - doc_type (basestring) – document type
- doc_id – document id, will be converted into basestring
- fields – if
False
, returns whether the document is found as bool; ifTrue
, returns the document dict; if list of string, returns the document dict with only the specified fields.
Return type:
-
oclubs.access.elasticsearch.
search
(querystr, *args, **kwargs)[source]¶ Search for Elasticsearch documents.
Parameters: - querystr (basestring) – query string
- doc_type (basestring) – document type
- doc_id – document id, will be converted into basestring
- fields (list of basestring) – fields to search on
- offset (int) – search offset
- size (int) – search size
Returns: - ‘instead’ (basestring or None): the alternative search query
- ‘results’ (list of dict): list of documents
- ‘count’ (int): the number of all matching documents
Return type:
-
oclubs.access.elasticsearch.
update
(*args, **kwargs)[source]¶ Update an Elasticsearch document.
Parameters: - doc_type (basestring) – document type
- doc_id – document id, will be converted into basestring
- data (dict) – new document data
Send Email¶
Module to send emails.
This module sends emails with either Postfix or SendGrid.
-
oclubs.access.email.
send
(*args, **kwargs)[source]¶ Send an email.
Parameters: - to_email (tuple) – email recipient address and name
- subject (basestring) – email subject
- content (basestring) – email content
Filesystem¶
Filesystem helpers.
Redis¶
Module to access Redis key-value storage.
Access is in a object fashion, with objects instantiated with the key. The serialization is done with JSON.
-
class
oclubs.access.redis.
ImmutableMixin
(value=u'')[source]¶ Bases:
object
Mixin to work with immutable types on redis.
Parameters: value – initial value
-
class
oclubs.access.redis.
RedisCache
[source]¶ Bases:
oclubs.access.redis.RedisStuff
,oclubs.access.redis.ImmutableMixin
An immutable object on Redis for indirect access.
-
class
oclubs.access.redis.
RedisDict
[source]¶ Bases:
oclubs.access.redis.RedisStuff
,dict
A dict on Redis.
-
class
oclubs.access.redis.
RedisList
[source]¶ Bases:
oclubs.access.redis.RedisStuff
,list
A list on Redis.
-
class
oclubs.access.redis.
RedisStuff
[source]¶ Bases:
object
Superclass of all redis stuffs.
Parameters: - key (basestring) – redis key
- timeout (int) – timeyt in seconds for the key, negative values are forever.
-
static
load
(key)[source]¶ Load a value from Redis.
Parameters: key (basestring) – redis key Returns: the value associated with the key Return type: basestring Raises: KeyError – if key is not found
-
modified
¶ bool indicating if value has been modified.
-
static
serialize
(obj)[source]¶ Serialize object.
Parameters: obj – object to serialize Returns: serialized object Return type: basestring
-
static
unserialize
(data)[source]¶ Unserialize data.
Parameters: data (basestring) – data to unserialize Returns: unserialized data
Secrets¶
Module to read from screts.ini.
-
oclubs.access.secrets.
get_secret
(name)[source]¶ Read a secret from secrets.ini.
Parameters: name (basestring) – name of the secret Returns: value of the secret Return type: basestring
Site configuration¶
Module to access site configuration in siteconfig.ini.
-
oclubs.access.siteconfig.
get_config
(name)[source]¶ Get a site configuration boolean.
Parameters: name (basestring) – name of site configuration Returns: value of site configuration Return type: bool
-
oclubs.access.siteconfig.
set_config
(name, value)[source]¶ Set a site configuration boolean.
Parameters: - name (basestring) – name of site configuration
- value (bool) – new value of site configuration
Classes¶
oclubs Objects.
-
class
oclubs.objs.
Activity
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
attendance
¶ List of values of column
att_user
in tableattendance
, with rows selected by the id of the object matching columnatt_act
in the same table.
-
callsign
¶ The callsign for use in urls.
-
cas
¶ Value of column
act_cas
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
club
¶ Value of column
act_club
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
date
¶ Value of column
act_date
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
date_fmtstr
= u'%Y%m%d'¶
-
description
¶ Value of column
act_desc
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
identifier
= u'act_id'¶
-
is_future
¶
-
location
¶ Value of column
act_location
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
name
¶ Value of column
act_name
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
one_line_selections
¶
-
pictures
¶ List of values of column
actpic_upload
in tableact_pic
, with rows selected by the id of the object matching columnactpic_act
in the same table.
-
post
¶ Value of column
act_post
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
classmethod
search
(query_string, offset=0, size=10)¶ Search for objects of this class with a query string.
Parameters: - query_string (basestring) – query string
- offset (int) – search offset
- size (int) – search size
Return type: list of dict
-
selections
¶ Value of column
act_selections
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
table
= u'activity'¶
-
time
¶ Value of column
act_time
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
-
class
oclubs.objs.
Club
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
all_act
¶ List of values of column
act_id
in tableactivities
, with rows selected by the id of the object matching columnact_club
in the same table.
-
callsign
¶ The callsign for use in urls.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
description
¶ Value of column
club_desc
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
identifier
= u'club_id'¶
-
intro
¶ Value of column
club_intro
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
is_active
¶ Value of column
club_inactive
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
is_excellent
¶
-
joinmode
¶ Value of column
club_joinmode
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
leader
¶ Value of column
club_leader
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
location
¶ Value of column
club_location
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
members
¶ List of values of column
cm_user
in tableclub_member
, with rows selected by the id of the object matching columncm_club
in the same table.
-
name
¶ Value of column
club_name
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
picture
¶ Value of column
club_picture
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
reactivate
¶ Value of column
club_reactivate
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
classmethod
search
(query_string, offset=0, size=10)¶ Search for objects of this class with a query string.
Parameters: - query_string (basestring) – query string
- offset (int) – search offset
- size (int) – search size
Return type: list of dict
-
table
= u'club'¶
-
teacher
¶ Value of column
club_teacher
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
teacher_and_members
¶
-
type
¶ Value of column
club_type
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
-
class
oclubs.objs.
FormattedText
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
club
¶ Value of column
text_club
in tabletext
, with row selected by the id of the object matching columntext_id
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
formatted
¶
-
id
¶
-
identifier
= u'text_id'¶
-
raw
¶
-
table
= u'text'¶
-
uploader
¶ Value of column
text_user
in tabletext
, with row selected by the id of the object matching columntext_id
in the same table.
-
-
class
oclubs.objs.
Upload
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
club
¶ Value of column
upload_club
in tableupload
, with row selected by the id of the object matching columnupload_id
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
id
¶
-
identifier
= u'upload_id'¶
-
location_external
¶
-
location_local
¶
-
mime
¶ Value of column
upload_mime
in tableupload
, with row selected by the id of the object matching columnupload_id
in the same table.
-
table
= u'upload'¶
-
uploader
¶ Value of column
upload_user
in tableupload
, with row selected by the id of the object matching columnupload_id
in the same table.
-
-
class
oclubs.objs.
User
[source]¶ Bases:
oclubs.objs.base.BaseObject
,flask_login.mixins.UserMixin
-
GRADECLASSREGEX
= <_sre.SRE_Pattern object>¶
-
PREFERENCES
= {u'receive_email': (<function <lambda>>, True)}¶
-
attendance
¶ List of values of column
att_act
in tableattendance
, with rows selected by the id of the object matching columnatt_user
in the same table.
-
clubs
¶ List of values of column
cm_club
in tableclub_member
, with rows selected by the id of the object matching columncm_user
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
currentclass
¶ Value of column
user_class
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
email
¶ Value of column
user_email
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
grade
¶ Value of column
user_grade
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
grade_and_class
¶
-
identifier
= u'user_id'¶
-
is_disabled
¶
-
nickname
¶ Value of column
user_nick_name
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
passportname
¶ Value of column
user_passport_name
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
password
¶ Value of column
user_password
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
phone
¶ Value of column
user_phone
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
picture
¶ Value of column
user_picture
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
studentid
¶ Value of column
user_login_name
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
table
= u'user'¶
-
type
¶ Value of column
user_type
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
Activity¶
-
class
oclubs.objs.activity.
Activity
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
attendance
¶ List of values of column
att_user
in tableattendance
, with rows selected by the id of the object matching columnatt_act
in the same table.
-
callsign
¶ The callsign for use in urls.
-
cas
¶ Value of column
act_cas
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
club
¶ Value of column
act_club
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
date
¶ Value of column
act_date
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
date_fmtstr
= u'%Y%m%d'¶
-
description
¶ Value of column
act_desc
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
identifier
= u'act_id'¶
-
is_future
¶
-
location
¶ Value of column
act_location
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
name
¶ Value of column
act_name
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
one_line_selections
¶
-
pictures
¶ List of values of column
actpic_upload
in tableact_pic
, with rows selected by the id of the object matching columnactpic_act
in the same table.
-
post
¶ Value of column
act_post
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
classmethod
search
(query_string, offset=0, size=10)¶ Search for objects of this class with a query string.
Parameters: - query_string (basestring) – query string
- offset (int) – search offset
- size (int) – search size
Return type: list of dict
-
selections
¶ Value of column
act_selections
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
table
= u'activity'¶
-
time
¶ Value of column
act_time
in tableactivity
, with row selected by the id of the object matching columnact_id
in the same table.
-
Club¶
-
class
oclubs.objs.club.
Club
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
all_act
¶ List of values of column
act_id
in tableactivities
, with rows selected by the id of the object matching columnact_club
in the same table.
-
callsign
¶ The callsign for use in urls.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
description
¶ Value of column
club_desc
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
identifier
= u'club_id'¶
-
intro
¶ Value of column
club_intro
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
is_active
¶ Value of column
club_inactive
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
is_excellent
¶
-
joinmode
¶ Value of column
club_joinmode
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
leader
¶ Value of column
club_leader
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
location
¶ Value of column
club_location
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
members
¶ List of values of column
cm_user
in tableclub_member
, with rows selected by the id of the object matching columncm_club
in the same table.
-
name
¶ Value of column
club_name
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
picture
¶ Value of column
club_picture
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
reactivate
¶ Value of column
club_reactivate
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
classmethod
search
(query_string, offset=0, size=10)¶ Search for objects of this class with a query string.
Parameters: - query_string (basestring) – query string
- offset (int) – search offset
- size (int) – search size
Return type: list of dict
-
table
= u'club'¶
-
teacher
¶ Value of column
club_teacher
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
teacher_and_members
¶
-
type
¶ Value of column
club_type
in tableclub
, with row selected by the id of the object matching columnclub_id
in the same table.
-
User¶
-
class
oclubs.objs.user.
User
[source]¶ Bases:
oclubs.objs.base.BaseObject
,flask_login.mixins.UserMixin
-
GRADECLASSREGEX
= <_sre.SRE_Pattern object>¶
-
PREFERENCES
= {u'receive_email': (<function <lambda>>, True)}¶
-
attendance
¶ List of values of column
att_act
in tableattendance
, with rows selected by the id of the object matching columnatt_user
in the same table.
-
clubs
¶ List of values of column
cm_club
in tableclub_member
, with rows selected by the id of the object matching columncm_user
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
currentclass
¶ Value of column
user_class
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
email
¶ Value of column
user_email
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
grade
¶ Value of column
user_grade
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
grade_and_class
¶
-
identifier
= u'user_id'¶
-
is_disabled
¶
-
nickname
¶ Value of column
user_nick_name
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
passportname
¶ Value of column
user_passport_name
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
password
¶ Value of column
user_password
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
phone
¶ Value of column
user_phone
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
picture
¶ Value of column
user_picture
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
studentid
¶ Value of column
user_login_name
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
table
= u'user'¶
-
type
¶ Value of column
user_type
in tableuser
, with row selected by the id of the object matching columnuser_id
in the same table.
-
Formatted Text¶
-
class
oclubs.objs.formattedtext.
FormattedText
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
club
¶ Value of column
text_club
in tabletext
, with row selected by the id of the object matching columntext_id
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
formatted
¶
-
id
¶
-
identifier
= u'text_id'¶
-
raw
¶
-
table
= u'text'¶
-
uploader
¶ Value of column
text_user
in tabletext
, with row selected by the id of the object matching columntext_id
in the same table.
-
Upload¶
-
class
oclubs.objs.upload.
Upload
[source]¶ Bases:
oclubs.objs.base.BaseObject
-
club
¶ Value of column
upload_club
in tableupload
, with row selected by the id of the object matching columnupload_id
in the same table.
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
id
¶
-
identifier
= u'upload_id'¶
-
location_external
¶
-
location_local
¶
-
mime
¶ Value of column
upload_mime
in tableupload
, with row selected by the id of the object matching columnupload_id
in the same table.
-
table
= u'upload'¶
-
uploader
¶ Value of column
upload_user
in tableupload
, with row selected by the id of the object matching columnupload_id
in the same table.
-
Base¶
oclubs Base Object.
-
class
oclubs.objs.base.
BaseObject
[source]¶ Bases:
object
-
create
(dup_key_update=False)¶ Write this temporary object into database and Elasticsearch.
Also set the id of the object to its corresponding id in the database, making the object permanent.
Parameters: dup_key_update (bool) – if True, when a unique key collides, update the colliding row with new data; else raise the error Returns: this object Raises: AlreadyExists – if insertion results in a unique key collision and dup_key_update is False
-
id
¶ ID of the object.
-
is_real
¶ Whether the object is temporary object (False) or permanent (True).
-
-
class
oclubs.objs.base.
ListProperty
(prop, table, this, that, ie=None)[source]¶ Bases:
object
Represent a list of value in the specified column in another table.
Selection is done by the id of the owner object match the value in the column specified by
this
in the specified table, and extraction is done on the column specified bythat
.Parameters: - table (basestring) – table name
- this (basestring) – column name to match the id with
- that (basestring) – column name to return values with
- ie (a single value of, or a tuple with two values of, None, NotImplemented, basestring, a serializer module, BaseObject, Enum, or callable) – import/export method, onlt the export part matters
-
class
oclubs.objs.base.
Property
(prop, dbname, ie=None, search=False, rediscached=False, search_require_true=False, error_default=Ellipsis)[source]¶ Bases:
object
Represent a value in the specified column of the current table.
Selection is done by the id of the owner object match the value in the identifier column in the current table.
Parameters: - dbname (basestring) – column name in relational database
- ie (a single value of, or a tuple with two values of, None, NotImplemented, basestring, a serializer module, BaseObject, Enum, or callable) – import/export method
- search (bool) – whether the column should be searchable
- rediscached (bool) – whether the column should be cached on Redis
- search_require_true (bool) – if True, the object will only be searchable if this column evaluates to True
- error_default – if not Ellipsis, when the importing fails, import this value as a fallback; else raise the error
Miscellaneous¶
Exceptions¶
oclubs exceptions.
-
exception
oclubs.exceptions.
AlreadyExists
[source]¶ Bases:
exceptions.Exception
Exception occuring when a row exists already when inserting.
-
exception
oclubs.exceptions.
NoRow
[source]¶ Bases:
exceptions.Exception
Exception occuring when no row is found from the database.
-
exception
oclubs.exceptions.
PasswordTooShort
[source]¶ Bases:
exceptions.Exception
Exception occuring someone sets a password that’s too short.
-
exception
oclubs.exceptions.
UploadNotSupported
[source]¶ Bases:
exceptions.Exception
Exception occuring when an uploaded file is not supported.
Enums¶
oClubs enums.
-
class
oclubs.enums.
UserType
[source]¶ Bases:
enum.Enum
Enum regarding the type of a user.
-
ADMIN
= 3¶
-
STUDENT
= 1¶
-
TEACHER
= 2¶
-
format_name
¶ Formats the value of the enum for display.
-
-
class
oclubs.enums.
ClubType
[source]¶ Bases:
enum.Enum
Enum regarding the type of a club.
-
ACADEMICS
= 1¶
-
ARTS
= 3¶
-
ENTERTAINMENT
= 5¶
-
OTHERS
= 6¶
-
SCHOOL_TEAMS
= 7¶
-
SERVICES
= 4¶
-
SPORTS
= 2¶
-
format_name
¶ Formats the value of the enum for display.
-


Logo
Link 1
Link 2
Link 3
Link 4
Save Property
Property Snapshot
assignment
Property Details
Address
State
City
ZIP
Bedroom
Bathroom
Aera (SqFt)
attach_money
Property Value & Pricing
Listed Price
Purchased Price
Rehab Cost
After Repair Value (ARV)
Holding Period (Months)
account_balance
Financing Cost
lien amount
lien amount percentage
Points
Interest Rate
Monthly Payment
Total Cost
beach_access
Holding Cost
Property Taxes
Principal & Interest
HOA/Condo Fees
Insurance Cost
Utility Cost
Gas
Water
Electricity
Misc Cost
shopping_cart
Buying Cost
Escrew/Atteroney/Misc
Title Insurance
Buying Record Fees
Home Warrenty
Realtor Fees
Misc Cost
monetization_on
Selling Cost
Escrew/Atteroney/Misc
Title Insurance
Selling Record Fees
Home Warrenty
Realtor Fees
Misc Cost
loop
Burrr and/or Rental
Down Payment
Purchase Price
Rehab Cost
ARV (After Repair Value)
Rent Monthly
Princitpal & Intr
Tax
Insurance
HOA
Mortagage Insurance
Mortagage Intr
Top
Property Snapshot
Deal Forcast
Yearly appreciation(%)
No of years
Profit
Purchase Deal Analysis & Analysis
ARV
Purchase Price
Total Rehab Cost
Total Financing Cost
Holding cost :
Buying cost :
Selling cost :
BRRRR & Rental Analysis
Equity :
Monthly Cash flow :
Yearly Cash flow :
1% Rule :
REI Metrics
Cap Rate :
COC-Return:
ROI:


For this rotation of the class, we were able to work with fusion 360 and the 3d printer and Fusion360 once again. After learning from my errors in the earlier weeks, I had an easier time creating things. One of the things that I was able to create was a bust of my head. I created this by taking a 3d scan of my face, and uploading that and a file of a pedestal to meshmixer.  I found this process super cool, as I saw how many things that could be made using a 3d scanner! I derfinitely want to explore into more creations that cn be made with that. However, the major difficulty that I experienced when creating this was scanning my head and face. You had to remain still during the scan, which was kind of hard for the first few times. Other errors that were made were due to the person taking the scan, as they missed various parts of my head. The second item that I created was a something more functional. I craeted a cup using my 3d printer that has so many uses! I currently use it to hold my makeup brushes, but it can also hold toothbrushes, pens and pencils, and other small objects such as coins. With this, I didn't have too much difficulty as I was more comfortable with designing on Fusion360.
Type in text here
Type Something About The Pictures (Images 1 and 2) | Type Something About The Pictures (Images 3 and 4)
More text here.
Type it here


{% extends 'base.html' %} {% load bootstrap3 %} {% block content %} Home District Needs and Collection Centers


About
Resume
Portfolio
Contact
Home
HTML
CSS
Sass
JS/jQuery
PHP/MySQL
SEO
Photoshop
Social Web
Resume
Portfolio
Contact
Home


Release notes: Open GEE 5.3.3¶
New Features
Ability to set default database from admin page. For 3D databases, there is an additional option in the publish dialog that allows the user to specify a database as the “default”. The “default” database will be served to the client if the server URL is specified without a database name.
getop can retrieve and display information while gesystemmanager is busy.
Previously, getop
could not display information while system manager
was in the middle of major calculations. Now, this restriction has been
removed for most calculations, such as when system manager is determining
which resources overlap.
Improved memory usage reporting for caches. The memory usage estimation for the asset and asset version caches has been improved and is much more accurate.
Optimized handling for task status updates. System manager’s performance while handling updates about running tasks has been improved. This update is experimental and can be enabled using the GraphOperations flag.
Use Python 2.7 with EL6-based operating systems. Change EL6 to use Python 2.7 from the SCL repositories in a virtual environment for increased security. EL7 and Ubuntu are unaffected.
Additional refactoring of auto-generated code. Move ReuseOrMakeAndUpdate and ReuseOrMakeAndUpdateSubAsset from auto-generated code to the storage manager.
Miscellaneous security updates. Security updates to prevent SQL injection attacks, buffer overflow attacks, and other potential risks.
Clarified and updated documentation. Update documentation. Updates were made for LDAP, for updated XMLparams changes, in the autogenerated code, and general clarifications made to existing documentation. Instructions also added for building on FIPS-enabled machines.
GraphOperations flag Improved ease of use of Portable for WMS clients. Accept col/row/level if x/y/z is missing in WMS request when serving portable globes.
Supported Platforms
The Open GEE 5.3.3 release is supported on 64-bit versions of the following operating systems:
- Red Hat Enterprise Linux version 6.x and 7.x, including the most recent security patches
- CentOS 6.x and 7.x
- Ubuntu 16.04 LTS
Google Earth Enterprise 5.3.3 is compatible with Google Earth Enterprise Client (EC) version 7.1.5 and above.
To upgrade from Open GEE 5.2.0, do NOT uninstall it. We recommend that you upgrade Open GEE 5.2.0 by simply installing Open GEE 5.3.3. Installing Open GEE 5.3.3 on top of Open GEE 5.2.0 will ensure that your PostgreSQL databases are backed up and upgraded correctly to the new PostgreSQL version used by Open GEE 5.3.3.
Resolved Issues
| Number | Description | Resolution |
|---|---|---|
| 1202 | Can’t select .KIP as source | Select ‘header.xml’ in .KIP directory to select .KIP |
| 1241 | geglxinfo should parse all meshes in terrain packets | geglxinfo will parse all meshes in terrain packets |
| 1511 | Missing Systemrc.h causes compiler error | Remove requirement for Systemrc.h |
| 1517 | geglxinfo should parse vector packets | geglxinfo will parse vector packets |
| 1530 | Cancel command is complicated | Simplify cancel command |
| 1532 | Supplemental search fields should be escaped for HTML when viewing on an HTML page | Escape supplemental search fields |
| 1538 | Code coverage builds incompatible with scons cache | Make code coverage builds compatible with scons cache |
| 1540 | Gradle wrapper is obsolete | Update gradle wrapper |
| 1552 | XML objects are not properly cleaned up | A memory management bug in XML processing was fixed, resulting in lower memory utilization and significantly improved performance. |
| 1561 | Unused REST end point in asset manager | Remove unused asset manager REST endpoint |
| 1564 | Apache does not build with crypto enabled | Apache builds with crypto enabled |
| 1572 | Unused directory | Remove obsolete directory |
| 1574 | Broken GLFS pointer for PyYAML tarball | Fix GLFS pointer for PyYAML tarball |
| 1577 | Use defusedxml in server code | Added defusedxml as a dependecy. Using defusedxml in place of PYTHON XML to improve security. |
| 1582 | Unit tests for asset version state calculation inaccurate | Fix asset version state calculation unit tests. |
| 1586 | Wrong permissions on download_tutorial.sh | Fix permissions issue on download_tutorial.sh |
| 1591 | New library defusedxml | License file for defusedxml added. |
| 1593 | Python dependency issues for Python 2.7 | Resolve Python dependency issues. |
| 1604 | WMS capability doesn’t work with reverse proxies | It now works, as long as the protocol (http vs https) matches |
Known Issues
| Number | Description | Resolution |
|---|---|---|
| 4 | Google basemap fails to load in 2D Mercator Maps | Obtain a valid Google Maps API key and include it in /opt/google/gehttpd/htdocs/maps/maps_google.html . |
| 8 | Ensure GEE Portable Cutter Job Completes | No current work around. |
| 9 | Improve FileUnpacker Handling of Invalid Files | No current work around. |
| 20 | Simplify build process for portable builds on MacOS | Building and running Portable Server on MacOS should be possible with minimal changes. |
| 34 | Scons build creates temporary directories named “0” | No current work around. |
| 126 | The Fusion installer creates a backup on the first run | No current work around. The created backup can be deleted. |
| 190 | Hostname mismatch check in installers doesn’t work as expected | No current work around. |
| 193 | Updated docs are not copied if the /tmp/fusion_os_install directory already exists |
Delete /tmp/fusion_os_install at the beginning of the stage_install build process. |
| 201 | Some tiles are displayed incorrectly in the Enterprise Client when terrain is enabled | No current work around. |
| 202 | Icons are not displayed on vector layers in the Enterprise Client | No current work around. It is not clear if this is an error in GEE or in the Enterprise Client. |
| 203 | Some vector layer options are not saved | No current work around. |
| 221 | The asset manager may display that a job is “Queued” when in fact the job is “Blocked” | No current work around. |
| 234 | Geserver raises error executing apache_logs.pyc | No current work around. |
| 254 | Automasking fails for images stored with UTM projection | Use GDAL to convert the images to a different projection before ingesting them into Fusion. |
| 269 | gevectorimport doesn’t crop features | Use GDAL/OGR to crop vector dataset before importing them using Fusion. |
| 295 | Fix buffer overflows and leaks in unit tests | No current work around. |
| 309 | Check for the FusionConnection before new asset is populated | Make sure that gefusion service is started. |
| 320 | The Portable Server web page uses obsolete REST calls | Do not use the buttons on the Portable Server web interface for adding remote servers or broadcasting to remote servers as these features are no longer supported. |
| 326 | Libraries may be loaded from the wrong directory | Delete any library versions that should not be loaded or use LD_LIBRARY_PATH to load libraries from
/opt/google/lib . |
| 340 | GE Fusion Terrain is black | No current work around. |
| 342 | Fusion crashes when opening an unsupported file type | Re-open Fusion and avoid opening unsupported file types. |
| 343 | gefusion: File ->open->*.kiasset*,*.ktasset*,*.kip does not work | kip is not a supported format. Void opening files with .kip extension. |
| 380 | Provider field in resource-view is blank | Open the individual resource to see the provider. |
| 401 | GEE commands are not in the path for sudo. | Specify the full path when running commands or add /opt/google/bin to the path for all users, including the super user. |
| 402 | Provider manager window locked to main window. | No current work around. |
| 403 | Missing Close button on system manager window in RHEL 7 | Right-click the title bar and select Close. |
| 404 | Opaque polygons in preview. | No current work around. |
| 405 | Vector layer preview not cleared in some situations | Reset the preview window to the correct state by either clicking on it or previewing another vector layer. |
| 407 | Corrupt data warning when starting Fusion | No current work around but Fusion loads and runs correctly. |
| 419 | Fix Fusion Graphics Acceleration in Ubuntu 14 Docker Container Hosted on Ubuntu 16 | No current work around. |
| 437 | Rebooting VM while it is building resources results in a corrupted XML | No current work around. |
| 439 | Uninstalling Fusion without stopping it results in unexpected error message | Ignore that error message. |
| 440 | Fuzzy imagery in historical imagery tests. | No current work around. |
| 442 | Multiple database pushes after upgrade don’t report a warning | No current work around. |
| 444 | Fusion installer does not upgrade the asset root on RHEL 7 | Upgrade the asset root manually by running the command that is printed when you try to start the Fusion service. |
| 445 | Path to tutorial source volume in gee_test instructions is different from path used in installers | Use /opt/google/share/tutorials . |
| 448 | Out of Memory issues | Use a system that has more than 4GB RAM. |
| 453 | Improve `check_server_processes_running` detection for uninstall | No current work around. |
| 456 | Inconsistent behavior of vector layers after upgrade | No current work around. |
| 460 | Possibility of seg fault in QDateWrapper | No current work around. |
| 474 | Running gee_check on some supported platforms reports that the platform is not supported | You can ignore the failed test if using a supported platform (Ubuntu 16.04, RHEL 7, and CentOS 7). |
| 477 | ‘service geserver stop/start/restart’ doesn’t work on Ubuntu 16.04 without a reboot | Reboot and try again. |
| 487 | gdal - python utilities do not recognize osgeo module | Install python-gdal . |
| 507 | Volume host is reported unavailable if `hostname` doesn’t match volume host | Set the host values in /gevol/assets/.config/volumes.xml to the FQDN and restart the Fusion service. |
| 557 | WMS service problem with ‘width’ & ‘height’ & ‘bbox’ | No current work around. |
| 569 | geserver service installation and uninstallation issues | Before uninstalling geserver verify if it’s running or not. |
| 590 | Maps API JaVaScRiPt Files Not Found | No current work around. |
| 594 | Save errors only reported for the first image | Close the form in question and try again. |
| 640 | Save button disabled in ‘Map Layer’ creation dialog when an error encountered | Close the resource form and open it again to make the save option available again. |
| 651 | Release executables and libraries depend on gtest | Follow current build instructions that requires gtest to be installed. |
| 669 | Missing repo in RHEL 7 build instructions | Enable rhel-7-server-optional-rpms and rhel-7-server-optional-source-rpms repos. |
| 686 | Scons fails to detect libpng library on CentOS 6 | Ensure that a default g++ compiler is installed. |
| 700 | Add EL6/EL7 check to RPMs | Make sure that RPMS are installed on same EL version that they were produced for. |
| 788 | Search fails after transferring and publishing a database using disconnected send from the command line | Re-publish the database from the web interface. |
| 825 | Geserver fails to start up fully due to conflicting protobuf library | Run pip uninstall protobuf to uninstall the protobuf library installed by pip. |


Aussie Tim Weeks in good spirits: Morrison
Australian academic Tim Weeks is in good spirits after being released by the Taliban in a prisoner swap, according to Prime Minister Scot Morrison.
Mr Weeks and his American colleague Kevin King were freed overnight, three years after they were abducted in Afghanistan.
The men have been flown out of the country by US officials and are undergoing medical checks.
"Tim is in a safe place, he's out, and he's coming home," Mr Morrison told reporters on Wednesday.
"We look forward to that very, very much."
The prime minister thanked the Afghan government and the United States for helping end "three years of absolute hell" for the two men.
"The fact that Tim and Mr King will be actually coming home to their respective countries is a great relief," Mr Morrison said.
"It just goes to show that if you stick at these things and you work at it quietly, you don't seek to showboat around this stuff, that you can get good outcomes for people.
"It's not always guaranteed, there are tremendous risks, and what has been able to be achieved here for Professor Weeks I think is just tremendous and I couldn't be more thrilled."
Foreign Minister Marise Payne spoke to Mr Weeks' family overnight and said they were extraordinarily relieved.
Mr Weeks is from Wagga Wagga in NSW, which is also home to Deputy Prime Minister Michael McCormack.
"I know all Wagga Wagga is celebrating today the freedom and the safety of Timothy Weeks," Mr McCormack said.
"Well done to everybody who helped make that happen."
Mr Weeks, 50, and Mr King, 63, who were grabbed outside the American University in Kabul in 2016, were freed in exchange for three members of the Taliban.
The people swap involved the release of Anas Haqqani, the younger brother of Sirajuddin Haqqani, who leads the Taliban's fearsome Haqqani network.
Anas Haqqani, along with an uncle, Hajji Malik Khan, and a Haqqani lieutenant, Hafiz Rashid Khan, were released by the Afghan government on Monday and flown to Qatar, where the extremist group has a political office.
Mr Weeks and his American colleague were handed over to US forces in southern Afghanistan and flown out of the country by chopper to receive medical care.
The Weeks family has asked for privacy.
"We are grateful for the efforts of the Australian government in securing Tim's release," they said in a statement.
"We would like to thank the United States government for the significant role it played in securing Tim's freedom and acknowledge the important contribution of the government of Afghanistan.
"We thank our friends and extended family for their love and support over the past three years during this very difficult time."
Labor's foreign affairs spokeswoman Penny Wong is relieved both Mr Weeks and Mr King have been released.
"We share the hope that this release will build positive momentum for meaningful dialogue and a durable peace in Afghanistan," she said.


(Originally published on OUBS Blog)

Corporate strategy signifies an overarching strategy, above and beyond that of one of the businesses of that corporation. The idea is to achieve superior returns through the combination of different businesses.

The book starts with a case on VWs acquisitions of Seat and Skoda and the potential benefits achieved through the integration and combination of those. For one, the company now has different brands in different market segments, but built on a standard platform to achieve economies of scale and scope. The problem that starts to appear is that the differentiation between the different brands is shrinking.

VW is saving some $500 million but this is only an advantage as long as Ford or Toyota cannot cut the costs the same amount.

All this combination stuff has come from portfolio management, which is about combining a portfolio of diversified strategic business units. Important here is also BCG’s growth-share matrix. The idea is to use internal cash flows for financing and manageing the cycle of declining businesses and growing ones. You take the stars, invest in them to make them cash cows which will provide the cash for the next stars.

The problem with portfolio management is that the only idea behind it is the management of cash flows. In the late 1980s, strategy moved back to focussing on core businesses. The thing is that in balancing cash cows and stars, the manager acts as the shareholder. The shareholder can do that himself though and it is sometimes unclear where the manager can add value or if the shareholder should not decide about his exposure to risk himself. Agency theory even suggests that portfolio diversification is bad for shareholders.

Now in the 1990s, strategy moved away from markets and more to capabilities though, which brings us to the notion of synergies.

The thing is that merely putting some companies in a portfolio does not add value, but synergy will need to be created, managed. The idea is to combine activities so that 2+2 = 5 (which can also fail and end up as 3 :)). The thing is that you need to clearly identify what the capabilities will be that will be needed for the synergies to work out.

Complementary benefits can be achieved through combination of physical assets for economies of scale, higher capacity utilisation and an improved product mix. Invisible assets may also be transfered from one business to another.

Itami (1992) suggested that there are combinatorial benefits, like opening a resort for the summer in a sky resort, and synergy which is multiplicative rather than additive, e.g. that by good reputation visitors in any season might come in the other too.

The thing is that some things are limited by some thing like for example capacity. Using a Plant that is used 70% more, can only lead to 100% usage, after that it is finished. This is also unlikely to be of lasting effect as other companies can do the same thing in the end. Invisible, information-based assets will likely remain unique to the company and will not run out or be exhausted.

Adding time to the mix brings you to static combination benefits, which are the integration of two strategies at one point in time and dynamic combination benefits, where they are integrated over time (e.g. reuse of extraction ptis as waste management depositories). Beyond that we come to dynamic synergy.

Prahalad and Hamel identify companies as collections of core competencies and core products. The thing is that core competencies do not diminish with use, as they put it. Rather, they are enhanced by use. In that sense, markets should be moved in that exploit an existing or develop a new competency. To test if these are core, as yourself: - do they provide potential access to many markets (is it transferable for combination benefits) - do they make a significant contribution to the perceived customer benefit of the end product - are they difficult to imitate

If all three fit, the source is likely to be dynamic. Theodore Levitt (1960) argued that many companies focus on their products instead on what the customer wants and one might even argue that they should relate their core competencies to that.

Honda for example did not exploit their products like VW but their core competencies by using the Honda brand across many different products that would not eat away each others profit margins.

Rumelt (1994) established four key components of core competence competition: - corporate span - temporal dominance (of products) - learning-by-doing (to enhance them) - competitive locus The thing is that superior corporate performance based on core competencies allows for dynamics.

Diversification and Divestment

There are two possibilities for superior performance, entering an attractive industry or possessing a competitive advantage. What are the motives for diversification in that light? - growth - investment risk-spreading - profitability (evaluated against Porter’s (1987) three tests for diversification value-creation)

Economies of scope are the main source of corporate superior performance as of Grant. These need to be more cheaply attained through internalising than out-sourcing (cost economics theory). There is a great figure (3.1) on page 9-26 to test for diversification strategies.

What if an activity does not work well, should it be divested or a recovery started? Kathy Harrigan (1988) sees declining industies as opportunities for end game strategies. In this game, you can either go for a quick sale, harvest it for cash, find a niche or go for leadership in which you believe that after the others leave, profitabilty will return.

Harrigan believes that companies either need to flee or fight. Grinyer et al. (1988) studied strategies with companies in delicne followed by dramatic and sustained improvement and found something they found sharpbenders. These will often have major management change, improved marketing, reduced production costs, improved quality and service.

Another usefulness of core competencies is that they allow you to see if you should divest and risk loosing that competency. Otherwise it might be wise to outsource.

Strategies for corporate structure

In Book 7 Alfred Chandler’s (1962) thesis was that ‘structure follow strategy’. Rumelt (1974) argued that for some ‘structure follows fashion’. Divisionalised structure was very in fashion until the 1970s, when the advantage of adopting it was removed as everybody was doing that. Corporate strategy as a management activity originated from the structure though.

The thing is that co-ordination and decentralisation are not easy to reconcile. Especially when leveraging invisible assets or core competencies, or at least trying too. You should also not forget the national interest and government policy when thinking about corporate strategy and the potential structure it entails or brings with it.

Chandler’s work (1962) was born out of the thesis that the devisionalised corporation evolved out of diversification and growth strategies of large enterprises. The thing is though that in different social and economic conditions things work very differently, which is examplified in a case about russias emerging conglomerate corporations. Here the setting that things were taking place in, needed some specific strategies which resulted in some specific structures.

This leads us to the idea that corporations need to understand values and norms behind competitors’ strategies. In the UK and USA there is a market oriented relationship between shareholders and corporations. In the Rhenish model banks play a more important role for long-term loan and equity, bringing more friendly capital and stability. In Japan, companies often have their origins in diversified, family-controlled zaibatsu merchant houses of the seventeenth century. Here the subsidiaries raise 49% of the cash needed for the company letting the family maintain control. These zaibatsu have evolved into keiretsu, involving interconnected members with support from keiretsu banks with interlocking minority shareholding.

You therefor need to understand regulation, government, socio-economics and cultural context to really see the structures in their full bloom.

Multidivisional structure removed the responsibility for the entire enterprise from routine operational tasks. Responsibility was often pushed down with minimal interconnections between different parts of the same corporation, with profit centers being decentralized resulting in less gains from scale and scope and less coherence of the corporation as a whole.

The thing is that if superior performance is about synergy and compination, then decentralisation might be a bad move. Management can managed the corporate portfolio, invididual business or internal linkages. This is not an easy dilemma and managers will always have to choose between centralisation or decentralisation and integration or independence and control or collaboration.

Networks and Corporations

One thing you can do is to accept this tension and get away from it (Sloan, 1963). In Japan instead of a formal hierarchy there are informal networks based on trust and relationships. A simple choice of make or buy is not enough here, even though the structures can be critized for less than free flow of information and capital in the general market.

Kay (1993) identified co-operative relational contracting as an alternative to classical or spot contracts. In Europe these might be: - network of italian suppliers for benetton - professional service firms who link complementary skills or locations

Four main drivers might encourage the formation of networks: - rising global competition - deepening industry convergence - battels over technical standards - positioning

In the end, we need to extend ‘make or buy’ to ‘make, buy or co-operate’. The corporate management needs to include network co-ordination then, co-ordinating joint decision-making. For alliances to fulfil their obligations Gomes-Cassares identified two main methods: - establishing group norms and standards - leadership in group decision-making (network leader or agreed compromise or consensus method)

The tighter the collaboration, the blurrier the boundary, the more the joined the firms are and the more will they put their economic weight into the battle as one unit.

Potential sources of advantage for networks come from: - flexible capabilities - specialisation and division of labour - learning - increased options

Remember though that networks are very complex, in itself and to be managed.


So, in essence, to get a TGT you need
1) correct time
2) username
3) key for username
4) name of DC / domain.
Ben's 'overpass the hash' method uses Mimikatz to set the hash/user/domain in memory on a Windows box. Then when you request a service using that credential, Windows will automagically ask for the TGT and any subsequent service tickets. Sometimes it is a bit fiddly to get the right Kerberos information to make it work since some places prefer to use the netbios name everywhere, but it's not too hard to figure out if you have enumerated the domain controllers.


HOME
SHOP
JOURNAL
ELEMENTS
PAGES
1 of 5
2 of 5
3 of 5
4 of 5
5 of 5
Home
About
Info
Contact
Show me more


Application
Pipeline Summary
Pipeline View
History
Info
Promote
Revoke
Approve
Upgrade
New
No Application Deployments Available
No Application Deployments Available
No Application Deployments Available


JavaScript compares differently to HTML and CSS as it is used for website functionality, this means it is able to process data and tells a page how to behave, where as HTML dictates structure, i.e. how the contents is divided, and CSS dictates style, i.e. how the page looks.
Explain control flow and loops using an example process from everyday life.Control flow is the order in which the computer executes statements. Loops offer a quick and easy way to do something repeatedly, changing the control flow of the code. An example of this in daily life would be the process of waking up.  However as we all know we like to snooze so sometimes when our alarm goes off we will snooze and go back to bed. A loop would then check that we haven't woken up and so the code to take a shower will not run until the condition of us waking up is met. If we are already awake when the alarm goes off the loop will not run at all as the condition has been met.
Explain the difference between accessing data from arrays and objectsThe difference between accessing data from arrays and objects is that data from an array can only be accessed through bracket notation where as data from an object can be accessed with bracket and dot notation. Also I think arrays are ordered so that you can only add/remove the first and last element where as you can add/remove or modify any property within an object as long as you know the property name.
Explain what functions are and why they are usefulFunctions are a way for us to give instructions to the computer more efficiently. Imagine us doing a daily task such as cooking. Our Ingredients(inputs) and meal(output) would differ but our method i.e. cook will be the same. Functions let us tell the computer to perform a set of instructions, without typing it over and over again, we just give it different inputs to get the corresponding output.


above |
K'un The Receptive, Earth |
|
below |
K'un The Receptive, Earth |
The Receptive brings about sublime success,
Furthering through the perseverance of a mare.
If the superior man undertakes something and tries to lead,
He goes astray;
But if he follows, he finds guidance.
It is favorable to find friends in the west and south,
To forego friends in the east and north.
Quiet perseverance brings good fortune.
The earth's condition is receptive devotion.
Thus the superior man who has breadth of character
Carries the outer world.
Six at the beginning means:
When there is hoarfrost underfoot,
Solid ice is not far off.
Six in the second place means:
Straight, square, great.
Without purpose,
Yet nothing remains unfurthered.
Six in the third place means:
Hidden lines.
One is able to remain persevering.
If by chance you are in the service of a king,
Seek not works, but bring to completion.
Six in the fourth place means:
A tied-up sack. No blame, no praise.
Six in the fifth place means:
A yellow lower garment brings supreme good fortune.
Six at the top means:
Dragons fight in the meadow.
Their blood is black and yellow.
When all the lines are sixes, it means:
Lasting perseverance furthers.


Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.The point of using is that it has. The point of using is that it has.The point of using is that it has.The point of using is that it has.The point of using is that it has.The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Reader will be distracted by the readable content of a page when looking at its layout. The point of using is that it has.
Distracted by the readable content of a page when looking at its layout. The point of using is that it has more normal.
Variations of passages of Lorem Ipsum available, but the majority suffered alteration in some form, by injected...
There are many variations passages of available, but the majority have suffered alteration in some form, injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of you need to be sure there isn't anything.
There are many variations passages of available, but the majority have suffered alteration in some form, injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of you need to be sure there isn't anything.
There are many variations passages of available, but the majority have suffered alteration in some form, injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of you need to be sure there isn't anything.
There are many variations passages of available, but the majority have suffered alteration in some form, injected humour, or randomised words which don't look even slightly believable. If you are going to use a passage of you need to be sure there isn't anything.


Bantayan Island is famous tourist destination in Visayas for its powdery white sand beach. Walking barefoot into the shallow waters or in the shore, you can feel the soft sand underneath. This beautiful beach is located in Cebu, Visayas, Philippines.
Bantayan Island boasts its powdery soft white sand beaches. The Island is located in Cebu which is divided into three municipalities namely Bantayan, Madredejos and Santa Fe. There are actually smaller islands near Bantayan Island and near them is a lane for ferries from Cebu to Manila. The nearby islands are inhabitable though.
Bantayan Island is famous for its soft white sand. When you walk barefoot to the sand of Bantayan Beach, you can actually feel the relaxing sand. Even if you walk into the shallow waters of the beach, its actually even softer. If you try to put handful sand, it’s like holding a baby powder. Okay I may be exaggerating a bit about that baby powder thing but you can put it that way.
Not just the white and soft powdery sand but you can actually appreciate the clear blue waters. If you want to swim and put your goggles on, you can actually appreciate the clear waters. Bantayan Island is unspoiled and clean.
From Manila, you can catch up a flight going to Cebu. So let’s assume you are in Cebu. From Cebu Mactan Airport (where you landed) you will take a taxi that will take you to Cebu Bus Terminal 2. From the Cebu Bus Terminal 2 take a bus ride going to Hagnaya Port. From the port, you will have to take a ferry to Bantayan Island, Santa Fe.
Please be reminded that the ferries travel schedule starts at 6:00 in the morning up to 5:00 in the afternoon. A ferry will leave every 1 and 30 minutes. The travel time to Bantayan Island may take 1 hour.


A SET consists of 3 cards in which each of the cards features, looked at one-by-one, are the same on each card, or, are different on each card. All of the features must separately satisfy this rule. In other words: shape must be either the same in all 3 cards, or different on each if the 3 cards; color must be either the same on all 3 cards, or different on each of the 3, etc. See Examples below.
All three cards have the same shape, the same color, the same number of symbols and they all have different shading.
All three cards have different shapes, different colors, and different numbers of symbols and they all have the same shading.
All three cards have different shapes, different colors, different numbers of symbols and different shadings.


Moscow Calls on US to Immediately Return Imprisoned Pilot Yaroshenko to Russia
VOLGOGRAD (Sputnik) - Moscow demands that the United States stop victimizing imprisoned pilot Konstantin Yaroshenko and return him to Russia, as he needs urgent medical care, Russian Foreign Ministry spokeswoman Maria Zakharova said Friday.
"We demand that the United States stop victimizing Konstantin Yaroshenko and return him home," Zakharova said.
"This is not about medical assistance that can be postponed or may not be so necessary, but it is about urgent medical care that needs to be provided to a person in this situation," she said.
On Monday, Yaroshenko's wife, Viktoria, said that the United States had turned down her husband’s appeal for transfer to his country of citizenship. She had previously said that her husband was suffering from severe arthritis and was not receiving the necessary medical care.
The Russian pilot was captured in Liberia in 2010 and was transferred to the United States without an official extradition procedure, prompting protests from Russia. In 2011, a US court sentenced him to 20 years in prison for allegedly conspiring to smuggle drugs, charges the Russian national denies.
In 2016, the New York Court of Appeals refused to revise Yaroshenko’s sentence.


{% extends "eu_elections_analytics/base.html" %} {% block content %}
European Conservatives and reformists (AECR)
Alliance of liberals and democrats of Europe (ALDE)
European People´s Party (EPP)
The Greens / European Free (Greens/EFA)
Europe for Freedom and Democracy (MELD)
European Left (PEL)
Socialists & Democrats (PES)


Pen it Down: Top Tips for Blogging
Let’s do begin from the scratch!
You might be a person with brainstorming ideas! You might know how to create a world of words with a mountain of implications concealed within! Are you an extraordinarily gifted person who can make marvelous magic moments with alphabets? Are you longing for a chance to unwrap your mind?
Just think of you making ventures and opportunities for the same! Sounds great, right?
Then why dawdle? It’s big-time to start penning on your new blog!
Here’s the Signboard
Begin with a well thought out blog topic. The niche is the blogger’s choice of course, but have due regard for your readers as well.
After choosing the right blogging platform, think of what Will Rogers has said, “You never get a second chance to make a first impression” and a good impression thus made can never be destroyed; so bear in mind how vital is the role played by your domain name. This step is followed by purchasing a Web Hosting Plan and installing Word Press. Based on your preferred layout and color scheme, design it captivatingly. Set your Blog and appropriate SEOs. Finally go ahead with your first post (Good luck, in advance!). But, it’s not the end! Don’t forget to boost your traffic and uphold your blog (make a good pep talk!)
 Then, besides the technical steps you followed (those already mentioned) be earnestly aware of something more.
On your blog, you can make announcements, discuss topics, explore ideas, and start discussions and whatnot. Blogs usually come up with the latest and rarest ideas. The benefit the blogger enjoys is that there’s no restraint to the layout, tone, or length of the content thus created. The blog owner can decide how to kick-start the new venture and what’s going to work best for the intended audience. In short, to a certain extent, the particular blog is solely the blogger’s individual property.
But, sincerely what must be the major concern of every blogger? It’s not only one’s passion for writing or simply the monetary benefits to be received; instead, you are supposed to take into account the reading community too.
Set your blogging goals and work consistently and diligently. Catch the eye and build a culture of inquisitiveness in your readers’ minds. Topics and your way of presentation matter the most. When it comes to the content, do not cling on to facts alone; or to put it simply, folks prefer fiction to facts or a combination of both; be informative as well as engaging. Keep in mind that, not the length, but rightness matters! Be brief and do not digress. Keep it simple, yet appealing. Keep the readers focused, the indispensable part of blogging!
Stay in tune! Be you! Keep up the tempo! Make a lasting impression!
Get your blog up and running!
Take it a doorway into building an asset for your future!
By –
Dawn Mariat Mathew
Tags: #blogging#writing #creative #notespickup, #notes, #trends
Leave a Suggestion


Micro Engine
Here are a few sample programs
*NEW 12-28-2021*
Sprite Editor
Breakout
Astroids
Micro Engine SoundFX


Skip to main content
What's New
Frequently Asked Questions
Complaints Procedure
Contact Us
Sitemap
Search
Home
Cymraeg
Contact HMRC
Help
Sign out


The process
object is a global object and can be accessed from anywhere.
It is an instance of EventEmitter.
Node will normally exit with a 0
status code when no more async
operations are pending. The following status codes are used in other
cases:
1
Uncaught Fatal Exception - There was an uncaught exception,
and it was not handled by a domain or an uncaughtException
event
handler.2
- Unused (reserved by Bash for builtin misuse)3
Internal JavaScript Parse Error - The JavaScript source code
internal in Node's bootstrapping process caused a parse error. This
is extremely rare, and generally can only happen during development
of Node itself.4
Internal JavaScript Evaluation Failure - The JavaScript
source code internal in Node's bootstrapping process failed to
return a function value when evaluated. This is extremely rare, and
generally can only happen during development of Node itself.5
Fatal Error - There was a fatal unrecoverable error in V8.
Typically a message will be printed to stderr with the prefix FATAL
ERROR
.6
Non-function Internal Exception Handler - There was an
uncaught exception, but the internal fatal exception handler
function was somehow set to a non-function, and could not be called.7
Internal Exception Handler Run-Time Failure - There was an
uncaught exception, and the internal fatal exception handler
function itself threw an error while attempting to handle it. This
can happen, for example, if a process.on('uncaughtException')
or
domain.on('error')
handler throws an error.8
- Unused. In previous versions of Node, exit code 8 sometimes
indicated an uncaught exception.9
- Invalid Argument - Either an unknown option was specified,
or an option requiring a value was provided without a value.10
Internal JavaScript Run-Time Failure - The JavaScript
source code internal in Node's bootstrapping process threw an error
when the bootstrapping function was called. This is extremely rare,
and generally can only happen during development of Node itself.12
Invalid Debug Argument - The --debug
and/or --debug-brk
options were set, but an invalid port number was chosen.>128
Signal Exits - If Node receives a fatal signal such as
SIGKILL
or SIGHUP
, then its exit code will be 128
plus the
value of the signal code. This is a standard Unix practice, since
exit codes are defined to be 7-bit integers, and signal exits set
the high-order bit, and then contain the value of the signal code.Emitted when the process is about to exit. There is no way to prevent the
exiting of the event loop at this point, and once all exit
listeners have
finished running the process will exit. Therefore you must only perform
synchronous operations in this handler. This is a good hook to perform
checks on the module's state (like for unit tests). The callback takes one
argument, the code the process is exiting with.
Example of listening for exit
:
process.on('exit', function(code) {
// do *NOT* do this
setTimeout(function() {
console.log('This will not run');
}, 0);
console.log('About to exit with code:', code);
});
This event is emitted when node empties it's event loop and has nothing else to schedule. Normally, node exits when there is no work scheduled, but a listener for 'beforeExit' can make asynchronous calls, and cause node to continue.
'beforeExit' is not emitted for conditions causing explicit termination, such as
process.exit()
or uncaught exceptions, and should not be used as an
alternative to the 'exit' event unless the intention is to schedule more work.
Emitted when an exception bubbles all the way back to the event loop. If a listener is added for this exception, the default action (which is to print a stack trace and exit) will not occur.
Example of listening for uncaughtException
:
process.on('uncaughtException', function(err) {
console.log('Caught exception: ' + err);
});
setTimeout(function() {
console.log('This will still run.');
}, 500);
// Intentionally cause an exception, but don't catch it.
nonexistentFunc();
console.log('This will not run.');
Note that uncaughtException
is a very crude mechanism for exception
handling.
Don't use it, use domains instead. If you do use it, restart your application after every unhandled exception!
Do not use it as the node.js equivalent of On Error Resume Next
. An
unhandled exception means your application - and by extension node.js itself -
is in an undefined state. Blindly resuming means anything could happen.
Think of resuming as pulling the power cord when you are upgrading your system. Nine out of ten times nothing happens - but the 10th time, your system is bust.
You have been warned.
Emitted when the processes receives a signal. See sigaction(2) for a list of standard POSIX signal names such as SIGINT, SIGHUP, etc.
Example of listening for SIGINT
:
// Start reading from stdin so we don't exit.
process.stdin.resume();
process.on('SIGINT', function() {
console.log('Got SIGINT. Press Control-D to exit.');
});
An easy way to send the SIGINT
signal is with Control-C
in most terminal
programs.
Note:
SIGUSR1
is reserved by node.js to start the debugger. It's possible to
install a listener but that won't stop the debugger from starting.SIGTERM
and SIGINT
have default handlers on non-Windows platforms that resets
the terminal mode before exiting with code 128 + signal number
. If one of
these signals has a listener installed, its default behaviour will be removed
(node will no longer exit).SIGPIPE
is ignored by default, it can have a listener installed.SIGHUP
is generated on Windows when the console window is closed, and on other
platforms under various similar conditions, see signal(7). It can have a
listener installed, however node will be unconditionally terminated by Windows
about 10 seconds later. On non-Windows platforms, the default behaviour of
SIGHUP
is to terminate node, but once a listener has been installed its
default behaviour will be removed.SIGTERM
is not supported on Windows, it can be listened on.SIGINT
from the terminal is supported on all platforms, and can usually be
generated with CTRL+C
(though this may be configurable). It is not generated
when terminal raw mode is enabled.SIGBREAK
is delivered on Windows when CTRL+BREAK
is pressed, on non-Windows
platforms it can be listened on, but there is no way to send or generate it.SIGWINCH
is delivered when the console has been resized. On Windows, this will
only happen on write to the console when the cursor is being moved, or when a
readable tty is used in raw mode.SIGKILL
cannot have a listener installed, it will unconditionally terminate
node on all platforms.SIGSTOP
cannot have a listener installed.Note that Windows does not support sending Signals, but node offers some
emulation with process.kill()
, and child_process.kill()
:
0
can be used to search for the existence of a processSIGINT
, SIGTERM
, and SIGKILL
cause the unconditional exit of the
target process.A Writable Stream
to stdout
.
Example: the definition of console.log
console.log = function(d) {
process.stdout.write(d + '\n');
};
process.stderr
and process.stdout
are unlike other streams in Node in
that writes to them are usually blocking.
To check if Node is being run in a TTY context, read the isTTY
property
on process.stderr
, process.stdout
, or process.stdin
:
$ node -p "Boolean(process.stdin.isTTY)"
true
$ echo "foo" | node -p "Boolean(process.stdin.isTTY)"
false
$ node -p "Boolean(process.stdout.isTTY)"
true
$ node -p "Boolean(process.stdout.isTTY)" | cat
false
See the tty docs for more information.
A writable stream to stderr.
process.stderr
and process.stdout
are unlike other streams in Node in
that writes to them are usually blocking.
A Readable Stream
for stdin.
Example of opening standard input and listening for both events:
process.stdin.setEncoding('utf8');
process.stdin.on('readable', function(chunk) {
var chunk = process.stdin.read();
if (chunk !== null) {
process.stdout.write('data: ' + chunk);
}
});
process.stdin.on('end', function() {
process.stdout.write('end');
});
As a Stream, process.stdin
can also be used in "old" mode that is compatible
with scripts written for node prior v0.10.
For more information see
Stream compatibility.
In "old" Streams mode the stdin stream is paused by default, so one
must call process.stdin.resume()
to read from it. Note also that calling
process.stdin.resume()
itself would switch stream to "old" mode.
If you are starting a new project you should prefer a more recent "new" Streams mode over "old" one.
An array containing the command line arguments. The first element will be 'node', the second element will be the name of the JavaScript file. The next elements will be any additional command line arguments.
// print process.argv
process.argv.forEach(function(val, index, array) {
console.log(index + ': ' + val);
});
This will generate:
$ node process-2.js one two=three four
0: node
1: /Users/mjr/work/node/process-2.js
2: one
3: two=three
4: four
This is the absolute pathname of the executable that started the process.
Example:
/usr/local/bin/node
This is the set of node-specific command line options from the
executable that started the process. These options do not show up in
process.argv
, and do not include the node executable, the name of
the script, or any options following the script name. These options
are useful in order to spawn child processes with the same execution
environment as the parent.
Example:
$ node --harmony script.js --version
results in process.execArgv:
['--harmony']
and process.argv:
['/usr/local/bin/node', 'script.js', '--version']
This causes node to emit an abort. This will cause node to exit and generate a core file.
Changes the current working directory of the process or throws an exception if that fails.
console.log('Starting directory: ' + process.cwd());
try {
process.chdir('/tmp');
console.log('New directory: ' + process.cwd());
}
catch (err) {
console.log('chdir: ' + err);
}
Returns the current working directory of the process.
console.log('Current directory: ' + process.cwd());
An object containing the user environment. See environ(7).
Ends the process with the specified code
. If omitted, exit uses the
'success' code 0
.
To exit with a 'failure' code:
process.exit(1);
The shell that executed node should see the exit code as 1.
A number which will be the process exit code, when the process either
exits gracefully, or is exited via process.exit()
without specifying
a code.
Specifying a code to process.exit(code)
will override any previous
setting of process.exitCode
.
Note: this function is only available on POSIX platforms (i.e. not Windows, Android)
Gets the group identity of the process. (See getgid(2).) This is the numerical group id, not the group name.
if (process.getgid) {
console.log('Current gid: ' + process.getgid());
}
Note: this function is only available on POSIX platforms (i.e. not Windows, Android)
Sets the group identity of the process. (See setgid(2).) This accepts either a numerical ID or a groupname string. If a groupname is specified, this method blocks while resolving it to a numerical ID.
if (process.getgid && process.setgid) {
console.log('Current gid: ' + process.getgid());
try {
process.setgid(501);
console.log('New gid: ' + process.getgid());
}
catch (err) {
console.log('Failed to set gid: ' + err);
}
}
Note: this function is only available on POSIX platforms (i.e. not Windows, Android)
Gets the user identity of the process. (See getuid(2).) This is the numerical userid, not the username.
if (process.getuid) {
console.log('Current uid: ' + process.getuid());
}
Note: this function is only available on POSIX platforms (i.e. not Windows, Android)
Sets the user identity of the process. (See setuid(2).) This accepts either a numerical ID or a username string. If a username is specified, this method blocks while resolving it to a numerical ID.
if (process.getuid && process.setuid) {
console.log('Current uid: ' + process.getuid());
try {
process.setuid(501);
console.log('New uid: ' + process.getuid());
}
catch (err) {
console.log('Failed to set uid: ' + err);
}
}
Note: this function is only available on POSIX platforms (i.e. not Windows, Android)
Returns an array with the supplementary group IDs. POSIX leaves it unspecified if the effective group ID is included but node.js ensures it always is.
Note: this function is only available on POSIX platforms (i.e. not Windows, Android)
Sets the supplementary group IDs. This is a privileged operation, meaning you need to be root or have the CAP_SETGID capability.
The list can contain group IDs, group names or both.
Note: this function is only available on POSIX platforms (i.e. not Windows, Android)
Reads /etc/group and initializes the group access list, using all groups of which the user is a member. This is a privileged operation, meaning you need to be root or have the CAP_SETGID capability.
user
is a user name or user ID. extra_group
is a group name or group ID.
Some care needs to be taken when dropping privileges. Example:
console.log(process.getgroups()); // [ 0 ]
process.initgroups('bnoordhuis', 1000); // switch user
console.log(process.getgroups()); // [ 27, 30, 46, 1000, 0 ]
process.setgid(1000); // drop root gid
console.log(process.getgroups()); // [ 27, 30, 46, 1000 ]
A compiled-in property that exposes NODE_VERSION
.
console.log('Version: ' + process.version);
A property exposing version strings of node and its dependencies.
console.log(process.versions);
Will print something like:
{ http_parser: '1.0',
node: '0.10.4',
v8: '<IP_ADDRESS>',
ares: '1.9.0-DEV',
uv: '0.10.3',
zlib: '1.2.3',
modules: '11',
openssl: '1.0.1e' }
An Object containing the JavaScript representation of the configure options
that were used to compile the current node executable. This is the same as
the "config.gypi" file that was produced when running the ./configure
script.
An example of the possible output looks like:
{ target_defaults:
{ cflags: [],
default_configuration: 'Release',
defines: [],
include_dirs: [],
libraries: [] },
variables:
{ host_arch: 'x64',
node_install_npm: 'true',
node_prefix: '',
node_shared_cares: 'false',
node_shared_http_parser: 'false',
node_shared_libuv: 'false',
node_shared_v8: 'false',
node_shared_zlib: 'false',
node_use_dtrace: 'false',
node_use_openssl: 'true',
node_shared_openssl: 'false',
strict_aliasing: 'true',
target_arch: 'x64',
v8_use_snapshot: 'true' } }
Send a signal to a process. pid
is the process id and signal
is the
string describing the signal to send. Signal names are strings like
'SIGINT' or 'SIGHUP'. If omitted, the signal will be 'SIGTERM'.
See Signal Events and kill(2) for more information.
Will throw an error if target does not exist, and as a special case, a signal of
0
can be used to test for the existence of a process.
Note that just because the name of this function is process.kill
, it is
really just a signal sender, like the kill
system call. The signal sent
may do something other than kill the target process.
Example of sending a signal to yourself:
process.on('SIGHUP', function() {
console.log('Got SIGHUP signal.');
});
setTimeout(function() {
console.log('Exiting.');
process.exit(0);
}, 100);
process.kill(process.pid, 'SIGHUP');
Note: When SIGUSR1 is received by Node.js it starts the debugger, see Signal Events.
The PID of the process.
console.log('This process is pid ' + process.pid);
Getter/setter to set what is displayed in 'ps'.
When used as a setter, the maximum length is platform-specific and probably short.
On Linux and OS X, it's limited to the size of the binary name plus the length of the command line arguments because it overwrites the argv memory.
v0.8 allowed for longer process title strings by also overwriting the environ memory but that was potentially insecure/confusing in some (rather obscure) cases.
What processor architecture you're running on: 'arm'
, 'ia32'
, or 'x64'
.
console.log('This processor architecture is ' + process.arch);
What platform you're running on:
'darwin'
, 'freebsd'
, 'linux'
, 'sunos'
or 'win32'
console.log('This platform is ' + process.platform);
Returns an object describing the memory usage of the Node process measured in bytes.
var util = require('util');
console.log(util.inspect(process.memoryUsage()));
This will generate:
{ rss: 4935680,
heapTotal: 1826816,
heapUsed: 650472 }
heapTotal
and heapUsed
refer to V8's memory usage.
callback
{Function}Once the current event loop turn runs to completion, call the callback function.
This is not a simple alias to setTimeout(fn, 0)
, it's much more
efficient. It runs before any additional I/O events (including
timers) fire in subsequent ticks of the event loop.
console.log('start');
process.nextTick(function() {
console.log('nextTick callback');
});
console.log('scheduled');
// Output:
// start
// scheduled
// nextTick callback
This is important in developing APIs where you want to give the user the chance to assign event handlers after an object has been constructed, but before any I/O has occurred.
function MyThing(options) {
this.setupOptions(options);
process.nextTick(function() {
this.startDoingStuff();
}.bind(this));
}
var thing = new MyThing();
thing.getReadyForStuff();
// thing.startDoingStuff() gets called now, not before.
It is very important for APIs to be either 100% synchronous or 100% asynchronous. Consider this example:
// WARNING! DO NOT USE! BAD UNSAFE HAZARD!
function maybeSync(arg, cb) {
if (arg) {
cb();
return;
}
fs.stat('file', cb);
}
This API is hazardous. If you do this:
maybeSync(true, function() {
foo();
});
bar();
then it's not clear whether foo()
or bar()
will be called first.
This approach is much better:
function definitelyAsync(arg, cb) {
if (arg) {
process.nextTick(cb);
return;
}
fs.stat('file', cb);
}
Note: the nextTick queue is completely drained on each pass of the
event loop before additional I/O is processed. As a result,
recursively setting nextTick callbacks will block any I/O from
happening, just like a while(true);
loop.
Sets or reads the process's file mode creation mask. Child processes inherit
the mask from the parent process. Returns the old mask if mask
argument is
given, otherwise returns the current mask.
var oldmask, newmask = 0644;
oldmask = process.umask(newmask);
console.log('Changed umask from: ' + oldmask.toString(8) +
' to ' + newmask.toString(8));
Number of seconds Node has been running.
Returns the current high-resolution real time in a [seconds, nanoseconds]
tuple Array. It is relative to an arbitrary time in the past. It is not
related to the time of day and therefore not subject to clock drift. The
primary use is for measuring performance between intervals.
You may pass in the result of a previous call to process.hrtime()
to get
a diff reading, useful for benchmarks and measuring intervals:
var time = process.hrtime();
// [ 1800216, 25 ]
setTimeout(function() {
var diff = process.hrtime(time);
// [ 1, 552 ]
console.log('benchmark took %d nanoseconds', diff[0] * 1e9 + diff[1]);
// benchmark took<PHONE_NUMBER> nanoseconds
}, 1000);


Chess Openings Explained
Looking for simple solutions to your opening problems? Grandmaster Eugene Perelshteyn shares critical developments from his classic series for both White and Black, Chess Openings, Explained. For just the price of a cup of coffee a month, you can boost your chess GM-style on the interactive platform ChessOpeningsExplained.com!
For all Pittsburgh Pawngrabbers fans, use the discount code ELITE to save 50% off on annual memberships this season!