My Recent Pastes (628 and counting)
All Pasties (over 628 and counting)
Below are summaries of the 15 most recent pasties by Allan Odgaard.
July 17, 2007
8:51AM EDT
by Allan Odgaard
View more (12 lines)
1 2 3 4 5 |
Index: SQL.tmbundle/Support/bin/db_browser.rb =================================================================== --- SQL.tmbundle/Support/bin/db_browser.rb (revision 7751) +++ SQL.tmbundle/Support/bin/db_browser.rb (working copy) @@ -134,6 +134,7 @@ |
July 16, 2007
6:50PM EDT
by Allan Odgaard
View more (11 lines)
1 2 3 4 5 |
// 1. If there is just one text area, we use that.
//
// 2. If there are multiple, we ask the web view to “select all”
// which goes to the active text area (hopefully) and then we
// check which of the text areas in the DOM actually changed.
|
July 06, 2007
11:52AM EDT
by Allan Odgaard
View more (8 lines)
1 2 3 4 5 |
if @seen.has_key?("#cybot_test")
corrections = @seen["#cybot_test"].keys.inject({}) do |hash, name|
distance = edit_distance(nick, name).to_f
hash[name] = distance if distance <= (nick.size + name.size.to_f) / 2.0 * 0.70
hash
|
July 06, 2007
3:18AM EDT
by Allan Odgaard
View more (274 lines)
1 2 3 4 5 |
class Country
{
function Country($country_code) {
$this->country_code = $country_code;
}
|
July 06, 2007
3:16AM EDT
by Allan Odgaard
View more (34 lines)
1 2 3 4 5 |
function binary_search($fp, $min, $max, $ip) {
if($min == $max)
return false;
$middle = floor(($min+$max) / 2);
|
July 04, 2007
7:16AM EDT
by Allan Odgaard
View more (15 lines)
1 2 3 4 5 |
The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field. The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field. |
July 03, 2007
11:06AM EDT
by Allan Odgaard
View more (11 lines)
1 2 3 4 5 |
require 'scanf' require "benchmark" str = "1 1 a\n" * 10000 |
July 03, 2007
10:54AM EDT
by Allan Odgaard
View more (37 lines)
1 2 3 4 5 |
begin = '(?x)
(?:
^ # beginning of line
| (?<= # or look-behind on:
[=>~(?:\[,|&]
|
June 29, 2007
10:40AM EDT
by Allan Odgaard
View more (8 lines)
1 2 3 4 5 |
require 'fileutils'
open("/tmp/A", "w") { |io| io << 'foo' }
open("/tmp/B", "w") { |io| io << 'bar' }
|
June 28, 2007
3:19AM EDT
by Allan Odgaard
View more (14 lines)
1 2 3 4 5 |
2007-06-28 07:18:37 ./plugins/web.rb:117:in `alias_method' ./plugins/web.rb:117 ./lib/plugin.rb:54:in `load' ./lib/plugin.rb:54:in `load_plugin' ./lib/plugin.rb:54:in `module_eval' |
June 27, 2007
5:09AM EDT
by Allan Odgaard
View more (13 lines)
1 2 3 4 5 |
Support/lib/connectors/mysql.rb:111:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
from Support/lib/connectors/mysql.rb:111:in `new'
from Support/lib/connectors/mysql.rb:111:in `real_connect'
from Support/lib/connectors/mysql.rb:99:in `initialize'
from Support/bin/db_browser_lib.rb:52:in `new'
|
June 26, 2007
12:06PM EDT
by Allan Odgaard
View more (50 lines)
1 2 3 4 5 |
#!/usr/bin/env ruby -wKU require ENV['TM_SUPPORT_PATH'] + '/lib/escape.rb' require ENV['TM_SUPPORT_PATH'] + '/lib/osx/plist' |
June 24, 2007
4:11PM EDT
by Allan Odgaard
View more (6 lines)
1 2 3 4 5 |
class Connection
attr_reader :name # name of this connection (for display purposes)
attr_reader :user, :password, :host, :port, :database
private
# take no notice of the man behind the curtain
|
June 22, 2007
9:08PM EDT
by Allan Odgaard
1 |
clear; cd /Volumes/chris.pod/Cocoa/lottery/build/Release; env DYLD_FRAMEWORK_PATH=/Volumes/chris.pod/Cocoa/lottery/build/Release DYLD_LIBRARY_PATH=/Volumes/chris.pod/Cocoa/lottery/build/Release ./lottery; echo -ne \\n\\nPress RETURN to Continue...; read foo;osascript &>/dev/null -e 'tell app "TextMate" to activate' -e 'tell app "Terminal" to close first window' & |
Pastie