code
stringlengths
1
1.49M
vector
listlengths
0
7.38k
snippet
listlengths
0
7.38k
from random import shuffle from Carta import Carta class Mazo(object): """Representa a un mazo de barajas inglesas""" def __init__(self): """Inicializa un mazo con sus 52 cartas""" self.cartas = [] for numero in xrange(1, 13 + 1): for palo in (Carta.CORAZONES, Carta.DIAMANTES, Carta.PICAS, Carta.TREBOLES):...
[ [ 1, 0, 0.0417, 0.0417, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.0833, 0.0417, 0, 0.66, 0.5, 238, 0, 1, 0, 0, 238, 0, 0 ], [ 3, 0, 0.5833, 0.875, 0, 0.66...
[ "from random import shuffle", "from Carta import Carta", "class Mazo(object):\n\t\"\"\"Representa a un mazo de barajas inglesas\"\"\"\n\tdef __init__(self):\n\t\t\"\"\"Inicializa un mazo con sus 52 cartas\"\"\"\n\t\tself.cartas = []\n\n\t\tfor numero in xrange(1, 13 + 1):\n\t\t\tfor palo in (Carta.CORAZONES, Ca...
from string import upper import re from sys import stdin SCORES = {'A':1, 'E':1, 'I':1, 'L':1, 'N':1, 'O':1, 'R':1, 'S':1, 'T':1, 'U':1, 'D':2, 'G':2, 'B':3, 'C':3, 'M':3, 'P':3, 'F':4, 'H':4, 'V':4, 'W':4, 'Y':4, 'K':5, 'J':8, 'X':8, 'Q':10, 'Z':10} def read_dictionary_from_file(): ...
[ [ 1, 0, 0.009, 0.009, 0, 0.66, 0, 890, 0, 1, 0, 0, 890, 0, 0 ], [ 1, 0, 0.018, 0.009, 0, 0.66, 0.1429, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.027, 0.009, 0, 0.66, ...
[ "from string import upper", "import re", "from sys import stdin", "SCORES = {'A':1, 'E':1, 'I':1, 'L':1, 'N':1, 'O':1, 'R':1, 'S':1, 'T':1, 'U':1,\n 'D':2, 'G':2, 'B':3, 'C':3, 'M':3, 'P':3, 'F':4, 'H':4, 'V':4, 'W':4,\n 'Y':4, 'K':5, 'J':8, 'X':8, 'Q':10, 'Z':10}", "def read_dictionary_fr...
from time import clock, time import heapq POINTS_TABLE = { 'A': 1, 'E': 1, 'I': 1, 'L': 1, 'N': 1, 'O': 1, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'D': 2, 'G': 2, 'B': 3, 'C': 3, 'M': 3, 'P': 3, 'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4, 'K': 5, 'J': 8, 'X': 8, 'Q': 10, 'Z': 10 } class WordNode(...
[ [ 1, 0, 0.0035, 0.0035, 0, 0.66, 0, 654, 0, 2, 0, 0, 654, 0, 0 ], [ 1, 0, 0.007, 0.0035, 0, 0.66, 0.0625, 251, 0, 1, 0, 0, 251, 0, 0 ], [ 14, 0, 0.0194, 0.0141, 0, ...
[ "from time import clock, time", "import heapq", "POINTS_TABLE = { 'A': 1, 'E': 1, 'I': 1, 'L': 1, 'N': 1, 'O': 1, 'R': 1, 'S': 1,\n 'T': 1, 'U': 1, 'D': 2, 'G': 2, 'B': 3, 'C': 3, 'M': 3, 'P': 3,\n 'F': 4, 'H': 4, 'V': 4, 'W': 4, 'Y': 4, 'K': 5, 'J': 8, 'X': 8,\n 'Q': 10, 'Z': 10 }...
import matplotlib.pyplot as plt import fib1,fib2,fib3,fib4,fib5 from monitor import monitorFib def showFigure(module,n): x = [] y = [] print "?????" for i in range(n): print i x.append(i) y.append(monitorFib(module,i)) plt.plot(x,y) print x print y plt.show() i...
[ [ 1, 0, 0.1, 0.05, 0, 0.66, 0, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 1, 0, 0.15, 0.05, 0, 0.66, 0.25, 843, 0, 5, 0, 0, 843, 0, 0 ], [ 1, 0, 0.2, 0.05, 0, 0.66, 0.5, ...
[ "import matplotlib.pyplot as plt", "import fib1,fib2,fib3,fib4,fib5", "from monitor import monitorFib", "def showFigure(module,n):\n x = []\n y = []\n print(\"?????\")\n for i in range(n):\n print(i)\n x.append(i)\n y.append(monitorFib(module,i))", " x = []", " y = [...
#!/usr/bin/python # -*- coding: utf8 -*- from math import sqrt # 存储运算中需要用到的两个常量 a = (1+sqrt(5))/2.0 b = (1-sqrt(5))/2.0 def fib(n): """ Standard Formula """ # 特殊情况:n为0或1 if(n == 0): return 0 elif(n == 1): return 1 else: index = 2 c = a d = b # 根据公式计...
[ [ 1, 0, 0.16, 0.04, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.28, 0.04, 0, 0.66, 0.3333, 475, 4, 0, 0, 0, 0, 0, 1 ], [ 14, 0, 0.32, 0.04, 0, 0.66, 0....
[ "from math import sqrt", "a = (1+sqrt(5))/2.0", "b = (1-sqrt(5))/2.0", "def fib(n):\n \"\"\" Standard Formula \"\"\"\n # 特殊情况:n为0或1\n if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:", " \"\"\" Standard Formula \"\"\"", " if(n == 0):\n return 0\n elif(...
#!/usr/bin/python # -*- coding: utf8 -*- def square(m): """ 求矩阵m的平方 """ r2 = m[2]*m[2]+m[1]*m[1] r1 = m[2]*m[1]+m[1]*m[0] r0 = m[1]*m[1]+m[0]*m[0] m[2] = r2 m[1] = r1 m[0] = r0 def recur(matrix,n): # 递归结束条件 if n == 1: return matrix else: recur(matrix,n/2) # Di...
[ [ 2, 0, 0.1875, 0.2, 0, 0.66, 0, 342, 0, 1, 0, 0, 0, 0, 0 ], [ 8, 1, 0.125, 0.025, 1, 0.93, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 1, 0.15, 0.025, 1, 0.93, 0.1667, ...
[ "def square(m):\n \"\"\" 求矩阵m的平方 \"\"\"\n r2 = m[2]*m[2]+m[1]*m[1]\n r1 = m[2]*m[1]+m[1]*m[0]\n r0 = m[1]*m[1]+m[0]*m[0]\n m[2] = r2\n m[1] = r1\n m[0] = r0", " \"\"\" 求矩阵m的平方 \"\"\"", " r2 = m[2]*m[2]+m[1]*m[1]", " r1 = m[2]*m[1]+m[1]*m[0]", " r0 = m[1]*m[1]+m[0]*m[0]", "...
#!/usr/bin/python # -*- coding: utf8 -*- from math import sqrt # 存储运算中需要用到的两个常量 a = (1+sqrt(5))/2.0 b = (1-sqrt(5))/2.0 def fib(n): """ Standard Formula """ # 特殊情况:n为0或1 if(n == 0): return 0 elif(n == 1): return 1 else: index = 2 c = a d = b # 根据公式计...
[ [ 1, 0, 0.16, 0.04, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.28, 0.04, 0, 0.66, 0.3333, 475, 4, 0, 0, 0, 0, 0, 1 ], [ 14, 0, 0.32, 0.04, 0, 0.66, 0....
[ "from math import sqrt", "a = (1+sqrt(5))/2.0", "b = (1-sqrt(5))/2.0", "def fib(n):\n \"\"\" Standard Formula \"\"\"\n # 特殊情况:n为0或1\n if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:", " \"\"\" Standard Formula \"\"\"", " if(n == 0):\n return 0\n elif(...
#!/usr/bin/python # -*- coding: utf8 -*- from math import sqrt a = (1+sqrt(5))/2 def recur(n): # 递归结束条件 if(n == 0): return 1 elif(n == 1): return a else: b = recur(n/2) #递归调用,Divide and Conquer # Combine b = b * b if(n % 2 == 1): #处理n为奇数的情况 ...
[ [ 1, 0, 0.1379, 0.0345, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.2069, 0.0345, 0, 0.66, 0.3333, 475, 4, 0, 0, 0, 0, 0, 1 ], [ 2, 0, 0.4828, 0.4483, 0, 0...
[ "from math import sqrt", "a = (1+sqrt(5))/2", "def recur(n):\n # 递归结束条件\n if(n == 0):\n return 1\n elif(n == 1):\n return a\n else:\n b = recur(n/2) #递归调用,Divide and Conquer", " if(n == 0):\n return 1\n elif(n == 1):\n return a\n else:\n b = recu...
#!/usr/bin/python # -*- coding: utf8 -*- def square(m): """ 求矩阵m的平方 """ r2 = m[2]*m[2]+m[1]*m[1] r1 = m[2]*m[1]+m[1]*m[0] r0 = m[1]*m[1]+m[0]*m[0] m[2] = r2 m[1] = r1 m[0] = r0 def recur(matrix,n): # 递归结束条件 if n == 1: return matrix else: recur(matrix,n/2) # Di...
[ [ 2, 0, 0.1875, 0.2, 0, 0.66, 0, 342, 0, 1, 0, 0, 0, 0, 0 ], [ 8, 1, 0.125, 0.025, 1, 0.06, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 1, 0.15, 0.025, 1, 0.06, 0.1667, ...
[ "def square(m):\n \"\"\" 求矩阵m的平方 \"\"\"\n r2 = m[2]*m[2]+m[1]*m[1]\n r1 = m[2]*m[1]+m[1]*m[0]\n r0 = m[1]*m[1]+m[0]*m[0]\n m[2] = r2\n m[1] = r1\n m[0] = r0", " \"\"\" 求矩阵m的平方 \"\"\"", " r2 = m[2]*m[2]+m[1]*m[1]", " r1 = m[2]*m[1]+m[1]*m[0]", " r0 = m[1]*m[1]+m[0]*m[0]", "...
#!/usr/bin/python # -*- coding: utf8 -*- def fib(n): """ Recursion """ # 递归结束条件: n为0或1 if(n == 0): return 0 elif(n == 1): return 1 else: return fib(n-1)+fib(n-2) # 递归调用
[ [ 2, 0, 0.6667, 0.75, 0, 0.66, 0, 604, 0, 1, 1, 0, 0, 0, 2 ], [ 8, 1, 0.4167, 0.0833, 1, 0.02, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 4, 1, 0.7917, 0.5, 1, 0.02, 1, ...
[ "def fib(n):\n \"\"\" Recursion \"\"\"\n # 递归结束条件: n为0或1\n if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:", " \"\"\" Recursion \"\"\"", " if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:\n return fib(n-1)+fib(n-2) # 递归调用", " ...
#!/usr/bin/python # -*- coding: utf8 -*- def fib(n): """ Bottom-up """ # 特殊情况: n为0或1 if(n == 0): return 0 elif(n == 1): return 1 else: # 用f(0)表示F(n-2),f1表示F(n-1),f2表示F(n) f0 = 0 f1 = 1 f2 = f0+f1 index = 2 while(index < n): ...
[ [ 2, 0, 0.5625, 0.8333, 0, 0.66, 0, 604, 0, 1, 1, 0, 0, 0, 0 ], [ 8, 1, 0.2083, 0.0417, 1, 0.08, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 4, 1, 0.625, 0.7083, 1, 0.08, 1,...
[ "def fib(n):\n \"\"\" Bottom-up \"\"\"\n # 特殊情况: n为0或1\n if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:", " \"\"\" Bottom-up \"\"\"", " if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:\n # 用f(0)表示F(n-2),f1表示F(n-1),f2表示F(n)\n ...
#!/usr/bin/python # -*- coding: utf8 -*- import sys from time import time import fib1,fib2,fib3,fib4,fib5 def monitorFib(module,n): start = time() result = module.fib(n) elapsed = time()-start print "%s took %0.3f ms :%d (%s)" % (module.__name__,elapsed*1000.0,result,module.fib.__doc__) return ela...
[ [ 1, 0, 0.1481, 0.037, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.66, 0.25, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.2222, 0.037, 0, 0.66,...
[ "import sys", "from time import time", "import fib1,fib2,fib3,fib4,fib5", "def monitorFib(module,n):\n start = time()\n result = module.fib(n)\n elapsed = time()-start\n print(\"%s took %0.3f ms :%d (%s)\" % (module.__name__,elapsed*1000.0,result,module.fib.__doc__))\n return elapsed", " s...
#!/usr/bin/python # -*- coding: utf8 -*- import sys from time import time import fib1,fib2,fib3,fib4,fib5 def monitorFib(module,n): start = time() result = module.fib(n) elapsed = time()-start print "%s took %0.3f ms :%d (%s)" % (module.__name__,elapsed*1000.0,result,module.fib.__doc__) return ela...
[ [ 1, 0, 0.1481, 0.037, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1852, 0.037, 0, 0.66, 0.25, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.2222, 0.037, 0, 0.66,...
[ "import sys", "from time import time", "import fib1,fib2,fib3,fib4,fib5", "def monitorFib(module,n):\n start = time()\n result = module.fib(n)\n elapsed = time()-start\n print(\"%s took %0.3f ms :%d (%s)\" % (module.__name__,elapsed*1000.0,result,module.fib.__doc__))\n return elapsed", " s...
#!/usr/bin/python # -*- coding: utf8 -*- def fib(n): """ Bottom-up """ # 特殊情况: n为0或1 if(n == 0): return 0 elif(n == 1): return 1 else: # 用f(0)表示F(n-2),f1表示F(n-1),f2表示F(n) f0 = 0 f1 = 1 f2 = f0+f1 index = 2 while(index < n): ...
[ [ 2, 0, 0.5625, 0.8333, 0, 0.66, 0, 604, 0, 1, 1, 0, 0, 0, 0 ], [ 8, 1, 0.2083, 0.0417, 1, 0.53, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 4, 1, 0.625, 0.7083, 1, 0.53, 1,...
[ "def fib(n):\n \"\"\" Bottom-up \"\"\"\n # 特殊情况: n为0或1\n if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:", " \"\"\" Bottom-up \"\"\"", " if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:\n # 用f(0)表示F(n-2),f1表示F(n-1),f2表示F(n)\n ...
#!/usr/bin/python # -*- coding: utf8 -*- from math import sqrt a = (1+sqrt(5))/2 def recur(n): # 递归结束条件 if(n == 0): return 1 elif(n == 1): return a else: b = recur(n/2) #递归调用,Divide and Conquer # Combine b = b * b if(n % 2 == 1): #处理n为奇数的情况 ...
[ [ 1, 0, 0.1379, 0.0345, 0, 0.66, 0, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.2069, 0.0345, 0, 0.66, 0.3333, 475, 4, 0, 0, 0, 0, 0, 1 ], [ 2, 0, 0.4828, 0.4483, 0, 0...
[ "from math import sqrt", "a = (1+sqrt(5))/2", "def recur(n):\n # 递归结束条件\n if(n == 0):\n return 1\n elif(n == 1):\n return a\n else:\n b = recur(n/2) #递归调用,Divide and Conquer", " if(n == 0):\n return 1\n elif(n == 1):\n return a\n else:\n b = recu...
#!/usr/bin/python # -*- coding: utf8 -*- def fib(n): """ Recursion """ # 递归结束条件: n为0或1 if(n == 0): return 0 elif(n == 1): return 1 else: return fib(n-1)+fib(n-2) # 递归调用
[ [ 2, 0, 0.6667, 0.75, 0, 0.66, 0, 604, 0, 1, 1, 0, 0, 0, 2 ], [ 8, 1, 0.4167, 0.0833, 1, 0.7, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 4, 1, 0.7917, 0.5, 1, 0.7, 1, 0...
[ "def fib(n):\n \"\"\" Recursion \"\"\"\n # 递归结束条件: n为0或1\n if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:", " \"\"\" Recursion \"\"\"", " if(n == 0):\n return 0\n elif(n == 1):\n return 1\n else:\n return fib(n-1)+fib(n-2) # 递归调用", " ...
#!/usr/bin/env python2 import random import math n = 1 count = 100 rate = 20 for V in range(5, count): filename = "test-" + str(n) + ".txt" n = n + 1 fle = open(filename, "w+") print "Generating test: " + filename + "..." nodos = V + 1 fabricas = int(math.ceil(rate * nodos / 100)) clientes = nodos -...
[ [ 1, 0, 0.0968, 0.0323, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.129, 0.0323, 0, 0.66, 0.2, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.1935, 0.0323, 0, 0.6...
[ "import random", "import math", "n = 1", "count = 100", "rate = 20", "for V in range(5, count):\n\t\n\tfilename = \"test-\" + str(n) + \".txt\"\n\t\n\tn = n + 1\n\t\n\tfle = open(filename, \"w+\")", "\tfilename = \"test-\" + str(n) + \".txt\"", "\tn = n + 1", "\tfle = open(filename, \"w+\")", "\tp...
#!/usr/bin/env python2 import random import math n = 1 count = 100 rate = 20 for V in range(5, count): filename = "test-" + str(n) + ".txt" n = n + 1 fle = open(filename, "w+") print "Generating test: " + filename + "..." nodos = V + 1 fabricas = int(math.ceil(rate * nodos / 100)) clientes = nodos -...
[ [ 1, 0, 0.0968, 0.0323, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 1, 0, 0.129, 0.0323, 0, 0.66, 0.2, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 14, 0, 0.1935, 0.0323, 0, 0.6...
[ "import random", "import math", "n = 1", "count = 100", "rate = 20", "for V in range(5, count):\n\t\n\tfilename = \"test-\" + str(n) + \".txt\"\n\t\n\tn = n + 1\n\t\n\tfle = open(filename, \"w+\")", "\tfilename = \"test-\" + str(n) + \".txt\"", "\tn = n + 1", "\tfle = open(filename, \"w+\")", "\tp...
#!/usr/bin/env python2 import subprocess, time, os, sys def instanceFromFile(path): f = open(path) text = "" for line in f: text += line return text def launch(input): command = ["./problema3-test"] subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) st...
[ [ 1, 0, 0.0952, 0.0238, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 2, 0, 0.2024, 0.1429, 0, 0.66, 0.1429, 709, 0, 1, 1, 0, 0, 0, 1 ], [ 14, 1, 0.1667, 0.0238, 1, 0...
[ "import subprocess, time, os, sys", "def instanceFromFile(path):\n\tf = open(path)\n\ttext = \"\"\n\tfor line in f:\n\t\ttext += line\n\treturn text", "\tf = open(path)", "\ttext = \"\"", "\tfor line in f:\n\t\ttext += line", "\treturn text", "def launch(input):\n\tcommand = [\"./problema3-test\"]\n\tsu...
#!/usr/bin/env python2 import subprocess, time, os, sys def instanceFromFile(path): f = open(path) text = "" for line in f: text += line return text def launch(input): command = ["./problema3-test"] subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) st...
[ [ 1, 0, 0.0952, 0.0238, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 2, 0, 0.2024, 0.1429, 0, 0.66, 0.1429, 709, 0, 1, 1, 0, 0, 0, 1 ], [ 14, 1, 0.1667, 0.0238, 1, 0...
[ "import subprocess, time, os, sys", "def instanceFromFile(path):\n\tf = open(path)\n\ttext = \"\"\n\tfor line in f:\n\t\ttext += line\n\treturn text", "\tf = open(path)", "\ttext = \"\"", "\tfor line in f:\n\t\ttext += line", "\treturn text", "def launch(input):\n\tcommand = [\"./problema3-test\"]\n\tsu...
#!/usr/bin/env python2 import subprocess, time, os, sys def instanceFromFile(path): f = open(path) text = "" for line in f: text += line return text def launch(input): command = ["./problema2-test"] subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) st...
[ [ 1, 0, 0.0952, 0.0238, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 2, 0, 0.2024, 0.1429, 0, 0.66, 0.1429, 709, 0, 1, 1, 0, 0, 0, 1 ], [ 14, 1, 0.1667, 0.0238, 1, 0...
[ "import subprocess, time, os, sys", "def instanceFromFile(path):\n\tf = open(path)\n\ttext = \"\"\n\tfor line in f:\n\t\ttext += line\n\treturn text", "\tf = open(path)", "\ttext = \"\"", "\tfor line in f:\n\t\ttext += line", "\treturn text", "def launch(input):\n\tcommand = [\"./problema2-test\"]\n\tsu...
#!/usr/bin/env python2 import random #~ i = 1 #~ #~ for nodos in range(100): #~ name = "test-" + str(i) + ".txt" #~ i = i + 1 #~ f = open(name, "w+") #~ #~ print "Generating " + name + "..." #~ #~ f.write(str(nodos+1) + " " + str(nodos) + "\n") #~ #~ for j in range(nodos): #~ f.write(str(j+1) + " " + str(...
[ [ 1, 0, 0.0698, 0.0233, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.4884, 0.0233, 0, 0.66, 0.3333, 773, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.5116, 0.0233, 0, ...
[ "import random", "n = 1", "count = 100", "for V in range(count):\n\t\n\tfilename = \"test-\" + str(n) + \".txt\"\n\t\n\tn = n + 1\n\t\n\tfle = open(filename, \"w+\")", "\tfilename = \"test-\" + str(n) + \".txt\"", "\tn = n + 1", "\tfle = open(filename, \"w+\")", "\tprint(\"Generating test: \" + filena...
#!/usr/bin/env python2 import subprocess, time, os, sys def instanceFromFile(path): f = open(path) text = "" for line in f: text += line return text def launch(input): command = ["./problema2-test"] subp = subprocess.Popen(command, stdout=subprocess.PIPE, stdin=subprocess.PIPE, stderr=subprocess.STDOUT) st...
[ [ 1, 0, 0.0952, 0.0238, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 2, 0, 0.2024, 0.1429, 0, 0.66, 0.1429, 709, 0, 1, 1, 0, 0, 0, 1 ], [ 14, 1, 0.1667, 0.0238, 1, 0...
[ "import subprocess, time, os, sys", "def instanceFromFile(path):\n\tf = open(path)\n\ttext = \"\"\n\tfor line in f:\n\t\ttext += line\n\treturn text", "\tf = open(path)", "\ttext = \"\"", "\tfor line in f:\n\t\ttext += line", "\treturn text", "def launch(input):\n\tcommand = [\"./problema2-test\"]\n\tsu...
#!/usr/bin/env python2 import random #~ i = 1 #~ #~ for nodos in range(100): #~ name = "test-" + str(i) + ".txt" #~ i = i + 1 #~ f = open(name, "w+") #~ #~ print "Generating " + name + "..." #~ #~ f.write(str(nodos+1) + " " + str(nodos) + "\n") #~ #~ for j in range(nodos): #~ f.write(str(j+1) + " " + str(...
[ [ 1, 0, 0.0698, 0.0233, 0, 0.66, 0, 715, 0, 1, 0, 0, 715, 0, 0 ], [ 14, 0, 0.4884, 0.0233, 0, 0.66, 0.3333, 773, 1, 0, 0, 0, 0, 1, 0 ], [ 14, 0, 0.5116, 0.0233, 0, ...
[ "import random", "n = 1", "count = 100", "for V in range(count):\n\t\n\tfilename = \"test-\" + str(n) + \".txt\"\n\t\n\tn = n + 1\n\t\n\tfle = open(filename, \"w+\")", "\tfilename = \"test-\" + str(n) + \".txt\"", "\tn = n + 1", "\tfle = open(filename, \"w+\")", "\tprint(\"Generating test: \" + filena...
import re import config import common import random import array # Step 1: Choose a starting point of MarkovOrder (2 or 3) notes. # Choose from list of states that have a non-empty successor list. # Step 2: Find a note randomly(?) from the list of successors. # There's scope for improvement(?) here - we can choose to...
[ [ 1, 0, 0.0132, 0.0132, 0, 0.66, 0, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.0263, 0.0132, 0, 0.66, 0.0769, 308, 0, 1, 0, 0, 308, 0, 0 ], [ 1, 0, 0.0395, 0.0132, 0, ...
[ "import re", "import config", "import common", "import random", "import array", "SuccessorList = {};", "NumVerses = 12; # Num of verses in the composition. 1 Verse = 1 cycle of tala", "def ReadAnalytics():\n\tf = open(config.OutFile,'r');\n\tfor line in f:\n\t\ttemp = re.split('\\s+',line);\n\t\tdef c...
RagaDef = {}; RagaDef['Mohana'] = ['Sa','Re','Ga','Pa','Da']; RagaDef['SriRanjani'] = ['Sa','Re','Ga','Ma','Da','Ni'];
[ [ 14, 0, 0.4, 0.2, 0, 0.66, 0, 689, 0, 0, 0, 0, 0, 6, 0 ], [ 14, 0, 0.8, 0.2, 0, 0.66, 0.5, 0, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 1, 0.2, 0, 0.66, 1, 0, 0,...
[ "RagaDef = {};", "RagaDef['Mohana'] = ['Sa','Re','Ga','Pa','Da'];", "RagaDef['SriRanjani'] = ['Sa','Re','Ga','Ma','Da','Ni'];" ]
Path='../corpus/Mohana' Raga='Mohana' Tala='Adi' Instrument='Piano' MarkovOrder=3; OutFile='Analytics.txt'
[ [ 14, 0, 0.1667, 0.1667, 0, 0.66, 0, 754, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.3333, 0.1667, 0, 0.66, 0.2, 99, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.5, 0.1667, 0, 0.66, ...
[ "Path='../corpus/Mohana'", "Raga='Mohana'", "Tala='Adi'", "Instrument='Piano'", "MarkovOrder=3;", "OutFile='Analytics.txt'" ]
#Archivo: Modulo Serial #Version:1 #Autores: Yimy Juarez, Manuel Arana, Irrael Eduardo #Descripcion: Este programa es un modulo que permite enviar los #datos al puerto serial, mediante el parametro ingresado. #Modificacion: 22 de Mayo de 2011 #----------------Se importan los modulos import time import serial d...
[ [ 1, 0, 0.4, 0.05, 0, 0.66, 0, 654, 0, 1, 0, 0, 654, 0, 0 ], [ 1, 0, 0.45, 0.05, 0, 0.66, 0.5, 601, 0, 1, 0, 0, 601, 0, 0 ], [ 2, 0, 0.725, 0.5, 0, 0.66, 1, ...
[ "import time", "import serial", "def envio(dato):\n dato=str(dato)#Se convierte el dato a str\n dato=dato[::-1]#Se da vuelta al dato recibido\n aux1=list(dato)#Se convierte en una lista el dato\n ser = serial.Serial(0)#Se abre el puerto serial numero 0\n for contador in aux1:#Bucle encargado del ...
#!/usr/bin/env python2 import subprocess, time, os, sys, random def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def toDot(path): f = open(path) input = [] for line in f: input.append(line.strip()) input = input[1:] dotFile = "" dotFile += "Gr...
[ [ 1, 0, 0.0316, 0.0105, 0, 0.66, 0, 394, 0, 5, 0, 0, 394, 0, 0 ], [ 2, 0, 0.0789, 0.0632, 0, 0.66, 0.0769, 709, 0, 1, 1, 0, 0, 0, 2 ], [ 14, 1, 0.0632, 0.0105, 1, 0...
[ "import subprocess, time, os, sys, random", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()", "def toDot(path):\n\tf = open(p...
#!/usr/bin/env python2 import subprocess, time, os, sys, random def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def toDot(path): f = open(path) input = [] for line in f: input.append(line.strip()) input = input[1:] dotFile = "" dotFile += "Gr...
[ [ 1, 0, 0.0316, 0.0105, 0, 0.66, 0, 394, 0, 5, 0, 0, 394, 0, 0 ], [ 2, 0, 0.0789, 0.0632, 0, 0.66, 0.0769, 709, 0, 1, 1, 0, 0, 0, 2 ], [ 14, 1, 0.0632, 0.0105, 1, 0...
[ "import subprocess, time, os, sys, random", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()", "def toDot(path):\n\tf = open(p...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import subprocess, time, os, sys cmf = "./cmf" iterations = 1000 def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def getTestFiles(folder, ext): testFiles = [] for root, dirs, files in os.walk(folder): fo...
[ [ 1, 0, 0.0494, 0.0123, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 14, 0, 0.0741, 0.0123, 0, 0.66, 0.1, 517, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0864, 0.0123, 0, 0.6...
[ "import subprocess, time, os, sys", "cmf = \"./cmf\"", "iterations = 1000", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import subprocess, time, os, sys cmf = "./cmf" iterations = 1000 def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def getTestFiles(folder, ext): testFiles = [] for root, dirs, files in os.walk(folder): fo...
[ [ 1, 0, 0.0494, 0.0123, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 14, 0, 0.0741, 0.0123, 0, 0.66, 0.1, 517, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0864, 0.0123, 0, 0.6...
[ "import subprocess, time, os, sys", "cmf = \"./cmf\"", "iterations = 1000", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import subprocess, time, os, sys cmf = "./cmf" iterations = 50 def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def getTestFiles(folder, ext): testFiles = [] for root, dirs, files in os.walk(folder): for ...
[ [ 1, 0, 0.0494, 0.0123, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 14, 0, 0.0741, 0.0123, 0, 0.66, 0.1, 517, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0864, 0.0123, 0, 0.6...
[ "import subprocess, time, os, sys", "cmf = \"./cmf\"", "iterations = 50", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()",...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import subprocess, time, os, sys cmf = "./cmf" iterations = 50 def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def getTestFiles(folder, ext): testFiles = [] for root, dirs, files in os.walk(folder): for ...
[ [ 1, 0, 0.0494, 0.0123, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 14, 0, 0.0741, 0.0123, 0, 0.66, 0.1, 517, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0864, 0.0123, 0, 0.6...
[ "import subprocess, time, os, sys", "cmf = \"./cmf\"", "iterations = 50", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()",...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import subprocess, time, os, sys cmf = "./cmf" iterations = 1000 def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def getTestFiles(folder, ext): testFiles = [] for root, dirs, files in os.walk(folder): fo...
[ [ 1, 0, 0.0494, 0.0123, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 14, 0, 0.0741, 0.0123, 0, 0.66, 0.1, 517, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0864, 0.0123, 0, 0.6...
[ "import subprocess, time, os, sys", "cmf = \"./cmf\"", "iterations = 1000", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()...
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import subprocess, time, os, sys cmf = "./cmf" iterations = 1000 def instanceFromFile(path): f = open(path) input = "" for line in f: input += line return input.strip() def getTestFiles(folder, ext): testFiles = [] for root, dirs, files in os.walk(folder): fo...
[ [ 1, 0, 0.0494, 0.0123, 0, 0.66, 0, 394, 0, 4, 0, 0, 394, 0, 0 ], [ 14, 0, 0.0741, 0.0123, 0, 0.66, 0.1, 517, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0864, 0.0123, 0, 0.6...
[ "import subprocess, time, os, sys", "cmf = \"./cmf\"", "iterations = 1000", "def instanceFromFile(path):\n\tf = open(path)\n\tinput = \"\"\n\tfor line in f:\n\t\tinput += line\n\treturn input.strip()", "\tf = open(path)", "\tinput = \"\"", "\tfor line in f:\n\t\tinput += line", "\treturn input.strip()...
__all__=["bubblesort","insertionsort"]
[ [ 14, 0, 1, 1, 0, 0.66, 0, 272, 0, 0, 0, 0, 0, 5, 0 ] ]
[ "__all__=[\"bubblesort\",\"insertionsort\"]" ]
#!/usr/bin/python """ Heapsort implementation """ def siftup(x, n): i = n c = x[i] #x[i] == c while True: p = i / 2 if x[p] >= c: break x[i] = x[p] i = p x[i] = c def siftdown(x, n): if n <= 1: return i = 1 c = x[i] while True: p =...
[ [ 8, 0, 0.04, 0.03, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.12, 0.11, 0, 0.66, 0.2, 356, 0, 2, 0, 0, 0, 0, 0 ], [ 14, 1, 0.08, 0.01, 1, 0.87, 0, 826...
[ "\"\"\"\nHeapsort implementation\n\"\"\"", "def siftup(x, n):\n i = n\n c = x[i] #x[i] == c\n while True:\n p = i / 2\n if x[p] >= c:\n break\n x[i] = x[p]", " i = n", " c = x[i] #x[i] == c", " while True:\n p = i / 2\n if x[p] >= c:\n ...
#!/usr/bin/python """ Binary Tree implementation and visualization """ import os import sys pygraphvizOk = True try: import pygraphviz except ImportError: pygraphvizOk = False __metaclass__ = type class BinTree: def __init__(self, value = 0, parent = None, label='', left=None, right=None): ...
[ [ 8, 0, 0.0087, 0.0065, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0152, 0.0022, 0, 0.66, 0.0667, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0174, 0.0022, 0, 0.66...
[ "\"\"\"\nBinary Tree implementation and visualization\n\"\"\"", "import os", "import sys", "pygraphvizOk = True", "try:\n import pygraphviz\nexcept ImportError:\n pygraphvizOk = False", " import pygraphviz", " pygraphvizOk = False", "__metaclass__ = type", "class BinTree:\n def __...
#!/usr/bin/python import sys import os, commands """ Run program from source code directly. Support C, C++, Java, etc """ if len(sys.argv) < 2: print 'Usage: %s sourcefile' % os.path.basename(sys.argv[0]) sourcename = sys.argv[1] handler = None if len(sourcename.split('.')) > 1: suffix = sourcename.split(...
[ [ 1, 0, 0.0441, 0.0147, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0588, 0.0147, 0, 0.66, 0.1, 688, 0, 2, 0, 0, 688, 0, 0 ], [ 8, 0, 0.1029, 0.0441, 0, 0.6...
[ "import sys", "import os, commands", "\"\"\"\nRun program from source code directly. Support C, C++, Java, etc\n\"\"\"", "if len(sys.argv) < 2:\n print('Usage: %s sourcefile' % os.path.basename(sys.argv[0]))", " print('Usage: %s sourcefile' % os.path.basename(sys.argv[0]))", "sourcename = sys.argv[1...
#!/usr/bin/python """ for the non-integral part of fraction a/b, found the n-th occurence of digit m, where 0 <= m <= 9 2013 Yahoo competition question 1 """ def getNthPosViolent(a, b, m, n): import decimal precision = 2000 decimal.getcontext().prec = precision a %= b q = decimal.Decimal(a)/decim...
[ [ 8, 0, 0.0421, 0.0374, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 2, 0, 0.1869, 0.215, 0, 0.66, 0.2, 865, 0, 4, 0, 0, 0, 0, 8 ], [ 1, 1, 0.0935, 0.0093, 1, 0.98, ...
[ "\"\"\"\nfor the non-integral part of fraction a/b, found the n-th occurence of digit m, where 0 <= m <= 9\n2013 Yahoo competition question 1\n\"\"\"", "def getNthPosViolent(a, b, m, n):\n import decimal\n precision = 2000\n decimal.getcontext().prec = precision\n a %= b\n q = decimal.Decimal(a)/de...
# -*- coding: utf-8 -*- import partie_1_diff as tn import numpy as np # Question 1 : def elastic_force(k, xo = 0, yo = 0): "define a k-elastic force" return lambda x, y: np.array([[-k*x], [-k*y]]) def centrifugal_force(k, xo, yo): "define a k-elastic force" return lambda x, y: np.array([[k*(x-xo)], ...
[ [ 1, 0, 0.0441, 0.0147, 0, 0.66, 0, 570, 0, 1, 0, 0, 570, 0, 0 ], [ 1, 0, 0.0588, 0.0147, 0, 0.66, 0.0435, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 2, 0, 0.1324, 0.0441, 0, ...
[ "import partie_1_diff as tn", "import numpy as np", "def elastic_force(k, xo = 0, yo = 0):\n \"define a k-elastic force\"\n return lambda x, y: np.array([[-k*x], [-k*y]])", " \"define a k-elastic force\"", " return lambda x, y: np.array([[-k*x], [-k*y]])", "def centrifugal_force(k, xo, yo):\n ...
# -*- coding:utf-8 -*- # Entry : (f::function, J::jacobian of f, U0::initial value, N::maximum of iteration, epsilon::accuracy) # Return : U::position vector import numpy as np import matplotlib.pyplot as plt # precision de la derivee : derivate_accuracy = pow(10, -15) def methode_de_Newton (f, Uo, N, epsilon, sho...
[ [ 1, 0, 0.0612, 0.0102, 0, 0.66, 0, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 1, 0, 0.0714, 0.0102, 0, 0.66, 0.1667, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 14, 0, 0.102, 0.0102, 0, ...
[ "import numpy as np", "import matplotlib.pyplot as plt", "derivate_accuracy = pow(10, -15)", "def methode_de_Newton (f, Uo, N, epsilon, show = 0):\n \"applies Newton methode to the arguments in parameter\"\n plt.clf()\n cpt = 0\n U = Uo\n n = len(f(Uo))\n m = len(Uo)\n v = []", " \"a...
import numpy as np import matplotlib.pyplot as plt def Newton_Raphson (f, fJ, Uo, N, epsilon, show = 0, name="figure", E = None): "applies Newton methode to the function f and its jacobian matrix J beginning from the vector Uo, looping at max at N and with an accuracy of epsilon" if(E == None): E = la...
[ [ 1, 0, 0.0103, 0.0103, 0, 0.66, 0, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 1, 0, 0.0206, 0.0103, 0, 0.66, 0.3333, 596, 0, 1, 0, 0, 596, 0, 0 ], [ 2, 0, 0.3299, 0.567, 0, 0...
[ "import numpy as np", "import matplotlib.pyplot as plt", "def Newton_Raphson (f, fJ, Uo, N, epsilon, show = 0, name=\"figure\", E = None):\n \"applies Newton methode to the function f and its jacobian matrix J beginning from the vector Uo, looping at max at N and with an accuracy of epsilon\"\n if(E == No...
##SECTION 4: ELECTROSTATIC EQUILIBRIUM ## # -*- coding: utf-8 -*- import numpy as np import partie_1 as nr from numpy import polynomial as P import matplotlib.pyplot as plt def ElecEnergy(X): "Calcule l'énergie totale du système " n=X.shape[0] r =0. for i in range(n): cpt =0. for j i...
[ [ 1, 0, 0.043, 0.0108, 0, 0.66, 0, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 1, 0, 0.0538, 0.0108, 0, 0.66, 0.0476, 210, 0, 1, 0, 0, 210, 0, 0 ], [ 1, 0, 0.0645, 0.0108, 0, 0...
[ "import numpy as np", "import partie_1 as nr", "from numpy import polynomial as P", "import matplotlib.pyplot as plt", "def ElecEnergy(X):\n \"Calcule l'énergie totale du système \"\n n=X.shape[0]\n r =0.\n for i in range(n):\n cpt =0.\n for j in range(n):\n if (i!=j):",...
# -*- coding: utf-8 -*- import partie_1 as tn import numpy as np # Question 1 : def elastic_force(k, xo = 0, yo = 0): "defines a k-elastic force" return lambda x, y: np.array([[-k*x], [-k*y]]) def centrifugal_force(k, xo, yo): "defines a k-elastic force" return lambda x, y: np.array([[k*(x-xo)], ...
[ [ 1, 0, 0.0217, 0.0109, 0, 0.66, 0, 210, 0, 1, 0, 0, 210, 0, 0 ], [ 1, 0, 0.0326, 0.0109, 0, 0.66, 0.0345, 954, 0, 1, 0, 0, 954, 0, 0 ], [ 2, 0, 0.0761, 0.0326, 0, ...
[ "import partie_1 as tn", "import numpy as np", "def elastic_force(k, xo = 0, yo = 0):\n \"defines a k-elastic force\"\n return lambda x, y: np.array([[-k*x], [-k*y]])", " \"defines a k-elastic force\"", " return lambda x, y: np.array([[-k*x], [-k*y]])", "def centrifugal_force(k, xo, yo):\n ...
# -*- coding: utf-8 -*- vowels = 'aAiIuUfFxXeEoOMH' consonants = 'kKgGNcCjJYwWqQRtTdDnpPbBmyrlvSzsh' other = ". |-\r\n\t" virama = u'\u094d' map_vowels = {'a':u'\u0905', 'A':u'\u0906', 'i':u'\u0907', 'I':u'\u0908', 'u':u'\u0909', \ 'U':u'\u090a', 'f':u'\u090b', 'F':u'\u0960', 'x':u'\u090c', 'X':...
[ [ 14, 0, 0.0469, 0.0156, 0, 0.66, 0, 841, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0625, 0.0156, 0, 0.66, 0.1, 416, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0781, 0.0156, 0, 0.66...
[ "vowels = 'aAiIuUfFxXeEoOMH'", "consonants = 'kKgGNcCjJYwWqQRtTdDnpPbBmyrlvSzsh'", "other = \". |-\\r\\n\\t\"", "virama = u'\\u094d'", "map_vowels = {'a':u'\\u0905', 'A':u'\\u0906', 'i':u'\\u0907', 'I':u'\\u0908', 'u':u'\\u0909', \\\n 'U':u'\\u090a', 'f':u'\\u090b', 'F':u'\\u0960', 'x':u'\\u090...
#!/usr/bin/env python # -*- coding: utf-8 -*- # Devanagari Editor import pygtk, pango pygtk.require('2.0') import gtk from decoders import devanagari help_string = ''' अ आ इ ई उ ऊ ऋ ॠ ऌ ॡ ए ऐ ओ औ अं अः a A i I u U R RR lR lRR e ai o au M H क ख ग घ ङ | य र ल व k kh g gh G | y r l v च छ ज झ ञ | श ष स ह c ch j jh J | ...
[ [ 1, 0, 0.039, 0.0065, 0, 0.66, 0, 106, 0, 2, 0, 0, 106, 0, 0 ], [ 8, 0, 0.0455, 0.0065, 0, 0.66, 0.1429, 66, 3, 1, 0, 0, 0, 0, 1 ], [ 1, 0, 0.0519, 0.0065, 0, 0.66...
[ "import pygtk, pango", "pygtk.require('2.0')", "import gtk", "from decoders import devanagari", "help_string = '''\nअ\tआ\tइ\tई\tउ\tऊ\tऋ\tॠ\tऌ\tॡ\tए\tऐ\tओ\tऔ\tअं\tअः\na\tA\ti\tI\tu\tU\tR\tRR\tlR\tlRR\te\tai\to\tau\tM\tH\n\nक\tख\tग\tघ\tङ\t|\tय\tर\tल\tव\nk\tkh\tg\tgh\tG\t|\ty\tr\tl\tv\nच\tछ\tज\tझ\tञ\t|\tश\tष\t...
# -*- coding: utf-8 -*- # Devanagari Editor import pygtk, pango pygtk.require('2.0') import gtk from decoders import devanagari Vowels = 'aAiIuUReoMH' Consonants = 'kgGcjJTDNtdnpbmyrlvzSsh' Numbers = '0123456789' other = ". |-\r\n\t" virama = u'\u094d' map_vowels = {'a':u'\u0905', 'A':u'\u0906', 'i':...
[ [ 1, 0, 0.0161, 0.0032, 0, 0.66, 0, 106, 0, 2, 0, 0, 106, 0, 0 ], [ 8, 0, 0.0193, 0.0032, 0, 0.66, 0.05, 66, 3, 1, 0, 0, 0, 0, 1 ], [ 1, 0, 0.0225, 0.0032, 0, 0.66,...
[ "import pygtk, pango", "pygtk.require('2.0')", "import gtk", "from decoders import devanagari", "Vowels = 'aAiIuUReoMH'", "Consonants = 'kgGcjJTDNtdnpbmyrlvzSsh'", "Numbers = '0123456789'", "other = \". |-\\r\\n\\t\"", "virama = u'\\u094d'", "map_vowels = {'a':u'\\u0905', 'A':u'\\u0906', 'i':u'\\u...
hk_map = [['X', 'LRR'], ['F', 'RR'], ['E', 'ai'], ['O', 'au'], ['K', 'kh'], ['G', 'gh'], ['C', 'ch'], ['J', 'jh'], ['W', 'Th'], ['Q', 'Dh'], ['T', 'th'], ['D', 'dh'], ['P', 'ph'], ['B', 'bh'], ['a', 'a'], ['A', 'A'], ['i', 'i'], ['I', 'I'], ['u', 'u'], ['U', 'U'], ...
[ [ 14, 0, 0.1857, 0.3429, 0, 0.66, 0, 9, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.5429, 0.3143, 0, 0.66, 0.5, 110, 0, 0, 0, 0, 0, 5, 0 ], [ 14, 0, 0.8714, 0.2857, 0, 0.66, ...
[ "hk_map = [['X', 'LRR'],\n ['F', 'RR'], ['E', 'ai'], ['O', 'au'], ['K', 'kh'], ['G', 'gh'],\n ['C', 'ch'], ['J', 'jh'], ['W', 'Th'], ['Q', 'Dh'], ['T', 'th'],\n ['D', 'dh'], ['P', 'ph'], ['B', 'bh'],\n ['a', 'a'], ['A', 'A'], ['i', 'i'], ['I', 'I'], ['u', 'u'],\n ['U', '...
# -*- coding: utf-8 -*- #the program encodes text between slp1, hk, wx and itrans formats ##Usage Guidelines: ##1) Copy the module to your ## working directory ##2) import Transcode ##3) use the methods as per your need ## ##example: if you have your source byte stream ## in HK translit...
[ [ 1, 0, 0.1731, 0.0096, 0, 0.66, 0, 848, 0, 1, 0, 0, 848, 0, 0 ], [ 1, 0, 0.1827, 0.0096, 0, 0.66, 0.1667, 575, 0, 1, 0, 0, 575, 0, 0 ], [ 2, 0, 0.3173, 0.2019, 0, ...
[ "import pickle", "import t_map", "def slp1(src_format, source_text):\n #load the mappings file for slp1 and the source format\n if src_format == 'hk':\n maplist = t_map.hk_map \n elif src_format == 'wx':\n maplist = t_map.wx_map\n elif src_format == 'itrans':\n maplist = t_map.i...
# -*- coding: utf-8 -* ''' Hare Krsna ''' ''' om namo Bhagavate Vasudevaya ''' #to find dictonary entries in the given ver ''' find the dictonary matches in the MW dictonary and NITAI VEDA and Glossary ''' #function to sort the list according to the index def add_index_tag(in_list,in_string):...
[ [ 8, 0, 0.0247, 0.0123, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.037, 0.0123, 0, 0.66, 0.0435, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 8, 0, 0.0926, 0.0741, 0, 0.66, ...
[ "''' Hare Krsna '''", "''' om namo Bhagavate Vasudevaya '''", "'''\n find the dictonary matches in the MW dictonary\n\n and NITAI VEDA and Glossary\n\n'''", "def add_index_tag(in_list,in_string):\n length = len(in_list)\n out_list = in_list\n for i in range(length):\n ent...
#! usr/bin/env python #-*- coding: UTF-8 -*- import heapq import math def distancia_entre_puntos(x1,x2,y1,y2): return math.sqrt((x1-y1)**2+(x2-y2)**2) def dijkstra(grafo, origen, destino=None, p=0): if origen == destino: return (0, [origen]) distancias = {} # diccionario con las distancias finales c...
[ [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0, 251, 0, 1, 0, 0, 251, 0, 0 ], [ 1, 0, 0.125, 0.0312, 0, 0.66, 0.3333, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 2, 0, 0.2031, 0.0625, 0, 0...
[ "import heapq", "import math", "def distancia_entre_puntos(x1,x2,y1,y2):\n\treturn math.sqrt((x1-y1)**2+(x2-y2)**2)", "\treturn math.sqrt((x1-y1)**2+(x2-y2)**2)", "def dijkstra(grafo, origen, destino=None, p=0):\n\t\n if origen == destino: return (0, [origen])\n distancias = {} # diccionario con las ...
#! usr/bin/env python #-*- coding: UTF-8 -*- import heapq import math def distancia_entre_puntos(x1,x2,y1,y2): return math.sqrt((x1-y1)**2+(x2-y2)**2) def dijkstra(grafo, origen, destino=None, p=0): if origen == destino: return (0, [origen]) distancias = {} # diccionario con las distancias finales c...
[ [ 1, 0, 0.0938, 0.0312, 0, 0.66, 0, 251, 0, 1, 0, 0, 251, 0, 0 ], [ 1, 0, 0.125, 0.0312, 0, 0.66, 0.3333, 526, 0, 1, 0, 0, 526, 0, 0 ], [ 2, 0, 0.2031, 0.0625, 0, 0...
[ "import heapq", "import math", "def distancia_entre_puntos(x1,x2,y1,y2):\n\treturn math.sqrt((x1-y1)**2+(x2-y2)**2)", "\treturn math.sqrt((x1-y1)**2+(x2-y2)**2)", "def dijkstra(grafo, origen, destino=None, p=0):\n\t\n if origen == destino: return (0, [origen])\n distancias = {} # diccionario con las ...
#! usr/bin/env python #-*- coding: UTF-8 -*- class Vertice(object): def __init__(self, id, datos): self.adyacentes = {} self.datos = datos self.id = id def __cmp__(self, otro): if self.id == otro.id: return 0 if self.id > otro.id: return 1 if self.id < otro.id: return -1 def ver_adyacentes...
[ [ 3, 0, 0.15, 0.2125, 0, 0.66, 0, 519, 0, 3, 0, 0, 186, 0, 1 ], [ 2, 1, 0.0813, 0.05, 1, 0.66, 0, 555, 0, 3, 0, 0, 0, 0, 0 ], [ 14, 2, 0.075, 0.0125, 2, 0.32, 0...
[ "class Vertice(object):\n\tdef __init__(self, id, datos):\n\t\tself.adyacentes = {}\n\t\tself.datos = datos\n\t\tself.id = id\n\n\tdef __cmp__(self, otro):\n\t\tif self.id == otro.id:", "\tdef __init__(self, id, datos):\n\t\tself.adyacentes = {}\n\t\tself.datos = datos\n\t\tself.id = id", "\t\tself.adyacentes =...
#! usr/bin/env python #-*- coding: UTF-8 -*- import sys import grafo import math import heapq def guardar_vertices(archivo, Grafo): '''Lee la cantidad de lineas equivalente a las intersecciones y agrega el vértice con el primer campo como id, y el resto como datos''' linea = archivo.readline() for i in range (int...
[ [ 1, 0, 0.0154, 0.0038, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0192, 0.0038, 0, 0.66, 0.0556, 503, 0, 1, 0, 0, 503, 0, 0 ], [ 1, 0, 0.0231, 0.0038, 0, ...
[ "import sys", "import grafo", "import math", "import heapq", "def guardar_vertices(archivo, Grafo):\n\t'''Lee la cantidad de lineas equivalente a las intersecciones y\n\tagrega el vértice con el primer campo como id, y el resto como datos'''\n\tlinea = archivo.readline()\n\tfor i in range (int(linea)):\n\t\...
#! usr/bin/env python #-*- coding: UTF-8 -*- import sys import grafo import math import heapq def guardar_vertices(archivo, Grafo): '''Lee la cantidad de lineas equivalente a las intersecciones y agrega el vértice con el primer campo como id, y el resto como datos''' linea = archivo.readline() for i in range (int...
[ [ 1, 0, 0.0154, 0.0038, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0192, 0.0038, 0, 0.66, 0.0556, 503, 0, 1, 0, 0, 503, 0, 0 ], [ 1, 0, 0.0231, 0.0038, 0, ...
[ "import sys", "import grafo", "import math", "import heapq", "def guardar_vertices(archivo, Grafo):\n\t'''Lee la cantidad de lineas equivalente a las intersecciones y\n\tagrega el vértice con el primer campo como id, y el resto como datos'''\n\tlinea = archivo.readline()\n\tfor i in range (int(linea)):\n\t\...
#! usr/bin/env python #-*- coding: UTF-8 -*- class Vertice(object): def __init__(self, id, datos): self.adyacentes = {} self.datos = datos self.id = id def __cmp__(self, otro): if self.id == otro.id: return 0 if self.id > otro.id: return 1 if self.id < otro.id: return -1 def ver_adyacentes...
[ [ 3, 0, 0.15, 0.2125, 0, 0.66, 0, 519, 0, 3, 0, 0, 186, 0, 1 ], [ 2, 1, 0.0813, 0.05, 1, 0.22, 0, 555, 0, 3, 0, 0, 0, 0, 0 ], [ 14, 2, 0.075, 0.0125, 2, 0.62, 0...
[ "class Vertice(object):\n\tdef __init__(self, id, datos):\n\t\tself.adyacentes = {}\n\t\tself.datos = datos\n\t\tself.id = id\n\n\tdef __cmp__(self, otro):\n\t\tif self.id == otro.id:", "\tdef __init__(self, id, datos):\n\t\tself.adyacentes = {}\n\t\tself.datos = datos\n\t\tself.id = id", "\t\tself.adyacentes =...
#!/usr/bin/python ''' @author: Manuel F Martinez <manpaz@bashlinux.com> @organization: Bashlinux @copyright: Copyright (c) 2012 Bashlinux @license: GPL ''' import Image import time from constants import * from exceptions import * class Escpos: """ ESC/POS Printer object """ device = None def _check_...
[ [ 8, 0, 0.0176, 0.0235, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0353, 0.0039, 0, 0.66, 0.2, 721, 0, 1, 0, 0, 721, 0, 0 ], [ 1, 0, 0.0392, 0.0039, 0, 0.66, ...
[ "'''\n@author: Manuel F Martinez <manpaz@bashlinux.com>\n@organization: Bashlinux\n@copyright: Copyright (c) 2012 Bashlinux\n@license: GPL\n'''", "import Image", "import time", "from constants import *", "from exceptions import *", "class Escpos:\n \"\"\" ESC/POS Printer object \"\"\"\n device = ...
#!/usr/bin/python ''' @author: Manuel F Martinez <manpaz@bashlinux.com> @organization: Bashlinux @copyright: Copyright (c) 2012 Bashlinux @license: GPL ''' import usb.core import usb.util import serial import socket from escpos import * from constants import * from exceptions import * class Usb(Escpos): """ Defi...
[ [ 8, 0, 0.0333, 0.0444, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0667, 0.0074, 0, 0.66, 0.1, 60, 0, 1, 0, 0, 60, 0, 0 ], [ 1, 0, 0.0741, 0.0074, 0, 0.66, ...
[ "'''\n@author: Manuel F Martinez <manpaz@bashlinux.com>\n@organization: Bashlinux\n@copyright: Copyright (c) 2012 Bashlinux\n@license: GPL\n'''", "import usb.core", "import usb.util", "import serial", "import socket", "from escpos import *", "from constants import *", "from exceptions import *", "cl...
""" ESC/POS Exceptions classes """ import os class Error(Exception): """ Base class for ESC/POS errors """ def __init__(self, msg, status=None): Exception.__init__(self) self.msg = msg self.resultcode = 1 if status is not None: self.resultcode = status def __st...
[ [ 8, 0, 0.0125, 0.0125, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0375, 0.0125, 0, 0.66, 0.125, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 3, 0, 0.125, 0.1375, 0, 0.66, ...
[ "\"\"\" ESC/POS Exceptions classes \"\"\"", "import os", "class Error(Exception):\n \"\"\" Base class for ESC/POS errors \"\"\"\n def __init__(self, msg, status=None):\n Exception.__init__(self)\n self.msg = msg\n self.resultcode = 1\n if status is not None:\n self.r...
""" ESC/POS Commands (Constants) """ # Feed control sequences CTL_LF = '\x0a' # Print and line feed CTL_FF = '\x0c' # Form feed CTL_CR = '\x0d' # Carriage return CTL_HT = '\x09' # Horizontal tab CTL_VT = '\x0b' # Vertical tab # Printer hardware...
[ [ 8, 0, 0.0189, 0.0189, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 14, 0, 0.0755, 0.0189, 0, 0.66, 0.0227, 373, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0943, 0.0189, 0, 0.66...
[ "\"\"\" ESC/POS Commands (Constants) \"\"\"", "CTL_LF = '\\x0a' # Print and line feed", "CTL_FF = '\\x0c' # Form feed", "CTL_CR = '\\x0d' # Carriage return", "CTL_HT = '\\x09' # Horizontal tab", "CTL_VT = '\\x0b' # Vertical tab", ...
__all__ = ["constants","escpos","exceptions","printer"]
[ [ 14, 0, 1, 1, 0, 0.66, 0, 272, 0, 0, 0, 0, 0, 5, 0 ] ]
[ "__all__ = [\"constants\",\"escpos\",\"exceptions\",\"printer\"]" ]
#!/usr/bin/env python # This file is part of django_ip2country. # django_ip2country is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
[ [ 1, 0, 0.4615, 0.0256, 0, 0.66, 0, 614, 0, 1, 0, 0, 614, 0, 0 ], [ 1, 0, 0.4872, 0.0256, 0, 0.66, 0.1667, 93, 0, 1, 0, 0, 93, 0, 0 ], [ 14, 0, 0.5641, 0.0256, 0, 0...
[ "import urllib", "from zipfile import ZipFile", "TARGET = 'http://ip-to-country.webhosting.info/downloads/ip-to-country.csv.zip'", "OUT_FILE_NAME = 'ip-to-country.zip'", "def reporthook(blocknum, bs, size):\n\telapsed = (blocknum * bs) * 100 / size\n\tif elapsed > 100: elapsed = 100\n\tprint('%s%%' % elapse...
#!/usr/bin/env python # This file is part of django_ip2country. # django_ip2country is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
[ [ 1, 0, 0.2857, 0.0159, 0, 0.66, 0, 312, 0, 1, 0, 0, 312, 0, 0 ], [ 1, 0, 0.3016, 0.0159, 0, 0.66, 0.1429, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.3175, 0.0159, 0, ...
[ "import csv", "import os", "import sys", "from optparse import OptionParser", "from django.conf import settings", "from django_ip2country import models", "def main():\n if not 'DJANGO_SETTINGS_MODULE' in os.environ:\n print('DJANGO_SETTINGS_MODULE should be set, exiting.')\n sys.exit(0)...
# This file is part of django_ip2country. # django_ip2country is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # dja...
[ [ 1, 0, 0.4474, 0.0263, 0, 0.66, 0, 521, 0, 1, 0, 0, 521, 0, 0 ], [ 1, 0, 0.5, 0.0263, 0, 0.66, 0.5, 40, 0, 1, 0, 0, 40, 0, 0 ], [ 3, 0, 0.7632, 0.3947, 0, 0.66, ...
[ "import bigint_patch", "from django.db import models", "class Ip2Country(models.Model):\n #ip_from = models.PositiveIntegerField()\n #ip_to = models.PositiveIntegerField()\n ip_from = bigint_patch.BigIntegerField()\n ip_to = bigint_patch.BigIntegerField()\n \n country_code2 = models.CharField(...
# This file is part of django_ip2country. # django_ip2country is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # dja...
[ [ 1, 0, 0.85, 0.05, 0, 0.66, 0, 302, 0, 1, 0, 0, 302, 0, 0 ], [ 1, 0, 0.9, 0.05, 0, 0.66, 0.5, 6, 0, 1, 0, 0, 6, 0, 0 ], [ 8, 0, 1, 0.05, 0, 0.66, 1, 276, ...
[ "from django.contrib import admin", "from django_ip2country.models import Ip2Country", "admin.site.register(Ip2Country)" ]
# This file is part of django_ip2country. # django_ip2country is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # dja...
[ [ 1, 0, 0.5312, 0.0312, 0, 0.66, 0, 6, 0, 1, 0, 0, 6, 0, 0 ], [ 2, 0, 0.6406, 0.125, 0, 0.66, 0.5, 337, 0, 1, 1, 0, 0, 0, 5 ], [ 14, 1, 0.625, 0.0312, 1, 0.04, ...
[ "from django_ip2country.models import Ip2Country", "def ip2long(ip):\n ip_array = ip.split('.')\n ip_long = int(ip_array[0]) * 16777216 + int(ip_array[1]) * 65536 + int(ip_array[2]) * 256 + int(ip_array[3])\n return ip_long", " ip_array = ip.split('.')", " ip_long = int(ip_array[0]) * 16777216 ...
# This file is part of django_ip2country. # django_ip2country is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # dja...
[]
[]
# This file is part of django_ip2country. # django_ip2country is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # dja...
[ [ 8, 0, 0.2158, 0.0842, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.2737, 0.0105, 0, 0.66, 0.1, 913, 0, 1, 0, 0, 913, 0, 0 ], [ 1, 0, 0.2842, 0.0105, 0, 0.66, ...
[ "\"\"\"module mydjangolib.bigint_patch\n\nA fix for the rather well-known ticket #399 in the django project.\n\nCreate and link to auto-incrementing primary keys of type bigint without\nhaving to reload the model instance after saving it to get the ID set in\nthe instance.\n\"\"\"", "from django.core import excep...
#!/usr/bin/env python import sys import os import datetime import shutil import dateutil.tz if len(sys.argv) != 8: sys.exit(); srm = str('SRM') + sys.argv[1] num1 = sys.argv[2] num2 = sys.argv[3] num3 = sys.argv[4] num4 = sys.argv[5] num5 = sys.argv[6] num6 = sys.argv[7] os.mkdir(srm, 0777); os.chdir(os.getcwd() +...
[ [ 1, 0, 0.0833, 0.0278, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.1111, 0.0278, 0, 0.66, 0.0588, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.1389, 0.0278, 0, ...
[ "import sys", "import os", "import datetime", "import shutil", "import dateutil.tz", "if len(sys.argv) != 8:\n\tsys.exit();", "\tsys.exit();", "srm = str('SRM') + sys.argv[1]", "num1 = sys.argv[2]", "num2 = sys.argv[3]", "num3 = sys.argv[4]", "num4 = sys.argv[5]", "num5 = sys.argv[6]", "nu...
#!/usr/bin/env python import sys, os if os.path.exists('output.txt'): os.remove('output.txt') top = './' fd = open('output.txt', 'w+') for root, dirs, files in os.walk(top, topdown=False): for name in dirs: if name[:-4] == 'Volumn': fd.write(name + ' has : ') count = 0 for root, dirs, files in os....
[ [ 1, 0, 0.15, 0.05, 0, 0.66, 0, 509, 0, 2, 0, 0, 509, 0, 0 ], [ 4, 0, 0.275, 0.1, 0, 0.66, 0.2, 0, 3, 0, 0, 0, 0, 0, 2 ], [ 8, 1, 0.3, 0.05, 1, 0.82, 0, 185...
[ "import sys, os", "if os.path.exists('output.txt'):\n\t\tos.remove('output.txt')", "\t\tos.remove('output.txt')", "top = './'", "fd = open('output.txt', 'w+')", "for root, dirs, files in os.walk(top, topdown=False):\n\tfor name in dirs:\n\t\t\tif name[:-4] == 'Volumn':\n\t\t\t\tfd.write(name + ' has : ')\...
cnt = int(raw_input()) rectlst=[] for i in xrange(cnt): tmplst = [] for k in xrange(3): input = raw_input() tmplst.append([int(j) for j in input.split()]) rectlst.append(tmplst) for i in xrange(cnt): coor=rectlst[i] result=[] center=reduce(lambda a,b:[a[0]+b[0], a[1]+b[1]], coor) center=[center[0]/3.0,center...
[ [ 14, 0, 0.05, 0.05, 0, 0.66, 0, 307, 3, 1, 0, 0, 901, 10, 2 ], [ 14, 0, 0.1, 0.05, 0, 0.66, 0.3333, 375, 0, 0, 0, 0, 0, 5, 0 ], [ 6, 0, 0.275, 0.3, 0, 0.66, 0....
[ "cnt = int(raw_input())", "rectlst=[]", "for i in xrange(cnt):\n\ttmplst = []\n\tfor k in xrange(3):\n\t\tinput = raw_input()\n\t\ttmplst.append([int(j) for j in input.split()])\n\trectlst.append(tmplst)", "\ttmplst = []", "\tfor k in xrange(3):\n\t\tinput = raw_input()\n\t\ttmplst.append([int(j) for j in i...
from Queue import Queue count = int(raw_input()) class Stack(Queue): def _get(self): item = self.queue[-1] del self.queue[-1] return item a = Stack(); b = Stack(); c = Stack(); k=[a,b,c] def move(src,dest): k[dest-1].put(k[src-1].get()) if(count<=20): print src,dest def other(h1,h2): t...
[ [ 1, 0, 0.027, 0.027, 0, 0.66, 0, 952, 0, 1, 0, 0, 952, 0, 0 ], [ 14, 0, 0.0811, 0.027, 0, 0.66, 0.0833, 778, 3, 1, 0, 0, 901, 10, 2 ], [ 3, 0, 0.1622, 0.1351, 0, 0...
[ "from Queue import Queue", "count = int(raw_input())", "class Stack(Queue):\n def _get(self):\n item = self.queue[-1]\n del self.queue[-1]\n return item", " def _get(self):\n item = self.queue[-1]\n del self.queue[-1]\n return item", " item = self.queue...
__author__ = 'changwoncheo' a0=(0,'zero') a1=(1,'one') a2=(2,'two') a3=(3,'three') a4=(4,'four') a5=(5,'five') a6=(6,'six') a7=(7,'seven') a8=(8,'eight') a9=(9,'nine') alist = [a0,a1,a2,a3,a4,a5,a6,a7,a8,a9] biglist =[]; def compareNum(string): for i in alist: temp = '' com = i[1] l = list(c...
[ [ 14, 0, 0.0132, 0.0132, 0, 0.66, 0, 777, 1, 0, 0, 0, 0, 3, 0 ], [ 14, 0, 0.0263, 0.0132, 0, 0.66, 0.0556, 599, 0, 0, 0, 0, 0, 8, 0 ], [ 14, 0, 0.0395, 0.0132, 0, 0...
[ "__author__ = 'changwoncheo'", "a0=(0,'zero')", "a1=(1,'one')", "a2=(2,'two')", "a3=(3,'three')", "a4=(4,'four')", "a5=(5,'five')", "a6=(6,'six')", "a7=(7,'seven')", "a8=(8,'eight')", "a9=(9,'nine')", "alist = [a0,a1,a2,a3,a4,a5,a6,a7,a8,a9]", "biglist =[];", "def compareNum(string):\n ...
def sort(_list): for i in range(len(_list)): target = _list[i] for k in range(len(_list)): if( (k+1) != len(_list)): if (_list[k] > _list[k+1]): swap(_list,k,k+1) else : k+=1 def printMax(_list): temp = 0 for i in _list: if i>temp: temp = i print '%.1f'%(temp) def swap(_list,sindex,d...
[ [ 2, 0, 0.1064, 0.1915, 0, 0.66, 0, 489, 0, 1, 0, 0, 0, 0, 6 ], [ 6, 1, 0.117, 0.1702, 1, 0.09, 0, 826, 3, 0, 0, 0, 0, 0, 6 ], [ 14, 2, 0.0638, 0.0213, 2, 0.06, ...
[ "def sort(_list):\n\tfor i in range(len(_list)):\n\t\ttarget = _list[i]\n\t\tfor k in range(len(_list)):\n\t\t\tif( (k+1) != len(_list)):\n\t\t\t\tif (_list[k] > _list[k+1]):\n\t\t\t\t\tswap(_list,k,k+1)\n\t\t\t\telse :", "\tfor i in range(len(_list)):\n\t\ttarget = _list[i]\n\t\tfor k in range(len(_list)):\n\t\t...
from django.db import models from django.contrib.auth.models import User class ProgrammingLanguage(models.Model): name = models.CharField(max_length=10) def __unicode__(self): return u'%s' % self.name class Classification(models.Model): name = models.CharField(max_length=35) uri = models.URLField() def get...
[ [ 1, 0, 0.0105, 0.0105, 0, 0.66, 0, 40, 0, 1, 0, 0, 40, 0, 0 ], [ 1, 0, 0.0211, 0.0105, 0, 0.66, 0.0667, 808, 0, 1, 0, 0, 808, 0, 0 ], [ 3, 0, 0.0632, 0.0526, 0, 0....
[ "from django.db import models", "from django.contrib.auth.models import User", "class ProgrammingLanguage(models.Model):\n\tname = models.CharField(max_length=10)\n\t\n\tdef __unicode__(self):\n\t\treturn u'%s' % self.name", "\tname = models.CharField(max_length=10)", "\tdef __unicode__(self):\n\t\treturn u...
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
[ [ 8, 0, 0.2188, 0.375, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.5, 0.0625, 0, 0.66, 0.5, 944, 0, 1, 0, 0, 944, 0, 0 ], [ 3, 0, 0.8438, 0.375, 0, 0.66, 1,...
[ "\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"", "from django.test import TestCase", "class SimpleTest(TestCase):\n def test_basic_addition(self):\n \"\...
from algorithm.models import Algorithm from django import forms from django.forms import Textarea class AlgorithmForm(forms.ModelForm): class Meta: model = Algorithm fields = ('name','description','classification') widgets = { 'description': Textarea(attrs={'cols': 240, 'rows': 10}), ...
[ [ 1, 0, 0.0588, 0.0588, 0, 0.66, 0, 363, 0, 1, 0, 0, 363, 0, 0 ], [ 1, 0, 0.1176, 0.0588, 0, 0.66, 0.3333, 294, 0, 1, 0, 0, 294, 0, 0 ], [ 1, 0, 0.1765, 0.0588, 0, ...
[ "from algorithm.models import Algorithm", "from django import forms", "from django.forms import Textarea", "class AlgorithmForm(forms.ModelForm):\n\tclass Meta:\n\t\tmodel = Algorithm\n\t\tfields = ('name','description','classification')\n\t\twidgets = {\n 'description': Textarea(attrs={'cols': 240...
from django import forms class ContactForm(forms.Form): subject = forms.CharField(max_length=100) message = forms.CharField(widget=forms.Textarea) sender = forms.EmailField() #cc_myself = forms.BooleanField(required=False)
[ [ 1, 0, 0.1429, 0.1429, 0, 0.66, 0, 294, 0, 1, 0, 0, 294, 0, 0 ], [ 3, 0, 0.6429, 0.5714, 0, 0.66, 1, 340, 0, 0, 0, 0, 953, 0, 3 ], [ 14, 1, 0.5714, 0.1429, 1, 0.29...
[ "from django import forms", "class ContactForm(forms.Form):\n subject = forms.CharField(max_length=100)\n message = forms.CharField(widget=forms.Textarea)\n sender = forms.EmailField()", " subject = forms.CharField(max_length=100)", " message = forms.CharField(widget=forms.Textarea)", " se...
import os from algorithm.models import Classification, Implementation, Algorithm, ProgrammingLanguage, Interest, ProeficiencyScale, ProgrammingLanguageProeficiencyScale, ClassificationProeficiencyScale, Question,QuestionAnswer,UserQuestion,ImplementationQuestion,ImplementationQuestionAnswer,UserQuestionAnswer from ex...
[ [ 1, 0, 0.0023, 0.0023, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0047, 0.0023, 0, 0.66, 0.0204, 363, 0, 14, 0, 0, 363, 0, 0 ], [ 1, 0, 0.007, 0.0023, 0, ...
[ "import os", "from algorithm.models import Classification, Implementation, Algorithm, ProgrammingLanguage, Interest, ProeficiencyScale, ProgrammingLanguageProeficiencyScale, ClassificationProeficiencyScale, Question,QuestionAnswer,UserQuestion,ImplementationQuestion,ImplementationQuestionAnswer,UserQuestionAnswer...
from django.contrib import admin from algorithm.models import ProgrammingLanguage, Classification, Algorithm, Implementation, Interest, ProeficiencyScale, ProgrammingLanguageProeficiencyScale, ClassificationProeficiencyScale, Question,QuestionAnswer,UserQuestion,ImplementationQuestion,ImplementationQuestionAnswer,User...
[ [ 1, 0, 0.0303, 0.0303, 0, 0.66, 0, 302, 0, 1, 0, 0, 302, 0, 0 ], [ 1, 0, 0.0606, 0.0303, 0, 0.66, 0.0556, 363, 0, 14, 0, 0, 363, 0, 0 ], [ 3, 0, 0.1515, 0.0909, 0, ...
[ "from django.contrib import admin", "from algorithm.models import ProgrammingLanguage, Classification, Algorithm, Implementation, Interest, ProeficiencyScale, ProgrammingLanguageProeficiencyScale, ClassificationProeficiencyScale, Question,QuestionAnswer,UserQuestion,ImplementationQuestion,ImplementationQuestionAn...
# Create your views here. from django.contrib import auth from django.views.decorators.csrf import csrf_exempt from django.http import HttpResponse, HttpResponseRedirect from django.template import Context from django.template.loader import get_template from algorithm.models import Classification, Implementation,Algor...
[ [ 1, 0, 0.0066, 0.0033, 0, 0.66, 0, 302, 0, 1, 0, 0, 302, 0, 0 ], [ 1, 0, 0.0099, 0.0033, 0, 0.66, 0.0312, 456, 0, 1, 0, 0, 456, 0, 0 ], [ 1, 0, 0.0132, 0.0033, 0, ...
[ "from django.contrib import auth", "from django.views.decorators.csrf import csrf_exempt", "from django.http import HttpResponse, HttpResponseRedirect", "from django.template import Context", "from django.template.loader import get_template", "from algorithm.models import Classification, Implementation,Al...
from __future__ import unicode_literals from django import forms from django.forms.util import flatatt from django.template import loader from django.utils.datastructures import SortedDict from django.utils.html import format_html, format_html_join from django.utils.http import int_to_base36 from django.utils....
[ [ 1, 0, 0.0147, 0.0147, 0, 0.66, 0, 777, 0, 1, 0, 0, 777, 0, 0 ], [ 1, 0, 0.0441, 0.0147, 0, 0.66, 0.0667, 294, 0, 1, 0, 0, 294, 0, 0 ], [ 1, 0, 0.0588, 0.0147, 0, ...
[ "from __future__ import unicode_literals", "from django import forms", "from django.forms.util import flatatt", "from django.template import loader", "from django.utils.datastructures import SortedDict", "from django.utils.html import format_html, format_html_join", "from django.utils.http import int_to...
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AlgPedia.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
[ [ 1, 0, 0.2, 0.1, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.3, 0.1, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 4, 0, 0.75, 0.6, 0, 0.66, 1, 0, ...
[ "import os", "import sys", "if __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"AlgPedia.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)", " os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"AlgPe...
from django.db import models # Create your models here.
[ [ 1, 0, 0.3333, 0.3333, 0, 0.66, 0, 40, 0, 1, 0, 0, 40, 0, 0 ] ]
[ "from django.db import models" ]
""" This file demonstrates writing tests using the unittest module. These will pass when you run "manage.py test". Replace this with more appropriate tests for your application. """ from django.test import TestCase class SimpleTest(TestCase): def test_basic_addition(self): """ Tests that 1 + 1 a...
[ [ 8, 0, 0.2188, 0.375, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.5, 0.0625, 0, 0.66, 0.5, 944, 0, 1, 0, 0, 944, 0, 0 ], [ 3, 0, 0.8438, 0.375, 0, 0.66, 1,...
[ "\"\"\"\nThis file demonstrates writing tests using the unittest module. These will pass\nwhen you run \"manage.py test\".\n\nReplace this with more appropriate tests for your application.\n\"\"\"", "from django.test import TestCase", "class SimpleTest(TestCase):\n def test_basic_addition(self):\n \"\...
''' Created on 20/02/2013 @author: Pericolo ''' from DBPediaQueryFetcher import QueryFetcher from FileWriters import TXTWriter import os from algorithm.models import Classification class ColumnExtractor: def __init__(self, file_name): self.file_name = file_name def extractColumn(self, col...
[ [ 8, 0, 0.0345, 0.0575, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.0805, 0.0115, 0, 0.66, 0.1111, 322, 0, 1, 0, 0, 322, 0, 0 ], [ 1, 0, 0.092, 0.0115, 0, 0.66,...
[ "'''\nCreated on 20/02/2013\n\n@author: Pericolo\n'''", "from DBPediaQueryFetcher import QueryFetcher", "from FileWriters import TXTWriter", "import os", "from algorithm.models import Classification", "class ColumnExtractor:\n\tdef __init__(self, file_name):\n\t\tself.file_name = file_name\n\t\t\n\tdef ex...
class CSVColumnExtractor: def __init__(self, file_name): self.file_name = file_name def extract_column(self, column_index): F_H = open(self.file_name, 'r') lines = F_H.readlines() F_H.close() column = map(lambda x: x.split(';')[column_index], lines) return column
[ [ 3, 0, 0.5357, 1, 0, 0.66, 0, 877, 0, 2, 0, 0, 0, 0, 5 ], [ 2, 1, 0.1786, 0.1429, 1, 0.43, 0, 555, 0, 2, 0, 0, 0, 0, 0 ], [ 14, 2, 0.2143, 0.0714, 2, 0.41, 0, ...
[ "class CSVColumnExtractor:\n\tdef __init__(self, file_name):\n\t\tself.file_name = file_name\n\t\t\n\tdef extract_column(self, column_index):\n\t\tF_H = open(self.file_name, 'r')\n\t\t\n\t\tlines = F_H.readlines()", "\tdef __init__(self, file_name):\n\t\tself.file_name = file_name", "\t\tself.file_name = file_n...
# Create your views here.
[]
[]
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "AlgPedia.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
[ [ 1, 0, 0.2, 0.1, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.3, 0.1, 0, 0.66, 0.5, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 4, 0, 0.75, 0.6, 0, 0.66, 1, 0, ...
[ "import os", "import sys", "if __name__ == \"__main__\":\n os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"AlgPedia.settings\")\n\n from django.core.management import execute_from_command_line\n\n execute_from_command_line(sys.argv)", " os.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"AlgPe...
from django.conf.urls import patterns, include, url from django.contrib.auth.views import login, logout from algorithm.views import * #show_main_page, sync_database, clear_database, show_all_classifications, show_classification_by_id # Uncomment the next two lines to enable the admin: from django.contrib import admin ...
[ [ 1, 0, 0.0263, 0.0263, 0, 0.66, 0, 528, 0, 3, 0, 0, 528, 0, 0 ], [ 1, 0, 0.0526, 0.0263, 0, 0.66, 0.2, 745, 0, 2, 0, 0, 745, 0, 0 ], [ 1, 0, 0.0789, 0.0263, 0, 0.6...
[ "from django.conf.urls import patterns, include, url", "from django.contrib.auth.views import login, logout", "from algorithm.views import *", "from django.contrib import admin", "admin.autodiscover()", "urlpatterns = patterns('',\n # Examples:\n\n\turl(r'^$', show_main_page),\n\turl(r'^sync/$', sync_d...
# Django settings for AlgPedia project. import os DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'AlgPedia', 'USER': 'root', 'PASSWORD': '', 'HOST': '127.0.0.1', # Empty...
[ [ 1, 0, 0.016, 0.0053, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 14, 0, 0.0267, 0.0053, 0, 0.66, 0.027, 309, 1, 0, 0, 0, 0, 4, 0 ], [ 14, 0, 0.0321, 0.0053, 0, 0....
[ "import os", "DEBUG = True", "TEMPLATE_DEBUG = DEBUG", "ADMINS = (\n # ('Your Name', 'your_email@example.com'),\n)", "MANAGERS = ADMINS", "DATABASES = {\n\t'default': {\n\t'ENGINE': 'django.db.backends.mysql',\n\t'NAME': 'AlgPedia',\n\t'USER': 'root',\n\t'PASSWORD': '',\n\t'HOST': '127.0.0.1', # Empty ...
""" WSGI config for AlgPedia project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION``...
[ [ 8, 0, 0.25, 0.4688, 0, 0.66, 0, 0, 1, 0, 0, 0, 0, 0, 0 ], [ 1, 0, 0.5, 0.0312, 0, 0.66, 0.25, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 8, 0, 0.6875, 0.0312, 0, 0.66, 0...
[ "\"\"\"\nWSGI config for AlgPedia project.\n\nThis module contains the WSGI application used by Django's development server\nand any production WSGI deployments. It should expose a module-level variable\nnamed ``application``. Django's ``runserver`` and ``runfcgi`` commands discover\nthis application via the ``WSGI...
import sys f = open(sys.argv[2], "w") out = sys.argv[3] + "<<-c("+','.join(open(sys.argv[1]).read().split("\n"))+")" f.write(out[:-2]+')') f.close()
[ [ 1, 0, 0.25, 0.125, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 14, 0, 0.5, 0.125, 0, 0.66, 0.25, 899, 3, 2, 0, 0, 693, 10, 1 ], [ 14, 0, 0.75, 0.125, 0, 0.66, ...
[ "import sys", "f = open(sys.argv[2], \"w\")", "out = sys.argv[3] + \"<<-c(\"+','.join(open(sys.argv[1]).read().split(\"\\n\"))+\")\"", "f.write(out[:-2]+')')", "f.close()" ]
#!/usr/bin/env python # Copyright (c) 2009, Prashanth Ellina # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice,...
[ [ 1, 0, 0.0628, 0.0023, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0651, 0.0023, 0, 0.66, 0.0233, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0674, 0.0023, 0, ...
[ "import os", "import sys", "import dbm", "import time", "import random", "from cmd import Cmd", "HOME_DIR = os.environ.get('HOME', '/tmp')", "DATA_DIR = os.path.join(HOME_DIR, '.aliaser')", "ALIASES_DB = os.path.join(DATA_DIR, 'aliases')", "IGNORED_DB = os.path.join(DATA_DIR, 'ignored')", "ALIAS...
#!/usr/bin/env python # Copyright (c) 2009, Prashanth Ellina # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # * Redistributions of source code must retain the above copyright # notice,...
[ [ 1, 0, 0.0628, 0.0023, 0, 0.66, 0, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0651, 0.0023, 0, 0.66, 0.0233, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0674, 0.0023, 0, ...
[ "import os", "import sys", "import dbm", "import time", "import random", "from cmd import Cmd", "HOME_DIR = os.environ.get('HOME', '/tmp')", "DATA_DIR = os.path.join(HOME_DIR, '.aliaser')", "ALIASES_DB = os.path.join(DATA_DIR, 'aliases')", "IGNORED_DB = os.path.join(DATA_DIR, 'ignored')", "ALIAS...
import sys import os import re def getQ(fin, query, N_dom): qseq = '' miss = False for line in fin: if miss == False: if re.match("(>%s)\sD(%d).*Query: start\s(\d+)\send\s(\d+).*\n(.*)" %(query,int(N_dom)), line): Qid = re.match("(>%s)\sD(%d).*Query: start\s(\d+)\send\s(\d+).*\n(.*)" %(query, ...
[ [ 1, 0, 0.0105, 0.0105, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0211, 0.0105, 0, 0.66, 0.125, 688, 0, 1, 0, 0, 688, 0, 0 ], [ 1, 0, 0.0316, 0.0105, 0, 0...
[ "import sys", "import os", "import re", "def getQ(fin, query, N_dom):\n\t\n\tqseq = ''\n\tmiss = False\n\tfor line in fin:\n\t\tif miss == False:\n\t\t\tif re.match(\"(>%s)\\sD(%d).*Query: start\\s(\\d+)\\send\\s(\\d+).*\\n(.*)\" %(query,int(N_dom)), line):\n\t\t\t\tQid = re.match(\"(>%s)\\sD(%d).*Query: star...
#!/usr/bin/env python ########################## # FASTA PARCER # # prints fasfa file # # for domain hit # # match. Optional # # matching parameters # # allow for parameter # # specific domain hit # # results. Options # # allow for creation # # of summary and # # detail d...
[ [ 1, 0, 0.0947, 0.0035, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0982, 0.0035, 0, 0.66, 0.0625, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.1018, 0.0035, 0, ...
[ "import sys", "import re", "import fileinput", "import os", "from optparse import OptionParser", "from math import e", "def domain_hits(fin):\n\thmm_FILE = open(fin, \"rb\")\n\tfor line in hmm_FILE:\n\t\tpos = line.find('Domain search space ')\n\t\tif pos != -1:\n\t\t\tdomainValueString = str(line)\n\...
#!/usr/bin/env python ########################## # FASTA PARCER # # prints fasfa file # # for domain hit # # match. Optional # # matching parameters # # allow for parameter # # specific domain hit # # results. Options # # allow for creation # # of summary and # # detail d...
[ [ 1, 0, 0.0947, 0.0035, 0, 0.66, 0, 509, 0, 1, 0, 0, 509, 0, 0 ], [ 1, 0, 0.0982, 0.0035, 0, 0.66, 0.0625, 540, 0, 1, 0, 0, 540, 0, 0 ], [ 1, 0, 0.1018, 0.0035, 0, ...
[ "import sys", "import re", "import fileinput", "import os", "from optparse import OptionParser", "from math import e", "def domain_hits(fin):\n\thmm_FILE = open(fin, \"rb\")\n\tfor line in hmm_FILE:\n\t\tpos = line.find('Domain search space ')\n\t\tif pos != -1:\n\t\t\tdomainValueString = str(line)\n\...