Skip to content

Commit e27b2d8

Browse files
committed
add sarikasama
1 parent 452cf2a commit e27b2d8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+862
-0
lines changed

sarikasama/0000/0000.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env python3
2+
#Add a number on my icon with the name "icon.png".
3+
#My icon is a little ... big.
4+
#Problem0000
5+
6+
from PIL import Image, ImageDraw, ImageFont
7+
8+
def add_number(num):
9+
im = Image.open("icon.png")
10+
#make a image for showing the number
11+
txt = Image.new('RGBA', im.size, (255,255,255,0))
12+
#use the font "arial.ttf"
13+
fnt = ImageFont.truetype("arial.ttf",40)
14+
#draw context
15+
d = ImageDraw.Draw(txt)
16+
#draw the number
17+
d.text((im.size[0]-50 ,5), str(num), font=fnt, fill=(255,0,0,255))
18+
19+
out = Image.alpha_composite(im, txt)
20+
out.show()
21+
out.save("icon_"+str(num)+".png")
22+
23+
if __name__ == '__main__':
24+
add_number(42)

sarikasama/0000/arial.ttf

269 KB
Binary file not shown.

sarikasama/0000/icon.png

233 KB
Loading

sarikasama/0000/icon_42.png

237 KB
Loading

sarikasama/0001/0001.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env python3
2+
#generate 200 activation codes for my apple store app
3+
4+
import random, string
5+
6+
def gene_activation_code(count, length):
7+
#make sure codes are diffrent
8+
res = set()
9+
while len(res) < count:
10+
res.add(''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(length)))
11+
return res
12+
13+
if __name__ == "__main__":
14+
res = gene_activation_code(200, 8)
15+
f = open("codes","w")
16+
f.write("\n".join(res))
17+
f.close()

sarikasama/0001/codes

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
9HM28I2V
2+
YUTUSWLX
3+
KO910ZXR
4+
1XQ7OMTH
5+
R8B8XWT3
6+
CAZDMATI
7+
HNHAU3QA
8+
VR2A5O8L
9+
1A2TG34C
10+
X3JT0T0B
11+
H4LSILG3
12+
BCICBNNJ
13+
LUFUT2S0
14+
4H51EV7M
15+
WMHE0LX1
16+
LBO6B5U7
17+
EJG3J6ZZ
18+
YQCQV5IS
19+
3SEL07K3
20+
N288TJEL
21+
VFCC0K2B
22+
P8J9ZG5N
23+
TDY65TGQ
24+
JGR14QYY
25+
012QG5J7
26+
JJD09E6O
27+
1V6QXSND
28+
MITES6G1
29+
V3C09ACE
30+
2I84H8D9
31+
ZR9VA4OR
32+
0J8VTCFY
33+
XCBB9HWF
34+
GS1NL6UB
35+
70GO84CW
36+
T1V48W99
37+
H4L9PCSG
38+
0XSXAQT0
39+
D7J98ZSY
40+
IKB10A5S
41+
VQGZ5L4C
42+
WJU2IMH8
43+
0XTNP65W
44+
XQ671726
45+
LCIMNOH4
46+
R36ZXNGT
47+
NU04BJOR
48+
P2IJVBEP
49+
JT1SCFZC
50+
69Y6VQ7A
51+
V5D5G6X2
52+
9GCKGK6M
53+
UB5G5OHX
54+
BGA0KKP6
55+
6V5TSJ58
56+
570VS9I6
57+
E03UJCOB
58+
J2UCMXGT
59+
8J7XBKU4
60+
MIJJDS35
61+
TCJFR4OU
62+
AT1M8RXF
63+
6G7PZVXU
64+
9601SLTJ
65+
G585YO17
66+
FOO71FXH
67+
N4TM1W45
68+
D0UZGV1C
69+
3X44O8AC
70+
A89NHFE7
71+
9PRH0BYM
72+
JFC3X18B
73+
HXBZY6DL
74+
2S3LZAPT
75+
HX572VEB
76+
WX0W7R99
77+
VKYBQBRI
78+
ZDU36TBC
79+
4L4EU1Y5
80+
TEBGN81Y
81+
BDJFCK9I
82+
SXA2D5EZ
83+
FCG7VJN0
84+
MWIEFAM2
85+
E8TO1EY5
86+
1JRU6F31
87+
7N70U7N7
88+
CSIWDBUK
89+
VQ8KR73I
90+
ISHABRX5
91+
2TXRGDJ8
92+
Z90BQBSG
93+
WSBJ4X3L
94+
34EKGUR8
95+
A63CJ0F0
96+
4QJ9TB49
97+
PTVLGUF3
98+
A9B0PY0K
99+
ZVP29VCK
100+
K3H9331J
101+
21HG6P11
102+
W6GZAVVD
103+
I5HGBM6P
104+
8RTCLY8R
105+
5A860OIH
106+
VLN2ZB37
107+
7DRYVPHU
108+
FWI0HDAD
109+
6P9RGQ8Z
110+
7F9Q10FR
111+
7HNH3EWP
112+
PFHK18Z6
113+
5VS9PKLC
114+
AZMBWSKW
115+
XA30TWRJ
116+
V6HI00G4
117+
A385GB8L
118+
1UFF62RI
119+
3TL6B4D4
120+
JYWHW6EY
121+
JZ7X5R31
122+
FG51SGUY
123+
Z7YTXLGF
124+
J3AVBX3P
125+
FNV19XYR
126+
M3I2Q6EV
127+
YY35QIOS
128+
J2BMJVP3
129+
XW9HM2HB
130+
1873CQQ8
131+
KGL61SL7
132+
TU41J8F4
133+
U1UCSYE5
134+
4L45MMQ9
135+
MFQLY7CB
136+
MKFH50ZZ
137+
LQ44DAW9
138+
8599GTIB
139+
IGCT34SA
140+
Q39B1TOJ
141+
LANF45HH
142+
72PJTWPK
143+
F0XPL1ZO
144+
5U7KOGZ9
145+
6M1MMXZ1
146+
HVZQD6RB
147+
H2D50E2W
148+
WJEXAK1L
149+
I4CBC1W5
150+
X9XRXBS3
151+
DBNDT60B
152+
6C6QJW0V
153+
H8J8ZW8D
154+
64MUB2X0
155+
8R44E4P9
156+
R83AV775
157+
UBRSJBPF
158+
JN36LDJW
159+
3C2EEMIQ
160+
HRE1S0SK
161+
SH8QH70P
162+
3BI5Q1ZF
163+
1VAQQXA0
164+
QGY6Y7G6
165+
1QQ9FLV7
166+
AP1SNJP2
167+
G68VA57Y
168+
N6UHT54O
169+
7Q9BB5JL
170+
B4PIP9CJ
171+
BAS3O1FH
172+
L6Q6YVSH
173+
APRT16IN
174+
K4205WGU
175+
R00E9H6L
176+
6MW091Y5
177+
ERCE510B
178+
U8XKOESQ
179+
1YAXZEFB
180+
KESINTFI
181+
03DUWJYK
182+
VRFUU0ZR
183+
F5E4B6FX
184+
XSEBU1JQ
185+
3E692DCL
186+
SF5A49NX
187+
7P73NY4S
188+
FAI8YPYC
189+
TDA6FHLT
190+
1NIX4S8W
191+
R549CDKZ
192+
CHK907PO
193+
5S8BU9CN
194+
XJIK45B5
195+
PK1PKL3K
196+
UDU54DY7
197+
G863ES4G
198+
GNW10XUX
199+
FEBRWV5F
200+
88I6TN3R

sarikasama/0004/0004.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
#count words in a textfile
3+
4+
from pprint import pprint
5+
import re
6+
7+
def main():
8+
res = {}
9+
with open('test','r') as f:
10+
content = f.read()
11+
tmp = re.split(r"[^a-zA-Z]",content)
12+
for w in tmp:
13+
if not w:
14+
continue
15+
w = w.lower()
16+
if w not in res:
17+
res[w] = 1
18+
else:
19+
res[w] += 1
20+
pprint(res)
21+
22+
if __name__ == "__main__":
23+
main()

sarikasama/0004/output

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{'a': 5,
2+
'about': 1,
3+
'age': 1,
4+
'all': 1,
5+
'always': 2,
6+
'an': 1,
7+
'and': 1,
8+
'arms': 1,
9+
'as': 2,
10+
'at': 4,
11+
'been': 1,
12+
'before': 1,
13+
'born': 1,
14+
'but': 1,
15+
'by': 1,
16+
'can': 1,
17+
'child': 1,
18+
'count': 1,
19+
'did': 3,
20+
'dolly': 1,
21+
'dolores': 1,
22+
'dotted': 1,
23+
'down': 1,
24+
'envied': 1,
25+
'exhibit': 1,
26+
'fact': 1,
27+
'fancy': 1,
28+
'feet': 1,
29+
'fire': 1,
30+
'for': 1,
31+
'four': 1,
32+
'gentlemen': 1,
33+
'girl': 1,
34+
'had': 1,
35+
'have': 2,
36+
'i': 1,
37+
'in': 6,
38+
'indeed': 1,
39+
'initial': 1,
40+
'is': 1,
41+
'jury': 1,
42+
'ladies': 1,
43+
'lee': 2,
44+
'life': 1,
45+
'light': 1,
46+
'line': 1,
47+
'lo': 4,
48+
'loins': 1,
49+
'lola': 1,
50+
'lolita': 4,
51+
'look': 1,
52+
'loved': 1,
53+
'many': 1,
54+
'might': 1,
55+
'misinformed': 1,
56+
'morning': 1,
57+
'murderer': 1,
58+
'my': 6,
59+
'no': 1,
60+
'noble': 1,
61+
'not': 1,
62+
'number': 1,
63+
'of': 7,
64+
'oh': 1,
65+
'on': 3,
66+
'one': 3,
67+
'palate': 1,
68+
'plain': 1,
69+
'point': 1,
70+
'precursor': 1,
71+
'princedom': 1,
72+
'prose': 1,
73+
'school': 1,
74+
'sea': 1,
75+
'seraphs': 2,
76+
'she': 8,
77+
'simple': 1,
78+
'sin': 1,
79+
'slacks': 1,
80+
'sock': 1,
81+
'soul': 1,
82+
'standing': 1,
83+
'steps': 1,
84+
'style': 1,
85+
'summer': 2,
86+
'ta': 2,
87+
'taking': 1,
88+
'tangle': 1,
89+
'tap': 1,
90+
'teeth': 1,
91+
'ten': 1,
92+
'that': 1,
93+
'the': 10,
94+
'there': 1,
95+
'this': 1,
96+
'thorns': 1,
97+
'three': 2,
98+
'tip': 1,
99+
'to': 1,
100+
'tongue': 1,
101+
'trip': 1,
102+
'was': 7,
103+
'what': 1,
104+
'when': 1,
105+
'winged': 1,
106+
'years': 1,
107+
'you': 1}

sarikasama/0004/test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lolita, light of my life, fire of my loins. My sin, my soul. Lo-lee-ta: the tip of the tongue taking a trip of three steps down the palate to tap, at three, on the teeth. Lo. Lee. Ta. She was Lo, plain Lo, in the morning, standing four feet ten in one sock. She was Lola in slacks. She was Dolly at school. She was Dolores on the dotted line. But in my arms she was always Lolita. Did she have a precursor? She did, indeed she did. In point of fact, there might have been no Lolita at all had I not loved, one summer, an initial girl-child. In a princedom by the sea. Oh when? About as many years before Lolita was born as my age was that summer. You can always count on a murderer for a fancy prose style. Ladies and gentlemen of the jury, exhibit number one is what the seraphs, the misinformed, simple, noble-winged seraphs, envied. Look at this tangle of thorns.

sarikasama/0005/0005.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python3
2+
#change the resolution of pics in dir 'test' to at most 1136*640 for iphone5
3+
from PIL import Image
4+
import os
5+
6+
def main():
7+
os.chdir('test')
8+
for root,dirs,files in os.walk(os.getcwd()):
9+
for f in files:
10+
im = Image.open(f)
11+
if im.size[0] > 1136:
12+
im.resize([1136,im.size[1]])
13+
if im.size[1] > 640:
14+
im.resize([im.size[0],640])
15+
im.save('test_'+im.filename)
16+
17+
if __name__=='__main__':
18+
main()

0 commit comments

Comments
 (0)