This file contains 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
typedef int (* cmpfn)(const void *a, const void *b); | |
/* interface */ | |
void quicksort(void *pbase, size_t start, size_t end, size_t size, | |
cmpfn compare); | |
/* implementation */ | |
void __insertion_sort(void *pbase, char *start, char *end, size_t size, | |
cmpfn compare) |
This file contains 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
#define CLRBIT(x, m, n) ({ \ | |
unsigned long __mask = ~0U; \ | |
__mask &= ~0U << (n); \ | |
__mask |= ~0U >> (sizeof(unsigned long) * 8 - (m)); \ | |
(x) &= __mask; \ | |
}) |
This file contains 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
/* | |
_oo0oo_ | |
o8888888o | |
88" . "88 | |
(| -_- |) | |
0\ = /0 | |
____/'---'\____ | |
.' \\| |// '. | |
/ \\||| : |||// \ |
This file contains 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 re | |
re.findall(r"(?<=[\[])[^\[^\]]*(?=[\]])", "xxx[0xdeadbeef]yyy[aa]a") | |
# ['0xdeadbeef', 'aa'] | |
re.findall(r"(?<=[\[])[^\[^\]]*(?=[\]])", "xxx[0xdeadbeef][aa]a") | |
# ['0xdeadbeef', 'aa'] |
This file contains 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 re | |
import urllib | |
from HTMLParser import HTMLParser | |
# configure area | |
# set search keyword and format | |
keyword_list = ['blacklist', 'Marvels Agents of S.H.I.E.L.D.'] | |
fmt_list = ['WEB-DL', '720P', '1080P'] |
This file contains 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 re | |
import urllib | |
from HTMLParser import HTMLParser | |
# configure area | |
# set search keyword and format | |
# { 'name' : [episode_list] } | |
keyword_list = {'blacklist':[8], 'Marvels Agents of S.H.I.E.L.D.':[6]} | |
# fmt should be one of following: "MP4","WEB-DL","HDTV","1080P","720P" |
This file contains 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
--- lcd-omap3.c.original 2011-10-12 09:37:09.499884033 +0200 | |
+++ lcd-omap3.c 2011-10-13 12:34:58.367997951 +0200 | |
@@ -334,6 +334,124 @@ | |
static void configure_dss_beagleboard(l4_addr_t frame_buffer) | |
{ | |
+ /* begin extra dss init patch */ | |
+ | |
+ // NOTICE: | |
+ // This patch has been tested only on revision C4 boards, |
This file contains 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
/* --(.'w'.)-( .'w')-( )-( )-('w'. )-(.'w'.)-( .'w')-( )-( )-('w'. )-(.'w'.)-- */ |
This file contains 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
extern "C" void _exit(int code) __attribute__ ((__noreturn__, __weak__)); | |
void _exit(int code) | |
{ | |
L4Re::Env const *e; | |
if (l4re_global_env && (e = L4Re::Env::env()) && e->parent().is_valid()) | |
e->parent()->signal(0, code); | |
for (;;) | |
l4_ipc_sleep(L4_IPC_NEVER); | |
} |
This file contains 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
EXTERN_C void *pthread_fn(void *data) | |
{ | |
Romain::App_thread *t = (Romain::App_thread*)data; | |
l4_cap_idx_t cap = (l4_cap_idx_t)pthread_getl4cap(pthread_self()); | |
t->vcpu_cap(L4::Cap<L4::Thread>(cap)); | |
/* | |
* Thread creation and config. | |
*/ |
OlderNewer