20080511

New and not so new technologies to build a startup

I would like to re-iterate some of the interesting ideas that Jeff Bezos threw out at startup school (google: startup school).

Building infrastructure is time consuming and wasteful for a startup. This is why many individual developers (over 350K according to Amazon's recent figures) have adopted Amazon Web Services, which allow for scaling up and scaling down, more or less transparently (programatically via API) of computing infrastructure: both in computing power and in storage (bread and butter of computing). Also in network usage (I guess that would be water, in the previous analogy).

Interestingly enough, Google is a recent newcomer to this game: it's app engine launched one month ago. I have heard that it is pretty limiting, but I do not have (for now) experience in working with AWS either.

Couple the opportunity of these infrastructure offerings with the networking power of a site like Facebook.com and you have one very compelling toolkit for a building a startup with very little money down.

Of course, you will be better off finding a framework/language that can leverage the de-centralized infrastructure of the computing cloud. Erlange comes to mind and so does mnesia. Now does anybody have a nice little set of erl bindings so wrap around AWS?

20080105

Effectively replace Firefox web-developer's extension in Safari

Firefox has some tremendous web developer capabilities: listening and modifying http requests, the web developer extension, DOM browser, Firebug to name some. Source Chart is also amazing. Firefox has one huge problem, however: it is zloooow on my mac and once I load all of these extensions, it gets even slower.

[Rant paragraph: the killer browser for the mac platform, imho, will be a webkit browser which can easily allow for extensions: if I want to store my bookmarks on del.icio.us, it should seamlessly integrate with that. If I want to install 50 extensions, it should allow me to do that, without becoming a 800 pound gorilla.]

So, I spent a bit of time yesterday trying to get Safari to mimick as much as possible some of the indispensible functionality in the Firefox developer extensions. Most of the scripts that I found were already there. Some I made.

Step 0: Enable debug menu in Safari
Just open Terminal.app and type the following:
defaults write com.apple.Safari IncludeDebugMenu 1

Step 1: Enable debugging
Go to webkit.org and download the newest webkit browser. Inside the dmg package you will also find an application called Drosera. Drosera is your webkit debugger.
Bonus point: by using webkit instead of Safari 3, you will get the newest Page Inspector, which is tremendously better than the original Safari 3 Page Inspector, which ships with Safari 3 (Edit: this page inspector is now standard in Safari 3).

Step 2: Most important Web Developer extensions for Safari
Please note: remove the newlines from the following lines of code.
Show tables:
javascript:var%20f=function(tt,col)%7Bvar%20a=document.getElementsByTagName(tt);
for(var%20b=0;b%3Ca.length;b++)%7Ba%5Bb%5D.style.border='1px%20solid%20%23'+col;
%7D%7D;f('table','00F');f('td','0F0');f('th','0FF');
Hide tables:
javascript:var%20f=function(tt,col)%7Bvar%20a=document.getElementsByTagName(tt);
for(var%20b=0;b%3Ca.length;b++)%7Ba%5Bb%5D.style.border='';
%7D%7D;f('table','00F');f('td','0F0');f('th','0FF');

Execute javascript:

javascript:var%20c='document.location.href',r='';
while(c=prompt(r+'Enter%20the%20code%20to%20be%20executed:',c)){
try{r='Returned:%20'+eval(c)+'\n';}catch(err){r='Error:%20'+err.message+'\n';}}


View generated source:
javascript:var%20str%20=%20document.documentElement.outerHTML;
str%20=%20str.replace(/%3c/g,%20"<");str%20=%20str.replace(/%3e/g,%20">");
str%20=%20"%3chtml%3e%3chead%3e%3c/head%3e%3cbody%3e%3cp%3e"%20+%20str%20+%20"%3c/p%3e%3c/body%3e%3c/html%3e";
var%20theWinref%20=%20window.open('','_blank');theWinref.document.write(str);


Step 3: Tinker headers in Safari
No known solutions yet. Any clue how to do this easily?

References:

20070919

Build new Xcode project templates

It has been talked before on the net on how to create create an xcode project template. This is another xcode template tutorial.

What are templates good for? IMHO, Cocoa should have decent out of the box exception handling. And by decent, I mean that it should dump on the console stack traces of exceptions caught by the default exception handler. More ideas: re-using other people's code in your apps. Over and over again, via templates.

20070810

Cocoa development wishlist

Garbage collection
Objective-C 2.0 has it. About time, if you ask me. The older convention of allocation/releasing, plus the complexities of writing accessor methods was boilerplate which had to go away. Any language, which aims at a reasonable productivity, in this age needs to support this. Debugging segfaults is for the 80s.

Syntax
I want syntactic sugar. I need syntactic sugar. I like ruby and python's capabilities to work with arrays and dictionaries as a part of the core language. If I want to concatenate two strings I should not have to type 20 characters. Yes, there are other solutions: macros, inline functions, and maybe other things. But they are all side-stepping the problem: while C is fast, it's a 30 year old language. Oh, actually, it is close to 45: Dennis Richie invented in for the second implementation of the UNIX. 

UI Helper app(s)
Right now creation of a custom widget in Cocoa requires quite a bit of trial and error effort: drawing bezier paths based on guessed coordinates is not fun. Guess coordinates, place, re-compile. You can invent shortcuts: place text fields in the nib for coordinates, to allow your experimental view to re-draw itself based on these inputs. It still is a kludge. Or maybe I am not in tune with the latest approaches in the cocoa world (quite possible since I do not actively develop at this time). 
I think there is a need for an application on the Macintosh that will allow developers to "draw" out their custom widgets. While the widgets are drawn, it should be possible define the separate components of each widget and to specify which components are static, and which components can be moved via different events (mouse clicks, mouse drags, keyboard key presses). At the end of this process the app will spit out the code required to implement the designed widget. I have searched on the web and I have not found anything close to this that fits the bill. I think this will be a nice decent-sized project.