This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In [84]: a | |
Out[84]: | |
{'b1': {'c1': {'d1': 'X1', 'd2': 'X2'}, 'c2': {'d3': 'X3', 'd4': 'X4'}}, | |
'b2': {'c3': {'d2': 'X6', 'd5': 'X1'}, 'c4': {'d7': 'X7', 'd8': 'X8'}}} | |
In [85]: f(a, 'b1/c2/d4') | |
Out[85]: 'X4' | |
In [86]: f(a, 'b2/c4') | |
Out[86]: {'d7': 'X7', 'd8': 'X8'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<jnlp spec="1.0+" codebase="http://ego:8080/scrumworks/jnlp/" href="scrumworks.jnlp"> | |
<information> | |
<title>ScrumWorks Basic Client</title> | |
<vendor>ScrumWorks, LLC.</vendor> | |
<homepage href="/scrumworks" /> | |
<description>ScrumWorks Basic - Unleash Team Self-Organization</description> | |
<description kind="short">ScrumWorks Basic Application</description> | |
<icon href="SWP_logoD_64.gif" /> | |
<icon kind="splash" href="sw_web_logo.jpg" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while (<>) { | |
s/(.*)/\[\U$1\]/; | |
print "$ARGV: $_"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
k@kallen ~/tmp/prl % perl uni.pm | |
STRING: H€lłØ Wø®Łð | |
STRING LENGTH: 11 | |
CHARACTERS: [H|€|l|ł|Ø| |W|ø|®|Ł|ð] | |
CHARACTERS LENGTH: 11 | |
CHARACTERS MATCH AGAINST /Łð$/: <H€lłØ Wø®><Łð><> | |
BYTES: [H|â||¬|l|Å||Ã|| |W|Ã|¸|Â|®|Å||Ã|°] | |
BYTES LENGHT: 19 | |
BYTES MATCH AGAINST /Łð$/: <H€lłØ Wø®><Łð><> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
def caca(n): | |
for i in xrange(n): | |
time.sleep(.2) | |
yield i | |
print "con generadores" | |
for i in caca(10): | |
print i |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
/* | |
* Escribe en ``pos`` la posicion del proximo caracter 'x' en ``s`` a | |
* donde ``pos`` >=``start``. | |
* Devuelve 0 si se puede encontrar 'x', de lo contrario, devuelve -1 | |
*/ | |
size_t find_all_x(char *s, size_t start, size_t *pos) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
k@kallen ~ % ./qq | |
4 x 5 + 3 x 2 | |
^ | |
4 x 5 + 3 x 2 | |
^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <locale.h> | |
#include <wctype.h> | |
#include <langinfo.h> | |
int main(int argc, char **argv) | |
{ | |
if (!setlocale(LC_ALL, "")) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import datetime | |
import locale | |
def utc_datetime_from_twitter_string_timestamp(s): | |
"""Parses as datetime.datetime in UTC a string formated Twitter timestamp""" | |
# we must parse the date in an english locale (due to %a and %b) | |
prev_loc = locale.getlocale() | |
try: | |
locale.setlocale(locale.LC_ALL, 'C') | |
return datetime.datetime.strptime(s, u'%a %b %d %H:%M:%S +0000 %Y') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
k@hirako ~ % cat hola.py | |
def f(): | |
print u"bla bla" | |
print u"soy un virus malo!" | |
k@hirako ~ % python | |
Python 2.6.2c1 (release26-maint, Apr 14 2009, 08:02:02) | |
[GCC 4.3.3] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from hola import f | |
soy un virus malo! |