Looking forward to disappointment
A friend from #webdev, Xixora, tweeted earlier today:
Hmm, may as well have a play about with HTML5. Looks quite nice really! Better defined than XHTML2 ever was anyway…
To which I felt compelled to construct an argument and engage with him:
@xixora No, no no no no no no no no no no no no no. No. No no no no no. No, no no. No. no no no NO NO NO NO NO NO NO NO NO. Bad Xix! No!
After a bit of to-ing and fro-ing, I made my point a little more clear:
@xixora everything about xhtml2 seems so pure, whereas everything about html5 seems so commitee-driven. It makes me weep for the internets.
I suppose the reason for my disappointment, is that to me, XHTML 2 is the way I hoped the internet would go. More generic. Less specific.
The HTML 5 spec tries to clarify it’s position by comparing its approach to that of XHTML 2:
However, XHTML2 and XForms lack features to express the semantics of many of the non-document types of content often seen on the Web. For instance, they are not well-suited for marking up forum sites, auction sites, search engines, online shops, mapping applications, e-mail applications, word processors, real-time strategy games, and the like.
And it’s right. XHTML 2 provides no generic way of marking up an ordered list of posts. I really need to expose myself more to HTML 5, but it just feels silly. By now I’ve learnt to trust this feeling, but maybe I am missing something.
HTML 5 just fills me with disappointment; it’s a missed opportunity to simplify things. Never mind. I for one look forward to the <internet> tag due in HTML 7.
</blogpost>
OpenPSN
I’ve been playing a fair amount of online games for my PS3 and on the whole it’s been a pleasant experience. The only thing that bugged me was that there was no way of sharing your exploits with the rest of the Internet.
Consider the itch, scratched. I’ve started work on a little Facebook application that attempts to open up the PSN network. I’d you use Facebook and have a PS3, I’d appreciate your help in testing. Hey, it may even be useful. Once I’ve got the basics up and running, I’ll extract it into a website of it’s own where you’ll be able to build ‘gamer tag’ style badges and all that sort of thing.
Anyway, check it out at http://openpsn.dies-el.co.uk/
(First post entered fully on the iPhone, woo!)
The economy is like air travel
The economy is like air travel. You’re powerless to do anything that can affect your future, though even if you did have power you wouldn’t know what to do with it, well, because it’s really complicated. You just have to hope that the people in control aren’t crazy. Snort.
Trusting measurements
I was in Cumbria this weekend and went fell-walking (up and around the Lion and the Lamb, Grasmere). When I woke on the morning of the walk, I remembered that I needed to charge my camera batteries. I plugged in the charger and had breakfast. When i returned an hour or so later, the charger was showing a solid light — the battery was charged. I loaded the camera and we set off.
After an hour or more of driving from the North-West of Cumbria to Grasmere, we parked up and started walking. Instantly, god rays appeared, so out comes the camera and ‘beep’ — the batteries are dead. I curse to myself and decide just to enjoy the walk rather than dwelling on the camera (photographer?) failure. As a result, I probably paid more attention to the jaw-dropping scenery and less to composing shots through the viewfinder, but it was still a right pisser.
Afterwards everyone helpfully suggested “you should have tested the camera in the house”. My reply that “The charger told me the battery was full and I had no reason to think otherwise”, was put down to a lack of common-sense, but it got me thinking.
At which point does the effort in checking your data is reliable, take over the value of what you’re trying to measure? Does it relate to the cost of failure, what you would lose if your measurements weren’t trustworthy, or is there an easier/better way to define it?
Comparing the contents of two arrays
Consider the scenario where you want to check whether a user has access to an asset. Both the user and asset has_many :roles (hey, it’s almost English). You need to see if any of the user roles are included in the asset roles array.
Try this
can_access_asset = asset.role_ids & current_user.role_ids
If none of the user roles match the asset roles, nil will be returned.
Check out Set Intersection (and all the other fun Array methods) on ruby-doc.org.