Sunday, June 29, 2014

how to start a successful blog


Add good url:
1. Use Bloggers tool to add permalink. This can help SEO.

Add your own logo:

Add members
Add comments section
Add google search bar
Add subscriber links
Add Logo and website

Use Custom URL
1. Use the custom URL. So search engine can find your blog,

Add Blogger to Google Analytics:
https://support.google.com/analytics/answer/1009610?hl=en

Good Blogs:
http://www.mkyong.com/

Promote Blogs:
1. Promote your blog on twitter, facebook, google plus, and subscribe me

Knowledge Sharing:
1. Blogging starts on 1998

References:
https://www.echoditto.com/insights/blogging-best-practices



Friday, June 27, 2014

Challenges to do the startup

Less Time:
Many people are busy on the job and his life. They want to do business, but they can't commit time. Without investing time and energy, doing startup is like a dream. Many people think that they can commit, but they can't. Lots of time will be spent on relocation, housework, family, vacation, children, bills, pets, etc.

Other Challenges:
1. To do a job, you just need to have type of knowledge, such tech skills. With enough education, training, and practice, you can easily master these skills. So you can easily manage this.
2. To do a good job in startup, you have to be a better person, be able to network, find business opportunities, execute, and learn from it. It needs many different skills in different aspects, which you will not learn in the school. You have to learn it from reality and practice.


Monday, June 23, 2014

How to use AWS to host your instance

Commands to run after setting up VM:
Check server info: lscpu
Check memory: free -m
uname -a
vi /etc/redhat-release

sudo passwd - Change root password

Connect to AWS Instance:
1. Use Puttygen to convert private key
2. Use Winscp to upload tomcat
3. Use unzip to unzip the tomcat
4.

Installation:
1.  Install JDK 7 on VM
2.  Install Tomcat 7 on VM
3.  Setup Load Balancer
4.  Setup DNS Information

Test Ports with Telnet:

Open AWS:
ec2-54-183-81-184.us-west-1.compute.amazonaws.com:8080

Install JDK7:
sudo yum install java-1.7.0-openjdk-devel
Setup java_home

Install Telnet:
http://nixcraft.com/showthread.php/12483-Install-Telnet-on-Red-Hat-Enterprise-Linux


Install Mysql Client on EC2:
Desc: This is good to troubleshoot the connectivity between EC2 and RDS
yum install mysql
http://stackoverflow.com/questions/5287220/is-there-a-way-to-only-install-the-mysql-client-linux

Can't connect from EC2 to RDS:
1. It is caused by enviornment configuration in spring, not by network.




Tuesday, June 10, 2014

How to develop API Proxy on APIGEE

Considerations:
1. Develop Flow
2. Develop Policy
3. Develop Fault Handling
4. Manage revision in Git
5. Deploy API Proxy

Knowledge Sharing:
1. Flow variable are used in policies and conditional flows. Policies can retrieve state from flow variables and use them to do their work.
2. The key to remember is that JavaScript executed by the JavaScript policy has access to all the flow variables that are exist and are in scope within the API proxy flow.
3. Variable scope is related to the flow or overall "life cycle" of an API proxy call.
4. To understand flow variable scope, it's important to understand or visualize the way messages flow through an API proxy. An API proxy consists of a series or message processing steps organized as a flow. At every step in a proxy flow, the proxy evaluates information available to it and decides what to do next. Along the way, the proxy may execute policy code or perform conditional branching.
5. the flows are composed of four main segments: ProxyEndpoint request, TargetEndpoint request, TargetEndpoint response, and ProxyEndpoint response.
6.





About how to debug API Proxy in APIGEE:
1. Develop API Proxy
2. Deploy API Proxy
3. Find out right URL
4. Invoke API
5. In the trace section, see how the message flows in the API Proxy from end to end, and see the contents inside the Flow.







Thursday, June 5, 2014

What is best tool to document API


Comparison:
rackspace
netflix api
go-grid
aws api
https://www.twilio.com/docs/api/rest
https://developers.google.com/+/api/

Good:
https://developers.facebook.com/
https://www.twilio.com/docs
https://developers.facebook.com/docs/
http://developers.soundcloud.com/
https://www.layar.com/documentation/browser/
https://dev.twitter.com/docs/streaming-apis


Best Practice:
1.

Lesson Learnt:
1.  ProgrammableWeb is a catalog which has all the APIs.
2.  



Best Practices:
1. Good documentation is important in encouraging and keeping developers interested in your platform as well as reducing support costs. Ideally, documentation should cover four areas, as shown in the figure above: overview, getting started, sample code, and references. In addition, this article describes best practices specifically for Web API documentation.
2.

Auto-generate Documentation

In order to minimize the amount of work in writing API documentation, it's useful to see how much of the documentation you can create automatically


Include Sample Code

More than anything, developers like to have sample code that they can learn with and start as a base for their own work. One of Web APIs strengths is that they are independent of platform and programming language. Unfortunately, this results in extra work when creating documentation. You should be able to make API calls in Python, Ruby, Java, C#, PHP, and so on.

Show Example Requests and Responses

In addition to sample code, having HTTP, XML, and JSON samples of your request and response is important. However, samples only are not sufficient. In addition, you need a description that explains the purpose of the call and you need a table that explains each element. We recommend a table with columns for Name, Type, Description, and Remarks.

Explain Authentication and Error Handling

Authentication is often required for Web APIs, so you will need to document how to get credentials and how those credentials are passed to the Web server. You may need step-by-step instructions on how to obtain API keys. Sample code is often useful showing developers how the keys work.

You'll need to explain how errors are handled as well. For example, an HTTP call may request data using unauthorized credentials, or it may request an action using data that does not exist. Right now there is no standard way to pass error information back, so developers need to understand how you are passing back error information, why an error occurs, and how to fix the problem.
Finally, remember that Web APIs are built on top of HTTP, which contains its own data. So you may have HTTP-related information that requires documentation as well. This can include caching, content type, and status codes.

Examples to Look At

If you talk to people in the Web API industry, one example often comes up as documentation that's done well. That's Twilio, which delivers cloud-based telephony and has excellent documentation.

What have they done right? First, they've got all of the pieces that a developer could ask for: tutorials, sample code, overviews, references, and an error and warning dictionary. Their reference material is well-organized, breaking information down into the Base URI, a table of properties, and HTTP methods (GET, POST, PUT, and DELETE, each with XML examples and description). In addition, they've got nice formatting that matches the look and feel of their overall website, and they have a good navigation system.

References:
http://www.programmableweb.com/news/web-api-documentation-best-practices/2010/08/12
http://bocoup.com/weblog/documenting-your-api/
https://www.braintreepayments.com/blog/api-where-to-begin
http://www.jpsoftwaretech.com/documentation-best-practices-for-web-apis/
 [Very Good]
http://www.slideshare.net/NathalieSteinmetz/web-apis-best-practices
http://www.slideshare.net/ibmapimgmt/recommended-practices-for-designing-a-web-api

Taxonomy: - Walked through the API Catalog of following APIs
https://www.twilio.com/docs/api/rest
http://docs.rackspace.com/



Monday, June 2, 2014

Research about SMS Capability


Terminologies:
SMS, GMS,

Supporting Frameworks:

JSMPP
1.  Support SMPP
2.  2 or 3 people
3.  https://code.google.com/p/jsmpp/
4.  Started from 2007
Status: Not good for GE

Java SMS SDK,  - No

Ozeki Java SMS SDK,  
1.  It is an Ozeki NG SMS Gateway
2.  Not Free
3.  http://www.ozekisms.com/


SMSLib 
1.  Need GSM modems and/or bulk sms operators.
2.  License: Apache
3.  - Too simple
4.  - Very few members

LOGICA SMPP Java API

Open Market SMS
Open Market SMS

Twilio Java SDK
1.  Commercial
2.  Support SMS, MMS

References:
About SMS Providers
Comparision of SMS Gateway
Send SMS Message from Email
2014 Best Text Message Marketing Service Comparisons and Reviews
How to text a cell phone from email?








What is the best VPS Provider



Requirements:
1.  Good Customer Support - Reason for not able to use
2.  Good Memory and Burstable RAM
3.  Good Upgrade Plan
4.  Good Consumer Rate
5.  Then Pricing


References:
http://www.comparevps.com/?location=1&mem_min=1024&disk_min=40&os=3


How to install DNS Server on Linux

Objective:
1.  Map Domain name to IP in Virtual Machine

Overall Guidance:



Steps:



References:
http://www.mochasupport.com/kayako/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=557



Research Findings:

Step # 1: Open /etc/resolv.conf file:
vi /etc/resolv.conf

Step #2: Add your ISP nameserver as follows:
search isp.com
nameserver 202.54.1.110
nameserver 202.54.1.112
nameserver 202.54.1.115

Step # 3:Test setup nslookup or dig command:
dig www.nixcraft.com
$ nslookup www.nixcraft.com

Dig Command:




What is parked domain

Understand parking, forwarding, or hosting your domain with us or with another registrar.


Research about supporting SMS


Objective:
This document is aim to send SMS to phone via Java Application.

What is SMS ?
Short Message Service (SMS) is a text messaging service component of phone, web, or mobile communication systems. Here is more detail.

Java Frameworks:
JSMPP, Java SMS SDK, Ozeki Java SMS SDK, SMS via email, SMSLib, Twilio Java SDK, LOGICA SMPP Java API,

Software:
SMS Gateway,

Options:
First : Use a SMS API Gateway which you need to pay for it , maybe you find some trial even free ones but it's scarce . Second : To use AT command with a modem GSM connected to your laptop . that's all

Protocols:
SMPP, GSM


References:
http://www.ozekisms.com/samples/index.php?owpn=581

What is the best VPS Hosting Provider

Commands for CentOS

About yum:
yum search java | grep 'java-'

Research about SMS Capability

How to install Tomcat on CentOS


Step 1: Download tomcat from the official website

Step 2: FTP tomcat to the CentOS

Step 3: Unzip it
jar xvf apache-tomcat-7.0.42.zip

Step 4: Deploy sample application
copy war to /webapps folder

Step 5: Restart tomcat


Enhancements:
1.  In setenv.sh, I shall use relative path, instead of absolute path
2.  I shall test all the setup locally, and then move to production enviornment
3.  How to set up java heap size in tomcat
4.

What is good Tech Stack for startup


Good Tech Stack:
Front End: Twitter Bootstrap, JQuery,
Backend: SpringMVC, Java
Database: MySQL
Mobile: Android, PhoneGap


Tools for Windows:
Development Tools:
JDK7
Maven 3
Spring Tool Suite
STS SVN Plugin
MySQL
HeidiSQL

Tools for Mac:
Development Tools:
JDK7
Maven 3
Spring Tool Suite
STS SVN Plugin
MySQL
Sequel Pro

Tools for Server:

Other Tools:
Disqus


References:
http://www.quora.com/What-technology-stacks-are-used-the-most-in-tech-startups-Why
http://leanstack.io/cloud-stacks
http://weavora.com/blog/2013/03/24/2013-the-development-stack-for-your-next-startup/


Understanding SMS

What is GSM ?
http://en.wikipedia.org/wiki/GSM

What is the relationship between ATT and GSM ?
http://www.wireless.att.com/learn/why/technology/mobile-broadband-and-GSM.jsp

What is GSM Carrier?
http://www.ebay.com/gds/GSM-and-CDMA-Guide-/10000000009189079/g.html




Research about Founder Equity


Knowledge Sharing:
1.  Early-stage companies should generally allocate at least 15 percent of their available shares for future key hires.
2.  A member of your senior leadership team, up to and including the COO, may get anywhere from 1 percent to 3 percent.  The exact amount depends on how much salary you can offer (more salary equals less equity, and vice versa) and the significance of the person’s role in the organization. Very early engineering or sales team members often receive anywhere from 0.15 percent to 1 percent equity.
3.  CEOs are in their own league. If you’re bringing on a CEO to run a venture-backed company, you can expect to give him or her 5 percent to 8 percent of your company’s equity, and maybe even 10 percent. In all cases, we’re talking about common stock. Signing bonuses are rare, but substantial performance-driven bonuses are not.
4.  Of course, there’s no guarantee that even the most promising hire will work out. So you want to protect yourself in case, against all odds, you’ve hired a dud. It’s typical to require a four-year vesting period, but often, no stock vests until the first anniversary of the executive’s hire -- the so-called one-year cliff. That helps make sure the employee really is a good fit before he or she starts getting shares in your company. In very rare cases, a company will even require employees to sell their stock if they leave the  company, minimizing the number of shares owned by nonemployees.
5.  The amount and terms of equity become irrelevant, however, if you are unable to convince the executive you are recruiting of your vision and potential. That’s what sets the successful founders apart from the rest, and in the end, that -- and a lot of hard work -- is what’s going to bring value to any shares.
6.  First, a caveat. For your first key hires, three, five, maybe as much as ten, you will probably not be able to use any kind of formula. Getting someone to join your dream before it is much of anything is an art not a science. And the amount of equity you need to grant to accomplish these hires is also an art and most certainly not a science.
7.  Hiring cofounder is different from hiring early employees.
8.  Once you have assembled a core team that is operating the business, you need to move from art to science in terms of granting employee equity. And most importantly you need to move away from points of equity to the dollar value of equity. Giving out equity in terms of points is very expensive and you need to move away from it as soon as it is reasonable to do so.
9.  The first thing you do is you figure out how valuable your company is (we call this "best value").
10.  The first thing you do is you figure out how valuable your company is (we call this "best value"). This is NOT your 409a valuation (we call that "fair value"). This "best value" can be the valuation on the last round of financing. Or it can be a recent offer to buy your company that you turned down. Or it can be the discounted value of future cash flows. Or it can be a public market comp analysis. Whatever approach you use, it should be the value of your company that you would sell or finance your business at right now. Let's say the number is $25mm. This is an important data point for this effort. The other important data point is the number of fully diluted shares. Let's say that is 10mm shares outstanding.
11.  The second thing you do is break up your org chart into brackets. There is no bracket  for the CEO and COO. Grants for CEOs and COOs should and will be made by the Board.
12.  The key thing is to communicate the equity grant in dollar values, not in percentage of the company. Startups should be able to dramatically increase the value of their equity over the four years a stock grant vests. We expect our companies to be able to increase in value three to five times over a four year period
14.

Categories:
1.  Cofounders, hired by Founders
2.  CEO, COO, hired by board
3.  First Brackets: CFO, VP Sales, CMO, CPO, CTO, VP Eng, VP HR.
4.  2nd Brackets: Director level manager, key people(engineering, design superstar)
5.  3rd Brackets: Key functions in engineering, product, marketing, etc.
6.  4th Brackets: employees are not in key functions, including receptions, clerical employees

Senior Team: 0.5x
Director Level: 0.25x
Key Functions: 0.1x
All Others: 0.05x

Two Types:
1.  Stock Option
2.  Common Stocks

Learnts about Stock Option:
1.  Stock option will shrink as the company issues more shares to investors or other new employees.
2.

http://www.slideshare.net/edkuiters/how-to-dividethepiepublic
How to divide equity ?
1.  Time : Negotiated Base Salary - Cash Compensation * 2 / 2000
2.  Unpaid Commission: *2
3.  Small Money: *4
4.  Investment
5.  Cost
6.  Building
7.  Unreimbursed Expense

Founder uses Time and Cost
Employees use Time
Investor use Money, Unpaid Commission and Credibility




References:
7 Common Questions About Startup Employee Stock Options
The Perils of Accepting Stock Compensation in a Startup Company
Founder's Pie
http://capgenius.com/2011/03/06/splitting-pie/
https://docs.google.com/spreadsheet/ccc?key=0AmhoYEAndoegcDMxRUtNVURRRkVZMzk5dkZyNlFRYWc&pli=1#gid=0
https://www.udemy.com/founders-pie-calculator/
http://www.slideshare.net/msuster/final-startup-grind?ref=http://www.bothsidesofthetable.com/2013/02/06/how-to-configure-your-startup-team/

Preferred Stocks vs Common Stocks:
1.  As assets are liquidated, payments go first to creditors and bondholders; then preferred stockholders are paid and, last of all, common stockholders.
2. Preferred stocks can get dividents regularly, but common stocks won't.
3. Holding shares of common stock gives you the opportunity to vote in the election of the board of directors
4. This is usually equivalent to one vote per share that you own. Owning preferred stock usually guarantees the payment of dividends but does not come with voting rights.
5.  Ownership in either type of stock entitles you to a piece of the company's profit. One way profit is distributed to the shareholders is through dividends, which are often paid in cash from the company's earnings. Dividends are usually paid on a quarterly basis.
6. Common stockholders never know the value of their dividends in advance, while preferred stockholders receive dividends at a fixed rate. While the dividends on preferred stocks tend to be higher than those on common stock, they will not appreciate with company growth
7.  Investors can think of preferred [stocks] as somewhere between a stock and a corporate bond, as they trade on an exchange the way stocks do, but the dividends are generally quite high, like those from long-maturity bonds,
8.  holding periods, common stocks have historically offered higher returns than preferred stocks or bonds,
9.  The bottom line is that common shareholders rarely get anything in bankruptcy cases, while preferred stockholders have a better chance of getting at least some money back.
10. Like common stock, preferred stock is sold by companies and is then traded among investors on the secondary market. Preferred stock is less risky than common stock, therefore investors can expect less reward.
11.  The bottom line is that preferred stock is less risky than common stock. It's designed to provide an income generating opportunity for investors while raising capital for the underlying company. As Buck investors, we probably shouldn't be thinking about preferred stock until we approach retirement in 30 years, but it's good to know the difference. 
12.  The vast majority of technology startups are capitalized in the same manner: common stock to the founders, common stock reserved in an option pool for employees and consultants, and preferred stock (Series A, Series B, etc.) sold to investors
14.   As successful entrepreneur Ryan Himmel has pointed out, equity splits should reward a combination of the highest-valued contribution and the largest undertaking of risk.
15.  In the end, splitting equity may be the toughest thing you have to do as a member of a founding team. You’re going to hurt feelings, make difficult decisions and live with the consequences.
16.  Conventional wisdom says that you gain far more in working as a team than you lose by diluting by half before you start.
17.  In this case, I would take your total ownership and divide it up by employee tiers. Maybe something like 10 percent each for five C-level executives; 2.5 percent each for 10 VP level executives and 1 percent each for 25 director/manager level staff (adding up to a total of 100 percent, with all other things being equal).
18.  One of the first tough decisions facing startup founders is how to allocate equity among the founders, investors, directors, advisors, and employees.
19.  Founders can contribute in many ways - some bring patents or insights from years of research, some bring technical abilities and business experience, and some bring network connections.
20.  Let’s assume that your company reserves 55% of the equity for founders, 30% for investors, and 15% for the option pool 
21.  

吕不韦

References:
http://www.foxbusiness.com/investing/2012/05/01/whats-difference-between-preferred-and-common-stock/
https://open.buffer.com/buffer-open-equity-formula/
https://www.quora.com/How-should-equity-be-split-between-founders-early-employees-consultants-and-investors-when-the-company-is-bootstrapped
http://fundersandfounders.com/how-to-make-money-the-startup-way/ https://www.legal.io/guide/555be3a277777738de6f0000/Don-t-be-Pied-Piper-1-How-to-Divide-Equity-Among-Startup-Founders


How to manage QA

QA Standards:
UI: Sonar, Jococa, Checkmarx
Service: Sonar, Checkmarx





How to manage cpanel and WHM

In many VPS Hosting, the provider will provide cpanel and WHM. Which can be a good thing and help you a lot of things. But they can also use lots of your memory, then you don't have the resources to use other services.

Target Goal: Use 450MB memory

Shutdown cpanel
service cpanel stop

Shutdown WHM

Turn off all the services you don't need from cpanel, and make sure it didn't start in the next reboot:


root      1009  0.0  0.0 249084  1588 ?        Sl   23:39   0:00 /sbin/rsyslogd -i /var/run/syslogd.pid -c 5
named     1030  0.0  0.9 162892 18256 ?        Ssl  23:39   0:00 /usr/sbin/named -u named
dbus      1129  0.0  0.0  21404   884 ?        Ss   23:39   0:00 dbus-daemon --system
root      1158  0.0  0.0   4080   636 ?        Ss   23:39   0:00 /usr/sbin/acpid
nscd      1174  0.0  0.1 832936  3452 ?        Ssl  23:39   0:00 /usr/sbin/nscd
root      1194  0.0  0.0  64716  1224 ?        Ss   23:39   0:00 /usr/sbin/sshd
ntp       1202  0.0  0.0  25028  1696 ?        Ss   23:39   0:00 ntpd -u ntp:ntp -p /var/run/ntpd.pid -g
root      1215  0.0  0.0 106312  1412 ?        S    23:39   0:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/mysqld.pid
mysql     1537  0.0  2.5 662268 48548 ?        Sl   23:39   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/va
root      1587  0.0  0.0 108428   644 ?        Ss   23:39   0:00 /usr/sbin/abrtd
root      1595  0.0  0.0 108204   836 ?        Ss   23:39   0:00 abrt-dump-oops -d /var/spool/abrt -rwx /var/log/messages
root      1606  0.0  0.0  17920   948 ?        Ss   23:39   0:00 /usr/sbin/dovecot
dovenull  1617  0.0  0.1  42208  2320 ?        S    23:39   0:00 dovecot/pop3-login
dovenull  1618  0.0  0.1  42212  2324 ?        S    23:39   0:00 dovecot/imap-login
dovecot   1619  0.0  0.0  13304   952 ?        S    23:39   0:00 dovecot/anvil
root      1620  0.0  0.0  13432  1108 ?        S    23:39   0:00 dovecot/log
dovenull  1622  0.0  0.1  42208  2324 ?        S    23:39   0:00 dovecot/pop3-login
dovenull  1623  0.0  0.1  42212  2320 ?        S    23:39   0:00 dovecot/imap-login
root      1624  0.0  0.0  14520  1880 ?        S    23:39   0:00 dovecot/config
dovecot   1625  0.0  0.0  29440  1764 ?        S    23:39   0:00 dovecot/auth
root      1626  0.0  0.2  72536  5308 ?        Ss   23:39   0:00 /usr/local/apache/bin/httpd -k start -DSSL
root      1633  0.0  0.1 137192  1992 ?        Ss   23:39   0:00 pure-ftpd (SERVER)                                                                                                    
root      1635  0.0  0.0 136580  1828 ?        S    23:39   0:00 /usr/sbin/pure-authd -s /var/run/ftpd.sock -r /usr/local/cpanel/bin/pureauth
root      1643  0.0  0.0 115404  1004 ?        Ss   23:39   0:00 crond
root      1654  0.0  0.0  19860   464 ?        Ss   23:39   0:00 /usr/sbin/atd
nobody    1687  0.0  0.1  71076  2228 ?        S    23:39   0:00 /usr/local/apache/bin/httpd -k start -DSSL
root      1688  0.0  0.4  48992  8756 ?        S    23:39   0:00 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/bin/leechprotect
root      1694  0.0  0.0  71076  1804 ?        S    23:39   0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody    1695  0.0  0.1  72252  1948 ?        S    23:39   0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody    1696  0.0  0.2 547868  5328 ?        Sl   23:39   0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody    1697  0.0  0.3 613404  6456 ?        Sl   23:39   0:00 /usr/local/apache/bin/httpd -k start -DSSL
nobody    1698  0.0  0.3 547868  6368 ?        Sl   23:39   0:00 /usr/local/apache/bin/httpd -k start -DSSL
root      1789  0.0  0.3  45260  6720 ?        S    23:39   0:00 cPhulkd - processor
root      1807  0.0  0.2  33124  5404 ?        S    23:39   0:00 queueprocd - wait to process a task
root      1815  0.0  0.7  96652 14364 ?        S    23:39   0:00 cpsrvd (SSL) - waiting for connections
root      1884  0.0  0.3  37404  7156 ?        S    23:39   0:00 tailwatchd
root      1896  0.0  0.1  27120  2992 ?        SN   23:39   0:00 cpanellogd - sleeping for logs
root      1930  0.0  0.0   4064   528 tty1     Ss+  23:39   0:00 /sbin/mingetty /dev/tty1
root      1932  0.0  0.0   4064   528 tty2     Ss+  23:39   0:00 /sbin/mingetty /dev/tty2
root      1934  0.0  0.0   4064   524 tty3     Ss+  23:39   0:00 /sbin/mingetty /dev/tty3
root      1936  0.0  0.0   4064   532 tty4     Ss+  23:39   0:00 /sbin/mingetty /dev/tty4
root      1937  0.0  0.0  10764   848 ?        S<   23:39   0:00 /sbin/udevd -d
root      1939  0.0  0.0   4064   528 tty5     Ss+  23:39   0:00 /sbin/mingetty /dev/tty5
root      1941  0.0  0.0   4064   528 tty6     Ss+  23:39   0:00 /sbin/mingetty /dev/tty6
root      1987  0.0  0.2 107164  4024 ?        Ss   23:40   0:00 sshd: root@pts/0
root      1992  0.0  0.0 106448  1688 pts/0    Ss   23:40   0:00 -bash
root      2129  0.0  0.0 108348  1068 pts/0    R+   23:52   0:00 ps aux


Question Series - Common Questions


Question 1: How would you improve performance of a Java application
Answer:
1. Pool valuable system resources
2. Optimize IO Operation
3. Minimize Network overhead
4. Check if you have memory problem and manage object efficiently.

Question 2: What is the performance tips?
1. ArrayList/Hashmap over Vector/Hashtable
2. Set proper initial size for collections
3. Don't use exception to control flow
4. Minimize casting
5. Avoid using system.out, use log4j

Question 3: How would you detect and minimise memory leaks in java ?
Detect memory leaks
1. Use tool like JProbe
2. Use OS Process Monitor
3. use totalMemory and freeMemory
Minimize memory leaks:
1. Use object's lifecycle
2. Unreachable collection objects cause memory problem
3. Use WeakHashMap
4. Free native resources

Question 4: Why out of memory error happens?
1. Increase heap size. Java -Xms1024M -Xmx1024M
2. Increase perm size. Java -XX:PermSize=256M -XX:MaxPermSize=256M
3. Have memory leak in your app

Question 5: Why does the JVM crash with a core dump or Dr. Watson error?
1. Use JNI Code
2. The OS needs a patch
3. JVM has a bug for translation

Question 6: What design patterns have you used before ?
1. Strategy, Iterator, Decorator, Visitor, Singleton, Factory, Command and MVC.
2. UML, BusinessDelegate, VO

Question 7:




How to use books

Overall Guidance:
1.  Sometimes, the books have more valuable information, than Internet. Especially, some open source projects. Many companies sell books for revenue.
2.

Book Catalog:
Solr - Apache Solr 4 Cookbook



Master PhoneGap

When to use Objective-C and PhoneGap ?
orientation shifts

How to support Offline Capability in PhoneGap App ?
1. Use SQLite on IPad
2. web storage, web sql database, indexed database, file access
3.

Mobile Requirements:
Offline Capability
Synchronization
Cache
First Time Load
Security: Encryption, Session, Remote Wipeout
Card Pushing
Notification

Workflow

General Design:
1.  Mobile app will always work with local storages via Offline Capability.
2.  Mobile app will automatically synchronize with server side

Frameworks:
HTML, CSS, JAVASCRIPT
JQuery, JQuery Mobile, Sencha Touch


Master Objective-C

Opportunity Gaps


Role: IT Platform Architect
Ruby, ServiceMix, Nginx, Puppet, Chef, SaltStack, Ansible, DevOps practices

Research:
1.  Chef is a configuration management tool written in Ruby and Erlang. It uses a pure-Ruby, domain-specific language (DSL) for writing system configuration "recipes". 
2.  Puppet is an open source configuration management tool, written by Ruby.
3.  Salt is an open source configuration management and remote execution application. Salt is written with the intent of making central system management and configuration as simple, yet as flexible as possible.
4.  An ansible is a fictional machine capable of instantaneous or superluminal communication. Typically it is depicted as a lunch-box-sized object with some combination of microphone, speaker, keyboard and display.
5.  DevOps (a portmanteau of development and operations) is a software development method that stresses communication, collaboration and integration between software developers and information technology (IT) professionals

DevOps Principles:
1.  DevOps helps to enable IT alignment by aligning development and operations roles and processes in the context of shared business objectives. Both development and operations need to understand that they are part of a unified business process. DevOps thinking ensures that individual decisions and actions strive to support and improve that unified business process, regardless of organizational structure
2.  For most organizations, Scrum, the iterative project management methodology, is the face of Agile.
3.  http://dev2ops.org/2010/02/what-is-devops/
4.1. Measurement and incentives to change culture 
4.2  Unified processes – The important theme of DevOps is that the entire development-to-operations lifecycle must be viewed as one end-to-end process. 
4.3  Unified tooling 
5.  The Information Technology Infrastructure Library (ITIL) is a set of practices for IT service management (ITSM) that focuses on aligning IT services with the needs of business.
6.  The focus is on all business value streams that are enabled by IT. In other words, it begins when requirements are identified (e.g., by the business or IT), are built in Development, and then transitioned into IT Operations, where the value is then delivered to the customer as a form of a service
7.  


Research about Algorithms Engineering

Objective:
1.  This document is aim to research about the algorithm engineering development lifecycle.

Research Findings:
1.  Algorithm Engineering focuses on the design, analysis, implementation, optimization, profiling and experimental evaluation of computer algorithms, bridging the gap between algorithm theory and practical applications of algorithms in software engineering.
2.  constant factors of algorithms have such a considerable impact on real-world inputs that sometimes an algorithm with worse asymptotic behavior performs better in practice due to lower constant factors.
3.  Implementations of algorithms used for experiments differ in significant ways from code usable in applications. While the former prioritizes fast prototyping, performance and instrumentation for measurements during experiments, the latter requires thorough testing, maintainability, simplicity, and tuning for particular classes of inputs.
4.  Empirical algorithmics (sometimes also called experimental algorithmics) is the area within computer science that uses empirical methods to study the behaviour of algorithms. It can be used in the analysis of algorithms.
5.  Algorithm design is a specific method to create a mathematical process in solving problems.
6.  Techniques for designing and implementing algorithm designs are algorithm design patterns,[1] such as template method pattern and decorator pattern, and uses of data structures, and name and sort lists.
7.  Backtracking is a general algorithm for finding all (or some) solutions to some computational problems, notably constraint satisfaction problems, that incrementally builds candidates to the solutions, and abandons each partial candidate c ("backtracks") as soon as it determines that c cannot possibly be completed to a valid solution.
8.  Proof by exhaustion, also known as proof by cases, perfect induction, or the brute force method, is a method of mathematical proof in which the statement to be proved is split into a finite number of cases or sets of equivalent cases and each type of case is checked to see if the proposition in question holds
9. In computer science, brute-force search or exhaustive search, also known as generate and test, is a very general problem-solving technique that consists of systematically enumerating all possible candidates for the solution and checking whether each candidate satisfies the problem's statement.
10. Brute force search should not be confused with backtracking, where large sets of solutions can be discarded without being explicitly enumerated
11. the efficiency or running time of an algorithm is stated as a function relating the input length to the number of steps (time complexity) or storage locations (space complexity)
12. Informally, an algorithm can be said to exhibit a growth rate on the order of a mathematical function if beyond a certain input size n, the function f(n) times a positive constant provides an upper bound or limit for the run-time of that algorithm.
14.  Algorithm analysis is important in practice because the accidental or unintentional use of an inefficient algorithm can significantly impact system performance. In time-sensitive applications, an algorithm taking too long to run can render its results outdated or useless. An inefficient algorithm can also end up requiring an uneconomical amount of computing power or storage in order to run, again rendering it practically useless.
15.

Steps in development of Algorithms
1. Problem definition
2. Development of a model
3. Specification of Algorithm
4. Designing an Algorithm
5. Checking the correctness of Algorithm
6. Analysis of Algorithm
7. Implementation of Algorithm
8. Program testing
9. Documentation Preparation

Common Algorithm Paradigms:

  1. Simple recursive algorithms
  2. Backtracking algorithms
  3. Divide and conquer algorithms
  4. Dynamic programming algorithms
  5. Greedy algorithms
  6. Branch and bound algorithms
  7. Brute force algorithms
  8. Randomized algorithms

Topics:
Algorithm Engineering
Algorithm Theory
Experimental Algorithmic

Algorithm Cycle:
Design
Analysis
Implementation
Experimental Evaluation
Joined by further aspects like Machine Models or Realistic Inputs

Institutes:
Library of Efficient Data types and Algorithms
Algorithms Marketplace

Top Algorithms in 20th Century:
1946: The Metropolis Algorithm for Monte Carlo. Through the use of random processes, this algorithm offers an efficient way to stumble toward answers to problems that are too complicated to solve exactly.
1947: Simplex Method for Linear Programming. An elegant solution to a common problem in planning and decision-making.
1950: Krylov Subspace Iteration Method. A technique for rapidly solving the linear equations that abound in scientific computation.
1951: The Decompositional Approach to Matrix Computations. A suite of techniques for numerical linear algebra.
1957: The Fortran Optimizing Compiler. Turns high-level code into efficient computer-readable code.
1959: QR Algorithm for Computing Eigenvalues. Another crucial matrix operation made swift and practical.
1962: Quicksort Algorithms for Sorting. For the efficient handling of large databases.
1965: Fast Fourier Transform. Perhaps the most ubiquitous algorithm in use today, it breaks down waveforms (like sound) into periodic components.
1977: Integer Relation Detection. A fast method for spotting simple equations satisfied by collections of seemingly unrelated numbers.
1987: Fast Multipole Method. A breakthrough in dealing with the complexity of n-body calculations, applied in problems ranging from celestial mechanics to protein folding.

Feelings:
1.  It is like solving math problems.
2.  Problems have easy, middle, and hard problems.
3.  It is very important to understand the problem; or is the problem describer has described the problem clearly. Many times, they are not. So we have to use questions to find out what exactly the problem the describer has.
4.  The only way to achieve this, is by solving more problems, and increase my experience. Just like Machine learning, we have to train ourselves with enough training examples, so we can improve algorithm experience.
5.  Algorithm Experience matters.
6.  There are many tricks in Algorithm.
7.  Also focus on worst case balancing.
8.  This is the key source for FLAG Company.
9.  Focus on practicing more questions with answers, accumulate tricks and common designs, and then solve the issue myself. There is no single good answer for all the problems.
10. Algorithm is to increate smartness of computer.
11. Algorithm shall go from easy to middle to hard, just like Experience.
12. Algorithm is about solving problems.
14. Shall also try to research about how other people solve this problem with what algorithms first, and then customize it.
15.  Leverage other people's algorithms.

References:
https://en.wikipedia.org/wiki/Algorithm_engineering
http://www.algorithmic-solutions.com/leda/index.htm
https://algorithmia.com/tags/machine%20learning
https://en.wikipedia.org/wiki/Empirical_algorithmics
https://en.wikipedia.org/wiki/Algorithm_design
https://en.wikipedia.org/wiki/Proof_by_exhaustion
https://en.wikipedia.org/wiki/Brute-force_search
https://en.wikipedia.org/wiki/Analysis_of_algorithms
https://www.quora.com/What-are-the-top-10-algorithms-of-the-20th-century


Master Drools Fusion

http://docs.jboss.org/drools/release/5.5.0.Final/drools-fusion-docs/html_single/index.html#d0e492


Master Java Platform-Concurrency

Java Platform:
1. Java Platform is provided as a library. Predix Platform is provided as a service. Java is a platform. To develop java platform, we need to collect different requirements, and provide common utility, API, framework, and tools as part of the platform.
2. To learn to use different Java Platform API, we also need to explore the API and do a POC with it.
3. It is very important to understand the capability of Java Platform Standard Edition and Enterprise Edition.
4. To develop java platform, the key is to implement data structure and algorithms, and develop frameworks. It is not about using open source tools and frameworks to develop applications.
5. If the goal is to implement java API, we need to master the data structure and algorithms, understanding Java Platform.
6. Developers: Develop Java Platform

Concurrency:
1.  Processing time for a single core is shared among processes and threads through an OS feature called time slicing.
2.  It's becoming more and more common for computer systems to have multiple processors or processors with multiple execution cores.
3.  To facilitate communication between processes, most operating systems support Inter Process Communication (IPC) resources, such as pipes and sockets. IPC is used not just for communication between processes on the same system, but processes on different systems.
4.  Multithreaded execution is an essential feature of the Java platform.
5.   There are two basic strategies for using Thread objects to create a concurrent application.
5.1. To directly control thread creation and management, simply instantiate Thread each time the application needs to initiate an asynchronous task.
5.1. To abstract thread management from the rest of your application, pass the application's tasks to an executor.
6. When a thread invokes d.wait, it must own the intrinsic lock for d — otherwise an error is thrown. Invoking wait inside a synchronized method is a simple way to acquire the intrinsic lock.
7. Multi-threading is involving two operation classes trying to accessing/modifying the same instance variable.
8. I shall learn the introduction sections of java.
9. For multithreading,
    9.1 define a shared object with lock, synchronized method.
    9.2 define a thread class, holding shared object, and start threading
    9.3 define a main method to execute the program.
10. The core java API comes with a lot of high level API, framework, interfaces, different implementations which help optimize the performance of java applications, either standalone or java ee, etc.
11. Many advanced API, such as Executors, ForkJoinPool are helping build high scalable multi-threading applications, instead of directly interacting with low level API.
12. Many interviewers are asking the API understanding and usage of java technologies.
14. API: Executor, Executors, Runnable, Thread, Future, Callable, ThreadPoolExecutor, ScheduledThreadPoolExecutor,etc.
15. Project example: MicroFlow Framework, which support Sequencial, Concurrent, and conditional executions.
16. Understand Concurrency and high level API.


Techniques:
1.  In run method, define a loop, and use thread sleep to periodically execute shared object's operation.
2.  if (Thread.interrupted()) {
    throw new InterruptedException();
}
3. 

Get Started with MongoDB

Installation Guide:
http://www.mkyong.com/mongodb/how-to-install-mongodb-on-mac-os-x/

Installation File Manifest:
MongoDB  Version:2.4.8
Mongo Client on MAC:
Umongo


Start MongoDB:
mongod --dbpath 
/Users/502329397/Documents/install/mongodb-osx-x86_64-2.6.3/data

Run MongoDB:
db, show dbs, use test, show collections, db.Alerts.find()

Aspects:
1.  Install Database
2.  Design Data Model
3.  Do CRUD Functionality with Spring Data
4.  Functions - Aggregations
5.  Administrate
6.  Security
7.  Clustering - Sharding, Replication,
8.  Performance - Index,
9.  Deployment
10.  Infrastructure

References:
https://github.com/agirbal/umongo
Documentation in official website
How to install mongodb
SQL to MongoDB Mapping

Issues:
Issue 1: Can't run umongo on Java 1.6
Solution:
Run mongodb from command line
On any platform you can run UMongo from the command line. Open a terminal and go to UMongo's directory in which umongo.jar is present and run:
> java -jar umongo.jar
https://github.com/agirbal/umongo






Master Design Patterns

Gang Of Four Design Patterns:
http://www.informit.com/guides/content.aspx?g=java&seqNum=441  - Good

http://www.blackwasp.co.uk/GofPatterns.aspx
http://www.javacamp.org/designPattern/

J2EE Design Patterns:


Enterprise Integration Patterns:
http://camel.apache.org/enterprise-integration-patterns.html


I need to master:
1. Data Structure and Algorithms
2. Design Patterns (Gof, J2EE, EAI)
3. Many other technologies, None Functional Requirements

Understand Telecommunication Domain



Terms:
Juniper MX
QFX Hardware


Knowledge:
1.  Juniper MX-Series is a series of Ethernet Services routers designed and manufactured by Juniper Networks
2.  QFX Series 10GbE/40GbE switches are high-performance, low-latency, 1 and 2 U edge devices that are optimized for virtualized data center environments.
3.   The QFX Series switches act as universal building blocks for multiple data center fabric architectures and can be used in seamless Juniper 1/10/40GbE architectures, such as Virtual Chassis, Virtual Chassis Fabric and QFabric deployments, as well as in open architectures such as Spine and Leaf and Layer 3 fabrics
4.   Private VLAN, also known as port isolation, is a technique in computer networking where a VLAN contains switch ports that are restricted such that they can only communicate with a given "uplink". The restricted ports are called "private ports". Each private VLAN typically contains many private ports, and a single uplink
5.  MC-LAG, or Multi-Chassis Link Aggregation Group, is a type of LAG with constituent ports that terminate on separate chassis, thereby providing node-level redundancy. 
6.  Software-defined networking (SDN) is an approach to computer networking which evolved from work done at UC Berkeley andStanford University around 2008.[1] SDN allows network administrators to manage network services through abstraction of lower level functionality. This is done by decoupling the system that makes decisions about where traffic is sent (the control plane) from the underlying systems that forward traffic to the selected destination (the data plane). 
7.  In computer networking, a port is an application-specific or process-specific software construct serving as a communications endpoint in a computer's host operating system. A port is associated with an IP address of the host, as well as the type of protocol used for communication
8.  Virtual Private LAN Service (VPLS) is a way to provide Ethernet-based multipoint to multipoint communication over IP or MPLSnetworks.
9.  An Ethernet VPN (EVPN) enables you to connect a group of dispersed customer sites using a Layer 2 virtual bridge. As with other types of VPNs, an EVPN is comprised of customer edge (CE) devices (host, router, or switch) connected to provider edge (PE) devices.
10.  The Alcatel-Lucent 5620 Service Aware Manager (SAM) enables end-to-end network and service management across all domains of the converged, all-IP network.
11.