Skip to content

Instantly share code, notes, and snippets.

@vo
vo / StopWatch.java
Created November 4, 2010 10:08
A Simple Multiple-Stopwatch Application
// StopWatch
// Simple multiple-stopwatch application
// Author: Christopher Vo (cvo1@cs.gmu.edu)
public class StopWatch extends javax.swing.JFrame {
private static final long serialVersionUID = -7040646868513878300L;
private static int numTimers = 5;
public StopWatch() {
// make main window
@vo
vo / README.md
Last active January 14, 2024 23:31
Creating Custom Mavlink Message

Creating a Custom Mavlink Message

Download the Mavlink Toolchain

git clone https://github.com/mavlink/mavlink.git

Create a message defintion

Create a file named custom.xml with these contents:

@vo
vo / Makefile
Created October 16, 2012 13:36
CUDA Vector Add Example
NVCC = /usr/local/cuda/bin/nvcc
all: vecadd
%.o : %.cu
$(NVCC) -c $< -o $@
vecadd : vecadd.o
$(NVCC) $^ -o $@
@vo
vo / gist:9331349
Last active February 13, 2023 13:22
Simple Mavlink Reader in Python using pymavlink
#!/usr/bin/env python
import sys, os
from optparse import OptionParser
# tell python where to find mavlink so we can import it
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../mavlink'))
from pymavlink import mavutil
def handle_heartbeat(msg):
#!/usr/bin/env python
####
#
# Usage:
# ./add_var.py [key] [value]
#
####
import re
@vo
vo / SimpleSolver.java
Created April 24, 2012 17:28
Simple cryptarithmetic puzzle solver in Java, C, and Python
public class SimpleSolver {
static int eval(String q) {
int val = 0;
java.util.StringTokenizer st = new java.util.StringTokenizer(q, "*/+-", true);
while (st.hasMoreTokens()) {
String next = st.nextToken().trim();
if (next.equals("+")) {
val += Integer.parseInt(st.nextToken().trim());
} else if (next.equals("-")) {
val -= Integer.parseInt(st.nextToken().trim());
@vo
vo / index.html
Created February 24, 2017 15:02
simple streaming of video from gstreamer to WebM / VP8 / HTML5 in chrome
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>gstreamer video example</title>
</head>
<body>
<video width=640 height=480 autoplay>
<source src="http://localhost:8080">
</video>
@vo
vo / listener.py
Created March 5, 2014 07:02
Quick hack to position hold with MAVLink using external webcam
#!/usr/bin/env python
import sys, os, socket, pickle
from time import time
from optparse import OptionParser
UDP_IP = "127.0.0.1"
UDP_PORT = 31200
# tell python where to find mavlink so we can import it
@vo
vo / override_rc.py
Created March 5, 2014 07:03
Quick hack to override RC over MAVLink with arrow keys
#!/usr/bin/env python
import sys, os
from optparse import OptionParser
import Tkinter as tk
# tell python where to find mavlink so we can import it
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../mavlink'))
from pymavlink import mavutil
@vo
vo / Link.java
Created May 20, 2012 17:54
Reversing a Linked List Using Recursion