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 argparse | |
from operator import itemgetter | |
import sys | |
parser=argparse.ArgumentParser() | |
parser.add_argument('file', help='name of the file', type=str) | |
parser.add_argument('-n', help='number of words',type = int) | |
parser.add_argument('-s', help='short words',action = 'store_true') | |
options=parser.parse_args() |
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 sys | |
import argparse | |
parser=argparse.ArgumentParser() | |
parser.add_argument('-f',help="cutoff", type=int, default=0) | |
parser.add_argument('file',help="inputfile", type=str) | |
options=parser.parse_args() |
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/python | |
import sys | |
from math import sqrt | |
#dist between two atoms | |
def dist(a,b): | |
return sqrt((a[0]-b[0])**2+(a[1]-b[1])**2+(a[2]-b[2])**2) | |
helices=[] | |
mean_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
from Tkinter import Tk, Canvas | |
import random | |
root = Tk() | |
canvas_size = 500 | |
canv = Canvas(root, width = canvas_size, height = canvas_size, bg = 'white') | |
canv.pack() | |
def draw_circle(event): | |
global count,radius | |
r=radius | |
x = random.randint(0, canvas_size - r*2) |
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
from Tkinter import Tk, Canvas | |
import random | |
canvas_size = 500 | |
x = 250 | |
y = 250 | |
delay = 10 | |
colors = ["red","orange","yellow","green","blue","cyan","magenta","light blue"] | |
def step(): |
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/python2.7 | |
import time | |
from math import sin,cos,pi,sqrt | |
from Tkinter import * | |
def rot_hand(x2,y2,rot,x1=75,y1=100): | |
xf=(x2-x1)*cos(rot)-(y2-y1)*sin(rot) | |
yf=(x2-x1)*sin(rot)+(y2-y1)*cos(rot) | |
return xf+x1,yf+y1 |
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
""" | |
Дан список положительных и отрицательных чисел. | |
Переместить все положительные числа в левую часть | |
списка с сохранением порядка положительных и | |
отрицательных чисел в списке. Все манипуляции можно | |
производить только с исходным списком, дополнительные | |
списки использовать нельзя, удалять элементы из списка | |
тоже запрещено. | |
""" |
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 <iostream> | |
using namespace std; | |
void printArray(int b[], unsigned size) | |
{ | |
for (int i=0; i < size; i++) | |
cout<< b[i] << ' '; | |
cout << endl; | |
} |