Skip to content

Instantly share code, notes, and snippets.

View mindjiver's full-sized avatar
🐒
Working from home

Peter Jönsson mindjiver

🐒
Working from home
View GitHub Profile
@mindjiver
mindjiver / u-boot.lds
Created February 13, 2011 21:10
lds-file for mini2440
/*
* (C) Copyright 2002
* Gary Jennejohn, DENX Software Engineering, <gj@denx.de>
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
@mindjiver
mindjiver / sha1.c
Created February 13, 2011 23:18
Lisp!??!
sha1.c:303: error: insn does not satisfy its constraints:
(insn 13 12 14 2 sha1.c:289 (set (reg/f:SI 3 r3 [143])
(reg/f:SI 13 sp)) 174 {*thumb1_movsi_insn_osize} (expr_list:REG_EQUIV (plus:SI (reg/f:SI 13 sp)
(const_int 0 [0x0]))
(nil)))
sha1.c:303: internal compiler error: in reload_cse_simplify_operands, at postreload.c:397
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions.
make[1]: *** [sha1.o] Error 1
@mindjiver
mindjiver / gist:941089
Created April 25, 2011 19:57
Euler - Problem 24
#!/usr/bin/env python
# the number of permutations of a n length list is n!
from itertools import permutations, islice
# recipe from itertools library documentation.
def take(n, iterable):
"Return first n items of the iterable as a list"
return list(islice(iterable, n))
@mindjiver
mindjiver / gist:942888
Created April 26, 2011 19:16
Trappajävel
#!/usr/bin/env python
def f(n):
if n < 0: return 0
if n == 0: return 1
return f(n - 1) + f(n - 2)
for i in range(0, 10):
@mindjiver
mindjiver / gist:949812
Created April 30, 2011 17:11
lördagsnöje
#!/usr/bin/env python
from operator import mul
import sys
# from problem10.py
def sieve_primes(num):
numbers = [True] * num;
@mindjiver
mindjiver / qsort.py
Created June 17, 2011 16:36
Python list comprehesion qsort
def qsort(l):
if len(l) == 0:
return []
if len(l) == 1:
return l
# pick a random pivot
pivot = l[random.randint(0, len(l)-1)]
@mindjiver
mindjiver / gist:1099415
Created July 22, 2011 13:06
Linux 3.0 is here
diff --git a/Makefile b/Makefile
index 60d91f7..6a5bdad 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 0
-EXTRAVERSION = -rc7
+EXTRAVERSION =
@mindjiver
mindjiver / gist:1247874
Created September 28, 2011 13:01
Git branching
master + corr. - 0
|\
| \
0 \
| 0 - stable w/ correction => lsv90
master - 0 |
| 0 - stable
0 /
| /
|/
@mindjiver
mindjiver / gist:1304990
Created October 21, 2011 21:12
E/// Linux kernel committers.
$ git log | egrep -i 'author.*@ericsson.com' | sort -u
Author: Anders Franzen <Anders.Franzen@ericsson.com>
Author: Anders Franzen <anders.franzen@ericsson.com>
Author: Guenter Roeck <guenter.roeck@ericsson.com>
Author: Hans Schillstrom <hans.schillstrom@ericsson.com>
Author: Håkon Løvdal <Hakon.Lovdal@ericsson.com>
Author: Jon Maloy <jon.maloy@ericsson.com>
Author: Jon Paul Maloy <jon.maloy@ericsson.com>
Author: Jonas Sjöquist <jonas.sjoquist@ericsson.com>
Author: Kerstin Jonsson <kerstin.jonsson@ericsson.com>
@mindjiver
mindjiver / Smacker.java
Created January 13, 2012 08:56
Smack API example
/**
*
*/
package se.redsox;
import org.jivesoftware.smack.Connection;
import org.jivesoftware.smack.ConnectionConfiguration;
import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;
import org.jivesoftware.smack.Roster;