Sometimes we will got a rar compressed file from our friends, but there is no default tool in OpenSolaris to decompress the rar filess. We can got a Solaris Intel version from rarlab . The steps as the following: 1. down load the rar tools from rarlab. http://www.rarlab.com/rar_add.htm 2. uncompressed the source. # gunzip ./unrar-sol-intel.gz 3. move it to the location you used to. # mv /unrar-sol-intel.gz /usr/bin/unrar 4. try to decomprss # unrar x ./test.rar Wish this helps. regards, Stanley Huang
Once you get lost in git and you could try to find it by the following commands $ git fsck --lost-found $ git reset HEAD@{1} Wish this helps. regards, Stanley Huang
If you want to implement iif in Python, please refer to the following sample code: #!/bin/env python def iif(b): return 'It\'s True' if b else 'It\'s False' print iif(True) print iif(False) And the following sample, guess what will you get! #!/bin/env python b = True print 'b: %s' % 'Ture' if b else 'False' b = False print 'b: %s' % 'Ture' if b else 'False' Result: $ ./iif.py b: Ture False The second result is "False", not "b: False". Why??? Because the prededence of string concatenation is higher than if. Therefore you need to use () to make it correct. #!/bin/env python b = True print 'b: %s' % 'Ture' if b else 'False' b = False print 'b: %s' % ('Ture' if b else 'False') Wish this helps. regards, Stanley Huang
Comments
Post a Comment