<?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>Jeremyopolis &#187; bugs</title>
	<atom:link href="http://jrsandberg.com/category/bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://jrsandberg.com</link>
	<description>An History Of Nerdly Activities</description>
	<lastBuildDate>Mon, 27 Sep 2010 02:57:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>double math in Java</title>
		<link>http://jrsandberg.com/2010/03/double-math-in-java/</link>
		<comments>http://jrsandberg.com/2010/03/double-math-in-java/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 22:51:01 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[bugs]]></category>

		<guid isPermaLink="false">http://jrsandberg.com/?p=113</guid>
		<description><![CDATA[I have been programming extensively using doubles and Doubles in Java.  Often, I have run into problems where simple mathematical operators will return 0.0. For example: ArrayList&#60;Double&#62; a, b; double temp = (a.get(0) + b.get(0)) * (a.get(0) + b.get(0)); After executing this code, temp would be equal to 0 no matter what values a.get(0) and [...]]]></description>
			<content:encoded><![CDATA[<p>I have been programming extensively using doubles and Doubles in Java.  Often, I have run into problems where simple mathematical operators will return 0.0. For example:</p>
<pre>ArrayList&lt;Double&gt; a, b;
double temp = (a.get(0) + b.get(0)) * (a.get(0) + b.get(0));
</pre>
<p>After executing this code, temp would be equal to 0 no matter what values <code>a.get(0)</code> and <code>b.get(0)</code> had.  This seemed very annoying and backwards and the only way I had to solve it was thusly:</p>
<pre>
double temp = (double)a.get(0) + b.get(0);
double result = temp * temp;
</pre>
<p>Then, result would actually have a result in it.  Go figure.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrsandberg.com/2010/03/double-math-in-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Integer to int null pointer exception?</title>
		<link>http://jrsandberg.com/2009/03/integer-to-in-null-pointer-exception/</link>
		<comments>http://jrsandberg.com/2009/03/integer-to-in-null-pointer-exception/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 01:19:04 +0000</pubDate>
		<dc:creator>Jeremy</dc:creator>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[school]]></category>

		<guid isPermaLink="false">http://jrsandberg.com/?p=16</guid>
		<description><![CDATA[As I was coding up some stuff for class today I was using your friendly HashMap in Java.  I created the hash map so it would use an Object and an Integer. I would have rather done an int but you can&#8217;t template ints.  Anyway, at one point I was pulling the Integer out of [...]]]></description>
			<content:encoded><![CDATA[<p>As I was coding up some stuff for class today I was using your friendly HashMap in Java.  I created the hash map so it would use an Object and an Integer. I would have rather done an int but you can&#8217;t template ints.  Anyway, at one point I was pulling the Integer out of the map with something like this:<br />
<code><br />
int parent = map.get(parentObj);<br />
</code><br />
There happened to be a case where the parent object wasn&#8217;t in the map and that line kept throwing a null pointer exception.  After a few minutes, I realized that is because the conversion from Integer to int implies an implicit method call.  And when the value returned from .get was null, there was a null pointer exception on the Integer.toInt() method.  So beware of implicit calls.</p>
]]></content:encoded>
			<wfw:commentRss>http://jrsandberg.com/2009/03/integer-to-in-null-pointer-exception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

