Monday, October 11, 2010

How I got Ubuntu to work with Broadcom's BCM43224

The Probelm

Since getting my Dell Studio xxxx I never managed to get it work on my wireless network with Ubunu 9.04 upwards.  Not too bad, as it came with Windows 7, which was a massive improvement over Vista which I had dual booted on my previous laptop.  But still... I missed the power and raw speed of Linux.

With 10.10 out, I decided to give it another try - and SUCCEEDED!

After running System Testing from the System > Administration menu (just run the network tests), I deduced that my network adaptor was a Broadcom BCM43224.

The Solution

From there on, I was 10 magical steps away from wireless nirvana:


  1. From the Application menu, selected Ubuntu Software Centre
  2. In the top left search box I search for Broadcom
  3. From the results I installed the 'Common files for the Broadcom STA wireless driver'
  4. Then went to the System menu > Administration > Additional drivers
  5. Selected the Broadcom STA proprietary wireless driver and hit 'Install'
  6. Rebooted
  7. It DIDN'T work
  8. Went back to System menu > Administration > Additional drivers
  9. Removed and reinstalled the Broadcom driver
  10. It worked!
This has bugging me for ages, and I've finally got it to work.

Bye-bye Windows 7, it wasn't too bad.

PS - I've not been brave enough to reboot again yet.

Wednesday, May 19, 2010

SOLVED: How to open zip files in IE6

This one took some time to fix, but I got there in the end. Here's what worked for me...

Problem

The web app I was working on generated a CSV report on the fly, zipped it up and returned it to the user's browser.

When submitting the web form that generated the report, the user's browser asked if you want to open or save the file. Firefox (and I'm assuming all other decent browsers) had no problems either opening, or saving then opening the file.

IE6, however, likes to be different.

Saving the file, then opening it, no problem. Tring to open the file straight away, big problem. The zip file was empty!  Interestingly, the downloaded file was not to be found in IE6's temporary files flder either.

It turns out that this was a well known bug in IE6 that Microsoft just couldn't be bothered to fix. Probably because they have newer browsers out there. I mean, who would use IE6 given the chance?

The Solution

For me, at least, I managed to work around the issue. Taking in to account the advice I found here, it turns out that there was some code in the web app adding response headers, specificly: Cache-Control: max-age=1,no-store,must-revalidate.

After stopping the web app from adding this header if the Content-Type was for a zip file (e.g. application/zip, application/x-zip etc.) all worked well.

Phew.

I'm guessing, but it seems that choosing to open  the file 'streams' the data back to associated application (WinZip in my case) via the browser, which takes the http headers in to account, opposed to saving and opening from disk.

Friday, February 12, 2010

Grails Many to Many with Lists Problem

The Problem

Having problems persisting your many to many relationships using Lists? Well you've come to the right place!

The Classes

We have a many to many relationship between a Player and a Squad, as a squad can have many players, and a player can belong to many squads.

We also want to know if the player is active in the squad, so we have another class modelling the relationship, Membership with an active property.

Let's have a quick look at our Domain classes...
We can persist he classes like this...


By default hasMany creates a java.util.Set of Memberships. That's fine, but Sets are unordered, and because I'm a bit fussy, I really want my memberships orders. There are a few ways to achieve ordering (I'm not going to cover them all here). The way I want to do it is by explicitly defining memberships as a List.

The Error

All fine and dandy. Well, actually, no. If we try and persist our domain classes now, we are met with an unexpected (and somewhat incomprehensible) error...

org.hibernate.MappingException: Duplicate property mapping of 
_membershipsIndexBackref found in smitek.fiveasider.Membership

All we did was change our collection from a Set to a List. For me this is a bit harsh, and hopefully something that can be handled in Grails going forward. As you can tell from the error message, this error is occurring down in Hibernate.

After lots of messing around trying various things I finally worked out a way to get this working, with a hint from this link.

The Solution!

By giving the collection of memberships a unique name in the Player and Squad classes we get round the problem.

About...

This is the about stuff