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
function magic!(M::Array{Int}, n::Int) | |
# Fast magic square generation | |
# | |
# | |
if n % 2 == 1 | |
# Odd-order magic square | |
# Algorithm: http://en.wikipedia.org/wiki/Magic_square#Method_for_constructing_a_magic_square_of_odd_order | |
# | |
ndiv2 = div(n, 2); | |
for I = 1:n |
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 | |
""" | |
A quick & dirty replacement for dpkg-shlibdeps | |
Written to check if pqiv uses any unnecessary depencencies. dpkg-shlibdeps | |
claims that this was the case and I wanted to check. | |
""" | |
import functools | |
import multiprocessing.pool | |
import os |
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
#!/bin/sh | |
git clone http://cgit.freedesktop.org/xorg/app/xrandr/ || exit 1 | |
cd xrandr || exit 1 | |
for TAG in $(git tag | grep "^xrandr-"); do | |
git reset --hard HEAD | |
git clean -fx | |
git checkout $TAG | |
mv configure.ac configure.ac~ | |
grep -vE "(m4_ifndef|m4_fatal|XORG_MACROS_VERSION)" configure.ac~ > configure.ac |
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
This is a small test environment for autorandr, that can be added as a | |
pre-commit git hook in local copies of the repository. | |
How-to: | |
Run `generate_fixtures.sh` to build all xrandr versions and generate fixtures. | |
Fixtures are a set of two files, FOO.version and FOO.verbose, that are the output | |
of `xrandr -v` and `xrandr --verbose -q`. You can also write more elaborate | |
tests by placing a script into the dynamic/ subfolder. It will be executed instead | |
of xrandr by tests. |
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
diff --git a/libc/dns/net/getaddrinfo.c b/libc/dns/net/getaddrinfo.c | |
index 2612d6a..277afb0 100644 | |
--- a/libc/dns/net/getaddrinfo.c | |
+++ b/libc/dns/net/getaddrinfo.c | |
@@ -80,6 +80,7 @@ | |
#include <fcntl.h> | |
#include <sys/cdefs.h> | |
#include <sys/types.h> | |
+#include <time.h> | |
#include <sys/stat.h> |
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
#!/bin/sh | |
# | |
# This script builds & bundles Python for Android | |
# You'll end up with a tar.bz2 file that contains a Python distribution | |
# | |
# Requires all prerequisites to build Android on the host, and the NDK | |
# installed. | |
# | |
# This script creates a file python4android.tbz2. Unpack it on your device | |
# (into a non-noexec partition!) and enjoy. |
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
diff --git a/autorandr.py b/autorandr.py | |
index 19722c9..6df9d9b 100755 | |
--- a/autorandr.py | |
+++ b/autorandr.py | |
@@ -129,7 +129,8 @@ class XrandrOutput(object): | |
(?P<rotate>(?:normal|left|right|inverted))\s+ # Rotation | |
(?:(?P<reflect>X\ and\ Y|X|Y)\ axis)? # Reflection | |
)? # .. but everything of the above only if the screen is in use. | |
- (?:[\ \t]*\([^\)]+\))(?:\s*[0-9]+mm\sx\s[0-9]+mm)? | |
+ (?:[\ \t]*\([^\)]+\))\s* |
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 <gtk/gtk.h> | |
void main() { | |
GtkTextIter start, end, inspos, tagpos; | |
gsize length; | |
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); | |
GtkTextTag *tag1 = gtk_text_buffer_create_tag(buffer, "tagone", NULL); | |
GtkTextTag *tag2 = gtk_text_buffer_create_tag(buffer, "tagtwo", NULL); |
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
/* compile with | |
gcc -oxcbtest xcbtest.c -lxcb -lxcb-randr -lX11 -lXrandr | |
*/ | |
#include <xcb/xcb.h> | |
#include <xcb/randr.h> | |
#include <X11/extensions/Xrandr.h> | |
#include <X11/Xlibint.h> |
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
/* | |
* This file generated automatically from randr.xml by c_client.py. | |
* Edit at your peril. | |
*/ | |
#ifdef HAVE_CONFIG_H | |
#include "config.h" | |
#endif | |
#include <stdlib.h> | |
#include <string.h> |