Skip to content

Instantly share code, notes, and snippets.

View tpetry's full-sized avatar

Tobias Petry tpetry

View GitHub Profile
var Module = (function() {
var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;
return (
function(Module) {
Module = Module || {};
var f,h,l;var m;m||(m=typeof Module !== 'undefined' ? Module : {});function aa(){}m.setLogger=function(a){aa=a};m.print=function(a){aa(a,"stdout")};m.printErr=function(a){aa(a,"stderr")};var ba={},da;for(da in m)m.hasOwnProperty(da)&&(ba[da]=m[da]);var ea="./this.program";function fa(a,b){throw b;}var ha=!1,ia=!1,ka=!1,la=!1,ma=!1;ha="object"===typeof window;ia="function"===typeof importScripts;
ka=(la="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!ha&&!ia;ma=!ha&&!ka&&!ia;var na="",oa,pa,qa,ra;
if(ka){na=__dirname+"/";var sa,ta;oa=function(a,b){sa||(sa=require("fs"));ta||(ta=require("path"));a=ta.normalize(a);a=sa.readFileSync(a);return b?a:a.toString()};qa=function(a){a=oa(a,!0);a.buffer||(a=new Uint8Array(a));assert(a.buffer);return a};1<process.arg
@tpetry
tpetry / contiki-iar.patch
Created June 16, 2015 12:47
Contiki IAR Workbench v6.x.x patch
diff --git a/cpu/msp430/isr_compat.h b/cpu/msp430/isr_compat.h
index 5d1a2dc..6662b24 100644
--- a/cpu/msp430/isr_compat.h
+++ b/cpu/msp430/isr_compat.h
@@ -67,8 +67,8 @@
#elif defined(__IAR_SYSTEMS_ICC__) && (((__TID__ >> 8) & 0x7f) == 43) && (__VER__ < 200)
/* This is V1.xx of the IAR compiler. */
#define ISR(a,b) interrupt[a ## _VECTOR] void b(void)
-#elif defined(__IAR_SYSTEMS_ICC__) && (((__TID__ >> 8) & 0x7f) == 43) && (__VER__ < 600)
- /* This is V2.xx, V3.xx, V4.xx, V5.xx of the IAR compiler. */
@tpetry
tpetry / PHP-Floatingpoint-Dos.php
Created January 5, 2011 13:07
Example for infinte loop of PHP in FP conversion (PHP-Bug #53632)
<?php
# open PHP-Floatingpoint-Dos.php?num=2.2250738585072011e-308 and PHP will never terminate
if($_GET['num'] > 0) {
echo 'OK';
}
else {
echo 'NOK';
}
<?php
function recursiveCombinatorics($strings, $removed , &$combinations, $recursionLevel, $debug) {
$rec = str_repeat('&nbsp;', 8*$recursionLevel);
foreach($strings as $i => $string) {
if($debug) printf("%srecursiveCombinatorics(strings=array(%s), removed=array(%s), combinations=array(%s))<br>",
$rec,
implode(', ', $strings),
implode(', ', $removed),