Box
Box
Posts List
  1. Python
  2. C++
  3. Latex
  4. Music Score
  5. Video

Test

Python

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import json
import jieba

while not done:

if(calc == SIZE):
break

c = f.readline()
data = json.loads(c)

for x, w in jieba.analyse.extract_tags(data['content'], withWeight=True):
if(not tagdict.has_key(x)):
tagdict[x] = All
All = All + 1

calc = calc + 1

C++

1
2
3
4
5
6
7
8
9
10
11
from stdio_ipc import ChildProcess
def action(ai):
try:
ai.send('action\n')
message = ai.recv(timeout=1)
posx, posy, tox, toy = map(int, message.strip().split(' '))
except Empty as e:
return { 'err': 'timeout' }
except :
return { 'err': 'wrong format. your output: %s' % repr(message) }
return { 'posx': posx, 'posy': posy, 'tox': tox, 'toy': toy }

Latex

$$
y=\frac{|\frac{\hat{M}}{max(\hat{M})} - I|_2^{2}}{n^2 - n}
$$

(Oh why the hexo extension didn’t work :(

Music Score

Don’t know how to test……

Video

Don’t know how to test…