This is a quote from Fred Brooks' "The Mythical Man Month".
“Where a new system concept or new technology is used, one has to build a system to throw away, for even the best planning is not so omniscient as to get it right the first time. Hence plan to throw one away; you will, anyhow.”
Great insight. What's also remarkable is this book is over thirty years old. In technology, we like to talk about how much and how fast things change - and they do, however there appear to be lots of things that remain timeless.
Saturday, September 13, 2008
Friday, September 12, 2008
Using the Flickr Authentication API - part I - generating the api_sig
All Flickr API calls using an authentication token must be signed. In addition, calls to the flickr.auth.* methods and redirections to the auth page on flickr must also be signed.
The api_sig is to be appended to the URL for all such API calls. The following code can be used to generate the api_sig (of course, you can use a higher-level library such as flickrj if you enjoy eating microwave ready to eat meals over growing your own tomatoes ;-).
The api_sig is to be appended to the URL for all such API calls. The following code can be used to generate the api_sig (of course, you can use a higher-level library such as flickrj if you enjoy eating microwave ready to eat meals over growing your own tomatoes ;-).
package com.jasondchambers.flickr;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Set;
import java.util.SortedMap;
import java.util.TreeMap;
/**
* Generates an api_sig from a list of parameter key value pairs
*
* The signing process goes like this. The parameters are sorted
* e.g. foo=1, bar=2, baz=3 sorts to bar=2, baz=3, foo=1
* The secret and the parameters are concatenated together as follows to provide
* the raw signature
* e.g. SECRETbar2baz3foo1
* An MD5 hash is created, converted to hex and returned - this is to be used as
* the api_sig parameter
*
* See section 8 of [1]
*
* [1] http://www.flickr.com/services/api/auth.spec.html
*
* @author Jason Chambers
*
*/
public class ApiSigGenerator {
private String secret;
public ApiSigGenerator(String secret) {
this.secret = secret;
}
public String sign(String... paramKeyValuePairs) {
try {
// Sort the parameters first
SortedMap<String, String> sortedParameterMap = sort(paramKeyValuePairs);
// Generate the raw signature
String rawApiSig = generateRawApiSig(sortedParameterMap);
// Hash the raw signature and return
return generateMd5(rawApiSig.toString());
}
catch (Exception e) {
throw new FlickrClientException(e);
}
}
private SortedMap<String, String> sort(String[] paramKeyValuePairs) {
SortedMap<String, String> sortedParameterMap = new TreeMap<String, String>();
final int KEY = 0;
final int VALUE = 1;
int i = KEY;
String key = null;
for (String o : paramKeyValuePairs) {
if (i == KEY) {
key = o;
} else {
sortedParameterMap.put(key, o);
}
i = ~i;
}
return sortedParameterMap;
}
private String generateRawApiSig(SortedMap<String, String> sortedParameterMap) {
StringBuffer rawApiSig = new StringBuffer();
rawApiSig.append(secret);
Set<String> keySet = sortedParameterMap.keySet();
for (String k1 : keySet) {
rawApiSig.append(k1);
rawApiSig.append(sortedParameterMap.get(k1));
}
return rawApiSig.toString();
}
private static String generateMd5(String input) throws NoSuchAlgorithmException {
StringBuffer output = new StringBuffer();
MessageDigest md;
md = MessageDigest.getInstance("MD5");
byte[] md5 = md.digest(input.getBytes());
for (int i = 0; i < md5.length; i++) {
String tmpStr = "0" + Integer.toHexString((0xff & md5[i]));
output.append(tmpStr.substring(tmpStr.length() - 2));
}
return output.toString();
}
}
Wednesday, September 10, 2008
Google's innovative approach to communicating Chrome
A big part of my job is communicating. In particular, I communicate designs and vision such that our development team can go off and build product. I have tried several approaches to communicating designs to the (remote) development team over the past few years or so including (some with more success than others):
Why do I bring this up? - Because I have been studying Google Chrome of late. The thing that most impressed me most was not necessarily Google Chrome per se (although I applaud some of their innovations and their approach), but one of the innovative ways they communicated the project to the public when it was launched.
They developed a comic-book – go check it out.
- Powerpoints (2007 has awesome 3D capabilities – ideal for those m-architectures)
- Demonstrations (I use iShowU)
- Proof-of-concepts (i.e. working prototype code)
- Visio’s (for when I feel constrained by UML)
- Word documents (nice and formal)
- Recorded Video presentations (I have found demonstration software works better)
- UML models (using Enterprise Architect)
Why do I bring this up? - Because I have been studying Google Chrome of late. The thing that most impressed me most was not necessarily Google Chrome per se (although I applaud some of their innovations and their approach), but one of the innovative ways they communicated the project to the public when it was launched.
They developed a comic-book – go check it out.
Tuesday, September 9, 2008
Flickr API
I have a ton of old prints I'd like to get published on-line at Flickr. I have a scanner at home but that sounds like a tedious process to me. It turns out that Walgreens (a US pharmacy) provides scanning services at a reasonable price. Sounds like a winner.
Typically whenever I publish photos to Flickr, I use iPhoto with FlickrExport from Connected Flow. This works fine for a manageable number of photos.
I'm thinking I want a better approach for bulk uploads so I signed up for an API key and intend to write some code to manage and automate the upload process for me.
I'll keep you posted with my findings and experiences using the API in due course.
Typically whenever I publish photos to Flickr, I use iPhoto with FlickrExport from Connected Flow. This works fine for a manageable number of photos.
I'm thinking I want a better approach for bulk uploads so I signed up for an API key and intend to write some code to manage and automate the upload process for me.
I'll keep you posted with my findings and experiences using the API in due course.
Friday, September 5, 2008
iPhone - don't leave home without it
It's been a couple of weeks since I picked up the new iPhone 3G. It had been on my shopping list for quite a while but being a bit of a cheapskate, I decided to wait and defer the purchase for as long as possible. The good thing about holding out on your technology purchases is that the gadgets only continue to get better (of course this is traded-off against the cost of going without).
Unfortunately, or fortunately whichever way you look at it, my RAZR finally packed up while on vacation in Kiawah, S.C. I happened to be passing the Apple store in nearby Charleston and decided to pop in and just see if by chance they had any iPhones in stock. To my delight and surprise they had and so I picked one up.
I immediately put it to use to help me find the car park - using it as a GPS locator if you will (although I don't think it doesn't actually uses GPS - I believe it locates via triangulation with cell towers correction - it does actually use GPS and cell tower location technology).
Immediately, I found the user interface very intuitive. This is a major improvement over the cell phones I have used in the past. The RAZR phone had a terrible user interface. After using it for over two years, I could not identify the correct buttons to press to switch between silence/vibrate and loud ringtone. I ended up just pushing the buttons on the side until the display told me I'd finally reached my desired setting.
I have to hand it to Apple. They have created a very powerful capable device in the iPhone and have yet managed to make it's operation easier to use than less capable devices.
This past weekend, I ended up taking my Dad to an urgent care facility in Nashville to get a prescription for Diabetes meds he left back in Atlanta. After waiting 4 hours to see the doctor (we could have driven back to Atlanta in only 3.5 hours), we learned that the doctor had not heard of the medication. I couldn't quite believe what I was hearing. Out comes the iPhone and off I trot over to Google. It turns out the drug in question is not FDA approved (although it is approved in the UK). The doctor confirmed my findings after talking to a pharmacist.
Also, this past weekend we bought a new car. I did some preliminary research by tapping into edmunds.com when the salesman wasn't looking proved useful in figuring out if I had a good deal or not.
Finally, I have a terrible short term memory. I'm not very good at remembering things like where I parked the car or shopping lists. I use SpeakEasy which I use to record voice notes and reminders. Invaluable little tool.
I'm also experimenting with Evernote too as a way to organize some of the chaos - or at least make it accessible when I need it. I used it to compile and collect research for the recent car purchase. Good stuff.
The one down-side is that the battery, particularly when using 3G doesn't seem to last too long. Also, not quite sure why iTunes Store only works when connected over WiFi.
The touch-screen device seems to have just the right level of sensitivity.
All in all though, it's a very useful device.
Unfortunately, or fortunately whichever way you look at it, my RAZR finally packed up while on vacation in Kiawah, S.C. I happened to be passing the Apple store in nearby Charleston and decided to pop in and just see if by chance they had any iPhones in stock. To my delight and surprise they had and so I picked one up.
I immediately put it to use to help me find the car park - using it as a GPS locator if you will (
Immediately, I found the user interface very intuitive. This is a major improvement over the cell phones I have used in the past. The RAZR phone had a terrible user interface. After using it for over two years, I could not identify the correct buttons to press to switch between silence/vibrate and loud ringtone. I ended up just pushing the buttons on the side until the display told me I'd finally reached my desired setting.
I have to hand it to Apple. They have created a very powerful capable device in the iPhone and have yet managed to make it's operation easier to use than less capable devices.
This past weekend, I ended up taking my Dad to an urgent care facility in Nashville to get a prescription for Diabetes meds he left back in Atlanta. After waiting 4 hours to see the doctor (we could have driven back to Atlanta in only 3.5 hours), we learned that the doctor had not heard of the medication. I couldn't quite believe what I was hearing. Out comes the iPhone and off I trot over to Google. It turns out the drug in question is not FDA approved (although it is approved in the UK). The doctor confirmed my findings after talking to a pharmacist.
Also, this past weekend we bought a new car. I did some preliminary research by tapping into edmunds.com when the salesman wasn't looking proved useful in figuring out if I had a good deal or not.
Finally, I have a terrible short term memory. I'm not very good at remembering things like where I parked the car or shopping lists. I use SpeakEasy which I use to record voice notes and reminders. Invaluable little tool.
I'm also experimenting with Evernote too as a way to organize some of the chaos - or at least make it accessible when I need it. I used it to compile and collect research for the recent car purchase. Good stuff.
The one down-side is that the battery, particularly when using 3G doesn't seem to last too long. Also, not quite sure why iTunes Store only works when connected over WiFi.
The touch-screen device seems to have just the right level of sensitivity.
All in all though, it's a very useful device.
Tuesday, September 2, 2008
Lucid definition of design
I have just watched an interesting video of a presentation Richard P. Gabriel gave at QCon in 2007. The title of the presentation "Architectures of extraordinarily large. self-sustaining Systems" is available here for those of you who are interested.
During the video, Richard provided a wonderful definition of the term design:
"Design is the thinking one does before building"
I like this definition. What do you think?
During the video, Richard provided a wonderful definition of the term design:
"Design is the thinking one does before building"
I like this definition. What do you think?
Subscribe to:
Posts (Atom)
