Archive for December, 2007

upgrading must be a relative term

Microsoft Windows VistaThis article seals the deal. Well, until I have enough extra cash laying around to get a macbook pro, I’m definately not going to be throwing any money at the purchase of anyone’s operating system.

Vista, both with and without SP1, performed notably slower than XP with SP3 in the test, taking over 80 seconds to complete the test, compared to the beta SP3-enhanced XP’s 35 seconds.

Microsoft admits that the launch has not gone as well as the company would have liked. “Frankly, the world wasn’t 100 percent ready for Windows Vista,” …

http://www.news.com/2100-1016_3-6220201.html

On a side note, I wonder if I might be able to install Panther on my old G3 iMac without it running slower than it already does and then throwing and complete and utter hissy fit, probably not.

coffee and consulting

I recently found myself standing at a counter at a cafe in Williamsburg having to instruct the barista through every step of making my order. I even had to ask him to please rinse out the porta-filter (the handle thing you put the espresso in) and then explain that by not rinsing it out between each drink, it’s not only gross, but makes the drink taste unneccessarily bitter. Silly barista.

One thing that I’ve been saying for years is to “never entrust coffee to a child”. That means that though your local (or global chain) cafe may happen to employ teenagers and college kids to sling drinks, those kids are usually working there for the $7 an hour and the couple of bucks in tips they might make, and not because they enjoy coffee or are even remotely good at what they do. I’m not saying there’s anything wrong with trusting your employees to provide a quality service just because you’re paying them. It’s just that coffee (like web design/development) is a special kind of service that creates a special type of product.

What is it that is the difference between a decent cappuccino and a great one? It’s the same things that divide quality interactive work from everything else. Ingredients, skills, and the most overlooked, passion. No matter what it is you do, you’ll always do a better job if you do it because you love to do it.

cats fight spam while i sleep


cats fight spam while i sleep, originally uploaded by naterkane.

I woke up this morning to find that one of my cats had not only been reading my email, but also decided to care enough about the comment spam I get that they would start to write back to the notification email.

first snow in brooklyn



first snow in brooklyn, originally uploaded by naterkane.

Adding support for Collections in the Flickr API

Over the next day or two I will be extending one or two Flickr API libraries with the goal of adding support for Collections in a user's photostream.

I can't find any information as to when Flickr is going to support collections in their API themselves. If anyone wants to save me a few hours of work, let me know. I'd be happy to not have to do the work myself. Sofar I'm expecting to have to pull out my regex reference book to give you a clue as to how it'll happen.

CURLing for Collections

I have a client who requested I build a custom front end to their Flickr account. She relies heavily on the collections feature of Flickr to organize her many many photosets. As we were trying to figure out how she can organize her account so I can quicklly parse the data returned by the Flickr API, I came up with a few proposed solutions. This is one of them, and though now what we went with, I decided to share.

CODE:
  1. <?php
  2. function getLinks($url){
  3.         $ch = curl_init();
  4.         curl_setopt($ch, CURLOPT_URL, $url);
  5.         curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
  6.         $data = curl_exec ($ch);
  7.         curl_close ($ch);      
  8.         $doc = new DOMDocument;
  9.         // We don't want to bother with white spaces
  10.         $doc->preserveWhiteSpace = false;
  11.         $doc->loadHTML($data);
  12.         $items = $doc->getElementsByTagName('a');
  13.         return $items;
  14.         }
  15.  
  16.  
  17. function listLinks($recursive,$id = ""){
  18.         $url = "http://www.flickr.com/photos/".$_SESSION['username']."/collections/".$id;
  19.  
  20.         $items = getLinks($url);
  21.         echo "<ul>";
  22.         for ($i = 0; $i <$items->length; $i++) {
  23.             if ($items->item($i)->getAttribute('class') == "Colla"){
  24.                 $thisCollectionID = split("/",$items->item($i)->getAttribute("href"));
  25.                 echo "<li>" . $items->item($i)->nodeValue . ': ' . $thisCollectionID[4];
  26.                 if ($recursive == true){
  27.                     listLinks($recursive,$thisCollectionID[4]);
  28.                 }
  29.                 echo "</li>";
  30.             } elseif ($items->item($i)->getAttribute('class') == "Seta"){
  31.                 $thisSetID = split("/",$items->item($i)->getAttribute("href"));
  32.                 echo "<li>" . $items->item($i)->nodeValue . ': ' . $thisSetID[4];
  33.                 echo "</li>";
  34.             }
  35.            
  36.         }
  37.         echo "</ul>";
  38. }
  39. ?>

Listing all of the photosets recursively

To loop through all collections and collections of collections recursively we simply call listLinks(false);. The execution time on the server was about ~3 seconds, which is unacceptably slow for realtime requests.

In order to just list the photosets that are inside of the top level collections, which takes about half the time (about 1-1.5 seconds), but is still unacceptable, you just set the parameter to false like so listLinks(false);. Simple as that.

You may have noticed that these are global functions. The Flickr API php library that I used for this project was actually not written in PHP5, and since this was just a simple proof of concept to talk the client out of using Collections, and instead a photoset naming convention, to organize the photos that were going to be made available on her site.

Using collections in the real world

Though 3 seconds of processing time would be horrible if your code was making requests all the time, using CURL to pull this data in to your server once in awhile and storing the results in a database doesn't seem too bad. An acceptable approach to working around the lack of support in the API is better than nothing at all. Right?

phizpop design challenge party

phizpop design challenge party

phizpop design challenge party, originally uploaded by naterkane.

Design work was not great, but the party was better. I honestly think the wrong team won. I'm guessing the agencies who were asked to participate must have been selected from a list of Microsoft vendors instead of from groups who had the most talent and capabilities.

I've pulled some serious firedrills in my day, and though three days is a very tight timeframe to turn anything around. It seemed to me that only the first group spent real energy and thought on UI and execution of an interface. Why they awarded points specifically for branding escapes me entirely.


Nater Kane naterkane personal http://www.naterkane.com LinkedIn Profile Web Technologist personal nater@naterkane.com 1978-09-12 voice 845.234.6698 | fax 707.922.0593
964 Flushing Ave. Brooklyn, NY 11206