A little update

Posted by sbecker Fri, 03 Mar 2006 01:54:00 GMT

A quick update:

  • I’ve finally left (or begun moving from) the dark side. I bought a MacBook Pro. Much $$$, but I’ve been planning this for a while. Now I have to wait a month to get it! Damn!
  • My 3 year old Gateway laptop screen died. So I sent it in for repair. As soon as I got it back, the hard drive promptly went kaput. I have to send it back again. I miss having a laptop.
  • I’m going to SXSW Interactive! I hope to meet all you web people there.
  • I’m also going to RailsConf! And I’ll have my mac laptop by then, so I can be cool like the rest of the gang.
  • I bought the Rails Recipes book, very nice.
  • I tried to get Rails accepted at my part-time day job, and got shut down. It’s all .NET there, all the time. What a shame. Their preference is to continue paying exorbitant Microsoft licensing fees, when better, faster alternatives exist for free. I have to grin and bear it. I’ve got some decent ORM database stuff going now, but its just not the same. Not even close.
  • I’ve just wrapped up my latest two major Rails projects. I should probably write those up here sometime soon.

To all who want the Grid control – yeah it works, but the code is sloppy and not very Rails-ish. Too much view logic in the controller. I want to re-write it before I put anything out there with my name on it. I’ll start “Getting Real” soon, I promise!

Active Record Relationship Design Patterns 7

Posted by sbecker Fri, 20 Jan 2006 06:30:00 GMT

In the world of web applications, eventually you’ve seen it all, and you start to see the same relational patterns occur over and over. To help out the newbies, here’s a list of various relationships (in Ruby on Rails syntax) that we see all the time.

Can you think of any more common relationship patterns?

Customer Relationship Management

class Company < ActiveRecord::Base
  has_many :contacts
end

class Contact < ActiveRecord::Base
  belongs_to :company
end

E-Commerce

class Category < ActiveRecord::Base
  has_many :products
end

class Product < ActiveRecord::Base
  belongs_to :category
end

class Order < ActiveRecord::Base
  has_many :line_items
end

class LineItem < ActiveRecord::Base
  belongs_to :product
  belongs_to :order
end

Roles Based Access Control

class User < ActiveRecord::Base
  has_and_belongs_to_many :roles
end

class Roles < ActiveRecord::Base
  has_and_belongs_to_many :users
  has_and_belongs_to_many :permissions
end

class Permission < ActiveRecord::Base
  has_and_belongs_to_many :roles
end

Mailing Lists:

class MailingList < ActiveRecord::Base
  has_many :subscribers
end

class Subscriber < ActiveRecord::Base
  belongs_to :mailing_list
end

Surveys / Questionaires / Quizzes:

class Survey < ActiveRecord::Base
  has_many :questions
  has_many :responses
end

class Question < ActiveRecord::Base
  belongs_to :survey
  has_many :choices
end

class Choice < ActiveRecord::Base
  belongs_to :question
end

class Response < ActiveRecord::Base
  belongs_to :survey
  has_many :response_choices
end

class ResponseChoice < ActiveRecord::Base
  belongs_to :response
  belongs_to :question
  belongs_to :choice
end

Hierarchical Content Management:

class Page < ActiveRecord::Base
  acts_as_tree
  acts_as_list :scope => :parent
end

Blogs:

class BlogEntry < ActiveRecord::Base
  has_many :comments, :dependent => true, :order => "created_at ASC"
end

class Comment < ActiveRecord::Base
  belongs_to :blog_entry
end

Social Networking:

(from: wiki.rubyonrails.com)

class User < ActiveRecord::Base
  has_and_belongs_to_many  :users,
                           :join_table => 'users_known_users',
                           :foreign_key => 'known_user_id',
                           :association_foreign_key => 'user_id',
                           :after_add => :create_reverse_association,
                           :after_remove => :remove_reverse_association

  def known_users
    self.users
  end

  private
    def create_reverse_association(associated_user)
      associated_user.known_users << self unless associated_user.known_users.include?(self)
    end

    def remove_reverse_association(associated_user)
      associated_user.known_users.delete(self) if associated_user.known_users.include?(self)
    end
end

Any major ones I’m missing here?

Discovering Podcasts

Posted by sbecker Wed, 18 Jan 2006 01:59:00 GMT

Podcasts are great. I only listen to them when I’m stuck in a car driving and can’t do anything else, but when you ARE doing that, it’s a great way to keep your brain active. It also allows you to fulfill your dreams of thinking about whatever you’re interested in literally ALL the time. Forget day dreaming and thinking about other aspects of life. I now think about web design and development 20% more of the day, not to mention balancing my two careers where I do just that! Oh well, this is an experiment in total immersion.

My favorite podcasts:

Venture Voice: This is the model by which interview-style podcasts should emulate – Greg Galant has a professional, polished interview style which makes you forget this is a Podcast and not NPR. He’s also got one of the more unique accents our there (atleast to my Florida ears), and seems to be able to get interviews with anybody who’s anybody in the tech and venture capital worlds. Listen here for inspiring stories from people in the trenches building new companies right now.

Ruby on Rails Podcast: The web development framework which continues to kick ass has its own Podcast, hosted by Geoffrey Grosenbach of TopFunky.net, author of the nuby on rails blog, the Sparklines, Gruff, and pure-CSS graphing libraries for Ruby, and lots of other helpful stuff. This Podcast interviews the who’s who in the RoR world, where the creators and big users of RoR get together and feel good about Rails.

Boagworld.com – A couple of funny brits hang out and talk web design. Each show focuses on a specific aspect of the biz. They go off on tangents here and there, but I’ve already learned some interesting tidbits from the couple shows I’ve listened to so far. And I’m getting better at imitating british accents at the same time!

Web 2.0 – A couple of funny americans hang out and talk web 2.0. They also conduct interviews. In show 7, Jason Calcanis of Weblogs, Inc. basically turns the interview around and asks the interviewers a lot of the questions. It’s funny. This is another show to hear interviews from the who’s who of the web.

I also plan to check out the Audible Ajax podcast, since they just interviewed Thomas Fuchs of Script.aculo.us, and the newly discovered Duct Tape Marketing podcast, since they conducted yet another interview of Jason Fried. Although, I don’t know how much more Jason Fried interviews I can take. I like the guy and his company, but I’ve already heard the gospel many times, plus I regularly read Signal vs Noise and peruse the 37signals website. How much new information could their POSSIBLY be?!

Never the less, I can’t resist, and I will probably download these new interviews at Duct Tape and Web 2.0 just in case there is anything new or inspiring in them.

google maps api 1

Posted by sbecker Fri, 11 Nov 2005 20:12:00 GMT

I started messing around with the Google Maps API today. Seeing all these “mash-ups” has convinced me that it must not be that hard, and it isn’t!

One thing you quickly discover is that google doesn’t supply you with a built-in way to translate an address into lat/long coordinates – the input they accept in order to plot points on the map.

So, I search for ways to do that, and find an article by John Resig that shows how to use perl to create a proxy to GeoCoder.us. That was exactly what I needed, except I needed it in C#. I bet if I searched harder, I could’ve found something, but it was pretty quick to whip it up myself, so here’s the code to do it:

double geoLat;
double geoLong;

// Address of Google
string address="1600 Amphitheatre Parkway,  Mountain View CA 94043";

string url = "http://rpc.geocoder.us/service/rest?address=";

XmlTextReader reader = new XmlTextReader(url + address);
XmlDocument xmlDoc = new XmlDocument();
xmlDoc.Load(reader);

XmlNodeList gPoints = xmlDoc.GetElementsByTagName("geo:Point");

geoLat = Double.Parse(gPoints[0]["geo:lat"].InnerText);
geoLong = Double.Parse(gPoints[0]["geo:long"].InnerText);

up and away 1

Posted by sbecker Fri, 11 Nov 2005 02:29:00 GMT

Sweet, I’ve finally managed to upgrade to the latest Typo release (2.6.0) and move this blog to Dreamhost. I just couldn’t get my sites to stay up on Textdrive, so unfortunately I’m having to move away. I really like TxD, with the cool hacker culture, the active forums and direct association with rails, but I just found them to be too unreliable. More often than not I would go to my sites and find them down, or getting a random error. I realize its a challenge in a shared hosting environment, with lots of developers trying random things, but I haven’t been having these issues at Dreamhost, so here we are.

up down up down 2

Posted by sbecker Wed, 21 Sep 2005 14:16:18 GMT

My textdrive websites (including this blog ) have been going down as much as they have been staying up. For no reason, whatsoever. As you can imagine, this is immensely frustrating. At some point in the past I setup Daedalus to detect the absence of a lighttpd process and restart it, but i realized today that the daedalus process wasn’t setup as a cron job, so it wasn’t running, thus my lighttpd instances weren’t getting restarted. I’ve been restarting them manually lately, whenever i discover the sites are down, which seem to pretty much daily. Why lighttpd suddenly ceases to run, I have no idea. I have lighttpd setup as a cron job to start every time the server boots, but this apparently insures nothing. Add to that the fact that the server – Pendrell – seems to cycle all the time, and goes down a lot. It was down yesterday. Now that Daedalus is cron’d, hopefully things we’ll be up a bit more!

We’ll I got a second account at Dreamhost, because A – they are cheaper, B – they support rails, C – why not, they had a sale. I have followed their instructions and got rails up and running. One thing that puzzles me though, despite the fact that my sites are running in production mode on Dreamhost, it seems like it is reloading everything on every request. (Unlike lighttpd on textdrive, i dont have to start any process, you just drop the right files in the directory, give the public folder execute permissions, and you’re off to the races.) BUT, is it caching anything? Keeping any ruby processes alive? If I change a file, i dont have to stop/start, it simply sees the change. And seems a bit slower than textdrive, like its reloading every time. But this contradicts the idea of production mode, where things are supposed to be cached. Is there a way to get things caching in memory, and boost the speed a bit? I hope someone can enlighten me.

Hasta la.... vista?!

Posted by sbecker Mon, 12 Sep 2005 04:39:00 GMT

Veerle has a funny post about how there’s going to be not one, but SEVEN versions of Window’s Vista, from “Starter” edition to “Ultimate” edition, and everything in between. And I don’t think this list even touches on the server versions.

To see a complete rundown, check out Paul Thurrott’s WinInfo site.

Here’s the part I thought was the most hilarious:

Windows Vista Starter Edition: Aimed at beginner computer users in emerging markets who can only afford a low cost PC. ... Starter Edition will allow only three applications (and/or three windows) to run simultaneously, will provide Internet connectivity but not incoming network communications, and will not provide for logon passwords or Fast User Switching (FUS). Windows Vista Starter Edition is analogous to XP Starter Edition. This version will only be sold in emerging markets.”

Bwaahahaha! And they expect people to actually pay for this? When you can get a free copy of Linux that runs as many programs as the computer is capable of? That runs Firefox, Thunderbird, OpenOffice, etc, without paying a dime?

As far as Apple’s user versions go, OSX has one. It also has one server version. “Am I glad the folks at Cupertino aren’t smoking the same joints as Microsoft does,” Veerle said. Indeed, somebody must have laced their joints with crack.

I currently run Windows XP. Next year, I plan to buy a Mac laptop when the Intel versions come out, and our server setups will all be *nix based. By the time Vista rolls around, I plan to be completely devoid of Microsoft products.

The MP3 phone wars

Posted by sbecker Sat, 10 Sep 2005 17:55:00 GMT

Apple won the MP3 stand-alone player war. It’s over. Done. Good luck Sony, but I think you’re just wasting your time.

The next battle is the MP3 phone. It’s just getting started, and obviously, Apple’s first foray into the market, the Motorola ROKR (it just sounds silly), looks to be a dud. It’s bulky. It’s got no class. It’s $250 and it can only play 100 DRM-managed songs.

The problem is, Apple doesn’t want to cannibalize their own product lines by introducing a super cool iPhone that people would rather purchase than an iPod. Especially after all the R&D they just poured into the Nano.

And that is their weakness. The only way Apple could get knocked off their high horse at this point would be for someone to introduce a high-capacity, sleek yet simply designed MP3 phone that looks as good or better than an iPod, and managed to do both things well, not mediocre.

I’d rather the have something that is the BEST at one thing, than a half-baked all-in-one solution.

I’ve got a phone with a camera in it, and guess what? Right, the camera sucks. Oh yeah, the phone sucks too. (Hey, it was free. With that 2 year contract extension. We all make mistakes.) And who makes that phone? Sony. Hahaha.

Apple’s advantage is that they’ve developed such a huge reputation for perfection. If they do introduce an iPhone, as some think they will, even a year from now, it will become the hottest, most desired phone on the market.

Imagine it, you’re in the market for a new phone. You can get a Nokia, a Sony, a Motorola, or any other phone with 50 twiddly buttons, half-baked user interfaces, slow-to-respond software with lots of unnecessary clicks, and much much more. Or, you can get an Apple iPhone. It’s as minimal as possible. Its only got the absolute necessary functionality, but it performs those functions perfectly. It’s probably got a scroll wheel which will let you perform most functions without ever using the keypad. You can get it in the timeless colors of either white, titanium silver, or black. Sure, it costs a bit. A Lexus costs more than a Ford. But you’re going to want it. And so will everyone else.

It’s a simple formula really. I wonder why no one else “gets it”?

Escaping Bloglines and the Sea of Same-ness

Posted by sbecker Wed, 07 Sep 2005 13:51:00 GMT

I usually read blogs from Bloglines, so everything tends to look the same. Lame. What a shame. Too bad bloglines doesn’t let you read each blog in the design the author intended.

I just updated my blog’s sidebar with a list of my randomly favorite blogs. (Leaving out still a bunch of others I check out just because I don’t want the list to scroll forever.) Clicking around, I noticed that a couple of them have recently re-designed! Check out the fresh looks at:

  • encytemedia – these tones of green are among my favorite colors. love the icons. but that blue line in the header slightly irks me.
  • whitespace – so nice. giant comment numbers! and when you click to read a full entry, the article appears in the left column and the comments appear in the right, awesome idea.

Creative ideas for staying creative

Posted by sbecker Wed, 07 Sep 2005 12:19:00 GMT

Originally seen at Needmore Notes, here’s 11 Tips to surviving a day job with your creativity intact . Creativity is a muscle that needs exercise just like any other, or you will become weak. This article has ideas that will inspire and show you how to make time for your creative side.

The article reminded me of The Creative Habit by Twyla Tharp, another great book on creativity.

Speaking of which, I’d really like to bust out an original design for this blog sometime in the near future.

Older posts: 1 ... 3 4 5 6