Talkin’ about Shoes
Posted on | March 6, 2010 | No Comments
For reasons both complex and stupid, I recently composed a few paragraphs for the ever charming legal-eagle @gabfran on the subject of footwear. Check it out at http://lawandshoes.wordpress.com/2010/03/05/guest-shoe-blog-post-by-gilfer-the-wedding-shoes/.
My humble thanks also to the anonymous twitter friend who found some very kind words to say about me by way of an introduction. You know who you are.
Flash CS5 Will Be Able to Create iPhone Apps
Posted on | March 6, 2010 | No Comments
’nuff said, really.
With Flash CS5, ActionScript programmers will be able to create native iPhone applications and sell them on Apple iStore.
I got chills.
OSX Terminal – Drag and Drop
Posted on | March 6, 2010 | No Comments
This is one of those things that gets all my geeky bits tingling. Apple, in defiance of the age old* command-line-vs-gui debate, have snuck in this wonderfully elegant point of integration between the two worlds. Because really, why should you have to be one or the other when you have the best of both?
Here’s the thing: When using the terminal in OSX, you don’t need to type in the full path to a file you want to manipulate. You can drag the file into the terminal window from the finder, and OSX will insert the full path for you.
Stop. Breathe in, and then out. Think about it. Think about how many hours you have spent finding the path to a file. Typing it in. Getting it wrong. Swearing like a sailor at your screen. Typing it again. You will never have to do this again.
Wow, right?
This is rad, but it gets radder: you can cmd-select multiple files and do the same thing. Want to change read-write permission on two dozen files spread across multiple directories? Easy-fucking-peasy! cmd-select to your heart’s content, drag them into your terminal window and you’re done.
Try and tell me that’s not awesome. Go on. I dare you.
And yes, this is probably an old old old feature. But it’s new to me on account of how i’m pretty much a terminal rookie.
*well, as old as the first gui anyway. which isn’t very old. don’t even get me started on the even age older command-line-vs-punch-card debate.
XML Node Name – AS3 Gotcha
Posted on | March 4, 2010 | No Comments
Just a quickie, but one that stumped me for about 20 minutes (admittedly because I didn’t RTFM properly).
It turns out that the name() method of the XML class in AS3 returns an object not, as I was assuming, a String. I have a simple switch statement which was taking specific action depending on the name of the XML node it encountered. In psuedo-code it looks like this:
for each (var child:XML in myXMLList) {
switch (child.name()) {
case "node-a":
trace("my name is node-a")
break;
case "node-b":
trace("my name is node-b")
break;
default:
trace("I am an unrecognised node called " + child.name())
break;
}
}
The above will always end up in the default case, and return “I am an unrecgonised [etc]” because the result of the name() method call is an Object and not, as i had assumed, a String.
It took me a while to figure this out because the name() method will evaluate to a String in the trace function through an automatic call to the toString() function, and you will see the localName property of the returned object. Since this is most likely what you are expecting to see, it looks as though nothing is wrong and the Object returned by name() is effectively hidden.
Anyway, the fix is easy and a reminder to read the documentation once in a while. Use either xml.localName() method or xml.name().localName (the latter will return the localName property of the name Object.
Easy when you know how.
Zen Coding
Posted on | February 3, 2010 | No Comments
I linked to the Zen Coding plugins from my Twitter account a couple of weeks ago. Since then I’ve become so completely enamored with them that I wanted to rave on in a bit more detail.
The Zen Coding plugins are a collection of macro commands which take some of the grunt work out of setting up HTML and CSS files on new projects. I’ve only played with the HTML set so far but I am well and truly sold on the time they can save and, frankly, how much fun they are to use.
The idea behind the HTML plugin is to outline your basic page structure with a simple shorthand syntax resembling CSS selectors and then, with a single keystroke, let the macro expand your pseudocode into neatly formatted HTML.
Let’s say you want a basic structure consisting of an outer container wrapping three key content divs, one each for header, content and navigation. Overall, you want your html hierarchy to look like this:
-->body
--->container-div
--->header-div
--->maincontent-div
---> footer-div
With the Zen Coding plugin installed, here’s what you type — directly into your html document, between the body tags — to get things started:
div#main>div#header+div#content+div#footer
That’s all. HTML tags are specified in plain text, and are immediately followed by #id_name to specify an id, or (you guessed it) .class_name to specify a class name. Children are indicated with a > and siblings with a +.
Once you have entered your shorthand, hit ctrl-, and the plugin instantly replaces your line of text with complete, neatly indented HTML.
So:
div#main>div#header+div#content+div#footer
is instantly turned into:
<div id="main">
<div id="header"></div>
<div id="content"></div>
<div id="footer"></div>
</div>
Now come on. That’s pretty damn cool, right? Obviously the structure here is pretty simple for purposes of an example but even on so basic a hierarchy, and assuming some reasonably effective auto-completion in your code editor of choice, the plugins are reducing your keystrokes by at least 50%.
Ok, so what about the tedious business of wrapping some HTML around content? You know the drill — you’ve got ten items you need to turn into an unordered list of links for a navigation menu. Easy! Put them down on your page, just the plain text, each item on it’s own line:
home
about
faq
help
join
contact
Highlight the text and and hit ctrl-h to bring up the Expand with abbreviation dialogue Box and tell the Zen Coding plugin how to convert your plain bits of text into HTML. Enter the following shorthand ul#navigation>li*>a and your text will be formatted just the way we want it:
<ul id="navigation">
<li><a href="">home</a></li>
<li><a href="">about</a></li>
<li><a href="">faq</a></li>
<li><a href="">help</a></li>
<li><a href="">join</a></li>
<li><a href="">contact</a></li>
</ul>
You can see again that the command syntax here is straightforward, and it should feel familiar to anyone with some basic CSS experience. And you’re significantly reducing keystrokes.
So it’s easy to get started, and you’re going to save some time. Over a few weeks, I’d suggest you’re going to save quite a lot of time.
But there’s something else happening here as well: Working with the Zen Coding plugins feels like a more interesting way to put your core HTML together. More satisfying. More fun.
Instead of suffering the repetition of wrapping tags over content in a robotic fashion, you’re describing the structure of what you want, considering the pattern, and then letting the computer to the repetition. Your brain stays in a more analytical mode and the computer does the robotic bit.
The examples above barely scratch the surface of what you can do with Zen Coding plugins. Like all the best “power tools” and productivity plugins, Zen Coding is deceptively simple on the surface but enormously satisfying to use. It will quickly become a transparent part of your workflow and, once in the habit, a natural complement to your programming tools.
You can download the Zen Coding plugins for your development tool of choice from http://code.google.com/p/zen-coding/
Goodbye, Mr Salinger
Posted on | January 31, 2010 | No Comments
In a brief, pointless and probably offensive tribute to the recently passed J D Salinger, I present you with my review of Catcher In The Rye, first published some years ago on the now sadly extinct Lorne Book Club blog.
Boy, this book just killed me. I really mean it. It’s all about this poor bastard, Holden Caulfield. He has a really crummy time after he gets kicked out of his goddamn school. He goes to New York and meets all these phoneys.
I sorta felt sorry for that kid. Boy, he really does have a crummy time and all. He wears this crazy hunting hat. I think my old uncle had a hat just like it or something. Whatever.
Anyway, old Salinger kinda makes you think. He really does. Him and his crazy hero. Not that Holden is a goddamn hero, really. He’s just some crummy kid. That poor bastard.
I must’ve read this goddamn book in about five hours straight. I’m not kidding. Seeing all the crummy stuff that happened to that poor sonuvubitch, boy, it made me blue as hell. I know it’s just a crazy book and all but I hope he turns out ok. I hate seeing some sappy bastard all messed up like that.
I could tell you more but I don’t feel like going into it. All that phoney review crap sure bores the hell outta me. Just read the goddamn book, why dontcha? Or not. Who even cares.
Photographica
Posted on | January 31, 2010 | No Comments
I’ve been hanging out on Flickr for a very long time now. Five years? Maybe more. Certainly since the very early days and long before it was a Yahoo* joint.
The rise of Flickr was perfectly timed to coincide with my rediscovery of photography. It’s fair to say that the the narcotic combination of newly affordable digital cameras and the vibrant online community of Flickr was largely responsible for the extent to which I became an obsessive snapper for a few years.
Flickr was the first of the “2.0″ social websites I got excited about, and is one of only two which has had any discernable impact on my social life outside of the digital (Twitter being the other). I made real friends on Flickr and, when I was at my most active online, these friendships spilled over into the real world with numerous meetups and even a large group photography exhibition a few years back. I’m still in casual contact with some Flickrers now, despite the fact that my online activity has dropped away to almost zero these days.
There was also the geek factor. As a web developer, Flickr was one of my favourite examples of user interface design done properly. Clever, fun interface features existed entirely in the service of the site’s function rather than for the sake of being cool. Dragging annotations over the top of photographs, editing titles and captions without reloading the page, being greeted in new laguage every time you log in. This was a clever and quirky site from which I have drawn inspiration and examples for years.
Did I mention the API?
It was the first time I had ever seen such a thing. A complete programming interface which allows any programmer to tap into the vast pool of images, data and functionality of Flickr to create entirely new applications. Thousands of API-driven websites and application cropped up, many of which existed purely for the joy of being playful, creative or funny. These days an API on a social networking site is the norm but back then, for me at least, it was a revelation and evidence that these people were doing something special.
And yet…
I don’t use Flickr so much these days.
Part of the reason is simply that I’m taking less photos now. Another part is because I have less free time, and maintaining an active social engagement on a site like Flickr takes up a surprising number of hours. Beside all that is the simple fact that Flickr is big now. Really big. It grows by an impossible number of new photos, new discussions, new users every minute of every day, and with massive growth comes a diminished sense of involvement – for me at least.
Anyway.
An hour or so ago I started writing this post, intending it to be a simple pointer to my new photoblog. I somehow ended up writing a love letter to Flickr by mistake. But that’s ok. I think my Flickr days are more or less over and that makes me a little bit sad, so some nostalgic wallowing is probably called for. Flickr was a source of inspiration to me, creatively and professionally, for many years. It led me to new friends, and nearly bankrupted me in my pursuit of radtastic new camera gear. We had good times.
Oh, and my new photoblog is http://photography.flamingmongrel.net.
Check it out already.
*I can’t bring myself to write it with an exclamation mark.
So, There Was This Guy…
Posted on | January 30, 2010 | No Comments
…and he had a bunch of websites, some dating back almost ten years.* Most of these sites came and went over greater and lesser periods of time, generally reflecting for the the changing tastes, enthusiasms and MTV-style attention span of their author. Some them only existed as vague ideas, because if there’s one thing the author found hard to resist, it’s the temptation to purchase a domain name just because it sounds cool.***
Then there was flamingmongrel.net, the oldest of them all. Home to countless revisions, tens of thousands of lines of code, Flash applications, database disasters, bad jokes, fake boy bands, superhero names and machines that go ‘ping’.
And now here it is again. I’m returning to a blog format for no particular reason other than I like WordPress very much, and I’m especially fond of this theme by Drew Stauffer and Alibi Productions – see the footer for more info. The main intention is to draw together links to other sites, old work and the occasional new experiment in a common place but who knows, maybe I’ll throw some content up here from time to as well.
*10 years! Holy crap, it’s hard to believe it’s been that long** since my boss woke me at 3am to bawl me out for not being psychic and to ponder the great mysteries of the universe, such as why he employs useless cunts like me.
**Actually, it’s only been 9 years, but that’s near enough for the purpose of rounding off to a nice even number.
*** And so now the internet is host to such tiny wonders as eroticstickfigures.com and doyouthinkishouldeatthis.com