Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Thursday, February 22, 2007

NBL maybe NBT.

I picked up this post by Steve Yegge on the NBL (next big language). He didn't say what the language was, but you should read the comments. I agree - JavaScript. When we started Zimki our intention was to remove all those unwanted yak-shaving tasks which got in the way of creating something. I called this campaign - Free Tom - much to Tom's annoyance.

We then built a JavaScript application development & hosting environment. One language front and backend (JavaScript), utility hosting environment (no capex) and persistence (not a relational database but instead a key/object store). Everything accessed through an API, even the client desktop tool for developing uses the same APIs.

A great moment for me was when Tom, during a break at D.Construct built and released a wiki with autopreview in under 25 minutes. Let us be clear here - from concept to development to live on the web as a running service within 25 minutes. I can't even get a hosting arrangement sorted out in that time usually.

So at FOWA I talked about Zimki & commoditisation, about building online in JavaScript without the need to worry about servers, hosting and databases. I talked about our plans to open source the entire technology later this year in order to create a fully competitive utility computing grid and to remove lock-in. So far, Zimki and the API services behind it have been blooming. We started with three applications consuming the services in Feb '06, by April '06 we had 600k API calls, by June '06 we had dozens of applications, over 2.8M API calls and 150 developer accounts. Today, we're into the many thousands of developer accounts.

The comments ranged from some real interest, to the very flattering (p.s. Thanks, I'm always nervous when speaking as I find it such a privilege to do so and very demanding to get it right, even if it is less than ten minutes) and the I don't get it, where's the business model? Sadly there's some old skool VCs & IT folk out there who just don't get how the IT world is moving to a utility basis.

Well you can't always get the message across clearly in eight minutes. Other than the trivial selling resources into the cloud there are further opportunities which are all fairly obvious. However, this got me thinking, maybe they are just obvious to us? This subject does seem to be something new to many people, you do need to change the way you think about IT.

Now, I've been talking about commoditisation for a long time, and I am also lucky to exist in a social environment surrounded by some very smart people. To find the money, you just need to ask yourself the questions of:-
1) Is there a distinction between the electricity generators and the electricity providers?
2) What was the impact of standardisation and the national grid?

Could commoditisation actually be the Next Big Thing? Well in my view, it's been the NBT for a very, very long time - it just doesn't get the same buzz as the "new" stuff. Until, of course, we start thinking it is "new".

-- 22nd Feb 2016

Tidied up some of the typos, paragraph structure and width adjusted. Well, it's almost a decade later and Javascript is still but not quite the NBT.

Alas, many of the links are now broken.

Tuesday, November 28, 2006

A little more dabbling ...

Had a few moments spare, so I've been playing around with a few ideas.

I decided to add Technorati entries and tags into my "mood" page. This was simplicity itself.

There is no error handling at the moment - so if it bombs, it bombs. It's a bit slow because I'm pulling data from other services, combining on the server and then serving.

All that was needed was a few bits of JavaScript like :-

function processTechnoTags( tagList ) {
var subset = {};
subset.blogs = new Array();
subset.count = tagList.document.result.postsmatched;

for ( let aBlogId in tagList.document.item )
subset.blogs.push({
title:tagList.document.item[aBlogId].title,
link:tagList.document.item[aBlogId].permalink});
return subset;
}


and suddenly, hey presto I've got entries from Technorati as well as Flickr combined together. Again this is from someone who doesn't know JavaScript in detail!

Ok, it's all server side at the moment, no AJAX stuff yet but I like this language ... lots, it couldn't be simpler.

This isn't even going into the persistance side of things, which for an old DBA like myself is child's play.

Easy does it ...

Well I don't know JavaScript or HTML and I haven't coded in a long time (the last time was languages like C++ / VB and C - however even then most of my work was in heavy databases)

So I wanted to see how quickly I could build and release a web application. I decided to build a "mood" finder - the idea would be that the service would extract data from multiple different sites and determine the "mood" of the internet.

To begin with I'd make things simple and just extract "mood" from one site - in this case I chose Flickr and to make it even simpler I'd just extract images and tags related to four predefined words - happiness, sadness, fear and hope.

So steps to be done.

1. Get a web server somewhere
2. Install programming language and other necessary items
3. Write a web site which extracts information from a public API and displays it.

Hmmm.

Well I skipped steps 1 + 2 by just using Zimki.

I created a new realm, with the following URL and added some javascript and template code (see below)

All done - approx 1 hr (with about 5 minutes help from James), and it only took an hour because I didn't know JavaScript and HTML!

Now to combine with some other sites and provide something more useful or maybe just add something AJAX like - just to show how quick it can be done.

Gosh, this is easy ...

P.S If my code sucks ... well, I'm just learning the language so give us a break!


JavaScript Code
================
zimki.library.require('library', 'trimpath.js');

var fapikey = 'add your own Flickr key here';
var url = 'http://api.flickr.com/services/rest/';
var photo_url = 'http://static.flickr.com/${photo.server}
/${photo.id}_${photo.secret}_s.jpg';

function processPhotos( photoList ) {
var subset = {};
subset.count = photoList.total;
subset.urls = new Array();
for ( let aPhotoId in photoList.photo )
subset.urls.push( photo_url.process(
{ photo: photoList.photo[aPhotoId] } ) );
return subset;
}

function processTags( tagList ) {
return tagList.tag.map(
function(o) { return o._content; } );
}

function jsonFlickrApi( d ) {
if (d.photos) return processPhotos( d.photos );
if (d.tags) return processTags( d.tags );
}

function getPhotos( aTag ) {
return eval(zimki.remote.get(url,
{method: 'flickr.photos.search',
api_key: fapikey,
tags: aTag,
per_page: 8,
format: 'json' }
));
}

function getTags( aTag ) {
return eval(zimki.remote.get(url,
{method: 'flickr.tags.getRelated',
api_key: fapikey,
tag: aTag,
format: 'json'}
));
}


function runapp() {

var tags = ['happiness','sadness','fear','hope'];
var moodData = {};

tags.forEach(
function( aTag ) {
moodData[aTag] = {};
moodData[aTag].mood = aTag;
moodData[aTag].photos = getPhotos( aTag );
moodData[aTag].tags = getTags( aTag );
}
);

return zimki.render.trimpath('index.html',
{moodData:moodData});
}

zimki.publishPath('/', runapp );


Template Code
============
<HTML>
<HEAD>
</HEAD>
<BODY>

<TABLE border="1">
<CAPTION><EM>A table of moods</EM></CAPTION>
<COLGROUP align="center" width="20%">
<COLGROUP align="center" width="50%">
<COLGROUP align="center" width="20%">
<COLGROUP align="center" width="10%">
<TR><TH>Mood<TH>Photo<TH>Words<TH>Count

{for moods in moodData}
<TR><TH>${moods.mood}<TD>
{for photo_url in moods.photos.urls}
<A HREF='${photo_url}'><IMG border="0" height="150"
width="150" src='${photo_url}'</IMG></A>
{/for}
<TD>
{for tag in moods.tags}
${tag}
{/for}
<TD>
${moods.photos.count}
{/for}

</TABLE>

</BODY>
</HTML>

Thursday, April 27, 2006

It's not java and it's not just scripting.

After swearing never to do it again, Greg has organised a new tech meeting in London.

This time it's JavaScript.

A great language with a lousy name.

Friday, March 17, 2006

Fav's this week

My favourite five for this week are :-

Jeff Han's Multi touch interace : because it is breathtaking.

YouOS : because building an entire OS in Javascript is an insanely correct thing to do. The worst thing about Javascript is the name.

Nada just because it points the way to a future where the physical / digital are designed in parallel

What's up : because it is such a simple and useful interface

E-Machine Shop : not because it's new but just because it's wonderful