Capture a single frame of video in Windows Media Player
19 January, 2009

Turning off hardware acceleration will let you take stills of video
Just a quick one today, but a very useful one. Ever needed to grab a still out of a video to use as a placeholder graphic or something? Playing the video in Windows Media player and pressing print screen then pressing or paste in your favourite image editing application, will only get you the Windows Media Player frame with a big black void in the middle of it.
The solution is to turn off video acceleration as in the image above.
Simply go to Tools -> Options, then under the performance tab, slide the arrow all the way to none.
Now when you play your video and hit print screen, your resulting screen cap will actually have a still of the video.
setInterval pains
6 January, 2009
Are you coding away in flash using setInterval instead of onEnterFrame in order to be a bit nicer on the CPU that has to render your final flash piece? Bashing your head against the wall because they aren’t clearing properly, or failing to fire properly? Well here’s my quick attempt at trying to explain how to use setInterval.
To start with, always start with an interval ID. This is just a variable that you create to hold a number that references the current setInterval occurrance (wanted a better word, but that will do). By doing this it is much easier to turn it off when you no longer need it.
Once we have that variable, we go ahead and clear the interval. I know it seem counter-intuitive, but over time I’ve found that by clearing it first, you are guaranteed not to end up with multiple instances of the same setInterval messing everything up on you. So here we go:
var newInt:Number;
clearInterval(newInt);
newInt = setInterval(ding, 1000, “ding”);
So all we have here is a setInterval command, ready to fire off a function called ding every second (remember that setInterval works in milliseconds and there are 1000 milliseconds to a second) sending the parameter of “ding”. So lets add in the function:
var newInt:Number;
clearInterval(newInt);
newInt = setInterval(ding, 1000, “ding”);function ding(txt:String):void{
trace(txt);
}
This is now in a position where you can go ahead and try it out so press CTRL-Enter and preview it. If all goes to plan your output will trace “ding” once every second.
To test things out a bit more, let’s introduce a second setInterval command to complicate it all and fire off the original setInterval at random times. The code will look like this:
var newInt:Number;
var secondInt:Number;
var count:Number = 0;function init(){
secondInt = setInterval(startInterval, 1000);
}function startInterval(){
count++;
clearInterval(newInt);
newInt = setInterval(ding, 500, “ding – ” + count);
}function ding(txt:String){
trace(txt);
}init();
So what this is going to do is fire off startInterval every second which will then fire our ding function half a second after that. Because the clearInterval(newInt) is called before the next setInterval is set, everything happens once, then ends. I added in the count to make this easier to notice.
Experiment with this until you have it all figured out. Try commenting out the clearInterval(newInt); line and see what happens:
var newInt:Number;
var secondInt:Number;
var count:Number = 0;function init(){
secondInt = setInterval(startInterval, 1000);
}function startInterval(){
count++;
//clearInterval(newInt);
newInt = setInterval(ding, 500, “ding – ” + count);
}function ding(txt:String){
trace(txt);
}init();
You’ll see now that each iteration of the newInt setInterval keeps going, repeating itself every half a second with nothing to stop it. As far as I can tell there’s also no way of rescuing setIntervals that are launched without a suitable ID.
So the basic rules of setInterval are:
- Always use clearInterval before a setInterval;
- Always use an interval ID;
- Use a unique interval ID for each setInterval you need.
Is Android the Linux of the mobile world?
29 November, 2008
The more I see and read about the Android Platform, the more I believe it will become the equivalent of Linux in the PC world. A platform preferred by geeks and techies due to its customisability and open source architecture, but shunned by the average punter who very quickly gets overwhelmed by the openness of it and puts it straight in to their ‘too hard’ box.
I had been having these thoughts for a while now, but after seeing this clip, I am pretty confident that my statement is accurate.
“The best applications aren’t here yet. They’re going to be developed by developers like you…”
Sure, right now we are talking about a platform that isn’t very old and has a lot of growing to do. This video in particular was advertising the prize they’re offering to clever little developers who do code up the applications that will define what the Android platform becomes. But at the crux of it all, your average punter doesn’t understand open source, or care about the possibilities of a completely open architecture. They just want a phone that’s easy to use and works.
The iPhone has enjoyed incredible success, mainly beause it was designed from the beginning to do specific things, but do them in a way that was very intuitive and worked in a way that simply made sense. Having just a few buttons on the device increased the level of simplicity to a level that most people were comfortable with.
Android however isn’t designed for a single piece of hardware. Already there are at least five devices I can think of that have been built to support the platform and from what I can tell, they all behave differently. Some have iPhone-esque touch screens, others prefer to go with more of a Blackberry nub and miscellaneous navigation buttons. Some also go for the full qwerty keypads.
As a website designer and someone that’s had a shot at designing websites for mobiles, I know how difficult it is to try and code for half a dozen different browsers. Multiply that by 30 different screen resolutions. Multiply that by 1000 different input interfaces and you can see just how problematic Android could become.
How do you design something for a device that may or may not have the button or interface you need for your application to work? Even when trying to figure out how much screen real-astate you have and how big or small the text needs to be becomes a massive problem.
Then there’s the rest of the world who can and probably will end up saying “90% of my clients use iPhones, Blackberry’s and Windows Mobile – I’ll code for those. If users are smart enough to know how to use Android, they’ll be smart enough to figure out how to use my application or view my website.”
Which is very similar to Linux. No-one want to do expensive user-testing, research and evaluation and devote weeks of development time on a platform only 3% of their market uses, so they remain unsupported. While they remain unsupported, there won’t be any consumer confidence in it. While there is no confidence, there will be no sales and without sales, they remain unsupported.
I don’t know what it will take to make Android a success. It could be a single device that will rule them all, it might be an application that simply revolutionises the way we use our phones, or it might just never work at all.
What I will go on the record as saying however is that in its current form, with its variety of devices and at least from my perspective no solid drive towards perfecting the user experience, its just not going to cut it.
Solar Energy Rebate – for who?
24 November, 2008
I’ve just bought my very first house. It’s all very exctining and like with any new toy, I’ve been out shopping for accessories. What better accessories for a house than some green or energy efficient additions.
So I went out looking at the Federal Government initiatives for solar panels. Now I know solar panels aren’t the greatest when it comes to their carbon footprint. I believe the quote goes something like “they’ll never create enough energy to replace the energy that went in to manufacturing them in the first place” but at the same time, they are helping and heck I think it’d be kinda cool.
So off I went searching for details on these rebates and the first thing that jammed in to my eye is the key eligibility criteria: you must earn less than $100,000 in your household.
OK – huh?
In Australia we currently have an insane housing market with a standard home costing $300,000 – 400,000. In order to get a home loan, you either need to have a pretty well paying job, or a couple of them, or have your nana drop dead and leave you a small fortune.
So you’ve saved and worked hard and you’ve finally bought your house. All your money is being poured in to the mortgage and you might have enough left over to eat, maybe even buy yourself some new pants.
Then the next question I have to ask is if you have managed to earn less than $100,000 a year, buy yourself a house and still manage to live, how are you going to able to afford to buy any solar panels? I mean, it’s only a rebate – you’ve still got to foot the bill yourself to start with.
What this has led me to though, is a money making scheme. Mobile homes. Caravans. Tents and shantys. These guys are all probably earning less than $100,000 a year, and using very little power. If you were to wander the alleys of your local caravan park and loan people the money to buy their own solar panels, even letting them keep the rebate for themselves, then signing them up to a contract whereby all revenue from the panels gets paid to you. They get free power and because so much excess power would be fed back in to the grid, you could make a fortune!
If anyone goes out and tried this idea, send me 5%. If you work in government on the solar panel rebate – please get them to reconsider the amount for the means test.
The iPhone 3G has cracks – so what?
4 August, 2008
I was sent this link by a apple-hating colleague of mine and felt that I simply had to respond. The issue surrounds the new iPhone 3G and that cracks are appearing in the plastic casing of the white ones.
My only comment is – so what?
A teeny little cosmetic crack is not going to destroy your phone, it’s not even going to affect the performance one smidge.
It’s not the first time that this has happened though – cast your mind back to the dark ages of the year 2000 and you’ll recall that Apple went through similar dramas with their G4 cube.
The spunky, 8″ ‘toaster’that performed at a similar speed to it’s much larger desktop tower brother, but a heck of a lot smaller and a lot sexier suffered a very short life due in part to its cost, and also because of similar hairline cracks that appeared in its seamless case.
For the most part however, these cracks are miniscule. The main comment on the cube’s cracks, is equally relevant for the iPhone -
“None of these appearance flaws are serious — they aren’t visible from across a desk…”
Joel Sparks,originalcopy.com
Have a look at most of the cracks on these phones and you’ll notice that they are really, really small. I believe the reason no-one has found them on the black ones is because they’re simply too hard to spot.
But why am I so nonchalant about these cracks? Because quite simply it really doesn’t matter. Within a few weeks of having your shiny new iPhone, you will get sick of the silicone sleeve or executive kangaroo leather pouch you sprung $120 for and you’ll start using your iPhone ‘raw’.
Whether its when you’re in a hurry to get to a meeting or a late night stumble on your way home from the pub, you will drop your phone. Once you do that, you are going to have much bigger problems than a hairline crack. You’ll have full-blown scars.
Real equipment has scars. If you don’t scuff it up in the first 6 months of owning it, you’re not using it properly.
So stop your whinging, be glad that you are lucky enough to have an iPhone and just start using it. It is still a kick-ass device.
Pwnage 2.0 – Getting it to work
20 July, 2008
The Pwnage 2.0 tool is out and 1st generation iPhone users around the world can now go out and upgrade to the 2.0 firmware. The path however, is littered with a few little traps.
- It is a mac only app for the moment. Either go borrow your mates computer for an afternoon or slip in to an Apple store and use one of theirs!
- No Installer support
- It won’t unlock a 3G iPhone
At the moment, installing the 2.0 firmware on your 1st gen iPhone will not give you support for our very loved old friend, Installer. It does however give us access to Apple’s shiny AppStore which has newer versions of most of the gadgets we know and love.
I found my copy of the Pwnage tool as a torrent, but I’m sure hundreds of people have mirrored it over the web by now. You really shouldn’t have any trouble finding it. The supporting files you also need to grab are pretty easy to find too. I simply let iTunes download the freaking mammoth 220MB iPhone 2.0 firmware ipsw file, and found the other parts using the Google-searches built in to the application.
Once everything was together I fired up Pwnage and tried to get it all working. It found the ipsw OK, found the other required files and compiled the new ipsw without any hassles. When it came to loading it all on to the iPhone however, it all fell apart.
The error that everyone has been googling since the tool was released: “Failed to enter DFU mode”
The fix for this was difficult to find. There are hundreds of posts out there from people trying to find answers, but very few useful solutions. However, the solution is a simple one:
Fire up Terminal on your Mac and fire of these two commands:
cd ~/Library/iTunes
mkdir “Device Support”
No idea why creating a directory fixes the problem, but it does. Now off you go, go grab some shiny new apps from the AppStore!!
Thanks to Joe Shaw for the answer – I’m sure his ISP is having a fit right about now… linky.
Testing multiple versions of Internet Explorer
24 June, 2008
We all know how completely un-awesome Internet Explorer 6 is and how un-wonderfully it complies to all those standards and stuff. As website designers, the world would be a much happier place if everyone was using Firefox or at least IE7, but unfortunately the world is a miserable place with millions of people still trolling around the internets with the now very outdated Internet Explorer 6.
Unfortunately for us, each verison of Internet Explorer uses the same resources to get the job done which means installing multiple versions is impossible. Or so I thought.
Standalone browsers
These look to be fantastic as they don’t overwrite any of the system files that your main browser uses. What this means is that you are effectively testing a fresh copy of IE6 (or earlier if you really feel the need) on the same system as IE7 or IE8.
You can grab the standalone installers from here -> http://browsers.evolt.org/?ie/32bit/standalone
A note on Vista
After fishing around for a very long time, it apppears that the only way to test in IE6 on a Windows Vista machine is to run a Virtual System. Microsoft has a full set of instructions on how to set this up.
The thingy on the taggy thing (CSS terminology)
2 June, 2008
One thing I have always struggled with is terminology. You know what you want to describe, you look at it on the screen and you go “yep, I want another one of those things” but when you are trying to communicate your ideas or pass on instructions to others, you get caught out very quickly when you start talking about “attaching things to other thingy’s” or “tweaking the value on the other thing.”
So I’m doing my best to learn the proper names of things. Starting with CSS.
I would step through all my own notes on tags, values, descriptors, etc, but why bother when there are pages that do it all so brilliantly already. And surprise of all surprises this one is a Microsoft page!
Checkit: http://www.microsoft.com/typography/web/designer/css02.htm
Why isn’t there a font-size:default value?
21 May, 2008
Playing around with fonts trying to figure out the most efficient way of setting up font size values for a major website, and I keep running in to inheritance problems, mainly because the system is build on a CMS which unfortunately has a lot of in-line styles.
So trying to keeop a percentage/ems based font-size method running becomes problematic when every second div has it’s own font-size command.
What would solve my problems is if there was a font-size:default value. The tag would break any inherited font-size values that may have been brought down from any parent items, and allow you to start fresh no matter how deep in the page you are.
Of course, the other solution is to go through the CMS and kill all the font-size commands, but that sounds like far too much hard work!
EDIT: Thinking about this problem more, I’ve thought of a situation that would make this command extremely useful – building code-snippets for other websites. If you know you want your text to be a particular height, but don’t know the context that it will be used in, this would be very useful. Or in situations where you don’t have access to the style sheet for a page.
Still hoping for a June release for 3G iPhone
20 May, 2008
Adding to my previous post which speculated that we may be seeing a 3G iPhone before th end of the financial year, Engadget has once again posted speculations that include a June release date. The exact quote from the article reads:
Apparently, a record label executive “familiar with the discussions” states that the Cupertino gang is hoping for a “big launch in June” which includes OTA music downloads, ringtone sales, and ringback tones
Australian Apple website MacTalk is also throwing in it’s own speculations on a June release adding many details about contracts, availability and ideas for who you might be able to buy one from (which I read to indicate it will be anyone with an Apple Reseller sticker in their window which may include big players like Domayne, Harvey Norman and Myer as well as the telcos). The main selling feature of the credibility of the MacTalk article however is its quoted source – Apple itself!
Resellers were informed over the past few days by Apple – the Australian Apple reseller community is like a little mothers club, so word travels fast
Now once again these are just rumours, but when so many rumours keep suggesting the same timelines who knows, maybe we will see the fabled 3G iPhone released next month.