Decorators in Python

Yesterday I m searching for decorators in Python, and i found it difficult to get a good tutorial for a beginner like me. Tutorials are available but it all found waste for me.

Here you can find a good tutorial for decorators, which will be useful for beginners like me.

Last i recognized stack overflow is awesome and why my majority friends are using it.



How to install Ubuntu along with Windows 7

I have installed Windows 7 & Ubuntu 10.10 (why Ubuntu 10.10 is of my own reasons, i like that version) on Toshiba Satellite C640 successfully.

First of all you have to install Windows as windows has the tendency to take the whole disk space.

First completely  formatted the hard drive  and created 3 partitions (C – Windows, J & U – Ubuntu).

Install windows 7 (not explaining the steps as its a simple process and everyone knows).

Boot to windows put Ubuntu 10.10 CD in drive and restart your system.

While restarting press the boot preference key (as in Toshiba its F12) and select ODD (Optical Disk Drive).

It will open with a welcome Box : Click Install Ubuntu .

Now you can see 3 options in which it will select default Install along with other operating system. Press Forward button.

Next box will show Allocate drive space. Down you can see a red link advanced partition tool , click on it.

Now you can see the listing of partitions you made at the starting.

Just press on the partition you want to install Ubuntu ( for me its U). Now you can see three buttons enabled : Change, Delete & Revert.

Click on the Delete Button. It will create a free space on Drive listing.

Click on the free space you will see one Add box down.

Press the Add box, it will open a box called Create partition.

Now you can see Mount Point box at last of the Create partition pop up. Click on the drop down u will see /, /boot, /home, /tmp, /usr, /var, /srv, /opt, /usr/local 

Select /boot and allocate partition size in MB @ Partition Size Box up to Mount Point box. You can give the extension as Ext4 which will be on the top of drop down of  Type box. You can give give 4000 as per Ubuntu manual instruction s and press ok.

You will see a new a new partition got created as /boot.

Repeat the steps for all the drop down menus in the Mount Point box expect / (i.e. ROOT).

Once its finished click on the free space and click add.

Now in the create Partition pop up in the Type box select swap area ( up to now we are selecting Ext4). Now for Swap area you have to give twice of your system RAM ( for me i gave 8000 as i have 4GB RAM).

Now again click on the free space and click add. Now u have to create ROOT. For that click Mount point as / and give rest of the free space for ROOT.

And press Install button: it will ask do you want to return to partition menu . Press the continue button.

Set the time press Forward button.

select keyboard layout as USA and press forward .

Continue the installation by selecting accordingly.

Once the system restarts after installation you can see the option coming at boot time to select Windows/Ubuntu.

Now you system is ready for dual booting .

any further help please free to contact me:

mail :

Mob : +919916325083

gTalk & Skype : adarshthapasya

Samsung Galaxy B rumored to have edge to edge display ?

Samsung will release  a bezel-free smartphone as  late as Q3 of this year, Korean paper Maeli Business reported. Samsung is said to be developing a Galaxy B handset that would get rid of the standard bezel in favor of an edge-to-edge display. A bezel-less phone does pose some usability problems though. Depending on the way certain people hold their phones, a missing bezel increases the chances for inadvertent tapping on the touch screen.

The entire front side of this rumored Galaxy B device would be consumed by one giant touch screen display except for a small area at the top dedicated to a speaker, front-facing camera, and I assume some sensors, too. The handset would more than likely have an AMOLED touchscreen and be powered by Android. Still no tech specs are revealed, however, a large screen is promised.

So could the Galaxy B ultimately become the oft-rumored Galaxy S III? Now we will have to wait and see…..

Adobe and Google : ppapi (Pepper plugin api)

For Flash Player releases after 11.2, the Flash Player browser plugin for Linux will only be available via the “Pepper” API as part of the Google Chrome browser distribution and will no longer be available as a direct download from Adobe. Adobe will continue to provide security updates to non-Pepper distributions of Flash Player 11.2 on Linux for five years from its release….

Want to read more on this : Read full story

Simple Mathematics

Open a python shell. and type like this

>>> 9 *0.000001
output : 9.0000000000000002e-06
>>> 99 *0.000001
output : 9.8999999999999994e-05
>>> 111 *0.000001
output : 0.000111
>>> 999 *0.000001
output : 0.00099899999999999989

See the difference between first, second & third, fourth. First two takes floating notation.

So while  coding in any scripting language take care of this. It  may cause some simple bugs sometimes even critical.

In php we can use number_format() function to get all the outputs in decimal notation.  So there will be no mismatch in formats there by reducing the chance of creating a bug.

Saving 2 or 3 rs and environment

Last week i went for shopping near my home (3 min walk). Before starting i know that, i don’t want to buy much items, so i took my helmet with me. I kept the veggies in my helmet and went back to home.

Its easy to save 3 rs and environment.