Saturday, October 28, 2017

TypeScript from Microsoft

to install Type script

npm install -g typescript

to check the version
tsc -v


What is typescript
a. Created by Microsoft in 2011
b. It is a superset of Javascript
c. It helps to generate most optimized javascript code
d. It is typesafe (where we have datatypes)
e. No compile time error in javascript , but do exists in typescript
f. Transpilation is the process for converting ts to js
g. Easy to upgrade the js version, if we have written our code using Typescript

The files are saved with extension of  "*.ts"

To compile the typescript to javascript
tsc <<typescript filename>>


We have datatypes in Typescript

String or string
boolean or Boolean
Date
uniontypes --> So the variable can hold multiple datatypes
let empid: String | number;
empid = 10;
empid = "emp10";
any --> The variable can store any datatye value like strinh, number,date,array,json etc.
Generic --> To have a same datatype to be stored in an array


javascript version is called ECMAScript5 and EcmaScript6.

Variable in typescript need to be declared using the keyword let

let name:string = "Pavan"

Loop

forEach --> to loop an array we use this

Eg:

let departments : Array<string> = new Array<string>();

departments.push('IT');
departments.push('Marketing');

departments.forEach(function(dept){
console.log(dept);
});


for -of  --> to loop an array we use this

Eg:

let department : Array<any> = new Array<any>();

department.push('IT');
department.push(10);

for(let dept of department){
console.log(dept);
}

For-in --> to loop an array and we will get the index position

Eg:

let departments : Array<string> = new Array<string>();

departments.push('IT');
departments.push('Marketing');

for(let dept in departments){
console.log(dept);
}


Arrow function or Lamda expression (=>)
To have the function in one line we will use it

let students : Array<string> = new Array<string>();

students.push('Pavan');
students.push('Kumar');

students.forEach((student) => console.log(student));





IIFE --> Immediate invoke function Expression
Anonymous function

Class is defined like other OOP languages

constructor()


Angular js

ng-model="tutorialObject.firstName"

scaffolding --> A empty project with necessary directory or files for a project will be created .

Sunday, October 15, 2017

Ubtunu

to know about the different network options in virtualbox

http://www.virtualbox.org/manual/ch06.html
To search for a package

To have the full screen in virtualbox for ubtunu

You need to install the Guest Additions go to devices menu > select "install guest additions" after installation restart virtual system now select view menu and click "switch to full screen

To have the camera to be used in Virtualbox

a. install a extension from virtual box (VirtualBox 5.1.10 Oracle VM VirtualBox Extension Pack)
b. Bring up the main VBox window and in the details tab for your machine click USB.
c. Make sure "Enable USB Controller" is selected. Also make sure that "Enable USB 2.0 (EHCI) Controller" is selected too



sudo apt-cache search openjdk

java  installation in ubtunu

$ sudo apt-get install openjdk-7-jre

$ sudo apt-get install openjdk-7-jdk

To know the default shell

echo $SHELL or printenv SHELL
echo $PATH   or printenv PATH

To know the exe location

which java
/usr/bin/java

To install ssh

sudo apt-get install openssh-server

To restart SSH

sudo service ssh restart

https://help.ubuntu.com/10.04/serverguide/openssh-server.html

Directory structure explanation in Linux
http://linuxcommand.org/lts0040.php

For awk and Grep
http://www.grymoire.com/Unix/Awk.html
http://www.theunixschool.com/2012/06/awk-10-examples-to-group-data-in-csv-or.html

To set environment variables
To set JAVA_HOME environment variable, do the following:
  1. Launch Terminal by pressing Ctrl+Alt+T on your keyboard.
  2. Enter the following command:
    $ gksudo gedit /etc/environment
  3. Depending on where you installed your Java, you will need to provide the full path. For this example, I installed Oracle JDK 7 in the /usr/lib/jvm/java-7-oracle directory.
    Scroll to the end of the file and enter the following:
    JAVA_HOME=/usr/lib/jvm/java-7-oracle
    export JAVA_HOME
  4. Save your file and exit gedit.
  5. Lastly, reload the system PATH with the following command:
    $ . /etc/environment
The above method will save you the hassle in having to run the commands every time you log in to your computer.


To update/upgrade ubtunu from terminal

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
To upgrade from 16.10 to 17.4 we can use the below comamnd 
 sudo apt update && sudo apt dist-upgrade
To install maven

Step 1 : apt-cache search maven
Step 2: sudo apt-get install maven
Step 3: mvn -version
To get the file from internet in Ubtunu

command : wget



Directory Description
/ The root directory where the file system begins. In most cases the root directory only contains subdirectories.
/boot This is where the Linux kernel and boot loader files are kept. The kernel is a file called vmlinuz.
/etc The /etc directory contains the configuration files for the system. All of the files in /etc should be text files. Points of interest:
/etc/passwd
The passwd file contains the essential information for each user. It is here that users are defined.
/etc/fstab
The fstab file contains a table of devices that get mounted when your system boots. This file defines your disk drives.
/etc/hosts
This file lists the network host names and IP addresses that are intrinsically known to the system.
/etc/init.d
This directory contains the scripts that start various system services typically at boot time.
/bin, /usr/bin These two directories contain most of the programs for the system. The /bin directory has the essential programs that the system requires to operate, while /usr/bin contains applications for the system's users.
/sbin, /usr/sbin The sbin directories contain programs for system administration, mostly for use by the superuser.
/usr The /usr directory contains a variety of things that support user applications. Some highlights:
/usr/share/X11
Support files for the X Windows system
/usr/share/dict
Dictionaries for the spelling checker. Bet you didn't know that Linux had a spelling checker. See look and ispell.
/usr/share/doc
Various documentation files in a variety of formats.
/usr/share/man
The man pages are kept here.
/usr/src
Source code files. If you installed the kernel source code package, you will find the entire Linux kernel source code here.
/usr/local /usr/local and its subdirectories are used for the installation of software and other files for use on the local machine. What this really means is that software that is not part of the official distribution (which usually goes in /usr/bin) goes here.

When you find interesting programs to install on your system, they should be installed in one of the /usr/local directories. Most often, the directory of choice is /usr/local/bin.
/var The /var directory contains files that change as the system is running. This includes:
/var/log
Directory that contains log files. These are updated as the system runs. You should view the files in this directory from time to time, to monitor the health of your system.
/var/spool
This directory is used to hold files that are queued for some process, such as mail messages and print jobs. When a user's mail first arrives on the local system (assuming you have local mail), the messages are first stored in /var/spool/mail
/lib The shared libraries (similar to DLLs in that other operating system) are kept here.
/home /home is where users keep their personal work. In general, this is the only place users are allowed to write files. This keeps things nice and clean :-)
/root This is the superuser's home directory.
/tmp /tmp is a directory in which programs can write their temporary files.
/dev The /dev directory is a special directory, since it does not really contain files in the usual sense. Rather, it contains devices that are available to the system. In Linux (like Unix), devices are treated like files. You can read and write devices as though they were files. For example /dev/fd0 is the first floppy disk drive, /dev/sda (/dev/hda on older systems) is the first IDE hard drive. All the devices that the kernel understands are represented here.
/proc The /proc directory is also special. This directory does not contain files. In fact, this directory does not really exist at all. It is entirely virtual. The /proc directory contains little peep holes into the kernel itself. There are a group of numbered entries in this directory that correspond to all the processes running on the system. In addition, there are a number of named entries that permit access to the current configuration of the system. Many of these entries can be viewed. Try viewing /proc/cpuinfo. This entry will tell you what the kernel thinks of your CPU.
/media,/mnt Finally, we come to /media, a normal directory which is used in a special way. The /media directory is used for mount points. As we learned in the second lesson, the different physical storage devices (like hard disk drives) are attached to the file system tree in various places. This process of attaching a device to the tree is called mounting. For a device to be available, it must first be mounted.

When your system boots, it reads a list of mounting instructions in the file /etc/fstab, which describes which device is mounted at which mount point in the directory tree. This takes care of the hard drives, but you may also have devices that are considered temporary, such as CD-ROMs and floppy disks. Since these are removable, they do not stay mounted all the time. The /media directory is used by the automatic device mounting mechanisms found in modern desktop oriented Linux distributions. On systems that require manual mounting of removable devices, the /mnt directory provides a convenient place for mounting these temporary devices. You will often see the directories /mnt/floppy and /mnt/cdrom. To see what devices and mount points are used, type mount.

Wednesday, October 11, 2017

java urls

http://javarevisited.blogspot.sg/2011/01/how-classpath-work-in-java.html


http://java67.blogspot.com/2012/08/what-is-path-and-classpath-in-java-difference.html

http://javapapers.com/core-java/java-class-loader/

http://zeroturnaround.com/rebellabs/rebel-labs-tutorial-do-you-really-get-classloaders/

http://www.learn-java-tutorial.com/Collections.cfm#.UslS3yaIoRg

https://www.cis.upenn.edu/~bcpierce/courses/629/jdkdocs/api/java.lang.Object.html

http://www.javaworld.com/article/2074996/hashcode-and-equals-method-in-java-object---a-pragmatic-concept.html

http://www.javabeat.net/list-of-hibernate-sql-dialects/

TCS resignation case
http://www.am22tech.com/leaving-tcs-onsite/#my-case


JavaSwing

http://www.javapractices.com/topic/TopicAction.do?Id=153
http://www.javamex.com/tutorials/threads/invokelater.shtml
https://www.javaadvent.com/2012/12/multi-threading-in-java-swing-with-swingworker.html
https://www.javaworld.com/article/2077754/core-java/swing-threading-and-the-event-dispatch-thread.html?page=5
http://stackabuse.com/how-to-use-threads-in-java-swing/
https://docs.oracle.com/javase/tutorial/uiswing/concurrency/simple.html
http://www.java2s.com/Code/Java/Threads/InvokeExampleSwingandthread.htm

Java thread
https://www.journaldev.com/1079/multithreading-in-java
http://tutorials.jenkov.com/java-concurrency/concurrency-models.html

Tuesday, October 10, 2017

IBM datastage

Source : https://www.ibm.com/support/knowledgecenter/en/SSZJPZ_9.1.0/com.ibm.swg.im.iis.ds.parjob.dev.doc/topics/partitioning.html


Partitioning

In the simplest scenario you probably won’t be bothered how your data is partitioned.
It is enough that it is partitioned and that the job runs faster. In these circumstances you can safely delegate responsibility for partitioning to InfoSphere® DataStage®. Once you have identified where you want to partition data, InfoSphere DataStage will work out the best method for doing it and implement it.
The aim of most partitioning operations is to end up with a set of partitions that are as near equal size as possible, ensuring an even load across your processors.
When performing some operations however, you will need to take control of partitioning to ensure that you get consistent results. A good example of this would be where you are using an aggregator stage to summarize your data. To get the answers you want (and need) you must ensure that related data is grouped together in the same partition before the summary operation is performed on that partition. InfoSphere DataStage lets you do this.
There are a number of different partitioning methods available, note that all these descriptions assume you are starting with sequential data. If you are repartitioning already partitioned data then there are some specific considerations:

Sunday, October 8, 2017

OOP concept

Encapsulation
Inhertitance
Abstraction
Polymorphism


http://www.informit.com/articles/article.aspx?p=2102828
https://stackoverflow.com/questions/742341/difference-between-abstraction-and-encapsulation