Showing posts from June, 2011

Solve Hangman With Linux

By using Linux and standard commands (cat and grep) that come with it we can easily solve hangman puzzle. Lets see with an example. Let us suppose the word is PLANET and so far we have guessed  _ _ ANE_ Lets assume that we have made incorrect guesses with letters b,s,a,i,u. Now lets try to solve the hangman with the help of our Linux box. We all know that there is a file called words that ships with all most all Linux distribution. The file contains dictionary word. Many people have used the file for many clever uses. Let us also try to use that file to solve our hangman. In my box the file is in "/etc/dictionaries-common/words" If you do: cat /etc/dictionaries-common/words it will show you all the words. Lets try to grep our answer with regular expression. cat /etc/dictionaries-common/words | grep -iE ^..ane.$ here, -i makes the grep case insensitive. - E is for extended regular expression. ^ means starting of the word $ means end of the word . means a letter so

[SOLVED] File Not Opening On Click

While working on a website I had problem of file not opening when I double click them or choose 'open' from right click menu. I had set the default opener for .html file 'geany', but no matter what I do it wouldn't open. I tried changing it to 'text editor' (gedit) but none of the file would open with the default program. After investigating the problem was the text file had +x (execute) permission on them. And I had set preference in nautilus to run executable text files when they are opened. So every time I was trying to open the text file it was running instead of opening. The solution is simple: Either remove the execute permission of the text files Or In Nautilus-Preference-Behavior-Executable Text Files Change option to view executable text files when they are opened

Swiss Codemonkeys Funny Jokes App Missing From The Market

After resetting my phone I could no longer find  Swiss Codemonkeys Funny Jokes App  in market. It is one of the best funny jokes app. In fact its my favorite bed time app :') . In, the app  said "This app is incompatible with your [phone]" and the reason for it was "This item cannot be installed in your device's country". So in order to install the app, I downloaded the apk file from You can directly download the file from your phone's browser or download it in your computer and copy it in your phone. After that it can be easily installed by opening with any file browser like Astro .

Upgrade To Latest Unity

You can get the latest version of unity  in Ubuntu 11.04 Natty Narwhal by adding the  ppa:unity/ppa  ppa in your system. To do so, In terminal run sudo add-apt-repository ppa:unity/ppa after that run sudo apt-get update and finally run sudo apt-get upgrade This will fix number of bugs and improve performance on your system.

Cron In Google App Engine

Cron in google app engine is similar to cron we use in Linux. With cron we can schedule task to run at specified time automatically. To write cron in google app engine application we basically need to edit cron.yaml app.yaml and the main cron file with the code. cron.yaml has the following format: cron: - description: daily summary job   url: /tasks/summary   schedule: every 24 hours   timezone: Australia/NSW   target: version-2 description is just a description to your job. (optional) url is what will run. schedule is when the job will run. timezone if provided, the job will run at the schedule of that time zone otherwise according to UTC (optional) target is the application version target you want the job to run. (optional) You can use any of the following format in schedule option to run your job. every 12 hours every 5 minutes from 10:00 to 14:00 2nd,third mon,wed,thu of march 17:00 every monday 09:00 1st monday of sep,oct,nov 17:00 every day 00:00 If yo

View Log In Local Development Server In Google App Engine

In local development server there isn't a page from where you can see your application logs. But Google has provided a handy way to do so. Add ?debug in your URL and a pop box will come listing all the logs. http://localhost:8080/?debug Like in appengine dashboard you can see logs by Debug, Info, Warning, Error, Critical. There isn't a way to filter the logs yet though. You can change the position of the box to top four corners by clicking in the little box on top left corner of the popped up box.

Delete Message From Facebook Inbox

Q. How to delete message from Facebook inbox? A. If you click the little 'x', your message will be archived. Archived message are hidden from the inbox and put in archive folder. New message will continue from the archived stage. But to permanently delete a message open your message. Unarchive it if its already archived. After you open the message go to Action menu on top and click Delete . Select Delete All from the bottom.

Enable Tray Icon For All Program In Natty Narwhal

You won't see tray icons for application that doesn't use app indicator. To enable tray icons in Ubuntu 11.04 Natty Narwhal you can run the following command in terminal: gsettings set com.canonical.Unity.Panel systray-whitelist " [ 'all' ] " It will white list all the application for tray icon. If you want to enable tray icon in only some of the application you can use: gsettings set com.canonical.Unity.Panel systray-whitelist "['Wine', 'Dropbox']" Here it will enable tray icon for Wine and Dropbox.

Clear Zeitgeist or Gnome Activity Journal

If you want to clear the history stored by zeitgeist you can run the following command: rm ~/.local/share/zeitgeist/activity.sqlite zeitgeist-daemon --replace If you open Gnome-Activity-Journal after this, you'll see that all your history has been cleared out.

[Solved] No module named _multiprocessing

I had to use Google App Engine 1.5 on Windows and the windows machine had Python 2.6 While launching the GAE, I got error,  No module named _multiprocessing The solution is very simple. On root of your application create a file called with content "import multiprocessing" This should fix the problem.