https://nfdc.faa.gov/xwiki/bin/view/NFDC/WebHome
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
#!/bin/bash | |
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs) | |
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 | |
# Enable the 2D Dock | |
#defaults write com.apple.dock no-glass -bool true | |
# Disable menu bar transparency | |
#defaults write -g AppleEnableMenuBarTransparency -bool false |
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
[1, 2, 3] * ',' # => "1,2,3" | |
[1, 2, 3] + [3, 4, 5] # => [1, 2, 3, 3, 4, 5] | |
[1, 2, 3] << "a" << "b" #=> [1, 2, 3, "a", "b"] | |
[ "a", "a", "c" ] <=> [ "a", "b", "c" ] | |
a = Array.new | |
a[4] = "hello" => [nil, nil, nil, nil, "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
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |
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
// | |
// Example usage: phantomjs screenshot.js http://yahoo.com /tmp/yahoo.png | |
// | |
var system = require('system'); | |
var url = system.args[1]; | |
var filename = system.args[2]; | |
var page = new WebPage(); | |
page.open(url, function (status) { |
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
#!/usr/bin/env ruby | |
contents = File.read('1.dataset') | |
A = contents.gsub(/[CcGgTt]/,'') | |
C = contents.gsub(/[AaGgTt]/,'') | |
G = contents.gsub(/[AaCcTt]/,'') | |
T = contents.gsub(/[AaCcGg]/,'') | |
puts "#{A.length} #{C.length} #{G.length} #{T.length}" |
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
#!/usr/bin/env ruby | |
input = ARGV[0] | |
a = input.count('A'); | |
c = input.count('C'); | |
g = input.count('G'); | |
u = input.count('U') | |
p "#{a} #{c} #{g} #{u}" |
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 SimpleLinearRegression | |
def initialize(xs, ys) | |
@xs, @ys = xs, ys | |
if @xs.length != @ys.length | |
raise "Unbalanced data. xs need to be same length as ys" | |
end | |
end | |
def y_intercept | |
mean(@ys) - (slope * mean(@xs)) |
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
from __future__ import division | |
import numpy | |
import shlex | |
from uuid import uuid1 | |
class d3object: | |
def __init__(self, | |
height=100, | |
width=100, | |
topHtml='', | |
bottomHtml='', |
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
response = $.getJSON("/pcr.json"); | |
data = JSON.parse(response.responseText); | |
newData = {"Printer":{}, "Cutter": {}, "Router": []} | |
$(data).each( function() { | |
obj = this; | |
if (obj.type == "Router") { | |
newData[obj.type].push(obj.make); | |
} else { | |
if (!newData[obj.type][obj.make]) { |
OlderNewer