- Mod + Shift + Enter -> Open console
- Mod + Space -> Change tiling mode
- Mod + j & Mod + k -> Move focus between windows
- Mod + Shift + c -> Close the focused window
- Mod + . & Mod + , -> Control the number of windows displayed in the master pane on the left
- Mod + Enter -> Move the focused window to the master pane on the left
This file contains hidden or 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
def matthews(tp, tn, fp, fn) | |
den = tp * tn - fp * fn | |
num = (tp + fp) * (tp + fn) * (tn + fp) * (tn + fn) | |
den / Math.sqrt(num) | |
end |
This file contains hidden or 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
def fix_encoding(fn) | |
q = File.read(fn) | |
File.open(fn, 'w') { |f| f << q.encode("UTF-8", "ISO-8859-1") } | |
end |
This file contains hidden or 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 -rwebrick -e 'WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd).start' |
This file contains hidden or 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
def polynomial(&block) | |
varX = Variable::Local.new('x') | |
x = Polynomial.valueOf(Real::ONE,varX) | |
yield x | |
end | |
# Creating a polynomial fx = 1(x^5) + 6(x^2). | |
fx = polynomial do |x| | |
x.pow(5).plus(x.pow(2).times(Real.valueOf(6))) | |
end |
This file contains hidden or 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
var N = 100, | |
a = 2.0, | |
b = 0.0, | |
c = 0.2; | |
var defaultScale = { mu: 0, sigma: 1 }, | |
enemScale = { mu: 500, sigma: 100 }; | |
// @return: The probability of hit at `theta`, or P(right | theta, a, b, c). | |
var prob = function (a, b, c, theta) { | |
return c + (1 - c) / (1 + Math.exp(- a * (theta - b))); |
This file contains hidden or 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 Counter | |
def initialize | |
@counts = Hash.new 0 | |
end | |
def <<(key) | |
@counts[key] += 1 | |
end | |
end |
This file contains hidden or 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
# Create a method `has_<library>?` on Module that requires the library and | |
# return a boolean indicating if the library is available. | |
# | |
# @param library [String] The library name. | |
# @return [Boolean] Whether the library is available or not. | |
def create_has_library(library) #:nodoc: | |
define_singleton_method("has_#{library}?") do | |
cv = "@@#{library}" | |
unless class_variable_defined? cv | |
begin |
This file contains hidden or 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
-- Some RNGs for getting to play with Lua. | |
-- | |
-- Carlos Agarie <[email protected]> | |
-- | |
-- Public domain. | |
-- N(mean; std^2). | |
function gauss(mean, std) | |
if std <= 0.0 then error("standard deviation must be positive!") end |
This file contains hidden or 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
./faces/kawamura/kawamura_straight_happy_open_4.pgm | |
./faces/phoebe/phoebe_up_sad_open_4.pgm | |
./faces/saavik/saavik_left_sad_sunglasses_4.pgm | |
./faces/sz24/sz24_right_angry_open_4.pgm | |
./faces/tammo/tammo_left_angry_sunglasses_4.pgm | |
./faces/bpm/bpm_up_neutral_open_4.pgm | |
./faces/kawamura/kawamura_up_angry_open_4.pgm | |
./faces/choon/choon_right_happy_sunglasses_4.pgm | |
./faces/saavik/saavik_right_sad_sunglasses_4.pgm | |
./faces/ch4f/ch4f_straight_angry_open_4.pgm |