Monday, April 24, 2017
Sunday, April 23, 2017
Wednesday, April 19, 2017
Tuesday, April 18, 2017
What is the difference between public and private IP ?
What is public IP address?
- A public IP address is the address that is assigned to a computing device to allow direct access over the Internet.
- A web server, email server and any server device directly accessible from the Internet are candidate for a public IP address.
- A public IP address is globally unique, and can only be assigned to a unique device.
Monday, April 17, 2017
New concepts in Redux
Reducers are functions that take the current state in an action and returns the new state
Containers are react components that are user specific.Container component contains the necessary logic for marshaling data and actions which they pass to dumb components through props. These clear separation helps to keep it simple
Immutability Redux store are immutable
Containers are react components that are user specific.Container component contains the necessary logic for marshaling data and actions which they pass to dumb components through props. These clear separation helps to keep it simple
Immutability Redux store are immutable
Sunday, April 16, 2017
Friday, April 14, 2017
Charlies angles for declaring variables in ES6
All these days we were able to use only var for declaring variables. Now we have the charlies angles options for declaring variables . What I mean is we have three ways of declaring variables.
Previously we had only 2 scopes. function scope and global scope. global scope is assigned if we do not declare var
Thursday, April 13, 2017
Resources in REST
- Client consumes servers capability by interacting with resources
- Resources are identified by a resource identifier.In http terms this is an URL
- Client interacts with resources the client does not work directly with the resources but with representations of those resources
Example Person can be identified by name. We directly do not work with the Person by representation of person using JSON or XML. The message should also contain meta data about what to do with the services
Wednesday, April 12, 2017
How do I reverse integer array?
To reverse an integer array we swap items until we reach the midpoint as shown below
public int [] ReverseIntArray() { int[] arr = { 1, 5, 20 }; for(int i= 0;i< (arr.Length)/2;i++) { int temp = arr[i]; //Keep traversing from last arr[i] = arr[arr.Length - 1-i]; arr[arr.Length - 1 - i] = temp; } return arr; }
Avoiding global scope in java script
Why global variables are bad?
- The primary reason why we need to avoid global scope is because all code share a single global namespace.
- JavaScript implied global namespace. i.e variables that are not explicitly not described in local scope are automatically added to global namespace
- Relying on this might result in collision between various scripts on the same page
- JavaScript does not have the concept of function overloading
String Manipulation ( Change first letter to Uppercase )
Angular function for converting the first letter to uppercase
firstNameToUpperCase(value:string){ //Check if the value exists if(value.length > 0) { //Fetch the first character and turn it into upper and leave the rest this.userModel.firstName=value.charAt(0).toUpperCase() + value.slice(1); } else { this.userModel.firstName=value; } }
HATEOAS on REST
HATEOAS, an abbreviation for Hypermedia As The Engine Of Application State, is a constraint of the REST application architecture that distinguishes it from most other network application architectures. The principle is that a client interacts with a network application entirely through hypermedia provided dynamically by application servers. A REST client needs no prior knowledge about how to interact with any particular application or server beyond a generic understanding of hypermedia. By contrast, in some service-oriented architectures (SOA), clients and servers interact through a fixed interface shared through documentation or an interface description language (IDL).
The HATEOAS constraint decouples client and server in a way that allows the server functionality to evolve independently.
Quick reference for Angular 2 changes
Changes in Angular 2 compared to angular 1
- Ngref= href property binding. Browser module has definition to *ngref. Any directive that changes the directive is known as structural directive
*ngFor - No watchers and No digest cycle
- Binding syntax has been changed
- Property binding is done using [ ]
Tuesday, April 11, 2017
Reverse a string containing Japaneese and chinese characters
Problem statement: We need to reverse the sentence containing Japanese and Chinese character.
Ex "ABCabcDEFdef . Here we need to assume that the capital letters are Japanese and smaller letters are Chinese.
We need to get an o/p as "defDEFabcABC"
Steps involved
- Write function to identify if the character is Chinese or Japanese character
- Check if previous character is different than the current. If it is different then add a space
- Use split and then reverse the string
- Remove the empty space
Comparison backbone vs ember, knockout vs ember, ember vs angular 1
Comparing backbone vs Ember is not fair
Backbone
- Small set of library sit on top of jquery
- We need to write own abstractions to sit on backbones core part
- Uses collections and models
- Does not try to abstract everything away rather it leaves to us
- Developer who does not mind writing code his way this is a fine choice
Ember
- If we do not want every single detail in your application focus solving the problem on hand instead how you solve Ember is a good choice
Big O notation
- Big O notation is the language we use for articulating how long an algorithm takes to run. It's how we compare the efficiency of different approaches to a problem.
- With big O notation we express the runtime in terms of—brace yourself—how quickly it grows relative to the input, as the input gets arbitrarily large.
Subscribe to:
Posts (Atom)
Labels
- Algorithms (52)
- Apache Kafka (7)
- Apache Spark (21)
- Architecture (8)
- Arrays (23)
- Big Data (98)
- Cloud services (6)
- Cognitive technologies (12)
- Data Analytics (3)
- Data Science (6)
- Design (1)
- devOps (1)
- Hadoop (26)
- Hive (11)
- Java (2)
- JavaScript (65)
- JavaScript Run-time (12)
- Machine learning (11)
- Maths (6)
- mongoDb (2)
- MySQL (1)
- Networking (3)
- No SQL (2)
- Node (20)
- Python (28)
- Security (4)
- Spark Grpahx (1)
- Spark MLlib (1)
- Spark Sql (3)
- Spark Streaming (4)
- SQL (40)
- Sqoop (2)
- ssis (3)
- Strings (13)