[]RSS

About Archives Artwork Comic Contact Philosophy Projects Tags

A retro moment

[Comment]

July 30th, 2008 in Links

Warped as it was 8 years ago, in all of its eye-grating goodness.1 Word.

  1. And before in-browser spell checking.

Google fudges rankings in their favor?

[Comment]

July 28th, 2008 in Links

Yet another product I had not heard of. Apparently there is some controversy about Google’s ranking of their own articles at Knol. I’ll crawl back under my rock now.

The killer adwords bug

[Comment]

July 21st, 2008 in Links

Be glad you’ve never had a bug this bad. We’ll, I suppose maybe you have. Bad bugs suck.

Quote: Models and truth

[Comment]

July 21st, 2008 in Quotes

Essentially, all models are wrong, but some are useful. – George Box

Kottke invents his own personal Twitter

[Comment]

July 21st, 2008 in Links

Kottke’s new tweet API is way cooler than Twitter’s. Seems more stable too. I haven’t laughed this hard at something on the nets for a long time. Thanks Kottke!

Dreaming in pixels: a warped-the-next theme idea

[Comment]

July 21st, 2008 in Ideas

new logo? activision + warpedvisions?

I was in a pixel mood while sketching in the Gimp tonight … trying to conjure up something old-school. Does it work?

SVN Status code cheatsheet

[Comment]

July 21st, 2008 in Howto. Micro Blog

Here’s a quick cheatsheet for svn stat codes, as I can never find a good one when I need it.1

    U        Local file updated
    G        Local file safely merged
    M        Local file has been modified, needs to be checked in
    C        Local file contains conflicts that need to be resolved
    ?        Local file not in repository
    !        File missing from local copy
    A        Local file scheduled to be added
    A+       Local file scheduled to be moved
    D        Local file scheduled to be deleted
    L        Local file is locked by a running svn command
  1. Note: this is a just a summary of the much better detailed svn help stat. The one some most of my developers are unaware of.

Quote: ignoring your audience

[Comment]

July 21st, 2008 in Quotes

I never think about the audience. If someone gives me a marketing report, I throw it away. - Wall-E creator Andrew Stanton

Optional arguments in PHP

[Comment]

July 16th, 2008 in Micro Blog

Named, optional function arguments are a commonly used calling convention in Perl modules, used for constructors and heavily overloaded functions. They’re usually implemented with hashes in Perl, and while somewhat more work to iterate in the library than fixed arguments, they clearly document the call for the caller (and tend to be far less fragile).

They’re also easy to implement in PHP. Here’s an example (based on some CodeIgniter code I had laying around):

class bar extends Controller {

    protected $data = array();

    function foo($name, $extras = array('desc' => 'default1', 'on' => false)) {
        $this->data = array_merge($this->data, $extras);
    }

}
  1. The optional parameters are defined as the array elements of the $extra default array parameter value.
  2. The optional parameters are merged with the class data $this->data.

Calling the function is simple:

$b.foo('test', array('on' => true));
$b.foo('test 2' /* uses defaults */ );
$b.foo('test 3', array('desc' => 'Here is a description'));

The caller’s syntax isn’t quite as clean as Perl’s, but applying the defaults is cleaner (and merging the structures is about equivalent). Despite the slightly more complex calling convention, it’s still useful for setup functions with multiple optional parameters.

Excercising the brain using Go

[Comment]

July 15th, 2008 in Links

Why programmers should play Go. A good argument for stretching your thinker in weird and wonderful ways. I’ve played my share of Go over the years, and while I can’t claim to be good at it, I can say that it has changed how I think. The important thing to remember, though, is that the stretching isn’t just a result of learning the game, it’s also the result of thinking about the game, and reflecting on the patterns of play and tactics.

Next page [>>]