LSRC Z127-09 - Milford, Michigan by Tyler Pate Via Flickr: Not your normal Lake State motive power, as CSX No.119 leads the southbound train towards Wixom, while splitting the signals in Milford, Michigan.
seen from China

seen from United Arab Emirates
seen from Ukraine
seen from China
seen from Ukraine

seen from United States
seen from Malaysia
seen from Italy
seen from Japan

seen from Malaysia
seen from Malaysia
seen from Italy
seen from United States

seen from Malaysia

seen from United States
seen from China
seen from United States

seen from Malaysia
seen from China
seen from United Kingdom
LSRC Z127-09 - Milford, Michigan by Tyler Pate Via Flickr: Not your normal Lake State motive power, as CSX No.119 leads the southbound train towards Wixom, while splitting the signals in Milford, Michigan.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
LSCR Z127-07 - Burton, Michigan by Tyler Pate Via Flickr: A pair of EMD SD50’s rumble south on Lake State Railway under Chesapeake & Ohio Searchlight Signals at Bristol Street.
LSRC Y118-08 - Saginaw, Michigan by Tyler Pate Via Flickr: Running around lite power to the south end of the yard is Y118 with LSRC No.801 to head down to S Hoyt to pick up storage tank cars.

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Lone Star Ruby Conference 2011: Day 2 Notes
These are some of my (terse) notes from day two of the LSRC. Â It would probably be helpful to read my colleague's notes as well.
Blow up Your Views
Instance variables in views suck
Real interface between C/V (github: voxdolo/decent_exposure)
Added "exposes(:foo)" in the controller and the view starts using just "foo" instead of "@foo"
Kill helpers
Example of timestamps
Should be writing helpers to format timestamps
Usually helpers are for specific objects (e.g. formats the timestamp on a particular kind of object)
We write helpers like print_name(user) instead of user.print_name but we want the later.
View Objects Implemented
Create an /app/decorators folder
Implement an attr_accessible approach to the view: Limit what it is allowed to call.
Github: jcasimir/draper
Should be splitting up responsibilities
Always render the same thing from the controller (define an API)
The view should deal with drawing the display for the client
Send them a JS template, assets, etc.
Render Engines
Plain HTML with jQuery Replacement
Mustache
Handlebars (SproutCore)
ICanHazJS
ZeroMQ
ZeroMQ is a messaging bus
Zero stands for 'zero brokers'
Scalability
Serve requests faster
Deals with complexity scalability
Uses an actor model
stateless
self-contained pieces
What ZeroMQ isn't
ZeroMQ isn't designed to write an HTTP server
It doesn't care what you send in messages but it cares how it sends it
ZeroMQ sockets only talk to other ZeroMQ sockets
Could write a layer that interprets HTTP and sends it into ZeroMQ (Mongrel2)
How to use it
Ruby: gem install zmq
Based in C and supported in every language
Threadsafe but can't share a socket between threads
Example: Request/Reply Sockets
Can start a client and it starts trying to communicate but will block until the server responds
If the server crashes in the middle and restarts but it wont automatically work.
Publish/Subscribe model
Uses option "SUBSCRIBE"
If the publisher goes down, the subscriber is durable
Push/Pull sockets
Multiple pull sockets can bind to a single push socket
Spawn more workers if the queue is backing up
Durable Sockets
Set a socket identity: give it a name
Setup spooling to disk for unreceived messages
JavaScript for people who didn't learn JavaScript (@jwo)
Prototype Inheritance
Only one prototype per function (but can be switched out when needed)
Like Ruby modules but you only get one.
Calling super
JavaScript doesn't provide a method to call super
var Note = Backbone.Model.extend({ Â set: function(...) { } <-- override behavior and call Backbone.Model.set.call(...)
Using 'new'
Don't just use new because you think you have to
Use 'new' if you need the prototype of the object
Don't use it if your just creating a new Array, etc.
Object.create is useful but some browser dependencies
"Don't write new Array()"
Arrays in JS don't have limits
"Don't write new Function()" - just use the funciton() literal
Invocation
Functions get declared-parameters, this, and arguments
Creating a new object with Object.create(HelloWorld) and calling hi.speak() you get the prototype
Using just HelloWorld.speak doesn't provide scope so 'this' isn't bound to the object
JavaScript allows you to pass in the object that you want 'this' to reference (so function() in the method can actually operate on whatever object you provide)
JavaScript puts semicolons in where you "forgot them"
return { Â javascript: "foo" }; // This will fail because return gets a magic ';' on the end.
Testing JavaScript with Jasimine
Slides: http://bit.ly/jasmine-lsrc
Jasmine has rspec like syntax
Jasmine with jQuery
jasmine-jquery adds more matchers
Lettering.js
Allows you to throw spans in between chars in a particular HTML DOM element
SpecRunner.html
Added jquery and lettering js files
Jasmine with Rails
Add 'jasmine' to Gemfile
rake jasmine / rake jasmine:ci
Easier way with Evergreen "gem install evergreen"
Create public folder (with js in it)
Create spec folder with specs in it
evergreen run
Evergreen follows the name_spec.js file naming convention
Install coffee-script and works with Jasmine (make .coffee file)
Headless running
Install capybara-webkit
Switched from selenium to webkit and runs faster
Rosie gives you factory_girl for JS
github: bkeepers/rosie
jasminerice - jasmine + coffee script + rails 3.1
The Ballad of Goliath, EventMachine, and MongoDB
These notes are bit short since a lot of the talk was random aspects of MongoDB towards the end.
Goliath
Event Driven (Built upon EventMachine)
Web and app server
Uses fibers in Ruby 1.9
Matches a rackup app somewhat
Inherits from Goliath::API
Get an array of command line options
-u for actually specifying the user
By default it doesn't log at all
EventMachine:Â Watch peepcode screencode
MongoDB
Just doing Mongo::ReplSetConnection.new(host), only R/W to primary
Use Mongo::ReplSetConnection.new(host, :read_secondary => true) to get better read performance
Polygot Parallelism
This talk started off with a brief intro to Erlang and continued a discussion into how Rackspace was able to successfully solve a massively parallel data gathering problem.
Erlang
Immutable Data Structures
Single assignment => everything is immutable
Webmachine
Similar to Sinatra or Goliath
Basically developing a custom web server for your application's behavior.
http://webmachine.basho.com
Leaves sensible defaults for the whole HTTP life cycle and can override at any step.