Skip to content

Instantly share code, notes, and snippets.

{{GameMenu intro}}
| ?sayb = Yellow Bile
| ?sabb = Black Bile
}}
{{top|Glutony values|Glutony values}}
====Mercury====
{{#ask:
[[:+]] [[mebl::>> 0]] OR
[[:+]] [[meph::>> 0]] OR
[[:+]] [[meyb::>> 0]] OR
def is_black(p):
return (p[0] | p[1] | p[2]) == 0
class FlatImage:
def __init__(self, path):
self.image = Image.open(path)
self.labels = [[0]*100]*100
self.pix = self.image.load()
self.flat = []
do {
rc = sqlite3_step(stm);
switch (rc) {
case SQLITE_ROW:
data.iface = sqlite3_column_text(stm, 0);
cnt->incoming_bytes = sqlite3_column_int64(stm, 1);
cnt->outgoing_bytes = sqlite3_column_int64(stm, 2);
if (info_cb(&data, user_data) == PCL_CANCEL)
rc = SQLITE_DONE; /* emulate end of data */
break;
long passed, next;
/* adjust the transition */
do {
passed = System.currentTimeMillis() - sync;
Log.d(TAG, "Adjust at "+l2s(passed+sync)+", sync was at "+l2s(sync)+" "+passed+"ms passed");
if (tr.isEmpty()) {
/* request more items */
exhausted();
if (tr.isEmpty()) {
Log.d(TAG, "no transitions");
#include <stdio.h>
int data[] = { 3, 4, 6, 5, 11, 2, 19, 1};
int main() {
int min, when_min, buy, sell;
int i;
int profit;
profit = when_min = buy = sell = 0;
min = data[0];
@aragaer
aragaer / gist:1768287
Created February 8, 2012 11:25
1705 investigation
#include <stdio.h>
#include <math.h>
typedef unsigned long long int val_t;
val_t naive_calc(val_t n, val_t min) {
val_t k;
for (k = min; k < n; k++)
if (n / k == n / (k + 1))
return k;
#include <stdio.h>
int a() {
printf("a called\n");
return 0;
}
int b() {
printf("b called\n");
return 0;
proxy = None
proxydict = urllib2.ProxyHandler().proxies
for type in ["https", "http", "socks"]:
if type not in proxydict:
continue
proxyline = proxydict[type]
schemalen = length(type + 3) # "<schema>://"
if proxyline[:schemalen] == "%s://" % type
proxyline = proxyline[schemalen:]
proxAddr, proxPort = proxyline.split(":")
@aragaer
aragaer / gist:1401316
Created November 28, 2011 18:01
calc_jtt
def calc_jtt(start, end, now):
now = now.datetime()
end = end.datetime()
start = start.datetime()
hlen = (end - start).seconds/6.0
tnow = (now - start).seconds
return tnow/hlen
>>> for line in data:
... print "checking", line,
... m = re.search("latitude.*'(.*)'", line)
... if m:
... print m.group(1)
...
checking function geoip_country_code() { return 'RU'; }
checking function geoip_country_name() { return 'Russian Federation'; }
checking function geoip_city() { return 'Moscow'; }
checking function geoip_region() { return '48'; }