Skip to main content

Posts

Showing posts from May, 2015

Getting started with Nginx

Points To Remember Nginx is pronounced as Engine-x It is open source It is a High performance HTTP server and Reverse proxy It does not rely on thread to handle requests.  Thus it can serve thousands of concurrent requests. It works on scalable event driven (asynchronous) architecture.  Getting started with NGINX Install nginx sudo apt-get install nginx Check the status of the server sudo service nginx status Start the nginx server sudo service nginx start Go to the browser and enter the url http://localhost  you will see the following screen. Our nginx server is up and running. Viewing the NGINX configuration files. You can go to the folder  /etc/nginx  to view the Nginx configuration files. The image above shows how the nginx files looks like. For getting started the important files you should be familiar to are mime.types  it includes all the mime types the the ngnix server will support. nginx.conf  it contains most of the configuration that is required for a normal application. It

How to create/ schedule a Job or Thread to run at fixed intervals

Points To Remember TimerTask is a class that can run a Thread repeatedly after a specific period. You can either implement your own class also by implementing Runnable Interface. Then you may need to put your thread to sleep and then resume the thread after a desired interval. The TimerTask will do this more efficiently for you then implementing your own code. How to schedule a Thread to run after fixed interval We will be using TimerTask to schedule the Thread after every 1 sec. TimerTask class in Java implements Runnable interface and has the following methods. cancel -  to cancel the timer task when needed. scheduledExecutionTime -  gives the time when the task was last executed successfully. run -  an abstract method that needs to be implemented. MyTask.java import java.util.TimerTask; import java.util.Date; class MyTask extends TimerTask { static int count = 0; @Override public void run(){ if(count < 5){ System.out.println(" MyTask called ### count = "

How to use AngularJs Expressions

Points To Remember You can evaluate angular expressions by the following ways using interpolation {{ }} using ng-bind Examples of AngularJs Expressions Following are the ways you can use the angular expressions. Mathematical calculations  String operations Json operation Array operations You may want to see ng-init. <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="style.css"> <script src="script.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script> </head> <body ng-app="" ng-init="firstName='Ekansh';lastName='Rastogi';json=[{'name':'user1','age':'18'},{'name':'user2','age':'24'}];array=[0,1,2,3,8]"> <div ng-bind="firstName + ' ' + lastName"></div><hr/> String op

Introduction to AngularJS

Setting up AngularJS. All you need to do is Download the AngularJs script from  https://angularjs.org/ . You can use the AngularJs cdn   http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js Add the Angular Js ng-app="" tag to initialize the angukar application. Add the angularjs script to the Html page and you are good to go <!DOCTYPE html> <html>   <head>     <link rel="stylesheet" href="style.css">     <script src="script.js"></script>     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.min.js"></script>   </head>   <body ng-app="">     <h1>{{"Hello" +" " + "World!" }}</h1>   </body> </html> The above code will give you the following output. Loading plunk...

Best HTC Mobiles under INR 15000

Lets have a look at the top HTC mobile phones under Rs 15000. HTC Desire 816G Plus  This is one of the most wanna be mobile that the company has produced and is available in the range 15000 INR. Lets see what makes this phone a great choice to buy. Octacore  1.7 Ghz processor that is fast enough to run all your games and applications simultaneously. 5.5 inch screen multi touch screen High resolution 720 x 1280  that will give you a great experience of viewing your videos and movies. 1 GB RAM and 16 GB internal memory.  So store all your apps and movies in the phone without the need of memory card. 13 MP 4160x3120 px super awesome primary camera. So get ready to capture all those priceless moments of your life. 5 MP rear camera to fit boost your #selfie love. 2600 mAh  battery that will last for a day. Awesome audio quality with great beats. Android , v4.4.2 So the verdict of the phone is that, if you are looking to buy a phone with a big screen and a great camera and sound than thi

Trending Apple Products

Apple is one of the best selling brands across the world. Some of the trending products of Apple in the year 2015 are. Apple Watch Some of the key features of the watch are  Stainless Steel case Sapphire crystal Ceramic back Heart Rate sensor, Accelerometer and gyroscope Requires iphone 5+ for operation. Why to buy Apple watch  The Apple Watch is coming in six different versions: there's the Apple Watch, the Apple Watch Sport and the Apple Watch Edition. And each of these comes in two sizes, for those that like a larger or smaller device for their wrist. Its neither a male watch nor a female watch. Both men and women can waer this watch and flaunt the looks equally matched with the latest fashion. The good integration of the Heart rate sensor and Accelerometer makes it a very good for all those health freaks.  Apple watch comes with the inbuilt workout application. During a dedicated cardio session, Apple Watch shows real-time stats such as time, distance, calories, pace, and speed

Different ways to bind Elements to Model in AngularJs

Different ways to Bind Elements to Model/ Directives You can bind the Angular Elements to the Model in the following ways. <span ng-bind="name"></span> <br/> <span ng:bind="name"></span> <br/> <span ng_bind="name"></span> <br/> <span data-ng-bind="name"></span> <br/> <span x-ng-bind="name"></span> <br/> Remove the x- or data-  from the start of the element attributes. e.g data-ng-bind and x-ng-bind can be written as ng-bind Convert the delimiters like :, -, _  to camelCase . Since the Html is case insensitive you can not use camelCase and you can use delimiters like :, -, _ to write your directives/angular . So the above ways are Following example in the Plunk shows the various ways to write our angular directive. Loading plunk... Now most of the above code works perfectly with angular js but they may cause HTML validation to fa

Best Acer Laptops

Acer Laptops When we talk about the Laptops for beginners or entry level laptops some of the best brands that offer these are ACER, HP, Lenovo, Samsung. Laptops are meant to give you a multifunctional computer. They have built-in Wi-Fi1 to give you the freedom to work and play wirelessly. Depending on the model, larger screen sizes, bigger hard drives and built-in DVD drives increase laptops' weight, which makes them less portable than netbooks but an excellent choice for your everyday computing needs.   And thankfully if you know where to look, it's possible to get a sleek and impressive laptop without blowing through your savings. Some of the key Features of the Acer laptops are  1. Design Design is essential in helping consumers choose a laptop and ACER provides some of the best and in class brand’s aesthetics, material choices and durability.  Another key factor to be noticed is the    benchmarks for Keyboard & Touchpads, Display and Audio category that the brand provid