Skip to content

Instantly share code, notes, and snippets.

View PeterJohnson's full-sized avatar

Peter Johnson PeterJohnson

  • Pasadena, California
View GitHub Profile
#0 0x00000000 in ?? ()
#1 0x001f8578 in std::_Function_base::~_Function_base (this=0x456a24,
__in_chrg=<optimized out>)
at /usr/arm-frc-linux-gnueabi/include/c++/4.8.2/functional:2030
#2 0x0021f420 in std::function<void ()>::~function() (this=0x456a24,
__in_chrg=<optimized out>)
at /usr/arm-frc-linux-gnueabi/include/c++/4.8.2/functional:2174
#3 0x002875f4 in Notifier::~Notifier (this=0x4569e0, __in_chrg=<optimized out>)
at /home/peter/project/frc/allwpilib/wpilibc/athena/src/Notifier.cpp:32
#4 0x002bdb4c in __gnu_cxx::new_allocator<Notifier>::destroy<Notifier> (this=0x4569dc,
import edu.wpi.first.wpilibj.networktables.*;
import edu.wpi.first.wpilibj.tables.*;
public class Listener {
private static class MyListener implements ITableListener {
public void valueChanged(ITable source, String key, Object value, boolean isNew) {
System.out.println("value changed: " + key + " isNew=" + isNew);
}
}
public static void main(String[] args) {
@PeterJohnson
PeterJohnson / .clang-format
Created January 2, 2016 18:01
clang-format for ntcore and wpilib
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: true
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
#include <chrono>
#include <cstdio>
#include <thread>
#include "ntcore.h"
int main() {
nt::StartServer("persistent2.ini", "", 10000);
std::this_thread::sleep_for(std::chrono::seconds(1));
nt::DeleteAllEntries();
@PeterJohnson
PeterJohnson / detect_requirements_package.sh.patch
Created August 29, 2015 00:29
Patch to fix package creation for fglrx-14.502.1040
--- a/detect_requirements_package.sh 2015-08-03 10:13:42.000000000 -0700
+++ b/detect_requirements_package.sh 2015-08-24 22:40:41.352391977 -0700
@@ -100,7 +100,7 @@
distro="RHEL"
fi
-if [ $distro="SuSE" -o $distro="RHEL" ];
+if [ "$distro" = "SuSE" -o "$distro" = "RHEL" ];
then
@PeterJohnson
PeterJohnson / roster-migrate-v1v2.py
Created September 8, 2011 04:25
roster v1 to v2 database conversion
#!/usr/bin/env python
import os
import json
if __name__ == "__main__":
import sys
print "Importing json..."
data = json.load(open(sys.argv[1]))
print "Mapping person..."