Wednesday 25 May 2011

Two Apocalypses Down, One To Go

The forecasts for the beginning of this century were quite ominous. Firstly the Y2K bug, then the Rapture, and then the End of the World.

Does anyone know what the Y2K bug actually was? Basically, computers were not future proofed and so only stored 2 numbers of the year, so 91 or 99, and simply prefixed 19 whenever asked. So the thought was that when the clocks ticked over to the year 2000, all computers what see the time as 1900, but wait, computers weren't around then! And so the computer would have a melt-down, or explode, or attack humanity.


Microsoft actually released a patch to prevent this apocalypse so luckily we were all saved. It must also be noted that a 32 bit date system used in Unix systems will have the same effect as returning to epoc time, but that is due to happen 2038.

The most recent apocalypse happened 21st May 2011, at 6pm EDT. Missed that one? Me too. A large community of the Christian faith believed that the second coming of Jesus would occour that day. Apocalypse 2011 it seemed, was a slight miscalculation. So how did this date even come about?
Wikipedia has this to say:

In 1970, Camping dated the Great Flood to 4990 BC.[26] Using this date, taking the statement in Genesis 7:4 ("Seven days from now I will send rain on the earth") to be a prediction of the end of the world, and combining it with 2 Peter 3:8 ("With the Lord a day is like a thousand years, and a thousand years are like a day"), Camping concluded that the end of the world would occur in 2011, 7000 years from 4990 BC.[8] Camping takes the 17th day of the second month mentioned in Genesis 7:11 to be May 21, and hence predicts the rapture to occur on this date.

Sounds like reason enough for me, but nothing happened, so what now?

On May 23, 2011, Harold Camping stated that May 21 had been a "spiritual" Judgment Day and that the Rapture will occur on October 21, 2011, together with the destruction of the world.[22]

So we are still awaiting the death and destruction all of man kind. Fan-fucking-tastic.


Next up, if we survive the physical rapture, is the Mayan worlds end prediction. These have been justified using mostly astrological alignments and the end of a calender created thousands of years ago.


Since this theory took off there have been numerous different theories on what will cause the end of the world. None of which have any real credit to them, as far as I am aware.

So that's my rant.
I posted a message on the  Apocalypse 2011 website and am hoping that it makes it past the moderation. I doubt it. Though I did leave a link to my blog and so if anyone has ended up here from there, feel free to leave a message. I will only remove content if the post is excessively vulgar, but it will still show that a post was made.

Cheers,
Milk

Sunday 15 May 2011

CAPS versus lowercase

In my Human Computer Interaction course we learnt something I thought was pretty cool.

THIS SENTENCE WILL TAKE YOU A LOT LONGER TO READ THEN

one is that entirely lower case, with the same word count.

Interesting ay?
So you will have entirely upper case to either grab attention and make people thing about what they are reading or to make people get annoyed and not read any of it.
Now have a think about where things are entirely upper case and entirely lower case.

Do you ever read these? Me neither.

They don't want you knowing what is in your food.

Those are the most noticable ones.
I also laughed at this.



Oh and am getting computer today hopefully. Will post update when I get it running.

Cheers,
Milk

Saturday 14 May 2011

New Computer for a New Game

Situation:
That's right I'm upgrading again. Last upgrade was my phone to an Android. This upgrade is from my old cheap ass (2 year old) Acer here, to I don't know yet... Also all prices in NZD.

By the way if you ever want to know how much something is in your monies go here. Fantastic.

Thoughts:
My thought process has been something along the lines of 'I'm going to start playing Starcraft II. To do this, I need a computer that can run it.' My current cracked version kills the computer. Also note I will buy the game. Support were credit is due. 'No space for a desktop. Better get a new laptop.' Have a couple friends who play religiously and I like RTS games so should be fun. Hopefully I can get the girlfriend into it as well.


Requirements:
I like Acer so am getting another one. But I'm not too fussy.
Must have a num pad.
Preferably more then  USB ports.
Preferably an SD card reader as well.
Current hard drive is 260Gb or something pathetic which I kept at max 10Gb free. Which is terrible for torrents and software engineering social circles. So anything over 500Gb is acceptable.
I also need a fast processor. Current is 2.1GHz which is fine. But faster is always better.
Need a dedicated graphics card. Current card is a 256Mb integrated death warrant.
And it must be cheap.

Luckily I can get $1000.00 from the government to assist my 'learning'.
Starcraft II = Software = New laptop plox?

So I'll looking to spend roughly $1500.00. Shouldn't be too difficult.
Don't mind upgrading the RAM myself but considering the other specs I'm looking for I'm not expecting the laptop to have less then 4Gb RAM standard.


tl;dr: I'm getting a new laptop so I can play Starcraft II. Awesome.


Let me know if you play or have a decent laptop suggestion.
Sorry there were no funnies in this post. It makes me sad too.

Cheers,
Milk

Wednesday 11 May 2011

Myers-Briggs Personality Types

For those of you that haven't heard about this STOP. Go here, and do the test.

It's basically a personality test. Created around World War II. Takes into account you both rational and irrational functions. You are either: extroverted or introverted, sensing or intuitive, thinking or feeling, judgemental or perceptive.

I'm INTJ. That rare 1% of people. The researcher Cool. Makes sense as I am a software engineer. Thought I'd have something more to say about this but I really don't. Lol. Most of these kinds of tests are vague enough to work for everyone but this seems pretty legit.

Girlfriend is the complete opposite, ESFP. The performer. It's pretty accurate. She's pretty awesome. According to the tests and things we are completely incompatible. That made me laugh, because we are the bestest most happiest couple everer :)

 Use this diagram to figure out what it means. Let me know what you are. Good for a laugh if anything.

For more information go here and do this test.
http://www.teamtechnology.co.uk/report/online/

For lols go here.
http://www.xeromag.com/fun/personality.html

Sunday 8 May 2011

How To Kill A Computer

Here is a couple things everyone should know how to do from the command line.

To get the command line, click on the start button, then in the search bar type cmd and press enter.


To change the location.
Command: cd path
e.g.: cd C:\Windows\system32

Change your password without knowing the old one.
Location: C:\Windows\system32
Command is: net user user_name new_password
e.g.: net user Milk Password01

Only catch is you have to already be logged in. Good to change a friends password if they leave their computer on. Would be lols.

Format hard drive.
Warning: Don't run this!!!
Location: anywhere in any drive
Command: del drive *.* /s /q
e.g.: del C:\ *.* /s /q



This silently deletes every file in every folder on your directory without asking "Are you sure?"
Pretty dangerous couple of characters.

Works great if you are on a flash drive. Deletes all the hidden files and meta-data as well. So it is very efficient.

Get your IP address.
Location: anywhere
Command: ipconfig



Gives you a whole bunch of information, very handy for LANs and setting up your minecraft server.

Print a tree.
Location: anywhere
Command: tree



Lost a folder? Set the location to a starting point and use the tree command. This prints out everything in the folder and folders below that, so that you can find something. It's fantastic.

These are only a couple cool looking things you can use in command line. They are only a very small part of what you can do. But this should be enough to impress your friends. Everyone knows that command line pulls the chicks.

Friday 6 May 2011

C Four, miGame, Part 5

So I was getting a bit frustrated at this AI, I made that I could beat every time... Had a look online at the solution Wikipedia was talking about. This. Shat my pants looking at the amount of information this things goes through. Some guy actually spend 40,000 hours calculating all the possible positions on the board and creating a txt file that holds all these and the transitions between them.

This is tl;dr.

4,531,985,219,092 different possible combinations of moves. That's quite a lot.

So this project seems to be a bit beyond what I was looking to do... I have a pretty average working AI now though. Wont release it just yet though. [Stop timer 201105061934]. Might work on this again later.

Random unrelated image:

I got a job making a website, which is great for University as I need work hours to graduate, but terrible for the guy who hired me because I have NO experience in html or css or php. Should be fun. Will have a play with this blogs design as well. I do quite like it how it is though. We will see.

Will end up something like this:

C Four, miGame, Part 4

Problem Encountered!!!



Something is wrong with the way I am calculating the 'best move'. My plan was to have every winning option score a number of points equal to the number of free spaces on the board.

So let's say it finds a spot where it can win with 3 empty spaces on the board. This spot has a score of 3. In reality the numbers end up much much larger due to the recursion as it finds multiple winning options from the same initial move.



I tried to have an opponent winning make a negative score, as in you don't want to go there. But this ended up with the effect of 'the opponent can win here so I better not block his win'. Stupid...

Tried changing this to increasing the number but then that doesn't work as well as I had hoped either.

Going to get rid of the how many spaces left option and instead will take into account the number of recursive calls to get to this point. I think I'm going to try put the negative thing back in and then have it decide which to choose based on the number furthest from zero (absolute value).

Also had some trouble with stack overflows so have had to limit the number of recursions. At the moment 7 steps in seems enough. Bear in mind that for every step it create another 7 boards. So this gets quite big quite fast.



tl:dr: I have no idea what I am doing at this point and am trying random things until I get something about right.

C Four, miGame, Part 3

Got back from hospital. Turns out the stone was 8mm. But had it blasted and feeling fine now.

I have little to no memory of how to make a C program. Lol...



Because I am using my old code this is going to be a very very poor example of good programming. I've noticed so so many little tweeks I could make. Blarg I haven't even started and I'm disliking C again... Such a tedious language. Luckily the two methods I'm going to use from the old program are set up well enough that I won't need to change anything.



First step: Create a new file for AI code.
From what I can find anywhere it is the same as in Java. Just do it. Examples didn't have 'include' or some other way for it to tell what file it is coming from so that makes things a bit easier. Except every method



Second Step: Allow AI's in the program.
I'm sure there is a much better way to do this but I'm going to hard code in an array of size two with either an h or a c to determine if the player is computer or human. Then add a check in the main loop and if it is a 'c' then call the computer MakeMove method.



Crap it's taken me 30 minutes to get the compiler to work again... Completely forgot everything. Now that I that done I can actually write some code. Woo!



Third Step: Write some code.
Create the AI using recursion to find the best possible move and go there. This is the fun part. Each time the computer is to make a move it will create a copy of the board and make it choose the first column then make the opponent go in the first column and so on and so forth until that column is full, then it moves to the next column and alternatively fills that. As soon as a win is detected the number of empty spaces on the board is the amount of points that win is worth. Then it starts again but places the its first move in the second column and then opponent in the first and it in the first. And so on and so on. This sounds like terrible way to do this. But computers are fast.To those that do program I'm going to be using recursion and so this SHOULD involve minimal code on my part. Which is the plan.

Going to start this now. [Start timer] 201105061147
[Pause timer] 201105061316
[Back again] 201105061650

Wednesday 4 May 2011

C Four, miGame, Part 2

I've noticed a lot of searches hitting my blog with my C Four program I made, here. So I'm going to go into a bit of depth about the game now. A lot of the searches say 'Program that proves Connect 4 is a draw'. This got me curious.


Wikipedia says "The game was solved mathematically by James D. Allen (Oct 1, 1988), and independently by Victor Allis (Oct 16, 1988). With perfect play, the first player can force a win by starting in the middle column. By starting in the two adjacent columns, the first player allows the second player to reach a draw; by starting with the four outer columns, the first player allows the second player to force a win."
It also has a couple links to freeware you can download that plays the perfect game. But I'd rather solve it myself.

Lulz


Initial thoughts: So we know the concept, get four in a row either diagonally, horizontally or vertically. The board is 7 long and 6 high. This means that we must use the middle column to get a diagonal or horizontal win. Also a diagonal or vertical win needs the two middle rows. As the board is filled row by row, it become immediately clear that middle board dominance is essential.

More lulz


Could do: I know how to model turn based games on a graph with nodes representing game state and then use logic to determine from what states a player can force a win. But that's boring and very time consuming to do by hand. See xkcd has done this for tic-tac-toe.

Will do: So what I'm going to do instead is alter my old version of C Four (get it? Connect Four but it's written in C so I called it C Four...) and create an AI that uses a depth first recursive search to find the optimum position for the next piece. I could have it build a graph at run time and then traverse the graph with each move made but computers are fast enough to handle what I'm trying to achieve here.
Basic: Make a program that looks at every possible move and picks the best one. 


What I will need:
Time. I'm back from University holidays and my memory is terrible so will have to go back and learn C.
Visual Studio or something similar to develop in. I'm posting at work so will download this to my flash drive and play with the idea from there.
Money. Not for this project but it's always good to have money, am I right?

Even more lulz


Akin to my original C Four program the game is going to be in ASCII. If I am able I will keep C Four as it is and simply add the option to verse a computer player or even watch a computer player verse another computer player. This is where the money is at.

[Connect Flour image. Sorry I lost this one. But it is funny]

If it works correctly we should see the two computer players play the exact same game every time. And hopefully player 1 will always win. That would be pretty cool.

I'm going back into hospital tomorrow for my kidney stones again, but workload from University has lessened so will work on it in my downtime.

Cheers,