Devlog :: And Wizardry

Tue, 07 Feb 2006

Powerful swell smashes my web site

They held the Mavericks surf contest today because of the powerful conditions. The swell made my buoyBrowser application stop working. It even hung one of my versions of Firefox. Hear's the error that was triggered by these rare conditions: /exception: java.lang.NumberFormatException: for input string "22+"/ My Java buoyBrowser application broke because an extremely long period swell was running yesterday. It turns out that the dominant period was over 22 seconds which is the longest period in the data files I download. The CDIP data files show this as "22+". It's rare to see even a foot of 22+ but it was up to 7 feet for that component. I took a screen shot shown below. I have the pointer on a time when the 22+ band is 5.5 feet and is the largest component. There were about 10 data points where this was true that day. I have back end software in Perl that scrapes the CDIP data files and precalculates everything for the Java app on my page. For one thing, it determines which swell component has the most energy. In this case it was 22+ which isn't a number. This is used in the 'Average Wave" display where the size is calculated combination of the size of all the individual components and the period is the period of the strongest component. In the six years this application has be running this is the first time 22+ has been dominant. Funny how many humbling lessons a fun little personal programming project can teach you. The fix? I now make sure no non numeric data gets into my data files. (s/[^0-9\s]//g) image pwizardry.com [/items/Perl] permanent link