<?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>KosherJava &#187; Software Bugs</title>
	<atom:link href="http://www.kosherjava.com/tag/software-bugs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kosherjava.com</link>
	<description>A weblog about Zmanim, Kosher Coffee (Kosher Java) and other odds &#38; ends</description>
	<lastBuildDate>Fri, 06 Jan 2012 18:28:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FAQ: Outputting Zmanim for A Different Time Zone With the the Zmanim API</title>
		<link>http://www.kosherjava.com/2011/11/08/outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api</link>
		<comments>http://www.kosherjava.com/2011/11/08/outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 05:01:03 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Bugs]]></category>
		<category><![CDATA[Timezone]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=1349</guid>
		<description><![CDATA[Question:Why does the output of zmanim for a different time zone appear incorrect?Answer: One of the common issues encountered by developers using the API is that zmanim generated for a different time zone than the user&#8217;s time zone may return output that appears incorrect. For example a user in Lakewood, NJ trying to calculate sunrise [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/coffeeQuestion.jpg" alt="Zmanim API FAQ"/><h2>Question:</h2>Why does the output of zmanim for a different time zone appear incorrect?<h2>Answer:</h2>
One of the common issues encountered by developers using the API is that zmanim generated for a different time zone than the user&#8217;s time zone may return output that appears incorrect. For example a user in Lakewood, NJ trying to calculate sunrise for Yerushalayim may attempt to use the following code:

<pre class="brush: java; title: ; notranslate">
String locationName = &quot;Jerusalem&quot;;
double latitude = 31.778; // Har habayis
double longitude = 35.2354;// Har Habayis
double elevation = 0;
TimeZone timeZone = TimeZone.getTimeZone(&quot;Asia/Jerusalem&quot;);
GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
ZmanimCalendar zc = new ZmanimCalendar(location);
zc.getCalendar().set(2011, Calendar.FEBRUARY, 8);
System.out.println(&quot;Sunrise: &quot; + zc.getSunrise());
System.out.println(&quot;Sunset: &quot; + zc.getSunset());
</pre>

While you would expect a <a href="http://www.kosherjava.com/maps/zmanim.html?lat=31.778&#038;lng=35.2354&#038;zoom=19&#038;date=2011-2-8">sunrise of 6:27:41 AM and sunset of 5:19:19 PM</a>, running this code on a computer anywhere in the Eastern Standard time zone would generate the following time that appears to be 7 hours early:
<pre class="brush: plain; title: ; notranslate">
Sunrise: Mon Feb 07 23:27:41 EST 2011
Sunset: Tue Feb 08 10:19:19 EST 2011
</pre>

The issue is simple, and the sunrise and sunset returned above are actually accurate. Zmanim are returned by the Zmanim API as a Java <a href="http://download.oracle.com/javase/7/docs/api/java/util/Date.html">Date object</a> that represents a moment in time (stored internally by Java as <a href="http://en.wikipedia.org/wiki/Unix_time">Unix Time</a> &#8211; the number of milliseconds since the January 1, 1970 GMT). Sunrise in Yerushalayim on February 8th actually happens at 11:27:41 PM on February 7th <b>EST</b>. Java is simply outputting the <a href="http://download.oracle.com/javase/7/docs/api/java/util/Date.html#toString%28%29">Date as a String</a> formatted to the users default time zone (EST in this example). The user probably intends to output the time in IST &#8211; Israel Standard Time (&#8220;Asia/Jerusalem&#8221; in the Olson database). To do this you have to output the zmanim using a formatter set to use the &#8220;Asia/Jerusalem&#8221; time zone.

<pre class="brush: java; title: ; notranslate">
DateFormat zmanimFormat = new SimpleDateFormat(&quot;EEE MMM dd HH:mm:ss z yyyy&quot;);
zmanimFormat.setTimeZone(location.getTimeZone());

System.out.println(&quot;sunrise: &quot; + zmanimFormat.format(zc.getSunrise()));
System.out.println(&quot;sunset:&quot; + zmanimFormat.format(zc.getSunset()));
</pre>
will output the expected
<pre class="brush: plain; title: ; notranslate">
sunrise: Tue Feb 08 06:27:41 IST 2011
sunset:Tue Feb 08 17:19:19 IST 2011
</pre>

Below is the full code example. 

<pre class="brush: java; highlight: [16,17,18,19]; title: ; notranslate">
import net.sourceforge.zmanim.*;
import net.sourceforge.zmanim.util.*;
import java.util.TimeZone;
public class FormatZmanim{
	public static void main(String [] args) {
		String locationName = &quot;Jerusalem&quot;;
		double latitude = 31.778; //latitude of Har habayis
		double longitude = 35.2354; //longitude of Har Habayis
		double elevation = 0; //optional elevation
		//use a Valid Olson Database timezone listed in java.util.TimeZone.getAvailableIDs()
		TimeZone timeZone = TimeZone.getTimeZone(&quot;Asia/Jerusalem&quot;);
		//create the location object
		GeoLocation location = new GeoLocation(locationName, latitude, longitude, elevation, timeZone);
		ZmanimCalendar zc = new ZmanimCalendar(location); //create the ZmanimCalendar
		zc.getCalendar().set(2011, Calendar.FEBRUARY, 8); //set the date
		DateFormat zmanimFormat = new SimpleDateFormat(&quot;EEE MMM dd HH:mm:ss z yyyy&quot;); //Create the formatter
		zmanimFormat.setTimeZone(location.getTimeZone()); //set the formatter's time zone
		System.out.println(&quot;sunrise: &quot; + zmanimFormat.format(zc.getSunrise()));
		System.out.println(&quot;sunset:&quot; + zmanimFormat.format(zc.getSunset()));
	}
}
</pre>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2011/11/08/outputting-zmanim-for-a-different-time-zone-with-the-the-zmanim-api/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>FAQ: Why Some Zmanim Never Occur (Developers Beware)</title>
		<link>http://www.kosherjava.com/2010/06/02/faq-why-some-zmanim-never-occur-developers-beware/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=faq-why-some-zmanim-never-occur-developers-beware</link>
		<comments>http://www.kosherjava.com/2010/06/02/faq-why-some-zmanim-never-occur-developers-beware/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 02:30:11 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Arctic Circle]]></category>
		<category><![CDATA[FAQ]]></category>
		<category><![CDATA[Latitude and Longitude]]></category>
		<category><![CDATA[null]]></category>
		<category><![CDATA[Software Bugs]]></category>
		<category><![CDATA[Twilight]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/?p=671</guid>
		<description><![CDATA[Question:Why do Some Zmanim Never Occur in Some Locations? (Developers Beware) Answer:While most people realize that the sun may not rise or set in the Arctic and Antarctic Circles (see the Star-K&#8217;s When Does One Pray When There Is No Day), many are not aware that some twilight dips will not occur during part of [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/EnglandTwilightMap.png" alt="England Twilight Map" title="England Twilight Map" /><h2>Question:</h2>Why do Some Zmanim Never Occur in Some Locations? (Developers Beware)
<h2>Answer:</h2>While most people realize that the sun may not rise or set in the <a href="http://en.wikipedia.org/wiki/Arctic_Circle">Arctic</a> and <a href="http://en.wikipedia.org/wiki/Antarctic_Circle">Antarctic</a> Circles (see the Star-K&#8217;s <a href="http://www.star-k.org/kashrus/kk-whendoesonepraywhenthereisnoday.htm">When Does One Pray When There Is No Day</a>),  many are not aware that some twilight dips will not occur during part of the year as far south of the Arctic Circle as London. For example around the <a href="http://en.wikipedia.org/wiki/Summer_solstice">summer solstice</a> in <a href="http://www.kosherjava.com/maps/zmanim2.html?lat=51.5&#038;lng=-0.10&#038;zoom=6&#038;date=2010-06-21">London (on the zmanim map)</a> the sun will never dip far enough below the horizon to reach <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ComplexZmanimCalendar.html#getAlos16Point1Degrees%28%29">Alos 16°</a>. This happens in London from June 5<sup>th</sup> till July 8<sup>th</sup>. The image seen on the top right (original at <a href="http://www.timeanddate.com/worldclock/sunearth.html?n=136&#038;month=6&#038;day=21&#038;year=2010&#038;hour=0&#038;min=28&#038;sec=0">timeanddate.com</a>) shows various <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/AstronomicalCalendar.html#getBeginAstronomicalTwilight%28%29">civil twilights</a> centered on London on Midnight June 21<sup>st</sup>. Look carefully to see the various bands of twilight. Gateshead will not have Alos 16° from May 16<sup>th</sup> through July 28<sup>th</sup>, while <a href="http://www.kosherjava.com/maps/zmanim2.html?lat=61.189412&#038;lng=-149.86042&#038;zoom=17&#038;date=2010-08-21">Anchorage, Alaska</a> (yes there is a <a href="http://lubavitch.com/centers/detail.html?id=389">Frum Shul in Anchorage</a> with an interesting davening direction issue that is discussed in the <a href="http://www.kosherjava.com/2011/01/17/davening-direction-from-alaska/">Davening Direction from Alaska</a> post ) will not have Alos 16.1° from April 25<sup>th</sup> to August 20<sup>th</sup>. Zmanim based on sunrise such as <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ZmanimCalendar.html#getAlos72%28%29">Also 72</a> that is a 72 minute offset of sunrise can be calculated as long as sunrise can be calculated, something that will happen as long as you are not in the Arctic or Antarctic Circles.
For this reason, the Zmanim API will return a <a href="http://en.wikipedia.org/wiki/Pointer_%28computing%29#Null_pointer">null</a> when a zman will not happen. A <a href="http://java.sun.com/javase/6/docs/api/java/lang/Long.html#MIN_VALUE">Long.MIN_VALUE</a> will be returned when a <a href="http://en.wikipedia.org/wiki/Long_integer">long</a> is expected such as in the case of a Shaah Zmanis. While an inconvenience to developers who have to code for this, the alternative of a default date would mean that developers unaware of this would return incorrect zmanim, something far worse than a program error from a <a href="http://java.sun.com/javase/7/docs/api/java/lang/NullPointerException.html">NullPointerException</a>.
In recent weeks two publicly available programs using the Zmanim API ran into issues due to nulls returned for early alos times. Being something not anticipated by the developers, the nulls generated errors in the programs that quickly led to fixes.  For this reason Yitzchok updated the <a href="http://github.com/Yitzchok/Zmanim/">Zmanim .NET project</a> to return the nullable <em>DateTime?</em> instead of the regular DateTime that it had previously been returning. While the <a href="http://www.kosherjava.com/zmanim/docs/api/">Zmanim API documentation</a> always made the possibility of a null being returned possible, I modified the documentation to make this clear on the return value documentation for every zman. Code with the modified documentation was part of the recently released Zmanim API 1.2.1.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2010/06/02/faq-why-some-zmanim-never-occur-developers-beware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zmanim Bug Report from the Land of the Midnight Sun</title>
		<link>http://www.kosherjava.com/2008/05/08/zmanim-bug-report-from-the-land-of-the-midnight-sun/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=zmanim-bug-report-from-the-land-of-the-midnight-sun</link>
		<comments>http://www.kosherjava.com/2008/05/08/zmanim-bug-report-from-the-land-of-the-midnight-sun/#comments</comments>
		<pubDate>Fri, 09 May 2008 01:27:29 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Software Bugs]]></category>
		<category><![CDATA[Zmanim Accuracy]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2008/05/08/zmanim-bug-report-from-the-land-of-the-midnight-sun/</guid>
		<description><![CDATA[I was recently contacted by Jan Terje Johansen, a developer at Datek Wireless AS in Norway, with an interesting bug report. Datek uses the Zmanim API (the AstronomicalCalendar base class) to allow their clients (the power company and stadiums) to remotely (via a web interface) control streetlights and stadium lights throughout Norway using a wireless [...]]]></description>
			<content:encoded><![CDATA[I was recently contacted by Jan Terje Johansen, a developer at <a href="http://datek.no">Datek Wireless AS</a> in Norway, with an interesting bug report. Datek uses the <a href="http://www.kosherjava.com/zmanim-project/">Zmanim API</a> (the <a href="zmanim/docs/api/net/sourceforge/zmanim/util/AstronomicalCalculator.html">AstronomicalCalendar</a> base class) to allow their clients (the power company and stadiums) to remotely (via a web interface) control streetlights and stadium lights throughout Norway using a <a href=" http://datek.no/Produkter_Lysstyring.htm">wireless lighting control system</a> that they developed. The zmanim code is used to allow setting the lighting times based on an offset of sunrise/sunset. For the technically curious, they are controlled primarily through <a href="http://en.wikipedia.org/wiki/General_Packet_Radio_Service">GPRS</a>, with <a href="http://en.wikipedia.org/wiki/Short_message_service">SMS</a> as fallback. A version under development uses <a href="http://www.zigbee.org">ZigBee</a>. The bug encountered was that for <a href="http://en.wikipedia.org/wiki/Troms%C3%B8">Tromsoe (Tromsø)</a>, Norway, as well as other areas within the <a href="http://en.wikipedia.org/wiki/Arctic_Circle">Arctic Circle</a> that experience the <a href="http://en.wikipedia.org/wiki/Midnight_sun">midnight sun</a>, from May 13th to May 17th (the date of last rise of the season in Tromsoe), the zmanim API produced correct sunrise/set times, but the date component (The API returns all times as Java Dates, something that might change with v2.0 of the API that will target <a href="https://jdk7.dev.java.net/"> JDK 7</a> to take advantage of <a href="https://jsr-310.dev.java.net/">JSR-310 Date and Time API</a>) was a day off. For non-automated systems, the date component is not important, but in their case it would cause the lights to go on/off on the wrong day. Jan provided a suggested patch that worked well. The actual fix I used was slightly different because I took advantage of the time spent on fixing the bug to refactor and simplify the code. This change as well as a few other changes are part of the Zmanim 1.1 <a href="http://www.kosherjava.com/zmanim-project/downloads/">beta release</a> that will likely be released as a final release in a few days. Jan mentioned that: <blockquote>&#8220;IMHO your API is easily the best and most accurate Open Source sunset/sunrise API out there&#8221;.  He continued:  &#8220;Officially (according to the Norwegian Meteorology Institute), the midnight sunset/sunrise is from May 20 to July 22 in Tromsoe, ie. the complete sun is above the horizon 24 hours. Parts of sun is visible 24 hours a day in Tromsoe from May 18th to July 25th. This is the same as in your calculations.&#8221;  &#8230;  &#8220;I have tested your calculations against other official midnight sunrise/sunset (part of sun) dates in Northern-Norway (North Cape, Hammerfest, Longyearbyen (<a href="http://maps.google.com/maps?q=Longyearbyen&#038;ll=78.508075,15.46875&#038;z=4">78,049762N -15,458252E</a>)) and they are spot on.&#8221;</blockquote> In response to my question regarding his testing of the NOAACalculator versus the USNOCalculator he had an interesting and very practical answer <blockquote>&#8220;We prefer to use USNO calculator as it is more in tune with the sunrise/sunset times printed in most newspapers. You see, our experience is that most users don&#8217;t look at the sun to determine sunrise/sunset but read the times in the newspaper. If our times don&#8217;t correspond to the printed ones, something is wrong with our system in their mind.&#8221;</blockquote>]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2008/05/08/zmanim-bug-report-from-the-land-of-the-midnight-sun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fix to NOAA Sunrise/Sunset Algorithm</title>
		<link>http://www.kosherjava.com/2008/04/13/fix-to-noaa-sunrisesunset-algorithm/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=fix-to-noaa-sunrisesunset-algorithm</link>
		<comments>http://www.kosherjava.com/2008/04/13/fix-to-noaa-sunrisesunset-algorithm/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 04:01:41 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Software Bugs]]></category>
		<category><![CDATA[Zmanim Accuracy]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2008/04/13/fix-to-noaa-sunrisesunset-algorithm/</guid>
		<description><![CDATA[The Zmanim API was developed from the ground up as an API which allows for easy plugging in of different algorithms. The Zmanim API ships with 3 &#8220;Calculator&#8221; implementations. Two calculators implement the US Naval Observatory&#8217;s algorithm, the SunTimesCalculator and the ZmanimCalculator. Both produce identical zmanim using slightly different code and are included for comparison. [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/pocketWatch.png" alt="pocket watch"/>The <a href="http://www.kosherjava.com/zmanim-project/">Zmanim API</a> was developed from the ground up as an API which allows for easy plugging in of different algorithms. The Zmanim API ships with 3 &#8220;<a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/AstronomicalCalculator.html">Calculator</a>&#8221; implementations.  Two calculators implement the <a href = "http://aa.usno.navy.mil/">US Naval Observatory&#8217;s</a> algorithm, the <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/SunTimesCalculator.html">SunTimesCalculator</a> and the <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/ZmanimCalculator.html">ZmanimCalculator</a>.  Both produce identical zmanim using slightly different code and are included for comparison. There is also the <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/JSuntimeCalculator">JSuntimeCalculator</a>, an implementation of the <a href="http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html">NOAA algorithm</a> by <a href="http://www.jstott.me.uk/">Jonathan Stott</a>. I was recently contacted by <a href="http://weeklyshtikle.blogspot.com/">Eliezer Bulka</a> who wanted to know why sunrise/sunset times generated by the NOAA algorithm were about 2 minutes off of the sunrise/sunset times generated by the NOAA <a href="http://www.srrb.noaa.gov/highlights/sunrise/sunrise.html">JavaScript implementation</a> that is the source of the JSuntimeCalculator. To compare apples and apples required modification of the NOAA JavaScript to allow entry of decimal latitude/longitude, and changing the output to display seconds. No change was made to the algorithm itself.  I then ported  the JavaScript directly to Java. This involved nothing more than slight syntax changes between the languages. Once this was done I noticed that the sun rise/set output from the Java port exactly matched the output of the NOAA JavaScript.  Analysis of Jonathan&#8217;s code showed (or at least my interpretation of it did) that there were two areas that caused the difference. Once is that he used a slightly different method of computing the Julian date, a key part of the algorithm. His change includes the time of day as part of the calculation. The net result of this change is that solar time generated using his algorithm varies based on the time of day the calculation is run, something that is incorrect. This means that there can be a discrepancy of up to one calendar day. If the user calculated sunrise at 11:59 PM, sunrise would be calculated for the following day even if the user attempted to calculate it for today. In addition, the other calculations do not match the output of the matching NOAA code. I have deprecated the JSuntimeCalculator and in its place added the <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/util/NOAACalculator">NOAACalculator</a> that was the result of the direct port of the NOAA code, shoehorned into the Zmanim API Calculator interface. I ran some tests to compare the maximum and minimum discrepancy between the 2 implementations, and  calculations for Lakewood, NJ, latitude 40.0828, longitude -74.2094 show a discrepancy of between a minute and 34 seconds to a minute and 37 seconds for sunrise and sunset across an entire year of sunrise and sunset calculations.  I also compared the USNO algorithm to the new NOAA implementation and ended up with a maximum deviation of less than 30 seconds, something that had been about 1.5 minutes apart previously. While I do believe that the Julian date calculation is a bug, I do not know that this is a case as far as the rest of the calculation, but it is clear that it does not match the NOAA implementation that is was based on, and I recommend that you <a href="http://www.kosherjava.com/zmanim-project/downloads/">download</a> the latest version that has the new NOAACalculator that fixes this issue. In addition to this fix, an additional patch will be released later this week that will address issues with calculations in the arctic circle. Stay posted for the next post.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2008/04/13/fix-to-noaa-sunrisesunset-algorithm/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Updated Zmanim Jar Released &#8211; Please Download the Latest</title>
		<link>http://www.kosherjava.com/2008/02/07/updated-zmanim-jar-released-please-download-the-latest/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=updated-zmanim-jar-released-please-download-the-latest</link>
		<comments>http://www.kosherjava.com/2008/02/07/updated-zmanim-jar-released-please-download-the-latest/#comments</comments>
		<pubDate>Thu, 07 Feb 2008 20:42:04 +0000</pubDate>
		<dc:creator>KosherJava</dc:creator>
				<category><![CDATA[Software Dev]]></category>
		<category><![CDATA[Zmanim]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Beta]]></category>
		<category><![CDATA[Download]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Software Bugs]]></category>
		<category><![CDATA[Timezone]]></category>

		<guid isPermaLink="false">http://www.kosherjava.com/2008/02/07/updated-zmanim-jar-released-please-download-the-latest/</guid>
		<description><![CDATA[In December when developing the Zmanim/Bearing to Yerushalayim map (blog post), I noticed a problem with the code used to generate zmanim. The API returns a Java Date object. Usually only the time is of interest, and the date is ignored, but in some cases (when a timezone offset is specified without using the Olson [...]]]></description>
			<content:encoded><![CDATA[<img class="alignleft" src="/images/SpilledCoffee.png" alt="Zmanim API Release" title="Zmanim API Release" />In December when developing the <a href="http://www.kosherjava.com/maps/zmanim.html">Zmanim/Bearing to Yerushalayim map</a> (<a href="http://www.kosherjava.com/2007/12/30/bearing-to-yerushalayim-and-zmanim-map/">blog post</a>), I noticed a problem with the code used to generate <a href="http://www.kosherjava.com/zmanim-project/">zmanim</a>. The API returns a Java Date object. Usually only the time is of interest, and the date is ignored, but in some cases (when a timezone offset is specified without using the <a href="http://en.wikipedia.org/wiki/Zoneinfo">Olson DB name</a> (such as America/New_York) or if the GMT timezone is used for other locations, and the local standard time is calculated as an offset of GMT), the date of the sunset returned was earlier than the sunrise date. This caused zmanim such as <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/ZmanimCalendar.html#getSofZmanShmaGRA()">Sof Zman Shema</a> for some locations to be incorrect, since the math used was comparing surnise to a sunset on the incorrect date, causing some very odd behavior. Updated files that correct this issue were uploaded to the site on Dec 26th. I was notified today by a developer using the jar, that not all the <a href="http://www.kosherjava.com/zmanim-project/downloads/">download links</a> were pointing to the updated versions, and this caused issues for his program (a post about his project will be posted in the near future). All the links have now been updated. Since the old code can sometimes generate incorrect zmanim, it is highly suggested that you replace your current jar with the latest version of <a href="http://www.kosherjava.com/zmanim/lib/zmanim.jar">zmanim.jar</a> (or <a href="http://www.kosherjava.com/zmanim/release/zmanim.zip">zmanim.zip</a>). <br /><br />Along with the fix mentioned above, a number of other small fixes were done. These include among other minor issues, fixed, better and simplified XML output from the <a href="http://www.kosherjava.com/zmanim/docs/api/net/sourceforge/zmanim/AstronomicalCalendar.html#toString()">toString</a> method, better error handling for expected error conditions, that had previously caused errors in the <a href="http://www.kosherjava.com/zmanim-project/zmanim-calendar-generator/">generations of zmanim</a> for areas in the arctic circle such as <a href="http://en.wikipedia.org/wiki/Thule_Air_Base">Thule, Greenland</a>. In case you are curious, someone did actually try this, and the error logs lead me to find the issue. The IP address used for the request mapped back to the <a href="http://www.thule.af.mil/">Thule Air Base</a>.]]></content:encoded>
			<wfw:commentRss>http://www.kosherjava.com/2008/02/07/updated-zmanim-jar-released-please-download-the-latest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

