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
#!/usr/bin/env python | |
from struct import pack, unpack | |
def vb_encode(numbers): | |
if isinstance(numbers, int): | |
numbers = [numbers] | |
bytestream = '' | |
for n in numbers: | |
bytes = [] | |
while True: |
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
#!/usr/bin/env python | |
from struct import pack, unpack | |
def vb_encode(number): | |
bytes = [] | |
while True: | |
bytes.insert(0, number % 128) | |
if number < 128: | |
break | |
number /= 128 |
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
#!/usr/bin/env python | |
import sys | |
from struct import pack | |
from vb import vb_encode | |
if len(sys.argv) < 2: | |
print "usage: %s in.txt > out.txt" % sys.argv[0] | |
sys.exit(1) | |
fp = open(sys.argv[1], 'r') |
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
#!/usr/bin/env python | |
import sys | |
from struct import unpack | |
from vb import vb_decode | |
if len(sys.argv) < 2: | |
print "usage: %s in.txt > out.txt" % sys.argv[0] | |
sys.exit(1) | |
fp = open(sys.argv[1], 'rb') |
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> | |
int main() | |
{ | |
return 0; | |
} |
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
# vim:fileencoding=utf8 | |
from pyahocorasick import AhoCorasick | |
terms = [] | |
fp = open('keyword.utf8.uniq.txt', 'rb') | |
for line in fp: | |
terms.append(line.strip().decode('utf8')) | |
fp.close() | |
ac = AhoCorasick(terms) |
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
# coding=utf8 | |
import bottlenose | |
from lxml import objectify | |
amazon = bottlenose.Amazon(access_key_id, secret_access_key, Region='JP') | |
res = amazon.ItemSearch(Keywords=u'東野圭吾', SearchIndex='Books', ItemPage='1', ResponseGroup='Small') | |
root = objectify.fromstring(res) | |
for item in root.Items.Item: | |
print unicode(item.ItemAttributes.Title) |
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 <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
typedef struct mulnum_t{ | |
int32_t fig; // 桁 | |
char *data; // 整数データ | |
int32_t size; // 確保したメモリのサイズ | |
}mulnum; |
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
# coding:utf-8 | |
require 'rubygems' | |
require 'jpstock' | |
# 逆日歩最高料率の計算 | |
def max_gyakuhibu(price, lot) | |
m = price * lot | |
g = (m / 50000.0).ceil * 100 | |
g = g / lot.to_f | |
if g <= 1 |
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
' 銘柄コードと銘柄名 | |
Public ccode As Integer | |
Public name As String | |
' 損益 | |
Public income As Long | |
' 信用新規買, 返済売 | |
Public buy_price As Double | |
Public buy_amount As Long |
OlderNewer