Page: 0 ... 5 ... 10 ... 15 ... 20 ... 25 ... 30 ... 35 ... 40
OpenGL shenanigans
Date: 6/7/2005
So I'm trying to build a system that uses opengl to draw dynamic 2d images in windows. I have tried using big bitmaps in memory and then glTexImage2D to create the texture from the memory bitmap. But the texture is static then... and to change the texture you have to call glTexImage2D again. Which in my case takes forever (120ms) to read the bitmap in and update the texture.

glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, x, y, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, bits);

Really what I want to do is draw on the texture using opengl. Or some other vector graphics api... although hardware acceleration is important so I'm assuming that I can't draw on the bitmap with any other type of hardware accelerated API. I really need to get my fill rate limitation off the CPU and into the GPU. Currently I've been using cairo to paint with and it's fill rate is woeful. I don't know whether that is cairo or just the CPU yet.

Maybe I will have to forget textures and just convert all the drawing commands to the opengl calls and clip the output against to the window's area. But that would mean changing the architecture to keep a display list of primitives around to "execute" everytime the screen needs updating. That doesn't sound like fun let alone an effcient way of doing things.
(5) Comments | Add Comment

USB/Firewire Header Adapter
Date: 29/6/2005
My new case has USB and Firewire ports built into the front and to connect them into the USB2 and Firewire PCI cards I need a little adapter like this. Male pins on one end and a normal USB or Firewire plug on the other. Both my cards have normal sockets on the internal side instead of header pins. The motherboard only has USB1.1 headers and no Firewire at all.

I can't find anyone in Australia that sells these sort of adapters so I'm probably going to have to construct them out of USB/Firewrire cables... which is more expensive and prone to malfunction than getting the right adapter.

Not to be outdone the sound ports on the front of the case have another incompatible connection point so I can't plug them into my SBLive.
(3) Comments | Add Comment

New Bug Database
Date: 27/6/2005
Those of you who are regulars around here would have noticed already, but there is a new button on the sitemap that links into the new Bug Database. I've entered all the products, some of the versions and made up some components to start with. I even kicked things off with bug #1.

This way I hope to maintain a better flow of information between myself and users over issues in the various software. And you should be able to keep abreast of where things are up to. Hopefully it doesn't end up being more work than it's worth. That really depends on how people use the Bug DB. DO try and check for duplicate bugs before entering a new one. DO be civil and helpful in comments, I don't want to have to moderate the system. Also if you get a crash, please attach any available crashdata.txt to the bug report.
(2) Comments | Add Comment

Site Update Mockup
Date: 24/6/2005
I'm working on a site update mockup and it's working fine in Firefox and IE but the title is broken in Opera. 2.2% of the people coming to this site use Opera, so I'd like to get the title looking correct for them too. No I'm not going to use an image instead, if it comes to that then the Opera users will just have to live with it.

Basically the problem is that Opera doesn't render position: absolute; elements the same way as Firefox and IE. It doesn't take into account the text-align mode of the container element for some unknown reason. This is probably just a bug in Opera but if there is some way to work around it then great, let me know. The style in particular is .title2 in the css.

Update: I've got things sorted out for the 3 main browsers that people use: Firefox, IE and Opera. I had to put 5 different hacks in the CSS to get it to work just right.
  • IE: to stop IE expanding some div's to the height of the default font I had to use 'font-size: 1pt;' on some css classes.
  • IE: to work around the lack of proper 'border: 1px dotted;' support I used an underscore on the front of a second border definition (with a solid line) which IE will parse and use but other browsers ignore.
  • IE: I had to add a id to the copywrite link to make it turn the correct colour. Other browsers let you do it by class or a child selector.
  • Opera: doesn't correctly support 'position: absolute;' on tags with centered or right aligned containers. So instead, because I had a fixed width layout anyway I hardcoded a padding on the container div to shift the text into roughly the correct place. (Ugly I know)
  • All: I thought I'd be clever and create the 3d button look on the menu bar by adding a 1px border-left with the highlight and a 1px border-right with the shadow. But browsers somtimes overlap the elements by a pixel seemingly randomly destroying the effect, so I gave up on that idea, made the 3d highlight into a 2px wide image and applied it to the left edge of all the anchors. Not as neat, and causes an extra HTTP get for the image but more robust.
I'm not entirely convinced this new layout is the best way to go. I need some sort of full width version for long pages. And I don't have it setup for google ads yet either. But other than that I'm pretty happy with the look of it.
(8) Comments | Add Comment

Electric Vehicles
Date: 24/6/2005
You'd think that in this day and age that the government would be falling over themselves to make it easy for the population to travel in a manner that gets cars off the road, doesn't pollute and is cheap to buy and maintain.

But no they legislate it onto the side lines.

I'm talking about electric scooters in Australia. The situation is that any electric powered vehicle, be it scooter or bike, is limited to 200w total power output or it has to be registered as a motor vehicle and be complied to the Australia Design Rules. Which is impossible for many imported powered scooters, as they don't have things like turning indicators, the right type of brakes or head lights. The 200w power limit really limits the class of vehicle to toys for kids. An adult riding a 200w scooter is going to get stuck on the first hill that presents itself.

Ideally these vehicles would be classified in the same class as bicycles because of the similarity of their performance envelopes. i.e. their top speed and cruising speeds are quite similar, as is their stopping distance and turning circle. So why not make the same rules and privileges apply?

Overseas the power limits for electric scooters vary between 250w (EU), 500w (Canada) and 750w (US). For the average adult to effectively negotiate terrain at least a 500w motor would be needed. Which brings us to the question 'Why would as adult want to ride a powered scooter anyway?'

We have been hearing for years about how the use of fossil fuels is putting a hole in the ozone layer and causing global warming let alone the clouds of smog over our cities! And the introduction of electric (or zero emissions) vehicles has long been held as a good step in the right direction in solving the reliance on fossil fuels. So what electric vehicle options are there for the discerning vehicle buyer? Certainly not an electric car, that's for sure. The next best thing is a hybrid car but to be honest they have yet to deliver on either value or efficiency. For instance the Honda Jazz (5.8lt/100km city) is pretty close to the Toyota Prius (4.4lt/100km city) and yet costs half as much. A motor bike is pretty hazardous on the hostile roads of Sydney where I live. It's merely a matter of time before someone side swipes you and end spend 6 months in hospital. No thanks.

That leaves the only real competitor to the powered scooter being the trusty old bicycle. There are a number of important distinctions between the 2 classes of vehicles, firstly and most importantly is that a powered scooter folds away for travel on public transport vastly increasing the range of destinations reachable via scooter. And in electric form they fold more compactly as well as not having the smell or danger of fuel along for the ride. Something that you can't do easily with a bike especially on a bus! The other consideration is that any non trivial distance ridden on a bike causes a good deal of sweat which makes there use for commuting to work less pleasant, maybe requiring you to shower at your destination.

I can understand the resistance to having petrol powered scooters on the roads and cycleways. They are completely too noisy for suburbia, in fact they are the single loudest vehicle on the road. And as a father with young children that get woken by petrol scooters I can vouch for their volume. If a reasonable volume level could be achieved then they could offer some of the same benefits as electric scooters, but not until then.

So what I'd like to see is a raising of the power limit for electric scooters to at least 500w, maybe more, say in line with the US and the limiting of noise levels produced by petrol scooters. To allow older people the option of using scooters for short commutes to work and shops. It gets another car off the road and that is a win for traffic and for the pollution situation. The same rules and regulations that apply to bicycles should apply, ie. you need to wear a helmet, use the road, not the footpath (unless your 12 or younger), use bike lights at night and you obey the road rules. And you get treated as a valid road user in return.

If there are any serious holes in my idea I'd like to hear about them. As I have presented this to my local Member of Parliament, who happens to also be the Minister for Transport. And if I go into bat on the issue knowing both sides of the story would be helpful to allow me to present a level headed argument. Currently I don't see any gaping holes in what I propose.

Also I'm thinking of starting a petition to have the 200w limit raised in light of the above arguments. If you would like to show support you can write a comment on this entry.
An fairly high end example scooter from the US is the Go-Ped ESR750 available in Australia for A$1495. Which is very affordable considering the cost of buying and running a motorbike or car.

Update: I've got a letter from the Minister of Transport explaining their position.

Update2: Marty pointed out in a comment below that the RTA have banned all "stand on" motor scooters regardless of power output, see their page decribing the rules, with line drawings of various types. After all this time I still thought the 200w scooters were legal, and now this.
(37) Comments | Add Comment

Scribe Crash
Date: 24/6/2005
The current bug blocking Scribe v1.88 going stable is a crash related to attachments. Somehow during attaching files to an email something goes wrong and when you send it or close the window it crashes. If you can reproduce that at will then I'd like to hear from you.

I suspect that something is creating an extra message loop on top of the email window's message handler, like maybe TrackPopupMenu or a modal dialog. And then for some reason while that is running the mail window is closed, and when the message loop returns to the underlying mail window message handler, it has already been deleted and it crashes with a corrupt stack or invalid memory access.

So far I've checked that I've correctly parented the attach file dialog and the popup menu tracking. So I don't see how it's possible but there must be a way of breaking it because people keep sending me crash reports about it. I havn't been able to work out how to reproduce it as yet, so if you have any relevant information let me know... please!

Another related problem is that when you double click a (usually large) attachment Scribe can crash. It's a similar sort of issue, i.e. after running the OnClick handler the window has been deleted and an invalid memory reference occurs. I've seen this once or twice myself but can't reproduce it.
(1) Comment | Add Comment