Ed Silverton

Category: Uncategorized

Avoiding jqPlot Memory Leaks

I’ve run into some problems when re-plotting data in jqPlot where it’s creating huge memory leaks.

To get around this I’ve put my charts into a container div and when re-plotting I use:

$(‘.jqPlot’).remove();

which clears the charts from memory entirely.

I then recreate the chart divs like so:

$(‘#plotContainer’).append(‘<div class=”jqPlot”  id=”targetPlot” style=”height:320px; width:600px;”></div>’);
$(‘#plotContainer’).append(‘<div class=”jqPlot”  id=”controllerPlot” style=”margin-top: 30px; height:100px; width:600px;”></div>’);

and re-initialize the  plots with their new data:

targetPlot = $.jqplot(‘targetPlot’, [data],  {

Seems to do the trick :-)

How to make a repeating button with delay in jQuery

I couldn’t find an example of exactly what I wanted so I’ve made a simple jQuery plugin that turns a regular <button> into a repeat button.

http://jsfiddle.net/edsilv/xKm9K/

The key element being that you can specify how long to wait before repeating the specified action. Therefore allowing discrete clicks as well as click and hold behaviour.

:-)

Thoughts on Tron Legacy and 3D Cinema

tron

I went to see Tron Legacy at the London IMAX on Saturday. My expectations were that like Avatar I’d experience a technically impressive spectacle that would ultimately leave me cold. Suffice to say it lived up to those (rather predictable) expectations, but it also made me think about the nature of 3D cinema as a whole.

I had a feeling that my sense of detachment was being caused by something more than the unfortunately thin plot/characters. It was something about the nature of 3D cinema itself.

I’ve heard that people sometimes get headaches when watching 3D movies.  I didn’t experience that, but it did somehow feel like watching it was more “work” than usual. I think I was struggling to accept the 3D world as “reality”. My brain was simultaneously accepting and rejecting the images it was receiving. I couldn’t completely “let go” as I would normally and enter a passive suspension of disbelief. Normally when watching a 2D movie the screen itself is part of the 3D reality of the cinema and crowd. With Tron it was like there were two 3D realities competing against each other.

In the 3D virtual simulation of our everyday lives that we like to call “reality” we get a continuous uninterrupted (except for sleep) stream of 3D from a single viewpoint (our eyes). Our brains are adapted to deal with this input and explain it to our conscious mind as a nice continuous story. However, a 3D movie consists of many different camera viewpoints which are constantly changing, “teleporting” us around the film set in a way that is completely at odds with our hard-coded model of reality. If you were playing a computer game like Quake and ran onto a teleporter pad you would expect to appear somewhere else and are mentally prepared for it. If you were to be randomly teleported around the game level without warning it would be disorientating.

This is what I think was going on when watching Tron. I think if somehow I was aware that I was about to be “teleported” it would cushion the experience psychologically. Also, if the 3D visuals were to the exclusion of everything else in the outside world like those old fashioned clunky VR headsets I may not have felt like the two worlds were competing for my brain’s storytelling cycles.

In conclusion; I don’t think 3D works in the cinema but I do think it could work well in games. I think the viewer or perhaps more aptly “user” needs to be fully engaged in the experience in order to accept it as their new reality. Maybe we can look forward to being Jeff Bridges in a superior VR incarnation of Tron in cycles to come.

Walkies for Neuroses

Perpetually ineffectual individuals have a schedule of appearing more exceptional by waxing intellectual.

Predictably despicable, a term I find applicable,
Concerning matters of the heart, or otherwise political.

Oh Brighton girl it is your lot, to scour sales of fading frocks,
And itemise into the stock, of your online vintage clothing shop.

Cancer teats and disco sweets and fizzy drinks for all.
Lets suck and sniff and drop and drink until we’re all consoled.
I long to be a child again, love unconditional.
Cancer teats and disco sweets and fizzy drinks for all.

You don’t smell well.
I’m being so unfeeling as to tell you that I’m reeling
Whenever scents so unappealing are expelled.

You don’t smell well.
Perhaps a change of diet, such as eating, have you tried it?
Or staying off the ciggies for a spell.

You don’t smell well.
Trying to apply some kind of masking floral find
Will only serve to emphasise the trace of stale.

You don’t smell well.
Accept these words as kindness and for both our sakes consign yourself
To a lifestyle more congruent with your health.

My thoughts on Brian Eno’s 77 Million Paintings at Fabrica

77 Million Paintings

This is (shamefully) the first time I’ve been to the Fabrica Gallery in Brighton. Eno’s name clearly provoked sufficient curiosity to finally lure me in.

I went with my good friend Jake Spicer. We entered into a dark and, characteristically for Eno, ambient-sounding room with what looked like a large digital stained glass window at the end. Fabrica commission installations specific to the space (a Regency church), so the window looked as if it belonged there.

Being the first in we had plenty of space and a sofa to sit on and look at this window. There was no question that we preferred to sit than stand, although we didn’t reflect on why at the time. Perhaps it’s the digital nature of the artwork that put us in a slouchy computer game state of mind. Or perhaps we sat just because we could.

I’m a gamer, and a particular fan of the Half Life series. After sitting for a while and chatting with Jake about what we thought about it I started to get a vague sense of finding it mildly unnerving. I mentioned this to Jake and soon realised why.

There’s this large “window”, presumably composed of multiple LCD screens arranged in a symmetrical pattern. The portal to Brian Eno’s mind perhaps?

Situated beneath it and to the left is a diamond-shaped box on a post emitting a light that gradually and almost imperceptibly changes colour. It looked very much to me like the “guardian of the portal”.

This sense is amplified by the two conic piles of dust/gravel in front of it. These are situated just within the area that the wooden floor of the gallery ends and the stone floored bounds of the artwork begin.

My gamer “spidey sense” was tingling that if I set foot inside that “forbidden zone” (perhaps to try and enter the mind of Brian Eno) the relaxing ambient music would become a piercing alarm. The diamond-shaped guardian would then swivel to face me and zap me into a third pile of dust.

Introduction To Silverlight Session @ FlashBrighton

Hello! I’ve been a bit quiet on the blogging front recently. Lots of exciting things happening at Unwrong towers. Anyway, I thought I’d mention my upcoming Silverlight talk on Feb 17th for FlashBrighton. I know, “Silverlight at FlashBrighton”?! Seats are limited as it’s being held at the Unwrong office so if you’re keen you might want to check upcoming around Feb 10th ish to RSVP.

Strange Attractors

Jon has made a seriously cool strange attractors visualisation tool.

Music Box

I was reading about Generative Art and learned about the Max application made by Cycling74. Max is a visual environment for designing your own audio/midi manipulation tools. I decided to download the trial version and try it out. In typical semi-obsessive style I then spent the rest of the day unable to stop experimenting with it :-) The end result is a thing I’ve named Music Box. This generates melodies using notes on the Major Scale and randomly generated numbers. Here’s a video of it working. I intend to add a Minor Scale option to it as well, but this will likely require a complete rewrite.

musicbox

Generative Art

This is rumoured to be Apple’s new visualization for iTunes by flight404.

This is Radiohead’s recent music video for House of Cards.

This is “Yellow and Teal” by Erik Natzke.

Mesh

I’ve been learning a bit about Microsoft’s Live Mesh platform. From what I can tell it’s incredibly ambitious. Basically it’s a cloud computing platform that enables peer to peer file sharing, seemingly limitless application scalability and file synchronisation across devices. The synchronisation part is currently the most touted aspect. Using this you could for example take a photo on one device then all other synchronised devices (your PC, Laptop, whatever) will have access to it via your own private Intranet of sorts. I think it’s essentially what Apple are also trying to do with Mobile Me.

What interests me most about Mesh though is the scope for using it as a launching pad for developing applications where scaling, file sharing and user access control are no longer an issue. In this video they talk about “Local MOE”, MOE being “Mesh Operating Environment”. Local MOE allows you to run applications offline then when you reconnect it synchs up with “Cloud MOE”, a bit like Google Gears, propagating the changes across your Mesh. Just to be clear your Mesh is a collection of folders that can be accessed from anywhere you’ve got the Mesh runtime installed. Synchronisation is achieved using their Atom based technology FeedSync.

Local MOE is interesting because as per the video at 27:40 you can run browser-type applications on localhost. He opens a web app created in HTML and Silverlight on localhost which looks like a regular desktop app. This made me think, wait a minute – is this Microsoft’s answer to Adobe’s AIR? If the user has Mesh installed you can provide them with a “packaged” version of your app that is essentially the same except it runs locally. That’s pretty cool.

My feeling about this is that Mesh combined with Silverlight is a huge game changer in application development. This is Microsoft’s play to dominate cloud computing, basically turning the Internet into an Operating System with Mesh as the File System and Silverlight the GUI. The Midori project represents the natural pairing-down of Windows to accommodate this paradigm shift. Vista now looks even more like a bloated dinosaur about to be superceded by a nimble highly optimised, cloud-oriented equivalent.

Follow

Get every new post delivered to your Inbox.