First pic of Apple Store in Sydney!

I work around the corner from the Apple Store in Sydney, and I noticed that at the beginning of this week, they took the cover off the side of the building. So I took my camera with me this morning and took a photo of it!

Apple Store Sydney

You can see the class fronting, still mostly covered, and the shape of it. I think the building looks quite good, actually.

Tags:

Comments (1)

Acer AL2416W’s magic smoke escaped!

I bought two Acer AL2416W monitors about 2 years ago when we were in Japan. Great monitors, high resolution, good colour, and they’re pretty cheap - only 100,000 yen new at the time, now they’re down near the $450AU mark.

But a few months ago, my wife and I were eating dinner, and there was a loud POP! We looked around, didn’t see what it was, I figured just a small book fell over or something. Then again. POP! I looked around, this time saw smoke coming out of one of the Acer’s, ran over and unplugged it.

After that, nada. Plug it back in, whatever, nothing happened. ACER logo would flash, but then it would power save.

Now, this would be unexceptional - random bits of hardware do fail from time to time, and in the IT industry one just shrugs, and buys another, and moves on. Thats what I did.

Now, I’m wishing I didn’t. The SECOND monitor I bought in Japan, at the same time, both dated with build date of 2005/11, have died. The second one died in exactly the same way with the same behavior. Now, this time, I’m going to open it up and figure out what went wrong because that’s just shoddy electronics. Acer should be ashamed. Crappy products. I’ll never buy another piece of hardware from them again.

Now I have a monitor sitting on my desk, dated 2007/11, and I hope that it survives long enough for me to experience my new computer when it arrives.

Couldn’t recommend buying ACER to anyone anymore.

Comments (3)

building gsoap on solaris

If you’re building gSoap on Solaris 10 (or below) you might run across this “Broken Pipe” issue with GNU bison:

make[4]: Entering directory `/home/d287582/gsoap-2.7/gsoap/src'
bison -y  -d -v `test -f 'soapcpp2_yacc.y' || echo './'`soapcpp2_yacc.y
make[4]: *** [soapcpp2_yacc.c] Broken Pipe
make[4]: Leaving directory `/home/d287582/gsoap-2.7/gsoap/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/d287582/gsoap-2.7/gsoap'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/d287582/gsoap-2.7/gsoap'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/d287582/gsoap-2.7'
make: *** [all] Error 2

The trick is to install GNU m4 from sunfreeware.com. It’s not obvious, but basically bison uses m4.

Posting this here because I’ve hit this 3 times now and each time I had to redo my troubleshoot from scratch as I’d forgotten what I’d done 3 months before.

Leave a Comment

GTK+, GTKmm, autotools, and your first simple app in C++

I’ve been playing with GTKmm, writing some code to see how to do GUI apps in GTKmm and see how easy it is. Its not too bad, there are some gotchas. This is what I’ve learned so far. I’ll post it as a kind of a tutorial, maybe it will help someone else.

Firstly, I’d like to say that GTKmm gets a lot of unfair stick out there on the ‘net. Google it vs QT or wxWidgets, you’ll see what I mean. But my experience is showing me that its actually a good API, with good underlying design.

We’ll start off with a simple application, called “SimpleApp”. We’re going to use Autotools to manage it. Don’t be scared! Its actually not too hard.

Before you start, I suggest you install Eclipse CDT. Its not bad for a C++ editor, though I wouldn’t bother with it’s managed projects. You’ll also need a bunch of packages. As I use Ubuntu as my development environment, I’ll show you the ubuntu commands, and you’ll have to work out how to do it in your environment.

You’ll need at least the following, I think (let me know if this isn’t enough):

sudo apt-get install build-essential libglademm-2.4-dev libglibmm-2.4-dev libgtkmm-2.4-dev autoconf automake

To make an autotools project, we only need a few files, configure.ac, and a [b]makefile.am[b] for each directory that contains stuff to be built.

Make yourself a project in Eclipse. File -> New -> C++ Project -> [Makefile project] Hello World C++ Project. Call it “SimpleApp”. Once it’s created, the Makefile and the cpp file it drops in there. You don’t need them.

Make a directory structure with some blank files like this:


    SimpleApp/
        configure.ac
        Makefile.am
        src/
            Makefile.am
            SimpleApp.cpp
            MainWindow.cpp
            PreferencesWindow.cpp
        include/
            MainWindow.h
            PreferencesWindow.h

configure.ac looks like this: (http://pastebin.ca/962273)

AC_PREREQ(2.61)

AC_INIT([simpleapp], [1.0.0], [You@that.place])

AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)

AC_ISC_POSIX
AC_PROG_CXX
AM_PROG_CC_STDC
AC_HEADER_STDC

PKG_CHECK_MODULES(SIMPLEAPP, 
    [gtkmm-2.4 >= 2.8 libglademm-2.4 >= 2.6    ])

AC_SUBST(SIMPLEAPP_CFLAGS)
AC_SUBST(SIMPLEAPP_LIBS)

AC_OUTPUT([
Makefile
src/Makefile
])

Basically this file tells autoconf what bits and peices we’re using. We’re using glade, and gtkmm. We also want it to output a Makefile in src, so stuff can be built there. I don’t really understand it much, but its pretty easy to understand as you go, it seems.

The first Makefile.am in the project dir contains just this one line:

SUBDIRS = src

Because we’re not building anything in the project directory (as it is about to be filled with hundreds of files).

the Makefile.am in the src/ directory needs the following: (http://pastebin.ca/962279)

gladedir = $(datadir)/glade
glade_DATA = simpleapp.glade

INCLUDES = \
        -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
        -DPACKAGE_SRC_DIR=\""$(srcdir)"\" \
        -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
        $(SIMPLEAPP_CFLAGS) \
        -I/usr/local/include \
    -I../include

AM_CFLAGS =\
         -Wall\
         -g

bin_PROGRAMS = simpleapp

simpleapp_SOURCES = \
        SimpleApp.cpp MainWindow.cpp PreferencesWindow.cpp

simpleapp_LDFLAGS = 

simpleapp_LDADD = $(SIMPLEAPP_LIBS)

EXTRA_DIST = $(glade_DATA)

Most of the time, you just need to edit the SOURCES line, every time you add a new source file, and then rerun the autoreconf steps (coming next). If you have any libraries you need to link against, add them to LDFLAGS. Include paths get added to the INCLUDES line. Feel free to mess with the CFLAGS to suit yourself; the defaults are designed to be sane.

Once you’ve done this, go to the project directory and run autoreconf. This will fail, with output like the following:

chrome@shuttle:~/Development/workspace/SimpleApp$ autoreconf
/usr/share/aclocal/gtk--.m4:10: warning: underquoted definition of AM_PATH_GTKMM
/usr/share/aclocal/gtk--.m4:10:   run info '(automake)Extending aclocal'
/usr/share/aclocal/gtk--.m4:10:   or see http://sources.redhat.com/automake/automake.html#Extending-aclocal
configure.ac:5: required file `./missing' not found
configure.ac:5:   `automake --add-missing' can install `missing'
configure.ac:5: required file `./install-sh' not found
configure.ac:5:   `automake --add-missing' can install `install-sh'
src/Makefile.am: required file `./depcomp' not found
src/Makefile.am:   `automake --add-missing' can install `depcomp'
Makefile.am: required file `./INSTALL' not found
Makefile.am:   `automake --add-missing' can install `INSTALL'
Makefile.am: required file `./NEWS' not found
Makefile.am: required file `./README' not found
Makefile.am: required file `./AUTHORS' not found
Makefile.am: required file `./ChangeLog' not found
Makefile.am: required file `./COPYING' not found
Makefile.am:   `automake --add-missing' can install `COPYING'
autoreconf: automake failed with exit status: 1

The warnings at the start are nothing we can do about at the moment. Seems to be a slightly older version of the m4 macros installed on Ubuntu 7.10, and I can only assume it’ll be fixed eventually. Doesn’t seem to harm anything.

The rest of the whinging is about missing files. automake will indeed add some of the missing files, but not all. Go ahead and add them.

automake --add-missing && touch NEWS README AUTHORS ChangeLog && autoreconf

Phew, almost there! Its a bit arduous, but you can kind of see a structure taking place here, right? It should be pretty familiar; any time you’ve downloaded a package and built it from source, it probably has these files. autotools and autoconf give you a level of build portability (even if your source code is not) so that at the very least you don’t have to worry about whether a C compiler is called gcc on one platform, of cc on another.

Now we just run ./configure, and it will spit out the Makefile we need to build our project.

chrome@shuttle:~/Development/workspace/SimpleApp$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for library containing strerror... none required
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for SIMPLEAPP... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands

There we go. Now once we’ve added the code into the source files, we’ll have a working build system to build the code with!

Rather than try and paste each file into here, I’ll link to them:

MainWindow.h MainWindow.cpp PreferencesWindow.h PreferencesWindow.cpp SimpleApp.cpp

now when you type make in either the project directory or the src directory, you should get a binary output, called simpleapp, in the src directory. If you try to run it, however, it’ll core!

(simpleapp:22891): libglade-WARNING **: could not find glade file 'simpleapp.glade'
terminate called after throwing an instance of 'Gnome::Glade::XmlError'
Aborted (core dumped)

Hopefully this should be pretty obvious. We don’t have a glade file! Thats because I had you implement the code before the UI. I think this is better coding practice btw; do lots of code first, then worry about the UI later.

So, what you’ll need is the glade file.

simpleapp.glade

Explanation: We have two windows, main_window and preferences_window. There is a single button, preferences_button on the main_window, which opens the preferences_window.

This preferences_window is controlled by the class, PreferencesWindow. It is instantiated only when we need it, and deleted when we are finished. We hook into the delete_event and hide signals for the preferences_window, so that we can destroy it, and in it’s destructor, it destroys any child widgets.

Note that the so-called “Preferences Window” does not work very well. The one tickbox option there, does not save state. This is something I’ll cover in another post; for now you simply need the .glade file in the same directory that you run simpleapp from.

There are multiple ways to control GTK windows and handle the instantiation of the glade based widgets, etc. But this is the way I’m doing it right now. Alternatives:

  • Code your Gtkmm widgets directly in your code.
  • Use get_widget_derived instead of get_widget to get the window object. You create a subclass of Gtk::Window and then use get_widget_derived to populate the Gtk::Window bits with stuff from the glade file. I really don’t see the point in this at the moment, I’m sure a GTKmm wizz will tell me why this is better than the way I’m doing it.

Disclaimer: I’m not a GTK or GTKmm expert. This is what I’m currently doing after about a week of messing with the library. My main project is a new bittorrent client, based on libtorrent, and thats not in a usable state yet so I won’t be releasing it til it’s reasonably feature complete :) But, stay tuned. (yes, I know, there are a lot of torrent clients, but it was a good project to work on to learn).

Leave a Comment

Apple to offer all-you-can-eat iTunes store?

I was remarking to a friend the other night that the media industry needs to move to a subscription model if they want to survive.

Ars has posted an interesting article about such a possibility. Go read it.

Leave a Comment

Firefox 3 b4 Doesn’t Suck

I’ve been tracking the Minefield build of Firefox 3 for the past few months. As each beta would come out, I’d download it, try it for a few days and then go back to Safari. Main reasons?

  • The native controls work wasn’t finished, and it looked like a frankenstein monster. (Not that I have anything against the Monster, he actually had a heart of gold, and it’s a bit of a stereotype, but there you go.)
  • It was buggy/slow/crashed a lot.
  • It chewed up too much memory.
  • It was ugly. Yeah ok, repeat of the first one, but you know. Now look at it:

firefox 3 b4 screenshot

Not only does it LOOK good, but it also works like a native app now; controls are snappy, they work just like normal aqua controls (because they are?) and all of the performance issues are pretty much gone. The whole browser used to block when clicking on a new link that took a while to respond, now its under a second and you can be doing stuff while it loads pages in the background. Yeah I know, not groundbreaking, but it was annoying that this bug has persisted in FF2 for so long.

Digg pages still never complete though, not sure what that is from, it doesn’t do it on any other browser, but I’ll blame Digg for now because usually it’s their fault, right? :)

Memory wise, it is still a bit of a hog. I’ve only been running it for the past hour or so and its already at 320MB. Thats 10% of my ram, guys. I know you’ve been working on that but it still needs work. Just linking in a new malloc() library isn’t enough here, methinks.

So the 2 remaining things for me is:

  • Memory usage
  • Digg never finishes loading

As it is I think I’ll be switching to beta 4 as my primary browser on my mac from now on.

Comments (1)

The Law of System Maintenance Neglect

While working on a dying solaris 8 box that probably hasn’t had a decent amount of maintenance done to it in, ooh, maybe 6 years, it occurred to me that in most companies you’ll generally find that the oldest, shittiest, cruftiest box also happens to be the companies most critical important machine.

In fact usually you’ll find that the machine is SO important that its never rebooted for fear that it’ll not come back again and the company will have to, oh, I don’t know, make do for half an hour while you fix things.

So I’ve formulated the following law:

The quality of maintenance that a computer system receives is inversely proportional to the importance of that computer system.

This explains why all internal systems that are critical to daily operation of a company suck. They’re just too critical to maintain properly.

Leave a Comment

A major milestone

I know I keep going on and on about my diet, but I really must record this for posterity. Today, I reached the under 120kg milestone:

The Hacker's Diet Online

This is huge for me; this brings me back to about 5 years ago weight wise. I’ll be working just as hard over the next 5-6 months and try to get another 40kg off. If I keep up the current rate I’ll be at my goal of 85-90kg at around that time. Which I really need to do.

Curiously, I found some shirts that had been feeling a bit tight earlier this year fit me easily, so its not just being lost around my waist, but also some is coming off Paunchzilla! I is happy about that.

And I also forgot to mention that I’ve been working at Telstra for over a year now. I quite like the challenges offered by this place, it can be quite frustrating sometimes, but ultimately it’s a great place to work, at least from a technical growth perspective.

Leave a Comment

I climb Everest every day.

There have been a few posts on Digg which depressed me of late, regarding obese people and methods used to lose weight. The most depressing sentiments I read were the following:

if you cant have the restraint to eat healthy and exercise doesnt that say a lot about the kind of person you are

and:

… Just watch the way obese people are treated. Being obese simply shows a lack of respect for yourself or simply the inability to take good care of yourself.

and here’s a doozy:

you people are seriously all that is wrong with America. I am pretty sure everything from our high crime rate to unnecessary wars to westboro baptist church is because of gluttonous “people” such as yourself. If you want to eat like a cow you should be treated as a cow and be put onto farms, fattened up, and executed for the feeding of normal people.

This guy almost hits on the right thing:

Bullshit. People abuse themselves in a wide variety of ways. Being fat is the result of one of them, the most visible result. So because you are skinny you are the picture of restraint and self-respect? That is the most ridiculous crap I’ve ever heard. It is stupid to claim that lack of self-discipline in one part of your life means that you completely lack self-discipline altogether. All you really mean is that you find obesity repulsive, but you don’t want to seem shallow, so you claim being fat is somehow a litmus test of character. Just man up and admit you find fat people ugly or gross. Fat IS not pretty. There is no reason to pretend it is. But stop trying to justify your revulsion with ridiculous (and unfounded) assertions.

This whole thread angered and depressed me, for a few days. As someone who has struggled with weight problems their entire life, I get pretty angry with people who dismiss the efforts that people like me need to go through to lose weight.

Lets get something straight; I don’t enjoy being overweight. It comes with a whole bunch of negatives, some of which are obvious, others which are less so. The most obvious one is the health aspects; if you’re overweight or obese you have a higher chance of dying earlier from weight related complications. Not cool. Some of the other issues are personal and aren’t something you talk about on a blog. Then there is just the whole walking around thing. I was nearly 140kg at christmas, and standing or walking for more than 100-200 meters was a huge effort, and incredibly painful. I knew I was overweight, and I knew my eating habits were killing me by inches, but I enjoyed what I was eating more than the threat of an early death or a pain filled life.

And really thats the problem; good tasting food … tastes GOOD. It can make you forget all of your weight problems, and while you’re sitting there eating you really don’t care that your ankles are swollen from the walk to the restaurant. And for someone like me, who loves food, all foods from so many cultures, the idea that I’d need to give up eating good, filling, tasty meal every day for breakfast, lunch and dinner, is unthinkable.

Now, I’m on a diet. I’m exercising. And it’s hard. I eat a piece of fruit for breakfast and another piece of fruit for lunch and I drink 2 liters of water during the day to suppress my appetite. I walk home - climbing Everest - the 6km from my office. My wife prepares me something small - delicious to be sure, but not filling for me - and I eat it. I drink more water. My body aches constantly from hunger and from the pain it feels from being pushed to walk home every day, and walking through Newtown (a popular restaurant district) on the way home is a huge test of willpower.

Have I solved my problems? Will I have solved them if I manage to bring my weight down to a reasonable level (the goal is 85kg) in 4 months time? I don’t think so. I think it will require constant vigilance and a level of self control that is immense, every day, for the rest of my life. I enjoy food, and that will never change. I will need to eat less, and deal with my stomach always telling me I need more.

It angers me when a skinny ‘nutritionist’ or some skinny asshat posts on some site somewhere that its just a lack of control, that if we tried a little harder, it would be easy for us all to lose weight.

Bullshit. The amount of control I’m exercising to keep this going feels like climbing Everest every day. I don’t care how much self control you think you have; if you’re thin, chances are that your self control had nothing to do with it but rather your metabolism and body chemistry conspire in such a way as to make it easy for you to not gain weight. If you have a big meal the night before, you probably don’t feel hungry the next day, whereas I’ll feel hungry 2 hours after a big meal.

If you’ve never been overweight, please refrain from having an opinion. You just don’t know what it’s like, either to be overweight with all that entails, or to try and lose it once you’ve there. You’re just not qualified. You might have some numbers to look at, but you don’t understand the human part of the equation. The effort that is required, the mindset that is required to make the change, to take the steps to lose weight.

I know one thing for sure; I wouldn’t be able to do it without my wife encouraging me every day. Coming home to her every day is the best part of the day.

Leave a Comment

Ace Combat 6

Bought Ace Combat 6 on the weekend, a fun arcade style jet simulator shooter.

ace-combat-6-screenshot

Incredibly fun. The missions are hard without being TOO hard, though I am currently stuck at a mission where you need to fly through tunnels (er, what?!).

Leave a Comment