Every so often I have the need to execute a command line application from a Ruby application/script. And every single time I fail to remember what the different command-executing methods Ruby provides us with do. This post is primarily a…
A long time ago (one day short of exactly 4 years) I posted a super simple - and to be honest - pointless Hello World example using Ruby on Rails. Back then the Rails version was 1.0. Today marks the…
Yesterday I got bit by this fairly obscure behavior in ActiveRecord: >> person = Person.first => #<Person id: 1, name: "Jakob", height: 170, created_at: "2010-01-22 08:57:02", updated_at: "2010-01-22 08:58:57"> >> person.height = 169,5 => [169, 5] >> person.height => 1…
I am currently wrapping up a client-project where I am preparing a Rails application for internationalization. The application is currently in English and I am translating it to Danish as a proof of concept. I am using the I18n::Simple backend…
Back when Yahoo! released their YSlow add-on for Firebug, I took it for a spin and optimized biq.dk using it. Google recently released their variant of YSlow called Page Speed. Like YSlow, it’s an add-on for Firebug and it provides…
Read the full entry, Browsers, Programming, Projects, Software, Usability, Webdesign , 3 comments
When I first read the Java Kicks Ruby on Rails in the Butt article by Javier Paniza, I brushed it aside as something from the time when Rails was just getting traction and people using related, established technologies started feeling…
I have been moonlighting as a freelance webdeveloper for the last couple of years. The first year, I was using my spare evenings and weekends until I began having trouble finding enough time to dedicate to new projects. My reaction…
Business, Life, Programming, Projects, Software, Usability, Webdesign , 7 comments
Take 12 attendees (one from Italy, way to go, Fransesco!), 11 Apple laptops (and one Windows one, I believe), 1 wifi hotspot, mix it all together in “a cottage”:http://flickr.com/photos/wa7son/2981895522/ in “the middle of nowhere”:http://maps.google.com/maps?f=q&hl=en&geocode=&q=langegyde+75,+denmark&sll=55.056251,10.453148&sspn=0.061353,0.129089&ie=UTF8&t=h&ll=55.045618,10.462825&spn=0.007302,0.016952&z=16&iwloc=addr, sprinkle it with a tad of “Ruby”:httpL//ruby-lang.org, “Git”:http://git.or.cz/, and “*jour”:http://drnicwilliams.com/2008/06/18/what-is-gitjour-gemjour-starjour/ and let is stew for 2 days and 2 nights.
On one of my projects the specs are now taking a full 10 minutes to run on my machine. Needless to say, it’s mightily annoying seeing a spec failure in the output knowing you’ll have to wait for 10 minutes…
During development of a small Ruby application today I ran into a minor issue with RSpec and Mocha. Earlier today, I was developing a small Ruby application, trying out RSpec instead of the usual Test::Unit, using Mocha for my stubbing…
Jesper asked on the Copenhagen Ruby Brigade mailing list what scripts and tricks use to launch their environment when developing Rails projects on OS X. iTerm shell script A bunch of people pointed to this handy iTerm shortcut, which uses…
Over the last few days I have been moving the BiQ application to Rails 2.0 PR. I’ve so far run into a fair deal of issues; one annoying one that I figured I’d share. The gist of the matter is…
During his keynote today, and now on the Rails blog, David explained the new policy for getting patches into Rails. Basically the new policy requires every patch to have documentation, tests and 3 supporters. It’s a welcome change, especially if…
Looks like someone decided to resurrect the Railsday concept. While it has a different name, a different duration, a different judging process (and probably a ton of other differences), Rails Rumble is still all about getting a small team together…
2 hours down the drain, and all I had to do: sudo port install ImageMagick sudo port install rb-rmagick…
Yahoo! has released a great Firefox addon - or rather, an addon for a Firefox addon - called YSlow. YSlow allows you to analyze and suggest improvements to various performance metrics on the website you’re currently visiting. For kicks I…
I am having massive problems connecting my MacBook Pro with the Microsoft SQL Server 2000 we have at work. I’ve connected to the same SQL Server (more or less) painlessly from Debian a couple of times before, so it…
You know we’re sitting on four million pounds of fuel, one nuclear weapon and a thing that has 270,000 moving parts built by the lowest bidder. Makes you feel good, doesn’t it? After launching the rewritten and redesigned BiQ I…
BiQ on Rails, Browsers, Programming, Projects, Software, Technology , 5 comments
After 6 months of evangelizing and advocating, followed by 6 more months of rewriting, and then 3 more months of building new features and enhancing existing ones, we have finally launched the new version of BiQ. Going from ASP/VBScript on…
BiQ on Rails, Programming, Projects, Software, Technology, Webdesign , 3 comments
Rails 1.2.3 was released today, primarily to fix a few bugs and compatibility issues with the recently released Ruby 1.8.6. Since the Rails team doesn’t provide an aggregate changelog and I was going through the individual changelogs to see what…
The Rails core team is cleaning up. That’s obviously a good thing, however it does leave us facing a kabillion deprecation warnings when running tests and whatnot. Unfortunately the official deprecations page appears to have been thrown together quickly after…
Cool, I made it into the top 40 Rails contributors in January. Which means I might end up with a free registration to the US RailsConf 2007 and a hotel room, courtesy of CD Baby - assuming enough of the…
This is a followup to my previous rant about the state of accepting online subscriptions. A few things happened after my post. Most importantly the client met with a focus group of potential users, and - among other things -…
Around 6 months ago I started the actual progress of rewriting our existing, customer facing application at BiQ. A week or two before christmas the rewrite went feature complete. That is; all the features we want and need in the…
BiQ on Rails, Programming, Projects, Technology , 2 comments
Last week I took a quick executive decision to deploy BiQ on Debian Etch instead of Sarge as initially planned. Mainly so we could take advantage of Ruby 1.8.5 (let me hear you scream “Mongrel”) and Subversion 1.4.something. Today, yet…
Rails views are powerful creatures. You have the full power of Ruby right at your fingertips, which makes it easy to write too much Ruby code in your view making them become cluttered and hard to read. The following is…
Payment gateways, merchant accounts, transaction fees, statements, grraaaah, it’s driving me bonkers. Here’s the deal: I have a client wanting to sell subscriptions for his web application. Nothing fancy, everyone’s doing it. It should be easy finding a payment gateway…
Google Code Search is a new search on Google Labs specifically for searching through, well, source code. And what do the geeks do with it? Figure out how many fucks are in the code of various languages Find serial number…
Railsconf Europe 2006 opened today and is now well underway. Unfortunately, I did not get to go there, however Jesper and other members of Copenhagen.rb are there, and Jesper is liveblogging the event on copenhagenrb.dk. Good job, Jesper!…
There I go again, trying to be too clever for my own good. In an attempt to do less I tossed the fixtures loading into test_helper. I figured it’d be a lot easier to just add to that single fixtures…
Wow, an exception error message that actually suggests a fix for the error, and the fix is correct. How great is that? ActionController::RedirectBackError: No HTTP_REFERER was set in the request to this action, so redirect_to :back could not be called…
Geoffrey Grosenbach recently discoved what’s effectively method_missing for rake tasks. I’ve taken his experimental proposed rake task, and changed (I’m reluctant to say “improved”) it slighty. This modified version uses a different syntax (rake test:foo:bar instead rake foo_bar) and regex…
I am now well over a week into putting BiQ on Rails, and I’ve been having so much fun. The fact that I actually getting paid for writing code that’s pretty and well tested means so much to the enjoyment…
At long last! I got the final commitment from my boss. We’ll be moving down the path of rebuilding BiQ using Ruby on Rails. Goodbye stupid ASP, hello sweet Ruby. Our preliminary tests shows that nothing we are currently doing…
So I am getting this error in my Windows Application Event Log: The log file for database ‘tempdb’ is full. Back up the transaction log for the database to free up some log space. Fair enough, it happens. But when…
Microsoft, a company that proclaims to be devoted to web standards, has updated parts of their MSDN Library VBScript Language Reference. They’ve hidden the most valuable details of each funtion behind some pointless click-to-expand links. Apart from being a usability…
After 24 hours of insane, non-stop coding, designing, talking, and general tom-foolery, Rails Day 2006 is over. Nearly 200 teams competed, committing over 5000 total changesets to the official SVN server. My team Even though I got a team fairly…
This coming Saturday will bring about 24 hours of Rails programming mayhem. Participating would be extremely cool and fun to boot, but I have no team or no really good ideas for a killer application. So uhm, anyone need a…
The venue for the Ruby on Rails Copenhagen meetup has been found: Café Selina (top floor), Skindergade 43, Copenhagen. Jesper has the details and links….
Thursday, June 29th, at 20:30 we (Jesper Rønn-Jensen and I) would very much like to see anyone with a passion for Rails at some unspecified location in Copenhagen. It’s just going to be a casual and relaxed meetup to see…
Also known as “The blog post where Jakob publically ridicules himself pretending to know squat about benchmarking” As part of our investigation into changing platforms, we’ll be looking for ways to make Rails or Ruby break down and cry. We’ll…
For the first time a Rubyism has bit me using Rails. I needed to make sure a field was set to false and not null. So I added af before_save callback to my ActiveRecord model: before_save :set_defaults def set_defaults self.signup_completed…
Thursday marked a major step on the path to exploring Rails as an alternative for BiQ. As I’ve mentioned earlier I’ve been looking for someone to come and present Rails for us. We found Scott Raymond of Blinksale and IconBuffet…
Read the full entry, BiQ on Rails, Business, Programming, Projects, Technology , 2 comments
At the recent Canada on Rails conference Robby Russel introduced his upcoming plugin, Acts as legacy. Facing a 60+ table legacy system, I will definitely be watching that space. Acts_as_legacy would allow me to not worry about our existing scripts…
It seems I have stirred quite a pot around the office with my recent ravings about Rails. Today the tech-head on the board sent me this article about why Rails won’t make it into the mainstream and asked for my…
In an effort to get a feel for the effort it’ll take to rewrite BiQ, I’ve been rewriting a vertical slice of our functionality. As part of that I’ve been setting up a test Ruby on Rails application and building…
Quick tip: If you want to run your Rails test suite through Rake on Windows using SQL Server, you need to have the scptxfr.exe utility in your path. On our development server, which is a pretty standard Microsoft SQL Server…
At the day job I’m the sole developer and maintainer of a legacy ASP/VBScript system. Yes, ASP/VBScript. No, not .NET. And yes, it’s driving me insane. The code contains around 42000 lines of VBSCript drivel and 30000 lines of supporting…
BiQ on Rails, Business, Programming, Projects, Technology , 2 comments
I want snippets of code that I publish here on Mentalized to have fancy colors and syntax highlighting. It makes reading code easier in my editors and it should make it easier here as well. Enter CodeHighlighter. a lightweight, unobstrusive…
Read the full entry, Mentalized.net, Programming , 0 comments
Today, on #rubyonrails, a stubborn developer insisted on storing phone numbers as integers. The rest of the channel tried to persuade him/her that this was a really, really bad idea. Part of the conversation went: <Cyanshade> you assume that all…
There is a newer version of this article updated for Rails 3 To some people Rails have a fairly high learning curve. And certainly, it’s somewhat higher than, say, PHP. However, in the longer run learning Rails definitely pays off….
So RailsConf 2006 registration has opened. Boy oh boy, would I like to go. But clocking in at minimum $400 for registration and a lot more for travelling expenses I can’t justify it. The side job doesn’t currently make enough…
One of the oft-ranted about features of Rails, is the Inflector - also known as that f***** pluralizer. To turn it off, put this in your config/environment.rb, below the line that says “Include your application configuration below”: ActiveRecord::Base.pluralize_table_names = false…
While checking out Scott Baron’s coverage-tool for Ruby, insurance, I ran into a minor issue on my - by now - fairly beat up Debian installation. jcop@mental:~$ sudo gem install insurance Attempting local installation of ‘insurance’ Local gem file not…
Woo, Ruby on Rails finally gets that mythical 1 point oh label. Congratulations core team. And with a great-looking new website designed by Jason Fried, 37signals is making sure noone misses the link between the signals and Rails. Good things…
WoW Snitch is a small application of mine that eases the pain of uploading data from your World of Warcraft AddOns to multiple websites. If you know what Matt Millers fine UniUploader is and does, you can think of WoW…
To set the content type and character set of your responses of your Rails applicaiton, add this to your Application Controller (/app/controllers/application.rb): class ApplicationController < ActionController::Base before_filter :set_content_type def set_content_type @headers["Content-Type"] = "text/html; charset=utf-8" end end This can obviously be…
In these times where Rails 1.0 Release Candidates introduce memory leaks, bugs, and whatnot, you might want to lock your Rails application to a tried and tested version. In your config/environment.rb, change your require_gem lines from require ‘active_support’ require ‘active_record’…
Andy Budd has posted a about the stages of technological acceptance. They seem to mirror my acceptance of Ruby and Rails quite well. I remember back when David showed me Ruby for the first time. Come to think of it,…
This little Ruby on Rails snippet solves a problem I’ve seen some people get confused by. I figured I’d share my way of doing it. The trick to behind creating a has_and_belongs_to_many association that associates rows in the same table…
What’s wrong with this line of Ruby on Rails code? Car.find(:all, :conditions => [‘cars.year = ?’, @year]) If you’re doing your own, internal application, nothing major is wrong. However if your application is meant for distribution and end-user-deployment, you’re making…
Aristotle Pagaltzis of Plasmasturm about hiring people with no experience in some specific programming language: […] if I was a manager, I’d consider someone who has no experience with the tools the company uses but no problem picking them up…
Man, I love how humanly readable Ruby on Rails code can be. I mean, I reckon even my mother could guess what this line of actual code does: redirect_to login_url unless current_user.has_permission_to(MANAGE_USERS)…
I had this sent in a mail today, and frankly am not quite sure what to make of it. According to MSDNs documentation for the WM_PICTURE structure, if your structure ever needs to contain “A bright colored fish”, you need…
Lately I’ve been getting the occasional “Error 12 from table handler” from the MySQL server on my latest pet project. It’s only certain queries that fail, but when it has failed once it seemingly keeps failing until the MySQL server…
Gah, using Ruby on Rails is seriously influencing my productivity at work in a negative way. I take longer doing simple stuff, my code has more errors and never works the first time anymore. “Why? How? Everybody else praise Rails…
MSDN’s documentation sucks. Wanting to raise a runtime error in VBScript, I looked up the appropriate method; err.raise on MSDN. The description there is pretty straightforward, until you get to the part where you want to decide on an error…
I spent a good deal of yesterday adding testcases to the recently added unittests on BiQ. I really like the way unit testing invites me to break my code by coming up with unhandled cases. I basically went through my…
English proverbs represented as code. If you can guess what they are, I must have made them at least somewhat correct: if (book.page != book.cover) { judge(book); } if chickens.state == "hatched" { return chickens.count; } if (bodyPart.isClass(Hand)) { if…
Being a wee, humble programmer working on a comparativly small project like BiQ, it is somehow comforting to read a Blizzard programmer publically state about a feature he did on World of Warcraft: […]I had to implement that. I probably…
I’ve had the pleasure of working on a part of our website that my boss was acceptance testing We had a session today at work where my boss was acceptance testing part of our website while I was working on…
Once in a while on a project design phase, you make a decision based on all the right reasons which later turns out to be a stupid decision. In some cases you won’t realize the decision was stupid until it…
Sigh, going through one of our more complex, rarely edited sourcefiles at work, I came across this line: j=i+19 I have a reasonably good grasp of what i is. j seems to have very little relation to anything, and I…
Why oh why am I stuck developing ASP/VBScript - that language is so crippled I can’t believe it. Every time I try to do something Right™ I bang my head against silly limitations of the language. At the moment I…
Gah, I just spent the last hour on the phone with a developer trying to debug a Python script, that had to run in our enviroment and couldn’t be debugged by him locally. Long distance eXtreme Programming I suppose. We…
While developing a template parser to replace our existing template-object at work, it finally dawned on me how insanely slow ASP/VBScripts standard string concatenation actually is. It isn’t something you’d notice in everyday development, but when you have to concatenate…
Or “Why forcing links into a new window is bad” I realize the topic of opening links in new windows has been covered countless times, but the dead horse has shown its ugly head and I am intent on beating…
Read the full entry, Browsers, Programming, Programming, Usability, Webdesign , 0 comments
Or “Why forcing links into a new window is bad” I realize the topic of opening links in new windows has been covered countless times, but the dead horse has shown its ugly head and I am intent on beating…
Read the full entry, Browsers, Programming, Programming, Usability, Webdesign , 0 comments
The barely noticable, yet significant alarms in the back of my head are going off again - The RidiculousPatent-sense is tingling: An application program interface (API) provides a set of functions for application developers who build Web applications on Microsoft…
I admit, I have commited one of the death-sins of project development. I let myself to believe, that a tight schedule and increased working hours would enable me to fulfill the deadline my boss had set for a project. As…