Welcome home DHH!
After a long time, it seems DHH is back, actively commiting to rails.
Getting ready for 2.2 to be released, he’s committed 20 times in the past week.
It’s nice to see.
After a long time, it seems DHH is back, actively commiting to rails.
Getting ready for 2.2 to be released, he’s committed 20 times in the past week.
It’s nice to see.
A recent post on the Google App Engine blog refers to;
“Support for a new runtime language”
That’s got to be ruby…
Imagine a bespoke Sinatra-style minimal framework, with DataMapper bindings to the Google DataStore.
No doubt it’ll be pretty quick to make it work with Merb as well.
AWESOME.
Why did google never reply to my job application asking to work on it?
(if you haven’t seen the videos from last years Google IO, then they’re well worth watching - here)
it’s hard enough to push out a great idea,
even if you thought of it,
and have spent years thinking about it.
If a potential investor is going to take the time, money, and bother to steal your idea,
then someone else is going to buy it from you
before they have a chance.
At work we have the following concept.
How does this work in code?
So, historically we did
class ApplicationController
layout :determine_layout
def determine_layout
if File.exists?("#{Rails.root}/public/sites/#{@site.id}/application.rhtml")
"../../public/sites/#{@site.id}/application"
else
"site_default"
end
end
end
This was a hack, and it breaks with Rails 2.1.1, so after a day or so playing with the internals of ActionView I discovered this;
append_view_path("#{Rails.root}/public/sites")
And it works!
We just need to set;
"#{@site.id}/application"
as our layout, and we’re away.
Site-specific layouts that live in /public!
On Monday its the LRUG quiz.
Can Google’s entry into drunken embarassment prevention really hold out against my mathematical skills?
Am I just too elite?
At level 5 (the hardest) we still get sums like “6x9”!
Does my mathematical ability really drop that much?
We’ll see tomorrow!
Does your application and architecture really have failover?
If I broke into your datacentre, ripped out, and hid one of your servers, what would happen?
Is your architecture the biggest hurdle to scaling your web app?
Blain Cook and Joe Stump not talking about Twitter’s scaling issues.
… but getting errors?
matthew@iRudy:~/code/rails211again $ sudo gem install mysql Password: Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql checking for mysql_query() in -lmysqlclient... no checking for main() in -lm... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lz... yes checking for mysql_query() in -lmysqlclient... no checking for main() in -lsocket... no checking for mysql_query() in -lmysqlclient... no checking for main() in -lnsl... no checking for mysql_query() in -lmysqlclient... no *** extconf.rb failed *** ... Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.7 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out
Found the fix
sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
So we have;
class Bum
attr_accessor :pants
delegate :smelly?, :to => :pants
end
We want to ask;
bum.smelly?
clearly if the bum has pants, then it’s only smelly if the pants are smelly
that’s cool,
but what if the bum has no pants?
>> bum.pants
=> nil
>> bum.smelly?
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.smelly?
from (__DELEGATION__):2:in `__send__'
from (__DELEGATION__):2:in `smelly?'
from (irb):7
this needs to be fixed,
but how?
by default we’d expect it to be nil,
but perhaps we want to assume that actually they’re smelly by default
but what syntax?
delegate :smelly, :to => :pants, :default => true
perhaps?
Faced with a shocking
>> Phrase.find_by_solr ‘book’
RuntimeError: Out of sync!
The id 296452 is in the Solr index but
missing in the database!
Fix it
>> Phrase.solr_delete(“Phrase:296452”)
>> Phrase.solr_commit()
BOOM!!!