<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Lonely Coder</title>
	<atom:link href="http://hamzeen.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://hamzeen.wordpress.com</link>
	<description>Plan your Code. Code your Plan.</description>
	<lastBuildDate>Mon, 19 Oct 2009 05:26:18 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='hamzeen.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2a54c1d60bd79607cec60742b79ab1eb?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Lonely Coder</title>
		<link>http://hamzeen.wordpress.com</link>
	</image>
			<item>
		<title>Exploring a street of Kyoto with Engage.</title>
		<link>http://hamzeen.wordpress.com/2009/10/17/exploring-a-street-of-kyoto-with-engage/</link>
		<comments>http://hamzeen.wordpress.com/2009/10/17/exploring-a-street-of-kyoto-with-engage/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 20:24:30 +0000</pubDate>
		<dc:creator>hamzeen</dc:creator>
				<category><![CDATA[Augmented Reality]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://hamzeen.wordpress.com/?p=286</guid>
		<description><![CDATA[Well the title might sound a little strange and confusing. Never the less, as most of us know Kyoto is a city in japan should have said a beautiful one at that and Engage is the project which I work these days. Things are really getting heated both with the project and rest of the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=286&subd=hamzeen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well the title might sound a little strange and confusing. Never the less, as most of us know Kyoto is a city in japan should have said a beautiful one at that and Engage is the project which I work these days. Things are really getting heated both with the project and rest of the stuffs that I&#8217;m up to these days causing me to go quite for sometime.</p>
<p>Anyhow, one of the things which impressed a lot at the start of this project was Augmented Reality (AR) where virtuality and reality come together. Normally, a virtual object or an animation is augmented on a real video or an image (content) using a marker where the virtual object always shown on top of the real content. But my interest, ever since I first happen to see this was on using it for computer interaction besides there are many possibilities that exists with AR specially when it is combined with holography which can surely bring to light an unseen dimension to our lives and produce great results.</p>
<p>Getting back to the post, this shows an example panorama which can be explored using a marker. It was intentional here to refrain from augmenting specially, to show the possibility of using marker for interaction and even for wearable computing. Enjoy <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="text-align:center; display: block;"><a href="http://hamzeen.wordpress.com/2009/10/17/exploring-a-street-of-kyoto-with-engage/"><img src="http://img.youtube.com/vi/3pm0EFteyVQ/2.jpg" alt="" /></a></span></p>
<p>Acknowledgments:</p>
<p>I have adapted an image of a street in Kyoto for the example which is available at, <a title='Gion Street in the evening under lights' target='_blank' href='http://wallpaper.free-photograph.net/en/photobase/yp5745.html'>http://wallpaper.free-photograph.net/en/photobase/yp5745.html</a></p>
<p>And the background music for this video was taken from,<br />
<a title='Piano and Strings by Ihaveriffs' href='http://ccmixter.org/files/Ihaveriffs/22440' target='_blank'>http://ccmixter.org/files/Ihaveriffs/22440</a> which was released under creative commons license.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hamzeen.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hamzeen.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hamzeen.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hamzeen.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hamzeen.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hamzeen.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hamzeen.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hamzeen.wordpress.com/286/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hamzeen.wordpress.com/286/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hamzeen.wordpress.com/286/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=286&subd=hamzeen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://hamzeen.wordpress.com/2009/10/17/exploring-a-street-of-kyoto-with-engage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ffe4475e185518cee0e4daff9a9a20e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hamzeen</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/3pm0EFteyVQ/2.jpg" medium="image" />
	</item>
		<item>
		<title>Firefox Party at IIT</title>
		<link>http://hamzeen.wordpress.com/2009/09/22/firefox-party-at-iit/</link>
		<comments>http://hamzeen.wordpress.com/2009/09/22/firefox-party-at-iit/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 18:30:50 +0000</pubDate>
		<dc:creator>hamzeen</dc:creator>
				<category><![CDATA[Adventure]]></category>
		<category><![CDATA[Events]]></category>
		<category><![CDATA[Open source]]></category>

		<guid isPermaLink="false">http://hamzeen.wordpress.com/?p=278</guid>
		<description><![CDATA[Well it was the first day of lectures for us after the completion of placement. No doubt it&#8217;s going to be a  hectic year ahead of us. But there was a huge surprise and sudden fun surrounded us during our short break of half an hour between the first two lectures.
It was not more [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=278&subd=hamzeen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Well it was the first day of lectures for us after the completion of placement. No doubt it&#8217;s going to be a  hectic year ahead of us. But there was a huge surprise and sudden fun surrounded us during our short break of half an hour between the first two lectures.</p>
<p>It was not more than one and a half month since I joined spread firefox as a campus rep. And ma first opportunity to grab a swags pack came just few weeks back and for ma amazement I received the pack within three weeks. After discussing with some of the other firefox freaks at <a target="_blank" href="http://www.iit.ac.lk">IIT</a>, we decided to through the party on the very first day itself.</p>
<p>So unexpectedly, the break between the first two lectures turned out be the time for Firefox Party. I should thank CJ for helping me immensely to get it underway in no-time.</p>
<p>There was great curiosity to know how to get swags pack on their own hence, we gave a glimpse of Spread Firefox and Campus Reps Initiative and also some materials related to getting started with Firefox Add-ons development for those who were interested on it. So hope to see some new reps in action from IIT very shortly. The event was thoroughly entertaining and was a tremendous experience. Everyone seem to have  enjoyed it to the utmost. Expecting more of these FF Parties at IIT in the near future.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hamzeen.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hamzeen.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hamzeen.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hamzeen.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hamzeen.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hamzeen.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hamzeen.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hamzeen.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hamzeen.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hamzeen.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=278&subd=hamzeen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://hamzeen.wordpress.com/2009/09/22/firefox-party-at-iit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ffe4475e185518cee0e4daff9a9a20e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hamzeen</media:title>
		</media:content>
	</item>
		<item>
		<title>Getting wired for the final year Project.</title>
		<link>http://hamzeen.wordpress.com/2009/08/22/getting-wired-for-the-final-year-project/</link>
		<comments>http://hamzeen.wordpress.com/2009/08/22/getting-wired-for-the-final-year-project/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 10:05:56 +0000</pubDate>
		<dc:creator>hamzeen</dc:creator>
				<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[OpenCV]]></category>

		<guid isPermaLink="false">http://hamzeen.wordpress.com/?p=273</guid>
		<description><![CDATA[I&#8217;m back after a long break. Ever since, I finished ma placement I was quote up with some projects and never had time to make post. Anyway this marks the start of another huge project in ma undergraduate studies. Yes, this is all bout getting wired for ma final year project.
The Project falls into the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=273&subd=hamzeen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m back after a long break. Ever since, I finished ma placement I was quote up with some projects and never had time to make post. Anyway this marks the start of another huge project in ma undergraduate studies. Yes, this is all bout getting wired for ma final year project.</p>
<p>The Project falls into the main stream of HCI (Human Computer Interaction) which will also involve a fair bit of wireless communication and motion sensing. But the first part of the project is to control a PC with hand and to provide support for all desktop applications.</p>
<p>The idea is to use a web cam and track hand movements and then define various methods for simulating all possible mouse events with a set of hand gestures. And going a step further, it is also planned to provide a drawing pad kind of an application where the user can draw various symbols and directly execute keyboard shortcuts without having to press any key (or key combination) on the keyboard.</p>
<p>So for the first part it will involve a lot of image processing and I&#8217;ll be using OpenCV for it. I chose OpenCV because it is open source and provides ample support for motion tracking. And since it&#8217;s C/C++ based it&#8217;s easy for me to get started with it as well.</p>
<p>I initially wanted to setup Visual Studio (2008) and configure OpenCV on it. But I failed badly on my Vista. Though it got installed alright, I couldn&#8217;t initiate a c++ project owing to a problem in launching the wizard for it. Anyway this was a known issue and was caused due to a permission issue with one of the registry keys associated with Visual Studio.</p>
<p>After a bit of digging I found a nice light weight open source IDE which also supports C/C++ development. After mapping it with the compiler(MinGW) and pointing OpenCV libraries I was able to code ma hello world in a flash.</p>
<p>The IDE now I&#8217;m using is Dev C++ and works wonderfully well with MinGW. If you are interested you can follow this tutorial which I also followed,<br />
<a href="http://www.cypax.net/tutorials/opencv/index?language=en" target="_blank">http://www.cypax.net/tutorials/opencv/index?language=en</a></p>
<p>And if you are using the latest version of OpenCV make sure you don&#8217;t include -lcvcam to the linker command line. And the tutorial assumes that you have already setup MinGW if that&#8217;s not the case you may visit,<br />
<a href="http://mingw.org" target="_blank">http://mingw.org/</a></p>
<p>Once you finish installing MinGW, you will also require to add MinGW bin to your path variable. Hope this will be useful if you are a windows vista user wanting to kick start with OpenCV image processing library.</p>
<p>After playing around with some tutorials and samples code I was able detect a moving object and bind the mouse pointer to the moving object but this looks very unstable at the moment. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="text-align:center; display: block;"><a href="http://hamzeen.wordpress.com/2009/08/22/getting-wired-for-the-final-year-project/"><img src="http://img.youtube.com/vi/O4AK7dSWKlk/2.jpg" alt="" /></a></span></p>
<p>Above I have used color space conversion, Contours finding and Edge Detection. And now I&#8217;m working on template matching. Hope when it&#8217;s combined with Template Matching it can produce better results. And make it a lot stable. Below I also share a screen shot of template matching (performed on an image). I&#8217;m yet to apply it on a video. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_274" class="wp-caption aligncenter" style="width: 487px"><img class="size-full wp-image-274" title="tplmatch" src="http://hamzeen.files.wordpress.com/2009/08/tplmatch.jpg?w=477&#038;h=385" alt="Template Matching via OpenCV" width="477" height="385" /><p class="wp-caption-text">Template Matching with OpenCV</p></div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hamzeen.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hamzeen.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hamzeen.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hamzeen.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hamzeen.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hamzeen.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hamzeen.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hamzeen.wordpress.com/273/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hamzeen.wordpress.com/273/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hamzeen.wordpress.com/273/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=273&subd=hamzeen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://hamzeen.wordpress.com/2009/08/22/getting-wired-for-the-final-year-project/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ffe4475e185518cee0e4daff9a9a20e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hamzeen</media:title>
		</media:content>

		<media:content url="http://img.youtube.com/vi/O4AK7dSWKlk/2.jpg" medium="image" />

		<media:content url="http://hamzeen.files.wordpress.com/2009/08/tplmatch.jpg" medium="image">
			<media:title type="html">tplmatch</media:title>
		</media:content>
	</item>
		<item>
		<title>Developing a Desktop Widget in JAVA</title>
		<link>http://hamzeen.wordpress.com/2009/05/12/developing-a-desktop-widget-in-java/</link>
		<comments>http://hamzeen.wordpress.com/2009/05/12/developing-a-desktop-widget-in-java/#comments</comments>
		<pubDate>Tue, 12 May 2009 03:03:11 +0000</pubDate>
		<dc:creator>hamzeen</dc:creator>
				<category><![CDATA[JAVA]]></category>
		<category><![CDATA[desktop enhancements]]></category>

		<guid isPermaLink="false">http://hamzeen.wordpress.com/?p=247</guid>
		<description><![CDATA[This widget will be developed using Eclipse SWT. Hence assuming you already have java and eclipse, you will also require to download Eclipse SWT zip. Which you can download on,
http://www.eclipse.org/swt/
Though to develop this particular widget you will not require a expertise knowledge in Eclipse SWT. You can go through,
http://www.eclipse.org/swt/eclipse.php
in order to get started with SWT. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=247&subd=hamzeen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This widget will be developed using Eclipse SWT. Hence assuming you already have java and eclipse, you will also require to <strong>download Eclipse SWT zip</strong>. Which you can download on,</p>
<p><a href='http://www.eclipse.org/swt/' target='_blank'>http://www.eclipse.org/swt/</a></p>
<p>Though to develop this particular widget you will not require a expertise knowledge in Eclipse SWT. You can go through,</p>
<p><a href='http://www.eclipse.org/swt/eclipse.php' target='_blank'>http://www.eclipse.org/swt/eclipse.php</a></p>
<p>in order to get started with SWT. But it&#8217;s not really necessary here and you can still go through this even if you are an absolute starter in SWT. And still you will have a fair knowledge on SWT at the end of this post. If you wanna have more of SWT, you can go through,</p>
<p><a href='http://www.eclipse.org/swt/snippets/' target='_blank'>http://www.eclipse.org/swt/snippets/</a></p>
<p>Which should cover all what you need to know about SWT. Let&#8217;s get to the business end of life.</p>
<p>1. Open up your eclipse and <strong>create new project</strong> and name it with whatever name you wish (In my case it was &#8220;WidgetPro&#8221;).</p>
<p>2. Now again go to file menu and select <strong>import</strong>. And under general select &#8220;<strong>select archive</strong>&#8221; <strong>check box</strong> (it will not be selected by default) and browse to <strong>point the downloaded &#8220;swt-3.x*.zip&#8221;</strong>.</p>
<p>3. Create a <strong>new folder</strong> inside your project&#8217;s src (source). And <strong>name it &#8220;images&#8221;</strong>. Download the following images and place them inside the folder which you just created.</p>
<p><img src='http://hamzeen.files.wordpress.com/2009/05/searchbox.png'><br />
<img src='http://hamzeen.files.wordpress.com/2009/05/ico.png'></p>
<p><b>N.B.</b> Your widget will take the shape of the first image.</p>
<p>4. Now you can create new class, name it &#8220;<strong>GSearchWidge</strong>t&#8221;. And paste the following code into it.</p>
<pre>
import java.awt.TextField;

import org.eclipse.swt.*;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.browser.TitleEvent;
import org.eclipse.swt.browser.TitleListener;
import org.eclipse.swt.graphics.*;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;
import org.eclipse.swt.browser.*;
import org.eclipse.swt.layout.*;

import java.awt.Frame;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;

/**
 * @author Lonely Coder
 * @date 12/05/2009
 * http://hamzeen.wordpress.com
 *
 * @since 3.2
 */
public class GSearchWidget {
	public static void main(String[] args) {

	final Display display = new Display();
	String currentDirectory = System.getProperty("user.dir");
	final Image image = new Image(display, "images/searchBox.png");
	final Image icon = new Image(display, "images/ico.png");
	Color green = display.getSystemColor(SWT.COLOR_DARK_GREEN);
	GC gc = new GC(image);
	// final Image image = display.getSystemImage(SWT.ICON_INFORMATION);
	final Shell shell = new Shell(display, SWT.NO_TRIM);
	shell.setText("G Search.");
	display.setAppName("G App.");
	shell.setImage(icon);
	shell.setAlpha(480);
	shell.setLocation(800, 20);
	shell.setToolTipText("Lonely Coder Labs.");
	Region region = new Region();
	final ImageData imageData = image.getImageData();

	if (imageData.alphaData != null) {
		Rectangle pixel = new Rectangle(0, 0, 1, 1);
		for (int y = 0; y &lt; imageData.height; y++) {
			for (int x = 0; x &lt; imageData.width; x++) {
				if (imageData.getAlpha(x, y) == 255) {
					pixel.x = imageData.x + x;
					pixel.y = imageData.y + y;
					region.add(pixel);
				}
			}
		}
	} else {
		ImageData mask = imageData.getTransparencyMask();
		Rectangle pixel = new Rectangle(0, 0, 1, 1);
		for (int y = 0; y &lt; mask.height; y++) {
			for (int x = 0; x &lt; mask.width; x++) {
				if (mask.getPixel(x, y) != 0) {
					pixel.x = imageData.x + x;
					pixel.y = imageData.y + y;
					region.add(pixel);
				}
			}
		}
	}
	shell.setRegion(region);

	Listener l = new Listener() {
	int startX, startY;

	public void handleEvent(Event e) {
		if (e.type == SWT.KeyDown &amp;&amp; e.character == SWT.ESC) {
			shell.dispose();
		}
		if (e.type == SWT.MouseDown &amp;&amp; e.button == 1) {
			startX = e.x;
			startY = e.y;
		}
		if (e.type == SWT.MouseMove &amp;&amp; (e.stateMask &amp; SWT.BUTTON1) != 0) {
			Point p = shell.toDisplay(e.x, e.y);
			p.x -= startX;
			p.y -= startY;
			shell.setLocation(p);
		}
		if (e.type == SWT.Paint) {
			e.gc.drawImage(image, imageData.x, imageData.y);
		}
		}
	};
		shell.addListener(SWT.KeyDown, l);
		shell.addListener(SWT.MouseDown, l);
		shell.addListener(SWT.MouseMove, l);
		shell.addListener(SWT.Paint, l);

		shell.setSize(imageData.x + imageData.width, imageData.y
				+ imageData.height);

		final Text txt = new Text(shell, SWT.WRAP | SWT.BORDER);
		txt.setBounds(20, 20, 100, 20);

		txt.addListener (SWT.Verify, new Listener () {
			public void handleEvent (Event e) {
				String string = e.text;
				System.out.println(e.text);
			}
		});

		Button go = new Button(shell, SWT.PUSH);
		go.setBackground(shell.getBackground());
		go.setText("Search");
		go.pack();
		go.setLocation(125, 18);
		go.setFocus();

	go.addListener(SWT.Selection, new Listener() {
	public void handleEvent(Event e) {

	//System.out.println("Clicked" + txt.getText());
	try {
	URL query = new URL("http://www.google.com/
        search?q=" + txt.getText());
	Runtime.getRuntime().exec("rundll32 url.dll,File
        ProtocolHandler " + query);
	} catch (MalformedURLException mue) {
		System.out.println("Ouch - a MalformedURLException happened.");
		mue.printStackTrace();
		System.exit(1);
	} catch(IOException io){
		System.out.println("Exception");
		//throw Exception("");
	}
	txt.setText("");
	}

	});

		Button b = new Button(shell, SWT.PUSH);
		b.setBackground(shell.getBackground());
		b.setText("X");
		b.pack();
		b.setLocation(190, 5);
		b.addListener(SWT.Selection, new Listener() {
			public void handleEvent(Event e) {
				shell.close();
			}
		});

		shell.open();

		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		region.dispose();
		image.dispose();
		display.dispose();
	}
}</pre>
<p>That&#8217;s it you have just completed the widget. Hit the run button and enjoy it. This widget is a good example of a desktop application interacting directly with a web page. To make it more interesting I have also given some transparency. With include and exclude features of SWT developing transparent applications becomes seamlessly easy. Here Firefox was opened explicitly. Since, in ma case, the default browser was found to be Internet Explorer and I wanted to view results in Firefox.</p>
<p>Nice to be back with a post after a while. Hope you enjoyed it, thank you.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hamzeen.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hamzeen.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hamzeen.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hamzeen.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hamzeen.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hamzeen.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hamzeen.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hamzeen.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hamzeen.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hamzeen.wordpress.com/247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=247&subd=hamzeen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://hamzeen.wordpress.com/2009/05/12/developing-a-desktop-widget-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ffe4475e185518cee0e4daff9a9a20e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hamzeen</media:title>
		</media:content>

		<media:content url="http://hamzeen.files.wordpress.com/2009/05/searchbox.png" medium="image" />

		<media:content url="http://hamzeen.files.wordpress.com/2009/05/ico.png" medium="image" />
	</item>
		<item>
		<title>SLAX. Linux on a USB flash drive.</title>
		<link>http://hamzeen.wordpress.com/2009/03/10/linux-on-stick/</link>
		<comments>http://hamzeen.wordpress.com/2009/03/10/linux-on-stick/#comments</comments>
		<pubDate>Tue, 10 Mar 2009 12:06:57 +0000</pubDate>
		<dc:creator>hamzeen</dc:creator>
				<category><![CDATA[Adventure]]></category>
		<category><![CDATA[Innovation]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open source]]></category>

		<guid isPermaLink="false">http://hamzeen.wordpress.com/?p=216</guid>
		<description><![CDATA[As things have turned out this happens to be the first post for this year. Though I wanted to blog a lot, ma work doesn&#8217;t seem to be giving me any room to do so. Anyway, Since of late I really wanted to try out a Linux Distro either in an emulated mode or to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=216&subd=hamzeen&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As things have turned out this happens to be the first post for this year. Though I wanted to blog a lot, ma work doesn&#8217;t seem to be giving me any room to do so. Anyway, Since of late I really wanted to try out a Linux Distro either in an emulated mode or to have it on a USB drive.</p>
<p>First I tried to run it in an emulated mode by following some of the tutorials given on <a href="http://www.pendrivelinux.com" target="_blank">PenDrive Linux</a>. But after a series of failure I decided to change to ma second option. When it comes to Portable distributions two famous one&#8217;s that came to ma mind were Puppy Linux and SLAX. And they both have KDE.</p>
<p>After considering some of the capabilities/features of both Puppy Linux and SLAX, I decided to stick with SLAX because it could offer me most of the software that I was looking for and moreover, you don&#8217;t need to install any extra plug-ins to get your MP3&#8217;s and other commonly used video formats (specially avi) working. This is something I would really like to have on other distros like Ubuntu and which I unfortunately, don&#8217;t find on them due to certain restrictions (I think it&#8217;s better for me to stay out of this coz then I will be getting into patent and copyright laws and put ma self in a spot of bother).</p>
<p>You can find more about SLAX on, <a href="http://www.slax.org/" target="_blank">slax.org</a>. And since, I&#8217;m using a hp pavilion dv2000 which has Windows Vista installed on it, this post should ideally suite vista users because it&#8217;s bit different than setting up your boot stick from being on other (older) versions of windows. But actually, creating it on older versions of windows seems to be lot easier than on Vista.</p>
<p>But to start with I should admit that there are some pre-requisites to ensure you can boot into SLAX using a pen drive. Because not all the PCs and Laptops supports booting from a USB drive. below I list few pre-requisites.</p>
<ul>
<li> The PC or Laptop that you are using should support booting from a USB drive.</li>
<li> A pen drive with a minimum of 256 MB free space.</li>
</ul>
<p>Moving on with the configurations,</p>
<ol>
<li> download <strong><a href="http://www.slax.org/get_slax.php" target="_blank">SLAX usb</a></strong> edition (you will be downloading tar ball)</li>
<li> download <strong><a href="http://downloads.sourceforge.net/sevenzip/7z462.exe" target="_blank">7-Zip</a></strong>. (to extract the contents of the tar ball)</li>
<li> extract the contents of the tar archive to the root of the pen drive.(boot and slax)</li>
<li> download <strong><a href="http://www.kernel.org/pub/linux/utils/boot/syslinux/syslinux-3.72.zip" target="_blank">syslinux-3.xx.zip</a></strong> and extract it to your local file system</li>
<li> copy the contents of <strong>syslinux-3.7.2/win32</strong> folder to <strong>boot/syslinux</strong> on the pen drive.</li>
<li> Now click on your windows start menu, type <strong>&#8216;command&#8217;</strong> on the search box of the start menu.</li>
<li> Once you are shown <strong>command prompt</strong> in the start menu <strong>right click</strong> and select <strong>run as administrator</strong>.</li>
<li> Move the prompt to your USB drive by typing <strong>&#8220;driveLetter:&#8221;</strong> and enter.</li>
<li> Type <strong>cd boot</strong> and press enter (in order to go to the boot dirctory in the usb drive).</li>
<li> Type <strong>bootinst.bat</strong> to overwrite the MBR on your usb drive.</li>
</ol>
<p>That&#8217;s it, we are done with the configurations. Now you can reboot your machine enter bios settings and then make USB drive as your first boot device in the boot sequence list. Now you should be logging into SLAX.!! below I attach a screenshot of slax while I was listening to some great tunes of A.R. Rahman.</p>
<p style="text-align:center;"><img class="aligncenter" title="Slax. ultra portable linux." src="http://hamzeen.files.wordpress.com/2009/03/snapshot7.jpg?w=475&#038;h=285" alt="a screenshot of slax" width="475" height="285" /></p>
<p>One of the coolest things about SLAX is that it not only shows other file systems but it also allows you to write to those which really makes life lot easier. Since SLAX is <strong>module based</strong> and modules get installed <strong>on-the-fly</strong> you never need to login and install anything. All what you need to do is just <strong><a href="http://www.slax.org/modules.php" target="_blank">download your preferred module</a></strong> and copy to slax and next time you boot into slax, you should be able to use your new app, easy as that.</p>
<p>I really enjoy ma time on slax and I hope you will consider SLAX next time when you wanna go portable as well. Cheers!.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/hamzeen.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/hamzeen.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/hamzeen.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/hamzeen.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/hamzeen.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/hamzeen.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/hamzeen.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/hamzeen.wordpress.com/216/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/hamzeen.wordpress.com/216/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/hamzeen.wordpress.com/216/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=hamzeen.wordpress.com&blog=1393805&post=216&subd=hamzeen&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://hamzeen.wordpress.com/2009/03/10/linux-on-stick/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0ffe4475e185518cee0e4daff9a9a20e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hamzeen</media:title>
		</media:content>

		<media:content url="http://hamzeen.files.wordpress.com/2009/03/snapshot7.jpg" medium="image">
			<media:title type="html">Slax. ultra portable linux.</media:title>
		</media:content>
	</item>
	</channel>
</rss>