Author Archives: mohittare

Using FullCalendar jQuery plugin with Java.

JQuery

JQuery (Photo credit: Wikipedia)

Duke, the Java Mascot, in the waving pose. Duk...

Java

Hello friends, Today i am going to show you how to use the Full Calendar jQuery plugin in your Java web application. The reason i am writing this blog post because while I was trying to use the plugin in my project , I couldn’t  find enough resources or rather a full fledged example that demonstrated its use.

I assume that you are familiar with Full Calendar, jQuery, Java Servlet technology And JSON ,so I am not going to explain them.

STEP 1:

Download the Full Calendar plugin and reference them in your file(in my case JSP) in which you want to display the Full Calendar. You can also apply a jQuery UI theme to your calendar.

</pre>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="jquery-ui-1.10.0.custom.css" rel="stylesheet" type="text/css" media = "all"/>
<link rel='stylesheet' type='text/css' href='cssdata/fullcalendar.css' />

<script src="js/jquery-1.9.0.js"></script>
<script src="js/jquery-ui-1.10.0.custom.min.js"></script>
<script type='text/javascript' src='js/fullcalendar.js'></script>
<pre>
$(document).ready(function() {
		$('#calendar').fullCalendar({
			theme: true,
			editable: false,
			events: "/CalendarProject/CalendarJsonServlet"
		});

	});
</script>
<div id="calendar"></div>

Now the references are set,so  we can now use the calendar inside the view.For that we create a div  with the id = “calendar”.The calendar data which will be using is a fetched from URL(Servlet URL) which will be providing the JSON feed.

STEP 2:

In the step 2 we will create the servlet CalendarJsonServlet and the java class which will be used in providing the JSON feed.

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
 List l = new ArrayList();

 CalendarDTO c = new CalendarDTO();
 c.setId(1);
 c.setStart("2013-07-28");
 c.setEnd("2013-07-29");
 c.setTitle("Task in Progress");

CalendarDTO d = new CalendarDTO();
 c.setId(2);
 c.setStart("2013-07-26");
 c.setEnd("2013-08-28");
 c.setTitle("Task in Progress");

 l.add(c);
l.add(d);

 response.setContentType("application/json");
 response.setCharacterEncoding("UTF-8");
 PrintWriter out = response.getWriter();
 out.write(new Gson().toJson(l));
 }

}

Here have created a servlet in which we have created a List of Event objects.For sample I have created two CalendarDTO objects namely c and d.Then we are using the Google GSON, a JSON library to convert the list into a JSON feed. The explanation about use of GSON is given here.

Now the final task that is creating the CalendarDTO class.It will contain getters and setters for the event source object fields.

public class CalendarDTO {
	public int id;
	public String title;
	public String start;
	public String end;
	public String color;
	public String getColor() {
		return color;
	}
	public void setColor(String color) {
		this.color = color;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getStart() {
		return start;
	}
	public void setStart(String start) {
		this.start = start;
	}
	public String getEnd() {
		return end;
	}
	public void setEnd(String end) {
		this.end = end;
	}

}

So finally we get the desired result and the calendar view is displayed.All the operations you want like querying the database you can do that in the servlet.

calendar view

calendar view

So Enjoy and if any suggestions write in the comments as I am also a beginner in this.Enjoy! Cheers ! 😀

Hadoop : What is it and is it a Rocket Science to learn?

The turbulence that Big Data is causing today in the IT sea is enormous. With this new era of Big Data the IT giants have really understood that the power of Big Data is really BIG if we can harness it.

big data

The nature of Big data

With the complexity that is lying around Big Data , comes the savoir Hadoop.

What is Hadoop ? Apache Hadoop is an open source Java framework for processing and querying vast amounts of data . I do agree that Hadoop is little bit complex to learn for a beginner but not really a rocket science to learn and practice some beginner tasks.

OK this looks interesting but from Where do i learn about Hadoop ? : You can entirely learn it by yourself specially with the world wide web for our help.

Source 1 : EMC Corporation Big ideas Video Playlist : Yes This may seem a bit naive and simple but they have made an amazing video series to understand and learn about what is Big Data and What is Hadoop. In fact its one of the fastest way to gain an overview of hadoop.

Link : http://www.youtube.com/playlist?list=PLD298CBF8D0908E4C

Source 2: Join Big data University : Yes you heard it right. Big data university has a bunch of amazing courses on Hadoop technology. The beginners entry point will be Hadoop fundamentals course. This course will teach you all the basics of Hadoop. Based on my personal experience it is a nice way to dig a bit deeper into Hadoop.

Link : http://bigdatauniversity.com/courses/

Source 3:  Hadoop in practice:  I really have not gone much deeper into this book , but yes the reviews tell it is good book to study and learn about Hadoop.

Link : http://www.amazon.com/Hadoop-Practice-Alex-Holmes/dp/1617290238

Source 4: Hadoop Tutorial from YDN and IBM Developer Works : The Yahoo developer networks and IBM developer works have also a bunch of amazing tutorials on Hadoop. IBM developerWorks have a bit advanced tutorial on other technologies related with hadoop like Hive,Pig Flume etc.

Link :  Yahoo YDN Hadoop Tutorial : http://developer.yahoo.com/hadoop/tutorial/module1.html

Link : IBM developerWorks : http://www.ibm.com/developerworks/data/library/techarticle/dm-1209hadoopbigdata/

Source 5: Apache Hadoop wiki and official web Page : Always if you want to dig more you can refer to Apache Hadoop official wiki.

Link : http://hadoop.apache.org/docs/current/

Ok now I have learnt about the basics now what ? Now time to see it action. The biggest hurdle that i faced is setting up an single node cluster on Hadoop and how to configure it to learn. I will post about it soon.

Meanwhile here is my presentation on Big Data and Hadoop which will also serve as an insight .

So Enjoy and happy Learning ! 😀

Courtesy : EMC Corporation Big Ideas,IBM developerWorks, Yahoo YDN, Apache Hadoop.

A Closer Look out from the window !

Today mostly our day starts with us sitting on the Windows( i mean) our PC. We usually follow a daily routine which usually starts with checking e-mails with the music player playing the same music that we hear everyday. We are online available on our Facebook Account , checking our wall , distributing free likes and specially commenting on spams like

comment 78 and press like and see what happens.

Boredom is our no 1 enemy even if we have power of Web and so called private space. A lot of people are available online but we are too negligent to chat. A one paisa per second pack is on our mobile phones yet we only call when we have some work.

Rust window

We are so sucked in the world of electronic media that we are unaware that there is actually a rusty window just beside us. That old window which was once our world to call our childhood gang , to eagerly wait for kulfi wala that came in the summer , to which we quickly rushed after we heard a sound of bat hitting ball , through which the sound of old bajaj scotter starting in the morning  was pleasant and unpleasant at the same time.

That old window which spread the aroma of the old chandan agarbattis  offered during the pooja to Tulsi plant. A fresh ray of sunlight that it bestows upon us after the last chilling night. That  window which provided us with sound of idliwala and the loud argument between two old uncles playing the chess.

The window was itself our imagination portal and we sat there for hours doing nothing. Today when such memories flash in our mind, we try to find significance in them but the more try to find significance in them the more we are hypnotized by them. Motion was itself entertainment at that time.

So when such memories came to mind before writing this blog post I asked myself a simple question “Am i living Life fully ?” .The obvious answer was NO. What can we do about it ? Sometimes may be we should Log off the new Window that is today our part of life and look out of the old Rusty Window.

May be we will find a new sense of happiness and experience something extraordinary (that is originally ordinary :D) .

enjoy-the-lovely-moment-quote

Cheers until next Time!

Ubuntu for phones is out there !

When surfing up on You Tube , we usually see a battle for smartphones. Right from the hardware to the software. Windows vs ios vs android. We are today captured and hypnotized by these smart phones.

Needless to say the reason being how elegantly they can integrate with your life and the power that they provide you at the edge of your palm.We are becoming digital as we are sitting most of the day in front of our laptop , Tablet or phone .

Photo: happen with me like if with you

So why not take all our devices and integrate them as one . Just one Operating system , one address book , one personal cloud for all. That is where Ubuntu took a leap of Faith and is out ready to come up with a Ubuntu for phones.

When I first saw its features and design , I realized the exceeding fast rate of the mobile OS market is growing

According to The Verge, Ubuntu for phones is built around the Android kernel and drivers, but doesn’t use a Java Virtual Machine and also, it supports both ARM and x86 processors.

“The Phone you can see yourself  in” , its designed elegantly such that it uses all its edges. Very similar to Ubuntu Linux in many ways including UI , this OS is designed in way that it uses power of HTML 5 to take full advantage of web along with the native apps.

Jane Silber says on the Canonical blog  that Ubuntu for phones will make use of the installable web apps available in Ubuntu 12.10. Also, there’s a QML-based Ubuntu SDK that developers can use to create native apps that work both on the desktop and the phone and then deliver then in the Ubuntu Software Center.

A smartphone OS that becomes a full PC when docked the Ubuntu for android merges your two face desktop and mobile life into one.

Check out this video about What is Ubuntu for Android ?

Also a good news for developers looking for developing a mobile application . Now with  QML toolkit that Ubuntu provides develop applications that can run on traditional desktop along with the handset. So there is a lot of excitement and expectations and I am really Happy to see  Ubuntu making a change and developing such Good and rich OS. Ubuntu Rocks 😀 !

Here are some images via ubuntu.com

phone-home-screen_thumb             phone-photo-gallery phone-conversations-324x576_thumb

Related Links –

Ubuntu for phones.

Ubuntu app Developer

Ubuntu for android 

Evernote and Udacity – A perfect way to increase your productivity

Udacity - Introduction to Statistics (ST101)

Udacity – Introduction to Statistics (ST101) (Photo credit: AJC1)

Udacity is an altogether different learning experience.For those who have still not heard of it , Udacity is the digital university founded by  Sebastian Thrun, David Stavens, and Mike Sokolsky, with the stated goal of democratizing education .  It is now offering 11 active courses related to Computer Science and other basic sciences.So check it out if you haven’t.:)

Now I am a Udacian , and between a busy schedule I was unable to find a way to continue my digtal learning and other college work.It resulted in a long gap of about 1/2 a month and it was really hard to get track of course again. So out of the box ,one day I searched the web how to pool out time for the self directed learning between my tight schedule. So i will share some of my tips to increase productivity.

 

Evernote

 

The savior Evernote comes to picture.Now Evernote was a software that was sitting right there on my laptop and i was rarely using it . And I started using it for my learning at udacity. Here are some tips –

  1. Start using evernote to take notes : Make a separate notebook in evernote and start taking notes while watching videos.You can also take handwritten notes as well as type notes.
  2. Take Screenshots and make nuggets of important code : Stop the video when you a really studying a difficult concept,Take a screenshot(windows+printscreen) and that screenshot remains at all times in your evernote account.Access it from anywhere your laptop or PC in home or your android, iPhone, iPad in college.
  3. Store your Course reference right in Evernote :  Use Chrome to save your course notes in pdf form (Ctrl + P) and store right it in evernote notebook . As evernote can directly store your pdf , no need of storing it separately in all your devices.
  4. Use shared notebook for group learning :  Use the shared notebook between your friends to learn in group.

All this about use of tool, Now some additional tips to manage time.

  • Block out at least 10 min from your schedule to review your evernote notebook . I have myself experienced just watching a screen clip on your phone can make you remember an entire video nugget.
  • On a weekend Block out 2-3 hrs at a stretch.although it seems difficult but sure you can manage it . Use it for continuous learning and reward yourself a pizza at night. 🙂
  • Try viewing at least 1 video nugget in the morning . So it stays in your brain entire day.
  • Compete between your group so as to increase your pace of learning like who completes unit first . 
  • Stay Udacious and Have a burning desire . Have a fire in you to learn and determination to complete the course with the best grade.

So that’s all . Comment if you have any additional ideas . Enjoy!

I am a Udacian and I use Evernote!

The age of netbooks!

The new age of net-books!

Earlier was the age when we used to use the large bulky PCs with heavy monitors which was later replaced by modern computers having a smart TFT display,which later came to laptops and now we have net-books.

Net-books are light-weight,small,devices that are creating the buzz in today’s digital market.Now in somewhere about  May11 Google released its Chromebook powered by Google Chrome operating system which is supposed to be first totally cloud based operating system.

Also Google released the source code as Chromium OS project-an open source initiative.Some of features of Chrome OS are

A SIMPLE USER INTERFACE: Now Google designed Chrome OS making its UI as simple and as streamlined as possible and making it somewhat similar to chrome browser.So we can just start using the OS with no worries 🙂

THE SPEED of chrome OS is the strong point which beats all .It boots very fast almost in 8-9 sec and you can start working on it.It automatically updates with connection to internet.But I personally like its SECURITY features.It uses the Defense-in-Depth approach with a verified boot,data-encryption.

In verified Boot each section of the operating system is booted one after other.Verified boot starts with a read-only portion of firmware, which only executes the next chunk of boot code after verification .Verified boot strives to ensure that all executed code comes from the Chromium OS source tree, rather than from an attacker or corruption.

So minimized threats from attacks,malwares, and no problems and hiccup of antivirus.For more information on verified boot click here.With inbuilt Connectivity by Wi-fi and 3G make it flexible to be connected to world anywhere and anytime.Also any app that you would write for the web can be a Chrome app.Thousand of apps can be available from Chrome Web Store.So enjoy variety of apps at doorstep !

So I feel Chrome OS and Chromebooks have really revolutionized the market and changed our view of computing !

First Step into blogging……………Why & how?

LIFE is all about events.Events trigger various feelings and make our opinions about various things in life.These events come together and in turn paint the canvas of life with phases which in turn change the role of the man at various points……………………But what makes a man’s life different is the impressions left on his life’s canvas by other people……….!

quote by mark jwain

Like all other living beings, I am also a person standing on a phase of life.I am Mohit Tare , a second year C.Tech student. Sharing your experiences with others gives us a lens to closely look upon our life’s canvas, and thereby improving it……………

Now coming to technology……..technology has a unique relation with life. Each technology that you learn is for benefit of others. So whatever your skill is for others. So I will share with you the recent changes that are happening in our world. So keep reading…………Enjoy, learn, practice , share and cheers!

My Computer

A lot About Technology and a Little about Life!