Skip to content

Instantly share code, notes, and snippets.

def try_shit(flist1, flist2):
ideal1 = flist1*R
ideal2 = flist2*R
expected = ideal1.intersection(ideal2).groebner_basis()
actual_ideal = [f.lcm(g) for f in flist1 for g in flist2]*R
actual = actual_ideal.groebner_basis()
return (expected == actual, expected, actual, flist1, flist2)
for powx1 in xrange(3):
for powx2 in xrange(3):
#!/usr/bin/env python
# -*- coding: utf-8 -*- #
THEME = './theme'
YEAR_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/index.html'
MONTH_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/{date:%m}/index.html'
ARTICLE_URL = 'posts/{date:%Y}/{date:%m}/{slug}.html'
ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%m}/{slug}.html'
ARTICLE_LANG_URL = 'posts/{date:%Y}/{date:%m}/{slug}-{lang}.html'
import re
import string
def yell_at_problem(willie, trigger):
if not trigger.admin:
willie.reply("DO NOT DISCUSS PROBLEMS IN CHANNEL. If you need help, pm an op by doing '/query tylerni7' (or another op).")
yell_at_problem.rule = '.*(answer|problem).*'
yell_at_problem.rate = 60
yell_at_problem.name = 'yell_at_problem'
import re
import string
regex_string = '.*(dark ?star|black ?hole|location|darkstar|php ?[1-4]|solution|core ?dump|spam ?carver|bitwise|get ?key|robomunication|format ?[1-2]|rop ?[1-4]|ever ?green|more ?evil|mildly ?evil|overflow ?[1-5]|clue|eval ?[1-5]|broken rsa|grep is your friend).*'
yell_string = "DO NOT DISCUSS PROBLEMS IN CHANNEL. If you need help, pm an op by doing '/query tylerni7' (or another op). Ops have an @ in front of their names."
good_guys = {'ajaska`': True, 'Feynman': True, 'rcombs': True, 'wizjany': True}
def good_guy(willie, trigger):
global good_guys
if trigger.admin:
@awreece
awreece / gist:5486514
Last active December 16, 2015 19:39
Sucks to be ethan
top - 23:57:09 up 23 days, 5:13, 9 users, load average: 4.14, 1.67, 0.72
Tasks: 265 total, 10 running, 254 sleeping, 1 stopped, 0 zombie
Cpu(s): 99.4%us, 0.6%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 66110592k total, 14748744k used, 51361848k free, 2440864k buffers
Swap: 6377464k total, 2252k used, 6375212k free, 9141156k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
26481 areece 20 0 322m 33m 6716 R 100 0.1 0:23.46 demo
26493 areece 20 0 350m 62m 6228 R 100 0.1 0:23.43 demo
26503 areece 20 0 327m 38m 6312 R 100 0.1 0:22.93 demo
ppp@shell:~$ gdb -q a.out
Reading symbols from /home/ppp/a.out...(no debugging symbols found)...done.
(gdb) b main
Breakpoint 1 at 0x8048467
(gdb) r
Starting program: /home/ppp/a.out
Breakpoint 1, 0x08048467 in main ()
(gdb) p system
$1 = {<text variable, no debug info>} 0xf7e68250 <system>
$ cat print_buf.c
#include <stdio.h>
int main(int argc, char** argv, char** envp) {
char buf[100];
printf("Stack at %p\n", buf);
int i;
for (i = 0; envp[i]; i++) {
printf("%p: %s\n", envp[i], envp[i]);
areece-macbook-pro:ec2 areece$ comm -2 -3 <(for dir in $(ls havlak); do echo havlak/$dir/$dir.json; echo steensgard/$dir/$dir.json; echo sreedhar/$dir/$dir.json; done | sort) <(ls */*/*.json | sort)
havlak/aptitude-curses/aptitude-curses.json
havlak/ekiga/ekiga.json
havlak/inkscape/inkscape.json
havlak/inkview/inkview.json
havlak/sha384sum/sha384sum.json
havlak/sha512sum/sha512sum.json
havlak/traceroute.db/traceroute.db.json
havlak/traceroute6.db/traceroute6.db.json
sreedhar/aptitude-curses/aptitude-curses.json
$ cat sorted.dat
apropos comma havlak c2d172e0c8bbd847bf8731fd5588a517
apropos comma sreedhar c2d172e0c8bbd847bf8731fd5588a517
apropos comma steensgard c2d172e0c8bbd847bf8731fd5588a517
apropos command_arg sreedhar 7ed3d61b122861a1fb56138903e92a08
apropos command_arg steensgard 7ed3d61b122861a1fb56138903e92a08
apropos command_args sreedhar b7b7ea492a1363c3952832612f255732
apropos command_args steensgard b7b7ea492a1363c3952832612f255732
apropos command_argstr havlak 264318c01a88625a7b07be5770cf28d0
apropos command_argstr sreedhar 264318c01a88625a7b07be5770cf28d0
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <sys/time.h>
// #include <smmintrin.h>
// #include <emmintrin.h>
#define SAMPLES 5
#define SIZE (1024*1024*1024)