Python ascii to binary

Aug 11
2010
import string
 
asci_lower = dict(map(lambda x,y: [x,y], string.ascii_lowercase,
                                      map(bin, map(ord, string.ascii_lowercase))))
 
asci_upper = dict(map(lambda x,y: [x,y], string.ascii_uppercase, 
                                       map(bin, map(ord, string.ascii_uppercase))))
 
print asci_lower['a']
0b1100001
 
print asci_upper['A']
0b1000001

9_999.999 lightyears

Aug 08
2010

the song itself and probably …

Sunshine Reggae

Aug 06
2010

Milka

Aug 06
2010

ReCaptcha CSS settings (again)

Aug 05
2010

In this case a ReCaptcha usage with web2py.

<script type="text/javascript">
    var RecaptchaOptions = {
	    theme: 'custom',
	    custom_theme_widget : 'sm_captcha'
    };
</script>
<div id="recaptcha">{{=T('Type the characters you see in the picture:')}}</div>
<div id="sm_captcha">
	<div id="recaptcha_image"></div> 
	<input type="text" id="recaptcha_response_field" class="inputBox" name="recaptcha_response_field" tabindex="14" /> 
	{{if form.errors.captcha:}}
	<div class="error" id="captcha_error">
	{{=form.errors.captcha}}
	</div>
	{{pass}}
	<div id="recaptcha_buttons"> 
		<a id="recatchaReload" href="javascript:Recaptcha.reload()">Reload</a>
		<a id="recatchaAudio" href="javascript:Recaptcha.switch_type('audio')">Audio</a>
		<a id="recatchaImage" href="javascript:Recaptcha.switch_type('image')">Text</a>
		<a id="recatchaHelp" href="javascript:Recaptcha.showhelp()">Help</a> 
	</div> 
	<script src="https://api-secure.recaptcha.net/challenge?k=YOUR_RECAPTCHA_KEY" type="text/javascript"></script><noscript><iframe frameborder="0" height="auto" src="https://api-secure.recaptcha.net/noscript?k=YOUR_RECAPTCHA_KEY" width="auto"></iframe><br /><input name="recaptcha_response_field" type="hidden" value="manual_challenge" /></noscript>
</div>

The result of these settings:

Sunset in Northeast Bulgaria

Aug 05
2010

PI is not 3.14

Apr 09
2010

To Be Continued

EU 2010, a monster cuts off a dog’s legs

Mar 30
2010

Several days ago a dog named Mima lost her legs just because a man living in the next house wanted to cut them off with an ax. This is happening in the town of Drianovo, Bulgaria. You can watch the official news here. The penalty for this person (in the worst case):  up to 500 €.

Mima will stay down from now on. Is this the EU justice?

Delete All Directories Except

Mar 27
2010

Write a Bash function or an alias.

#######
### alias 
#######
alias _rm_except="rm -rf $(ls | grep -v ^$1$)"
 
##########
### function
##########
_rm_except () { rm -rf $(ls | grep -v ^$1$) }
 
# sample usage:
$ cd /tmp && mkdir 1 2 3 11 22 33
$ _rm_except 1; ls
11  2  22  3  33

Jojo is resting

Feb 19
2010

Calendar

February 2012
M T W T F S S
« Sep    
 12345
6789101112
13141516171819
20212223242526
272829  

Tags