pressureNET: An Android app to create a worldwide network of user-submitted barometer readings

Two weeks ago Phil Jones and I published the first version of our ambitious Android application on the market. It’s called pressureNET and it lets users submit barometric readings from their Android devices to our database. Users can see a map of the data and browse around, looking at readings submitted by other users. While this data is currently not very informative on its own, we are rapidly gaining users we will be developing tools and analytics to better process this wealth of data. We hope that we can build a large network of barometers that will then enable us to chart and graph weather patterns on a global scale. We have hopes to improve weather prediction on a short-term, local scale as well, perhaps by collaborating with other weather prediction organizations.

Pretty soon we’ll be bringing the map to the web, so that everyone can enjoy our results. Currently, pressureNET supports all Android 3.1+ devices, but so far only the Motorola Xoom and Samsung Galaxy Nexus have barometers.  There are lots of details about our plans (as well as the app’s source code!) on our blog at cumulonimbus.ca.

Binary Search in Haskell

I have just written a function in Haskell that will perform a binary search on a list of integers. Pass it your list, the value you’re searching for, default low and high (0 and n-1) and it will return for you the position of your value. I’m sure there are plenty of experienced Haskell coders that will tell me there’s a better way, but I haven’t heard from one yet.

binsearch :: [Int] -> Int -> Int -> Int -> Int -- list, value, low, high, return int
binsearch xs value low high
   | high < low       = -1
   | xs!!mid > value  = binsearch xs value low (mid-1)
   | xs!!mid < value  = binsearch xs value (mid+1) high
   | otherwise        = mid
   where
   mid = low + ((high - low) `div` 2)