Android app can now save people’s lives!


Don’t believe it? I too didn’t until I read about this PressureNET open-source android app recently. This is a crowd-sourced app and its working is simple: Just gauge these two parameters:

1) Atmospheric pressure using the pressure sensors (available in latest android phones like Galaxy S4/Nexus), and

2) GPS coordinates using the GPS sensor.

and send the data to the PressureNET web-server through Internet. Now, with enough number of people running this app on their devices, weather scientists across the nation have access to substantial data regarding pressure-belts forming in various parts of the country. They can then input this data to their weather modeling systems and come-up with solid predictions! (not just vague guesses like now) regarding for example, when and exactly where the next hurricane is going to hit. According to Cliff Mass, an atmospheric Scientist at the University of Washington, this data can help predict an occurrence of a hurricane up to six hours earlier. There is currently, no technique to do it now.

Whilst the pressure-sensor is being used for this purpose, the intentions of Google was something totally different when putting this feature into the android OS. It was to fetch the altitude information. You see, the GPS tells you only the Geo-coordinates (Lat/Lon) on a plane surface. But the atmospheric-pressure changes as a person travels uphill or downwards, and thus it can let us know exactly what altitude a person is on!





A Python finds out which is the best performing Linux distro!


With more and more linux distributions competing among themselves for the userspace, we are currently living in the best of times as far as choice in open-source software is concerned. However, more the number of choices, more is the head-scratching to decide what to choose amongst them. Like many, I am also one of the victims of “distro-hopping”. No sooner a major distribution declares a new version, I’m itching to try one out in my virtual box or as a LiveCD version. Few days ago, this benchmarking idea occurred to me.

I’m a software developer and my requirements were clear. I wanted a distro that is good at performance. Since my desktop is cluttered with “heavy-duty” programs like Eclipse-ADT, Java, IDLE, etc., performance was my primary concern. I mostly write application software and android apps, so things like disk I/O, memory and CPU utilization matter.

With these things in my mind, I was seeking a simple way to do a quick benchmark of various distros to find out what suits my needs. Thats when this idea came to me – Almost all distros come preloaded with a general-purpose scripting language called python which could be summoned for the job. I took “time taken in milliseconds” to do 5 basic tasks to decide on the performance. These tasks were:

  1. Zip-test: A test to compress a large file to a zip file, and extract in back in python code.
  2. Random-test: Generate 5 million random numbers and round them to zero decimals.
  3. I/O test: Write a unicode string ‘spam and eggs’ 5 million times to a text file, and read them back.
  4. CSV test: Generate a CSV spreadsheet with 5 million rows in it, and read them back.
  5. Bandwidth test: Download the 800K akonadi RPM file from IIT Kanpur’s website.

(The last one was just for the sake of completeness. Internet bandwidth depends more on other parameters such as your ISP limits, time of the day, latency, etc. rather than the disto you are using).

The contestants in the arena were:

  1. openSUSE 12.2
  2. Debian 7 (GNOME version)
  3. Fedora 18
  4. Ubuntu 12.04 LTS
  5. Xubuntu 12.04

My previous experience with Ubuntu made be biased towards it, but the tests showed me how wrong I was. Also, from what I’d read in most blogs on the Internet, KDE was one of the most bloated distros ever. However, in my tests KDE on openSUSE topped the race in most parameters, though the credit should go to openSUSE for optimizing the KDE. The second spot saw Fedora and Debian fighting amongst them, while Ubuntu (that I was presently using) fared the worst! Here are the detailed results:

Test zt1




random io csv bandwidth
debian1 7622 2753 9142 5732 12784 118978
debian2 7724 2752 9161 5287 12112 92386
fedora18_1 8605 4168 6287 5972 12750 0
fedora18_2 7762 4164 6419 6160 12818 0
openSUSE1 9001 2313 5915 5904 12715 115999
openSUSE2 7253 2245 6035 5935 11492 71257
precise1 9649 5012 8807 6846 13552 78560
precise2 10555 4434 8890 7229 13455 48286
xubuntu1 13305 4827 8954 5839 14676 58538
xubuntu2 10826 4760 8934 7908 12802 52768

*Above figures represent time-taken in milliseconds

The bandwidth test could not be performed on fedora as the Live CD did not have the wget package installed, but I did not need that to get a general idea of things.

My Conclusion: openSUSE wins the race, though Debian-7 and Fedora-18 are also fine distros for performance.

Here is the entire python benchmarking script that you may customize as per your requirement (change initializing variables in the script and run by issuing “python” from the shell):


import sys,time,os
import zipfile,random,csv
import subprocess
from zipfile import ZipFile,ZIP_DEFLATED
from random import random

#This should be initially present before running the program:
file_to_extract = “VirtualBox.exe” #”dotnetfx35.exe”

def timer(test):
if test == “ziptest1”:
elif test == “ziptest2”:
elif test == “randomtest”:
elif test==”iotest”:
elif test==”csvtest”:
elif test==”bwtest”:

print test,timetaken,”msecs.”
return timetaken

def ziptest1():
myzip=zipfile.ZipFile(‘’,’w’,ZIP_DEFLATED) #ZIP_STORED

def ziptest2():

def randomtest():
for i in range(1,5000000):
r = round(random()*100,0);
#print r

def iotest():
for i in range(1,5000000):
file.write(u’spam and eggs’)
while (s!=”):
#print s

def csvtest():
writer= csv.writer(file,delimiter=’,’,quotechar=’|’)#,quoting=csv.QUOTE_MINIMAL)
for i in range(1,5000000):
for row in reader:
s= ‘,’.join(row)

def bwtest():[“wget”,””,”-O akonadi.rpm”])[“wget”,””,”-O”,”akonadi.rpm”])

if __name__ == “__main__”:
#print time.strftime(“%d-%m-%y %H:%M”, time.gmtime())
#print time.strftime(“%d-%m-%y %H:%M”, time.localtime())

#Store results to csv file.
writer= csv.writer(file,delimiter=’,’,quotechar=’|’)
print ‘\n\nWritten results.csv’