Tuesday, August 28, 2012

Linux: Process Backgound/Foreground

To send a currently running process to background press: Ctrl+Z

~$ sudo unzip Acappella_METRO.zip
Archive:  Acappella_METRO.zip
   creating: Acappella_METRO/
  inflating: Acappella_METRO/.project
  inflating: Acappella_METRO/.pydevproject
   creating: Acappella_METRO/.settings/
  inflating: Acappella_METRO/.settings/org.eclipse.core.resources.prefs
   creating: Acappella_METRO/birt-runtime-2_2_2/
  inflating: Acappella_METRO/birt-runtime-2_2_2/about.html
   creating: Acappella_METRO/birt-runtime-2_2_2/about_files/
   creating: Acappella_METRO/birt-runtime-2_2_2/about_files/CVS/
 extracting: Acappella_METRO/birt-runtime-2_2_2/about_files/CVS/Entries
 extracting: Acappella_METRO/birt-runtime-2_2_2/about_files/CVS/Repository
 extracting: Acappella_METRO/birt-runtime-2_2_2/about_files/CVS/Root
  inflating: Acappella_METRO/birt-runtime-2_2_2/about_files/LICENSE.txt
  inflating: Acappella_METRO/birt-runtime-2_2_2/birt.war  ^Z
[1]+  Stopped                 sudo unzip Acappella_METRO.zip

To bring back the process to foreground type: fg 1

inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/mapper.py
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/mapper.pyc
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/properties.py
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/properties.pyc
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/query.py
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/query.pyc
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/scoping.py
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/scoping.pyc
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/session.py
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/session.pyc
  inflating: Acappella_METRO/thirdparty/sqlalchemy/orm/shard.py

Wednesday, August 22, 2012

Friday, August 10, 2012

Python: Split a string into array with each character

use list() mehod:


numbers = "342"
lst = list(numbers)
print lst // ['3','4','2']

Reference:
http://ubuntuforums.org/showthread.php?t=541931

Python: iterate for loop backwards

use reversed() method:


>>> array=[0,10,20,40]
>>> for i in reversed(array):
...     print i

reference:
http://stackoverflow.com/questions/3940128/how-can-i-reverse-a-list-in-python

Thursday, August 9, 2012

Windows 7: You need to format the disk in drive before you can use it

If you get this error:

"You need to format the disk <DriveLetter> in drive before you can use it"


Just follow the followoing steps :

1. Go to start button on windows.
2. Type "cmd"  and right click on "cmd" search result icon and click "Run as Administrator"
3. C:\Windows\system32>
4. Now type :     chkdsk <Your hard disk letter>: /f

For e.g If my hard disk is named "f" then just type ----------   chkdsk f: /f

Try it out...I guess it will work.

Reference:
http://answers.microsoft.com/en-us/windows/forum/windows_vista-system/you-need-to-format-the-disk-in-drive-j-before-you/4e153784-3217-4425-9c39-48030af82a13

Monday, August 6, 2012

Toad For Windows: Installation and Configuration

Her is a great article with all the steps to install Toad For Windows

Here is the link:
http://jorgeehumir.wordpress.com/2011/05/15/instalacion-y-configuracion-de-toad-for-oracle-10-5/

Ps: the instant client url is here http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html, you have to install the windows 32 bits version, because there are some issues with the Instant Client 64Bits version: "Cannot load OCI DLL: " http://toadfororacle.com/thread.jspa?threadID=24227