Sometime , firefox did crash on me for don’t know what reason.
I think is because of Flash.. It was making some weird sound when tried to play a youtube video.
But even when pressed the close , exit button. (Quit_)
Upon trying to re-launch the firefox ..
something like this appear.
“there is another firefox process already running “
Hence, need to kill all Firefox process one by one.
So come the following …
$ ps xa| grep firefox| grep -v grep | awk '{print $1}' | xargs kill -9
So, after that you can re-launch the firefox again.
As it would no longer complain..


the above function can be simplified a but further with the following :
#!/usr/bin/python def getBM (eng): if eng == 'No rain': return "Tiada Hujan" if eng == 'Rain': return "Hujan" if eng == 'fair': return "Cerah" if eng == 'Weather Fair': return "Cuaca Baik" if eng == 'Clear': return "Cerah" if eng == 'Hazy': return "Berjerebu" if eng == 'Windy': return "Berangin" if eng == 'No rain': return "Tiada Hujan" if eng == 'Cloudy': return "Mendung" if eng == 'Cloudy over coastal areas': return "Mendung di kawasan pantai" if eng == 'Cloudy over inland areas': return "Mendung di kawasan pedalaman" if eng == 'Rain': return "Hujan" if eng == 'Intermittent rain occasionally moderate': return "Hujan sekejap-sekejap kadangkala sederhana" if eng == 'Intermittent rain occasionally heavy': return "Hujan sekejap-sekejap kadangkala lebat" if eng == 'Windspread intermittent rain': return "Hujan sekejap-sekejap yang menyeluruh" if eng == 'Isolated rain': return "Hujan di satu dua tempat" if eng == 'Isolated rain over coastal areas': return "Hujan di beberapa tempat di kawasan pantai" if eng == 'Isolated rain over inland areas': return "Hujan di beberapa tempat di kawasan pedalaman" if eng == 'Scattered rain': return "Hujan curah/sementara di satu dua tempat" if eng == 'Scattered rain over coastal areas': return "Hujan curah/sementara di kawasan pantai" if eng == 'Scattered rain over inland areas': return "Hujan curah/sementara di kawasan pedalaman" if eng == 'Showers': return "Hujan curah" if eng == 'Isolated showers': return "Hujan curah di satu dua tempat" if eng == 'Isolated showers over coastal areas': return "Hujan curah di kawasan pantai" if eng == 'Isolated showers over inland areas': return "Hujan curah di kawasan pedalaman" if eng == 'Thunderstorms': return "Ribut petir" if eng == 'Isolated thunderstorms': return "Ribut petir di satu dua tempat" if eng == 'Scattered thunderstorms': return "Ribut petir di beberapa tempat" if eng == 'Widespread thunderstorms': return "Ribut petir di kebanyakan tempat" else: return eng # example usage : print "translating 'No rain' = " + getBM("No rain") print "translating 'No rain' = " + getBM("Scattered thunderstorms") print "translating 'No rain' = " + getBM("Scattered rain over inland areas")hmm. if putting into a file and read from there would be much more better.
yeah..
to make it read from a text file and behave exactly as above.
#!/usr/bin/python import csv # to read from a file with list of weather. reader = csv.reader(open("weather_list.txt", "rb"), delimiter=':', quoting=csv.QUOTE_NONE) # build up a reference list kamus = {} for row in reader: english_w=row[0].lstrip(' ').strip(' ') bm_w=row[1].lstrip(' ').strip(' ') kamus[english_w] = bm_w # a function to return exactly the same def getBM (eng) : return kamus[eng] # example usage : print getBM ("Isolated showers"); print getBM ("Rain");then create text file with the following content.