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
/* For reference see: | |
* http://www.franken-business.de/galileo-computing/c-von-a-bis-z/022_c_algorithmen_003.htm#mj925248949647af9ef7f16d215f433a8c | |
* http://www.algorithm-code.com/wiki/Insertion_sort#C_Code | |
*/ | |
#include <stdio.h> | |
void insertion_sort(int arr[], int n) { | |
int i, j, x; | |
for (i = 1; i < n; i++) { |
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
# setup.py | |
setup( | |
# [...] | |
version=__import__('example').__version__, | |
# [...] | |
) | |
# example/__init__.py |
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
# file: /etc/event.d/nginx | |
description "Nginx HTTP server" | |
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
exec /usr/sbin/nginx |
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
# Stripped down Nginx config file for example.com | |
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; |
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
/var/log/nginx/*.log { | |
daily | |
missingok | |
rotate 52 | |
compress | |
delaycompress | |
notifempty | |
create 640 root adm | |
sharedscripts | |
postrotate |
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
#!/bin/bash | |
# Usage: $./hs-wlan-login username | |
# Author: Simon Westphahl <[email protected]> | |
# Required (Ubuntu): zenity, libnotify-bin, curl | |
if test -z "$1" | |
then exit | |
else | |
USERNAME=$1 |
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
""" | |
Author: Simon Westphahl <[email protected]> | |
Description: Brute-force implementation for solving the TSP. | |
http://en.wikipedia.org/wiki/Travelling_salesman_problem | |
""" | |
routes = [] | |
def find_paths(node, cities, path, distance): |
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
""" | |
Author: Simon Westphahl <[email protected]> | |
Description: Testing hash distribution for multiplication and modulo. | |
""" | |
from math import sqrt, floor | |
text = "Loraem ipbsum dcolor sdit ameet cosetetur sadpscing eltr seed dgam nosumy eird temdfpor inidunt udft lbore edft dlore mgasdna aquyam eabrat stied dfiam volptua Atat veron eods eukt ascsam ennt jullsto duno dors ehfht eajt rbum Stimet citlla kabsd gbergren notre sklma tkitatta sanlicttus ermist Lopprem isrum dmuolor siast amppet" | |
word_list = text.split() |
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
Server | |
====== | |
Module | |
------ | |
- Login-Thread | |
- Broadcasting-Agent | |
- Client-Thread | |
- Clientliste/Benutzerverwaltung/Rechteabfrage | |
- Tafel + Zugriffsfunktionen |
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
CREATE TABLE disziplinen ( | |
dnr INTEGER CONSTRAINT pk_disziplinen PRIMARY KEY, | |
weltrekord VARCHAR(50), | |
sport_gattung VARCHAR(50), | |
mannschaft INTEGER, | |
bezeichnung VARCHAR(50) | |
); | |
CREATE TABLE wettkaempfe ( | |
wnr INTEGER CONSTRAINT pk_wettkaempfe PRIMARY KEY, |
OlderNewer