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
Notes on the reverse engineering of the data for the Neewer-RGB660 PRO leveraging bluetooth low energy. | |
NEEWER-RGB660 PRO | |
02 41 00 0C 00 08 00 04 00 52 0E 00 78 81 01 01 FB | |
Preamble 02 04 00 0C 00 08 00 04 00 52 0E 00 Value 78 81 01 01 FB | |
Service UUID: 69400001b5a3f393e0a9e50e24dcca99 | |
Caracteristic: 69400002b5a3f393e0a9e50e24dcca99 | |
Properties: WRITE, WRITE NO RESPONSE |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
// Fast Block Distributed CUDA Implementation of the Hungarian Algorithm | |
// | |
// Annex to the paper: | |
// Paulo A. C. Lopes, Satyendra Singh Yadav, Aleksandar Ilic, Sarat Kumar Patra , | |
// "Fast Block Distributed CUDA Implementation of the Hungarian Algorithm", | |
// Parallel Computing | |
// | |
// Hungarian algorithm: | |
// (This algorithm was modified to result in an efficient GPU implementation, see paper) | |
// |
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 Sass::Script::Functions | |
def user_color | |
color_values = options[:custom][:user].color. | |
scan(/^#?(..?)(..?)(..?)$/).first. | |
map {|num| num.ljust(2, num).to_i(16)} | |
Sass::Script::Color.new(color_values) | |
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
use std::io; | |
fn main() { | |
eval(bytes!("++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.")); // I stole this off of wikipedia, sorry, wikipedia :( | |
} | |
fn eval(program: &[u8]) { | |
let mut pointer = 0u; | |
let mut memory = [0u8, ..1024]; | |
let mut jmp_stack = vec!(); |
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
# Run this file with `RAILS_ENV=production rackup -p 3000 -s thin` | |
# Be sure to have rails and thin installed. | |
require "rubygems" | |
# We are not loading Active Record, nor the Assets Pipeline, etc. | |
# This could also be in your Gemfile. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
# The following lines should come as no surprise. Except by |
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
Original Source: https://github.com/chneukirchen/styleguide | |
= Christian Neukirchen's Ruby Style Guide | |
You may not like all rules presented here, but they work very well for | |
me and have helped producing high quality code. Everyone is free to | |
code however they want, write and follow their own style guides, but | |
when you contribute to my code, please follow these rules: | |
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
rm -R $HOME/Desktop/server-{1,2} | |
mkdir -p $HOME/Desktop/server-{1,2} | |
mysql_install_db --datadir=$HOME/Desktop/server-1 && mysqld --server-id 1 -h ~/Desktop/server-1 --socket ~/Desktop/server-1/mysql.sock -P 10001 --log-bin & | |
mysql_install_db --datadir=$HOME/Desktop/server-2 && mysqld --server-id 2 -h ~/Desktop/server-2 --socket ~/Desktop/server-2/mysql.sock -P 10002 --master-port=10001 --master-host=127.0.0.1 --master-user=root & | |
alias sql-master="mysql -h127.0.0.1 -P10001 -uroot" | |
alias sql-slave="mysql -h127.0.0.1 -P10002 -uroot" | |
alias sql-master-admin="mysqladmin -h127.0.0.1 -P10001 -uroot" |
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 Matz | |
def self.included(*) | |
puts <<-MATZ | |
Simplicity is NOT a Goal | |
------------------------ | |
Things too simple are difficult | |
Things too complex are difficult |
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
class Floppy | |
def method_missing(method, *args) | |
super unless args.length > 0 && method.to_s[-1..-1] == "=" | |
if args.first.is_a?(Proc) | |
(class << self; self; end).class_eval do | |
define_method(method.to_s[0..-2].to_sym, args.first) | |
end | |
else | |
(class << self; self; end).send(:attr_accessor, method.to_s[0...-1]) |
NewerOlder