Skip to content

Instantly share code, notes, and snippets.

@johnmurrayvi
johnmurrayvi / bst.hpp
Created December 24, 2011 20:41
binary search tree w/ iterators and parent-aware children
#ifndef BST_H
#define BST_H
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <queue>
using namespace std;
template <class TKey>
@johnmurrayvi
johnmurrayvi / 51-android.rules
Last active November 26, 2021 14:41
Udev permission for android devices
## Acer
#SUBSYSTEM=="usb", ATTR{idVendor}=="0502", MODE="0600", OWNER="<username>"
## ASUS
#SUBSYSTEM=="usb", ATTR{idVendor}=="0b05", MODE="0600", OWNER="<username>"
## Dell
#SUBSYSTEM=="usb", ATTR{idVendor}=="413c", MODE="0600", OWNER="<username>"
## Foxconn
@johnmurrayvi
johnmurrayvi / ng-stacktrace
Last active December 18, 2015 13:38
nightingale xul-9 stacktrace
jmurray@jjmvi-AMD-ubuntu:/mnt/git/nightingale/nightingale/compiled/dist$ gdb ././nightingale-bin 9615
GNU gdb (GDB) 7.5.91.20130417-cvs-ubuntu
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
@johnmurrayvi
johnmurrayvi / ng-nspr-log
Created June 16, 2013 06:09
export NSPR_LOG_MODULES=all:3 ; ./nightingale
jmurray@jjmvi-AMD-ubuntu:~/git/nightingale/nightingale/compiled/dist$ export NSPR_LOG_MODULES=all:3 ; ./nightingale
(process:9783): GLib-CRITICAL **: g_slice_set_config: assertion `sys_page_size == 0' failed
nsStringStats
=> mAllocCount: 6
=> mReallocCount: 2
=> mFreeCount: 6
=> mShareCount: 1
=> mAdoptCount: 0
=> mAdoptFreeCount: 0
@johnmurrayvi
johnmurrayvi / ng-backtrace
Created June 16, 2013 20:56
full backtrace of current issues
(gdb) backtrace full
#0 0x00007ffff4e34a5b in nsCOMPtr<nsIObserver>::nsCOMPtr (this=0x7fffffffc838, aRawPtr=0x7fffe0fdb2d0) at ../../../dist/include/nsCOMPtr.h:600
No locals.
#1 0x00007ffff4fb6fdc in PrefCallback::PrefCallback (this=0x7fffffffc810, aDomain=0x7ffff6ba53e0 <sFileOriginPolicyPrefName> "security.fileuri.strict_origin_policy", aObserver=0x7fffe0fdb2d0, aBranch=0x7fffe9648d80)
at /mnt/git/nightingale/deps/xulrunner/mozilla/modules/libpref/src/nsPrefBranch.h:89
No locals.
#2 0x00007ffff4fba089 in nsPrefBranch::RemoveObserver (this=0x7fffe9648d80, aDomain=0x7ffff6ba53e0 <sFileOriginPolicyPrefName> "security.fileuri.strict_origin_policy", aObserver=0x7fffe0fdb2d0)
at /mnt/git/nightingale/deps/xulrunner/mozilla/modules/libpref/src/nsPrefBranch.cpp:634
rv = 0
key = {
@johnmurrayvi
johnmurrayvi / playcount-fail
Created June 24, 2013 00:13
play count increment debugging
***** First track *****
-679024832[7f1fd6060370]: virtual nsresult sbPlaybackHistoryService::OnMediacoreEvent(sbIMediacoreEvent*): sbPlaybackHistoryService[0xb3e0e400] - OnMediacoreEvent
-679024832[7f1fd6060370]: virtual nsresult sbPlaybackHistoryService::OnMediacoreEvent(sbIMediacoreEvent*): +++++ sbIMediacoreEvent: eventType = 16384 [STREAM_BEFORE_START]
-679024832[7f1fd6060370]: virtual nsresult sbPlaybackHistoryService::OnMediacoreEvent(sbIMediacoreEvent*): sbPlaybackHistoryService[0xb3e0e400] - OnMediacoreEvent
-679024832[7f1fd6060370]: virtual nsresult sbPlaybackHistoryService::OnMediacoreEvent(sbIMediacoreEvent*): +++++ sbIMediacoreEvent: eventType = 4096 [METADATA_CHANGE]
***** About to start first track *****
-679024832[7f1fd6060370]: virtual nsresult sbPlaybackHistoryService::OnMediacoreEvent(sbIMediacoreEvent*): sbPlaybackHistoryService[0xb3e0e400] - OnMediacoreEvent
-679024832[7f1fd6060370]: virtual nsresult sbPlaybackHistoryService::OnMediacoreEvent(sbIMediacoreEvent*): +++++ sbIMediacoreEvent: e
@johnmurrayvi
johnmurrayvi / gcc-4.8-pm-fix
Last active December 19, 2015 01:59
patch to fix ng build with gcc 4.8
--- /usr/lib/gcc/x86_64-linux-gnu/4.8/include/mm_malloc.h
+++ /usr/lib/gcc/x86_64-linux-gnu/4.8/include/mm_malloc.h
@@ -32,6 +32,7 @@
extern int posix_memalign (void **, size_t, size_t);
#else
-extern "C" int posix_memalign (void **, size_t, size_t) throw ();
+extern "C" int posix_memalign (void **, size_t, size_t);
#endif
static __inline void *
Changes:
getSkinDescription: function getSkinDescription(internalName) {
+ dump("sbFeathersManager::getSkinDescription(internalName = "+internalName+")\n");
return this._skins[internalName];
},
...
getLayoutDescription: function getLayoutDescription(url) {
@johnmurrayvi
johnmurrayvi / gist:7518743
Created November 17, 2013 21:52
TinyOS Paths
### TinyOS ###
export TOSROOT="/opt/tinyos/tinyos-main"
export TOSDIR="$TOSROOT/tos"
export CLASSPATH=$CLASSPATH:$TOSROOT/support/sdk/java/tinyos.jar:$TOSROOT/support/sdk/java
export MAKERULES="$TOSROOT/support/make/Makerules"
export PYTHONPATH=$PYTHONPATH:$TOSROOT/support/sdk/python
#export MOTECOM="serial@/dev/ttyUSB0:telosb"
0:00:50.801413313 18036 0x7fb584149b50 DEBUG GST_PLUGIN_LOADING gstpluginloader.c:324:plugin_loader_load_and_sync:<registry0> Synchronously loading plugin file /mnt/git/nightingale/sb-trunk-oldxul/compiled/dist/gst-plugins/gstmozilla_d.so
0:00:50.801430251 18036 0x7fb584149b50 DEBUG GST_POLL gstpoll.c:874:gst_poll_fd_ctl_write: 0x7fb57c454230: fd (fd:37, idx:1), active : 1
0:00:50.801440075 18036 0x7fb584149b50 LOG GST_POLL gstpoll.c:888:gst_poll_fd_ctl_write: pfd->events now 60 (POLLOUT:4)
0:00:50.833350322 18036 0x7fb584149b50 DEBUG GST_POLL gstpoll.c:874:gst_poll_fd_ctl_write: 0x7fb57c454230: fd (fd:37, idx:1), active : 1
0:00:50.833367230 18036 0x7fb584149b50 LOG GST_POLL gstpoll.c:888:gst_poll_fd_ctl_write: pfd->events now 60 (POLLOUT:4)
0:00:50.833377414 18036 0x7fb584149b50 DEBUG GST_POLL gstpoll.c:1229:gst_poll_wait: timeout :0:00:01.000000000
0:00:50.833390438 18036 0x7fb584149b50 LOG GST_PLUGIN_LOADING gstpluginloade