Tuesday, December 29, 2015

Spring MVC + Angular JS

Basic Idea - You have one controller per page(or per view) on AngularJS side . A controller's job is to mix mash data from services to fit it to a view (controller can have a one to one relationship with a web view or web page)

AngularJS is MVC based , for each AngularJS Controller you may need one or more services and these can be virtual REST services - mapped to Spring MVC's view rendered JSON. Spring MVC View would have a one on one relationship with a controller for neatness sake . 

So each of the corresponding controllers on server side in Spring MVC , would call one or more than one Java Service classes which might fetch data from RESTful APIs.

One can structure the application in the below manner:
         Angular JS View has one to one relationship with Angular JS Controller
         Angular JS Controller has one to many relationship with AngularJS service
         AngularJS Service  has one to one relationship with Spring MVC View and so does it with Spring MVC Controller
        Spring MVC Controller can have one to many relationship with  Spring Model (Service) classes




Java is number 1 language in terms of popularity - Tiobe index

Java is number 1 language in terms of popularity - Tiobe index


Sunday, December 27, 2015

AMQP, STOMP and MQTT

AMQP(binary), STOMP(text) and MQTT(binary and low-power, suitable for IoT) are application layer messaging protocols over TCP/IP.
MQTT is being used by Facebook for some of the messaging services.
https://blogs.vmware.com/vfabric/2013/02/choosing-your-messaging-protocol-amqp-mqtt-or-stomp.html


RabbitMQ broker can support all the above three
https://www.rabbitmq.com/distributed.html

Friday, December 25, 2015

Syntax Highlighter/HTML Generator for R

Use the language S

http://hilite.me/

Most frequently used Linux commands for system monitoring

vmstat (overall system monitoring)
iostat (overall io monitoring)
free -m (Memory usage)
df -h (Disk usage)
tcpdump (Reading bytes on the network)
netstat (Network statistics)
nice (process scheduling)
ionice  (io scheduling for a process)
top (for overall monitoring)
ethtool (for network card details)

vmstat

vmstat [interval] [count]

In this example, the first line of data provides the average since the last boot time. Subsequent reports, until [count] is reached, report data on the current state of the system every [interval]seconds.

vmstat cpu time adds up to 100 - user, kernel, idle and wait times

The cpu section reports on the use of the system’s CPU resources. The columns in this section always add to 100 and reflect “percentage of available time”.
The us column reports the amount of time that the processor spends on userland tasks, or all non-kernel processes. The sy column reports the amount of time that the processor spends on kernel related tasks. The id column reports the amount of time that the processor spends idle. The wa column reports the amount of time that the processor spends waiting for IO operations to complete before being able to continue processing tasks.