Plan, Then Build. |
Stuff for developers. |
Not so long ago, google announced swf to html conversion with swiffy: http://swiffy.googlelabs.com/.
This is an excellent tool, but in production, it gets a bit touchy, particularly if you’re using a javascript framework like jquery.
This is all down to the swiffy runtime monopolising the $ symbol.
You might get an error like :
TypeError: Cannot call method ‘Ge’ of undefined
…the moment you try to run some $ functions with your framework.
However, all is not lost.
jQuery (so i figure the other frameworks must do too) acknowledges that the use of $ might already be taken, so offers a way around.
Include this code
var $j = jQuery.noConflict();
When you code with jquery now, simply replace your $ with $j. You will now be able to perform all your jquery stuff like so:
$j(document).ready(function(){});
I couldn’t find a complete solution for what i needed, so wrote one.
Everyone shows you how to do it in excel, and excel uses its IRR() function which yes, is great, but still, not helpful in this scenario.
Anyway
Its rounding to one decimal place at the moment, i believe that’s what EU regulations require anyway.
Pastebin after the jump.
Ok.
I just want to say this out loud - because every time i read about google’s many failed social media experiments, people suggest that wave is one of them.
I’m sorry anyone whos written this in their blogs, but you are wrong. Wave was never a social media platform. It is an online collaboration tool. Ok, ok, collaboration is a social remit, but that is not reason to shove it in the ‘social media’ group with the likes of twitter, facebook, buzz (a genuine google social media fail), bebo, and myspace.
Many people waved it around (chortle) as a social platform, but google didn’t. Google designed it to allow live collaboration, and to date - nothing else exists that does it as well as wave does it.
People flocked to it from invites and got all excited to use it, but once they realised that it wasn’t what they thought it was, they stopped using it.
I’ve used it on a few occasions, because at those times where live collaboration is needed, there really is nothing better out there for achieving that purpose.
Wave does what it does very well, the problem was that everyone else failed to recognise what it did, or they didn’t have a use for it.
Was that google’s fault for having an introductory video that was near enough an hour long? Possibly, but even if that is the case - it still isn’t a failed social media platform, because it was never a social media platform.
You’ll kick yourself if this never occurred to you before.
Proof that it works? The fonts on this very page are using Cufon, the encoded font file is hosted in a Dropbox public folder.
Want stats on your downloads?
Combine with a bit.ly account for click-tracking.
Using these methods, I am able to derive that my Dubstep’s Dead mix, has had 275 downloads (and counting!). I didn’t have to find a file sharing site, i just dropped it in my public folder. Total win.
Obviously, i wouldn’t suggest running a whole website from your dropbox account, it’s probably throttled.
Quite good this really.
An example:
$(‘#datepicker’).datepicker({ beforeShowDay: hideDays })
function hideDays(date){
if (date.getDate() == 24 && date.getMonth() == 6){
return false;
} else {
return [true, ”];
}
}
How it works
Every time the datepicker code loops, it chucks the days at your function, and you decide by returning false if you dont want it to be shown.
In this instance, im hiding the 24th of July (month 7, number 6, it counts from 0. 11 = december).
Sometimes, you will have problems storing serialized data and unserializing it later. The solution is simple (tho may have some large system-wide impact for you…).
Serialized data sucks (for a variety of reasons, none of which im entirely clear on). Adversely, JSON rocks.
Upshot, instead of serialize($array), use json_encode($array). You’ll obviously want to use json_decode instead of unserialize, too. Additional benefits include that the encoded string size is smaller.
Dance around.

From youtube.com/html5 (lets face it, the busiest video site on the web who have both new tech and user support in mind):
Supported Browsers
We support browsers that support both the video tag in HTML5 and either the h.264 video codec or the WebM format (with VP8 codec). These include:
- Firefox 4 (WebM, Beta available here)
- Google Chrome (WebM and h.264)
- Opera 10.6+ (WebM, Available here)
- Apple Safari (h.264, version 4+)
- Microsoft Internet Explorer 9 (h.264, Beta available here)
- Microsoft Internet Explorer 6, 7 or 8 with Google Chrome Frame installed (Get Google Chrome Frame)
Process that information. Look at the support list.
Next.
Some have commented that WebM is just Google getting at Apple because of what they did to Adobe.
That may be true, it may not be, but it doesnt change the following facts:
We could try and draw a parallel to what MP3 looked like when it started getting popular, but, lets be clear.
H.264 is not licensed the same way that the MP3 codec is - it does have impact for content creators, not just developers and hardware manufacturers.
So once again, we’re waiting for browser support. Blame it on google, blame it on early hype about h.264 without taking into account the patents and licensing issues, either way, that’s where we are.
Im not saying don’t use it, just be informed.
You might choose to dive straight in and do html5 video, that is up to you - and its not for ANY developer to tell you what to do. But you should be informed that if you want your users to see it - you need to follow the excellently sound advice at diveintohtml5.org.
For maximum compatibility, here’s what your video workflow will look like:
- Make one version that uses WebM (VP8 + Vorbis).
- Make another version that uses H.264 baseline video and AAC “low complexity” audio in an MP4 container.
- Make another version that uses Theora video and Vorbis audio in an Ogg container.
- Link to all three video files from a single <video> element, and fall back to a Flash-based video player
As web developers, we know, because we’ve been told, that flash must be stopped.
It is a closed system which is inefficient, and everything you’d want it for, you can do in html5 anyway, so what’s the point in using it!
Remember that a web developer is - or should be - an engineer. He looks at all the options available to decide on the best solution.
Nowadays, you’re probably not going to use flash for an animated banner. However, there are still instances where flash is not only acceptable, but the most elegant solution.
I know, this flies in the face of what everyone says, and what you’ve been told thus far - but remember - you are an engineer, not a sheep.
It is your remit to:
The problem is that too many web builders lent on flash for everything, and wrecked its perception.
You may think its just a video player, just an animation tool - and you’re wrong.
Go have a brief skim of the AS3 Docs, you will quickly get the handle of the truth - you probably don’t know 5% of what is flash is capable of.
SWF will drop out, eventually, due to the very real outgoingness of plugin technology… but this wont happen totally until there is a replacement that not only equals it, but betters it.
Just to be clear, HTML5 does neither of these, not yet anyway.
The other thing to bear in mind, no-one expected WebM (ACTUALLY open) and no-one expected WebP, but here we are. Things change, learn the facts yourself, and make your own decision based on the facts.
Baaa.

Eric Raymond’s Rule of Economy states “Programmer time is expensive; conserve it in preference to machine time.” But I’ve got a better one.
The user’s time is precious; conserve it in preference to programmer time.
It’s so easy for a development team to make decisions based on the schedule,…
As a developer, i occasionally am asked to do something completely random as part of an automated process. Sometimes its easy to do, sometimes difficult.
Recently I had to automate a file download, to run as a feed automatically onto a site which unforunately has to be nameless for NDA reasons.
This was to access a secure file transport site which used a piece of software called tumbleweed.
Using command line, i could use cURL to access the site, but i hit a problem. The command would ALWAYS cause a user prompt (in this case, it was prompting for the password). I tried various amends to my command to get it to work all in one go, but to no avail.
So, i had to find a way to automatically respond to an expected prompt.
Then, i found expect. It is a TCL extension for bash programming, and it allowed me to fully automate the prompt.
At the time, i googled around, and couldn’t find much that was relevant to my problem. I eventually found the answer, but it took some digging. The point in this post is just to give someone else who may be looking for a similar solution, a fighting chance.
Hopefully google will pick this up on the strength of keywords and relevance and will return this post as a useful type of directional signpost to a possible solution. Hopefully. Otherwise, iv just wibbled on for no reason at all.