Jacarandas

Before I travelled to South Africa, my parents and other relatives told me how utterly beautiful the jacarandas are in Pretoria. Certain areas of the city are full of them. I recall one park in particular which had few other species.

They are beautiful, but what struck me when I returned is how brilliant the colour of the local jacarandas is. It's a deeper and richer mauve than those in Pretoria. Even allowing for the fact that here they are surrounded by darker green foliage, and one never sees so many in close proximity, they're better.

Brumby's having a mid-life crisis

Just when we thought it couldn't get any worse, a Labor government is about to shred the vocational training system on the blades of the free market. Not only is the Victorian TAFE system the worst funded in the country, not only are its teachers on the lowest wages of any TAFE teachers in the country (and paid less than high school teachers), the Government is about to introduce changes which will kill off or seriously injure existing institutes and allow rampant profiteering by private corporations. Here are main "features":

  • Double or triple fees paid by students
  • Make government funding contestable by private corporations. This means that private providers can apply for, and receive, government funding to provide training.
  • Remove limits on the numbers of places a training provider can offer

The issue of contestability is fraught with danger. As yet there's no indication of how providers are to set fees or even whether there will be limits set by the Government. Can you imagine if a private provider, who might otherwise charge $10000 for a fee-for-service place, got $7-8000 from the government and then still charged $5k?

One hopes it won't be so.

The last one has been little discussed. What most people don't know is that the Office of Tertiary Training and Education (now known by the fatuous and opaque title of Skills Victoria) put years of work into modelling the demands for skills in the employment market. Now even though my area -- sound production -- would be (and was) designated as a "low priority" course, it does make sense for the government to spend its education dollar wisely on training people for skills that are actually needed and in occupations where there are skills shortages.

Well, OTTE and the puppet Minister for Education got rolled by some arseholes in Premier and Cabinet. It is said that the then Department Secretary for OTTE was so insensed that she resigned.

So what's the wash-up? Well, since the government will now purchase as many places for students as we can enrol, maybe its not so bad. Except that it's inevitable that private providers will cherry-pick the cheap courses -- those for which only a classroom, a whiteboard and desks and chairs are required -- so established providers (TAFE institutes) will lose places.

The response at my institute, so I've heard, is to convert fee-for-service courses into "recurrently funded" courses (funded by the government). And since there's no limit on the numbers we can enrol, even in what was previously a low priority course, it's an easy way of keeping up the number of places and therefore the revenue. However, our Department is still expected to generate a high level of fee-for-service revenue even though we've lost more than half of it. So the net result is that everyone is trying to think up fee-for-service programs that can be offered.

I'm not having a go at my insitution. Converting fee-for-service places into recurrently funded places is actually a rational response to what's going to happen. But the net effect is that those of us "at the coalface" (to use a cliche beloved of politicians and public servants) are going to have to put in thousands of hours of unpaid overtime to develop new course with the meagre, and in some cases, non-existent resources that we have. And that's on top of the overtime we already do.

I would venture to say that there's probably not a single colleague who's not putting in at least one day a week extra -- even those of us who are on a 0.6 contract (three days a week) -- that we're not being paid for.

One has to wonder what the motivation is. Well, apparently the Federal Minister for Education would like to see a similar thing so I wouldn't be surprised if she planted the idea in the Premier's mind. But to throw out years of work and let the kids do whatever courses they want, regardless of whether there'll be a job for them at the end of it, and do it when the economy is tanking big time, is plain stupid.

But it's just one of a number of things that Premier Brumby is doing that no one wants... except a few small vested interests. Here are some others:

  • Building a pipeline between the Goulburn River and Melbourne, effectively stealing water from the most degraded and fucked up river system in the country
  • Building a desalination plant instead of regulating water saving and coming down hard on industrial wastrels
  • Building more freeways instead of a reliable public transport system. It'd be really cool to get a comment on this blog from the PR guys at Dis-Connex. Hey, it doesn't matter what you say. No one believes you. Now go and get a real job.

The decisions have been made despite rational, well-argued opposition and there'll be no back-down. Because to reverse such decisions make you look weak. And Brumby doesn't want to look weak. He's just another bloke hung up about his masculinity who'll never admit his mistakes. This is exactly the macho bullshit evident in so many cultures, and in every totalitarian state, around the world that's got us where we are. Haven't you noticed? It's always the fucking men.

Brumby is no different to the leaders of China, Cuba or North Korea. He's having a mid-life crisis and has to show the world what a big man he is.

Un-spam

For much of the time since I started this blog (that no one reads), I've had at least 10 comment spams a day... all nicely caught by this blogging software. But in the last few weeks, it's stopped. I had one today, but only one. What's going on? I guess not even spam merchants are interested in this blog!

Reliable dragging and rotation too!

In my last entry, I demonstrated that when a Raphael SVG object is rotated, its coordinate system is also rotated. In fact, when the object is returned to a rotational angle of 0 degrees, it jumps to the location it would have moved to had it not been rotated.

So the issue is, how can one move an object which has been rotated away from its original angle (whatever shape and orientation it had when it was created). I previously considered using trigonometric calculations to adjust both x and y coordinates to make the object move to where it would be if its angle of rotation had been 0 degrees. But I now realise that this would not have worked properly as the distance the object moves when it is rotated away from 0 degrees is the same as it would have moved when it was at 0 degrees' rotation. If my memory of trigonometry serves me correctly, that would require tan, not sin or cos.

I'm sure that, with a little revision, I could work it out. But I suspect that some of those mathematical functions result in a performance hit, especially as they'd have to be performed with every mousemove event. I've no doubt that SVG or VML functions already employ such calculations, even though they're done by the Javascript engine which is most likely written in C or C++ and therefore performs at least an order of magnitude faster than the interpreted Javascript which invokes them. Or maybe such calculations only happen once, when the object is rotated and then a completely different coordinate system is maintained in memory.

Since I understand nothing about Javascript engines, I could be talking completely through my hat.

So I decided to try a simpler approach that I alluded to before: rotate the object back to 0 degrees before moving it and then re-rotate it to whatever angle it was before the move.

I could "undo" the rotation on the mousedown and "redo" the rotation on the mouseup, but the user would see the object in an unrotated state during the mousemove. I decided to so these operations for every mousemove event.

Here's the demo. It has the same "Rotate"/"Unrotate" button under the canvas (scroll down a bit if you can't see it) as before.

If you examine the Javascript, you'll notice there are only a few lines added. I don't notice any performance difference between the previous one and this, even though the Javascript engine is probably working a bit harder. WRONG! There is a noticeable performance hit. At first, I thought there wasn't because I forgot how smooth movement is without the modifications to the previous script. And to the user, it looks as if the object is moving smoothly fairly smoothly, with no blurring due to redraws even though, one assumes, redraws are occurring.

I'm not using a superfast machine either: it's an old IBM R30 running Opensuse 11.0 (Linux) with KDE4 and Firefox 3 (FF3 is required for scalable vector graphics).

So, with this key functionality in place, I can continue developing the "stageplan" application.

Reliable dragging using Raphael

After some weeks of frantic marking and other administrative affairs, I finally had the chance to sit down this week and work on the Javascript-based app using Raphael.

I discovered that one can indeed access drawing objects with the JQuery Javascript library, provided one adds an "id" attribute and refers to the "original" object. So if, for example, one creates an object as follows:

var paper = Raphael("container", 640, 480);
var square = paper.rect(50, 50, 20, 20);
square.attr({
    "fill":"#b34300",
    "id":"square",
});

...one can only access attributes of the object like this:

square.attr("x");

...and not this (using Jquery):

$("#square").attr("x");

I think this reflects the very complicated nature of Raphael and, in fact, SVG or VML drawing. (Take any comments about VML with a grain of salt though because I haven't got any of this to work in IE yet.) At least, the structure of SVG and its child objects seems to be very complex if the Firefox DOM Inspector tool provides any indication!

Anyway, I tried the tricks that I alluded to previously: that is, attaching mousemove and mouseup handlers to the "canvas" rather than the object being clicked and dragged. And it works a treat.

Demo

There is still the problem of rotating the object. It's probably more obvious in this example than in the previous one. Click on the "Rotate" button to rotate the square 45 degrees clockwise. When you drag the mouse straight up or down, the object moves diagonally. When "Unrotate" is clicked, it shifts position as its coordinate system is re-aligned with the canvas's. Rotating any object also rotates its coordinate system.

I don't know if this is a side-effect of Raphael or the underlying SVG or VML. Any ideas?

← Previous  1  17 18 19 20 21 22 Next →

About

A vanity publishing venture of David Rodger, sound production teacher and wannabe PHP developer

User