All posts

How to make an accordion with jquery

Assuming that you have a div with id "switcher" and each panel of the accordian has the class of "switch" and that your accordion headers are h2's with a's in them, then:

$("#switcher .switch").hide();
$("#switcher .switch:first").show();

// wire up sidebar switcher
$("#switcher h2 a").click(function() {
  var id = $(this).attr("href");

  $("#sidebar .switch:not("+id+")").slideUp();
  $(id).slideDown();

  return false;
});

This is the matching html:

<div id="switcher">
  <h2><a href="#one">One</a></h2>
  <div class="switch" id="one">
    <p>One</p>
  </div>

  <h2><a href="#two">Two</a></h2>
  <div class="switch" id="two">
    <p>Two</p>
  </div>

  <h2><a href="#three">Three</a></h2>
  <div class="switch" id="three">
    <p>Three</p>
  </div>
</div>

This turned out to be way easier than I first thought.

Learn CSS Positioning in Ten Steps

Sunk Cost

xvfb-run.sh source

Manpage of xvfb\-run

This will come in handy soon.

uninitialized constant MysqlCompat::MysqlRes

So getting an old rails project up and running today was a bit of a problem. And it all ended up being something very simple.

If your on Snow Leopard you probably know that you have to install the mysql gem in a special way:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql
  -- -with-mysql-config=/usr/local/mysql/bin/mysql_config

This is all well and good, until you rake gems:unpack. That's when it all started today.

You see, those gems have to be built. And, just like when you install the gem into your system gems, it has to know the arch settings. That means you need to do:

env ARCHFLAGS="-arch x86_64" rake gems:build

So simple, yet an entire hour lost.

Can ruby gems not do this for me?

Code Conventions for the JavaScript Programming Langugage

"Avoid conventions that demonstrate a lack of competence."

Yojimbo, Instapaper, and Delicious are three applications/services that I really like. However, I want my own version of them.

Things I want to be able to do that I cannot at this time:

  • Add a zip file to Yojimbo
  • Access my Yojimbo stuff on my iPhone (or anywhere other than my laptop)
  • Have Instapaper articles downloaded to my laptop
  • Have an archived copy of every page I add to delicious
  • Have a screenshot of every page I add to delicious
  • Everything should be auto-tagged and indexed
  • Etc...

Then it occurred to me: I don't need three applications, I really just need one good one.

Sometimes I add URLs to Yojimbo because I want an archive of the page. Sometimes I add things to Instapaper, but want to read it when I'm offline. Etc, etc...

So how hard would it be? Is it impossible to get an application/service that I can dump anything into for later and then get to that thing anyway I want?

Anyone got any recommendations?

Microsoft's Creative Destruction

I hope he's wrong, we need more innovation from everyone.

HTML5 Offline Image Editor and Uploader

20 Years of Photoshop

I remember how big a deal it was to me that I could undo multiple times.

There is no way Apple leaves out Flash from the iPhone and iPad because they want to limit people from watching video and playing games.

Why would they push HTML5 video then? Why would they work on Web GL so people can make 3D games in the browser with JS?

Why try to limit someone from doing something while inventing alternative technologies to let them circumvent your control?

Crazy.

Flash vs. HTML5 vs. Anything else

I love flash.

Without flash, I would have never wanted to be a designer. Praystation and other sites where designers uploaded "experiments" drove me to learn and to hack and to code and to draw and to create.

But today: flash sucks.
(It kinda always has really.)

It uses too much cpu on a mac (this is known), AS3 is alienating designers (bread and butter user-base), and there are just some strange bugs (but that doesn't really matter as much).

I still love it. I still use it. And oh boy do I know about some weird bugs with large bitmaps and caching and writing your own bitmap caching and using listeners to make an event loop to register queues to process things so the UI never lags (cause it's going to lag) and on and on.

All just so I can draw things on the screen and maybe even move them every now and then.

That is what I want do. The internet allows anyone to create something beautiful and immediately share it with anyone else.

So will HTML5 kill Flash?

No.

Why would it? Plugins will exist as long as the content we want requires them.

If content creators make content that doesn't require plugins, fine, but what we want is the content.

Flash doesn't matter. Neither does HTML5. Neither does anything else. If people really want content that requires flash to consume, they will find a way to use flash.

People just want to create and share things. They will continue doing that.

Hickey Wiki

I've been using this wiki enough now that I think I can recommend it to everyone. Hickey is a wiki I built in a few hours last week and have been updating regularly as I need things.

So far it does:

  • Markdown format
  • Full text search
  • Recently updated pages
  • Diffs between versions
  • Minor spam protections

I really really like it so far. I am using it for my class I am teaching to post notes and it has also been setup as the Letters.app project wiki.

If you want to try it out yourself, it's pretty simple to get up and running. Right now you must have git and ruby installed (if your on a mac, it's already there). Eventually, I am going to make a GUI app that will work no matter if you have it installed or not.

You can find the steps to download and install hickey in the Readme at github.

Is a "real" multitouch tablet even possible?

Disappointed by the closed nature of the App Store being thrust upon such a beautiful device, I started wondering if it's even possible to take a full desktop OS (as they are seen today) and use it for a multitouch only experience.

The more I think about it, the more I think the answer is: No.

Companies have tried many times over the past few years to craft something that people will use everyday with just their fingers, without a keyboard and mouse. And those companies have all failed.

Maybe a locked down, limited device is the only way to have a quality multitouch experience in a small portable form factor.

I sure hope I am wrong.

If Hulu were to move to using the video tag, what sorts of protection are available for them? How do they keep people from skipping the commercials?

Right now, I think they could:

  • Chop up the show into h.264 chunks (each chunk == between commercial breaks)
  • Use javascript to dictate when things happen (commercial plays, next chunk is loaded, etc)
  • And use some sort of authentication to make sure that a chunk isn't sent to a client that isn't authorized to view it yet (like before the commercial ends)

I wonder if/when this sort of setup will happen?

Comments About HTML5 video and H.264 – what history tells us

I commented with my thoughts which are: I should be able to play whatever the crap I want.

Interesting: Number Pad for iPhone + MacBook Pro

http://www.youtube.com/watch?v=G5WarA5xnNE&feature=channel

If the network had come to me and they said: "Dave, we'd like you to have this show." And then a week later they said: "Dave, we don't want you to have the show." Then, you could be angry about that.

http://kuler.adobe.com/#themeID/366749

I am interested in making something like delicious.com, but that I would run on my own server. It needs to:

  • Create a screenshot of the page
  • Download the page as an archive (with all assets)
  • Auto tagging (custom tags work too)
  • Sharing (via twitter, facebook, or importing into other bookmarking stuffs)
  • RSS everywhere

Open sourcing it and making it a cinch to run on Heroku would be great, so that anyone could run their own version of it.

Will Jay Do The Right Thing?

Teaching

Pretty soon, I'll be teaching at CDIA in Georgetown. This will be a life-long (oxymoron, being as I am quite young) dream of mine to head up a class about a topic I love.

Intro to Javascript

Explaining the beginnings of things is what appeals to me. How to get started is so critical and so many people get introduced to the industry in the worst of ways.

I am very opinionated about the correct way certain things should be done and I don't mind that. Even some of the curriculum at CDIA doesn't agree with me, but I'm sure it will all work out <winkyface>. A tremendous amount of leeway is given to the teacher, which can be problematic as constraints help us focus. Luckily they have suggested teaching paths that are very solid.

It's amazing that a school is offering a course as progressive as the one I'll be teaching. A focus on learning standards, validation to help solve problems, and introducing designers to web programming are all right up my alley.

We'll see how it goes. Hopefully I don't screw up the student's educations too bad.

Happy Christmas and Merry New Year

Hope everyone has a good holiday season this year.

Chrome OS

The new Google Chrome OS is very exciting. For the first time, I can see an OS that might save Netbooks. Chrome OS feels like a browser running in kiosk mode and this is not a bad thing.

Apps (really, just fancy bookmarks) are accessible by clicking on the Chrome icon in the top left, which I suppose is like a start menu of sorts. You wouldn't know it at first, but you can actually open more than one window. The windows slide in from the right and are accessible by Alt+Tab to cycle (other shortcuts can be found in this Developer FAQ.

The scrollbars lack arrows at the top or bottom and are made entirely of the scroll thumb. I think this is a great advancement: who needs those arrows anyway?

There is a simple Task Manager that has a pretty funny link to get to the advanced settings:

Chrome OS Task Manager

You can even use the Webkit Inspector in its own window:

Chrome OS Webkit Inspector

And I even wrote this post using Chrome OS:

Writing this post in Chrome OS

I am really thrilled with what they have done so far. This is going to change how people thing about using a computer.

Some things that google needs to solve to make the OS better:

  • Simple image editing
  • Downloads?
  • Better copy and paste or drag and drop

Any thoughts? Contact me and I'll try to append them here.

http://laughingsquid.com/pigeon-impossible/

http://www.mtvmusic.com/artist/weezer/videos/29890/say_it_aint_so

http://www.jay-z.com/2009/10/jay-z-ft-alicia-keys-empire-state-of-mind-music-video/

Highbrow

Change your default browser quickly or just have it always default to whichever one you are currently using. A must have app for anyone who uses Firefox, Chrome, Safari and more at the same time.

Concentrate

A neat little Mac app to help you stay focused. Not sure if I can do it, but it's a neat idea.

A 50 Lines-of-Code JavaScript Animation Framework: Say Hello to Émile

One of the best presentations on JavaScript I have ever seen. So much good content with real in-depth explanations.

Read now.

http://vimeo.com/7391362?hd=1

In the past, I have recommended Flash Video (flv) as the best way to get video content online and make it available to users. However, I think my opinions about this are starting to change. H.264 is such a good codec that can be played by so many devices that even Flash running in a browser and play it. It's that easy to play.

<video> is now on the scene and it is reinforcing the idea that we can have a positive video experience without all the buffering and stuttering and general flash slowness. Don't get me wrong, I love flash, I started making websites in flash, I still do a fair amount of AS3.

But flash is slow. It's slow how Ruby is slower than C. Ruby is still great to use and I use it for all my web applications now, but it's slowness is acceptable because of the level of abstraction and productivity gains. All technologies have tradeoffs. However, I am starting to think that flash's slowness is not a tradeoff that is good for consumers of video content.

Apple TV (which is made from piece of crap parts) can play 720p video just fine. Heck, even the original xbox using XBMC can play some HD content from what I hear. Yet give an SD flash video to either and watch them cower in fear. Web sites shouldn't require users to have beastly machines just to enjoy the content.

Flash is bad for video unless it can speed up and become transparent. For now, it's very visible that it is working too hard to perform a job that we already solved in much better ways.

All is not Roses with <video>

My issue with <video> is this: how do you interrupt the show for commercials?

I assume current flash players just use AS code to determine those sorts of things and possibly even load each segment as a different FLV. While most of this can be duplicated in JS, that would be far more hackable than AS from inside the browser. I could rid myself of commercials forever, but then the video hosting site would go out of business.

Has anyone tackled this problem? Is this something where commercials just have to be integrated into the stream?

Experimenting lately, I have been talking to my computer.

Every Mac includes something called Speakable Items. Essentially you can say things like "Get my mail" or "Switch to TextMate" and it will do it. In System Preference, Speech you can turn it on and look at the help to figure out how to use it.

Essentially: it sucks and I love it.

It sucks, because it's buggy and it doesn't know how to isolate a voice. I love it because it could keep me from typing as much as I do.

In the end, I don't think I can use it on a daily basis, but it has changed my mind about speech recognition's usefulness.

While I don't know if I could use dictation too much, I do like the idea of asking what the temperature, time, do I have new email, and other short questions or commands.

Is anyone working on something like this? Is there research to improve this?

I am very interested in speech commands now and I would love to see progress on this in the near future.

http://chromeography.com/

I'm not a hater or anything, really, but come on: Video of Microsoft Store Opening That is an Apple Store with non-Apple computers in it.

If Growl notifications are not working with Colloquy on Snow Leopard, it's because Colloquy is using a 32-bit library to communicate with Growl. It can be fixed by setting Colloquy to open in 32-bit mode.

This is the first application I have set to do that so far.

Creative Inspiration - 2010 Printable Calendar

Practical XML Parsing

For Cocoa + Objective-C.

Simple Yet Fantastic iPhone Game - Canabalt

The Turntable

Turntables are complicated. I picked up a cheap turntable today that works, but I am sure it is destroying the records I am playing. Reading online it appears that you need to align your cartridges, oil your belts, and lots of other things that I will probably never do.

Looking at the little thing, it appears that it's arm is pretty shotty, the wiring or something is causing a nice buzz, and the records seems to bounce a bit on their way around. I'm not sure if all of that can be fixed or not.

Either way, it's nice to finally checkout the Eagles LP I got.

Apparently I jotted down a quote from my dream last night before I forgot it. I found this in my iPhone's Notes application:

I have some unilateral thoughts about what it means - and those have changed over time. You don't get that deep without seeing rockets everyday.

Yeah, it doesn't entirely make sense to me either. Must be poetry.

http://vimeo.com/channels/hd#5606758

How To Install id3lib-ruby On Snow Leopard

I compiled id3lib include /usr/local, then:

$ sudo -s
$ export CONFIGURE_ARGS="--with-opt-dir=/usr/local"
$ env ARCHFLAGS="-arch x86_64" gem install id3lib-ruby
$ exit

http://project.ioni.st/post/2808#video_2808

http://happymundane.blogspot.com/2009/09/google-street-view.html

Things to do when the wife is out of town

  • Hulu
  • Work
  • Eat leftovers
  • Watch the new Jay Leno show (same as the old)
  • Ride the bike
  • Work
  • Watch TED videos
  • Sit on the couch
  • Work

Yojimbo 2

Rating: 4.0

I love Yojimbo, but the new icon - worst. ever.

Yojimbo Icon

I've looked at MySQL, Postgres, Oracle, Couch, and many other database applications over the past few months.

I like Couch the best.

However, I have decided that Mongo DB is the best database to use for a web CMS. And this is for one reason: a query language.

Content is based on documents or content objects and this just cannot be modelled correctly in a traditional RDBMS like MySQL. Couch is great, but you gotta know what your content looks like up front (or write tons of code to create / drop indexes depending on content changes).

If I ever build the CMS that I would want to build - to allow users to create structured and unstructured content anywhere in the system - it would only work with Mongo.

iTunes 9

Genre Browser

OK, so they moved the genre browser to the left. Luckily you can change it back to top with View > Column Browser > Top.

UI

The new interface is very white. All the progress bars look better than before, but I can't get over just how bright it is. The Movies section still won't do folders or anything, but I suppose that's what search is for.

Store

The new store is easier to navigate and it's much easier to preview songs. It's actually a lot like the iPhone iTunes store.

LP and Extras

I have been saying for a long time that there needs to be a file format that allows menus like a dvd with all the extra features, but still contained in one file. Finally, Apple has delivered this.

It will be interesting to look inside these files to see if something like Handbrake could ever be used to generate them from existing DVDs (the holy grail) and if open source players could ever support anything like this. This is the most exciting thing to me as now I can actually think about buying movies in iTunes. Why pay the same price as DVD and not get any special features?

A better description of the special features when browsing the store would be nice, but hey they're just getting started.

Final words

Finally someone chose to try to solve the problem of include special features with movies - all in one file.

Iron Man is for sale this way. I might have to try it out.

Not Nathan

iPhoto has facial recognition now, but it still needs a tiny bit of improvement. Below are some of the real mistakes it made trying to recognize me:

Not Nathan

Not Nathan

Not Nathan

Daily Chores

Let's see if I can stick to this.

What would the world look like if people lived locally, yet were interconnected with the rest of the world?

Comment by Matt Parks:

What do you mean by living locally? Local to what? Not sure if I understand the question.

My reply:

Living locally, to me, means to live near where you work, buy things made near where you live, and form close relationships with those who are geographically similar. Sure, we all travel a bit, but planting ourselves into out community and working together to benefit it should be our long term goal.

A great iTunes Smart Playlist

Songs you have listened to greater than five times, but not within the last 6 months.

Social Media Icons by Paul Robert Lloyd

http://stream.btucker.org/post/173936916/widescreen-vs-pan-and-scan-via-kottke

Why do they even make full screen movies anymore?

David Pache

Stefan Kanchev

Time Machine Backing Up

After getting a new logic board put into my laptop, Time Machine seems to think this is a new computer and is making an entirely new set of backups for it. Strange.

It appears to be impossible to convince it that it's the computer that made all the old backups.

Devot:ee - ExpressionEngine articles, add-on database, and much more

The Sound class in flash automatically parses ID3 tags into an id3 method on the sound object.

sound.id3.artist returns exactly what you would expect.

Using flash today wasn't total torment. It was actually kinda fun.

Illustrator Keeps Crashing

How To Make A Calendar With Rails

Over time I have had to implement calendars on sites over and over again. I used to try to use other people's plugins, but that never really gave me the flexibility I needed, but hey it was free and fast. However, recently I needed to implement a calendar in javascript and I found all the existing libraries to be lacking, so I wrote my own.

Then I ported it to Ruby and Rails so I could use it on the server side. It turned out to not be that difficult, so I wanted to document my thought process here for later. This applies to Rails 2.2.

Start With A Resource

We'll need some kinda of Event object to display on the calendar, so let's just create the Event model and EventsController.

script/generate resource event title:string start_at:datetime description:text

If you would like an end_at or a duration then feel free to add those in as well. I'm not going to cover building the data entry forms in this article, so the fields don't really matter other than start_at.

Routes

We will need to be able to pass in what month and year we want to see, so I add an extra route for that:

map.event_year_month "/events/:year/:month", :controller => "events", :action => "index"
map.resources :events

So we can CRUD events if we like and we can also see events for a given year and month. Also of note, since we put :year and :month in the url and not in the query string, it's much easier to cache later if we need to.

EventsController

All the controller needs is an index action that figures out which year and month to display.

def index
  @year = (params[:year] || Time.now.utc.year).to_i
  @month = (params[:month] || Time.now.utc.month).to_i
end

Simple and concise. Also of note, I do (...).to_i since params[:year] will be an instance of String or NilClass and nil.to_i is not a method.

I'm not going to demonstrate how to implement the show action, you can handle that.

Event Model

The model should always be where most of the heavy lifting goes. Luckily Rails has some fancy tricks to make searching and other tedious things pretty easy.

class Event < ActiveRecord::Base
  default_scope :order => 'created_at DESC'

  named_scope :future, lambda { { :conditions => ["start_at > ?", Time.now.utc] } }
  named_scope :recent, lambda { 
    { :conditions => ["start_at >= ? AND start_at <= ?", 2.weeks.ago, Time.now] } 
  }
  named_scope :between, lambda { |b, e| 
    { :conditions => ["start_at >= ? AND start_at <= ?", b, e] } 
  }
  named_scope :near, lambda { |that| 
    { :conditions => ["start_at >= ? AND start_at <= ?", that - 2.weeks, that + 2.weeks] } 
  }

  def to_param
    "#{id}-#{title.parameterize}"
  end

  def self.all_for_day(date)
    between(date.beginning_of_day, date.end_of_day)
  end

  def happened?
    start_at < Time.now
  end

  def future?
    !happened?
  end
end

I threw in a few extra useful methods, but the primary things we are interested in are Event.between and Event.for_day. Also of note, having to_param be "#{id}-#{title.parameterize}" (example url: /events/3-some-string) is a good thing, since Event.find("3-some-string") will really just be Event.find(3), so it's as if the title wasn't even appended when you go to lookup that specific event.

Calendar Helper

In events_helper.rb we just need to add a method to generate our calendar. This is the hard part and I am going to walk through the logic of it step by step.

def calendar(month, year)
end

All we need to generate a calendar is a month and a year. Something like 1, 2010.

def calendar(month, year)
  beginning = Time.now.utc.change(:month => month, :year => year).beginning_of_month
  days_in_this_month = Time::days_in_month(month, year)
end

Next, we need to figure out what the first day of the month passed in is and how many days are in that month. Now, we know how many days are in this month and we now have a variable pointing at the first day of this month, we need to think about what we want to do now.

If you think of (or look at a) calendar you will see that they list the prior and next months before and after the current month, to make each row have a complete seven day listing. This is obvious and second nature for us to recognize, but how to we produce that from the info we currently have.

We need to make an array of six weeks, each week being an array of seven days. The first array might show some of the prior month, so we need to backtrack to Sunday (let's assume our calendar starts on Sunday for now) before we start. Later, when we run out of days for the current month, we can just keep going until the array is full to show the next month's days. This is an example for August 2009:

[ 
  [26, 27, 28, 29, 30, 31, 1],
  [2, 3, 4, 5, 6, 7, 8],
  [9, 10, 11, 12, 13, 14, 15],
  [16, 17, 18, 19, 20, 21, 22],
  [23, 24, 25, 26, 27, 28, 29],
  [30, 31, 1, 2, 3, 4, 5]
]

For August, beginning would be pointing at the 1 on Saturday. We need to find out how many days we need to show of the previous month. This turns out to be really easy, since Ruby returns an integer for Time#wday with Sunday being 0. And it turns out, if the first day was on Sunday, we would want to show zero additional days before it. So if Saturday is 6 and our month ends on Monday which is 1, we need to show 5 additional days (6 - 1 = 5).

def calendar(month, year)
  beginning = Time.now.utc.change(:month => month, :year => year).beginning_of_month
  days_in_this_month = Time::days_in_month(month, year)

  extra_days_at_beginning = beginning.wday
  extra_days_at_end = 6 - beginning.end_of_month.wday
end

So if we add up the extra_days_at_beginning, extra_days_at_end, and days_in_this_month we should get 42 or 35 (some months are only five weeks).

def calendar(month, year)
  beginning = Time.now.utc.change(:month => month, :year => year).beginning_of_month
  days_in_this_month = Time::days_in_month(month, year)

  extra_days_at_beginning = beginning.wday
  extra_days_at_end = 6 - beginning.end_of_month.wday

  total_days = extra_days_at_beginning + days_in_this_month + extra_days_at_end
  number_of_weeks = total_days / 7

  first_day = beginning - extra_days_at_beginning.days

  calendar_array = []

  number_of_weeks.times do |week|
  end

  calendar_array
end

Just calculating the total_days that the calendar will display (either 42 or 35) and then the number_of_weeks (either 6 or 7). We are going to use first_day as a starting point to increment from when building the actual array.

def calendar(month, year)
  beginning = Time.now.utc.change(:month => month, :year => year).beginning_of_month
  days_in_this_month = Time::days_in_month(month, year)

  extra_days_at_beginning = beginning.wday
  extra_days_at_end = 6 - beginning.end_of_month.wday

  total_days = extra_days_at_beginning + days_in_this_month + extra_days_at_end
  number_of_weeks = total_days / 7

  first_day = beginning - extra_days_at_beginning.days

  calendar_array = []

  number_of_weeks.times do |week|
    calendar_array[week] = []

    7.times do |day|
      position = day + (week * 7)
      current_day = first_day + position.days
      calendar_array[week][day] = {
        :day => current_day,
        :events => Event.all_for_day(current_day)
      }
    end
  end

  calendar_array.each { |week| yield(week) } if block_given?

  calendar_array
end

position is the current position in the 7 x 6 grid, and it's gets added to the first day (position starts at zero) to find where we are in the loop. Also, there is a nice line that ends with block_given? that makes it quicker to do loops when using this method.

View

So now we can finally use this in our view (I am using haml):

.nav
  = link_to "Previous Month", event_year_month_path(:year => @year, :month => @month-1)
  = link_to "Next Month", event_year_month_path(:year => @year, :month => @month+1)

%h1= "#{Date::MONTHNAMES[@month]} #{@year}"

%table.events
  %thead
    %tr
      - Date::DAYNAMES.each do |day_name|
        %th= day_name
  %tbody
    - calendar(@month, @year) do |week|
      %tr.week
        - week.each do |day|
          %td
            %span.day= day[:day].day

            - unless day[:events].blank?
              %ul.events
                - day[:events].each do |event|
                  %li= link_to event.title, event_path(event)

Finished

It's possible to start the calendar on a different day, always show six weeks no matter what, and all kinds of other stuff when you role your own calendar. Don't be afraid of taking an hour and working out your own solution instead of relying on code you didn't write. Or at least read over and understand the code you are using.

Yeah, this was way too long...

Massive Regular Expressions Toolbox

MSR Flex 4 System Cookset

Everything fits together amazingly.

Wallpaper

Beautiful wallpaper found at mulele.com

Philippe Starck Designed Yacht

Futurama Mini Figures

Vector Graphics Software

Software has come a long way in over 40 years. The first vector drawing program was apparently written in 1963! It's called Sketchpad:

This looks amazing, but the Macintosh is really what allowed programmers to create sophisticated applications that were also easy to use. The first (and still best) mac vector drawing application was Illustrator in 1987:

Illustrator progressed quite a lot in one year:

Illustrator had such a polish and finishedness about it. It was deliberate in it's design, catering to an industry with specific solutions. I feel that Illustrator CS4 (really all the CS's) has diluted some of that refinement in favor of more features and fancier marketing. Some tools I use everyday are buried in menus and pallets while others are placed right in the toolbox because they are new and listed on the box, no matter how many use them regularly.

I hope that the current Adobe will hearken back to their early years and focus on delivering quality, easy to use applications instead of new ways to bundle and market, synergy, blah blah blah. I love Illustrator, it is still the application I enjoy using the most, I just get tired of seeing the unexpectedly quit dialogue every day.

I found the videos via John Nack.

Lego sets

http://www.flickr.com/photos/myobie/3824710588/

LED Handrail

handrail

Netflix Freedom and Responsibility Culture

slide

The Problem with Service Design

Jeff Howard:

I’m afraid service design is futile. We’re wasting our time.

http://blindsearch.fejus.com/

Try this out and see which search engine you like best. So far, I have chosen each engine once. I am not sure what this means.

Managing UI Complexity - Brandon Walkin

10 questions for some great programmers

101

http://vimeo.com/5437401

Quotes from Wendy Kopp

Some great quotes posted over on 37 signal's blog, like this one:

There are certain lessons…One of them is the importance of focus, the importance of saying no.

http://www.behance.net/Gallery/New-Typeface-St-Atmosphere/274595

http://www.eatmedaily.com/2009/08/next-gen-ramen-noodle-robot-chefs-from-japan-video/

http://vimeo.com/5233789

via (why not ben)

A good friend is moving.

Wish you and your family well in Alabama.

http://vimeo.com/5631912

Notes from my upgrade to the DataMapper next branch (as of today)

  • Assiciation class names are now specified as :model => "User"

      belongs_to :owner, :class_name => "User", :child_key => [:owner_id]
    
  • Belongs to associations have a :nullable => false by default, so you gotta do :nullable => true if you want that sort of thing

  • #relationships on a Resource instance is now private, so you gotta do instance.model.relationships
  • Do author.books.new instead of author.books.build (which makes more sense anyway)
  • Has many through has changed and is better explained by example:

      has n, :subscribers, :through => :subscriptions, :model => 'User', :via => :user
      # :via => :user tells it to use the association named user
    
  • new? and not new_record?

  • original_attributes and not original_values
  • database.yml has changed a bit:

      adapter: mysql
      path: db_name
      host: localhost
      user: root
    

Quicklook plugin to show you what files a package will install.

I have already used this twice today. Should be built into Mac OS X.

Want: Graphic Design, Referenced

Happy birthday Jenny.

I need to be more effective with the tools that I use. Very rarely do I use my available toolset to it's fullest. Anyone got any tips? Here is a list of a few things I use all the time:

All of these things I love to use, but I feel that I use them at a fraction of their potential. I forget about todo's in highrise, I leave backpack pages out of date, I forget to twitter, I leave notes on my phone for months, and I really don't think I could ever use my macbook pro to it's fullest.

I mean it's great to have all this creative potential around me. Just need to make better use of everything.

USB Turntable

http://www.youtube.com/watch?v=Oqsi_z3J-rk

http://www.vimeo.com/5284239

http://www.vimeo.com/5405849

Design Management

A fantastic article by Zeldman about project management for design/web projects.

http://balldroppings.com/js/

Stoned wallabies make crop circles

Vegan Flyer

http://project.ioni.st/post/2738#video_2738

The Fios man just repaired the internets here at home. A power brick freaked out and had to be replaced - which is actually what I had deduced myself since the LED on the thing was blinking like crazy.

I should blame my lack of blog posts on the lack of internet access, but tethering was setup on my iPhone so it's really just me being lazy.

Good news though, the Fios man offered to change my router access from Coax to Ethernet! This may not seem exciting, but it allows me to use any router I want without having to hack the Verizon router's firmware to make it pass through.

Now I am using my Airport Express and the Verizon router is neatly boxed up in the corner. As it should be.

Best Fios tech ever.

5 Ways To Know You Were Driving An RV Too Long

  1. You are impressed with the acceleration of a 2003 Honda Civic Hybrid
  2. You keep taking turns way too wide
  3. You expect the tank to hold over $100
  4. You worry about height going to a drive through
  5. You finally, truly realize you were driving a freaking huge RV

How to fetch a non-continuous set of couchdb ID's (when start and end keys won't work)

Using curl:

$ curl -X POST http://localhost:5984/tickets/_all_docs \
  -d '{ \
    "keys":[ \
      "06a1b6e367cd059362bc3a7921b64b45", \
      "b6e6ee95a42e10f4b884b024e10fec2b"] \
    }'

> {
    "total_rows":3,
    "offset":0,
    "rows":[
      {
        "id":"06a1b6e367cd059362bc3a7921b64b45",
        "key":"06a1b6e367cd059362bc3a7921b64b45",
        "value":{"rev":"5-2613703449"}
       },
       {
         "id":"b6e6ee95a42e10f4b884b024e10fec2b",
         "key":"b6e6ee95a42e10f4b884b024e10fec2b",
         "value":{"rev":"4-3074023027"}
       }
     ]
   }

Just a random thought.

A lot of people who use rails do a object.save, then check if it's true or not to determine what to do next in a controller. I find that to be verbose and hides the actual save command inside an if statement.

def update
  if @page.update_attributes params[:page]
    redirect_to admin_pages_path
  else
    render :edit
  end
end

I prefer stuff like this:

def update
  @page.update_attributes! params[:page]
  redirect_to admin_pages_path
rescue ActiveRecord::RecordInvalid
  render :edit
end

I think it's more clear that to render :edit is an exception and should not be the norm.

I have been in Louisiana for the past week helping out with Habitat for Humanity in New Orleans and HPC in Baton Rouge. Worked on some houses, mowed some lawns, painted some doors, and sweated a lot. It's hot there. Like really really hot.

Had a great time helping, what little I could, and glad to be home and back to normal.

Paul Arden

Do not covet your ideas. Give away everything you know, and more will come back to you.

Found via Joshua Blankenship

I just setup God to monitor 4 mongrels and ar_sendmail and post to twitter about it. Need to tweek God's settings a bit, but really cool thus far.

Google chrome on mac is pretty cool. Doesn't work with Flash and can't do http authentication yet, but it's already a really really good browser.

You can find builds for every revision.

I don't know if anyone has noticed, but Safari on the iPhone is capable of 3D transforms and smooth animation thanks to CSS Animations. Checkout this example (free account required).

It's hard to tell that it's a webpage. I have got to do something with this.

Flash

Rating: 1.1

Much time has been wasted recently getting Flash to do anything well.

Scotland On Rails Videos

This is why Wolfram Alpha is cool

My Name

Tank Icons

This might be some of the coolest animated gifs I have come across in a very long time.

HTML5

Used to be, I would only use a strict XHTML doctype on any webpage I authored. I looked down on people using html4 or transitional even, thinking it was pretty worthless (which it is ;).

Why is XHTML better?

  1. XML can be validated, extended, and written by machines easier since it's parsing rules are standardized.
  2. XSLT
  3. Strictness (if it isn't valid xml, it doesn't work)

Any cons?

  1. Strictness. The idea of a comment from someone on my blog being able to derail the entire page because of invalid xml is pretty stupid.
  2. application/xml support sucks. Violating the spec just to please IE seems ok at first, but it really is just another thing to worry about. What if the mechanism that does this switch freaks out or doesn't work with IE9 or something?

But I don't care now, because HTML5 is the future

HTML 5 actually provides all the positives of XHTML without any of the cons. It's parsing rules are declared fully, anyone can make a parser and validation will be much more useful. HTML 5 will also define XHTML 5, which will be essentially the same but with XML compatibility, so XSLT is still an option. And strictness is still possible, but doesn't derail the entire thing.

You also get new form inputs, section, nav, header, footer, and other cool tags. You get data- attributes on elements, you get DOM parity with the parsing model, you get SQL storage in the browser, the ability to run apps offline, etc. You really get all the ideas we all already agree on.

Any really, why should HTML have it's own spec and be it's own language? Why do we have to use XML for everything? I already use JSON for almost all of my inter-application communication when I write webapps. Not because it works natively in javascript (I'm not even using it there much), because it works everywhere. There are not attributes or namespaces or anything, just data. It beats the pants off XML for most everything I do. And parsing JSON is dead simple, anyone can write a parser (sound familiar).

And really, the main reason HTML5 is the best to me is because the author of and contributors to the spec care about what works now. They are not hesitating to push things forward, but they are not blindly blazing a trail that no one is going to follow.

Is there anything that is in XHTML 2 that (X)HTML 5 will not have that matters? Contact me and I will amend any comments if valuable.

Also, here is a google search in case you care.

Update: Probly the best overview at immike.net. A quote:

Both working groups have embraced the coming Semantic Web by allowing developers to embed richer metadata in their documents. As with forms, the XHTML2 working group has embraced a more sophisticated technology, while the HTML working group has kept things simple.

The complex looks nice sometimes, but usually the simple wins in the end.

Update 2: An article disagreeing with me.

Update 3: Some more links:

Mon Ami Gabi

Rating: 4.0

Website. A french bistro and steak house. Good steak, good wine, and good desert. Profiteroles are the bomb.

We went on a hike. Amazing forest right behind our house.

Twitter changed @replies, then some people freak out, then twitter try to calm them by talking, then they try to calm them by changing

Standford iPhone programming classes, free on iTunes (link will open iTunes)

Snakes on a plane

http://bigthink.com/topics/architecture-and-design/ideas/jeff-zeldman-drives-home-the-importance-of-web-standards

Example Rating with Weird Amount

Rating: 3.2333

This post's rating is 3.2333. Just testing to make sure the star images work ok even with weird numbers like that.

Review posts now show their ratings as stars.

Ratings are stored as floats, so they can have very strange precision like 4.5 or 4.3567. Since I wanted to show the amount of stars as accurately as possible, I decided to make something that can reflect any float value (basically).

Essentially, I laid 5 stars out (15px wide each) with 4px between them. I saved out two versions, one with all stars in the off/disabled state and one with all stars in the on/enabled state. I use these as backgrounds of div's, with the "on stars" on top of the "off stars." I show the current rating with the "on stars" by clipping the image's width. See below:

Star Layout Illustration

So, I essentially clip the "on stars" to whatever width they need to be to represent the rating.

How does one calculate the width? Well, it's simply (star_width * rating_amount) + (space_width * floor(rating)). floor() means to always round down, even when the decimal is .5 or more. Example math:

Rating: 1
Width: (15px 1) + (4px 1) = 19px (only shows the first star)

Rating: 4.5
Width: (15px 4.5) + (4px 4) = 83.5px

Since we can't have 0.5 pixels technically, I just round the amount off to the nearest integer.

So, not very hard. Actually, it took me longer to write this post than to make the stars.

Star Trek

Rating: 4.0

A full review will have to come later (after some reflection), but I will say that it is a very enjoyable movie. You should see it.

5 Problems We Might See in the Next 100 Years

  1. Stealing rain from neighboring countries (from seeding clouds)
  2. Pushing pollution across continents
  3. Global suburbs around nice weather areas (ex: Mediterranean, not really a problem I guess)
  4. Exposing food to all shoppers being a legal liability
  5. Not having any problems

http://www.youtube.com/watch?v=Z19zFlPah-o

Saw this on Rain Wilson's site.

Background applications on the iPhone are not important to me. I understand the issues and have never liked the idea of having tons of little processes eating away at battery, even when I had a palm.

But there is one inconsistency on the iPhone that has been driving me mad the past two weeks. Mail runs in the background.

I know it does.

The fact that I know that it does is actually the problem. I type an email, hit send, then I immediately hit the Home button and open another app. When the email is actually sent, you hear the woooosh – while in the other app.

Which is great.

It's a time saver and I don't have to watch the little spinny thing waiting for the mail to be sent. However, Tweetie does not run in the background. At least 10 times I have typed a tweet, hit home, then discovered later (upon reopening Tweetie) that it didn't make it. Pretty much, I cancelled sending it by shutting down the app.

Which sucks.

I think Apple could use a facility they already have built in. When memory is tight, they kill your app. Shutting an app down could be moved to a two stage process: closing the window, then real shutdown (dealloc and all that other stuff). There could even be a windowDidClose method so that app makers could dealloc all the UI stuff, but leave any syncing or any critical processes running as long as possible.

Now this could lead to battery draining type apps, so it will probly never happen. And I get that. I just wonder if there weren't a way for it all to work somehow.

MySQL 5 Cast Functions

RailsConf News

Presentation Files from RailsConf

As the speakers provide files, they are added here.

Shifting my Opinion on CSS Animations

I have been feeling pretty much the same way about CSS animations recently.

Create Outlook Calendar Events with Rails

hCalendar

http://icalendar.rubyforge.org/

Will be making use of this in the next few days.

Sorry to not have posted for a few days, I broke the site. Well, actually, I just made it incredibly difficult to post new posts, but that's pretty much the same. My text engine (turbine) is what actually was "broke." Let me explain:

When I post text to this blog, turbine attempts to figure out what type of object I actually posted. Well, it does take some instruction to get it going at first. It was my instruction that pretty much killed it. See this commit for the simple fix.

It's really interesting writing your own publishing software. When it breaks it's usually your fault, which is mostly bad. But when it works, it's also your fault, which is always good :)

Wolfram Alpha

I don't know what to think of this yet.

How to push a UINavController into a UINavController

For Remindo, I wanted to use the same view for both add and edit. I want the edit version to slide in from the right (navController style) and the new version to slide up from the bottom (modal style).

The edit UI actually has different levels of screens for editing (for specificity of date/time), so it needed to be it's own UINavController, which it turns out is very difficult to push onto an existing navController.

I am working on a full tutorial on how to do this, but until then this link is how my IB files are setup to allow this to work.

I think the new Honda Insight is a failure. Why? Because it gets the same gas mileage as my >5 year old Honda Civic Hybrid. I mean in 5 years it doesn't get over 42 miles per gallon?

Tt Tea Mugs

http://www.tekniqal.com

Various videos about basic Ruby concepts.

Tweetie for mac

Rating: 4.5

A very good twitter client for the mac that is definitely my current favorite.

Charles Proxy

I may need this in the next few days for debugging.

Panasonic All-in-One Cordless Hair/Beard Trimmer (ER224S)

Rating: 5.0

The Trimmer

I picked this up a couple weeks ago and I couldn't be more pleased. The main selling point to me is that it's water proof. Being able to do a quick trim while in the shower is fantastic.

This could be used to cut my hair as well, but we already have a set of Wahl clippers for that. I can say it does function well to clean up the details of a hair cut.

Picked it up at Target for ≈30-40 $'s.

I've commited changes to show admin controls when I am logged in. Fancy.

install_convert

This is my bash script to install everything I need for ImageMagick. I am going to try to keep it up to date as versions of things change. Feel free to fork and add new versions or libraries that might help.

Passenger runs on nginx now

I really like nginx and use passenger with apache, so I might switch to this for a current project.

iPhone Screencasts from The Pragmatic Studio

Ruby Best Practices Blog

Maybe I should try to get this blog running on app engine

The previous blog, in case you care

Dreamhost & Sinatra - Part 4

Well, it seems that a simple Gem.clear_paths is all that I needed. Or at least it appears to have helped out.

I found this out on the phusion blog.

You can see my dreamhost specific ruby code on github

Dreamhost & Sinatra - Part 3

I am going to try this for a while:

 module Gem
   def self.default_path
     [AppConfig[:production_gems_path], default_dir]
   end 
 end

Hopefully that will work.

Dreamhost & Sinatra - Part 2

OK, so passenger is randomly complaining that it cannot find my gems. It's purely random. I cannot isolate it. ENV['GEM_PATH'] = AppConfig[:production_gems_path] doesn't seem to work 100% of the time (95% maybe).

Weird.

Dreamhost & Sinatra - Part 1

So, I look this morning and nathanherald.com is down, passenger is complaining that it couldn't find the sinatra gem. This is all very strange, since it was running last night.

A simple touch restart.txt fixed it, which is even more weird since one would think that it wouldn't just randomly forget where my ruby files are. My current hypothesis is that when passenger killed my sinatra process for being idle, it did something weird and forgot where my gems were when it needed to bring it back up.

I have setup a cron job to touch restart.txt every 4 hours. That should keep passenger in the loop while I research this issue.

So, this is my new website. I finally got something up here that I don't think is absolutely terrible. I will be migrating the content from all my past sites to this one slowly, so sorry for everything to disappear all of a sudden.

I wrote this blog in sinatra and you can see it here in a github repo. It's running on dreamhost (which isn't that bad for sinatra apps).

There are a few things that do not work at the moment.

  • There are no comments. Coming soon.
  • The search doesn't work at all.
  • The feed is a bit wonky at the moment.

Any feedback? Please, fill out the contact form.