The house is finished!


Written on 14/8/2008 – 2:04 pm | by JProgrammer

Have you ever noticed that as time goes buy your passion for different things start to wain? I do it seems some things that you thought was important is not so important any more. Like blogging for instance :P

It has been quite a while now mainly because work has been heating up for me. I went on a week long trip to China visiting different customers.

And most importantly our house was finished and we moved in about 4 weeks ago Yey!

Completed
And we are loving it, the cat hasn’t adjusted too bad either. But the money is now flowing out finishing off the house. Oh well such is the life of a mortgagee.

Tags: , ,

We have a Slab!


Written on 24/1/2008 – 9:54 am | by JProgrammer

Well the Christmas hiatus for the building industry is finished and we now have a slab. It’s such an exciting thing to finally see some progress in the house that we have invested so much time and effort into actually taking shape.

Slab

With all this excitement we are now heading out there every evening so there will be loads of photos to follow. I may not post about each stage so to keep up subscribe to the Our House photo rss.

Tags:

House Update


Written on 2/11/2007 – 12:55 pm | by JProgrammer

Most people would know we bought land in April to build our first house on.

Our House

And since then we have been trying very hard to get approval to build the house we want on it. There was a clause in our title, Memorandum of Common Provisions to be exact. That no structure within the first metre of the boundary will be greater than 3.6 metres tall. And the house plan we decided to build once sited on the block made the height of the garage at 1 metre from the boundary 3.79 meters.

So both I and the build phoned the council to see what could be done, simple they said all you will need is a Planning permit and it should only take a couple of weeks for such a small item.

Thats when the fun really began it took the council 3 months not a couple of weeks to approve the permit and when we finally got it back we were told that the planning permit was not all that needed to be done to allow us to build our house :(

A planning permit like this gives you permission to get a licensed surveyor to draw up a plan that will then be approved by council which will then need to be submitted along with the title kept by the bank to the Titles Office.

So here’s the list of things that cost money along the way:

  • Planning Permit
  • Letters to neighbours
  • Plan
  • Approval of Plan with Council
  • Release of Title from bank
  • Submission to Titles office

So if anyone ever tells you that a Planing Permit is no big deal laugh in their face it is a big deal and it will take time effort and quite a bit of money.

But if you are going through something similar take a queue from me that I should have known earlier, you need to be a squeaky wheel. If the person says that something will be done on a certain date or in a “couple of days” then make sure you phone them then and find out if it has been done.

Other than that we are now very excited about the prospect of getting on with the building of our house :)

Tags: , ,

Vertical text align of radio buttons in java


Written on 19/9/2007 – 11:24 am | by JProgrammer

I have been doing some GUI java code in both swing and SWT recently and find text alignment a niggling annoyance of mine. Often you want to align components with the text line vertically of combo or check boxes.

Here is the code for determining the width in pixels for the two most popular GUI libraries in java. Both are cross platform/look-and-feel solutions.

Swing

JRadioButton radio = new JRadioButton();
int raddioButtonOffset =
    UIManager.getIcon("RadioButton.icon")
        .getIconWidth()
    + radio.getIconTextGap()
    + radio.getInsets().left;

SWT

// get the width of a space
GC gc = new GC(parent);
int spaceWidth = gc.getAdvanceWidth(' ');
gc.dispose();

// create radio widget to get widths
Button radioButton = new Button(parent, SWT.RADIO);
Point baseSize =
    radioButton.computeSize(SWT.DEFAULT, SWT.DEFAULT);
radioButton.setText(" ");
Point withSpaceSize =
    radioButton.computeSize(SWT.DEFAULT, SWT.DEFAULT);
radioButton.dispose();

int radioButtonOffset =
    withSpaceSize.x
    - ((withSpaceSize.x - baseSize.x) / 2)
    - spaceWidth;

Tags: ,

Down again?


Written on 20/7/2007 – 8:59 pm | by JProgrammer

This week the blog went down again with “500 Internal Server Error” again. This time however I believe that the problem has been resolved for good this time however.

Back when I started this blog in 2003 with Wordpress 1.0 there was no WYSIWYG editor so I wrote the first 18 months of posts in Textile before Wordpress 2.0 was released with the TinyMCE editor for writing posts. And after that I couldn’t be bothered re-formatting them so I left the Textile plugin turned on and as it turns out it created the problems so hopefully it’s all finished with now. Thanks again to the support staff of Profusehost.

Tags: , ,

Netbeans


Written on 12/7/2007 – 3:58 pm | by JProgrammer

I have become a bit obsessed with the java community lately more in a consuming fashion than a participatory fashion, reading Java Desktop and listening to the Java Posse and it just keeps coming up how much everyone loves Netbeans and that everyone should be using it for Java development.

Features such as Mattise look to be very good and a great reason to use the IDE. However as an Eclipse user there are just too many features that I miss to change IDE for now.

  1. Per project settings including templates and code style
  2. Macro for YEAR for code templates
  3. Incremental compiler.
    On a small project of only one file takes a good 3 seconds just to launch even if it is built. Like really do you need to build a jar always when executing projects? As good as running everything through ant sounds it is just too slow when compared to what you get for free with eclipse.
  4. Editor support.
    Supposibly the java editor is greatly improved for version 6, however in the test build I used M9 it is still slow, non intuitive and just painful give me eclipses Ctrl-1 quick fix any day.

Completion in the IDE space is good but for my everyday java development it is still impossible for me to switch.

Tags: , , ,

gstreamer port to Java


Written on 12/6/2007 – 9:17 am | by JProgrammer

It has long been discussed in the java community about the lack of a good multimedia framework for the platform. After reading Chris Adamson’s wrap up of his JavaONE BoF I felt here is a cause I could really get behind.

I starting thinking yes wouldn’t it be great if gstreamer was ported to java. I started doing some research and grabbed a copy of the gstreamer cvs. But just as I was getting my hopes up I read that sun was going to do something about multimedia. But by the time I got to the end of the blog entry I realized that it is a smaller project of giving a common java wrapper for the platform services ie Qucktime on OSX, DirectShow on Windows and I guess gstreamer on Linux.

As the days went on and the comments on Chris Adamson’s blog kept commoning many people believe that a full stack is needed but no one is willing as far as I can tell willing to have a go at it. One even goes as far as to say that it is too hard because gstreamer usually just wraps other binaries such as ffmpeg and would just be too hard.

There is also the Cortado sub project of flumotion which is a very simple applet for viewing ogg theora videos. At it’s core there is a partial port of gstreamer that is undocumented and is very C-style coding.

So for fun I want to start trying a full port, so I have read the gstreamer application development manual and the plugin writers guide and now feel I have a fairly good understanding of what is under the hood and how much work this is going to be. I think alot more than I even realize right now.

A few design features I am thinking of going with now are:

  • Full java stack as far as possible only pure hardware plugins such as video4linux etc would call native code.
  • Rewrite all previous java implementations ie, jorbis.
  • Elements as POJO’s and use introspection for properties rather than a map.
  • Java SE 6 only.
  • Heavy use of java.util.concurrent.
  • Core released as GPL plus classpath exception and plugins most likely GPL.

Now I know it will be a lot of work and knowing me it will probably never be released but if you think this is a good idea and want to put you 2c’s in then please leave a comment.

Tags: , , , , ,

Asserting SwingWorker


Written on 3/4/2007 – 1:32 pm | by JProgrammer

I have had a chance to play around with some java code recently for a change of pace and I was excited to use the new SwingWorker class in JSE6. However I also am in the habit of programming with asserts which I found out to be a problem if one triggers while running in a SwingWorker thread.

If you look at the base class of SwingWorker, FurtureTask, in the inner class Sync, which is where the actual task is run there is this method:

boolean innerRunAndReset() {
    if (!compareAndSetState(0, RUNNING))
        return false;
    try {
        runner = Thread.currentThread();
        if (getState() == RUNNING)
            callable.call(); // don't set result
        runner = null;
        return compareAndSetState(RUNNING, 0);
    } catch (Throwable ex) {
        innerSetException(ex);
        return false;
    }
}

The observant reader will notice that this code will catch all Throwables, which is the base class of Exception and Error, and an assert in java will throw a AssertError so your code will bomb out silently without notification if any Throwable is thrown.

try {
    // do threadded work here
} catch (AssertionError e) {
    logger
        .log(Level.WARNING,
        "Assertion while processing: {0}\n{1}",
        new Object[] { e.getMessage(),
        e.getStackTrace()[0] });
} catch (Exception e) {
    logger.log(Level.SEVERE,
        "Exception throw during processing {0}\n{1}",
        new Object[] { e.getClass().getName(),
        e.getMessage() });
    throw e;
} catch (Error e) {
    logger.log(Level.SEVERE,
        "Error throw during processing {0}\n{1}",
        new Object[] { e.getClass().getName(),
        e.getMessage() });
    throw e;
}

I use the a statically defined Logger, logger, to print output from the Exceptions and Errors.

This allows the thread to throw asserts but keep going and if it does bomb out on any other Error or Exception you get notified in your log making debugging a SwingWorker a bit easier.

Tags: , , ,

Card Reader on BenQ S52


Written on 30/3/2007 – 12:54 pm | by JProgrammer

In my continued coverage of getting my BenQ S52 laptop running correctly under Ubuntu Linux, I recently had the need to use the integrated memory card reader with an SD card.

And Lucky me it didn’t just work so I hunted around the internet which lead me to an article on the Ubuntu forums. However I found that this does not work with this particular laptop and should not be done.

The solution however is simple you just have to make sure the tifm_sd module is loaded. The it does just work which is great. Though if you are wanting to use another type of card with this reader you are out of luck for now as SD is the only format that is supported by the driver at the moment.

So to load this module once

> sudo modprobe tifm_sd

But to load it at every boot add tifm_sd to /etc/modules

Tags: , ,

A Podcast for the Few


Written on 28/3/2007 – 12:33 pm | by JProgrammer

Software Engineering RadioI have been listening to the software engineering radio podcast for a few months now it covers a number of topics on current software engineering trends and has interviews with different developers.

I enjoyed the recent episode on dynamic languages for static minds, which applies so well to me, although I still haven’t been converted to a dynamic language developer it has got me to re think my ideas on them.

Since I finished University over a year ago now I was missing the new ideas and methodologies that gets taught there but programs like this enable me to learn new ideas while working, ahh listening to music/podcasts while you work.

I recommend subscribing to this program which releases a new episode about every 10 days for all you SE’s out there.

Tags: ,