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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.rotateCannon(90); |
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
# Install ZeroMQ | |
sudo brew install zmq | |
easy_install pyzmq | |
[0] http://www.zeromq.org/bindings:python | |
# Install OpenCV | |
sudo brew install opencv | |
# Install libusb |
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
//I guess I'd go with straight functions into a module you could mixin or use directly OR objects... | |
//On the first option, something like this: | |
var app = app || {}; | |
app.server = app.server || {}; | |
app.server.http = function() {...}; | |
app.server.get = function() {...}; | |
app.server.post = function() {...}; | |
//And for the second option: |
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
#undo last commit | |
git reset HEAD^ | |
#show files in a given commit | |
git show --pretty="format:" --name-only rev_number | |
#remove untracked files and directories | |
git clean -f -d | |
#track remote branch |
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
public enum Clazzes { | |
param1 ("java.lang.String"), | |
param2 ("java.util.ArrayList"); | |
private final String clazz; | |
Clazzes(String clazz) { | |
this.clazz = clazz; | |
} | |
public Object get() throws Exception { | |
return Class.forName(clazz).newInstance(); |
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
The fix for this.. | |
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError) | |
Seems to be setting this config: | |
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE | |
The question though is, why it fixes it? Is it actually the right way to fix it? |
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
#ruby | |
> a = [0] | |
> i = 0; for i in 0...(a.size) do; puts "in the loop"; end | |
> puts i | |
Produces: | |
# in the loop | |
# 0 | |
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
pvt.rb:10:in `': private method `say_hello' called for # (NoMethodError) |
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 Test | |
def_p say_hello | |
puts "I'm a private method" | |
end | |
end | |
Test.new.say_hello |
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
$ ./configure | |
$ make |