Edge Rails Goody: Distributed Asset Hosts

Posted by Daniel Fri, 02 Mar 2007 12:38:00 GMT

Edge Rails Goody: Distributed Asset Hosts: It turns out this problem is even worse than I previously realized. According to this page (which I found out about in the patch I’ll mention in the next paragraph), most browsers impose a limit on how many connections can be made to a single named host at any given time. And on the internet’s most popular browser, this number is a whopping two. Add to this the fact that HTTP Pipelining is disabled by default, and a resource-heavy page is a recipe for a sluggish user experience. [We knew we’d need to collapse the files at the very least.]
Source: ChadFowler.com

Posted in ,  | no comments | 1 trackback

Mike Clark's File Upload Fu

Posted by Daniel Fri, 02 Mar 2007 12:25:00 GMT

File Upload Fu: A picture might be worth a thousand words, but how many lines of code does it take to upload one to your Rails application? Sounds like a fun feature to tackle on a Friday. Let's upload some mug shots. You know, to identify the goofballs around the office. [Nice.]

Posted in  | no comments | no trackbacks

BDG for Custom Javascript Events

Posted by Daniel Thu, 01 Mar 2007 02:46:00 GMT

As promised a Busy Developer's Guide to Seth's Custom Javascript Event mixins. It's a truly simple example, but it should display the simplicity of getting this going, and to some degree how it separates concerns.

Seth: There's a typo I believe on line 29 of event_broker.js. And line 161 of event_mixins.js. Should they not refer to "listenForEvent"?

Posted in  | 2 comments | no trackbacks

Replacing AppleScript with Ruby

Posted by Daniel Wed, 28 Feb 2007 02:34:31 GMT

Replacing AppleScript with Ruby: Matt Neuburg, MacDevCenter.com: “I’ll explain how to download and install rb-appscript. I’ll discuss the basics of rb-appscript usage and show how to develop a simple ‘hello world’ script. Finally, I’ll rewrite the Ruby-AppleScript example from my book to use Ruby with rb-appscript instead.” [Heh. puts app(‘Finder’).home.count(:each => :item) Nice!]
Source: ranchero.com

Posted in ,  | no comments | no trackbacks

Creating Custom Events with Seth

Posted by Daniel Tue, 27 Feb 2007 19:15:00 GMT

For now, if you haven’t already, read this. Seth, I found a documentation bug (I think). I’ll post the full story later today… for now it’s back to work.

OK. I’m back. Did you read the article? That’s OK. I’ll wait…

So I’m working on a website and the design has iterated. It started out with… er, um, a page that displays a list of things that are “on” and a list that is “off”… both displayed on the same page. Time goes on and navigation is added and other widgets as well. It’s wired up with Javascript etc. It’s fairly clean, but basic, since we knew a revision was in the works.

The revision shows up, and we have to get the new design working but it’s radically different. Now the on and off lists are toggled—only one list showing at a time, and the navigation changes depending on which one is showing. Some new code is added (almost always a bad sign) to get things wired up and we resign ourselves to cleaning it up in steps as we go. We feel this is best because we don’t know that more changes aren’t coming, we have other higher priority tasks to spend time on, and since the changes weren’t hard, we have little reason to clean everything up now.

Time goes on and we continue to refactor every time we have to touch something. A little bit here, a bit there, and soon the code has far more distinct responsibilities and encapsulation. Our understanding of the app is better as time goes on, and the code reflects this. But we haven’t touched the toggling yet…

So toggling is screaming to be refactored since the wiring is painful to behold. It’s far too interwingled with the other stuff on the page and we know it. I had looked at Seth’s work a while back, and shoved it into my back pocket… and today it worked out perfectly. We did a little spike, got the basic code working, and then applied our new found knowledge to the problem. Now we have excellent separation of concerns. The toggle dispatches a custom event, and various things listen for it via a broker. Nice. Any other widgets or tools can tie in just as easily. Since we were already using Prototype.js and our own classes, it took only about 15 minutes to mixin the Event classes and set up a broker. Most excellent Seth!

I have a “Busy Developers Guide” one page sample of one publish class, one listener class, and one broker. It’s an extremely simple example, but it is all you’ll need to get started using Seth’s stuff and should help answer the basic question “How do I use this?” from a code perspective. I left it at work so I’ll post it tomorrow, and point out what appears to be a documentation bug (or some misunderstanding on my part).

Posted in , , ,  | no comments | 1 trackback

The XM/Sirius merger

Posted by Daniel Thu, 22 Feb 2007 14:00:00 GMT

Disclosure: I own a tiny amount of Sirius stock.

Doc writes: "There are a number of problems with this merger; but they're also problems with satellite radio in general..." and lists a number of problems. Two of them can be addressed.

The monoculture issue can be addressed by making space for "public satellite radio" similar to local cable access. No I admit that I never watch what seems to be an endless stream of worthless shows, in almost direct opposition to the podcast phenomena where I listen to many different 'casts... but it could mitigate the homogeneity of radio programming to some degree, if it were truly embraced (and it should be from what I've heard on XM).

I agree that files seem to have advantages, so I wonder why neither XM nor Sirius to my knowledge release their shows via iTunes. They already deal wih the rights issues, so it shouldn't be a big leap, and it would probably improvve their programming, since they competition is stiffer. I also think they should store the programming locally (say in my car's radio) so that it could be loaded on my iPod if I wish. There are shows that are on when I'm not in the car that I'd love to listen to...

I should add that I've only listened to XM during the free trial period, it's not in the budget at the moment. I do enjoy the quality of the sound, and the seemingly endless streams of music I don't own or haven't heard.

In short, I think that open up some space for the public, and realizing that their competition is the public at the same time is the salvation. Mel, send me check when you implement these ideas please? Thanks.

Posted in ,  | no comments | no trackbacks

Simplest browser...

Posted by Daniel Wed, 21 Feb 2007 03:17:00 GMT

In my continuing quest to learn Cocoa and it’s frameworks, I wrote the “hello world” of browsers utilizing WebKit. Mostly it was interface builder, with a couple lines of code. I loaded my own blog and Apple’s home page in celebration. Onward!

Posted in  | no comments | no trackbacks

Cocoa apps and Rails apps

Posted by Daniel Tue, 20 Feb 2007 11:21:57 GMT

So it’s been a long while since I wrote anything on Objective-C. It was decidedly not like riding a bike for me. However,I did get the basis of an app I’m thinking about going, wrote a couple of tests, and got some CoreData stuff going.

I’m was excited by some of the up coming additions to the Frameworks. CoreAnimation and Garbage collection are high on my list… and so is the Ruby bridge. And it’s been a while since I wrote a Mac app, and I felt like it was time. Since it has been a while I felt that I should go roots (or Core) rather than work in some of the other environments I’ve used in the past.

I also wrote a tiny Ruby on Rails app to celebrate version 1.2. While I work daily these days in MonoRail (The Castle Project)in .Net it was refreshing to drop in on the framework that has got so many people thinking about web dev.

Anyway, a very interesting weekend from a programming perspective, with plenty of time for playing with Noah (it was cold out for him).

The only thing I didn’t manage was to ride my bike. I feel old, slow, and out of shape. However my spring time workouts begin today with stretching exercises and I’ll be on my bike this weekend one way or the other (Murphy willing).

Posted in  | no comments | no trackbacks

Passed on to you

Posted by Daniel Tue, 20 Feb 2007 11:08:00 GMT

TOM BIHN Blog: Sometimes people ask why our bags are so expensive. One reason is because we spend more on higher quality fabrics, zippers, buckles, webbing, thread, and every other part that goes into the bag. The price we pay for that higher-quality material and those tougher zippers and buckles gets passed on to you, but you’ll also have a bag that will last years and won’t bleed dye on your stuff! [Honest. Understand the product and decide whether it is worth it. I have several of Bihn’s products going back to about 1998. Recommended.]

Posted in , , ,  | no comments | 1 trackback

Capistrano & EC2 Sitting in a Tree

Posted by Daniel Fri, 16 Feb 2007 14:53:00 GMT

Capistrano & EC2 Sitting in a Tree: I use capistrano to manage these EC2 instances. With these tasks, I have automated many sets of EC2 commands into simple rake tasks. [Nice. Seems like just a bit of load balancing would be required…]

Posted in ,  | no comments | no trackbacks

To the mountains...

Posted by Daniel Tue, 13 Feb 2007 02:40:00 GMT

my bmc mountain bike

I carefully selected bits and pieces. I dreamed of putting this together one day. And then, through the wonder of EBay and the sale of stuff from my former life, I have a new bike. It’ll never be this clean again!

Glenn, Bill, Wendy and others at Piermont Bike Connection really did a great job on the build. Yeah, it took a long time because no one followed up on a missing bit or two, but other than torturing me, there’s no harm done. It’s a BMC FS01 (2006). Let me know if you want nitty gritty build details.

Posted in ,  | no comments | no trackbacks

Crack Down on Drivers, Not iPods

Posted by Daniel Tue, 13 Feb 2007 01:54:00 GMT

Crack Down on Drivers, Not iPods: What have we done now? It’s like Menachem Begin said once, in a different context: Goyim kill goyim, and they come to hang the Jews. In this case, it’s drivers kill peds, and while Kruger wants to hang the peds, the Times wants to hang some… cyclists. Really, you can’t make this stuff up. [Yeah. What he said.]
Source: StreetsBlog

Posted in , ,  | no comments | no trackbacks

Live Reviewer

Posted by Daniel Wed, 07 Feb 2007 11:41:00 GMT

Live Reviewer:

One of the other members of the Prototype Core team just asked me to be his only English-speaking “Live Reviewer” for a forthcoming book on Prototype / Scriptaculous.

[What Seth doesn’t say is that he’s apparently a part of the core team… with a bio coming soon! That’s way cool. Go Seth!]
Source: Truer Words - A Journal

Posted in , , ,  | 2 comments | no trackbacks