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 | |
SDK=`dirname $0` | |
SCRIPT=`basename $0` | |
SDKPARENT=`dirname $SDK` | |
PLATFORM=`uname -sp` | |
if [ "$PLATFORM" = "Darwin i386" -o "$PLATFORM" = "Darwin x86_64" ]; then | |
echo "iPhone Toolchain installer script by rpetrich" | |
echo "" |
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 DeleteArrayElements( array, index, count ) | |
-- Deletes one or more (count) array elements from the specified index. | |
-- Returns an undo function, which if called would revert the operation. | |
local deletedElements = {} | |
assert( index >= 1 and index <= #array, "index=" .. index .. " must be >= 1 and <= " .. #array .. " (#array)" ) | |
assert( count >= 1 and count <= #array - index + 1, "count=" .. count .. " must be >= 1 and <= " .. #array - index + 1 .. " (#array - index + 1) where #array=" .. #array .. " and index=" .. index) | |
for i = 0, count - 1 do |
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
/** | |
* On my CentOS 5 system this application sent the first 3000 messages | |
* with a running memory footprint less than 7 MB. In a few minutes, it | |
* leveled out at 18MB. Based on the sending rate, the maximum data rate | |
* out of this process should be less than 75kbps -- well below the | |
* ZMQ_RATE of 10Mbps. While there doesn't seem to be a long-term leak, | |
* the fact that this application does the first 3000 sends with a memory | |
* footprint far less than it's terminal value is concerning. | |
* | |
* If I change nothing other than the ZMQ_RATE value and change it to |
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
local function out_of_range(i,n) | |
if type(i) == 'number' then | |
if i > 0 and i <= n then return true | |
else error('out of range',3) | |
end | |
else | |
error 'cannot index array by non-number type' | |
end | |
end |
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/win32/win32.c b/win32/win32.c | |
index 6366d92..4e52d7b 100644 | |
--- a/win32/win32.c | |
+++ b/win32/win32.c | |
@@ -4115,39 +4115,62 @@ winnt_stat(const WCHAR *path, struct stati64 *st) | |
{ | |
HANDLE h; | |
WIN32_FIND_DATAW wfd; | |
+ WIN32_FILE_ATTRIBUTE_DATA wfa; | |
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
// | |
// main.m | |
// ProtectTest | |
// Demonstrates newer versions of iOS now support PROT_EXEC pages, for just-in-time compilation. | |
// | |
// Must be compiled with Thumb disabled | |
// | |
// Created by Stuart Carnie on 3/4/11. | |
// Copyright 2011 Manomio LLC. All rights reserved. | |
// |
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: OpenPdfToSection | |
function! OpenPdfToSection() | |
let g:my_section = substitute(getline(search('\\\(sub\)\?section', 'bn')), '\\\%(sub\)\?section{\([^}]\+\)}', '\1', '') | |
" some weird trailing space can appear, remove them | |
let g:my_section = substitute(g:my_section, "^ *", "", "g") | |
let g:Tex_ViewRuleComplete_pdf = 'mupdf -f "'.g:my_section.'" -r 102 $*.pdf' | |
call Tex_ViewLaTeX() | |
" reinitialize the variable to keep <leader>lv working | |
let g:Tex_ViewRuleComplete_pdf = 'mupdf -r 102 $*.pdf' | |
endfunction |
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
/** from http://www.reddit.com/r/programming/comments/mlbna/scala_feels_like_ejb_2/c31z0co */ | |
interface Pong<T> {} | |
class Ping<T> implements Pong<Pong<? super Ping<Ping<T>>>> { | |
static void Ping() { | |
Pong<? super Ping<Long>> Ping = new Ping<Long>(); | |
} | |
} | |
> javac Ping.java |
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
-- Something like (ZeroMQ in this case) | |
return { | |
typedefs = { | |
functions = { | |
zmq_free_fn = { "void", "data", "hint" }, | |
}, | |
structs = { | |
zmq_pollitem_t = "zmq_pollitem_t" | |
}, |
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
----------------- | |
-- Microlight - a very compact Lua utilities module | |
-- | |
-- Steve Donovan, 2012; License MIT | |
-- @module ml | |
local ml = {} | |
--- String utilties. | |
-- @section string |
OlderNewer