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
/* Batcher odd-even mergesort: http://en.wikipedia.org/wiki/Batcher_odd-even_mergesort */ | |
/* O(n * (log n) * (log n)): inplace, and could run in O( (log n) * (log n) ) on n cores in parallel */ | |
/* Most implemenations only handle power-of-two input sizes; this implementation | |
appends "virtual" infinity items at the end of input (takes no space) */ | |
#include <vector> | |
#include <cassert> |
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
/* | |
Torrent Announce Info extractor | |
lists all announce urls from torrents on stdout | |
Build with ragel (http://www.complang.org/ragel/) and a c compiler: | |
ragel -T1 torrent-announce-info.rl && CFLAGS='-O2' make torrent-announce-info | |
list torrent files on stdin: | |
ls -1 /path/to/torrents/*.torrent | torrent-announce-info |
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
override LDFLAGS += -lssl -lpcrecpp | |
override CPPFLAGS += -O2 -Wall | |
all: torrent-sanitize | |
clean: | |
rm torrent-sanitize | |
.PHONY: all clean |
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/bash | |
IPKG=$1 | |
FILENAME=$(basename "$IPKG") | |
X=$FILENAME | |
PACKAGE=${X%%_*} | |
X=${X#*_} | |
VERSION=${X%%_*} | |
X=${X#*_} |
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
/* wait for "this" future to reach this point, run "inner" in background; copy result from "inner" future */ | |
Future.prototype.nest = function(inner) { | |
var succ, result, exc, wait = 2, f = this; | |
this.then(function () { | |
f.exception; | |
if (0 == --wait) { if (succ) f.result = result; else f.exception = exc; } | |
}); | |
inner.then(function (future) { | |
if (future.exception) { succ = false; exc = future.exception; } else { succ = true; result = future.result; } | |
if (0 == --wait) { if (succ) f.result = result; else f.exception = exc; } |
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 ruby | |
require 'optparse' | |
require 'tmpdir' | |
require 'json' | |
require 'fileutils' | |
require 'zlib' | |
require 'rubygems' rescue nil | |
require 'libarchive' |
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
<?php | |
global $token; | |
/* Insert real token data to use search/app details | |
luna-send -n 1 palm://com.palm.accountservices/getAccountToken '{}' | |
luna-send -n 1 palm://com.palm.deviceprofile/getDeviceId '{}' | |
luna-send -n 1 palm://com.palm.preferences/systemProperties/Get '{"key":"com.palm.properties.DMCARRIER"}' | |
*/ | |
$token = array( |
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
git = { | |
docroot "/home/gitosis/repositories"; | |
mime_types ( | |
# css for cgit | |
".css" => "text/css; charset=utf-8", | |
# git mime types, default for objects files | |
"HEAD" => "text/plain", | |
"alternates" => "text/plain", |
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
NAME = PDK | |
TITLE = PDK | |
APP_ID = org.webosinternals.toolchain.${NAME} | |
VERSION = 1.0-1 | |
MAINTAINER = WebOS Internals <[email protected]> | |
.PHONY: package | |
package: build/.built-${VERSION} | |
.PHONY: stage |
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++ -O3 -Wall `pkg-config --cflags --libs glib-2.0` cppallocs.cpp -o cppallocs | |
#include <new> | |
#include <glib.h> | |
#include <sys/mman.h> | |
// Use different allocators depending on size, so we need to remember the size | |
// One could add other members,like some magic data to check the allocs/frees |
OlderNewer