<?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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>“That’s not a bug, it’s a feature.”</title>
	<atom:link href="http://ibnaziz.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ibnaziz.wordpress.com</link>
	<description>... the awakening of a web developer.</description>
	<lastBuildDate>Wed, 11 Jan 2012 12:34:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='ibnaziz.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/f27daa2cb423e2fae253ab9277371885?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>“That’s not a bug, it’s a feature.”</title>
		<link>http://ibnaziz.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://ibnaziz.wordpress.com/osd.xml" title="“That’s not a bug, it’s a feature.”" />
	<atom:link rel='hub' href='http://ibnaziz.wordpress.com/?pushpress=hub'/>
		<item>
		<title>CSS Box Shadow Effect</title>
		<link>http://ibnaziz.wordpress.com/2011/05/25/css-box-shadow-effect/</link>
		<comments>http://ibnaziz.wordpress.com/2011/05/25/css-box-shadow-effect/#comments</comments>
		<pubDate>Wed, 25 May 2011 05:56:20 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Graphics]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[Style Sheet]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[XHTML]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/?p=229</guid>
		<description><![CDATA[Having too many graphical images can weigh your website down... but without them, it can start to feel dull and boring. So the best course to take is to utilise CSS to the max. It will make-up for the lack of images, while keeping you light at the same.

The Box Shadow effect is just one example of the many CSS effects, waiting to be used.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=229&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#800000;"><strong>Context:</strong></span></p>
<p>Having too many graphical images can weigh your website down&#8230; but without them, it can start to feel dull and boring. So the best course to take is to utilise CSS to the max. It will make-up for the lack of images, while keeping you light at the same.</p>
<p>The Box Shadow effect is just one example of the many CSS effects, waiting to be used.</p>
<p><span style="color:#339966;"><strong><br />
Solution:</strong></span></p>
<p>ie foo.css<br />
<pre class="brush: plain;">

.shadow {
-moz-box-shadow: 5px 5px 5px #ccc;
-webkit-box-shadow: 5px 5px 5px #ccc;
box-shadow: 5px 5px 5px #ccc;
}

</pre></p>
<p style="text-align:left;">&nbsp;<br />The 4 values correspond to the following respectively:-<strong><br />
</strong></p>
<ol>
<li><strong>The horizontal offset</strong> of the shadow, positive means the shadow will be on the right of the box, a negative offset will put the shadow on the left of the box.</li>
<li><strong>The vertical offset</strong> of the shadow, a negative one means the box-shadow will be above the box, a positive one means the shadow will be below the box.</li>
<li><strong>The blur radius</strong>, if set to 0 the shadow will be sharp, the higher the number, the more blurred it will be.</li>
<li><strong>Color</strong></li>
</ol>
<p>And that&#8217;s all to it.</p>
<p>Alhumdulillah.</p>
<p>&#8211;<br />
<strong>References:</strong><br />http://css-tricks.com/snippets/css/css-box-shadow/</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/229/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/229/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/229/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=229&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2011/05/25/css-box-shadow-effect/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>How to sync Google Calendar with Thunderbird</title>
		<link>http://ibnaziz.wordpress.com/2011/05/25/how-to-sync-google-calendar-with-thunderbird/</link>
		<comments>http://ibnaziz.wordpress.com/2011/05/25/how-to-sync-google-calendar-with-thunderbird/#comments</comments>
		<pubDate>Wed, 25 May 2011 03:21:59 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Thunderbird]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/?p=202</guid>
		<description><![CDATA[It's all about the cloud these days. The ability to centralise information so that it can be accessed from various locations... reducing redundancy.

Following the aforementioned concept, it would make a lot of sense to have Google Calendar operate the same way. Well guess what... it's possible ! If you're using Thunderbird with Lighting for calendars, you can install the Provider for Google Calendar add-on to get seamless 2-way sync of all your calendars.

<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=202&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#ff0000;"><strong>Context:</strong></span></p>
<p>It&#8217;s all about the cloud these days. The ability to centralise information so that it can be accessed from various locations&#8230; reducing redundancy.</p>
<p>Following the aforementioned concept, it would make a lot of sense to have Google Calendar operate the same way. Well guess what&#8230; it&#8217;s possible ! If you&#8217;re using Thunderbird with Lighting for calendars, you can install the Provider for Google Calendar add-on to get seamless 2-way sync of all your calendars.</p>
<p><span style="color:#339966;"><strong>Solution:</strong></span></p>
<p>(Assuming that the &#8216;Lightning&#8217; add-on is already installed)</p>
<p>1. Download and install the Thunderbird plugin – Provider for Google Calendar.</p>
<p>2. Now open up Google Calendar in the browser and click on the settings option.</p>
<p>3. Navigate to the &#8216;Calendars&#8217; tab and click on the desired calendar.</p>
<p>4. Scroll down, look for the &#8216;Private Address&#8217; section and copy the link location by right clicking the &#8216;xml&#8217; button.</p>
<p>5. Go to Thunderbird -&gt; File -&gt; New -&gt; Calendar.</p>
<p>6. Create New Calendar window popup -&gt; Choose “On the Network” -&gt; Choose “Google Calendar” -&gt; Paste your private xml link to the “Location” text box and click Next.</p>
<p>7. Enter the relevant username and password. and click Next.</p>
<p>8. Now enter a name for your Calendar and choose your calendar Color and check box if you need the alarm for all your imported event and click “Next” -&gt; “Finish”.</p>
<p>9. Done, your Thunderbird should be synced (2-way) with Google Calendar by now.</p>
<p>And that&#8217;s all to it.</p>
<p>Allahu A&#8217;lam.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/202/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/202/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/202/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=202&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2011/05/25/how-to-sync-google-calendar-with-thunderbird/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Clear input field on focus and vice versa</title>
		<link>http://ibnaziz.wordpress.com/2011/05/24/clear-input-field-on-focus-and-vice-versa/</link>
		<comments>http://ibnaziz.wordpress.com/2011/05/24/clear-input-field-on-focus-and-vice-versa/#comments</comments>
		<pubDate>Tue, 24 May 2011 07:54:45 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[Forms]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/?p=177</guid>
		<description><![CDATA[Web forms are popular... very popular. Occasionally, the need arises to have an input field display text by default, but then remove it on focus. In other words, when touched by the cursor.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=177&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#800000;"><strong>Context:</strong></span></p>
<p>Web forms are popular&#8230; very popular. Occasionally, the need arises to have an input field display text by default, but then remove it on focus. In other words, when touched by the cursor.</p>
<p>For example, a field can show the message, &#8220;Enter email to subscribe&#8221;&#8230; and then remove it automatically when the user wants to type in it.</p>
<p><span style="color:#339966;"><strong>Solution:</strong></span></p>
<p>1. Use the following javascript</p>
<p><pre class="brush: plain;">
&lt;script language=&quot;javascript&quot;&gt;
     &lt;!--
     function ClearForm() {
         document.subscription.email.value= &quot;&quot;;
     }

     function FillForm() {
         if ( document.subscription.email.value == &quot;&quot; )
         {
             document.subscription.email.value=
                          &quot;Enter email to subscribe.&quot;;
         }
     }
     //--&gt;
&lt;/script&gt;
</pre></p>
<p>2. Coupled with the following form</p>
<p><pre class="brush: plain;">
&lt;form action=&quot;&quot; method=&quot;post&quot; name=&quot;subscription&quot;&gt;
    &lt;input name=&quot;email&quot; type=&quot;text&quot;  class=&quot;keywords&quot;
         value=&quot;Enter email to subscribe.&quot;
         onfocus=&quot;ClearForm();&quot; onblur=&quot;FillForm();&quot;
    /&gt;
    &lt;input name=&quot;&quot; type=&quot;image&quot; src=&quot;images/submit.gif&quot; /&gt;
&lt;/form&gt;
</pre></p>
<p>And that&#8217;s all to it. Simple don&#8217;t you think !?</p>
<p>Alhumdulillah.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=177&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2011/05/24/clear-input-field-on-focus-and-vice-versa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>&#8220;Windows Desktop Gadgets has stopped working&#8221; &#8211; Windows 7 (x64)</title>
		<link>http://ibnaziz.wordpress.com/2011/05/22/windows-desktop-gadgets-has-stopped-working-windows-7-x64/</link>
		<comments>http://ibnaziz.wordpress.com/2011/05/22/windows-desktop-gadgets-has-stopped-working-windows-7-x64/#comments</comments>
		<pubDate>Sun, 22 May 2011 11:38:57 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[sidebar.exe]]></category>
		<category><![CDATA[Windows & Sidebar]]></category>
		<category><![CDATA[Windows Desktop Gadgets has stopped working]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/?p=169</guid>
		<description><![CDATA[Installing an unknown gadget caused the windows 7 gadget sidebar to stop working and show the "Windows Desktop Gadgets has stopped working" error. Finally after hours of trying various things, a simple file tweak solved the problem.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=169&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#ff0000;"><strong>Context:</strong></span></p>
<p>Installing an unknown gadget caused the windows 7 gadget sidebar to stop working. It showed the &#8220;Windows Desktop Gadgets has stopped working&#8221; error.</p>
<p>After typing the word &#8216;gadgets&#8217; in the main menu search bar and trying many of the options that came up&#8230;</p>
<p>- View list of running gadgets<br />
- Uninstall a gadget<br />
- Restore desktop gadgets installed with Windows<br />
- etc</p>
<p>&#8230; frustration only mounted as the problem would just not go away. Finally after hours of trying various other things, a simple file tweak solved the problem.</p>
<p>In essence, the removal of a particular file ( or renaming it to backup ) and a re-start will cause the sidebar to reset.</p>
<p><span style="color:#339966;"><strong><br />
Solution:</strong></span></p>
<p>1. Ensure &#8216;sidebar.exe&#8217; is closed ( via the task manager ).</p>
<p>2. Open windows explorer and enter &#8216;%localappdata%\microsoft\Windows Sidebar&#8217; in the url bar.</p>
<p>3. Rename the &#8216;Settings.ini&#8217; file to make room for automatic creation of new file.</p>
<p>4. Re-launch sidebar and viola !!<br />
Alhumdulillah.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/169/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=169&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2011/05/22/windows-desktop-gadgets-has-stopped-working-windows-7-x64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Android: Returning values from a custom Dialog</title>
		<link>http://ibnaziz.wordpress.com/2010/02/19/android-returning-values-from-a-custom-dialog/</link>
		<comments>http://ibnaziz.wordpress.com/2010/02/19/android-returning-values-from-a-custom-dialog/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 02:37:03 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Android Custom Dialog]]></category>
		<category><![CDATA[Customer Dialog Interface]]></category>
		<category><![CDATA[Dialog event listener]]></category>
		<category><![CDATA[Dialog UI Listener]]></category>
		<category><![CDATA[extends Dialog implement]]></category>
		<category><![CDATA[Returng values from custom dialog]]></category>
		<category><![CDATA[Returning values from a custom dialog]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/?p=145</guid>
		<description><![CDATA[Cases which involve using a custom dialog to capture user input, may require the captured data to be passed back to the displaying activity. The following describes exactly this... how to pass back data from a custom dialog to the displaying activity.

ps - by custom dialog we mean a custom class that 'extends Dialog'.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=145&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#ff0000;">Context:</span></strong></p>
<p><span style="color:#000000;">Cases which involve using a custom dialog to capture user input, may require the captured data to be passed back to the displaying activity. The following describes exactly this&#8230; how to pass back data from a custom dialog to the displaying activity.</span></p>
<p>ps &#8211; by custom dialog we mean a custom class that &#8216;<strong>extends Dialog</strong>&#8216;.</p>
<p><strong><span style="color:#ff0000;">Solution:</span></strong></p>
<p>Step 1 &#8211; Define custom interface</p>
<pre> // step 1 - to return values from dialog
 public interface OnFooEventListener {
     public void fooEvent(int fieldOne, int fieldTwo);
 }</pre>
<p>Step 2 &#8211; Declare the above interface as a field member</p>
<pre> // step 2 - to return values from dialog
 private OnFooEventListener onFooEventListener;</pre>
<p>Step 3 &#8211; Add it to the custom dialog constructor</p>
<pre> // step 3 - to return values from dialog
 public FooEventDialog(Context context, OnFooEventListener onFooEventListener)
 {
     super(context);
     this.context = context;

     this.onFooEventListener = onFooEventListener;
 }</pre>
<p>Step 4 &#8211; Call it within the view object&#8217;s event listener, (in this case an &#8216;ok&#8217; button)</p>
<pre>
 Button btnOk = (Button) findViewById(R.id.btnSet);
 btnOk.setOnClickListener( new Button.OnClickListener()
 {
     @Override
     public void onClick(View v) {

         // step 4 - to return values from dialog
         onFooEventListener.fooEvent(fieldOne, fieldTwo);
         dismiss();
     }
 });</pre>
<p>Overview &#8211; So the class should look something like the following</p>
<pre>
public class FooEventDialog extends Dialog
{

    // step 1
    public interface OnFooEventListener {
        public void fooEvent(int fieldOne, int fieldTwo);
    }

    // step 2
    private OnFooEventListener onFooEventListener;

    // Other member fields
    ...

    // step 3
    public FooEventDialog(Context context, OnFooEventListener onFooEventListener)
    { ... }

    @Override
    public void onCreate(Bundle savedInstanceState)
    {
         // other stuff
         ...

        Button btnOk = (Button) findViewById(R.id.btnSet);
        btnOk.setOnClickListener( new Button.OnClickListener()
        {
            @Override
             public void onClick(View v) {

                 // step 4 - to return values from dialog
                 onFooEventListener.fooEvent(fieldOne, fieldTwo);
                 dismiss();
             }
         });
     }
}
</pre>
<p>&#8230; That&#8217;s all there is to it.</p>
<p>Wa&#8217;Allahu A&#8217;lam !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=145&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2010/02/19/android-returning-values-from-a-custom-dialog/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Removing pppoeconf settings in Ubuntu 9.10</title>
		<link>http://ibnaziz.wordpress.com/2010/02/17/removing-pppoeconf-settings-in-ubuntu-9-10/</link>
		<comments>http://ibnaziz.wordpress.com/2010/02/17/removing-pppoeconf-settings-in-ubuntu-9-10/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 07:54:34 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[pppoeconf]]></category>
		<category><![CDATA[pppoeconf + remove pppoeconf + remove pppoeconf settings + ubuntu direct internet connection]]></category>
		<category><![CDATA[remove pppoeconf]]></category>
		<category><![CDATA[remove pppoeconf settings]]></category>
		<category><![CDATA[ubuntu direct internet connection]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/2010/02/17/removing-pppoeconf-settings-in-ubuntu-9-10/</guid>
		<description><![CDATA[At first my internet connection required me to go through a user name and password... and hence my connection was taken care of by....

sudo pppoeconf

... but now since my internet provider has changed, and given me access to a direct connection (without username &#38; password).... I no longer require pppoeconf to handle my connection for me. In fact, it has become a hinderance... as I am not able to connect and if I run pppoeconf again, it tells me that....

"Sorry, I scanned 1 interface, but the access concentrator of your provider did not respond. Another reason for the scan failure may also be another running pppoe process which controls the modem. "

Having tried things like "poff dsl-provider" and "poff -a", I decided, it was probably best to remove the settings altogether !<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=142&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#ff0000;">Context:</span></strong></p>
<p>At first my internet connection required me to go through a user name and password&#8230; and hence my connection was taken care of by&#8230;.</p>
<pre>sudo pppoeconf</pre>
<p>&#8230; but now since my internet provider has changed, and given me access to a direct connection (without username &amp; password)&#8230;. I no longer require pppoeconf to handle my connection for me. In fact, it has become a hinderance&#8230; as I am not able to connect and if I run pppoeconf again, it tells me that&#8230;.</p>
<p><strong><span style="color:#000000;">&#8220;Sorry, I scanned 1 interface, but the access concentrator of your provider did not respond. Another reason for the scan failure may also be another running pppoe process which controls the modem. &#8220;</span></strong></p>
<p>Having tried things like &#8220;poff dsl-provider&#8221; and &#8220;poff -a&#8221;, I decided, it was probably best to remove the settings altogether !</p>
<p><span style="color:#ff0000;"><strong><br />
</strong></span></p>
<p><span style="color:#ff0000;"><strong>Solution:</strong></span></p>
<p>Step 1 &#8211; Remove the &#8216;dsl-provider&#8217; file (or what ever else your connection was called) within the peers folder, as follows&#8230;</p>
<pre>sudo rm /etc/ppp/peers/dsl-provider</pre>
<p>Step 2 &#8211; Modify the interfaces file within the network folder, and remove the section that has &#8216;dsl-provider&#8217; defined, as follows&#8230;</p>
<pre>sudo gedit /etc/network/interfaces</pre>
<p>&#8230; and you should  be left with something similar to the following&#8230;.</p>
<pre>auto lo
iface lo inet loopback</pre>
<pre>auto eth0
iface eth0 inet manual</pre>
<p>Step 3 &#8211; Change the last part from being manual to dhcp, and you should end up with something like&#8230;</p>
<pre>auto lo
iface lo inet loopback</pre>
<pre>auto eth0
iface eth0 inet dhcp</pre>
<p>&#8230; that&#8217;s all there is to it.</p>
<p>Wa&#8217;Allahu A&#8217;lam !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=142&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2010/02/17/removing-pppoeconf-settings-in-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing Eclipse in Ubuntu 9.10</title>
		<link>http://ibnaziz.wordpress.com/2010/01/13/fixing-eclipse-in-ubuntu-9-10/</link>
		<comments>http://ibnaziz.wordpress.com/2010/01/13/fixing-eclipse-in-ubuntu-9-10/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 04:28:50 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[eclipse+ubuntu+9.10]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/2010/01/13/fixing-eclipse-in-ubuntu-9-10/</guid>
		<description><![CDATA[Frustratingly eclipse ( using ubuntu 9.10) does not allow the buttons to be clicked using the mouse and instead requires highlighting them first, followed by hitting 'space' or 'enter' for the selection.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=130&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#ff0000;">Problem:</span></strong></p>
<p>Inability to click buttons using the mouse and instead having to highlight them first and then hitting &#8216;space&#8217; or &#8216;enter&#8217; for the selection.</p>
<p><strong><span style="color:#ff0000;">Solution:</span></strong></p>
<p>Create a script that will be used to load eclipse using the GDK_NATIVE_WINDOWS.</p>
<p>1) Create an empty file called eclipse_gdk_fix.sh</p>
<p>2) Insert the following code</p>
<pre>#!/bin/sh
GDK_NATIVE_WINDOWS=1 /path/to/eclipse</pre>
<p>3) Make the script executable</p>
<pre>chmod a+x eclipse_gdk_fix.sh</pre>
<p>&#8230; That&#8217;s all to it !</p>
<p>Wa Allahu A&#8217;lam.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=130&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2010/01/13/fixing-eclipse-in-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>(Android) R.layout.main cannot be resolved !!</title>
		<link>http://ibnaziz.wordpress.com/2009/12/28/android-r-layout-main-not-recognised/</link>
		<comments>http://ibnaziz.wordpress.com/2009/12/28/android-r-layout-main-not-recognised/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 02:24:42 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[mobile programming]]></category>
		<category><![CDATA[phone]]></category>
		<category><![CDATA[R.java]]></category>
		<category><![CDATA[R.layout.main]]></category>
		<category><![CDATA[R.layout.main cannot be resolved]]></category>
		<category><![CDATA[R.layout.main is not recognised]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/2009/12/28/android-r-layout-main-not-recognised/</guid>
		<description><![CDATA[Beginning android programming... everything seemed to be working... but the R.layout.main is not being recognised anymore !!<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=121&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#ff0000;">Problem:</span></strong></p>
<p>Beginning android programming&#8230; everything seemed to be working&#8230; but the R.layout.main is not being recognised anymore !!</p>
<p><strong><span style="color:#ff0000;">Solution:</span></strong></p>
<p>Simply remove the &#8216;import android.R&#8217; statement&#8230; and things should be back to normal.</p>
<p><span style="color:#ff0000;"><strong>Context:</strong></span></p>
<p>Having the import android.R seems to refer to the default R.java provided by the android platform instead of the version for your application&#8230;. hence the main.xml being referred to is not found. Removing the import statement fixes the problem by causing the application to search for R.java locally.</p>
<p>&#8230;wa&#8217;Allahu A&#8217;lam !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=121&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2009/12/28/android-r-layout-main-not-recognised/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>Cached up in Google !</title>
		<link>http://ibnaziz.wordpress.com/2009/09/02/cached-up-in-google/</link>
		<comments>http://ibnaziz.wordpress.com/2009/09/02/cached-up-in-google/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 02:19:55 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[JSP]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[crawl bots]]></category>
		<category><![CDATA[robots meta tag]]></category>
		<category><![CDATA[search indexing]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/?p=117</guid>
		<description><![CDATA[A client accidentally found, to his surprise, that google had somehow managed to cache a "secure" page from his private web application !! Well, alhumdulillah... there now seems to be a way to prevent this from happening again...<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=117&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#ff0000;"><strong>Problem:</strong></span></p>
<p>A client accidentally found, to his surprise, that google had somehow managed to cache a &#8220;secure&#8221; page from his private web application !!<br />
<strong><span style="color:#ff0000;"> </span></strong></p>
<p><strong><span style="color:#ff0000;">Solution:</span><br />
</strong><br />
To prevent something like this from happening again, the following meta tags must be included in the relevant html/jsp pages&#8230; to instruct search robots NOT to include the tagged pages into their search listings :-</p>
<pre>&lt;meta name="robots" content="none"&gt;
&lt;meta name="robots" content="noarchive"&gt;</pre>
<p><span style="color:#ff0000;"><strong>Reference:</strong></span></p>
<p><a href="http://googlewebmastercentral.blogspot.com/2007/03/using-robots-meta-tag.html">Google &#8211; Using the robots meta tag</a></p>
<p>&#8230; wAllahu A&#8217;lam !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/117/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/117/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/117/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=117&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2009/09/02/cached-up-in-google/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
		<item>
		<title>POJO Annotation (hibernate) Example</title>
		<link>http://ibnaziz.wordpress.com/2009/08/26/pojo-annotation-hibernate-example/</link>
		<comments>http://ibnaziz.wordpress.com/2009/08/26/pojo-annotation-hibernate-example/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 05:10:45 +0000</pubDate>
		<dc:creator>Ibn Aziz</dc:creator>
				<category><![CDATA[Annotations]]></category>
		<category><![CDATA[Hibernate]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Netbeans]]></category>
		<category><![CDATA[Annotation]]></category>
		<category><![CDATA[Hibernate Annotations]]></category>
		<category><![CDATA[POJO Annotation]]></category>

		<guid isPermaLink="false">http://ibnaziz.wordpress.com/?p=109</guid>
		<description><![CDATA[Simple example of what a java pojo that has been hibernate annotated may look like, along with it's corresponding sql file.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=109&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#333333;">The following is an example of what a hibernate annotated java file may look like&#8230;</span></p>
<p><strong><span style="color:#ff0000;">Source :</span></strong></p>
<pre>/*
 * filename: Tax.java
 * descrip.: represents the tax object ( tax domain )
 */

package com.foo.tax.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * Represents the Tax entity.
 *
 * please note if the table name is the same as the class name
 * then the @table annotation doesn't need to be specified
 */
@Entity
@SequenceGenerator( name="fooTaxIdSeq", sequenceName="FOO_TAX_ID_SEQ", allocationSize=1)
@Table(name="FOO_TAX")
public class Tax
{
    private Long id = null;
    private String name = null;
    private double percentage = 0;

    @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="fooTaxIdSeq")
    @Column(name="ID", nullable=false, unique=true)
    public Long getId()
    {
	return id;
    }

    // no need for the name as we want the defualt to be used
    @Column( nullable=false, unique=true )
    public String getName()
    {
	return name;
    }

    public void setName(String name)
    {
	this.name = name;
    }

    // equivalent to NUMBERIC( 256, 2 )
    @Column( nullable=false, precision=256, scale=2 )
    public double getPercentage()
    {
	return percentage;
    }

    public void setPercentage(double type)
    {
	this.percentage = type;
    }
}</pre>
<p><strong><span style="color:#ff0000;">Notes :</span></strong></p>
<p><span style="color:#333333;">- assuming that database id generation is in place, as opposed to application generated.</span></p>
<p><span style="color:#333333;">- the &#8216;@SequenceGenerator&#8217; has been declared at the class level, and it is used at the method level with, &#8216;@Id @GeneratedValue&#8217;. Please note the &#8216;<strong>generator=&#8221;fooTaxIdSeq&#8221;</strong>&#8216;.</span></p>
<p><span style="color:#333333;">- also please note that the &#8216;@SequenceGenerator&#8217; specification is somewhat database dependant, and that in this case the above combination works for PostGres. A different database may require a different specification.</span></p>
<p><span style="color:#333333;">And the following is a corresponding table creation sql file for the above pojo&#8230;</span></p>
<p><span style="color:#ff0000;"><strong>Source:</strong></span></p>
<pre>-- filename: 1_tax_init.sql
-- description:
--   creates a 'foo_tax' table, along with a 'foo_tax_id_seq' sequence
--   that will be used to increment the id with every new tax entity

CREATE TABLE FOO_TAX (
	ID VARCHAR(36) PRIMARY KEY,
	VERSION INTEGER NOT NULL,
	ADDED_BY VARCHAR(36) NOT NULL,
	DATE_CREATED TIMESTAMP NOT NULL DEFAULT NOW(),
	MODIFIED_BY VARCHAR(36),
	DATE_MODIFIED TIMESTAMP,
	REMARKS TEXT,

	NAME VARCHAR(256) NOT NULL,
	PERCENTAGE NUMERIC(256,2) NOT NULL
);
ALTER TABLE FOO_TAX OWNER TO FOO_OWNER;

CREATE SEQUENCE FOO_TAX_ID_SEQ;
ALTER TABLE FOO_TAX_ID_SEQ OWNER TO FOO_OWNER;</pre>
<p><strong><span style="color:#ff0000;">Notes :</span></strong></p>
<p><span style="color:#333333;"><strong>- </strong>the &#8216;create sequence foo_tax_id_seq;&#8217; statement could have been omitted if the keyword &#8216;serial&#8217; was specified for the id column above.</span></p>
<pre>CREATE TABLE FOO_TAX (
	ID <strong>SERIAL</strong> VARCHAR(36) PRIMARY KEY,
        ...</pre>
<p><span style="color:#333333;">- this instructs the database that the id will be database generated, and the default name for the sequence table would have been the table name plus &#8216;id_seq&#8217;, so in this case &#8216;foo_tax_id_seq&#8217;.</span></p>
<p><span style="color:#333333;">&#8230; wa Allahu A&#8217;lam !</span></p>
<p><span style="color:#ff0000;"><span style="color:#000000;"> </span></span></p>
<div id="_mcePaste" style="overflow:hidden;position:absolute;left:-10000px;top:0;width:1px;height:1px;">/*<br />
* filename: Tax.java<br />
* descrip.: represents the tax object ( tax domain )<br />
*<br />
* Copyright 2009 X-IT Management Ltd.<br />
*/</p>
<p>package com.astra.tax.model;</p>
<p>import com.astra.common.model.BaseEntity;<br />
import javax.persistence.Column;<br />
import javax.persistence.Entity;<br />
import javax.persistence.GeneratedValue;<br />
import javax.persistence.GenerationType;<br />
import javax.persistence.Id;<br />
import javax.persistence.SequenceGenerator;<br />
import javax.persistence.Table;</p>
<p>/**<br />
* Represents the Tax entity.<br />
*/<br />
/* please note if the table name is the same as the class name<br />
* then the @table annotation doesn&#8217;t need to be specified<br />
*/<br />
@Entity<br />
@SequenceGenerator( name=&#8221;astraTaxIdSeq&#8221;, sequenceName=&#8221;ASTRA_TAX_ID_SEQ&#8221;, allocationSize=1)<br />
@Table(name=&#8221;ASTRA_TAX&#8221;)<br />
public class Tax extends BaseEntity<br />
{<br />
private String name = null;<br />
private double percentage = 0;</p>
<p>@Override<br />
@Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator=&#8221;astraTaxIdSeq&#8221;)<br />
@Column(name=&#8221;ID&#8221;, nullable=false, unique=true)<br />
public Long getId()<br />
{<br />
return id;<br />
}</p>
<p>// no need for the name as we want the defualt to be used<br />
@Column( nullable=false, unique=true )<br />
public String getName()<br />
{<br />
return name;<br />
}</p>
<p>public void setName(String name)<br />
{<br />
this.name = name;<br />
}</p>
<p>// equivalent to NUMBERIC( 256, 2 )<br />
@Column( nullable=false, precision=256, scale=2 )<br />
public double getPercentage()<br />
{<br />
return percentage;<br />
}</p>
<p>public void setPercentage(double type)<br />
{<br />
this.percentage = type;<br />
}<br />
}</p></div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ibnaziz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ibnaziz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ibnaziz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ibnaziz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/ibnaziz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/ibnaziz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/ibnaziz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/ibnaziz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ibnaziz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ibnaziz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ibnaziz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ibnaziz.wordpress.com/109/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ibnaziz.wordpress.com/109/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ibnaziz.wordpress.com/109/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ibnaziz.wordpress.com&amp;blog=3722011&amp;post=109&amp;subd=ibnaziz&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://ibnaziz.wordpress.com/2009/08/26/pojo-annotation-hibernate-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d92fa1e906b6c7a8820305b4856ccdc9?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ibnaziz</media:title>
		</media:content>
	</item>
	</channel>
</rss>
