A Year Ago

About a year ago I was diagnosed with Asperger Syndrom and ADHD. Since I feel I’ve been able to figure out a few things since then, I’ll try to write about it here.

Now, if I were to write about cars, I wouldn’t need much explanation – just dive right into the cc:s, mph:s and so on so forth (disclaimer: I know almost nothing about cars, owned one the first year after I got my license, live in a part of my country with lots of commuter traffic, so haven’t missed a car since then…)

On the other hand, if this blog was about … let’s say Data Mining… I would have to explain what “Data Mining” was a bit before talking about it… but I would be able to do that, with a few well-phrased sentences…

However, when it comes to Asperger (ADHD isn’t that much of a problem in this respect) it’s not always that easy to explain it or generalize about it. What I’ve been able to figure out is that people with Asperger have it in different degrees, and when it comes to people like me, with a double diagnose (it turns out it’s not that uncommon to have both Asperger and ADHD or ADD) just separating the two becomes a chore.

I think the most important thing to think about when discussing Asperger is that it is a disorder on the autism spectrum. I interpret that rather literary. Just as it’s hard to tell exactly when red becomes orange or orange becomes yellow on the color spectrum, it’s hard to separate different symptoms of Asperger/Autism. They bleed into each other, making it problematic/impossible to separate one from the other.

In practical terms, this means one Aspie might be completely different from another. I’ve heard comments such as “…do you have Asperger? I know people with Asperger and you’re not at all like them…” – so, yeah… we Aspies are really individualistic! 🙂

I’ve added a few links on Asperger and ADHD below. I’ll talk about these two neurological disabilities (but I’m pretty sure I’ll be unable to tell which one of them is in play – if not both – in some cases) from my unique perspective, how I experience them, what I do to deal with them, etc etc. Hopefully I’ll be able to contribute to someone! 😀

The home page of Tony Attwood, one of the authorities on Asperger: http://www.tonyattwood.com.au

This is a fairly long article on Asperger Syndrome (however, I needed to ax some of the ads in order to “survive” the read — Firefox + Ad Block Plus rocks!): http://www.emedicinehealth.com/asperger_syndrome/article_em.htm

Here’s yet another link on Asperger (http://www.mayoclinic.com/health/aspergers-syndrome/DS00551)…

And here’s a Wikipedia article on ADHD (I’m not sure about Wikipedia’s treatment on Asperger yet…): http://en.wikipedia.org/wiki/Attention-deficit_hyperactivity_disorder

Happy 09-09-09 09:09

Summer is nearing its end, autumn leafs are everywhere, yellow, red and brown… unless you’re in australia… eh or by the equator?

Regardless, this is kind of a hoax since I’m writing this in March.  But still, I’ve discovered the timed post, and so, this hour being very special I’ve decided to take advantage of that.

So happy ninth of the ninth of the ninth of….  well you get the gist of it…

Is Java pass-by-value or pass-by-reference?

The question if Java passes parameters by value or by reference seems to be one of the things newcomers to the Java language stumble upon quite often.

In general the answer is simple: Java is always pass-by-value.

What does this mean?

Pass-by-value means that you get a copy of the passed in object to work with, as opposed to a reference to it.

Let’s exemplify.  Assume we have a method that manipulates a List object:

public void updateList(List list) {
    ..;
}

Now, assume we’d like to replace the passed-in list with another list we’ve created inside the method.  We might like to do something like:

public void updateList(List list) {
    List myList = new ArrayList();
    // add objects to myList
    list = myList; // replace list with my new list? *WRONG*
}

However, if we test this new method we’ll find list has not changed at all.

This is because list is a copy of the object we passed-in to the method, and not the passed-in object itself.  list has been passed-by-value!

So, are we unable to change variables that are passed-in to a method in Java?  Can we only change them by returning a new object?

No.

And this is where the confusion sets in, because while we’re unable to replace the passed-in object list with another object, we’re perfectly allowed to manipulate it’s member objects.

Basically this means if we want to replace a passed-in list with our own list we must do:

public void updateList(List list) {
    List myList = new ArrayList();
    // add objects to myList
    list.clear(); // empty passed-in list
    list.addAll(myList); // replace passed-in list with my new list!
}

Since we never try to replace list itself, the whole method works just fine and does what we expect.

Black pointer: Never lose track of your mouse pointer again

I’ve tried several ways to keep track of my mouse pointer.  It’s kind of hard from time to time.  Adding more than one monitor does not help at all!

Recently a colleague gave me the tip to make the mouse pointer black… and larger. I tried this and found that the mouse pointer was much easier to spot.  No surprise there, really.  After all, white on white tends to become a bit hard to keep track of, tiny silhouette outline or not.

I was told how to do this in Windows (Control Panel > Mouse > Pointer, but that’s another story).

In Gnome (I’m running Ubuntu 8.10) you do it in the System > Preferences > Appearance dialog (see below).  In my version of Window’s there’s no settings under Appearance > Mouse.

Appearance Preferences

Next you click the “Customize” button:

Customize Theme

In the new dialog select the “Pointer”-tab and select the color of pointer you want.  In order to resize it, see the “size slider” below the list of pointers (there seems to be three distinct sizes to choose from).

Click “Close” once you’re done, and voila, you have a new and much easier to spot mouse pointer!

Sun Tzu’s Art of War – Agile…

A quote from the Art of War that might have some baring on Agile development techniques:

31. Water shapes its course according to the nature
of the ground over which it flows; the soldier works
out his victory in relation to the foe whom he is facing.

32. Therefore, just as water retains no constant shape,
so in warfare there are no constant conditions.

But then again, we all know war is agile, right?

Or another quote I heard (source unknown, original language Swedish):

Meeting all requirements in programming is like walking on water.  It’s easy if the water and the requirements are frozen…

Random thought: Extreme situations

One of the more deadly things you can do is to act normally in an extreme situation.

This goes for extreme weather situations, being taken hostage, living on a planet that may be dying, etc.  etc.  Basically, I believe panic will make you react in a predefined way while keeping your cool will make you react according to the situation.  A few times panic might save you (running from a violent person instead of trying to talk sense to them) while in most cases not panicking will probably get the best result.

Interesting thought: aren’t we presented with “extreme” situations now and then, and once we’ve managed through them, they’re not extreme anymore.  Take for instance, first day at school, first love, first day as a parent, first day of retirement, or being a victim of a crime, being in a car accident, or other accident, being falsely accused, getting fired and being unemployed, etc. etc, there are a bus load of extreme situations out there.

So, the thing is to keep from getting pissed at  your boss for firing you, and trying to get a good letter of recommendation out of it (after all, who say’s you’re getting kicked cause your boss dislikes you?)  Or to stop being a kid yourself once your little ones are on their way, or to get out of that car wreck, and try to get everyone else in it along, before something worse than a roll and a spin happens.

So, it’s all about controlling panic then… or?  Hmmm…

Humans

Humans are in fact not that different to other species. We make a little bit more complex sounds and our territorial behavior is a bit more involved, but to say we’re the crown of creation is rather self-involved. The most that can be said about mankind’s standing in the family of species is that we’re the black sheep, or the obnoxious kid sibling everybody has to put up with, or mom and pop will give them a hairy eyeball.

Random thought: Windows disproves Darwinism

Microsoft Windows is the unique case that disproves Darwin’s theories of natural evolution and survival of the fittest while at the same time supplying no support for the main theory opposing Darwinism, the so called Intelligent Design Theory.  It is obvious the existence of a system such as Microsoft Windows is the work of a deity.  In this case an inherently chaotic and evil one; we usually refer to it as the Devil.

Mmm… wonder if I may be able to do a thesis on that, just wonder if it should be in the religion or computer science department… 😀

CHARVA: A Java Windowing Toolkit for Text Terminals

Looking around for an easy way to create applications with text GUIs for running over SSH terminals I came across CHARVA. CHARVA’s API copies Swings, it unfortunately is not built on top of Swing but is a copy of Swing. This forces implementers to import classes in the charva.awt and charvax.swing packages instead of traditional awt and swing classes. However, the result is rather nice, at least if you’re looking to run applications off a server on a simple Point-of-Sale or Point-of-Service (POS) terminal that may not even support graphics.

In my case I’m looking into making a simple app that I can use to keep track of passwords, both when I’m at home (regular swing) and when I’m away (at work or similar) and only able to access the application via SSH (CHARVA).

For more info, check out CHARVA here: http://www.pitman.co.za/projects/charva/index.html