Xbox 360 + Connect360 + MacBook Pro + Airport Extreme + external 500 gig USB2 hard drive = media centre awesomeness!
(I confess I stole the title from here because that title rocks. And fits.)
By chris on August 27th 2008 in /dev/random
I used MySQL for years and years before coming across this little MySQL output-formatting tip that makes all the difference in the world when viewing your raw data. Instead of:
SELECT * FROM users;
use:
SELECT * FROM users\G
The result is very nicely formatted output (almost YAML-like, save for the spacing) that’s much, much easier to read (at least for those of us on small, 17″ laptops instead of the mega 30″ monitors).
By chris on August 18th 2008 in /dev/random
A great article about how to tell if your kid’s become one of them dreaded hackers: Is Your Son a Computer Hacker?
I particularly like this bit:
There are, unfortunately, many hacking manuals available in bookshops today. A few titles to be on the lookout for are: “Snow Crash” and “Cryptonomicon” by Neal Stephenson; “Neuromancer” by William Gibson; “Programming with Perl” by Timothy O’Reilly; “Geeks” by Jon Katz; “The Hacker Crackdown” by Bruce Sterling; “Microserfs” by Douglas Coupland; “Hackers” by Steven Levy; and “The Cathedral and the Bazaar” by Eric S. Raymond.
Sadly, I confess to owning each and every one of those titles, and many more. To whom do I turn myself in?
(And yes, the whole thing’s a joke.)
By chris on August 12th 2008 in /dev/random
You’re installing Ultraspinx (perhaps per these instructions from Inoshi, which are the best I’ve found thus far) and you run into this error when time comes to bootstrap your installation:
~/Sites/ticklists/: sudo rake ultrasphinx:bootstrap –trace
(in /Users/chris/Sites/ticklists)
** Invoke ultrasphinx:bootstrap (first_time)
** Invoke ultrasphinx:_environment (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute ultrasphinx:_environment
** Invoke ultrasphinx:configure (first_time)
** Invoke ultrasphinx:_environment
** Execute ultrasphinx:configure
rake aborted!
You have a nil object when you didn’t expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
I couldn’t find this one in the google anywhere. Turns out the cause of this is defining non-existent properties for indexing on your models (perhaps I’m the only one dumb enough to do that).
You’ll know if this is the cause because you’ll see something akin to this in your Rails console:
** ultrasphinx: warning: field f is not present in User
** ultrasphinx: warning: field descritpion is not present in Profile
Remove (or fix the spelling of) those and everything should work hunky-dory.
By chris on August 7th 2008 in /dev/rails, /dev/ruby
If, when running in production, your Rails app throws the following error:
uninitialized constant Footnotes::Filter
You’re probably experiencing a collision between Rails’ initializer.rb file and Footnotes’ initializer.rb file.
The fix is detailed at the bottom of Searching a Ruby on Rails application with Sphinx and Ultrasphinx with the specific implementation details available via this github commit: 9bf8344b2d9ece09ff301dfc4e500e00fd46b9bc.
By chris on August 7th 2008 in /dev/rails
I love this rant: Read Giles Coren’s letter to Times subs.
That’s passion for your work!
By chris on July 31st 2008 in /dev/random
As a collective industry we’ve been building web apps for about fifteen years now. In many ways we’ve greatly improved our development processes, our tools, our methodologies and our expectations. Today we whip out Rails apps in days that would have taken months before; single developers are producing entire commercial sites where once a team would’ve been required.
But alas not all is golden in this day and age. Time and time again I come across development practices and code that would not have been out of place in 1995, and that is not a compliment (and incidentally, these practices and code would have been bad then too, we web developers were just too divorced from the comp-sci folks to know it at the time).
Fortunately experience and hindsight can now provide us with rough guidelines against which we might develop our own apps. In the spirit of fifteen years of web development advancement I present to you “You’re Doing it Wrong If”.
You’re doing it wrong if:
- You’re not building atop an open-source framework
- You’re writing your own framework upon which to build
- You’re not using a database abstraction layer
- You’re writing your own database abstraction layer
- You believe you can write it faster or better or more efficiently than any available library
- You have more than one developer on your project and no written coding style guidelines
- Your bug tracker serves as your functional scope or your development roadmap
- You aren’t using source control
- You comment the what but not the why
- You tend to pass properties instead of instances to functions
- Your “deployment procedure” involves any combination of FTP and/or drag n’ drop
- You write code in a manner that cannot be unit tested
- Your primary method of code reuse is copy/paste
- You don’t read any development blogs focused on your primary and secondary languages or technologies
- You haven’t been to a conference or birds-of-a-feather meeting in the past year
- The only code you read at work is your own
- You worry that some day someone else will read your code and know it was written by you
and finally
- You’re doing it wrong if you aren’t learning every day
Only truly terrible places are victims of all of the above, however no one is immune. The more hurried we are, the more stressed we are, the more of a monoculture we work in, the more likely we are to become affected by these ailments.
(It goes without saying that these are general rules of thumb, applying ye olde “90/10″ rule and you, of course, are part of the 10. However for the sake of everyone else I urge you to consider Bruce Schneier’s famous words: “anyone who creates his own security protocol is either a genius or a fool”. The odds are not in your favour).
Update: Changed “ORM” to “database abstraction layer”.
By chris on July 28th 2008 in /dev/random
Microsoft is sponsoring the Apache foundation and I am indeed impressed:
Microsoft is becoming a platinum member of the Apache Software Foundation (ASF), paying $100,000 annual membership.
Now one could take the cynical approach that it is yet more lip service from Microsoft about being “open” without actually being open (and really, a hundred grand is pocket change to MS) but I like to think this could be the start of something good. Especially given this statement:
Ramji, who made the announcements at the O’Reilly Open Source Convention (OSCON) Friday, promised “a lot more” PHP patches in the coming months now Microsoft had established processes he said clarified how employees can contribute to open source.
…
The decision to work on PHP fits with the overall strategy of improving the language’s interoperability with Windows and stemming the loss of PHP application deployments to Linux. LGPL allows code to be used with proprietary programs - such as SQL Server - unlike its GPL cousin.
(The word from the Apache Foundation itself.)
I had no idea Microsoft was even interested in PHP much less in a position to contribute patches. A quick googling suggests that this is not a new development so I suppose my surprise is a function of not paying much attention to web development on the Windows platform.
Regardless, PHP is the dominant web language and anything (and anyone) who helps improve PHP, regardless of platform, helps us all.
PHP, IronRuby… Microsoft, I feel like I hardly know you.
By chris on July 25th 2008 in /dev/random
User interface design is not about dumbing things down for the poor stupid user.
We software developers, understanding the software as we do, find it easy to look down upon those who lack our understanding.
This is wrong.
- These things I believe.
By chris on July 16th 2008 in /dev/random
A couple of weeks ago, in the middle of getting DreamBank ready for launch I was feeling like I needed a break. Of course that meant “what can I develop in Rails over a single weekend?” See, I had an idea for an application that would fulfill a need we had at DreamBank: how to manage incoming applicants and resumes against available job positions and I was pretty sure it would go.
My one-weekend project became a two weekend project and a bunch more time was shoe-horned in here and there for bug fixes and improvements until it was finally usable. And then we really got serious about the other launch and development got forgotten; it was released and functional and - dare I say it - even useful but neglected.
I now present to you “Applican“, a Rails-based resume/applicant/job tracker designed (as much as it has been) as an internal tool for small & medium-sized companies. For more details see the proto-documentation here.
I consider the current release to be about v0.4: it works, it’s useful, it undoubtedly has bugs, they’re may not be critical, there’s definitely functionality to be added. It’s free, it’s open-sourced, it’s available on Github and it require Rails 2.1.
(Apologies to Robert Rodriguez for stealing and bastardizing one of the best lines in cinema history).
By chris on July 13th 2008 in /dev/rails, /dev/ruby