Process Object

The process object is available globally meaning that it can be accessed from anywhere in the code. It allows us to fetch information regarding the current process instance; information such as environmental variables, path, stdin, and stdout.

console.log(process.argv);

Save this code as processdemo.js. To run:

$ node processdemo.js

This code outputs the parameters used when the process starts. It's output is as follows:

Node Package Manager

Node Package Manager (npm) comes bundled with Node. It allows you do search Node repositories for packages and modules. Anything that is searchable on search.nodejs.org is also searchable by npm. npm can be used to install Node packages on your system. It also performs version and dependency management for all Node packages installing on your system. To find out the version of npm you are using, simply type the following command

$ npm --version
2.15.9

To upgrade you npm,

Node.js

Node is an open source runtime environment for server-side applications. It allows you to run JavaScript on the server in addition to the browser. Almost all of the new and most widely used JavaScript solutions use Node in one form or another.

Installing Node.js

Download from https://nodejs.org. Install with default options. To check, type the following on the terminal

What is Caching

A cache is a temporary data store that usually contains pre-computed data. The purpose of a cache is to provide the data the next time someone asks for it without having to re-compute the data. For example, your website needs to run a complex query to fetch results of a user request. A complex query takes time to run and uses the system's resources for the query to run. Every time someone click on a link, this query needs to run. However, if you cache the results, you can simple provide results from the cache rather than having to re-query the data.

Quick Introduction to Google Cloud

Google Cloud Platform (GCP) offers many services. They can loosely be classified as:

  • compute services
  • storage services
  • big data services
  • identity and security services
  • management tools
  • developer tools
  • other services

Compute services includes virtual machines, containers, and functions.

Storage services allow storage of files, archival storage, and persistence data. Data services include NoSQL, RDBMS, Hadoop and Spark.

Quick Introduction to Amazon Cloud

Amazon uses Amazon Elastic Cloud Compute (EC2) for provide cloud services. Following are some characteristics of EC2

Elastic IP

Servers are accessed through IP addresses. In the cloud, we spin up new virtual servers on the fly. To efficiently deal with these changes, elastic IPs are used. They are not dynamic addresses assigned to your account. Servers on the cloud are accessed through these elastic IP addresses.

Quick Introduction to Cloud

Cloud refers to hosted services over the Internet. For example, Google Drive and GoogleDocs are cloud services. Google Drive allows you to save your files on their hardware. GoogleDocs is a collection of software (word processor, spreadsheet, etc.) hosted on Google's servers. The software resided on Google's hardware and uses their memory and CPU. You access it through the Internet. The are three category of cloud services:

Python3 Basics

Variables

See the following program. Save as datatype.py:

a = 100    # integer
b = 1.23   # float
c = "python"    # string

# print variables
print(a)
print(b)
print(c)

# convert int to float
print(float(100))         

# convert float to int
print(int(3.14))

# convert string to int
d = "12"
e = "12.3"
print(int(d))
# print(int(e)) - this will generate an error

# convert string to float
print(float(d))
print(float(e))

# convert int to string
f = str(12)
print(type(f))

To run

Pages