Seattle drinking den bans Google Glass geeks

I had to repost this article from The Register if for no other reason than it used the word “vainglorious”.

This is a Seattle den called the “5 Point Cafe”, which made the decision to ban Google-eyed punters out of respect for the privacy of its clientele.

It’s a fun read, but it does open up an interesting point on privacy.
Jump to the article…

Bombermine — Massively Multiplayer Bomberman

Bombermine is an excellent MMO HTML5/JS game built using Angular, Canvas and async.js.

Be warned it is a massive time sink.  I’ve just wasted over an hour playing this brilliant little gem.

Screen Shot 2013-03-04 at 10.59.51

This weeks javascript roundup

I thought that I’d start doing a weekly list of Javascript (and other tech) that caught my eye.  So, to kick it off here is the first list:

Reading

“localStorage” denial of service attack

Even though the Web Storage specification says user agents should limit the amount of space used to store data, a new exploit uses it to store gigabytes of junk. The exploit is based around storing data per-subdomain, which gets around the limits most browsers have already implemented. Users testing it found Chrome would crash when run in incognito mode, but Firefox was immune to the attack.

Other security researchers have raised concerns about localStorage in the past. Joey Tyson talked about storing malicious code in localStorage, and Todd Anglin wrote about some of the more obscure facts about localStoragewhich touches on security.

PhoneGap: An Unexpected Journey

This is a story of a web developer, who’s a complete newbie in mobile world and who were given a task to research and develop a tablet application from scratch, re-using his experience in web technologies, i.e. using PhoneGap.

Choices, Choices: Dart or AngularJS?

In this great discussion on Google+, read some of the debate from a real developer trying to make the choice between Dart and AngularJS for his next project.

Learning From the Brackets Source Code

Brian Rinaldi takes a look inside the Brackets’ source to examine what techniques, libraries and frameworks you can learn using examples directly from the Brackets’ code.

Cloudinary Tutorial

Cloudinary is best described as a realtime ImageMagick in the cloud with versioning, storage and CDN services.  This tutorial introduces Cloudinary, and demonstrates how to build a gallery application using Express and Node.

Code & Libraries

Sails – Realtime MVC Framework for Node.js

Sails.js makes it easy to build custom, enterprise-grade Node.js apps. It is designed to resemble the MVC architecture from frameworks like Ruby on Rails, but with support for the more modern, data-oriented style of web app development. It’s especially good for building realtime features like chat.

Oooo shiny!

Nodecopter

Well, looks like I’ve found a new hobby!  Flying node machines what could be better?

NodeCopter.js is a full day event where 15 – 60 developers team up in groups of 3.  Each team receives one Parrot AR Drone 2.0 and spends the day programming and playing with it. At the end of the day, each team gets to present their work to the other attendees.

While I can’t make the London event, I am certainly going to get an AR-Drone and hook up my own personal drone of destruction.

Releases

Node 0.8.21

Node 0.8.21 is out. There are fixes for the http and zlib modules, so it’s safe and sensible to update.

Meteor 0.5.7: Major Scaling Update, New DDP Version, EJSON

Major improvements: New revision of DDP (Meteor’s protocol) with different messages and a version negotiation step; extensions to JSON to represent additional data types; and new database observer and publish APIs.

Sources:

Javascript Weekly | DailyJS | Reddit

The Restart Page – A trip down memory lane

Oh the memories. Relive the rebooting experience from a bygone age courtesy of The Restart Page. I let out a big laugh at the Amiga reboot complete with floppy drive sounds – oh, those were the days.  I think I’ll have to do a Commodore 64 loader tape simulator.

It even has sound!

Via: TheVerge

iPad survives fall from space

This video is from rugged case manufacturer G-Form who sought to prove its hardware protection credentials in the most spectacular fashion possible by launching an iPad into near space before letting it plummet to Earth.


 

The iPad in its Extreme Edge case and, using a weather balloon which bursts at altitude.

Via: El Reg

Playing with MongoDB in LA

When I first saw NoSQL stores a few years ago I wasn’t that impressed.  They were nice and really fast if you had a bucket load of ram, but it seemed to be a solution to a problem I didn’t have.

My biggest qualm was initially the “eventually consistent” data, and the absolute requirement to have multiple nodes.  I have grown to like the “eventually consistent” model because 75% of what I build are CMS or CRUD type apps.  With these type of apps you are reading data most of the time and only occasionally writing to the store.

But, for the most part good old MySQL serves as the warhorse as it has with me for the last 12 years (wow, it’s been that long?!).  It does the job, and doesn’t take a lot of admin to keep things running smoothly.

MongoDB – The new cool?

But recently I began to hear about MongoDB, and I’ve really taken a shine to it.  Essentially it is a NoSQL datastore, but stores data as binary JSON (BSON) but seems to straddle the divide between traditional RDBMS & NoSQL stores.  It also has full index support, journaling, really nice support for replication and sharding and pretty much all the things you’d expect of a RDBMS but in a document store with a number of extra bells and whistles attached.

There also seems to be a lot of energy in the project, and it feels like MySQL did when it was the scrappy newcomer (but Mongo has a *much* better website!).

Schema-me-this, schema-me-that

But the one thing I can’t quite understand yet is how to model a document store schema. Document stores can be multi-dimensional, which means that you can store arrays, structs and all manner of data nested within a single document record.  This can be very useful, but traditional normalisation rules do not apply.

I’ve had CODDs normalisation drummed into my brain so much it is just nature to me now; I go all the way to 5NF ‘cos I’m hard. ;)  Changing you mindset after 15+ years of BCNF dogma is a tricky thing, and I think it requires the kind of mind-shift that I had to go through when learning OOP having only used functional languages before.

The problem is that there I have not uncovered as yet a wealth of information on what the best way to design these things and as such I’ve not taken the plunge yet with MongoDB as the backbone in a new project.

But yay, enlightenment is a mere 30mins drive away @ LAX

But, the knowledge gods have smiled on me as there is a MongoDB 1day conference in LA on the 19th Jan with a track on just the thing I am craving info on.  I will dutifully report what I learn should I remember anything after we inevitably hit the bar (there will be no repeat of Scotch on the Rocks and the Jagermeister incident).

Watch this space…

Psych Vision 2

My favorite TV show has a new mobile app – Psych Vision 2:

It uses AIR 3.0 and takes advantage of new features like StageVideo in combination with OSMF to enable HD video playback, StageText, captive runtime, and StageWebView for the social media integration. And to boot, Ben Forta presented it during the MAX 2011 keynote.

Here are the links…wait for it, waaaait for iiiit…

Playing with Node.js – the basics…

Today has been fun learning Node and finding out how powerful this thing really is. Here are a few simple snippets to illustrate the power of Node:

Simple web server

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(3000, "127.0.0.1");
console.log('Server running at http://127.0.0.1:3000/');

That can’t be it surely? Oh yes it is, you now have a very simple webserver sitting on port 3000 just waiting to say hello.

Phhff, that’s just simple and isn’t that impressive

OK, but all that does is say “Hello World” to every request, and that’s not very much use. What if it does something useful like serving static files, essentially a very basic webserver.  That will make it much more complicated since we need to use the connect webserver module, and the huge code for that is:

var connect = require('connect');
var server = connect.createServer(
	connect.logger(),
	connect.static(__dirname + '/html')
).listen(3000);
console.log('Connect server running at http://127.0.0.1:3000/');

That is all that is needed to serve everything in the “html” directory, and log all connections in an Apache log format to the console. The connect module has support for cookies, vhosts, session management and much more.

OK, that’s kinda impressive but is that it?

That’s just the tip of the iceberg, what about a chat server? That must be much harder broadcasting to all the clients and all that. Well it is harder, but only 29 lines harder.

var net = require('net'),
    carrier = require('carrier'),
	connections = [];

var server = net.createServer(function(conn) {
	var username;
	connections.push(conn);

	conn.write('Welcome to the Odyssey Of Mayhem chatroom!\n\n');
	conn.write('Please type your name:');

	conn.on('close', function(){
		var pos = connections.indexOf(conn);
		if(pos >= 0) connections.splice(pos, 1);
	});

	carrier.carry(conn, function(line) {
    	if(!username){
			username = line;
			conn.write('Hello '+username+'! There are '+(connections.length-1)+' other people on the server\n');
			return;
		}

		if(line == 'quit'){
			conn.end();
			return;
		}

		var feedback = username + ': ' + line + '\n';
		connections.forEach(function(one_connection){
			one_connection.write(feedback);
		});
	});
}).listen(3000);
console.log('Simple chat server up on port 3000.');

There you have a simple chat server that remembers your name, and broadcasts your inner thoughts to whoever else dares fire up a telnet client! What was that, “pics or it didn’t happen”?  OK, here you go…

3 terminal windows. 1 for Node, and 2 for chat clients.

Oh, I’m going to have soooooo much fun in the coming weeks. :D

Damn you Mr Mclean, damn yoooooouuuuu!

The job is on

It all started innocently enough when my good friend and partner in crime Gordon McLean sent me a question:

Do you want to see if you can get an iPhone to send an SMS from a Mac/PC.
Essentially I am looking for a SMS service that can be triggered from
Servoy that uses a standard phone ideally one unlimited free texts via
AT commands.
Dont spend frigging hours on it mind, there is virtually no budget.

Servoy for those who don’t know is a Java based RAD tool to produce desktop/web apps very much in the same way as Filemaker Pro, Visual FoxPro do.  It’s a great tool to build desktop business app quickly.

The Options

So, I wondered off in search of a solution and since the budget was “as tight as a ducks backside”, a KISS approach was called for.  A short while later I fired off a reply saying suggesting the following solutions:
  • Purchase the Prolific Axis serial port plugin for Servoy, and hope it works.
    Costs almost the whole budget however.
  • Write our Servoy plugin utilising the standard Java serial communications API
  • Write a script that will sit along side servoy (but must be installed separately from Servoy).
    This can be in a number of languages like Perl, Python, Ruby or Javascript.

We agreed that the fastest and cheapest way was to build a proxy app that would accept HTTP REST calls, and then communicate with a phone over a serial port.

The quest for a simpler, more productive life

Since I’m in a push to reduce complexity and the number of technologies I finally suggested that we use Node.JS since I dislike Perl, haven’t every got around to working with Python and I’m just not getting in to Ruby that much.  My logic being that otherwise the choices are Perl, Python or Ruby and all use different syntax to Javascript; since we know Javascript, why learn another language?  The response was susinct:

F@*k me, I never thought I would hear you say “use a known technology” ;)
Are you feeling OK !?!

You see, I like shiny and new things – that is why there is an “Ooooo shiny” category to my blog.  I normally learn a few new technologies a year just to keep up to date and have a play.  The bleeding edge is where the cool toys are. ;)

There be gold in them there hills

But, you see despite myself seeking safe ground this time, it would seem that I have uncovered shiny gold!  The more I read about Node, the more I liked and now I am totally smitten.

One key difference is that Node uses an event-loop rather than the norm which is threads.  The problem though is that you need to look at the problem differently since the whole thing is event driven and non-blocking.

Traditional appservers will do an operation, block (wait for IO from database) and then continue with the code.  But while the server is waiting, that process can not do anything else other than wait.  This is why app servers have threads so that there are multiple worker-threads waiting for incoming connections and hopefully no one is kept waiting (assuming we don’t run out of threads).

Upon further reflection it occurred to me that with most of the applications that I’ve worked on over the last decade very rarely was CPU load the major issue.  Most of the time it was either IO (database or disk) or low memory issues.  Indeed the main cause of high CPU loads was when the Java garbage collector “goes nuts” when memory is very low.

So it seems that my inner explorer and lover of shiny things has thwarted my quest to reduce the number of new languages/platforms that I play with.  Oh well, have to go and play with the new toy now. :)

jQuery Mobile reaches v1.0

Yesterday, the jQuery Mobile Team announced the official release of jQuery Mobile 1.0.

I have been working with jQuery Mobile since it hit beta, and in the time since it has certainly evolved into a mature platform for Mobile Web Applications.  It will certainly be in my toolbox and is easier to use than Sencha Touch for smaller projects.

Follow

Get every new post delivered to your Inbox.

Join 143 other followers