Posts archived in Coding

Hit Nick’s blog forall the other sites that’re blogging about ReMIX 2007 Melbourne.

A few short (and blunt) thoughts on ReMIX:

Good Stuff:

* Getting to meet and speak to various interesting people.

* Hearing honest case-studies/opinions from non-Microsofties as to how well the whole Silverlight thing worked for them. They were all using pre-release very early beta/alpha code, but it was interesting to see that several of the speakers basicly said “don’t bother with Silverlight 1.0, if you’re not comfortable with Javascript in a big way, and/or just want to do more advanced stuff”

* WebJam + Galactic Circus.

Not so cool things:

* Lack of free wifi (I’ve mentioned this already, but it’s a bit of a sticking point for me)

* Expression Web
Expression Web is of limited or no use to designers, and most or all of it’s functionality is replicated inside Visual Studio 2008, so it’s of limited value to developers. Expression Studio + Vista Ultimate were given out at MIX in Las Vegas – so Expression Studio would’ve been nice.

* Overrcrowding
There was a serious lack of space in many of the rooms and public lunch/morning tea areas. Some crowding is okay, but the way it was laid out meant that there were often very narrow walkways, which quickly get blocked by guys with backpacks (like me).
Very limited places to sit down for lunch. (Maybe about 40 spaces for people to sit down, for 300+ people – There really needed to be a sperate lunch/morning tea area)

And, uhm, yes, that’s Paul and me with the blue monster. I’m dreading my video showing up on Nick’s “The Geek Stories” site. Lots of “Umm… Ahh… ” + Shifty Eyes.

This blog has taken a rather negative tone for the last few days, maybe it’s just the weather, or maybe it’s because I’d really just like people to produce better software.

So, to illustrate the difference between adding a mod to, say, WordPress and PHPbb 3, I’ve drawn up this flowchart.
I think it’s quite obvious the difference in complexity (and thus, ability of non-experts to manage and maintain a forum running PHPbb).

Wordpress vs PHPbb - Patch vs Interface Model

I run a relatively active forum for an online (unpublished) Author. We run on phpBB, because that’s what the previous hoster was running, and it’s open source - so no licensing fees.

Unfortunately, PHPbb2.x has some issues – there’s no easy way to track mod actions or user-notes, the anti-spam stuff is a joke (it all comes down to requiring registration, and battling spam-bots at the registration page), and mods (the PHPbb word for plugin) are, frankly, a pain in the backside to install.

A few weeks back PHPbb3 RC1 was released, and I was running a test board just to try it out.

It has a number of major improvements – performance seems to be improved, and overall management is significantly better. You can track what moderators and admins have done too, so there’s more transparency on that end. 

However, when I tried to install a mod (to provide a basic RSS feed from the forums) – I got a bit stuck. In PHPbb2, there was a mod which allowed you to upload other mods, and install them with just a few clicks. Somewhat similar to WordPress’s plugin model, though more prone to breaking things.

I thought that the PHPbb3 developers would have taken a leaf out of WordPress’s book, and implemented a proper plugin model – and given that there’s now this MODX format (basicly a zip file, with a bunch of other files in it, in a certain structure) – it seemed like that would be the approach.

The problem I was having was that I couldn’t find the location where to upload the MODX file. So, I jumped onto the PHPbb irc site hoping someone could quickly set me straight.

Here’s what happened (ps: “Spec8472″ is me)  – trimmed for brevity, but otherwise people’s comments are as written.

Start of #phpbb buffer: Sun Jun 17 15:52:59 2007

* Now talking in #phpbb
<Spec8472-> Okay, question that’s probably really obvious to some, but I can’t find an answer online… where do I actually upload the mods to, in the phpbb3
  directory?
<iWisdom> …
<iWisdom> You don’t.
<iWisdom> Unless, of course, the MOD instructs you to upload a file
<iWisdom> In which case, you follow the directions included in the .MOD file
<Highway_of_Life> .xml file
<iWisdom> There is no automated MOD installer
<Spec8472-> There’s not an automatic mod installation thingy like easyMod for PHPbb2?
<Spec8472-> damn :(
<iWisdom> Just open the .xml file in a web browser
<Highway_of_Life> no, spec, and don?t curse

Okay, so there’s no automated installer… Thats… disappointing. 

<bsdboy> how hard is it to install mods manually?
<bsdboy> i dont think ive ever automatically installed a mod
<iWisdom> bsdboy: Not hard
<Spec8472-> Brilliant… that, and no event hooks… 
<iWisdom> Spec8472-: Pardon?
<Highway_of_Life> bsdboy: it would depend on your level of expertise, for me it?s like combing my hair in the morning… well, easier actually… coming my hair can be difficult at times…
<iWisdom> Highway_of_Life: That’s since you basically live in the Olympus codebase
<karlsemple> following txt instructions on what changes to make is easy whether you know the code or not :p
<Highway_of_Life> But for some, they never seem to get it right, no matter how many times they try… but it usually depends on the quality of the instructions and how many code changes need to be made
<Spec8472-> Mod installation, should imo, be automatic – upload a file somewhere, click a few things,   hey-presto you’ve got some new functionality (see WordPress) – sure, you might need to include some stuff in your presentation layer, but that’s all.
<WizardJames> ..
<iWisdom> …
<Highway_of_Life> ….
<iWisdom> Well, each person has the right to their own opinion
<iWisdom> But frankly that doesn’t mean we agree
<bsdboy> Spec8472-: You’re bloody lazy.
<iWisdom> Personally, I think it would be a bad idea
<iWisdom> It encourages users to go MOD crazy
<iWisdom> Which makes for a support hell
<WizardJames> bsdboy said my thoughts
<iWisdom> And it also increases the chances of things breaking during upgrades
<bsdboy> Highway_of_Life: Thhey shouldnt be allowed to live.
<iWisdom> It also encourages users, as bsdboy said and WizardJames echoed, to be lazy and not learn their way   around the codebase
<Highway_of_Life> I prefer to control the whole aspect… but still, MODs should be of good enough quality   that only a very small handful of changes need to be made
<Spec8472-> bsdboy: I don’t believe in extra effort, where effort isn’t needed.
<bsdboy> lol
<iWisdom> Spec8472-: To each his own
<bsdboy> Then write a fucking mod to install mods.
<bsdboy> Dont expect someone else to do it.
<karlsemple> please do not swear
<Spec8472-> bsdboy: Well, I would, except that I don’t code in PHP. Besides, that’s just more effort ;)
<Highway_of_Life> you don?t need to code in PHP to install a MOD
<bsdboy> Spec8472-, go shove it where the sun don’t shine if you expect someone to come on IRC and make your   mods auto install. IF you don’t know at least basic PHP you shouldnt be running phpBB.
<Highway_of_Life> you just have to be able to follow instructions, that is all
<iWisdom> Copy/paste
<bsdboy> I didnt know PHP when i first started using phpBB, but you know what< I went and RTFM and followed   the instructions
<iWisdom> It’s not complicated
<bsdboy> its nNOT hard.
<iWisdom> Considering the endless hours MOD authors invest
<iWisdom> It’s not work at all
<WizardJames> not that hard,  just open file, find,  paste, save, next file..
<Highway_of_Life> bsdboy: knowledge of PHP isn?t necessarily required to run phpBB, but it might be required if you want to modify your board in any way…

I don’t agree with the approach that PHPbb3 devs are taking to it – they’re obviously not taking the (quite active) modding scene into account, and it just makes both administrators and modder’s lives more difficult.

Defined interfaces make things much easier all around – take for example something that we all use every time we use a computer – Device Drivers for hardware.

Hardware manufacturers, for the most part, stick to defined interfaces for their drivers. They don’t need to patch the kernel or other parts of the operating system. When they do step outside those bounds, things get… interesting. Updates to the OS, or indeed changes by other drivers can trample all over each other, and result in system or driver crashes.  All in all, a messy situation.

The same goes for other bits of software – if you need to extend Windows Live Writer, you use the SDK to create a plugin that conforms to certain specifications. You don’t need to patch the application’s code to add new functionality. 

I don’t think I’m wrong in asking that PHPbb also take this model – and I think over time it would reduce the level of work required by the developers and support staff.

This is my response to Frank Arrigo and Brian H Masden:

LOLSeal - TechEd via LOLCat Builder

If you don’t know what the LOLCat craze is all about, Wikipedia has the answers (as usual).

Are you scared yet? :)

Oh – and the original image is mine – took it in Austria, actually.

Having Google Reader available when I’m not connected to the ‘net, is something I’ve wanted for a while. 

Luckily for me (I think) Google released Google Gears the other day – and made Google Reader implement it.

The idea itself is good – Being able to read your RSS feeds when you’re not connected to the ‘net, and have it sync back to the “mothership” (as the Googler’s put it) when you reconnect – marking read items as read, and downloading new content.

There’s a few key things missing though:

#1 – No Automatic Synchronisation.
I was hoping this would be something like Outlook in Exchange mode – i.e, I connect to a network, it realises it’s connected and updates all my items, sends mail that needs sending, downloading new bits, etc.

Google Reader however, doesn’t do this – it requires you to hit the Offline button, whence it takes a snapshot of some 2000 items (read? unread? latest? who knows).  Ideally it should do the synchronisation in the background – i.e when you’re connected, and it’s setup for offline usage – it should just sync in the background.

#2 – Doesn’t download even basic post resources (like images).

I CAN HAS CHEEZBURGER without images? ’nuff said. 

PS: Even if you’re actually connected, but that Offline button is pressed, you don’t get images.

#3 – Doesn’t remember previously sync’ed items (I think)

I go online. Then click offline – it pops up this little progress meter:

image

Once it’s finished syncing – if I hit online again, then offline – it pops up the same sync thingy, and takes just as long to download.

Okay, so Gears is a very very early beta*, and this is just the first implementation of Reader Offline, but I do hope they’ll fix these things and make it a truly seamless experience in later iterations.

Technorati Tags: , ,

* Aaron Boodman said something like “Google Gears is a real beta, not like our usual level of Beta” about a dozen times during his talk.

I’m at the Google Developer Day 2007, here in Sydney on this chilly winter’s morning.

I’ll update this entry throughout the day. 

Opened by James O’Lauchlan, of The New Inventors on ABC. Being broadcast live on the ‘net. This is the second largest group, with 700 people registered.  

 

Keynote

  • Two new products being launched
  • GData feeds into 8 apps – read/write/auth access.
  • Heavy focus on Mashups using Google products – Maps, Google Base, Earth, etc
  • Announcing Mapplets: Mashups in Google Maps
  • Announcing Google Google Gears – allows offline AJAXy sites.

James O’Lauchlan back on …

Creator of Greasemonkey is on… Aaron Boodman

Why Google Gears

  • Reliability: 1% of downtime can hurt at the wrong time
  • Performance – Local acceleration
  • Convenience – not having to find a connection

Gears provides three key bits of functionality:

  • Localserver – runs web apps offline
  • Database – self explanatory
  • Workerpool – runs Javascript “background threads”

10:13AM – Giving code samples

- Demoed how it works – live demo, the presentation itself is the demo – pulled network cable, claps, cheers, etc. Very cool.

Database:

- Parametised SQL, built in SQL Command line

WorkerPool provides, basically background threads in JS – threads execute outside browser (I think), so UI and browser is unaffected.

10:28AM - Google Gears is completely Open Source, very early beta.  Available on IE, Firefox and Opera – on Win, Linux and Mac. http://gears.google.com

10:30AM - James O’Lauchlan back, more jokes.. presenting Dr James McGill.

10:35AM - http://maps.google.com.au/preview – Google Mapplets Preview.

10:40AM - Mapplets are “Gadgets” for Maps – mapplet providers provide gadget, which returns location data and other information for the map points + pop item (eg; hotel availability). Google provides additional map stuff, eg, search nearby.

Can turn on multiple gadgets, so can overlay different data on each other.   Example  given were properties in SanFran, plus crime reports in SanFran.

10:45AM – Mapplets based on iGoogle Gadgets – very small level of modification required to convert.

10:53AM: - Mapplet runs on gmodules.com – not on maps.google.com. (presumably for security reasons)

To enable comms between the map and the mapplet – mapplets run a maps.google.com iframe, then set the hash to your serialised portion. Maps.google.com then deserialises and runs the code.

Key thing however – you can’t run JS Code inside the infoboxes (those popups you get when clicking on a point in gmaps).

11:15AM – Break, cookies, etc

11:50AM - Bo Majewski is on, to talk about Google Maps.

Another real live “the presentation is the demo” thing – no Powerpoint/whatever. This time running in Firefox on a Mac.

12:20PM: Guide tour through Google Maps API – some funny bits. Bo demo’s adding various items to the maps

(Maybe it’s just me, but Bo looks somewhat like Cain, from Command and Conquer)

12:30PM Lunch! Four different “canteens” with different types of food – “American”, Indian, Seafood/Deli, Chinese Stirfry/Noodle Box.  Playing around with some of the mashups that were on show, and a Nintendo Wii (my quick go showed me that I suck at Wii Sports Tennis too).

2:00PM - We’re back,  and learning about Google Gadgets.  It’s been a while since I last looked at the Google Gadgets code – looks interesting.

2:24PM - Now onto Google Gadgets – interesting – I’ve built one, but there’s new functionality which lets you do more.  Also, gadgets can be hosted outside just iGoogle now – other sites, Vista Sidebar, Google Desktop, Mac Widgets, etc.

(Note: These bits were written the next day, due to lack of power on my lappy)

???? – Google Web Toolkit, it was mainly about how you can write Java, which can produce efficient, smart Javascript. Looks like it’s a competitor to ASP.NET AJAX and such.  Allows debugging, etc.

???? – Break – more cookies, fruit, drinks, etc. 

???? –  GData. Kinda dry, but it’s a good way of being able to shift data around in a consistent format. Allows you to pull data from Google Products, fiddle with it, then save changes.   Has built in versioning – if someone tries to modify an older version, it won’t work – needs to happen on the newest version.

???? – KML Overview. – Excellent session by Michael Ashbridge. Google Earth allows a lot more things to be done in the upcoming KML 2.2, adding some web-like functionality (i.e links to places, within Infoboxes and such – lists of locations, etc)

???? – End of the day, Google Dev-Day t-shirts, lots of free imported beers, wines, and stacks of nibblies.

All in all – a very very good day, 99% of it was excellent - the access to Google staffers both in person, and on the IRC chat room was a great idea.

Technorati Tags: , ,
2 comments

Irish Code?

Q: Why did the Irishman wear two condoms?
A: To be sure, to be sure.
(Apologies to any Irish who happen to be reading this.)

I’m currently working on a project where I need to upgrade an application to support some new functionality.   This application was originally written by others,

While I was doing a review of the code, I found a segment like this (names anonymised):

        CountOfIDs = ds.Tables("SomeTable").Rows.Count
        Select Case CountOfIDs
            Case 0
                ' Do Nothing 
            Case Is >= 1
                If CountOfIDs >= 1 Then
                    ' Do Something
                End If
        End Select

Those IDs are slippery little things – better check twice, to be sure.
(Hint for the C#/C++/etc readers: VB doesn’t need a ‘break’ statement to exit a select/switch block)

Silverlight really needs to get with the pre-loading and obvious controls thing.

Edit: Correction – okay, so like Paul says – it’s not Silverlight itself, it’s the templates that people are using. Still, they’re templates that come with the various Silverlight capable applications (Blend, Expression, and Media Encoder) – so they’re going to be used fairly frequently.

Here’s a Youtube video:

How do you play/pause, or skip to a certain portion? How do you know how much of the video is loaded? 

They’re fairly obvious after about 5 seconds of watching the player run. The little red bar runs to the right as it loads, and the dot follows along as it plays. Drag the dot – you start playing at that point.  

What about a QuickTime video?  (I’m not exactly a fan of QuickTime either)

  

Yep, that’s reasonably obvious too. There’s the play, skip/etc controls – and a similar style of displaying the amount of video loaded.

Now let’s take a look at this Silverlight video:

Well, we’ve got skip back, play and skip forward.. err.. how do I tell how much has preloaded?  Oh – that’s right – with this helpful little glyph:

What does the 36 signify though? It’s not until you actually watch what it does for a while, that you realise it’s not some sort of countdown timer until you can start the movie  – it’s a percentage counter of how much it’s loaded. (Silverlight will start playing the moment it has some video loaded – regardless of whether the connection between you and the server is fast enough to keep it up).

Okay, so, how do you skip forward in the video… err.. .wait… can you? Well, assuming it’s been pre-loaded – yes, there’s a little blue bar with a white gradient — that’s the play position indicator. You can drag the white bit around to set the current play position.

The only issue is – it breaks the common UI visual cues’, so it took me about 30 seconds to find the control (it’s really not obvious). What’s the likelihood that my Grandmother is going to know how to use it? 

One big win for last week, which I havn’t mentioned was that work is picking up the tab for my TechEd 2007 ticket. (Thanks, Malcolm – even though I’m sure you don’t read my blog)

So, I’ve gone ahead and booked flights and accomodation for then.

Looks like I’m going to be busy in the next few months – Google Developer Day in Sydney on May 31st (free), ReMIX in Melbourne on June 25-26th ($140), and finally TechEd on August 7-11.

Due to some configuration changes on my webhost, WordPress (2.1.x) stopped working correctly on one domain.

Basically, even though Windows Live Writer was submitting to the XML RPC Interface via POST, it was still returning “XML-RPC server accepts POST requests only.”. Not exactly helpful! 

Windows Live Writer was giving a message like  ”Invalid Server Response – The response to the blogger.getUsersBlogs method received from the weblog server was invalid.”, and I could only find this post as a possible solution.

Anyway, the kind folks at Dreamhost fixed it up by adding the following line to the top of the xmlrpc.php file: 

$HTTP_RAW_POST_DATA = file_get_contents(“php://input”);

What it does, I’m not quite certain (fixing a global variable?) – but it works nicely now.