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

<channel>
	<title>Shey's Rebellion &#187; Java</title>
	<atom:link href="http://www.sheysrebellion.net/blog/category/programming/java/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sheysrebellion.net/blog</link>
	<description>I sleep with pillows on my head.</description>
	<lastBuildDate>Thu, 27 Jan 2011 18:59:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>JSR-310</title>
		<link>http://www.sheysrebellion.net/blog/2007/02/22/jsr-310/</link>
		<comments>http://www.sheysrebellion.net/blog/2007/02/22/jsr-310/#comments</comments>
		<pubDate>Wed, 21 Feb 2007 22:38:04 +0000</pubDate>
		<dc:creator>Sheheryar Sewani</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.sheysrebellion.net/blog/?p=61</guid>
		<description><![CDATA[JSR-310 recently accepted as a new JSR! What is JSR-310? &#8220;This JSR will provide a new and improved date and time API for Java. The main goal is to build upon the lessons learned from the first two APIs (Date and Calendar) in Java SE, providing a more advanced and comprehensive model for date and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jcp.org/en/jsr/detail?id=310">JSR-310</a> recently accepted as a new JSR!  What is JSR-310?</p>
<blockquote><p>&#8220;This JSR will provide a new and improved date and time API for Java. The main goal is to build upon the lessons learned from the first two APIs (Date and Calendar) in Java SE, providing a more advanced and comprehensive model for date and time manipulation&#8230;..Currently Java SE has two separate date and time APIs &#8211; java.util.Date and java.util.Calendar. Both APIs are consistently described as difficult to use by Java developers on weblogs and forums. Notably, both use a zero-index for months, which is a cause of many bugs. Calendar has also suffered from many bugs and performance issues over the years, primarily due to storing its state in two different ways internally.&#8221;</p></blockquote>
<p>Horray!  It&#8217;s nice to know that I wasn&#8217;t the only one not happy with Java&#8217;s Date Time classes. I&#8217;ve swithced to Joda Time, but I would rather use someting that&#8217;s part of the standard package instead of a giant library to handle Dates.</p>
<p>I wish the Java guys will take some time to understand the .NET Framework&#8217;s handling of Dates and times and if they really want to make me happy, throw in some of of Ruby&#8217;s Humane interfaces.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li><a rel="nofollow" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2007%2F02%2F22%2Fjsr-310%2F&amp;title=JSR-310" title="del.icio.us"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2007%2F02%2F22%2Fjsr-310%2F&amp;title=JSR-310" title="Reddit"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2007%2F02%2F22%2Fjsr-310%2F&amp;t=JSR-310" title="Facebook"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2007%2F02%2F22%2Fjsr-310%2F" title="Identi.ca"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://twitter.com/home?status=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2007%2F02%2F22%2Fjsr-310%2F" title="TwitThis"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sheysrebellion.net/blog/2007/02/22/jsr-310/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Time to switch over to Joda Time</title>
		<link>http://www.sheysrebellion.net/blog/2006/12/25/time-to-switch-over-to-joda-time/</link>
		<comments>http://www.sheysrebellion.net/blog/2006/12/25/time-to-switch-over-to-joda-time/#comments</comments>
		<pubDate>Sun, 24 Dec 2006 20:18:17 +0000</pubDate>
		<dc:creator>Sheheryar Sewani</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.sheysrebellion.net/blog/?p=41</guid>
		<description><![CDATA[I&#8217;ve complained about the Java Date API classes before, it&#8217;s complicated,difficult to use and the calender class makes accessing methods clunky and well, verbose. Last week I found Joda-Time, a replacement for the Java Date/Time classes. I played around with it for a week and found Joda-Time has great support for Time Zones and Time [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="http://www.sheysrebellion.net/blog/?p=29">complained</a> about the Java Date API classes before, it&#8217;s complicated,difficult to use and the calender class makes accessing methods clunky and well, verbose.</p>
<p>Last week I found <a href="http://joda-time.sourceforge.net/index.html">Joda-Time</a>, a replacement for the Java Date/Time classes.  I played around with it for a week and found Joda-Time has great support for Time Zones and <a href="http://joda-time.sourceforge.net/key_period.html">Time Periods</a> which is super handy and easier to read than the JDK classes; it makes it easy to find some date plus/minus a time period, no more mucking around with the Calendar class or TimeZone classes.</p>
<p>Here&#8217;s a small example of what Joda-Time can do:</p>
<p>//JDK, adding 15 years to a date<br />
Calendar rightNow = Calendar.getInstance();<br />
rightNow.add(Calendar.YEAR, 15);<br />
Date javaDate = rightNow.getTime();<br />
System.out.println(javaDate.toString());</p>
<p>//Joda Time, adding 15 years to a date<br />
DateTime jodaDate = new DateTime().plusYears(15);<br />
System.out.println(jodaDate.toString());</p>
<p>//Joda Time, changing timezone<br />
DateTime newDate = jodaDate.withZone(DateTimeZone.forID(&#8220;US/Eastern&#8221;));<br />
System.out.println(newDate.toString());<br />
Play around with Joda-Time and decide for yourself.</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li><a rel="nofollow" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F12%2F25%2Ftime-to-switch-over-to-joda-time%2F&amp;title=Time%20to%20switch%20over%20to%20Joda%20Time" title="del.icio.us"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F12%2F25%2Ftime-to-switch-over-to-joda-time%2F&amp;title=Time%20to%20switch%20over%20to%20Joda%20Time" title="Reddit"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F12%2F25%2Ftime-to-switch-over-to-joda-time%2F&amp;t=Time%20to%20switch%20over%20to%20Joda%20Time" title="Facebook"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F12%2F25%2Ftime-to-switch-over-to-joda-time%2F" title="Identi.ca"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://twitter.com/home?status=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F12%2F25%2Ftime-to-switch-over-to-joda-time%2F" title="TwitThis"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sheysrebellion.net/blog/2006/12/25/time-to-switch-over-to-joda-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java Date and Calendar classes</title>
		<link>http://www.sheysrebellion.net/blog/2006/11/06/java-date-and-calendar-classes/</link>
		<comments>http://www.sheysrebellion.net/blog/2006/11/06/java-date-and-calendar-classes/#comments</comments>
		<pubDate>Sun, 05 Nov 2006 21:44:05 +0000</pubDate>
		<dc:creator>Sheheryar Sewani</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.sheysrebellion.net/blog/?p=29</guid>
		<description><![CDATA[I really wish Sun would simplify the classes related to dates in the Java Library. The java.util.date and java.util.*calendar* classes are a mess, very verbose and cumbersome to use. This ONJava article helps but it&#8217;s just a reminder of how much easier dates are to play with in .NET Share and Enjoy:]]></description>
			<content:encoded><![CDATA[<p>I really wish Sun would simplify the classes related to dates in the Java Library.  The java.util.date and java.util.*calendar* classes are a mess, very verbose and cumbersome to use.  <a title="Making Sense of Java's Dates" href="http://www.onjava.com/pub/a/onjava/2003/06/05/java_calendar.html">This</a> ONJava article helps but it&#8217;s just a reminder of how much easier dates are to play with in .NET</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li><a rel="nofollow" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F11%2F06%2Fjava-date-and-calendar-classes%2F&amp;title=Java%20Date%20and%20Calendar%20classes" title="del.icio.us"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F11%2F06%2Fjava-date-and-calendar-classes%2F&amp;title=Java%20Date%20and%20Calendar%20classes" title="Reddit"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F11%2F06%2Fjava-date-and-calendar-classes%2F&amp;t=Java%20Date%20and%20Calendar%20classes" title="Facebook"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F11%2F06%2Fjava-date-and-calendar-classes%2F" title="Identi.ca"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://twitter.com/home?status=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F11%2F06%2Fjava-date-and-calendar-classes%2F" title="TwitThis"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sheysrebellion.net/blog/2006/11/06/java-date-and-calendar-classes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How-to write Java programs that work with HTTP proxies</title>
		<link>http://www.sheysrebellion.net/blog/2006/10/22/how-to-write-java-programs-that-work-with-http-proxies/</link>
		<comments>http://www.sheysrebellion.net/blog/2006/10/22/how-to-write-java-programs-that-work-with-http-proxies/#comments</comments>
		<pubDate>Sun, 22 Oct 2006 13:32:50 +0000</pubDate>
		<dc:creator>Sheheryar Sewani</dc:creator>
				<category><![CDATA[Java]]></category>

		<guid isPermaLink="false">http://www.sheysrebellion.net/blog/?p=24</guid>
		<description><![CDATA[Sometimes, your network administrator may force you to connect to the internet through a HTTP Proxy. While this makes the administrator’s job of managing net security easier, a http proxy server will make your java application that communicates with the internet fall flat on its face. If you are behind a proxy server, your java [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes, your network administrator may force you to connect to the internet through a HTTP Proxy.  While this makes the administrator’s job of managing net security easier, a http proxy server will make your java application that communicates with the internet fall flat on its face.</p>
<p>If you are behind a proxy server, your java application must know that internet calls will go through a proxy, to do this, add the following lines to your program:</p>
<p><strong>System.getProperties().put( &#8220;proxySet&#8221;, &#8220;true&#8221; );<br />
System.getProperties().put( &#8220;proxyHost&#8221;, &#8220;server1&#8243; );<br />
System.getProperties().put( &#8220;proxyPort&#8221;, &#8220;8080&#8243; );</strong></p>
<p>Some proxies also require you to send a username and password, if your proxy requires such action then you must also add the following lines to your code:</p>
<p><strong>URL url = new URL(&#8220;http://www.somedomain.com/&#8221;);<br />
URLConnection conn = url.openConnection();</strong></p>
<p><strong>String password = &#8220;username:password&#8221;;<br />
String encodedPassword = base64Encode( password );<br />
conn.setRequestProperty( &#8220;Proxy-Authorization&#8221;, encodedPassword);</strong></p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li><a rel="nofollow" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F10%2F22%2Fhow-to-write-java-programs-that-work-with-http-proxies%2F&amp;title=How-to%20write%20Java%20programs%20that%20work%20with%20HTTP%20proxies" title="del.icio.us"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F10%2F22%2Fhow-to-write-java-programs-that-work-with-http-proxies%2F&amp;title=How-to%20write%20Java%20programs%20that%20work%20with%20HTTP%20proxies" title="Reddit"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F10%2F22%2Fhow-to-write-java-programs-that-work-with-http-proxies%2F&amp;t=How-to%20write%20Java%20programs%20that%20work%20with%20HTTP%20proxies" title="Facebook"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F10%2F22%2Fhow-to-write-java-programs-that-work-with-http-proxies%2F" title="Identi.ca"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow" href="http://twitter.com/home?status=http%3A%2F%2Fwww.sheysrebellion.net%2Fblog%2F2006%2F10%2F22%2Fhow-to-write-java-programs-that-work-with-http-proxies%2F" title="TwitThis"><img src="http://www.sheysrebellion.net/blog/wp-content/plugins/sociable/images/twitter.gif" title="TwitThis" alt="TwitThis" class="sociable-hovers" /></a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.sheysrebellion.net/blog/2006/10/22/how-to-write-java-programs-that-work-with-http-proxies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

