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
<<-BENCHMARK | |
A quick benchmark vs Starling | |
doesn't deal with contention | |
running in Production mode | |
with 50,000 pre-existing RudeQueue items | |
user system total real | |
rudequeue 49.060000 2.970000 52.030000 ( 77.439360) | |
starling - one 1.710000 0.890000 2.600000 ( 11.684323) | |
starling - many 1.170000 0.610000 1.780000 ( 16.830219) >> @starlings.length => 128 |
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
"rake away the pain" |
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
def self.board_threads(opts={}) | |
#-- a note from the author | |
# # this query is heavily optimized & indexed, as it's pretty common | |
# # the select column override needs changing if column order changes on any of these tables :( | |
SectionPosting.find(:all, { | |
:include => {:content => :user}, | |
:select => 'section_postings.`content_id` AS t0_r0, section_postings.`section_id` AS t0_r1, section_postings.`lastreply` AS t0_r7, content.`id` AS t1_r0, content.`title` AS t1_r1, content.`content` AS t1_r3, content.`user_id` AS t1_r5, content.`type` AS t1_r7, content.`replies` AS t1_r8, users.`id` AS t2_r0, users.`username` AS t2_r1', | |
:limit => 10 | |
}.merge(opts)) |
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 Developer Required @ JobsGoPublic.com | |
****************************************** | |
============================== | |
The Company - JobsGoPublic.com | |
============================== | |
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
.post .photo div.caption blockquote { | |
font: Bold 28px Helvetica, sans-serif; | |
letter-spacing: -1px; | |
color: #666666; | |
} | |
.post .photo div.caption { font-size: 15px; | |
} | |
dl.blogroll { |
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
describe "base" do | |
before(:each) do | |
@params = {} | |
end | |
describe "with an id" do | |
before(:each) do | |
@id = 23 | |
@params[:id] = @id | |
end | |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8"/> | |
<style type="text/css"> | |
body { | |
font-family: arial, sans-serif; |
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
SolrQuery.build(:keyword => "red OR yellow", :category => "toys", :price => 5..10) | |
returns | |
"(red OR yellow) AND category:(toys) AND price:([5 TO 10])" |
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
def add(data, tree) | |
if tree.end_of_a_branch? && tree.ND? | |
tree << data # we add something to the tree | |
else | |
add(data, tree.branch1) # we recurse | |
add(data, tree.branch2) | |
end | |
return tree # we always return the tree | |
end |
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
data Btree a = ND | Data a | Branch (Btree a) (Btree a) | |
deriving (Show,Eq) | |
data Dir = L | R | |
deriving (Show,Eq) | |
type Path = [Dir] | |
--- Part a) | |
OlderNewer