Archive for June, 2009


Java Thread Methods: currentThread(), isAlive() and Thread.sleep()

Sunday, June 28th, 2009

Couple of important notes from my Threading blog collection. I’m going to go threw some methods that are in the Thread class as noted above.

(more…)

Java Threads Basics

Saturday, June 27th, 2009

The ability to do multiple tasks at the same time. Threaded programming is about more than parallelism, it’s also about simpler program design. Concurrency also includes the ability to access data at the same time in two or more threads. These are problems of data synchronization which lock one thread to one method so that multiple threads does not access the same method.

Threading was first used to make programs easier to write. If a program can be split into separate tasks, it’s often easier to program the algorithm as separate tasks or threads. I’m going to show you how to create a Thread and use it, and whether you should implement the Runnable interface or extend the Thread class.

(more…)

Read A Zip File In Java

Monday, June 22nd, 2009

This is a quick tip on how to read the content of a Zip file with Java. We are going to print out file names inside the Zip file using the Java console. You can modify this in anyway you want by printing out the content in a JFrame.

(more…)

Play Sound In Java

Monday, June 22nd, 2009

This is a quick and easy way to play sound in Java.

(more…)

The Hangover

Monday, June 22nd, 2009

One of the funniest movies out there. I was truly surprised over how funny and cool the movie is. This movie is worth every penny.

The movie is about some friends going for a bachelor-party held for a bachelor shortly before he enters marriage, to make the most of his final opportunity to engage in activities a new partner might not approve of, or merely to spend time with his male friends (who are often in his wedding party afterwards).

The bachelor and his friends did some really crazy stuff together at Vegas. In the next morning they forget everything. They lose the bachelor so they try to find him.

Java JSON Converter

Friday, June 19th, 2009

I recently developed two Ajax web applications for clients written in Java and JavaScript. The main problem I had was converting my Java Objects to JavaScript Objects so that I can manipulate and do visual changes…etc

The first thing you do is to visit json.org and download the JSON parser from there. The problem with that parser is that you have to manually add attributes to the object. This can take a while.

I wanted a simple JSON parser that take my Java Object(s) and convert them to JSON without having to hassle around and adding attributes again to JSON object.

That’s why I found Google GSON. What’s great about this is that it’s a Java library that can be used to convert Java Objects into its JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.

You need to import src files to your project, then use them by declaring a GSON object and using its methods.

From LINQ To JSON

Friday, June 19th, 2009

This is a quick note on how to convert your LINQ Objects to JSON String. I had some issues doing so when only using the LINQ Class but did a quick fix by creating my own class and setting it up with the same information as the LINQ Object.

(more…)

I Underestimated Sin City

Friday, June 19th, 2009
SinCity Movie DVD Cover

The first time I watched Sin City the movie it was horrible. I underestimated the movie quite allot. I watched it the first time at night and did not like nor understand how the movie is telling you the story.

Two days ago from today, I watched it again. To tell you the truth I really loved it. I was surprised of how well this movie is.
Watch it.