Skip to content

Instantly share code, notes, and snippets.

View drbobbeaty's full-sized avatar

Bob Beaty drbobbeaty

View GitHub Profile
@drbobbeaty
drbobbeaty / caveatPatchor.js
Created September 20, 2012 14:52
Place in ~/L/AS/Propane/unsupported/ for CSS customization
var MD5 = function (string) {
function RotateLeft(lValue, iShiftBits) {
return (lValue<<iShiftBits) | (lValue>>>(32-iShiftBits));
}
function AddUnsigned(lX,lY) {
var lX4,lY4,lX8,lY8,lResult;
lX8 = (lX & 0x80000000);
lY8 = (lY & 0x80000000);
@drbobbeaty
drbobbeaty / udp_receiver.cpp
Created May 26, 2012 15:41
DKit UDP Receiver Sample Usage
/**
* This is the tests for the udp_receiver
*/
// System Headers
#include <iostream>
#include <string>
// Third-Party Headers
// Other Headers
@drbobbeaty
drbobbeaty / gist:1893270
Created February 23, 2012 15:19
UDP Multicast Listening Code
/**
* This method is the "no lock" version of the listen() method because
* sometimes it needs to be called from within a lock on the
* connections map, and we need to have something like this available.
*/
bool UDPReceiver::listen_nl( const MulticastChannel & aChannel )
{
bool error = false;
// make sure there's something logical to do...
@drbobbeaty
drbobbeaty / gist:1816316
Created February 13, 2012 11:59
Sparse, Banded Matrix Solution using Mac OS X cLAPACK
- (BOOL) simulateWorkspace
/*"
** This method will take the existing workspace with all the objects placed
** on it and simulate it for the potential at each simulation grid point.
** This needs to be done before you can get any values out of the workspace,
** but that's pretty obvious if you think about it.
"*/
{
BOOL error = NO;
@drbobbeaty
drbobbeaty / gist:1016785
Created June 9, 2011 14:03
Little Script to Start SSHAgent for SSH Logins
#!/bin/tcsh
##
# Start SSH Key Agent
##
if (`where ssh-agent` != "") then
#
# See if there's already a running copy of ssh-agent
#
set proc=`ps -aux | grep 'ssh-agent' | grep -v grep`
if ($%proc >= 10) then
@drbobbeaty
drbobbeaty / GDB backtrace of crash
Created April 5, 2011 15:31
Seg Fault in ZeroMQ 2.1.4 on zmq_msg_size()
(gdb) bt
#0 zmq_msg_size (msg_=0x16e53c68) at zmq.cpp:208
#1 0x00002b84d9f5de3b in zmq::encoder_t::message_ready (this=0x16e53c20) at encoder.cpp:68
#2 0x00002b84d9f65ffb in zmq::encoder_base_t<zmq::encoder_t>::get_data (this=0x16e53c00) at encoder.hpp:80
#3 zmq::pgm_sender_t::out_event (this=0x16e53c00) at pgm_sender.cpp:165
#4 0x00002b84d9f62c66 in zmq::object_t::process_command (this=0x15996360, cmd_=...) at object.cpp:63
#5 0x00002b84d9f5fafc in zmq::io_thread_t::in_event (this=<value optimized out>) at io_thread.cpp:83
#6 0x00002b84d9f5e3a2 in zmq::epoll_t::loop (this=0x237bb40) at epoll.cpp:161
#7 0x00002b84d9f73c46 in thread_routine (arg_=0x237bbb0) at thread.cpp:71
#8 0x00002b84da9f39ca in start_thread () from /lib/libpthread.so.0
@drbobbeaty
drbobbeaty / Results
Created March 23, 2011 20:59
Test of std::map Iterator invalidation on Ubuntu 10.04.1
$ g++ maptest.cpp -o maptest
$ maptest
got :
next: 11111
$
@drbobbeaty
drbobbeaty / Explanation?
Created March 22, 2011 13:01
Core Dump for ZeroMQ 2.1.3 with OpenPGM (epgm)
If the core dump is right, the value of minor_bucket is 0x27c38b0 - and the check in the code is for it not being NULL. Seems to me to be next to impossible to have this be the case.
@drbobbeaty
drbobbeaty / gist:869313
Created March 14, 2011 15:28
C++ version of the Erlang Ring from Chapter 8 of Armstrong
/**
* ring.cpp - this is the C++ equivalent of the Armstrong Chapter 8
* exercise where you are supposed to make a ring of 'n'
* objects and have one fire another for a total of 'm' laps.
*/
// System Headers
#include <stdint.h>
#include <iostream>
#include <sys/time.h>
@drbobbeaty
drbobbeaty / gist:853122
Created March 3, 2011 17:15
Erlang Ring Benchmark from Erlang book by J Armstrong (Chapter 8 Exercises)
-module(ring).
-export([start/0, test/2]).
%% make the state container for the ring node
-record(state, {next, origin, caller}).
%% standard entry point for a 1000 node, 500 cycle test
start() ->
test(1000, 500).