You are here: Blogsphere Longtail
Keep up to date with your favourite Rails bloggers in context.
google-caja - Google Code
Death by powerpoint
mephisto sitemap plugin was commented on.
Developing Typefaces for the Xbox 360 and Other Devices
Pradipta's Rolodex
Late last night, I had the honor of being mailed a Ruby on Rails offer. See 416 Random People with RoR on their resume + Reply All = Reverse Flash Mob for the full details.
Pretty amusing, really.
"Trey's 'Time Turns Elastic' With Orchestra Nashville"
We're all psycho!
"Of course it’s real, it’s on YouTube."
Tom(warning: non-english blog) had a small friday-afternoon problem for me, which they couldn’t easily figure out. The problem:
x = [1, 2, 3] y = ['a', 'b', 'c'] ??? # result should == [[1,'a'],[2,'b'],[3,'c']]
My first guess was a simple * but apparently Array#* only takes strings and numbers:
x * 3 # => [1, 2, 3, 1, 2, 3, 1, 2, 3] x * '-' # => "1-2-3" x * y # => TypeError: can't convert Array into Integer
So I went through the Array API and found out there was something like transpose. Basically this is what you want:
x = [1, 2, 3] y = ['a', 'b', 'c'] result = [x,y].transpose # => [[1, "a"], [2, "b"], [3, "c"]]
RE: Инициализация масивов
One of the most exciting things about the computer industry these days is the ease with which can get started. Decent computers can be had for well south of $1000, hosting is cheap, services like Amazon EC2 make it ever easier to scale rapidly should the need arise, and the only other things you need are an internet connection and a place to sit. This is leading to more people, like 37 Signals to question the need for investment entirely and others, like YCombinator to successfully make very small investments (thousands of dollars, rather than millions).
Sometimes, however, I wonder - is it just a passing moment in time, a window of opportunity, or is it a long term trend? Historically, to set up something like a factory required a great deal of money, putting it beyond the reach of anyone unable to obtain financing. Even in this day and age, there are plenty of endeavors that require large amounts of capital, and a lot of time, prior to seeing returns: that's how things work in my wife's field, biotech. Some fields have even become more expensive with time. High end computer games are very expensive propositions in this day and age, compared to the low budget stuff typical of, say, the Commodore 64 era, although it's also true that the market has also grown a lot, and that there is still space for smaller-budget operations.
How does all this look historically? Have there been industries in the past where it was so easy to get started? Anything that was able to scale? By which I mean: it might have been relatively easy to start some kind of small business, but it would most likely always stay small, whereas things like Craigslist or 37Signals have the means to grow a great deal without adding lots of people. Will things change in the future so that one or a few programmers can't compete with a big team? Or perhaps things will go in the other direction and more industries will become like computing is today and it will be possible to a biotech startup in your home office?
Heading to work for another lo…
The Watchmen looks like it’ll …
[OpenMoko] GPS software and hardware solution
Create a file check_maillog in /usr/local/sbin or where do you prefer, make it executable and wrote in it:
tail -f /usr/local/psa/var/log/maillog /var/spool/qscan/qmail-queue.log /var/spool/qscan/quarantine.log /var/log/clamav/clamd.log /var/log/clamav/freshclam.log
Dr. Horrible
Usually I hate musicals but, in Dr. Horrible's sing-along-blog, Joss Whedon manages once again to make something I love (with props to Alan for the link).
Edge Rails: Introduzindo Memoizable para cache de atributos
Script commandes rake
Bonjour,
Je souhaiterais automatiser l'exécution de plusieurs taches rake.
Par exemple je voudrais taper la commande
rake monscript
qui ferait :
rake db:fixtures:drop
rake db:fixtures:create
rake db:migrate
rake db:fixtures:load FIXTURES=users
sans avoir a taper toutes les commandes d'affiler
J'ai pensé à faire un fichier bat et un sh pour windows et linux
mais il faut maintenir 2 fichiers et rails intègre surement une méthode plus élégante !
Manu
lsbom -f -l -s /Library/Receipts/package_here.pkg/Contents/Archive.bom | (cd /; sudo xargs rm)
Валидируем по очереди поле
class Subscription < ActiveRecord::Base
validates_presence_of :subscription
validates_format_of :subscription, :with => /^[A-F0-9]{8}$/, :message => 'incorrect format.', :if => Proc.new { |record| !record.subscription.nil? }
#....
end
Как она работает?
Есть поле в таблице subscription
оно не омжет быть ни пустым ни иметь не правильный формат. РАньше выводилось в процесе валиадции сразц два сообщения об ошибке, но как говорится тестеры очень умный народ.
Они захотели чтобы при пустом поле было одно сообщение а при не правильно заполненном другое, по этому пришлось добавить дополнительное условие в валидацию по формату.
Тоесть при заполенном поле уже проверять формат записи.
Таким образом у нас валидвация происходит как бы по очереди.Ruby on Rails has just integrated a basic support for i18n.
ActiveSupport now includes the i18n gem which provides the API and the settings for the default locale: en-US.
The gem abstracts the repository where the translations are stored, so all the plugin authors could write their own mechanism. The bundled repository is called Simple and stores all the settings in memory.
Declaring a locale is quite easy:
I18n.backend.store_translations :'it-IT', {
:support => {
:array => {
:sentence_connector => 'e'
}
},
:date => {
:formats => {
:default => "%d/%m/%Y",
:short => "%d %b",
:long => "%d %B %Y",
},
:day_names => %w(Lunedì Martedì Mercoledì Giovedì Venerdì Sabato Domenica),
:abbr_day_names => %w(Lun Mar Mer Gio Ven Sab Dom),
:month_names => %w(Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre).unshift(nil),
:abbr_month_names => %w(Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic).unshift(nil),
:order => [:day, :month, :year]
},
:time => {
:formats => {
:default => "%a, %d %b %Y %H:%M:%S %z",
:short => "%d %b %H:%M",
:long => "%B %d, %Y %H:%M",
},
:am => 'am',
:pm => 'pm'
}
}
How can I translate or localize?
I18n.locale = 'it-IT'
I18n.t :hello # => Ciao
I18n.l Time.now # => "Ven, 18 Lug 2008 10:58:14 +0200"I18n#t is also useful to fetch locale defaults:I18n.t :'time.formats.short' # => %d %b %H:%M
ActiveRecord now returns localized error messages for validations.
You may wish to declare your messages:
I18n.backend.store_translations :'it-IT', {
:active_record => {
:error_messages => {
:inclusion => "non è incluso nella lista"
# ...
}
}
}
ActionView now supports translations and localization for time and currency helpers (i.e. distance_of_time_in_words, number_to_currency).
Ruby on Rails has just integrated a basic support for i18n.
ActiveSupport now includes the i18n gem which provides the API and the settings for the default locale: en-US.
The gem abstracts the repository where the translations are stored, so all the plugin authors could write their own mechanism. The bundled repository is called Simple and stores all the settings in memory.
Declaring a locale is quite easy:
I18n.backend.store_translations :'it-IT', {
:support => {
:array => {
:sentence_connector => 'e'
}
},
:date => {
:formats => {
:default => "%d/%m/%Y",
:short => "%d %b",
:long => "%d %B %Y",
},
:day_names => %w(Lunedì Martedì Mercoledì Giovedì Venerdì Sabato Domenica),
:abbr_day_names => %w(Lun Mar Mer Gio Ven Sab Dom),
:month_names => %w(Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio Agosto Settembre Ottobre Novembre Dicembre).unshift(nil),
:abbr_month_names => %w(Gen Feb Mar Apr Mag Giu Lug Ago Set Ott Nov Dic).unshift(nil),
:order => [:day, :month, :year]
},
:time => {
:formats => {
:default => "%a, %d %b %Y %H:%M:%S %z",
:short => "%d %b %H:%M",
:long => "%B %d, %Y %H:%M",
},
:am => 'am',
:pm => 'pm'
}
}
How can I translate or localize?
I18n.locale = 'it-IT'
I18n.t :hello # => Ciao
I18n.l Time.now # => "Ven, 18 Lug 2008 10:58:14 +0200"I18n#t is also useful to fetch locale defaults:I18n.t :'time.formats.short' # => %d %b %H:%M
ActiveRecord now returns localized error messages for validations.
You may wish to declare your messages:
I18n.backend.store_translations :'it-IT', {
:active_record => {
:error_messages => {
:inclusion => "non è incluso nella lista"
# ...
}
}
}
ActionView now supports translations and localization for time and currency helpers (i.e. distance_of_time_in_words, number_to_currency).
RE: использование SQL функций
So just got back from a great 2 weeks in California, went to Foo camp, Social Media Camp, Mashable and a couple of other meetups – all excellent. One slight hiccup with the hire car…..... I claim it was the taxi’s fault (of course), although its a bit of a blur to be honest.

On the up side I can highly recommend Enterprise (and taking out the full coverage), they were very helpful and polite. Even offered me a new car – which would of seemed like a better idea if I could move properly!! At least no one was badly hurt.
Those 2G iPhones are worth their weight in gold
I've been watching a lot of 2G iPhones on eBay and the average sale price is £238. I'm watching 8 that haven't ended yet and they average about £180.
That seems crazy to me. Assume you pick one of these up and get a cheap pay&go tariff (say £5/mth) plus a data bolt-on (£10/mth). That makes TCO over 18 months £508.
Now if you're pursuing this strategy you're probably not intending to hold on to the device for 18 months, let's say 8 months. Long enough that you might have an outside shot at an iPhone 3G (as in 3rd generation). That comes to £358.
Now a new iPhone 3G will run you -at a minimum - £99 plus £540 in monthly fees for a total cost of £639.
So your wait & see 2G strategy costs you 56% the cost of a new iPhone for only 44% the total usage (8 mths instead of 18). If this was the same device that'd be okay but you're getting a second hand device, older model, that may well be out of warranty much of that time. Waiting Apple/O2 out is starting to sound like a pretty expensive option.
And this assumes a probably impossible low of £5/mth on pay&go. If we say £10 instead you come out at £398 which is 62% of the cost for 44% of the time. Maybe it's Alan coaxing me but the 3G iPhone is starting to sound like a better deal. All except the 18-month contract part.
Maybe my figures are wrong?
If not it seems to me that people are wayy overpaying for 2G iPhones.
For the record when I set out on this path my gut instinct on the value of a 2G iPhone topped out about £85 which is not a million miles from Kottke's gut instinct that they'd be worth no more than $150. (Thanks Stu for the link). Kottke later realises the same thing I did, our gut instinct is dead wrong.
Maximal output är svåra grejer
Wee Date Picker Rails Plugin
RE: RE: RE: RE: RE: использование SQL функций
Some GTD criticism
Tell us what you think of the new BlogSphere feature. We are continually looking to improve and update the
functionality based on your feedback.

Find your next Ruby on Rails project or job.
Exclusive content,
regularly updated - onsite and tele-working positions listed.
Had my life changed by haml, figured that was worth at least a couple clicks and a sentence. thanks, hampton!
-
R.B, United States