Skip to content

Instantly share code, notes, and snippets.

View earthling-shruti's full-sized avatar

Saishruti Shetty earthling-shruti

View GitHub Profile
#------------------------
#in else block
try:
obj = db.create_obj():
except DBExploded as e:
fail, return
else:
#obj is guarenteed to be valid object
obj.do_something()
obj.save()
<on feature branch>
561 git mv folder1/folder2/ folder3/
562 git status
563 git add .
564 git commit
565 git status
566 git rm folder3/folder4
567 git rm -r folder3/folder4
568 git status
569 git add .
Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz”
instead of the number and for the multiples of five print “Buzz”. For numbers which are
multiples of both three and five print “FizzBuzz”.
import csv
import math
#read csv file
str = []
with open ('scores.csv', 'rb') as csvfile:
file = csv.reader(csvfile, delimiter= ',')
for row in file:
str.append(' '.join(row))
#store schools and scores in different arrays
def tourney(N, C):
if N < 2 or C < 1:
print "Enter >2 N and >0 C"
sys.exit()
#generate game set
game_set = []
for i in range(1, N):
for j in range(i+1, N+1):
game_set.append(str(i) + " vs " + str(j))
def tourney(N, C):
game_set = []
for i in range(1, N): #add error check for 1 player
for j in range(i+1, N+1):
game_set.append(str(i) + " vs " + str(j))
for game in game_set:
print game
tourney(6,4)
postgres 3390 0.0 0.0 5720 1488 pts/1 S 11:34 0:00 su postgres
postgres 3398 0.0 0.0 5780 1900 pts/1 S 11:34 0:00 bash
postgres 6019 0.0 0.1 39916 5144 pts/1 S+ 15:46 0:00 /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
postgres 6021 0.0 0.0 39916 816 ? Ss 15:46 0:00 postgres: checkpointer process
postgres 6022 0.0 0.0 39916 828 ? Ss 15:46 0:00 postgres: writer process
postgres 6023 0.0 0.0 39916 832 ? Ss 15:46 0:00 postgres: wal writer process
postgres 6024 0.0 0.0 40452 1756 ? Ss 15:46 0:00 postgres: autovacuum launcher process
postgres 6025 0.0 0.0 10140 836 ? Ss 15:46 0:00 postgres: stats collector process
postgres 6222 0.0 0.0 5720 1484 pts/2 S 16:03 0:00 su - postgres
postgres 6230 0.0 0.1 7952 4148 pts/2 S 16:03 0:00 -su
Server started:
postgres@shruti-Inspiron-N5010:/home/shruti/git_stuff/grails_stuff$ /usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data
LOG: database system was shut down at 2013-01-29 15:46:28 MST
LOG: database system is ready to accept connections
LOG: autovacuum launcher started
-----------------------------------------------------------------------------------------------------------------------
Client connection error
postgres@shruti-Inspiron-N5010:~$ createdb mydb
@LOOPSTART
GOTO << @NORTHANDWESTGETOUT
GOTO << @LOOPSTART
@NORTHANDWESTGETOUT
CALLFF << @LOOK @NORTH 2
EQUAL << @CELL_EMPTY
IFFGOTO << @MOVEWESTGETOUT
CALLFF << @MOVE @NORTH 2
POP
@LOOPSTART
GOTO << @CHECKEAST
@MOVEEAST
CALLFF << @LOOK @EAST 2
EQUAL << @CELL_EMPTY
IFFCALL << @MOVENORTH
CALLFF << @MOVE @EAST 2
POP
RETURN