I upgraded to Ubuntu 8.10 the other day, and all of a sudden I couldn’t get any sound from Flash player 10 within Firefox. After checking my player version I was being informed I was on version 9… odd, since I upgraded to 10 a few weeks ago when it came out for Linux. On looking in my plugins folderĀ  (~/.mozilla/plugins) I found another copy of libflashplayer.so in there, so deleted it, reloaded the Adobe plugin detection page and lo and behold, version 10,0,12,36 is back up and I have sound again in the browser.

Sweet.

Cube Runner with Papervision 3D

November 3rd, 2008

I’ve been pissing about with Papervision (V2 Great White), the 3D library for AS3. It’s very cool, and I can’t believe it’s taken me so long to pick it up and have a play around.

Anyway, I got Cube Runner on my iPod and decided to recreate it in Flash. My version isn’t exactly “finished” but as an exercise in controlling 3D space, it was a good one. It has some collision bugs, and some of the physics aren’t quite as polished as the iPhone version but whatever… I just wanted to see if I could do something similar with what Papervision offers.

I want to try and finish it over the next few days and get the following things done:

  • Work out how to add more distance on the camera’s perspective, as the cubes tend to start too close to the viewport. They’re being added with a z position of 0 at the moment, but it looks like anything less than 0 makes them disappear off screen… maybe zoom out and let the cubes scale up?
  • Improve the collision detection slightly – I’m using hitTestObject() to evaluate collisions at the moment but I don’t think my implementation is too hot.
  • The fonts don’t work under Linux (only I’m bothered about that mind).

Instructions: Use the mouse to move the ship left and right and avoid the evil cubes!

If you’re doing any .Net ADO work with an Excel sheet, and want to explicitly enable or disable automatic handling of the first row of the sheet being set as a heading by the data handler, you have to set HDR=YES or NO in the connection string’s ‘Extended Properties’. OK, you may say, but what I ran into the other day was the following helpful message as soon as those properties were added to my connection string:

“Could not find installable ISAM”.

Huh? What’s happened? Dave’s started banging his head against a brick wall, that’s what.

It turns out that the formatting of the connection string has to be quite strict (read: stick random linebreaks in) to get it to work, so here is how I managed to get the damn thing working again:

OleDbConnection connString = new OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;" +
 "Data Source=c:\somefile.xls;" +
 "Extended Properties=" + (char)34 + "Excel 8.0;HDR=Yes;" + (char)34);

Hope that helps some poor sucker scouring the web who’s run into the same issue.

If you’re finding that MOUSE_OVER or ROLL_OVER MouseEvents are being fired on animated movieclips at a rate of knots (for example a button or movie element that animates on rollover), and have ensured that mouseChildren is off for the clip – take a look to see if you turned on cacheAsBitmap for the element and try setting it to false…

I can only assume that the internally cached bitmap is interrupting the mouse events when it’s being redrawn, but why exactly is beyond me. This first example will exhibit the weirdness – mouse over the edges of the squares to see.

So there you are.

Ubuntu

August 7th, 2008

MSXML Documentation

November 21st, 2007

I’m sick of always losing the bloody URL for Microsoft’s MSXML documentation (I swear it keeps moving), so I’m posting here for my own reference.

http://msdn2.microsoft.com/en-us/library/ms764730.aspx

New none-boring blog post coming soon :)

I’ve hacked a quick jQuery extension to allow you to overload the toggle method to allow more than 2 toggle events. It’s not exactly rocket science but I need to be able to give an element three toggle states and the built in version only allows two.

Simple state extra toggles separated by commas like normal:

jQuery.fn.extend({
toggle: function() {
var a = arguments;
return this.click(function(e) {
if (this.lastToggle == undefined || this.lastToggle+1 >= a.length) {
this.lastToggle = 0;
} else {
this.lastToggle++;
}
// Make sure that clicks stop
e.preventDefault();
// and execute the function
return a[this.lastToggle].apply( this, [e] ) || false;
});
}
});

jquery.multiple_toggle.js

UPDATE: Multiple toggle states are now supported natively in jQuery 1.2.6.

I’ve been doing a spot of work that requires version control, so we’ve been using Subversion. It’s great, but if you’re anal like me then you may not like the .svn files that litter your working directories after you’re finished. Rather than doing a full SVN export, I cobbled together a VB script to delete them all in one fell swoop. Might help someone else on a random Google search. so posting it here. Sorry for being boring.


OPTION EXPLICIT
Dim FSO, Folder, SubFolder, LogFile, DeletedCount
DeletedCount = 0
If MsgBox ("This will delete ALL of your subversion folders for this repository. Are you sure?", vbYesNo) = vbYes Then
Set FSO = CreateObject("Scripting.FileSystemObject")
Set LogFile = FSO.CreateTextFile("./svn-cleanup.txt")
DoSvnDelete ("./")
MsgBox(DeletedCount & " .svn file(s) were deleted. See log file for rundown.")
Set FSO = Nothing
End If
Sub DoSVNDelete (Path)
If FSO.FolderExists (Path) Then
Set Folder = FSO.GetFolder(Path)
If Folder.SubFolders.Count > 0 Then
For Each SubFolder In Folder.SubFolders
If SubFolder.Name = ".svn" Then
LogFile.WriteLine ("Deleted: " & Path & "\" & SubFolder.Name)
SubFolder.Delete
DeletedCount = DeletedCount + 1
Else
DoSVNDelete (SubFolder)
End If
Next
End If
End If
End Sub

Download the VBS file here.