Displaying articles with tag

Evaluating an expression in a RegExp

Posted by hardwarehank, Mon Aug 14 13:15:21 UTC 2006

Horray! I can evaluate the right side of a regular expression!

e   Evaluate the right side as an expression.

Wow.

Tags:

Freezing Rails and Zeller's Congruence

Posted by hardwarehank, Mon Aug 14 11:33:18 UTC 2006

Lately, I’ve been doing a lot of code golf. A Lot. During the calendar challenge, I was trying to find a way to obtain the first day of the year for any given year taking into account leap years. _W_ on #codegolf/freenode was kind enough to point out Zeller’s Congruence, which I think will work out well in the final project I submit.

In other news, I froze an app to Rails 1.1.6 today. It involved this:


/www/ugres/ugr/config/../vendor/plugins/engines/lib/engines.rb:138:in `start_engine': undefined method `add_path' for Controllers:Module (NoMethodError?)

and later…


/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:21:in `require__': no such file to load -- authenticated_user (MissingSourceFile?)

The Fix is simple:


script/plugin install --force -x engines
script/plugin install --force -x login_engine

Then, just freeze the crap out of it:


sudo gem update rails
rake freeze_gems

I opted for freezing at 1.1.6 rather than a safer earlier one since the old ones (sans 1.1.3) are affected by a terrible DoS bug. People can execute stuff remotely. Bad… So make sure you upgrade, and don’t be afraid to freeze even if it’s really cold outside.

Tags: