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
s1843530: | |
Based on your comment the solution seems on the right track but fillQueue is the important part. | |
s1869635: | |
The approach seems ok, break yor code in subroutines. | |
s1844752: | |
not much to comment on | |
s1840770: |
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
def clean_reversed_seq(seq): | |
skip = 0 | |
# Find a version of reversed that is an iterator | |
for i in reversed(seq): | |
if i == '\b': | |
skip += 1 | |
elif skip == 0: | |
yield i | |
else: | |
skip -= 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
a = [[1,2,1,1], | |
[1,2,1,1], | |
[1,2,1,1]] | |
STEPS = [ | |
lambda (x,y): (x+1,y), # STEPS[0] | |
lambda (x,y): (x,y+1), # STEPS[1] | |
lambda (x,y): (x-1,y), # STEPS[2] | |
lambda (x,y): (x,y-1), # STEPS[3] | |
] |
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
def in_grid(cur,grid): | |
x,y = cur | |
height = len(grid) | |
if y >= height or y < 0: | |
return False | |
row = grid[y] | |
width = len(row) | |
if x >= len(row) or x < 0: | |
return False |
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 java.util.Scanner; | |
public class Homework { | |
public static void main(String[] args) { | |
Scanner scan = new Scanner(System.in); | |
System.out.print("Enter x coordinate: "); | |
int x_coordinate = scan.nextInt(); | |
System.out.print("Enter x coordinate: "); | |
int y_coordinate = scan.nextInt(); |
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
class RingBuffer(object): | |
def __init__(self, data): | |
self._data = data | |
def __getitem__(self, i): | |
return self._data[i % len(self)] | |
def __setitem__(self, i,v): | |
self._data[i % len(self)] = v |
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
class Tree(object): | |
def __init__(self, operator, left, right): | |
self._operator = operator | |
self._left = left | |
self._right = right | |
def eval(self): | |
if not isinstance(self._operator, basestring): | |
return self._operator |
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
def lookup_fun(buf, end, addr): | |
return buf[(n + end) % 4] | |
def fun(n): | |
buf = [1,1,2,4,8] | |
end = 0 | |
for i in range(n + 1): | |
buf[end] = sum(buf) | |
end = (end + 1) % 4 |
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 calendar | |
import feedparser | |
import praw | |
reddit = praw.Reddit(client_secret='-6308pLSnW6UWs1Fw_tccXU2ADA', | |
client_id='alVYh7xBmsCVqA', | |
user_agent='my user agent', | |
username='konservokouti', |
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
/* 19 entries */, 32768) = 656 | |
getdents(3, /* 0 entries */, 32768) = 0 | |
close(3) = 0 | |
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 | |
write(1, "bama\t\t\t drvv-site\t hybrid\t"..., 45bama drvv-site hybrid tc-panel | |
) = 45 | |
write(1, "bama.zip\t\t emacs\t\t hybrid."..., 43bama.zip emacs hybrid.zip vimb | |
) = 43 | |
write(1, "bibtex\t\t\t fakedrake.github.com "..., 55bibtex fakedrake.github.com index17.dat WordPress | |
) = 55 |