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
#!/usr/bin/env python | |
import re, urllib.request, sys | |
from html.parser import HTMLParser | |
from urllib.error import HTTPError,URLError | |
class TableHTMLParser(HTMLParser): | |
def __init__(self): | |
super(TableHTMLParser,self).__init__() | |
self.__interest = False | |
self.__lastday = "Montag" |
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
#!/usr/bin/env python | |
import sqlite3, unittest | |
class KittehDB: | |
def __init__(self,path): | |
""" | |
Creates database at specified path | |
""" | |
print("Creating Database") |
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
#!/usr/bin/env python | |
import os, sys, time | |
def find_next_free_x_display(max_tries = 10): | |
""" | |
Find the next free X Display by | |
investigating the Xlocks in /tmp | |
""" | |
for i in range(max_tries): |
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
#!/usr/bin/env python | |
import os, sys, time | |
def find_next_free_x_display(max_tries = 10): | |
""" | |
Find the next free X Display by | |
investigating the Xlocks in /tmp | |
""" | |
for i in range(max_tries): |
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
#!/usr/bin/env python | |
import os, sys | |
def find_next_free_x_display(max_tries = 10): | |
""" | |
Find the next free X Display by | |
investigating the Xlocks in /tmp | |
""" | |
for i in range(max_tries): |
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
#!/usr/bin/python | |
def find_next_free_x_display(): | |
for i in range(10): | |
try_path = "/tmp/.X" + str(i) + "-lock" | |
try: | |
with open(try_path,"r"): | |
print("-- " + str(i) + " is there") | |
except: | |
return i |
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
// g++ MemPool.cc $(pkg-config --libs --cflags glib-2.0) -Wall -Wextra -pedantic | |
#include <glib.h> | |
#include <algorithm> | |
template<class StorageClass> | |
class UseMemPool | |
{ | |
public: | |
void * operator new(size_t size) |
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 <fts.h> | |
#include <glib.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/stat.h> | |
typedef struct | |
{ | |
char * path; |
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 <glyr/glyr.h> | |
#include <glyr/cache.h> | |
#include <glib.h> | |
#include <stdlib.h> | |
void do_insert(GlyrQuery * q, GlyrDatabase * db, char * artist, char * album, char * title) | |
{ | |
glyr_query_init(q); | |
glyr_opt_artist(q,artist); | |
glyr_opt_album(q,album); |
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 <pthread.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
/* Stupid implementation of C semaphores with pthreads. | |
* Used as mutex for counting a variable below. | |
* | |
* compile with: | |
* | |
* cc semaphor.c -o sam -lpthread -Wall -Wextra -std=c99 -Os |