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 re | |
from copy import deepcopy | |
import operator | |
RE_NUM = re.compile('\s*([-+]?\d+(\.\d+)?)') | |
def number(word): | |
result = RE_NUM.match(word) | |
groups = result.groups() |
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
<?sap.transform simple?> | |
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates"> | |
<!-- | |
json: example: | |
[{"result":-3.585595,"errorCode":"0","errorMessage":" "}, | |
{"result":-3.585595,"errorCode":"0","errorMessage":" "}] | |
abap type: | |
TYPES: BEGIN OF ty_result, |
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
DATA buffer TYPE xstring. | |
DATA v_text TYPE string. | |
DATA v_text2 TYPE string. | |
DATA conv TYPE REF TO cl_abap_conv_in_ce. | |
conv = cl_abap_conv_in_ce=>create( encoding = 'UTF-8' ). | |
LOOP AT response. | |
buffer = response. | |
conv->convert( | |
EXPORTING input = buffer |
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 requests | |
from datetime import datetime | |
def timer(file): | |
def wrapper(func): | |
def wrapper(*argv): | |
d1 = datetime.now() | |
res = func(*argv) | |
d2 = datetime.now() | |
file.write('duration:{0.seconds}s {0.microseconds}ms\n'.format(d2-d1)) |
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
# delete specific tags from html file | |
# by quxiaowei | |
# @ 20160702 | |
i = j = 0 | |
text = """ | |
<p class="p"><b><span style="font-family: 'Times New Roman': font-size: 12pt;">一、岗位及人数</span></b><span style="font-family: 'Times New Roman'; font-size: 12pt;"><o:p></o:p></span></p><p class="p"><span style="font-family: 'Times New Roman'; font-size: 12pt;">办公室工作人员,<font face="Times New Roman">1</font><font face="微软雅黑">名;教师,</font><font face="Times New Roman">4</font><font face="微软雅黑">名。</font></span><font class=" | |
""" | |
text_o = '' |
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
bytes.fromhex(str_str).decode('ascii') |
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
iconv -f cp936 -t utf-8 chinese-gb2312.txt > chinese-utf8.txt |
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
for i in {1..12} | |
do | |
url=http://www.bilibili.com/video/av3794937/index_$i.html | |
echo $url | |
youtube-dl -o "SeGmEnT-$i-%(playlist_index)s.%(ext)s" $url | |
rm -f buffer_list | |
touch buffer_list | |
for file in $(ls SeGmEnT-$i-*.flv) | |
do | |
echo file "'$file'" >> buffer_list |
NewerOlder