2K Sports is Back

Posted by Jake Good
on Jan 31, 07

A long time ago, it was announced that EA Sports signed an exclusive contract with the NFL for any football related games. Primary goals of such a huge contract were no doubt driven by 2K Sports being able to produce amazing football games… on par or above Madden. Also sparking the signing was 2K Sports decision to drop prices of 2K5 version of the games to $20 to start, outselling Madden that year.



And I guess EA knows how bad it sucks to not have NFL backing



At any rate, it pissed a lot of people off. Including me.



Now, 2K Sports will be back… with All-Pro Football 2k8

Links for Around the Intrawebber Grill

Posted by Jake Good
on Jan 30, 07

Here’s some linkage to keep you busy…



ActiveMerchant - Shopify Credit Card processing library for Ruby on Rails



Coding Horror talks about becoming a real developer… SO TRUE!



Voice Command 1.6 for Windows Mobile 5



A new version of Mint - freaking sweet stuff… love the dashboard widget



That’s all I got for today… have fun kids.

ActiveRecord Observers Revisted

Posted by Jake Good
on Jan 29, 07

In my previous post, I examined the usage and what I would call problems of current ActiveRecord Observers



I sent it out to the ruby.mn (Minneapolis Ruby User Group) on a whim, to get feedback… and I got quite a bit. In fact, I even got emails from people who have stumbled onto my blog… currently when you search for “ActiveRecord Observers”, my post comes up #4 (strange as how the article is only a few days old).



At any rate… what I mainly got from the feedback, is like the recommended model, my approach isn’t valid either. Yes, Casey, I’m coupling my observer to my observed class… and yes, Brian, the bad coupling now allows the observer to see the observed, which may not be the original intent.



It was also pointed out that my example might not be the best one… there was one simple point I was trying to get across, that my example was not self explanatory enough.



All I wanted to show is that the definition of my class requires that certain data be in the database to do filtering. When the first instance of that class gets loaded and the parser executes the class definition, it will make a database call to build out the definition dynamically (the CommentStatus class)… which in the case of running rake:test on a fresh database, the data will not be there… thus an invalid assumption occurs.



The main problem with my implementation is that it requires data to be present in the system for testing to occur, which IMHO should be taken care of by fixtures… but that’s failing because the fixtures are getting loaded after the assumption needs to run it’s check. It breaks loose coupling and the observer pattern… It’s a bad implementation, I get that.



I think what I was really trying to do was make my implementation behave more like an event driven system, like .Net where instances are responsible for notifying the things that subscribe to their events…Granted it’s not exact but I was trying to get the best thing done with what I had available (aka Observers). Maybe even a mix of “The Hollywood Principle”.



After much discussion, here’s what I realized… I’m going to leave what I have implemented in place cause it readable and it works until I can spend time refactoring it.



I will also try to get a simple Rails application that causes this to break without bad implementation (as I feel like loading fixtures after loading the test environment could break more than it helps)… and see if I can’t get a fix for it to send in a patch.

ActiveRecord Observers

Posted by Jake Good
on Jan 26, 07

This week has been hectic… I’ve been tasked with implementing a large feature in a short amount of time (isn’t it always that way?).



At any rate, I’ve come to one conclusion about ActiveRecord Observers.



The recommended way doesn’t make sense to me and can actually break.



Observers are meant to be classes that encapsulate functionality that might not be the responsibility of the class it’s observing, but it needs to take action when the class saves, updates, deletes, etc.



But yeah, it breaks in my certain scenario… and I’ve been thinking on how it could be done better.



But that’s one of the nice things about Rails. Since I’ve started working full time with Rails, I’ve dug deep into the internal code and figured out how I could accomplish what I wanted to.



Imagine the following scenerio:




class User < ActiveRecord::Base
has_many :comments, :conditions => ['comment_status_id = ?', CommentStatus[:approved]]
end

class UserObserver < ActiveRecord::Observer
observer User

def after_save(user)
# do some funky logic when a user saves.
end
end


Typically… (according to standard documentation)… you would register your UserObserver in your #{RAILS_ROOT}/config/environment.rb




config.active_record.observers = :user_observer


I don’t like this…



For two reasons:




  1. It’s confusing on where it gets wired up. A developer comes in, something weird happens when they save their User. Where would they go first? User… then some sort of controller… and if you eventually knew that it was an observer, you’d look at UserObserver. Never config/environment.rb

  2. This doesn’t work for tests when your Class requires data to be in the database… as in the given example. I’ll tell you why when I explain how observers work.



Well… here’s what happens when you type the magical line:




config.active_record.observers = :user_observer


ActiveRecord::Base class will iterate the symbols and classes you feed into observers=(*observers) and it will instantiate each one of the classes. Each one of the observers then registers itself with the class it observers (that little observer User line in UserObserver). This then causes that class to load.



Here’s the problem for tests… This stuff is happening BEFORE your test fixtures have a chance to get into the database… It will load your environment (config/environment.rb) long before it brings in data… so when it parses the observer UserObserver, which observers User, which in turn loads the class User… which causes the has_many to be parsed and executed… which requires that CommentStatus[:approved] to be solved, which goes to the database… to get the comment status of ‘approved’… which isn’t loaded yet from fixtures. You get the idea.



What’s the better approach?



Since observers=(*observers) is JUST instantiating instances of the observer, and it in turn instantiates the observed class… why not do this?




class User < ActiveRecord::Base
ActiveRecord::Base.observers = :user_observer
has_many :comments, :conditions => ['comment_status_id = ?', CommentStatus[:approved]]
end


This makes sense!




  • It gets loaded ONLY when the User class gets loaded… and it will happen after your environment is loaded and your fixtures get into the database.

  • It allows you to easily remove the observer…

  • It also makes it easier to find… you’ve essentially led the user right to the User model to find the observer.



The only thing I don’t like about this approach is that the User is knowledgeable about it’s observers… but in this case, I think it’s perfectly acceptable.



What do you guys think? Are there any caveats that I’m not aware of?

One of my Vices

Posted by Jake Good
on Jan 25, 07



Jason ‘Sundance’ Head sings Stormy Monday Blues - Bobby “Blue” Bland



this guy better be one of the top 5

My life as of late...

Posted by Jake Good
on Jan 24, 07

Man… I feel like I’m super busy, but when I actually write out what I do on a day to day basis, it’s still filled with stuff that could be replaced by more constructive activities.



For instance…



I’m busy with work, that’s constructive.



I’m busy at night reading news, books, watching movies, playing games, and watching a few TV shows… that’s not as constructive. Books and news maybe, but TV and games… not so much.



:: shrugs :: It’ll improve… I think it’s the weather ;)



One good thing! I had a very successful second date with a new woman… I’m excited to go out again with her!

A little humor for Sunday

Posted by Jake Good
on Jan 21, 07

**God, Inc.**



Episode 1





Episode 2
Episode 3
Episode 4



Check out this website for upcoming episodes!



(hat tip to John)

A new project idea

Posted by Jake Good
on Jan 19, 07

This one goes with the theme of today being Friday… if you’re a geek who’s into web development, you might chuckle.



Otherwise you might not get it.



The project will contain one empty index.html file (empty as in the DOM will be empty, but there will be one JS include).



The JS include will then connect back to the project and retrive a JSON representation of a DOM…



The DOM will then be injected and rendered on the screen.



Where does the content come from? A p2p JSON CMS. The first attempt to collect will alert and ask for a JSON representation of a page… and it will then use a javascript based p2p system to distribute the JSON and it will continually be modified.



Nice.

Rails 1.2

Posted by Jake Good
on Jan 19, 07

Congratulations goes out to the Ruby on Rails team for releasing…



Ruby on Rails 1.2



If it weren’t for this great web platform, I wouldn’t be at this point in my career!

Thumbs Up

Posted by Jake Good
on Jan 17, 07

Today I invented a new emoticon



^3 - thumbs up.



And Neil’s take on it…



8^ ^3 - the Fonz… Ehhhh!



Can you tell that my brain is a little fried from thinking too much about too many things?

Yeah This Kid is Better Than Me

Posted by Jake Good
on Jan 16, 07



Insane

SNL iPhone

Posted by Jake Good
on Jan 15, 07



It appears as though Steve Jobs was on SNL Saturday ;)

I'm glad I never played

Posted by Jake Good
on Jan 14, 07

I used to be addicted to Guild Wars… as much as everyone else is to World of Warcraft



But check this figure out…



8 Million Subscriptions to World of Warcraft



That means that nearly 0.1% of the ENTIRE EARTH plays World of Warcraft



(Well not really, this doesn’t include dupe accounts and could be a rough estimate)

hmpf

Posted by Jake Good
on Jan 13, 07

If anyone has Mephisto or Liquid templating experience… can you answer a question?



Why don’t my category/sections allow me to page? I have 99 articles in Personal, yet only 15 show up… with no links for pages.



Boo!

From Typo to Mephisto

Posted by Jake Good
on Jan 13, 07

As you’re reading this… it’s coming from a new Ruby on Rails platform… Mephisto



It’s taken me a good 3 to 4 hours to get everything converted and working properly.



Overall it wasn’t too horribly different. Added a few routing rules and had to change two small pieces of data in my old blog to accommodate the new system.



But other than that, it went smooth.



Let me know if you’re having problems…



One of the things that makes it easier is that there’s a built in URL rewriting engine… Here’s a set of rules that I found useful for a standard Typo install…



Mephisto::Routing.redirect ‘articles/?/?/?/?’ => ‘/$1/$2/$3/$4’



Mephisto::Routing.redirect ‘articles/tag/*’ => ‘/tags/$1’



Mephisto::Routing.redirect ‘articles/category/*’ => ‘/$1’



Mephisto::Routing.redirect ‘xml/rss20/feed.xml’ => ‘/feed/rss.xml’



Mephisto::Routing.redirect ‘xml/atom10/feed.xml’ => ‘/feed/atom.xml’



There you have it folks… The site will be running a little slow until I figure out why my stupid dispatch.fcgi won’t run.

Strange Text Messages

Posted by Jake Good
on Jan 12, 07

Late last night I get 3 text messages (one long message) from a random phone number…



(701)426-2682 … a little research indicates that it comes from Bismarck, ND.



The message as follows:



yo boi sup? yo nigga be terned too a 70s brutha n izn no brayd pimp no mo tyrell be gifin me a snoop do gg perm n pimp now i has a reel big nappy afrohed naw sayin? bichs be luvin da nappyhed speshly wite hos dey awl ova dis pimp ya hurred me? get yo husle ova at muh crib we be smokin dat wikid stiky stiky sipin sum purp be makin a nigga reel stoopider den we be pimp cruzen wit muh knew ecsalade pik usselfs up cupla wite hos



lil jazzz a3z



My first response:



Who is the gansta rapper?



Then a MMS message with this picture and text:



lil jazzz a3


dis hoo i be wy u be playin wit dis pimp? cum ova at muh crib n we be smokin dis playce up how u likes muh happy afrohed?



jus lil PiMpin jazzz a3z



So I call the number… and it picks up and starts playing Ludacris - Money Maker. Turns out that was the voicemail greeting. HAHA. I actually listened to the whole 4 minute song to find that out… great.



Another one just came in:



yo cuz I gets wit u reel sune i be bizy wit 3 wite get down bichs



jus PiMpin jazzz a3z



I’ll continue with updates in the comments…

All Day Long

Posted by Jake Good
on Jan 11, 07

I wish I could do this all day long…



Geekiverse

Posted by Jake Good
on Jan 09, 07

My home boy Mike just launched his new social networking swag thingy…



Geekiverse



Go check it out RIGHT now!





Ideal Job

Posted by Jake Good
on Jan 05, 07

I thought I’d take a second to analyze and describe what I would consider to be my ideal job… not necessarily ideal company, but job functions. I’ll try to describe it as easily as I can… and please don’t take this as me not being happy at my current job or that I’m looking…



Currently I’m a Ruby Developer… and was just previously a .Net (C#) Developer. Both of these positions were in various degrees of consulting… essentially working on projects for clients under the respectful firms (employers). Interestingly enough, both were/are very similar to product development as I’ve been involved primarily in one project…



What I’d like to do ideally would be to stay in the realm of computer science and software development… but move towards a Research & Development style of position.



I’d like to be able to define projects that I’ll work on that may or may not have significant impact on the world. I’d like to have a team of developers working with me, with me being somewhat of a lead position, and I’d like to be able to patent some of the ideas/concepts that were generated. I’d also like to keep it language/platform agnostic… and just use the right tools for the job. I’ve used many languages: Fortran 77, Ada 95, C, C++, C#, Java, Ruby, Lisp, Scheme, BAL, and Mumps (M). Though I am only professionally experienced in C# and Ruby.



As far as fields of research… I am really passionate about a few scientific areas and naturally, due to this job being ideal, I’d like to be focused in on those subjects. Including but not limited to: genetics, bioinformatics, robotics, artificial intelligence, neuroscience, and archaeology. Lots of other areas would be just as cool as long as it involves modeling of systems and producing developmental code / applications / systems that are radical and that can benefit humanity.



Interestingly enough, I’ve already researched and wrote code in all of those areas sans archaeology (which was chosen mainly for my childhood viewing of Jurassic Park).



There ya go… There are interesting companies in the US that are in need of people like me… and I would encourage them to contact me… as I will definitely be contacting companies in my future.



What is your ideal job?



As always, if you have any information pertaining to my ideal job, I would love to hear from you!

Thoughts on Tech Bubble

Posted by Jake Good
on Jan 03, 07

So I’ve had a lot of spare time to think lately and I’ve come up with some things to chew on if you’re in the tech world…



Where is user generated content going?



It seems to me… that one of the largest factors in the latest Web 2.0 bubble has been user generated content… sites like YouTube, MySpace, and Flickr are all dependent on user generated content.



So what’s next? It seems to me that people will generate the content, but it’s meaning will continue to diminish as time goes on. Think about this for a second. YouTube videos are worthless unless it catches on and lots of people watch it… MySpace is worthless unless you find a ton of people to look at your stuff and comment (people are always begging for picture comments)… and Flickr is worthwhile for storing images but there’s still a popularity factor.



That’s the key… popularity. In the United States, a kid’s life is focused around popularity. As terrible as it is, kids will do ANYTHING to be popular. These websites are just one medium to facilitate this. Will it last? I don’t think so… once kids start realizing that these (now) polluted websites (with spam and pr0n) are going to lose value, they’ll leave. The sites are already becoming disposable, it’s just a matter of time before they crumble.



What is the next step?



I’m not entirely sure… if I knew, I’d be rich like the YouTube kids… but I will talk about it for a second. What do people online crave and need?




  • Ability to contribute and have it mean something

  • Possibility of popularity and fame.

  • Ability to communicate (becoming less important). More like the ability to make an initial connection.

  • Ability to make money (not entirely just yet, but if you tell a 13 year old that they can make money easily online… goldmine for man hours)



That’s about it really… think about it, it covers social networking, user generated content sites, and all in between. There’s a lot of other things to consider… but if you start putting focus on a few of these concepts, you might have something.



This is where niche sites will take over. There you have it, that’s my prediction. I think there will be a HUGE spurt of niche sites, that will offer MORE meaningful content for people looking for it… it will offer BETTER chances at fame and popularity by having that be fueled by people you know and that have similar interests. Say you’re a great basketball player… do you want your video of your sweet shot to be seen by an NBA scout or a 16 year old girl dancing in her room to Britney Spears? The ability to initiate connections is exactly what a niche site can facilitate easily… and most important… if advertisers can narrow down demographics of a site to more important figures, you’ll get more money. If there are other things you can offer your members that mean more, you’ll get more people.



Take Curbly for example. Two of my friends, Ben and Bruno, have had wild success with their site, Curbly. It’s one of those niche sites that offers it’s users more detailed information… and more relevant information. The rewards are directly related and it gives users a chance to show off their interests to people who know and understand… it simple means more.



Here’s an idea for a niche site.



Granted… this kind of site requires more skill and equipment than the average internet user with a webcam has… but it could be interesting. Host a contest in which the internet collective as a whole produces a movie. Have people create 5 - 15 minute segments and allow users to vote on which segments make the cut. Have a rough draft of a plot, but leave it up to people to be creative with dialog and blocking. I don’t know… maybe it would work.



But the problem becomes



What happens when you have too many niche sites, or sites that pretend to be niche and end up getting too big… or sites where the niches cross. Which niche site is better than the next? Yikes… so many questions.



I’m done for the day.

So you want scary?

Posted by Jake Good
on Jan 03, 07

Watch The Descent… seriously had me sweating and jumping more than once.



the_descent-screenshot01


If you’re deathly afraid of small spaces and caves, this movie will drive you nuts! I remember as a kid trying to go through caves and whenever it came to crawling on the ground or tight spaces, I always freaked out… this movie brought me RIGHT back to that place.



Incredible!

Welcome 2007

Posted by Jake Good
on Jan 02, 07

Holy shit…



I wake up from a crazy night of NYE partying… and BAM! It’s 2007 and I have to go back to work! Getting a week off was freaking sweet. That’s for sure!



So yeah, you’ve probably noticed the neglect of the blog on my part… yeah well, it happens. I had the whole week off; so I ventured to Iowa. For the most part I stayed off line and even away from video games. Yeah, imagine that!



Aside from seeing my family… and their smiling faces, I got to see the girl I wrote about a few weeks back. Yeah, it rocked… I spent as much time as I could, dinner… drinks… etc. I saw a few other people, including Rebekah! Great times!



Then I came back, met up with Tom Johnson and Gregory Peck… threw a hellacious NYE party. We played some beer pong, guitar hero, and the guys (including myself) decided to play dress up and roll around in suites and sport coats at midnight. Had a little too much champagne… YEAH SON!



AT ANY RATE… it’s finally time for me to get back to work… take care!