Skip to content

Instantly share code, notes, and snippets.

View bovine's full-sized avatar

Jeff Lawson bovine

View GitHub Profile
var http = require('http');
var tcl = require('./nodetcl.node');
var interp = new tcl.NodeTcl();
interp.eval("package require flightaware");
interp.eval("package require flightaware-core");
interp.eval("set startTime [clock seconds]");
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
#!/usr/bin/tclsh8.5
package require speedtable
speedtables Animinfo 1.1 {
table animation_characters {
varstring name indexed 1 unique 0
varstring home
varstring show indexed 1 unique 0
varstring dad
@bovine
bovine / web-skins-classic-views-options.php.diff
Created April 1, 2012 06:23
Zoneminder 1.25.0 patch: display configuration help in a tooltip or alert box rather than a new window. make configuration radio buttons easier to click by using labels.
--- web/skins/classic/views/options.php (revision 3648)
+++ web/skins/classic/views/options.php (working copy)
@@ -211,10 +211,13 @@
{
$shortName = preg_replace( '/^ZM_/', '', $name );
$optionPromptText = !empty($OLANG[$shortName])?$OLANG[$shortName]:$value['Prompt'];
+
+ $optionHelpText = !empty($OLANG[$shortName])?$OLANG[$shortName]:$config[$name]['Help'];
+ $optionHelpText = preg_replace( "/~~/", "\n", $optionHelpText );
?>
#include <boost/interprocess/managed_mapped_file.hpp>
#include <boost/interprocess/managed_shared_memory.hpp>
#include <boost/interprocess/allocators/allocator.hpp>
#include <boost/interprocess/containers/string.hpp>
#include <boost/flyweight.hpp>
#include <boost/flyweight/no_tracking.hpp>
#include <boost/flyweight/hashed_factory.hpp>
using namespace boost::flyweights;
using namespace boost::container;
diff -uwr mod_rivet.orig/Makefile mod_rivet/Makefile
--- mod_rivet.orig/Makefile 2014-03-12 18:03:28.000000000 -0500
+++ mod_rivet/Makefile 2014-03-12 18:03:52.000000000 -0500
@@ -16,7 +16,7 @@
LIB_DEPENDS= libitcl.so:${PORTSDIR}/lang/itcl
USE_APACHE= 22+
-USE_AUTOTOOLS= aclocal automake libtool libtoolize
+USE_AUTOTOOLS= aclocal libtool libtoolize autoheader automake autoconf
USE_LDCONFIG= ${PREFIX}/lib/rivet
@bovine
bovine / gist:15c350d044325a93d5cb
Created July 15, 2015 22:25
memory leak in tcl 8.6.4
#!/usr/local/bin/tclsh
proc doit {newkey} {
global myarray
global clocknow
# store a new value into the array
set myarray($newkey) $clocknow
#!/usr/local/bin/tclsh8.6
package require http
package require autoproxy
package require tls
proc init1 {} {
set http_proxy_host "proxy"
@bovine
bovine / tpool_nowait_bug.tcl
Created November 11, 2016 17:11
tpool::post -nowait does not ever create more than 1 worker thread
#!/usr/local/bin/tclsh
package require Thread
set threadstart {
puts "thread started"
tsv::incr sharedData threadCount
}
@bovine
bovine / tpool_threxit_bug1.tcl
Created November 11, 2016 18:17
tpool::release hangs if any of the thread pool's workers have exited
#!/usr/local/bin/tclsh
package require Thread
# initialize the thread pool
set mypool [tpool::create -minworkers 1 -maxworkers 5]
# queue up something that exits the thread
tpool::post $mypool "puts \"hello\"; thread::exit"
@bovine
bovine / tpool_threxit_bug2.tcl
Created November 11, 2016 18:20
tpool::post hangs if the maximum number of workers has already been reached, but they have all exited already
#!/usr/local/bin/tclsh
package require Thread
# initialize the thread pool
set mypool [tpool::create -minworkers 1 -maxworkers 5]
# queue up something that exits the thread.
# this will be unable to process more than 5 events because all of the workers have gone away.
for {set i 0} {$i < 10} {incr i} {