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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <lua.h> | |
#include <lauxlib.h> | |
#include <lualib.h> | |
int main (int argc, char *argv[]) { | |
if (argc < 3) { | |
fprintf(stderr, "Missing arguments. Use it like ./program <a> <b>\n"); |
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 ast | |
code = """ | |
import foo | |
a = 1 + 2 | |
b = "a" + "b" * 3 |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <errno.h> | |
#include "ae.h" | |
#include "anet.h" | |
#include "cdredis.h" |
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 scrape_listing(): | |
for link in get_links(LISTING_URL): | |
scrape_link(link) | |
def scrape_link(url): | |
resp = requests.get(url) | |
info = get_link_info(resp.content) | |
save('link', info) |
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
schedule('scrape_link', 'http://example.com', seconds=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
for _ in range(10): | |
schedule('scrape_link', link, seconds=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
@starting_task | |
def scrape_listing(): | |
for link in get_links(LISTING_URL): | |
schedule('scrape_link', link, seconds=0) | |
@subtask | |
def scrape_link(url): | |
resp = requests.get(url) | |
info = get_link_info(resp.content) |
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
# REPL | |
# read, eval, print, loop program | |
import os | |
import subprocess | |
import shlex | |
import sys | |
last_returncode = 0 | |
try: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 collections import defaultdict | |
class BaseCell(object): | |
def __init__(self, value): | |
self.value = value | |
def __add__(self, other): | |
if not isinstance(other, Cell): | |
other = BaseCell(other) |
NewerOlder