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
#!/usr/bin/env python | |
import sys | |
import math | |
import matfunc | |
import idmethod | |
import csv | |
for filename in sys.argv[1:]: | |
wdirlist=[] |
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
function tab () { | |
CURRENT_RVM=$rvm_ruby_string | |
osascript 2>/dev/null <<EOF | |
tell application "System Events" | |
tell process "Terminal" to keystroke "t" using command down | |
end | |
tell application "Terminal" | |
activate | |
do script with command "cd $PWD; rvm $CURRENT_RVM; $*" in window 1 | |
end tell |
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
SELECT | |
CAST(COALESCE(trans_online.headcount,0) + ((COALESCE(class_online.headcount,0) - (COALESCE(class_online.headcount,0) * COALESCE(nesting.nesting_percent,0)))) AS DECIMAL(6,2)) headcount | |
FROM training_classes | |
JOIN weeks | |
LEFT JOIN (SELECT x.training_class_id, y.start_on online_week, z.headcount FROM (SELECT a.training_class_id, MAX(b.start_on) start_on FROM training_class_forecasts a JOIN weeks b ON a.week_id = b.id WHERE a.headcount > 0 GROUP BY a.training_class_id) x JOIN weeks y ON x.start_on = y.start_on JOIN training_class_forecasts z ON x.training_class_id = z.training_class_id AND y.id = z.week_id) class_online ON class_online.training_class_id = training_classes.id AND training_classes.transition = 0 AND class_online.online_week = weeks.start_on - INTERVAL 7 DAY | |
LEFT JOIN (SELECT x.training_class_id, y.start_on online_week, z.headcount FROM (SELECT a.training_class_id, MAX(b.start_on) start_on FROM training_class_forecasts a JOIN weeks b ON a.week_id = b.id WHERE a.headcount > 0 GROUP BY a.trainin |
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
require 'rubygems' | |
require 'irb/ext/save-history' | |
IRB.conf[:SAVE_HISTORY] = 100 | |
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb-save-history" | |
IRB.conf[:AUTO_INDENT] = true | |
IRB.conf[:PROMPT_MODE] = :SIMPLE | |
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
require 'ge' | |
player_name = "Firblitz" | |
blue_charms = 401 | |
crimson_charms = 3510 | |
green_charms = 1971 | |
gold_charms = 4124 | |
shards = 44562 |
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
require 'runescape' | |
days = 1 | |
amount_per_day = 64 | |
ge_limit_per_day = 600 | |
bstaff_shop_cost = 7000 | |
bstaff_alch_amt = 9300 | |
battlestaff = Runescape::Item.new(1391) |
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
require 'rubygems' | |
require 'open-uri' | |
require 'plist' | |
require 'hpricot' | |
variables_path = "#{ENV['HOME']}/Library/Application Support/Soulver/Variables.plist" | |
items = { | |
1391 => "Battlestaff", | |
573 => "Air orb", |
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
EXPLAIN ANALYZE | |
SELECT | |
COUNT(*) | |
FROM jivemessage | |
Row QUERY PLAN | |
1 Aggregate (cost=1085701.27..1085701.28 rows=1 width=0) (actual time=111295.699..111295.699 rows=1 loops=1) | |
2 -> Seq Scan on jivemessage (cost=0.00..1052949.61 rows=13100661 width=0) (actual time=10.628..108926.771 rows=13100661 loops=1) | |
3 Total runtime: 111295.761 ms |
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
<html> | |
<head> | |
<title>JS Key Example</title> | |
<script type="text/javascript"> | |
addEventListener("keydown", function (e) { | |
var output = document.getElementById('output'); | |
if (e.keyCode == 37) { | |
output.innerHTML = "You pressed 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
class Item | |
attr_accessor :name, :odds | |
def initialize(name, odds) | |
@name = name | |
@odds = odds | |
end | |
end | |
class Dice |