Vendor/Gems and Rake

Today, I hit a little bump along the road of having a nice, simple checkout/run path in the Rails project I’m working on. The problem occurs when you don’t have a gem installed on the system, instead unpacking it into vendor/gems. In order for those to be included in the environment, you need to add everything underneath vendor/gems to the load_paths, something like this:

  config.load_paths += Dir["#{RAILS_ROOT}/vendor/gems/**"].map do |dir|
    File.directory?(lib = "#{dir}/lib") ? lib : dir

Unfortunately, the Rakefile only requires boot.rb and the load_paths aren’t updated. Since we are using Rcov, it was bombing out because the Rake task couldn’t be found. I had to add an additional line in the Rakefile, require(File.join(File.dirname(__FILE__), ‘config’, ‘environment’)) After that, everything worked just fine.

A Case of the Mondays

Everyone knows you’ll have bad days but the good thing is that they generally don’t happen too often. If they did, you’d have a tough time getting out of bed each day, heading to the office. Today though was a bad day. Mistakes were made last week and the bill came due this morning. I’m purposefully trying to find as many cliches as I can since they all seem quite appropriate.

Fixing code is a funny thing sometimes since you can introduce new things when seemingly fixing old things. That’s what happened in a nutshell but unfortunately I didn’t find out about it until 7AM this morning. It could have easily been fixed Friday afternoon but no, I knew nothing about it until today. Once I found out, the fix was easy and done fairly quickly but then the real fun began. The endless questions, the repeating of the steps, the reviewing of the process, all very legitimate but still it wears on you.

Simple Mongrel Handler

I have a project at work which I just need to break down a given URL and insert data into a database, nothing more, nothing less. Right now for convenience sake, I’m using JBoss, mainly because it was already setup and ready to go. That’s way too much stuff for this so I wanted something simple. Hopefully I’ve found that with Mongrel and the ability to create simple, custom handlers.

Since I can’t show the actual project, I’ve pasted a sample one which does pretty much what I want. I’m hoping to do some load testing on it this week and if it performs like I hope, life will be nice.

Technorati Tags:
,

Celebrating Failure

A week or so ago, Tara Hunt posted a thought-provoking blog entry. That isn’t really a shock since most of her pieces live in my browser tabs, waiting for some sort of response. Invariably, too much time passes before I comment and the moment is gone. Hopefully that isn’t the case for this one.

LoserCamp would be a take off from FooCamp and BarCamp, a sort of unconference bringing people together talking about the times they failed and how they learned from that failure. Many times, people don’t like to talk about their failures even if that failure spurred them onto greater things. It’s just not talked about. I’d like to see that changed and perhaps something like LoserCamp would help with that.

Failing is one of the most important things you can do and as a father, I’m finding it even more important to instill into the kids. The idea that you can fail, pick yourself up and move ahead, learning from what went wrong and making any sorts of adjustments into your future. That is what people and companies need to learn. I feel that too much of today’s plans are done via spreadsheets and metrics. Now, don’t think I’m totally down on metrics because I think they have a place in building your product roadmap but it isn’t the only thing that should go into building that roadmap. Part of the roadmap should come from intuition as well as trying different things and seeing what works and what doesn’t work.

I think one of the hidden strengths of Google’s 20% rule is that a developer can try many new things, failing more often than succeeding, yet each new project will benefit from that failure. It’s something that I would love to see instilled into the ‘Link because we don’t have the belief now that failing can lead to better things and because of that, we try to make every new application or project absolutely perfect from Day 1 and unfortunately that causes delays or things to not even make it to the public.

So get out there, try something new, skin your knees, pick yourself up and do it again.

Technorati Tags:
, , ,

Facebook Platform as the Evolution of the Portal?

David Sacks makes this argument in a recent guest post on TechCrunch. He’s see the evolution coming from the browsing of portals to search-based portals and now to a portal which your social graph pushes information to you. He sees the Facebook Platform as the example of the last step.

Obviously I’m a little biased because of my involvement in developing a traditional portal but I don’t quite buy Facebook as the end-all application. Yes, it is seeing some tremendous growth and people are building some great things for it but that does not mean this is exactly what everything will look like in the next few years.

That being said, now is a great time to build an application for the platform. All you have to do is look at iLike and the gains they’ve made since the launch of their application. They’ve seen amazing user signups and usage. I would love to see us put something together which could show off some of the newer applications we’ve been developing. They can be hidden behind the monolithic portal application unfortunately.

And perhaps that’s one of the keys of this new idea, that you are going to see mini-apps handle different things, you’ll be able to pick-and-choose these apps and if they are done well, have some sort of sharing aspect to the data. That could be an evolution if we let it.

Technorati Tags:
, , ,

Log4Twitter

Being on the Twitter API development list is a good way to hear about new little apps before everyone else. Case in point, Log4Twitter. It’s an Appender to log4j which is pretty much the standard logging component for any Java project.

This wouldn’t be for debug logging or information logging. I think it could be useful for those fatal happenings when things are breaking and shutting down. By using Twitter, you could easily subscribe to an account, mark it private and have an easy way of getting notified when something catastrophic happens.

I think piggybacks nicely on the concept of Twitter as a message bus, whether human or computer. That is a direction which could make things very interesting.

The other thing that happens as more machines enter spaces previously restricted to humans is that the potential for interaction based on overhearing emerges. I used “overheard” very deliberately earlier – to suggest we’re not getting the original message (which, presumably, is in XML or binary or something) but a chinese whisper of it, cast out in public via Twitter. But now imagine if the API is two ways, and telescopes, watching the Twitter timeline can start acting upon the things they overhear. Scheduling software overhearing the Victoria line announcing that it’s broken. My cooker picking up that I’m leaving the office.

Technorati Tags:
, ,

Creating a Web Framework with Conventions

Joe Gregorio has an awesome post detailing the work needed to create a Web framework with some very nice conventions.

They key point of adding ‘conventions’ is to take a load off the user. You need to actually remove two kinds of load, cognitive and manual. Cognitive load is the number of concepts you need to hold in your head. The fewer the number of concepts, and the more uniformly they are applied, the easier the system will be to use. Manual load is just the amount of manual stuff, like typing, that you need to do. Why should I have to manually create a directory structure when a computer is capable of doing that?

I think this is a great blueprint for any investigation one could do in building something new for the Web, no matter the language. Much has been said about frameworks like Rails and Django but they are not the end of development or at least they shouldn’t be looked at that way. There is always room for innovation and improvement, for new and different ideas to take hold. Look at the attention Seaside is getting for an example of that.

What Joe has done is show the way any language can building something with constraints. I think you could easily use this post as a way of improving your skills in the language of your choice.

Memcached

A few memcached-related blog posts over the last couple of days.

First, Tobias Luetke gives the the secret to memcached. It boils down to being as specific as you can with your memcached requests. In his example, part of the key was a version number which gets revved any time an update to a product is done. That way, cache misses will occur automatically after an update without trying to manage a full sweep of the cache.

Second, Greg Luck compares Ehcache with memcached and finds Ehcache to be faster. That’s somewhat understandable since Ehcache is being a local cache and obviously memcached has the network overhead for any put/get. I think these two have different roles and it isn’t that useful of a comparison. Kevin Burton has some additional thoughts on the benchmarks.

Technorati Tags:
,

Some Random Ruby / Rails Goodness

Here’s a few Ruby / Rails things I’ve seen around the Web the last few days. All are pretty cool…

Evan Weaver shows off some MySQL configurations for Rails.

Ilya Grigorik creates a simple RSS aggregator in 26 lines of Ruby code.

Here’s a custom Mongrel handler to create an XML-RPC server. I’ve been digging a bit more into Mongrel and custom handlers. I have some ideas for simple servers at work which might benefit from this sort of thing instead of the monstrosity that is JBoss.

And finally, splatter that array.

Technorati Tags:
, , ,