This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'file1' | |
require 'app1' | |
require 'file2' | |
require 'app2' | |
require 'app3' | |
require 'app4' | |
require 'app5' | |
require 'file3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# Array ISO Test | |
assert('Array', '15.2.12') do | |
assert_equal(Class, Array.class) | |
end | |
assert('Array inclueded modules', '15.2.12.3') do | |
assert_true(Array.include?(Enumerable)) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef NDEBUG | |
#define debug(M, ...) | |
#else | |
#define debug(M, ...) fprintf(stderr, "DEBUG %s:%d: " M "\n", __FILE__, __LINE__, ##__VA_ARGS__) | |
#endif | |
#define clean_errno() (errno == 0 ? "None" : strerror(errno)) | |
#define log_err(M, ...) fprintf(stderr, "[ERROR] (%s:%d: errno: %s) " M "\n", __FILE__, __LINE__, clean_errno(), ##__VA_ARGS__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'artoo' | |
connection :raspi, :adaptor => :raspi | |
device :led, :driver => :led, :pin => 11 | |
work do | |
every 1.second do | |
led.toggle | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'artoo' | |
connection :arduino, adaptor: :firmata, port: '/dev/ttyACM0' | |
device :led, driver: :led, pin: 13 | |
device :button, driver: :button, pin: 2, interval: 0.01 | |
work do | |
puts "Press the button connected on pin #{ button.pin }..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'artoo' | |
connection :sphero, :adaptor => :sphero, :port => '/dev/rfcomm0' #linux | |
device :sphero, :driver => :sphero | |
connection :pebble, :adaptor => :pebble | |
device :watch, :driver => :pebble, :name => 'pebble' | |
api :host => '0.0.0.0', :port => '8080' | |
name 'pebble' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'artoo' | |
connection :sphero, :adaptor => :sphero, :port => '/dev/rfcomm0' #linux | |
device :sphero, :driver => :sphero | |
connection :pebble, :adaptor => :pebble | |
device :watch, :driver => :pebble, :name => 'pebble' | |
api :host => '0.0.0.0', :port => '8080' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
void XorBuffer(char * buffer1, char * buffer2, int len, char * dest) | |
{ | |
int i; | |
for(i = 0; i < len; i++) | |
{ | |
dest[i] = buffer1[i] ^ buffer2[i]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module VersionFlat043 | |
BLOCK = Proc.new do | |
class IO | |
def self.a; puts "Device Included Class a"; end | |
def b; puts "Device Included Instance b"; end | |
end | |
end | |
def self.flat klass | |
klass.class_eval &BLOCK | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"encoding/hex" | |
) | |
func main() { | |
sample1 := "\xbd\xb2\x3d\xbc\x20\xe2\x8c\x98" | |
str := "30bdb23dbc20e28c98" |