Skip to content

Instantly share code, notes, and snippets.

View ashgti's full-sized avatar

John Harrison ashgti

View GitHub Profile
a = foo()
a.bar = 123 # default
with a:
a.bar = 13213
a.do_stuff()
with a:
a.bar = 5432
a.do_stuff()
cc1plus: warning: -Wuninitialized is not supported without -O
In file included from /Users/harjohn/Projects/serial/src/serial.cc:4:
/Users/harjohn/Projects/serial/include/serial/serial.h:610: warning: ‘class serial::SerialExecption’ has pointer data members
/Users/harjohn/Projects/serial/include/serial/serial.h:610: warning: but does not override ‘serial::SerialExecption(const serial::SerialExecption&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:610: warning: or ‘operator=(const serial::SerialExecption&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:624: warning: ‘class serial::IOException’ has pointer data members
/Users/harjohn/Projects/serial/include/serial/serial.h:624: warning: but does not override ‘serial::IOException(const serial::IOException&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:624: warning: or ‘operator=(const serial::IOException&)’
/Users/harjohn/Projects/serial/include/serial/serial.h:651: warning: ‘class serial::PortNotOpenedException’ has pointe
@ashgti
ashgti / Output
Created April 4, 2012 17:02
C++ Templates with default params
Type is... int
Type is... char
Type is... float
Type is... double
Type is... long
Type is... short
Type is... int
Type is... double
@ashgti
ashgti / Error Msgs
Created March 17, 2012 02:49
Rustc build failure
Stack dump:
0. Running pass 'Function Pass Manager' on module 'core.rc'.
1. Running pass 'Greedy Register Allocator' on function '@_ZN7unicode16derived_property10Alphabetic17_fa1eb4cef144b687E'
/bin/sh: line 1: 78747 Illegal instruction: 4 x86_64-apple-darwin/stage1/bin/rustc -O --target=x86_64-apple-darwin --enforce-mut-vars -o x86_64-apple-darwin/stage1/lib/rustc/x86_64-apple-darwin/lib/libcore.dylib src/libcore/core.rc
make: *** [x86_64-apple-darwin/stage1/lib/rustc/x86_64-apple-darwin/lib/libcore.dylib] Error 132
$ avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:UNO-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m
avrdude: stk500v2_recv_mk2: error in USB receive
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00s
avrdude: Device signature = 0xffffff
avrdude: Yikes! Invalid device signature.
iface foo<A> {
fn bar(a: A, b: A);
}
impl of foo<int> for int {
fn bar(a: int) {
// bad.
}
}
@ashgti
ashgti / Simple Repeater
Created January 28, 2012 20:04
A simple arduino setup to test a xbee
#include <SoftwareSerial.h>
SoftwareSerial xbee(2,3);
void setup() {
Serial.begin(9600);
xbee.begin(9600);
}
void loop() {
97.548% in __select()
01.442% in read()
#include <string>
#include <iostream>
using std::string;
using std::cout;
using std::endl;
void foo(string &foo) {
foo += "hello";
}
diff -r a37008dd3341 ogre_tools_qt/CMakeLists.txt
--- a/ogre_tools_qt/CMakeLists.txt Thu Dec 15 17:29:28 2011 -0800
+++ b/ogre_tools_qt/CMakeLists.txt Fri Dec 16 00:55:18 2011 -0600
@@ -40,12 +40,6 @@
set(X11_LIBS ${X11_LIBRARIES})
endif(UNIX AND NOT APPLE)
-if(APPLE)
- include_directories(/usr/X11/include)
- link_directories(/usr/X11/lib)