Craig Mattson (Personal Website)
Home - Blog, News, About MePrograms - C#.Net, Java, VB6MusicWebsites

My Blog

The number 67,137,648 (17/06/2007 11:31:41 AM)
67,137,648... is the same number in MB that the *nix UFS (Unix File System) can store EXTRA over the Windows NTFS (the one used in Windows XP) per file. Wow... that's like 67.13 Terabyte HDD's :)

[0 Comment(s)]


Java != Javascript (15/06/2007 11:11:04 AM)
Once again, a complete moron who is supposedly a Web Designer AND Java programmer believes that Javascript is not only made by Sun Microsystems and is a derivitave of Java, but also believes that the Java framework must be installed for Javascript to execute. So here is a little image for that person who I know does not read this webpage. (Tough if they do :P)
 
grhhhh_591

[5 Comment(s)]


Hospital Tycoon (15/06/2007 03:59:47 AM)

Hi All,

Today I for the first time loaded up Hospital Tycoon after working out why the hell it wouldn't run on my laptop - it turns out that it defaulted to high quality, 1024x768 on a not-up-to-scratch system. So, I got the game running only to be greated by the worst music imaginable - Bus Driver has much better music (even if it was made using FL Studio hehe). Anyway, I have never been a fan of any 'Tycoon' badged game (yes thats right, I didn't even like Rollercoaster Tycoon, Railroad Tycoon, Monopoly Tycoon, Transport Tycoon, Realestate Tycoon, even School Tycoon was a disapointment) so I wondered if this game was any different.

The main reason I do not like 'Tycoon' games is because they seem to require too much effort to do anything useful... I certainly found that with most of them I have played anyway - but is Hospital Tycoon any different? Well, coming from the Theme Hospital world, this game is nothing more than a rip off combined with the relationship management (probably better done in Hospital Tycoon though) from The Sims 2. After getting passed the crappy music, it was time to load the game up - and what the? The first 'mission' starts up as an introduction to some fubared American drama - it introduces your staff :S and they Talk! (which would have been OK if they didn't directly rip off the sims here - that garbled talk does not impress me).

Anyway, once I got passed this stage of the intro video (this is 10 minutes into the game by the way - given the stupendous load time on my laptop), it was time to play. Now, Theme Hospital made it easy - I remember the first time I played Theme Hospital as per how easy it was to build a room (that being build a building, place an object, build a desk, hire some staff with flashing queues) and Hospital Tycoon atleast had this element so that it was easy to work out where to start. The only problem here is that the 'helpful' doctor in Theme Hospital is replaced by a 'Teenager souding' Receptionist who talks just like a real Sim. You would have no idea how much hearing a high pitched sim voice really annoys me. Even in todays age, the characters can't speak! The queues in Theme Hospital "Doctor Requirity GP's Office" are helpful - the "meningbla gibulabla compnrenre" means diddly squat to me. Instead of building specialised rooms like Theme Hospital, you get to build pre-defined sizes (which is disapointing - I wanted a whole plot to be a Ward Frown) and put your items in there - which I suppose has it's advantages - instead of deleting a room, you can simply replace items in the room to make it a new one. Another great thing I found was the ability to put bin's ANYWHERE in the hospital.

So, a patient sees the reception desk as normal and goes to the 'Examination Room' where a Nurse sees the patient and takes her into the doctors office - in there, they are Examined (could you believe) for their illness and once done a POKEMON card came up called a Curedex (Pokedex???)! Whilst this is a great idea - it can be annoying that I have to click a Computer to find this card whereas Theme Hospital would just pop up a little icon to click (a green box with a ? or ! to be precise).

I suppose I'm just a bit disappointed in the whole game - it's not fun, it's quite boring infact. I couldn't get myself to play it anymore than the first Scene. There is just nothing fun in listening to some sim bitch for ages and have a hospital already built for me (that seems to be what the rest of the scenes are) and all I have to do is run and modify. I know there is a sandbox mode that may be a bit of fun - but really... there is alot of garbage in there to do anything.... A true Tycoon game hehe...

Before anyone says play it as Hospital Tycoon and Theme Hospital... Well, there was only one way to play it and I have been looking forward to this game for ages. It's a downright disappointment - no skill required, shitty music, an unhelpful doctor that tells me how to play the game speaking in a high pitched voice and relationships between stupid doctors and nurses is just unnecessary in a simulation designed to build a hospital. I suppose I should have seen it coming with School Tycoon ;)

I'll play it some more ofcourse before I give it my final verdict - but yeah... off to play Theme Hospital for a while ;)

Orb!ter

UPDATE: Zer0 from Drouin updated me on the latest disaster with Public Transport. V/Nacho's!!!! are no longer for sale... infact they have been BANNED!!!!!!!!

[0 Comment(s)]


Sun Microsystems - how long until death? (14/06/2007 10:46:13 AM)

Hi all,

I don't know how many of you keep up with the exactly 6 years older than me, Sun Microsystems, but has anyone noticed the impending doom on Sun Microsystems? The once king-pin in both servers, desktops, operating systems and entire business consultancy is just going down the gurgler so-to-speak. What makes me say this? Well - has Sun Microsystems done anything major lately that will have increased their marketshare and profits?

Originally Sun created a version of Unix known today as Solaris which was their primary product, yet not that long ago, Sun Microsystems made Java an Open (Closed?) Source framework - why? Well, they claim it was a great move for Java to go down that path with little-to-no emphasis on why now, and not before. One of their greater achievements was purchasing the German made StarOffice. Star Office seems to have disappeared off the face of the planet with OpenOffice still in production (frankly, OpenOffice still needs alot of work before I would 100% switch to it... for starters - develop it in something OTHER than Java ;)), yet StarOffice which was a commercial product is being replaced by an Open Source productivity suite?

There's no point me reposting this recent action here with attempting to join OpenSolaris with the Linux community, but if you do read it - does anyone else believe with me that Sun Microsystems may be grasping at more straws trying to work something out to keep them out of the red?

I can honestly see within the next 5 to 10 years SUN Microsystems completely gone - a memory if you will given there seems to be no innovation from the company. As I said before - Sun seems to be about making it's projects Open... OpenSolaris, OpenOffice, OpenJava... they all use the GPL License now :)

It's just a theory - be interested to see other peoples thoughts on the matter. 

[0 Comment(s)]


Why projects fail? (13/06/2007 02:52:54 AM)
Why do projects fail?

I know this is an old topic now, but I came across it during revision and I must admit - how bloody true it is in the real world.

What the user wanted:

what_wanted_120

What the budget allowed for:

what_budget_120 

What the timescale allowed for:

what_pf_120

What the technician designed for:

rocket_jet_120

What the user finally got:

wheelbarrow7676_120 

[1 Comment(s)]


Why oh why? (12/06/2007 08:32:41 AM)

It has intrigued me as to why by default the two leading productivity packages, OpenOffice.org and Microsoft Office, set their paper size to Letter when clearly all printers by default are set to A4. I mean seriously - who goes and buys a realm of 500 sheets of Letter sized paper (letter sized paper has a slightly shorter length)? It is pretty poor that neither software productivity packages or printers can agree on one default paper size.

My guess is that software developers should make A4 by default ;) I mean - how many letters have you written versus other documents requiring A4 size. Also, when you write a letter, did you buy special letter sized paper to print it out?

[1 Comment(s)]


Using methods within methods and String manipulation (09/06/2007 12:40:06 AM)

For those of you who are studying Java or Object Orientation Programming at University, here is something that may be useful to you. Basically this question came up in sample exam, and I was appauled to see the answer completely incorrect in terms of the lack of depth within the answer and the approach that when compiled, produced the wrong results. Here is the question for those who don't know, and the proper solution for it.

Question: Write a method called soundex to convert a string to a soundex code using the following criterion

  • All characters must be in UPPER CASE
  • Leave the first character in
  • Replace double letters with single
  • Omit the following characters: A, E, I, O, U, W, H, Y
  • and only produce a maximum of 4 characters

This question will no doubt be in the exam (or similar atleast) and even for those not doing the course, it is worth a read to see that it is possible to use mutator methods within methods. Here is my version of the proper, fully commented solutions to the question.

To complete this question, you must be familiar with the following methods;
String.charAt(integer); returns a char for the position requested.
String.toUpperCase(); returns all characters to upper case.
String.indexOf(character); returns an int as per the position in the string (-1 if doesn’t exist).

The code for the solution is below:

public String soundex(String aWord);
{
    //Check if there is a value within aWord
    if(aWord == "" || aWord == NULL)
    {
        //Return an empty string
        return "";
    }

    //Create a message variable to return, and a variable containing chars to eliminate
    String message;
    String toElim = “AEIOUWHY”;

    //Complete condition 1 to convert to lower/upper case
    aWord = aWord.toUpperCase();

    //Complete condition 2 to leave the first letter the same
    message = aWord.charAt(0);

    //Step through each individual character
    for(int i=1; i<aWord.length() && aWord.length() > 1; i++)
    {
        //Complete condition 3 to see if the 2 characters are identical
        if(aWord.charAt(i) == aWord.charAt(i-1))
        {
            //break out of the if...else condition (we don’t want identical letters)
            continue;

        //Complete condition 4 to see if the character appears in toElim
        } else if(toElim.indexOf(aWord.charAt(i)) > -1) {

            //break out of the if...else condition (we don’t want eliminated characters)
            continue;

        } else {

            //Add the letter to the string to return
            message += aWord.charAt(i);

            //Complete condition 5 in checking the length is 4
            if(message.length() == 4)
            {
                //If it does, then return the message
                return message;
            }
        }
    }
    
    //Once the loop has exhausted, return what has currently been set
    return message;

}

You should already be familiar with the commands expressed above, but what you may not be familiar is using methods that return a variable or value within methods.

Let’s assume the following:

String word = “TEST”;

We have the following commands and outputs:

word.charAt(2); //This would return the character ‘S’ as it is in position 2 in the string word.
word.charAt(3); //This would return the character ‘T’ as it is in position 3 in the string word.
word.indexOf(‘E’); //This would return the integer 1 as it is the position of the character ‘E’
word.indexOf(‘F’); //This would return -1 as the letter F does not appear in the string.

You should be familiar with this using integers and characters. One thing you should have learned was the fact that you can also use variables in place of the characters and integers, and thus the following could work:

int pos = 2;
word.charAt(pos); //This would return the character ‘S’ as pos = an integer of 2
char ch = ‘E’;
word.indexOf(ch); //This would return the integer 1 as ch = the character of ‘E’

As you know how to do these, there should be little to worry about dynamic variables such as those in a for loop:

for(int i=0; i<word.length(); i++) //This iterates through the individual letters
{
    word.charAt(i); //This will return what the value is at i.
}

So, you know you can get integer variables of datatype int and char to work in indexOf and charAt respectively, but can we do it with methods that return a value (those being accessor methods)? The answer is yes! So, if we have a look at Question 4.1, we created an alphabet of characters to eliminate. Using the combination of indexOf (which is useful for finding out if a character does exist) and charAt (which is useful for getting a character at a given position (or index) in a string.

Lets step back a bit – we said that indexOf can take the value of a character, and the method charAt returns a character. Therefore, is it possible that finding the index of a character within the alphabet will yield the response we wish to obtain? Again, the answer is yes! charAt returns a ‘char’ which is perfectly acceptable to use within String.indexOf(char). This is where something like the following comes in:

toElim.indexOf(aWord.charAt(2)); //In this case would be the equivalent to toElim(indexOf(‘S’));

Using the word TEST, this will mean that aWord.charAt(2) is the same as ‘S’. Therefore, the indexOf(‘S’) becomes -1 as toElim does not contain the letter S. aWord.charAt(1) on the other hand is the same as ‘E’ which is in the toElim string. indexOf(‘E’) returns the integer 1 which states it is in the first position in the string. By manipulating this theory, we can create a conditional statement to complete criterion 4.

if(toElim.indexOf(aWord.charAt(1)) > -1)
{
    continue;
}

The rest of the code is pretty self explanatory (in terms of position = position – 1 for checking the character before the current character), and checking if there have been 4 characters already.

[0 Comment(s)]


Thin-Clients now in Laptops (07/06/2007 07:55:45 AM)

Hi all,

Thought I would actually post something decent today (apart from the bit of a knock together in Fireworks). I've been working a fair amount this week (had 3 days at work) and almost ready to splash out and get a car - about 11 months after my accident last year. Anyway, something I came across today was the theory of Thin-Clients in Laptop form.

One of the great things about the Microsoft Windows Server 2003 operating system is the Terminal Services module (yes, it does exist in older server versions) and some of the organisations I have set up networks for have also enjoyed this 'freedom' of being able to use on what ever computer they happen to be on, their same desktop set up as they left it as. With many stolen laptops, this theory of thin clients can potentially mean that although a laptop may be stolen, it won't have any important data on it.

I must admit, I'm a bit skeptical about the whole theory given it sounds to me like it's nothing more than a standard laptop without optical drives or hard drives. Whilst the battery life will be phenominal, there is really no point to having a battery life as you kind of need to be seated somewhere to use it :S

I'm sure you guys can come up with some clever points as to the benefits of having a thin client laptops, but right now - I need some sleep :P I've been up the last 3 mornings at 4:30AM and well - sleeping at 11:00PM just isn't doing much for me ;)

Orb!ter 

[1 Comment(s)]


No more V/Nacho's!!! (05/06/2007 04:13:11 AM)
0551314400_350
Caption: No more V/Nacho's

No more V/Nacho's on atleast one more service thankyou to the truck driver who caused this today at 1:40. Just what V/Line needed - more trains down.

On a more serious note, I am forever seated in the BRN car (which is what's pictured above for those who don't know) and well - shit, looks like theres been some damage. I wonder if the train driver yet again steered into the truck?

Edit: On a side note, may I grab your attention to an earlier post I made some 4 months ago about my prediction that 6 months from the launch of Vista (from November when Business was released), Dual Core systems and RAM will be cheap. It seems that these predictions have come true with MSY offering 2048MB of RAM for under $100 and Dual Core processors (Pentium-D) from $115. By the time you build a new system up AND get a legit copy of Microsoft Windows Vista Home Premium OEM for $170, then yeah - for under $1,000 - you will end up with a system more than adequate to power Windows Vista Home Premium - hehe I still think it's a waste :P

[0 Comment(s)]


Programming Concepts Part 2 (02/06/2007 09:22:49 AM)

If you have missed part 1, you can view that by clicking here!

So, this post is a direct follow on from the program that is a Phone Book and hopefully educating some of the viewers some design concepts in creating small portions of code. Back in the previous post, we had implemented a menu, and a Person object. Continuing on from Step 4 which precisely defines what happens during the method, we can now interperate this now into Java syntax. To enter a person to the database, we assumed the following steps:

  1. Enter a users name
  2. Enter a users phone number
  3. Enter a users e-mail address
  4. Store the name
  5. Store the phone number
  6. Store the e-mail address

Lets convert this into Java code step by step:

//We firstly want to display some text for the user for the fields we wish to enter
System.out.println("Enter a Persons Name:");
//Now ask for the data using the keyboard we defined
String un = this.kb.nextLine();
//Ask for the users phone number
System.out.println("Enter a Persons Phone Number:");
//Again, get the data from the user
String ph = this.kb.nextLine();
//Ask for the users e-mail address
System.out.println("Enter a Persons Address");
//Get the input again from the keyboard
String ad = this.kb.nextLine();
//Now, store all the values - there's a number of ways we can approach it
//As we have a constructor class, we may aswell use it:
Person newPerson = new Person(un, ph, ad);

Above is the entire method for adding a user. In the case of adding an array, we simply require a counter (we are not assuming ArrayList here), so basically it works as such:

arrayName[position] = newPerson;
position++;

This method above would (assuming arrayName was already set up for the Person object; Person arrayName[];) simply store into the array of Person objects the new person created. The position incrementing simply says that the next time you add a person, you would store it in a new slot.

I'll post the final method tomorrow which will involve the use of a structured for loop, but right now there is something more important that I feel needs to be expressed:

There is NOTHING stopping you using multiple namespaces! Alot of people seem to be confused and think that it's only possible to use one namespace which is false. You CAN use multiple namespaces. For instance, providing we have say a Person that has a Lesson object and Lesson has a Time object, then there is nothing wrong with using:

Person.Lesson.Time.returnTime();

Or, you may even have methods associated with it to return the Lesson Object, and the Time Object (especially where arrays are used):

Person.getLesson().getTime().returnTime();

This is exactly the same (that is if getLesson returns a Lesson and getTime returns a Time) as the one above it - it does not matter how many you have ;) Just don't get confused.

Anyway, more to come at a later date!

[1 Comment(s)]


[Print View]