Tuesday 25 November 2008

Not Dead!

The project is going great (honest!) in theory I will "soon" (I anticipate New Year as I've a nice tasty chunk of chrimbo holiday coming up). So, what do I expect to deliver... the following.

The basic canvas/bauhaus font (scalable with various stroke/fill effects).

* MCP:NOTE:The font will be extended with various diacritics. Umlaut, circumflex, acute, grave, cedilla an dot.

Matrix math class with optimiser - a "simple" piece of code that supports various transforms (please note that this is not a replacement for a JS library such as Slyvester. It does not have that scope instead supporting scaling, translation, shear, rotation, identity, multiply and can also "optimise" a matrix multiply by creating a chunk of JS code that has multiply by 0, 1 and -1 optimised (away in the case of 0 or reduced to add or sub if the input is 1 to -1). Also, the entire multiply is loop unrolled so do NOT use this for large matrices! A vulgaris multiply is available. Matrices can also be output to an HTML table (very handy).

* MCP:NOTE:This will probably need "inverse" eventually.

Canvas based control point and control point view with grid and user grid. A "fake" canvas that can record canvas activity (somewhat like ExplorerCanvas). A canvas JS program can be used to supply the editing surface (although some metadata may be unavailable - MCP to confirm). Colour gradient editing _will_ work! This will include "in place" (that is actually on the screen) editing of linear and radial colour gradient positions. A property window that offers a colour gradient "ruler" and colour selector. However, I may not be able to offer anything other than RGB for the colour selector (yet) and probably no bitmap patterns either (yet - eventually more advanced Canvas effects will be possible such as using a Canvas as a pattern). In place editing of all control points with rubber banding, snap to user grid and shared user grids (with ruler). A property window and code output window (interactive) will be displayed.

Note system - pulled from the old "COD2" project - little more than a tree of notes really with a few clever pruning/renaming methods. Should let me write code on my crackberry via Opera Mini (seems to be holding together).

Tuesday 21 October 2008

Sunday 19 October 2008

HTML Canvas Fonts.

Quite a bit has been written about this for sure...

Like this

http://canvaspaint.org/blog/2006/12/rendering-text/

and very usefully this

http://canvaspaint.org/blog/2006/12/rendering-text/

SOOOOooo..

I started hacking around and made this http://canvas.burnttoys.net/bauhaus.html

And (with just a small shake of the code) this http://canvas.burnttoys.net/bauhaus-outline.html

L8rz,
BT

Thursday 16 October 2008

Nintendo DS Korg DS-10 Forums Now Available

I've set up forums for chatting, tips, tricks, toots and links right here at

DS-10 Forums

Enjoy!

Matthew.

Monday 13 October 2008

Korg DS-10

Ah man! Got back from FOWA on Friday night to find the latest love of my life lying motionless and unhassled in the front hallway.... oh god...

Nevermind. I picked her up stripped her naked and shoved her in the back slot of my DS. Then she turned me on....

Lovely piece of kit for the 25 quid it cost.

It's roughly 2 MS-10's and an analogue drum machine. For the muso techy (like me) it has most of what you'd expect. Each monosynth has a single ADSR, selectable HPF, LPF, BPF filter, 2 oscillators and all the lovely modes you'd expect (such as oscillator syncing, VCO2 offset) each oscillator is tri, saw, square or noise.

The drum machines 4 sounds are roughly the same. Nice.

There are 3 sequencers. 1 each for the monosynths and another which controls the 4 drum sounds.

Each drum sound or monosynth also has a patch bay allowing you to connect various oscillators or other outputs to various inputs... Eventually you'll understand what I mean!

There's no cross patching that is it doesn't seem that synth 1 can affect synth 2 in anyway - shame but then I didn't expect a Radias.

Then there's loadsa effects - 1 effect per drum sound and 1 effect that can be applied to a selection of outputs (synth 1 and/or 2, drums or all of 'em).

All of the above is replicated 16 times in each "song" as a 16 step pattern.... yeah.... just push the buttons and listen!

TBH The whole thing fits really nicely and I would give it full props except for the following which I'm find annoying (but not enough to stop me playing!)

1 - I can't name a song which makes it difficult to remember what and where I'm doing things.

2 - Number of songs is limited - maybe annoyingly so

3 - When in drum edit mode playback ceases except for the drum sound - annoying as I can't hear my newly edited drum in my mix.

4 - In keyboard mode I should be able to trigger the sound by clicking the keyboard

5 - In synth edit and synth patch mode I'd like a button that just played middle C. Otherwise I must go and create a sequence when all I want to do is edit a sound

6 - I can't copy sequences from one pattern to another (or haven't figured it out yet). DEEPLY irritating... seriously. Especially when ones sequences have got quite complicated.

7 - AH... that's enough for now... I've got to go and play!

FOWA!

Back from FOWA... totally shattered... nothing but croissant, salad and coffee to keep me alive for 2 days! It was _very_ interesting but due to the extreme pace of the thing my brain had turned to mush by the end of Friday! Anyhoo... I have a massive pile of notes here. TBH I doubt I'm going to sanitise them so here they are straight from my Crackberry.

=====================================================================================
2008/10/09
=====================================================================================

* digg - news, tries to connect users, their diggs/buries and other users to provide "news"
services. Effectively data mining in "realtime". Interesting bit - there are users that are very
good at predicting what will be "hot" e.g. What's upcoming. Problems - eclectic tastes, taxonomy
parlance differs around the world.

* AOL - not much - just "crowded biz space" and "many apps yet to be written"

* Joe Stump, Blaine Cook. "Languages don't scale"... Ruby - anti-ruby-zealots (well it does
suck!). "PHP sucks"! Probs - decade for OOP, no closures, no namespaces, no unified DB layer.
"Ruby sucks" probs - loops (bad implementation e.g. Whole conext switch per loop), dreadful
syntax, Loadsa C extensions needed (no async networking). Python - Guido sole developer
(dictator), no protection mechanism, dreadful syntax.

PHP vs Ruby - simple RSS/XML reader. Same run time(ish). Both solutions blocked by IO time not CPU.

Whatever language we've got how do we scale? Scaling up vs out.

"Up" -> upscale boxen (faster tech), not necessarily a "single box problem" - may need to
distribute prog. (Avg box @ digg has 16gig o ram)

"Out" -> Distribute load. RAIC. Scaling is a matter of "throwing more cheap boxes" at the problem
(reliability scaling???)

"Web2" - user content... Scales badly. People make "a lot of crap". Make no box a bottle neck?
Don't want a server with 50 HTTP servers but only 1 DB server. "Don't Share"

"Happy coders" - give 'em tools, let 'em do what they want.

Bandwidth isn't latency - that is speeding up your code _may_ not increase bandwidth but may
decrease latency.

Parallel search - across machines innit.

Parallel access often better than single access. Stops blocking - often faster than 1 machine.

MemCacheD - in memory cache. FB - nearly 7TB of distributed memory cache.

Parallel cache invalidate... Painful (what about in-flight requests?). Time stamped cache (garbage
collection?)

expiration jittering (boltzmann machine?) When spread across servers should mean that servers
spread there invalidation not all at the same time. Queus - "starling" - Queue everything - RoR in
particular is non async comms, limited socket connections.

Partiton data... Scale reads - distribute DB reads. Writes a problem. H - split table in 1/2, V -
split table by fields (extreme = 1 table per field)

"Languages don't scale, architecture does"

**************************
* Future of Enterprise Webapps (Kevin Marks - google)
**************************

"Clouds" - the cloud connects all - why? Cos' the phone (P2P) type system is not the internet.

"The young are unaware of an un-networked world" - well... Duh!

"The kids" - email is formal - SN is what they use to communicate with each other. Email is
somewhat physically based e.g. Somebloke@somecorp.com.

Enterprise apps - lotsa forms! Why can't the computer do this work? "Real people" are often the
interface between the. User and a form (kinda stoopid).

Too many forms and fields mean users will lie! E.g. "Mickey mouse", location "the moon".

Users willing to give data away... Often crazily (username, password)

Lots of sites store copies of your personal detail... So unify right? Hmmmm... Back to forms...
"OpenSocial" - Data, Friends, Activities. "Portable Contacts" portablecontacts.net

Data Store - you own apps extensions to the open social info.

Activites - things people do with your app...

Persist your data not all data. Your site neednt know who someone is but just stashes a I'd
(abstracted away user -> details in code).

Orkut - cal company big in brazil - just cos' of "organic" growth. Word of moutj, face to face
recommendations. (Orkut probly tied down to portugese). Once a site has a culture of it's own it
will appear alien to people of other cultures (unusual, uncomfortable)

"Open Social" - framework+abstraction does not mean LJ,FB etc...

"Viewer" + "viewers friends"
"Owner" + "owners friends"

Idents -> idents (per container not web wide). Idents not necessarily people, could be website,
company or a real thing.

On _my_ site the viewer(me) is the owner.

"Social Object" - pic.vid.snd e.g. Youtube, flickr, myspack.

CRM - owner is site. Viewer is you (customer?). Pfffttt...

**************************
* Mobile Web will Change Everything
**************************

Network proliferation - too many networks. Blocks on messaging etc.

Vendor lock-in... "Sucks"!

Exchanging data is hard (differing platforms)

Microformats, JS, Web2.O, OAuth (link sites without passing user/password stuff) OpenID?

Startups - purpose is to break down barriers (surely means high failure)

"we are creationist"

"the best way to predict the future is to invent it" - Alan Kay

**************************
* Ron Richards - "bringing internet TV to the masses" - Revision 3 (diggNation broadcasters)
**************************

The TV.... Ubiquitous.

TV/PC convergence. Watching vs Interaction.

AT&T "you will" advert

"Play move 'now'" - how do 'puters use video. - olden days... 386 "my god it plays video".

2005 - video in 2 directions. Youtube vs PodCasts... (What's the fucking difference? Quality

Simply (perceived) amateur vs professional.

New field - video created for internet. No lower bound for video content creation (well, very low
anyway)

2005 onwards HD (big thing?). Actually TV is now more like monitors (gone up in rez + colour)

User perception is that internet tv is not _real_ tv...

Obstacles to delivery - small screens on mobile devices. Wiring up is a nightmare (ethernet,
audio, video etc). Tivo gets it right (easy to setup - virtually nil)

Simple "download this file" isn't enough. More than simple RSS. Delivey of shows via damn near
evrything (mobile, other internet sites etc) - Rev3 have become content providers?

Wordpress?! Blimey.....

The fork... Pro delivery, hi-def, large files vs low def, augmented, streamed

"Lean forward" vs "Lean Back"

Running commentaries in realtime on video (wine library tv - you stream) - intetractive as
produced... Realtime feedback.

Hollywood - Huloo? NBC.COM (powered by huloo). Starz.

Advertising - intrusion to watching video. R3's model is advertising. "This episode bought to you
by..." 50's stylee...

* Ben Huh - "I can haz Cheez burger"

http://www.icanhaz.com

"Spend an extra few quid" - 'keep a collection' - by misspellings!

Site got backers because of community. No community no value.

"Community base unit" - as simple as 2 people.

"It's funny, I'll tell someone else"

50% will never return. 1% will be there all the time. 1% are vocal but not a lot of money. Hit
casual users. Make 'em fans. Let 'em share - encourage it... Make a sensible self statement such
as "we'll make you happy 5mins a day". 45% casual users (important for their money)

Vast majority of traffic is direct e.g. Via email links, I'm etc.

Number of "shared experiences" vs members...

Goodwill? WTF? All content comes from users. Powered by goodwill.

'Starting' - Start easy. Don't over engineer. D'oh...

'Infopr0n' - narcissistic tendency to want to introspectively analyse our data. Users have 'fans'
based on creation... Kinda simple, not really fans but.... What the hey.

"Thefting" we know who puts which picture in which blog. Let 'em link to your content. Old world
publishers are obsessed with this IP theft.

KTHXBAI

* Tony Fish - taking your web app mobile.

www.mashupevent.com


=====================================================================================
2008/10/10
=====================================================================================

* Tim Bray - Sun

"Getting through tough times"

Will the bad times giant collaps and recovery? Is he wrong?

1 - Your Work - more effort? You could cause your employer to "fail" (haha). No large capital
expenditure. No waterfall. Go "Agile". No software license (GPL/BSD will win?) Pay support costs
after building SW (no future for enterprise SW?). Get in the cloud - analogy in the old days firms
had their own generators and C-electrical-Officers. This migrated to a utility model. Avoid vendor
lock-in. Be part of the online conversations about your company (good or bad). Yamaha social
network? Or just big forum thing.

2 - Opportunities - out of work? Do a startup! "Regulatory tech". High visibilty, open rule
system. Think about basic needs (too much drinking, eating, going out) Archway-London!!! Telecoms
- 100% addicted to mobiles! IPhone apps... Lots of mone there. Mobile apps... GO! Program for
youself (muso type thinking). VC? Fear VC?! Goals/aims may not match between you and investor.
"Make money now not later".

3 - You - position youself to survive the "hard times". No technology religion. No break down
between designer and developer. Don't do it - expand you horizons - you'll keep your job. Lots of
tech out there - do not specialise on a single development route (e.g. Just C++). Build Skills.
Make contributions (get your name on google) - blog, contribute to OS project etc. Contribute to
web or employers won't bother with you. "Network". Contribution is networking.

* Adam Gross - salesforce.com

"Cloud" - salesforce - no software - enterprise apps in browser - subscription model. virtual
virtualisation. Demo of CRM. Smart stuff - CM plus DB manager all in one.

** O'Reilly also Apress

* Simon Wardley - innovation the future and why nothing is ever simple...

Process behind change... Commoditisation & innovation, Drivers, why nothing is simple....

C&I - yesterdays hot stuff - todays boredom.

New - bespoke - product - services

"Creative Destruction"

Where does new stuff come from? Discoery/invention.

Drivers.... Novel/new = scope for competition.

Salaman & Storey


* Gavin Starks - Amee - pracitically heretical - you iPhone is about to become landfill (ghasp!
Shock!)

Aggregate all energy data on Earth.

"VidConf vs flights. But, the flight is a perk desired by employees. How can that attitude be
changed. Greed it may be (and keeping up with the Jones')... But it happens. It's a social
attitude. A job with travel is better than a job with vidconf.". Consumption is wealth. How do you
fight that attitude?

* Lunch session. - Mike Ormand - MS dev evang. http://mikeo.co.uk

* What's this SL stuff

* Beyond Google Maps. Andrew Turner - Mapufacture.

Sqlite has geospatial types. Blimey!

* Meebo/GAIM

All linuxy cgi stuff. Web based I'm. Beaut.

* 10 tips for a distributed team success. www.yuuguu.com

Anish.kapoor@yuuguu.com

Instant screen sharing. Meet online travel less. 1 or 2 people to get together immediately and
discuss this, that, the other.

"What makes for constructive teams?" Tech problem?

Right people... Will this person enjoy working on their own. Will they actually pick up the phone?
What's their motivation? Does this person want to change their life?

Work to a clear vision. They won't be present everyday so you must have commonality. Side by side
co-workers are effective... How do we replicate this?

Have an open culture - people free to pipe up. Don't play politics. E.g. Those not in the office
then they may feel outside the decision process.

"trust you people" - "don't track time" (trust) don't even track holiday. Say "hello" ;-) talk to
everyone in the team oce a day. Every other day at worst.

Stamp out stroppy email.

Q - Holidays. No tracking!. How did that work out?

Q - Also hours kept - problematic e.g. Night workers (me)

Q - distributed teams slow down decision making (see don't make decisions in meetings)

Project teams just "sort iot out" "core hours" etc but people realise they need comms with each
other.

Q - code/doc review over distance? Did it work out well?

Q - what good SW did you find?

"Passive comms" - where does it fit - skype etc "I'm doing 'this'"

Don't meet up to work.

Conference calls are for debate (not just listening) don't make decisions in meetings.

* What ingredients make for successful distributed teams.


* How to build a desktop app from a web app - Jeremy Baines, Howed Baines.

'Bout the 10% of time they write hobby apps. "Human Moods". Designing, building + distro of
desktop apps

"Publish API" - let other write the app??? Good idea? Not quite...

"Always on" - useful desktop app characteristic. "Better integration with desktop/file system".
"Data persistence"

Transient vs fully immersive? Use it a little bit like MSN or full on experience like
photoshop,word etc.

Get a good icon!

Tech. AIR, WPF, blah (wot no Qt?)

Distro... Cost? Bandwidth?

Distro from places websites dont make it like apple.com, adobe.com, downloads.com

Another way??? Alertthingy - V2...

* How to survive ouside silicon valley.

"Starting a biz is hard"

Those investors in SV will understand your pitch (tech minded) - outside - good luck!

"Community - Team - Passion"

Opencoffee.ning.com - likemind.us - meetup.com - workatjelly.com

"Looking for good (or cheap!) Talent"

"Competition" - other firms will steal your employees!

Distributed team - interntational - skype, email, I.M. And wiki's!!!

Team + passion = good company.

* "Huddle" andy@huddle.com

How do we prosper (not just survive)

Community, Team, Customers, Money...

"DrinkTank".co.uk

* to borg or not to borg.

"No longer just individuals"? Mass audiences - somewhat anonymous. "All people all the time" problem.

Email/im "task focussed" not socially focused.

Design metaphores - UCD - task goal generated. What is the "goal" of flickr/fb etc?

"Add as friend" - unhelpful term. Might be interested in your work but not you! 2nd wave HCI -
"activity theory" - lev vygotsky.

"Activity theory" ISBN 0-262-11298-1

OpenId - OAuth _keeps_ cropping up. Interesting.....

"Hinternet" - peeps who just aint involved in the net. Dialuppers - non-geeks etc.

"People as composites" - there's their stuff already out there....

Monday 15 September 2008

Canvas, Javascript, Properties, HTML, Table, List, Obvious Tags

Some of you _may_ find this useful...

A list of Canvas properties captured via AJAX, stored in a MySQL database via PHP which also converts this to an HTML table (with colouring)

Across the X axis is placed the browser's User Agent string.

The Y axis is the Javascript property name.

Each cell is the data returned from the Javascript Object.prototype.toString() call (there are SOOO many tricks one can perform here the possibilities are stunning. Especially once you roll in typeof and other chums... brilliant!).

Each table cell is coloured.

Grey means that this property did not exist in the given browser.

A yellow row means that this property existed on all platforms but gave different results in at least one case.

A default setup is used. That is canvasElement.getContext('2d') has been called but no other canvas functions.

Interesting Differences

Colours

Safari reports CSS style named colours. All others report 6 digit hex (what about alpha).

Properties

Safari supports a whole bunch of set$propertyName type calls. No others do.

Shadows

Safari has a clearShadow routine (sensible!)

Bitmaps

All except Safari support get and put image data functions.

Firefox/Mozilla has the handy drawWindow. Kinda useful. Renders web content into a Canvas. However, there's a ton of security restrictions. This could be a useful way of getting images from local applications into the web browser.

Transforms and Coordinates

All except Safari support the very useful "setTransform".

All except Safari support the, also the useful, "transform".

All except Safari support the slightly odd but useful "isPointInPath".

I'd like to see a transformPoint function TBH.

Text

Mozilla support text. It's quite nice in its own way BUT... don't expect miracles. The last time I tested it anti-aliasing doesn't when text is drawn along a path.

See mozText. I must check newer browsers for fillText and strokeText.

Notes

The following are untested as I did this before...

Google's "Chrome" arrived on the (so called) scene.
WebKit got embedded in Qt.
Opera 9.62 came out with it's nice new debugger.
Wii.

If hassled I might let someone have the TERRIBLE source code. This was lashed together in an evening to solve a problem. It is "engineer" code... :-D

Lastly, I think we should separate out the matrix math from Canvas and create a Matrix library for Javascript. Also useful would be a Vector library. Given Javascript's type flexibility the internal state could be packed arrays of 32 bit floats (or double if you wish) and there are excellent libraries out there to optimise the jebus out of this stuff.

L8trz,
Burnttoy.

Wednesday 3 September 2008

Google Chrome, Silverlight and hacking.

Google Chrome... well, I've just given www.bbodemo.com and.... none of the Silverlight shows up! No warnings about plugins, no SL D/L progress just the background.

A quick check of this pretty demo also shows no love.

However, Chrome seems to have found the SL plugin - one can check by getting up a new tab and typing about:plugins into the address bar and pressing enter - this list shows that all the plugins on my machine (SL, QT, Flash etc) are present in that list (and, as I've mentioned before... why on Earth is Silverlight associated with the .scr file extension).

I've tracked down a list of other "about:" links... ready?

Useful

about:version - Display current Chrome version (user agent etc)
about:plugins - Display Installed Plugins (Flash, SL, PDF, QT etc)
about:histograms - Display History
about:dns - Display DNS Stats
about:cache - View Cache Pages
view-cache:stats - Cache Stats
about:stats - Display Stats
about:network - Somewhat like HTTPFox but not as functional
about:memory - "stats for nerds"
about:crash Shows the "Crash" page
about:hang
about:shorthang

Easter Eggs. Maybe not that useful

about:internets The message “Don’t Clog the Tubes!” appears in the title bar... go figure.
chrome-resource://favicon/ - Get "favicon" (of browser?) comes up with a PNG

Task Manager

This is where things start to look a little less like a browser and more like an OS App Kernel... interesting.

Right click on the title bar of your Chrome window and select "Task Manager" - this is not the windows TM but the Chrome TM. In the bottom left of the TM is "Stats for Nerds" - this will give you all sorts of useful info. This can also be accessed by entering the address "about:memory"

Debugging

Next to the address bar is the "Control the Current Page" button - click it. Down the bottom is "Development" which contains a JS debugger, page source viewing etc - I have yet to experiment here.

Installer

The installer is probably just a stub (it's less than 500K) and seems to DL the rest of itself from the Internet.

Interestingly it doesn't install itself in %Program File% instead sequestering itself in "C:\Users\$user\AppData\Local\Google\Chrome\Application\chrome.exe".

Anyhoo... That's all so far. Just keepin' 'em peeled innit.

UPDATE!! Silverlight _does_ seem to be running but very, very, very, very, VERY slowly.

L8rz, burnttoy

Tuesday 2 September 2008

Forcing reloading of URL Protocols (getting round Same Origin policy)

Let's say you have a link that looks like this <a href="myurlscheme:login/AppUserId/820">myurlscheme:login/AppUserId/820</a>

This link will only operate when clicked on by a user (that is it's semantics, it's a "a href", a hypertext link to another document).

But, let's say I don't want to do that. Instead I want to trigger the application bound to that protocol automagically. So, the first step (the only thing I can try) is the use XMLHttpRequest. This handy JS function allows me to "get" or "post" data from a server. The problem here is that for the sake of security this can only operate from the domain from which the page containing the JS was loaded e.g. http://www.myurlscheme.com can run JS to get requests from myurlscheme.com but not google.com or https://www.myurlscheme.com (protocol is significant in these tests). This page (mozilla) provides an excellent and clear overview of the "Same Origin" policy.

So, what's the solution?

In my HTML page (actually music.aspx which is HTML with embedded ASP code - basically PHP ;-) I create an "iframe" tag and make it invisible...

<iframe id="protocolHandler" src="" style="display:none"></iframe>

Now, when I want to programatically invoke the "myurlscheme" protocol I can use the following

document.getElementById("protocolHandler").src = "myurlscheme:login/AppUserId/820";

And... almost unbelievably, setting the iframe src property forces a reload of that frame (which is invisible anyway). Now, a URL Protocol does not return any data to the browser (on any platform I've tested) despite people insisting on the opposite I can find no way to get data back from a URL Protocol. However, this hack works for what I need so... err.. peachy.

L8rz,

Matthew

Wednesday 27 August 2008

Future of Web....

We have so many interesting things going on. IE8 will be out soon, we've got Silverlight 2 in beta. Mozilla are working hard on TraceMonkey (huge Javascript speed-ups).

What I'd like now is two things... The first is a decent, stable DOM style interface to OpenGL (pref something like ES). The second is the ability to push and pull data from OGL. Given the amazing stunts even an old GPU can perform (operations on vectors and arrays of floats - often programmable but "simple" stuff like Multiply Accumulate and lovely matrix methods... SOoooo, what can't we have that?

The best thing to do is this... 1 - Read the OGLES spec carefully. 2 - Kill all the crap you don't need (all that old GLU type stuff). 3 - Describe the interface carefully in a format that JS will love. 4 - Release it as a standard FF plugin.

PLEASE!

Sunday 17 August 2008

Ah.

What a nice quiet evening...

Wednesday 13 August 2008

Mediawatch UK - FAIL! Daily Mail - FAIL!!!

Because of this...

Parents horrified as most violent video game ever to launch on 'family friendly' Wii

I now REALLLLLYYYY want 'MadWorld'! For a start it's Sega. Secondly... look at that style. Gotta love it. I'm not a huge fan of "realistic" graphics. Some of the sexiest games ever simply don't bother like (Crazy Taxi, Jet Set Radio, F0X, Rez etc...

John Beyer was quoted as saying "I've never seen this game for real or even heard of it but I think the authors should be hung from the nearest lamp post and all their women handed over to me for debriefing"

Quote the Mail "Nintendo's Wii has enjoyed phenomenal success as an innocent alternative to complex - and often violent - role play video games."... errr like Zelda? It's pretty violent when you analyse it... how about Boxing in Wii Sports, not exactly knitting practice eh?

As for the "Parents horrified"... well, amazingly not a single one was cited in the article.

I suspect the connection between the Mail and Mediawatch is some form deviant homosexual, Satanic pact to control all that we see and hear. Time will tell...

A representative from Sega left the following message "HAHHAHHHAAA Thanks for all the free publicity fuck face!"

Saturday 9 August 2008

Retro fitting a Sony T1XP with an SSD HD.

MY (lovely) Sony T1XP _has_ had it's problems over the years. Mostly the result of excessive use and travel! Although only a 1.1Ghz Pentium M it still sharp and snappy running Win2K Pro or XP Pro. My machines run "odd" software. I'm not a regular user being a bit of a hacker. The sort of things I like to run on it are Dev Studio, MingW or similar, Photoshop, Firefox + debugging extensions, Cool Edit Pro/Audition and various control panels for outboard gear.

In the past the 40 gig 1.8" PATA drive (not ZIF) died and so was "upgraded" to a 60 gig drive. Turns out that the 1.8" drives in these things were also used on the iPods.

That HD is OK but spins _very_ slowly too save power so latency and throughput aren't great.

What can I do to A - stop the HD dying again and B - speed things up a little?

The answer I've come up with and, should, be answering over the next couple of weeks is "Can I retro fit an SSD drive into this machine"?

The first problem we find is that nearly all SSDs on the market ATM are SATA based - no go, simply can't plug it in. So, where do we turn for cheap flash storage. Well, CF (Compact Flash) card are cheap and replacable.

To plug that in we're going to need some sort of adapter (CF to 1.8" IDE). This transform actually turns out to be very easy as the only difference between CF and 1.8" EIDE is a 5 volt to 3.3 volt interface difference (sometimes) and a slight difference in pinout. We go to ebay and search for "1.8 compact flash adapter". That gets us that far.

Next we need a compact flash card. A 32gig card could cost as little as 60 quid. How fast/reliable they are I don't know. Others around 85 offer 100x speed. After that we get anything up to 300x but these are 130ish quid. Pricey (the 60gig replacement cost a little under 100 quid).

32gig isn't masses, but, think about this a little more. Maybe we could have swappable boot storage to switch OS's... I've got a use for that.

So, I'm going to charge my Paypal account and get hold of some of these bits and pieces.

Friday 25 July 2008

Firefox 3, XAML, Silverlight (and Windows 2000 Pro)



Firefox 3, XAML, Silverlight (and Windows 2000 Pro) with Apache for local serving.

I got distracted because I am old ;-) and it works and I'm stuck with my tiny via TX series and that's fine. This machine "only" runs Windows 2000 + SP4 + loadsa patches, firewall, FF3. I wasn't expecting much Silverlight joy.

Installing Silverlight Beta 2 on Windows 2000 Pro

Download and install Silverlight 2 beta 2. I got an error message afer installation from the installer but just ignored it and restarted Firefox. Well, I kind ignored it and have yet to hit a problem. It worked! I could view XAML content on Win2K.x

Setting up Apache to Server XAML File

I used Apache to setup another local HTTP server for me. This one lives on 127.0.0.13 and will be used to server up files. My servers live at E:\servers\SomeServerName under this is public_html. In this case that server directory is called 1313.

Open Apache's conf\httpd.conf file and add a new host. If you want to name it edit %SYSTEMROOT%\System32\drivers\etc\hosts ...
<VirtualHost 127.0.0.13>
ServerAdmin wbmstr@1313.co.uk
ServerName 1313
DocumentRoot "E:/server/1313/public_html"
</VirtualHost>
Then add this to control access permissions on the folder ...
<Directory "E:/server/1313/public_html">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
We will need to also edit Apache's mime.types file. To this add ...
text/xaml   xaml
This will set the Content-Type header to text/xaml when serving a file ending in the .xaml extension.

You may want to make sure that Listen is set to 80. If it isn't change port numbers elsewhere. You have several options.

Now you should restart Apache.

Now go to Firefox 3 and enter http://127.0.0.13/xaml.html

Not much yet. Let's put those files in place.
  1. The latest "Silverlight.js" from http://code.msdn.microsoft.com/silverlightjs
    Save this as E:\server\1313\public_html\Silverlight.js

  2. A .xaml file to try. XML version is important. There are many
    Save this as E:\server\1313\public_html\plugin.xaml
    <?xml version="1.0" encoding="utf-8"?>
    <Canvas xmlns="http://schemas.microsoft.com/client/2007">
    <TextBlock>Some text... don't ask me what will happen cos' I don't know...</TextBlock>
    </Canvas>

  3. An HTML file in which to host your Silverlight/XAML control.
    Save this as E:\server\1313\public_html\xaml.html
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>My Silverlight Application</title>
    <!-- Helper files for initializing and creating the Silverlight plug-in -->
    <script type="text/javascript" src="Silverlight.js"></script>
    </head>
    <!--head and html tags omitted-->
    <body>
    <P>Expect silverlight below...</p>
    <div id="slPluginHost" >
    <script type="text/javascript">
    // Create a variable that references the HTML element that hosts the plug-in.
    var parentElement = document.getElementById("slPluginHost");

    Silverlight.createObjectEx(
    {
    source: 'plugin.xaml', // Source property value.
    parentElement:parentElement, // DOM reference to hosting DIV tag.
    id:'myPlugin', // Unique plug-in ID value.
    properties:
    { // Plug-in properties.
    width:'100%', // Width of rectangular region of plug-in, in pixels.
    height:'100%', // Height of rectangular region of plug-in, in pixels.
    background:'blue', // Background color of plug-in.
    framerate:'24', // MaxFrameRate property value.
    version:'2.0'
    },
    events:{
    onError:Silverlight.default_error_handler
    },
    initParams:null, // initParams property value -- user-settable string for information passing.
    context:null,
    }
    ); // Context value -- passed to Silverlight.js onLoad event handlers.
    </script>
    </div>
    </body>

  4. 4 - Install Firebug. It's as good as it gets at the moment.
Debugging

Debugging is primitive but useful and is enabled in the example xaml.html file.

The property onError is set to Silverlight.default_error_handler.

This function is part of Silverlight.js and will produce a Javascript alert dialogue when Silverlight detects an error.

To disable the debugging alert remove the onError handler.

Silverlight Beta 2 Support

NOTE. Support for Silverlight Beta 2 is slightly fuzzy. Whilst you can force support for Beta 2 by specifying a property within the properties member of the silverlight.createObjectEx call. Add
version:'2.0.30523'.
However, the HTML object created will have the type attribute type="application/x-silverlight-2-b2".

By looking in navigator.plugins with Firebug showed that both mime types application/x-silverlight and application/x-silverlight-2-b2 invoke version 2.0.30523.8 of npctrl.dll.

The only difference is that application/x-silverlight is bound to suffix .scr. Strange.

Signing off...

Thursday 24 July 2008

ZFS, Sun and Flash Memory

Interesting approach from Sun. Being "Big Tin" manufacturers and wholesalers they have a rather different take on the Flash vs HD argument. Simply put Flash uses less power, has better bandwidth, much, much, much better latency and is in general more reliable BUT billions of writes could wear them out. Hard drives have WAY more storage per dollar/euro/pound/yen BUT there are many components that could fail.

So... which is cheaper? Sun don't view this is a simple $/Gb... They see it as "dollars per gigabyte served". Once you take into account power things change dramatically.

There's also talk of why ZFS fits this well (in a nutshell, ZFS is very good at spotting and routing around errors

Sun CEO Jonathan Schwartz Blog Entry "Anything But a Flash in the Pan"

Tuesday 15 July 2008

Adding a Url Scheme to a Qt Application Running on Mac Os X and Win32

Introduction

What is a URL Scheme or Plugin Protocol?

When you write a web address it starts with "http:" or "https:". An FTP connection (within a browser) starts "ftp:" that part of the address is known as the "scheme".

Many applications create their own schemes so that data can be passed from the browser via an <a href="anewscheme:this_data_is_sent_to_the_native_application"> style link.

I went through the mill getting this to work (especially on the Mac). By comparison Windows is very simple to setup - just a few registry hacks. So, let's start there.

Windows

All one needs to do to in Windows is set the appropriate registry keys. Let's assume that we've installed our application at "C:\Program Files\Acme\MyAcmeProgram.exe"

We need to add the following keys to the registry, all in HKEY Class Root. I instruct NSIS to do this at installation time as it knows where the application is to be installed.

"HKCR\anewscheme" = "URL:BODiBEAT Protocol"
"HKCR\anewscheme\URL Protocol" = ""
"HKCR\anewscheme\Shell\Open\Command" = "C:\Program Files\Acme\MyAcmeProgram.exe "%1$""

NOTE, the "URL Protocol" key really is empty. It's simply a place marker

NOTE, the extra quotes around the %1 are essential especially if your URL contains commas, spaces or any other character that specifies a parameter separator on the command line.

Operation

When the user accesses a link with like "anewscheme:datagoeshere" the application is executed and the link itself is sent to the application as argv[1]. It's that simple. You may want to make your application single instance and pipe the given URL to the first instance of the application.


Mac Os X

For the Mac we have much more work to do. The first thing we will need to do is to install an AppleEvent handler in our "main" function like this...


OSErr err = AEInstallEventHandler(kInternetEventClass,
kAEGetURL,
NewAEEventHandlerUPP((AEEventHandlerProcPtr)macCallbackGetUrl),
(long) (&app),
false);

We also need to provide the function "macCallbackGetUrl"


// AppleEvent callback
static pascal OSErr macCallbackGetUrl(const AppleEvent* inEvent,
AppleEvent* outEvent,
long refCon)
{
OSErr err = noErr;
Size actualSize = 0;
DescType descType = typeChar;

if ((err = AESizeOfParam(inEvent, keyDirectObject, &descType, &actualSize)) == noErr)
{
if (0 != actualSize)
{
// make a buffer (Qt style)
QByteArray bUrl;
bUrl.resize(actualSize + 1);

err = AEGetParamPtr(inEvent,
keyDirectObject,
typeChar,
0,
bUrl.data(),
actualSize,
&actualSize);
// Grufty C cast... meh.
(CMyApplication*)(app)->appReceivedUrl(bUrl);
}
}

return noErr;
}

NOTE:"app" is whatever you want. Possibly the most convenient object to pass to the event handler is your QApplication derived application class.

We're NEARLY there! The very last thing we need to do is to invoke the Carbon event loop. However, Qt does this for you when you create a QApplication object (which you did in main just after setting up the Apple event handler right?)

To make this all compile and link properly we need to link against the Carbon framework. TO do this we need to add one extra line to our qmake .pro file when building for the Mac

mac:LIBS += -framework Carbon

To finish off we need to add some XML to Info.plist which is inside the app bundle. Use finder to open the package and in the "Contents" folder you'll find "Info.plist" - you can use the property edit to edit this - just double click.

However! There's a little trick you can use in your qmake .pro (or .pri) file. Qt installs a very minimal Info.plist in your app bundle. To override this and provide your own add the line

mac:QMAKE_INFO_PLIST = ./Info.plist

Another way to do this is to use "install" type "man install" for more info. This lets you add/delete files from a package at will and is very powerful.

Anyhoo. These are the keys that need adding...

 <key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>A New Scheme</string>
<key>CFBundleURLSchemes</key>
<array>
<string>anewscheme</string>
</array>
</dict>
</array>
<key>NSAppleScriptEnabled</key>
<true/>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
Operation

When the user access a "anewscheme:" URL an Apple Event is received in the callback function and we can pick out that data and process it anyway we like.

Epilogue

And that's all! Honest! L8rz, burnttoy

Wednesday 26 March 2008

ARM vs Intel - What battle? What War? There's nothing going on here.

Intel have announced "Atom" best described as a low power x86 core. It is not the fastest out there being in-order, single core and having as fairly low clock frequency. It looks like this could eat ARM alive right? Right?

No! The chip won't be available until next year at the earliest. It still consumes 10 times the power of an ARM and, to top it all, will be pitched at around 40$... ARM have a synthesizable core (very important to the SoC peeps) it has all the SIMD floating point extensions you'd expect in a modern CPU core consumes a 10th of the power of Atom is a far smaller component and, most importantly, can be licensed for a fraction of a fraction of the 40$s Atom is going to cost you.

Yup, maybe Intel can move into this market. Maybe. TBH I'm not sure I see the need for an x86 based mobile device. Do I really want to run full blown office apps on a phone? No. They are just the wrong apps to run. Think email, social networking, games (not Crysis!!!), texting etc.

The UMPC is where the Atom will end up - and whilst the devices are nice they are a fairly niche market - most (the Asus EEE PC for example) end up being used as web terminals (HTML, CSS, IM, bit of flash). In those situations no-one cares what the CPU is (iPhone is _not_ x86 and it's not as though you'd notice).

There's one app that everyone would like on their UMPC's and smart phones... Flash. I'm not a huge fan but it's the only sane way of getting video and audio playback in a browser style application. I think this says more about the shoddy state of multimedia support in the W3C's specifications - Many things have been done well (HTML itself, Form, SVG) and we have some well supported extensions such as the Canvas object. But... Please get a move on with audio and video. Audio especially - for VI users it would be a god send.