Skip to content

Instantly share code, notes, and snippets.

View eggie5's full-sized avatar
💭
Working on TensorFlow Ranking

Alex Egg eggie5

💭
Working on TensorFlow Ranking
View GitHub Profile
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#include <stdio.h>
#include <termio.h>
#include <stdlib.h>
//float asciiToFloat(byte* line);
#define FreqClockA 2000000 // Value on Reset (PWMPRCLK = 0x00)
#include <hidef.h> /* common defines and macros */
#include "derivative.h" /* derivative-specific definitions */
#include <math.h>
int notes[16]= {60,62,64,65,67,69,71,0,72,74,76,77,79,81,83,84}; //key to note lookup table
void initializePorts()
/* RealTime Clock.
* Global variable msCount is incremented every millisecond by Timer
* channel 5 Interrupt Service Routine.
* Loop in main displays msCount<15:12> on the module LEDs
* and msCount<11:4> project board LEDs.
* Note that when a word is assigned to a byte variable, the low 8 bits
* of the word are assigned to the byte.
*/
#include <hidef.h> /* common defines and macros */
#**
#* Subscribe
#*
#* This is BLOCKING.
#* Listen for a message on a channel.
#*
#* @param array args with channel and message.
#* @return false on fail, array on success.
#*
def subscribe(args)
cat network
config 'interface' 'loopback'
option 'ifname' 'lo'
option 'proto' 'static'
option 'ipaddr' '127.0.0.1'
option 'netmask' '255.0.0.0'
config 'interface' 'lan'
option 'ifname' 'eth1'
br-lan Link encap:Ethernet HWaddr 00:03:7F:11:3F:33
inet addr:192.168.1.111 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:2 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
eth0 Link encap:Ethernet HWaddr 00:03:7F:11:3F:33
UP BROADCAST MULTICAST MTU:1500 Metric:1
@eggie5
eggie5 / lab13.c
Created April 27, 2012 01:58
lab13.c
//Alex Egg Lab 12
#include <hidef.h> /* common defines and macros */
#include <MC9S12C128.h> /* derivative information */
#include <math.h>
void initializePorts(void);
byte PATTERNS[]= {0x00,0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0x7F,0x1F,0x0F,0x07,0x03,0x01,0x00};
int notes[16]= {60,62,64,65,67,69,71,0,72,74,76,77,79,81,83,84}; //key to note lookup table
@eggie5
eggie5 / insteon_listener.rb
Created May 24, 2012 23:41
event machine loop to listen for insteon messages
require 'eventmachine'
module InsteonNetwork
class Client
attr_accessor :connection
def connect
@connection = EM.connect "192.168.1.102", 9761, Listener, self
end
def do_callback(data)
require 'eventmachine'
class String
#literal_hex_string
def lhs
self.unpack('C*').map {|e| "0x#{e.to_s(16)} "}.join
end
end
threads = [];
threads << Thread.new { funcA };
threads << Thread.new { funcB };
threads.each { |t| t.join(0.1) } while true