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 = "+ (++count));
}
else {
cancel();
System.out.println("######### TASK CANCELLED #######");
}
}

}


TestTimerTask.java

import java.util.TimerTask;
import java.util.Timer;

class TestTimerTask {

public static void main(String args[]){

TimerTask task = new MyTask();
Timer timer = new Timer();
timer.scheduleAtFixedRate(task,0,1000);

}

}

 MyTask called  ### count = 1
 MyTask called  ### count = 2
 MyTask called  ### count = 3
 MyTask called  ### count = 4
 MyTask called  ### count = 5
#########    TASK CANCELLED    #######

So Thread goes on executing till it is stopped manually or till cancel() is called on the task.

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 operation ->{{"Hello" +" " + "World!" }}<hr/>

Math operation -> {{2 * 5 }}<hr/>

String &amp; Math operation ->{{"10 * 15 * 84 = " + (10 * 15 * 84)}}<hr/>

Json Operation ->{{'name = ' +json[0].name + ' age =' + json[0].age}}<br/>

{{'name = ' +json[1].name + ' age =' + json[1].age}}<hr/>

Array operation -> <span ng-bind="{{array}}"></span>
</body>

</html>

The above code will give you the following output.

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.
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 this phone is a great option for you. The video and audio quality of the phone is better than the other phone in the market in the same segment.


HTC Desire 320 

  • Quad-core 1.3 Ghz processor More cores results in better parallelism, that is more number of simultaneous tasks. 
  • 4.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 4 GB internal memory. It has an extendable slot for memory card so that you can carry all your cool stuff with you. 
  • 5 MP camera. It is good enough to get good quality pictures for taking sharp and clear photos. 
  • 2100 mAh battery that will last for a day. Awesome audio quality with support for all types of audio formats. 
  • Android , v4.4.2



So if you are looking for a cool, sleek and good looking phone with some cool specs in a budget range than this phone is a must check out option. Another great feature of this phone is the different UI of android which will make it a bit different from the other android phones.


Also checkout other HTC Mobiles in this segment.


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 
  1. Stainless Steel case
  2. Sapphire crystal
  3. Ceramic back
  4. Heart Rate sensor, Accelerometer and gyroscope
  5. 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.

Other in built applications of Apple watch are

  • Messages
  • Calls
  • Mail
  • Calender
  • Maps
  • Music
  • Stocks
  • Stopwatch, timer and alarm
Built-in Apple apps, on the other hand, work far more smoothly. Maps allows for quick navigation and turn-by-turn directions that work well in tandem with the iPhone while paired to my car's Bluetooth audio: when driving, my wrist tapped and pinged to indicate left and right turns in advance of exit announcements, and quick glances always showed me the next turn, plus how far away it was.

Apple iPhone 6

Some of the key features of iphone 6 are

  • Quality customer service
  • Impressive hardware
  • Highly durable
  • 4.7 inch screen that is big but not not too big
  • 8 MP and 1.2 MP cameras that are too impressive as compared to other phones in segment
  • Awesome audio quality
  • Cool color to choose from
As always with Apple’s phones the iPhone 6 has superb balance, it feels right in the hand regardless of orientation. The comfy edges are also a lot easier on the palm than the sharper ones on the iPhone 5S and the 6.9mm thickness makes it feel sleek yet strong.


See the Apple Phone here and choose the best that suits your needs.

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/>

So the above ways are
Following example in the Plunk shows the various ways to write our angular directive.




Now most of the above code works perfectly with angular js but they may cause HTML validation to fail. So if you want your code to be Html validatable then you should use

 <span data-ng-bind="name"></span> 

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 provides.

2. Technical Support

Acer is regarded as one of the best for its quality support. With Acer starting the online Tech support along with the traditional on call support has given it an edge over other key players in the market.

3. Keyboard and Touchpad.

Acer’s keyboards and touchpads are as varied as its notebook lineup, with some models providing comfortable, accurate results and others feeling flat. While the keyboards on the Aspire E15 Touch and Aspire Switch 10 offer deep travel and a snappy feel.

4. Audio 

Loud is not always good. Acer laptops are equipped with some good quality speakers and Audio profiles. Some of the Acer laptops also come with Dolby Digital Plus, which lets you choose from multiple sound profiles to customize what you hear. 

5. Storage

Acer’s Cloud app and the Clear.fi software suite have been replaced by the company’s Build Your Own Cloud (BYOC) software, which comes with all Acer notebooks. BYOC is different from Dropbox in that you directly access your device’s hard drive remotely. This means that the storage you get is pretty much up to you, and typically much more than cloud services offer for free. Along with this it also comes with 320GB,512GB and 1TB HDD's.

Some of the best Acer Laptops are listed in the list below with their Key Features



Acer Travelmate P645

    • Core i7 processor
    • Discrete graphics
    • 9:46 of battery life
    • High Performance
    • Strong security features


Acer Aspire S7-392

  • Intel Core i5 processor
  • Super-slim
  • 1080p touch-screen
  • Snow White color 
  • Bloatware-free




Acer Chromebook 13

    • Cloud-based machine
    • 1920 x 1080-pixel glare-resistant HD display
    • Tegra K1 processor
    • 13" screen.
    • Glare-resistant full HD screen
    • Long battery life







You can also view the wide range of other ACER Laptops on the following link and choose the one that fits your needs the best.



So these are some of the Best Acer laptops that i would recommend. To know more and find a