This file contains hidden or 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
SELECT s.student_id | |
FROM students s | |
EXCEPT | |
SELECT g.student_id | |
FROM grades g; |
This file contains hidden or 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 "voltmeter.h" | |
float voltage(const float m) | |
{ | |
return m * VOLTAGE_FACTOR; | |
} | |
int main(void) | |
{ | |
float i = 0; |
This file contains hidden or 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
irb(main):002:0> ['A3', 'A5', 'A11', 'A8', 'A10'].sort | |
=> ["A10", "A11", "A3", "A5", "A8"] |
This file contains hidden or 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 myqueue: | |
def __init__(self): | |
self._contents = list() | |
def __str__(self): | |
return '{}'.format(self._contents[::-1]) | |
def __iter__(self): | |
return iter(self._contents) |
This file contains hidden or 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 remDupl(s): | |
return None |
This file contains hidden or 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 stack import stack | |
def sort(unsorted): | |
sortedStack = stack() | |
while len(unsorted): | |
top = unsorted.pop() | |
while len(sortedStack) and sortedStack.peek() < top: | |
unsorted.push(sortedStack.pop()) | |
sortedStack.push(top) |
This file contains hidden or 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 <u.h> | |
#include <libc.h> | |
const int STDERR = 2; | |
static void | |
usage (void) | |
{ | |
fprint (STDERR, "usage: %s 0644 file1 [file2] ...\n", argv0); | |
exits ("usage"); |
This file contains hidden or 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 urllib.request, urllib.parse | |
MAX_TRIES = 3 | |
if __name__ == '__main__': | |
opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor()) | |
urllib.request.install_opener(opener) | |
params = urllib.parse.urlencode(dict(login='username@yahoo.com', | |
passwd='y0uRpas5')) | |
utf_params = params.encode('utf-8') |
This file contains hidden or 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
ERR = 'n must be >= 0' | |
def fibonacci(n): | |
assert(n >= 0), ERR | |
if n == 0 or n == 1: | |
return n | |
res = fibonacci(n-1) + fibonacci(n-2) | |
return res | |
known = {0:0, 1:1} |
NewerOlder