Archive for March, 2004

March 31st, 2004

Voice Chapterisation

Posted in AppleScript by Diggory

I was reading about Speakable Items and QuickTime and made this script

It will allow you to chapterise (add chapters to) the front Movie in QuickTime Player - by voice. Simply move the play head to the appropriate points and say “Chapter” - then when the last chapter has been added say “Finish”.

Requires Panther and QuickTime Pro.

you can get the script into Script Editor by clicking Here

global blurb, targetBlurb, sourceMovie, sourceMovieDuration, sourceMovieName, sourceMovieWidth, sourceMovieHeight, chapterTrackText, sourceMovieWidth, sourceMovieHeight, numChaps, lastChapTime



on run

my chapterise()

end run



to chapterise()

set lastChapTime to 0

– Quit if QT Pro is not installed

if not my checkForQTPro() then

return

end if



– pre-check for a front movie

my movieIsForemostPreCheck()


tell application “QuickTime Player”

– Show Info Dialog — explains what the script does.

set the blurb to “This script will add chapters to a QuickTime Movie. Make sure that the movie you want is foremost in QuickTime Player.



” & targetBlurb

display dialog blurb buttons {”OK”} default button 1 giving up after 5

– Now we’re off and ready to go…

– Get the info for the movie we want to chapterise

if not my getFrontMovieInfo() then

activate

display dialog “There is no front movie to chapterise.” buttons {”Whoops!”} default button 1 giving up after 5

return

end if

display dialog “Initial Chapter Title:” default answer (”Start”) buttons {”OK”, “cancel”} default button 1

copy the result as list to {text_returned, button_pressed}

if button_pressed is “OK” then

set initalChapterName to text_returned

else

return

end if



set chapterTrackText to “{QTtext}{font:Geneva}{plain}{size:12}{textColor: 65535, 65535, 65535}{backColor: 0, 0, 0}{justify:center}{timeScale:30}{width:” & sourceMovieWidth & “}{height:” & sourceMovieHeight & “}{timeStamps:absolute}{language:0}{textEncoding:0}
[00:00:00.00]
{textBox: 0, 0, 50, 160}” & initalChapterName & “




– Get the chapters

set numChaps to 0

set another to true

repeat while another is true

set commandSpoken to my listenForChapterCommand()

if commandSpoken is “chapter” then

my addMarker()

else if commandSpoken is “finish” then

my finishChapterise()

set another to false

else if commandSpoken is “debug” then

log (”debug command used”)

else

set another to false

end if

log commandSpoken

end repeat

end tell

end chapterise


– Script subRoutines

to checkForQTPro()

tell application “QuickTime Player”

if QuickTime Pro installed is false then

display dialog “QT Pro is required for this script” buttons {”OK”} default button 1

return false

end if

end tell

return true

end checkForQTPro


to finishChapterise()

set chapterTrackText to chapterTrackText & “[" & my explodeTime(sourceMovieDuration) & "]“

set chapterFile to my writeOut(chapterTrackText)

tell application “QuickTime Player”

activate

tell sourceMovie to rewind

make new track at sourceMovie with data alias chapterFile

end tell

tell application “Finder” to move file chapterFile to trash

my attachChapterTrackToVideo()

end finishChapterise



to attachChapterTrackToVideo()

tell application “QuickTime Player”

tell sourceMovie

set textTracks to every track whose name is “Text Track”

set chapTrack to first item of textTracks



set videoTracks to every track whose name is “video Track”

set videoTrack to first item of videoTracks

tell videoTrack

set chapterlist to chapTrack

end tell

tell chapTrack

set enabled to false

end tell

end tell

end tell

end attachChapterTrackToVideo


to writeOut(someData)

activate

set chapFile to ((path to home folder as string) & “tempChapterMovie.txt”)

– set chapFile to choose file name with prompt “where should I save the chapter file?” default name (sourceMovieName & “_chapters.txt”)

set chapFileRef to open for access chapFile with write permission

write someData to chapFileRef

close access chapFileRef

return chapFile

end writeOut


to listenForChapterCommand()

tell application “SpeechRecognitionServer”

set chapteriserLanguageModel to {”chapter”, “marker”, “mark”, “now”}

set finishLanguageModel to {”end”, “finish”, “stop”}

set cancelLanguageModel to {”quit”, “cancel”}

set debugLanguageModel to {”time”}

set thePrompt to “listening…”

try

set theResultstring to listen for chapteriserLanguageModel & finishLanguageModel & cancelLanguageModel & debugLanguageModel with prompt thePrompt

if theResultstring is in finishLanguageModel then

say “finishing up”

return “finish”

else if theResultstring is in cancelLanguageModel then

say “cancelling”

return “cancel”

else if theResultstring is in chapteriserLanguageModel then

say “adding chapter marker”

return “chapter”

else if theResultstring is in debugLanguageModel then

say “debug”

return “debug”

end if

end try

end tell

return “error”

end listenForChapterCommand


to addMarker()

tell application “QuickTime Player”

tell front movie to set currentTime to the current time of sourceMovie

if currentTime is less than lastChapTime then

display dialog “Sorry, you must add chapters in Chronological order.” buttons {”OK”} default button 1

return

else

set lastChapTime to currentTime

end if



set chapTime to my explodeTime(currentTime)



display dialog “Chapter Title:” default answer (”Chapter ” & numChaps + 1) buttons {”OK”, “cancel”} default button 1

copy the result as list to {text_returned, button_pressed}

if button_pressed is “OK” then

–[00:00:19.00]

–{textBox: 0, 0, 50, 160}Chapter Two

set markerText to “[" & chapTime & "]
{textBox: 0, 0, 50, 160}” & text_returned & “



set chapterTrackText to chapterTrackText & markerText

set numChaps to numChaps + 1

– log markerText

end if

end tell

end addMarker



to movieIsForemostPreCheck()

tell application “QuickTime Player”

try

set sourceMovie to front movie

tell sourceMovie

set frontMovieName to name

end tell

set targetBlurb to “Current targetted movie: ‘” & frontMovieName & “‘.”

on error theError

set targetBlurb to “There is currently NO movie targetted. Make sure a movie is open before pressing OK in this dialog.”

end try

end tell

end movieIsForemostPreCheck


to getFrontMovieInfo()

tell application “QuickTime Player”

activate

try

set sourceMovie to front movie

tell sourceMovie

rewind

set sourceMovieDuration to duration

set sourceMovieName to name

set dims to (dimensions)

set sourceMovieWidth to first item of dims

set sourceMovieHeight to last item of dims

return true

end tell

on error

return false

end try

end tell

end getFrontMovieInfo



to explodeTime(durationInSeconds)

set secondsLeft to durationInSeconds div 600

set secPerMin to 60

set secPerHour to secPerMin * 60



set numHours to “00″

set numMins to “00″

set numSecs to “00″



if secondsLeft is greater than or equal to secPerHour then

set numHours to secondsLeft div secPerHour

log (”number of hours: ” & numHours)

set excessSeconds to numHours * secPerHour

set secondsLeft to secondsLeft - excessSeconds

if numHours < 10 then

log (”padding hour int”)

set numHours to (”0″ & numHours) as string

end if

end if



if secondsLeft is greater than or equal to secPerMin then

set numMins to secondsLeft div secPerMin

set excessSeconds to numMins * secPerMin

set secondsLeft to secondsLeft - excessSeconds

if numMins < 10 then

set numMins to (”0″ & numMins) as string

end if

end if


set numSecs to secondsLeft

if numSecs < 10 then

set numSecs to (”0″ & numSecs) as string

end if



set output to (numHours & “:” & numMins & “:” & numSecs) as string

return output

end explodeTime

March 30th, 2004

Money

Posted in Real World by Diggory

I know it’s very vulgar to talk about money - but I’ve been reading up:

Money, get away.

Get a good job with good pay and you?re okay.

Money, it?s a gas.

Grab that cash with both hands and make a stash.

New car, caviar, four star daydream,

Think I?ll buy me a football team.

The Chip and Pin advertising campaign to inform the public has begun — “Safety in Numbers.” There are nine months left for mag stripe CCs in UK. They were first introduced here in 1976 (when I was 1 year old!)

The smart cards are a global standard called EMV - they also allow multiple applications - not just a credit card.

Europe and Asia first to go to EMV - 2004 & 2006. Not sure when US gets it.

Card Fraud:

Money, get back.

I?m all right jack keep your hands off of my stack.

Money, it?s a hit.

Don?t give me that do goody good bullshit.

I?m in the high-fidelity first class traveling set

And I think I need a lear jet.

Plastic fraud over the last five years

“At £424.6 million in 2002, plastic card fraud losses are still increasing ? although not as dramatically as in previous years. Our multilayered fraud prevention initiatives, coupled with the work of a new police card fraud unit, are starting to disrupt the illegal activities of organised criminal gangs. ” – APACS Card Fraud Facts 2003

“About £1 million-worth of fraud is committed on cards every day in the UK - a crime every eight seconds. Chip and PIN will help tackle 60% of this fraud.” – APACS Annual Report 2003

APACS thinks that post Chip and Pin organised crime will move from skimming, towards id theft e.g. bin raiding & masquerading. CardHolder Not Present (CNP) transactions (i.e. Phone & Internet) will still be vulnerable to fraud, much as they are today.

There appears to be progress there too:

AVS/CSC — (cardholder Address Verification System and Card Security Code checking system) - Ever had trouble shipping internet-bought products to an address other than your own? That’s AVS. CSC is the three digit Security Number on the signature strip of Credit Cards that some sites ask you to enter. Hopefully many more sites will require this in the near future.

The roll-out of Verified by Visa and MasterCard’s SecureCode to combat Internet-based CNP fraud.

Token-based authentication - “An initial UK specification for the use of chip and PIN cards in handheld readers was issued at the end of 2002, giving members the option of using dynamic, two-factor authentication for customers when banking or paying online. Token-based authentication would provide customers with a similar experience to that at cash machines and in retail outlets. Whilst benefiting from the investment being made in chip and PIN, it would be significantly stronger than authentication based on password and user identity. In 2003 interest in token-based authentication increased significantly within the UK and abroad. APACS has been working closely with MasterCard, Visa and a number of associations overseas to encourage the development of a common global specification.” – APACS Annual Report 2003

This could mean Smart Card readers attached to PC’s with software that allowed you to authorise payment via Chip & Pin.

Other Interesting info about Money:

Money, it?s a crime.

Share it fairly but don?t take a slice of my pie.

Money, so they say

Is the root of all evil today.

But if you ask for a raise it?s no surprise that they?re

Giving none away.

Over half of all cash acquired by individuals (in the UK) is obtained from cash machines. In 2003 an estimated £144 billion was paid out in 2.4 billion transactions, 5% more than in 2002.

The rate of growth rose during the year and may reflect benefit recipients shifting to the use of cash machines once their benefits are paid by Direct Payment rather than obtaining cash at the post office. Direct Payment will give a further boost to this trend in 2004 and 2005 and, in the longer term, the demographic pattern of preferences will be a steady driver of growth - younger customers are more likely to use a cash machine than older customers.

In 2012 it is projected that cash machines will pay out over £190 billion in today?s money in 3.1 billion transactions.

personal cheque use has been falling every year since 1990. In that year each adult wrote over 60 cheques on average; by 2002 this had fallen to 30 cheques on average.

Around 3% of all card payments were made over the Internet last year. This is expected to grow to one in ten by 2012.

Over one Internet user in three banks on-line. Users of Internet banking are increasingly transacting on-line, moving money or altering payment arrangements.

Sources of Cash 2002

Two in three adults regularly use cash machines, taking out over £80 each week on average. The cash machine habit is strongest with younger adults. Over 90% of 25 to 34 year olds with access to cash machines get cash from them on a regular basis. Cashback with debit cards, however, remains very much a niche source of cash. Around 8 million debit cardholders use it, primarily as a way of topping up their cash. Nine in ten cashback users also regularly draw cash from cash machines. The growing popularity of cash machines has been driven by their increasing availability. Since the mid 1990s banks have been installing cash machines at non-branch sites and the last two years have seen an explosion of convenience machines owned by non-bank independent ATM deployers at sites such as corner stores. At the end of 2002 over half of the UK?s 40,825 cash machines were at non-branch locations.

links:

http://www.apacs.org.uk/
http://www.emvco.com/

Biblio:

http://www.apacs.org.uk/downloads/Annual%20Review%202003.pdf
http://www.cardwatch.org.uk/pdf_files/cardfraudfacts2003.pdf
http://www.smartcard.co.uk/resources/tutorials/sct-itsc.pdf

March 30th, 2004

Wireless doo-dah

Posted in Networking by Diggory

I’ve just invested in a very cool (but quite ugly) device: you can get one here.

It’s basically a mini wireless access point that’s powered by USB - or at the flick of a switch it becomes an ethernet-to-wireless adapter.

I’m currently using mine to free my sitting room of one less wire (one down, 3,251 to go…)

Wireless PS2

It’s small enough to chuck into a laptop bag and take to meetings/LAN parties/ etc…

The only downside is the configuration - theoretically it’s web-based - but I had to fire up virtual PC and use the Windows Binaries - as the “web” interface is a real mess of Windows IE-only JavaScript. Firebird/IE:Mac/Safari all choked and Mozilla choked half way through configuration.

March 29th, 2004

Une Grande Pression S’il Vous Plaît

Posted in Real World by Diggory

Trois Vallees Skyscape

I’m back from a Week’s Skiing in Meribel. Absolutely fantastic - loads of snow fell and a really nice sunny day at the end. I hadn’t skied for about five years and it was really nice to get back on to the slopes.

I can’t believe how good the GSM coverage is in the Alps these days - *everyone* had a phone on the slopes and people where texting/MMS’ing from chairlifts. Excellent for safety and not getting separated, but unimaginable ten years ago.

Skiing warning sign

I would have blogged out there but roaming GPRS is still trop cher:
GPRS Roaming costs
- (That’s £1.46 for 300k!)

view

March 18th, 2004

BdJ uncovered

Posted in Zeitgeist by Diggory

Belle de Jour uncovered. The literary detective strikes again.

You didn’t think she was real did you? far too much detail…

March 18th, 2004

Series 60 Tips

Posted in Hardware by Diggory

Christian Lindholm posts some shortcuts and tips for Nokia Phones that you may not know.

March 15th, 2004

Silence

Posted in Console Games by Diggory

Sorry, again I seem to be out of the blogging habit - I’m currently addicted to a PS2 game I’m testing for the Network Beta. Alas can’t mention anything about it (but it’s out soon). I’ve been finishing off Vice City too - wow that game is detailed.

Meanwhile here’s one of my bad-tempered rants about minor imperfections in life:

Why is it that some PS2 game developers are still making games that can only use the first memory card slot? It’s rather irritating, and when the game requires that the PS2 network config must be on the same card - it means duplicating your net settings on all cards.

Copy Protected PS2 Net Config

Then you discover that the Net Config is Copy Protected - so you have to go through the whole IP set-up doo-dah again. Which is no fun, because entering IP addresses with a Dual-Shock controller is about as usable as Windows 3.1

Gah!

March 2nd, 2004

Bleep!

Posted in Music by Diggory

bleep

I just bought a music track off the internet. I can’t believe it! No - not through iTunes, from Bleep. I heard a track on Radio 1, the DJ mentioned off hand that it was available from bleep - and I bought it almost before the track had ended.

They’ve got a very nice, simple UI - and they sell high quality MP3s unrestricted by any DRM.

£0.99 per track. (oh, by the way - the track was TEKNOTEST by Cane)

March 1st, 2004

San Andreas coming…

Posted in Console Games by Diggory

GT:San Andreas is coming this autumn. Yikes! — I still haven’t finished Vice City…

in Totally Unrelated News: The London Underground is going to allow GSM operators to put their networks into the tube, cool. BBC London News Link.

March 1st, 2004

XBox2 Dev Kit… is a Powermac G5?

Posted in Console Games by Diggory

Microsoft XBox2 Dev kit - is a Mac. Apparently.

Some wag has already been busy in Photoshop:
XBox Dev Kit ;)
(hehe)