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
template<class T> struct NullFunctor { boolean operator()(const std::vector<T>& perm) { return FALSE; } }; | |
//! Iterator to generate all permutations of a list. A functor can be specified for fast culling of entire subtrees of undesired permutations. | |
/** | |
* The permuations are in lexicographic order. ie. {1,2,3} , {1,3,2} , {2,1,3} , {2,3,1} , {3,1,2} , {3,2,1} | |
* The current permutation list can be accessed with the dereference/pointer operators. | |
* | |
* If a functor is provided then undesired subtrees can be culled. The functor must provide this function: | |
* | |
* boolean operator()(const std::vector<T>& perm) |
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
-- By Richard Kulesus, 2009. Released without license! | |
-- Use this for whatever! | |
-- I seriously despise code authors who copyright tiny bits of obvious code | |
-- like it's some great treasure. This is small and simple, and if it saves | |
-- the next guy some time and trouble coding applescript I'll feel good! | |
-- | |
-- Quickly change all the hot-corners to do what you want. | |
-- Particularly useful for presentations and full-screen games. | |
-- Customize the activity of each hot-corner with "all windows/application windows/dashboard/disable screen saver/none/show desktop/show spaces/sleep display/start screen saver" | |
-- The MODIFIERS are the keys which can be used to supplement hot-corner activation. |
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 | |
### BEGIN INIT INFO | |
# Provides: dropbox | |
# Required-Start: $local_fs $remote_fs $network $syslog $named | |
# Required-Stop: $local_fs $remote_fs $network $syslog $named | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# X-Interactive: false | |
# Short-Description: dropbox service | |
### END INIT 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
import java.io.*; | |
/** | |
* Calculates the amount of byte entropy across a window | |
* size, N. The maximum entropy across any window size | |
* is N unless N > 255 in which case the maximum number of | |
* of byte patterns which may exist is 255. | |
* | |
* This program is based on Charlie Daly's Entropy.java | |
* program which does more or less the same thing, but | |
* this program has lower memory requirements allowing |
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
# Orignal version taken from http://www.djangosnippets.org/snippets/186/ | |
# Original author: udfalkso | |
# Modified by: Shwagroo Team and Gun.io | |
import sys | |
import os | |
import re | |
import hotshot, hotshot.stats | |
import tempfile | |
import StringIO |
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/perl | |
use strict; | |
use warnings; | |
(our $Prog) = ($0 =~ m%([^/]+)$%); | |
use Getopt::Long; | |
use File::Slurp; | |
use Net::Amazon::EC2; | |
my $aws_access_key_id_file = $ENV{AWS_ACCESS_KEY_ID}; |
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
import socket | |
def netcat(hostname, port, content): | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
s.connect((hostname, port)) | |
s.sendall(content) | |
s.shutdown(socket.SHUT_WR) | |
while 1: | |
data = s.recv(1024) | |
if data == "": |
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 | |
lame_opts=" --vbr-new -V 2 -B 256 " | |
for x in "${@}" | |
do | |
FLAC=${x} | |
MP3="${FLAC%.flac}.mp3" | |
[ -r "$FLAC" ] || { echo can not read file \"$FLAC\" >&1 ; exit 1 ; } ; |
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
Windows Registry Editor Version 5.00 | |
[HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft] | |
"SPONSORS"="DISABLE" | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft] | |
"SPONSORS"="DISABLE" |
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 runs a configure script with the Android NDK toolchain | |
# You may need to adjust the COMPILE_TARGET and ANDROID_API variables | |
# depending on your requirements. | |
# | |
# Call this script in a directory with a valid configure script. | |
# Example: PREFIX=${PWD}/bin android-configure.sh | |
# Set the ANDROID_NDK variable to the root |
OlderNewer