Archive for the ‘Hobbies’ Category

Tic-Tac-Toe

Saturday, September 27th, 2008

In the game of tic-tac-toe, a single row has many different possible states. Each cell can either have X, O, or remain blank. It is a trinary number system. The number of unique states in one row is 3 to the power of 3 (3*3*3), or simply 27.

I am looking into this because I am interested in making a game of tic-tac-toe in an environment where image size and count mean everything. The less data that is needed to be transferred, the better. I could create an image for the entire grid, but that would result in 3 to the power of 9 images (19,683 images). I could dumb it down to just 3 images of an X, O, or empty spot, but the format of what is available would require me to use more resources to display 9 separate images at one time. The optimal method to use limited resources is to display 3 rows as 3 separate images.

I could go ahead and create 27 different images to load up in each row. However, the key idea here is the use less data that is needed to be transferred. My take on it is that I’ll use the same image for each row, but only show part of that image. So if I have an image that says “XXOXOXOXX”, and I want to show “XOX”, then I’ll stretch the image and center it on the “XOX” so that all of the other characters are outside of the visible area.

This is good, but I had one last thing to focus on. 27 different images all streamed together would result in an image with 81 characters. Surely their is a lot of repetitive characters? Take my example: “XXOXOXOXX”. You’ll notice that “XOX” is repeated three times, and “OXO” is repeated twice. I could try eye-balling it to cut it down to size, but we have computers for that sort of thing.

I started generating a random string of ” “, X, and O with 81 characters. As soon as I found a string that suited all possabilities that a row would have, I would generate another random string with 1 less character. It took much longer as I tried to generate less characters. I could only get down to 29 characters “O-OOX-O—X-XXX–OXO-XOXXOOO-”. This was very interesting to me because I was starting to see a significant pattern here. 29 is very close to 27, and as I noted earlier, the total number of possible combinations is … 27.

Doing the same for 2^2 is something I could do in my head. Possible combinations are 00, 01, 10, and 11. I came up with 10011. Only off by one (2^2 = 4), but if I wrap the text to repeat itself, I get “1001″ - 4 characters! Note “11″ is “wrapped” with the two ends. Now, with that knowledge in hand, look at the pattern that I had with 29 characters. Notice that the last 2 characters matches the first 2. From here, I can wrap the text around to reduce 2 additional characters resulting in 27! My final pattern was “O-OOX-O—X-XXX–OXO-XOXXOO”.

This reduces the total size of my image by almost 67%. The “wrapping” effect already happens with images in the environment that I work with and is known as “tiling”. If an image does not cover an entire area, the same image is placed next to itself, essentially causing a tiling effect over the whole area.

The next steps are to actually make the image, detect where a person has touched the game, and map the image to reflect the actual state of the game in each row.

At one point, I did try creating a string of values and incrementing them as a trinary number (—, –O, –X, -O-, -OO, -OX), however this actually took a lot of time to do. After letting it run for a couple hours with no results, I abandoned it all together and went for a randomized “fuzzy” approach. Randomly, I was finding different combinations of 29 characters each in about 2 minutes each. The lack of speed may have been because I was dealing with strings rather then an array of numbers. I’ll look into different possabilities next time.

Memory Transfer

Saturday, September 27th, 2008

Last week, I got a network storage system (NAS200). I have since set it up to be RAID 1 with mirroring. During the setup process, it asked if I wanted to enable journaling as well. I had no idea what journaling is and had to look it up. Apparently, journaling lets you do atomic transactions with file writing. If the power goes out or something happens in the middle of a transfer (or deleting a file), you are safe. The file does not fully transfer/delete. This is good because if you have partial data on a disk and the disk is only … partially aware of it, it could end up being overwritten, or simply not show up and not be available for writing over either. Naturally I turned it on.

Backing Up

I’ve been spending a lot of time organizing files on a lot of computers. I’ve been using DiskPie 2 and Sequoia View. Both are free programs, however DiskPie 3 (Pro) does cost a few dollars if you want to go with the latest program. The programs help me visually identify large files on my file system, as well as large directories and file types. Each has their own strengths allowing me to trim many gigabytes from my HDD’s.

After trimming the fat and organizing files, I then face the long backup process. I use a tool that I created for retrieving files from my old 250 GB HDD. It appears that it comes in handing going the other way too. Any time that the program fails, I simply restart it again. It recognizes files that were already transferred and skips over them. Really handy!

Problems Encountered

So the problems I’ve been running into are few. Wireless networks are also pretty slow. However, I use what I have to get the job done. Wireless networks appear to “forget” they are connected to a network. They seem to drop off every now and then. This results in me having to restart the copy process to ensure that all files are transferred. My little tool tells me when their is a problem such as a network path not being found. One computer kept knocking itself off so often that I had to continuously monitor it and check up on it every 15 to 30 minutes. Another computer wouldn’t stay connected at all and I had to physically migrate the thing near my router to connect over the LAN.

Old computers take a lot of time to use the other utilities (DiskPie/Sequoia). One of the older computers only had a 75 GB drive, and at the time of purchase, that was considered excessive. The majority of the drive is full of MP3’s that I ripped from most of my music collection. The tricky part of this is that collection has migrated over to my other computers that I backed up, so I have a lot of duplicate music. That music is mixed in with “protected” music as well, so I hadn’t tried separating the protected music from the original music. In addition, the original music has since been converted to AAC format to take up less space. On top of that, the newer AAC format has additional information such as ratings, completed information about each track, artist album, and album artwork. It took a lot of time to get all of that setup.

Eventually I’ll have to find the duplicated music and consolidate them into one complete library. For now, I’m making separate folders on the NAS to identify what computer that each backup came from.

Some computers contain backups of other computers. These are not simply just “My Documents” and “Desktop” files. I used software programs (such as Norton Ghost) to do full backups of hard drives. Although the computers are no longer operational, I need to find a file reader for those old backups and see if their is anything worth saving.

I’m only halfway through all of this. I’ve backed up seven computers (3 are virtual/non-existing). I have 3 more computers to backup. I then need to reorganize and consolidate those backups. I’ll also need to wipe out the old computers and set them up for “my master plan”.

Master Plan

I primarily want to setup a development environment. I would like to setup the following services: email, MS SQL, MySQL, Oracle, PHP, ASP.Net + Remoting on a second tier, and SVN. Many of the services could be consolidated to run on the same machine. Perhaps all of them. In addition, I would also like to have a dedicated server for OpenSIM.

Making real money in Second Life

Friday, March 9th, 2007

Second Life looks like it is really starting to pay off. After a year of experimenting, playing around, building stuff, and meeting new people, I appear to have an impressive cash flow income. I’ve recently started to sell off my lindens each day. I used to store them all into a ginko bank account, but the interest was getting pretty low that it really wasn’t worth the risk. I pulled my lindens out and sold them all off at once (about 800 US$ worth). Now mind you, I’m still buying lots of junk in-world as well as renting stores, sponsoring classes, and paying for advertising. I’ve made 260.11 US$ since the 23rd of last month. 15 days with an average of 17.34 per day. I believe that I’m getting roughly 500 US$ per month from a game. A GAME!

My success has encouraged my family to start paying a little more attention to this game as well. A few of them have already been playing, but this latest trend of me selling rather then hoarding L$ has really opened there eyes to what this game is capable of.

Well, If you want to see more of what second life is about, I have another blog with lots of pictures almost every day. Or you can just go ahead and sign up for a free account.

Order Id Order Type Quantity Ordered Quantity Filled Limit Rate Time Opened Time Closed Closure Method Gross US$ Net US$
177#### Limit Sell L$1,225 L$1,225 L$266 / US$1.00 2007-03-07 22:50:34 2007-03-08 04:11:54 fill US$4.61 US$4.44
177#### Limit Sell L$4,500 L$4,500 L$266 / US$1.00 2007-03-07 06:20:21 2007-03-07 07:09:45 fill US$16.92 US$16.32
176#### Limit Sell L$1,500 L$1,500 L$266 / US$1.00 2007-03-06 21:54:14 2007-03-07 02:50:31 fill US$5.64 US$5.43
176#### Limit Sell L$5,500 L$5,500 L$266 / US$1.00 2007-03-06 05:55:35 2007-03-06 12:37:33 fill US$20.69 US$19.94
175#### Limit Sell L$1,750 L$1,750 L$266 / US$1.00 2007-03-04 23:24:02 2007-03-05 08:26:55 fill US$6.58 US$6.34
174#### Limit Sell L$1,500 L$1,500 L$266 / US$1.00 2007-03-04 18:08:42 2007-03-05 05:01:15 fill US$5.64 US$5.44
174#### Limit Sell L$3,500 L$3,500 L$266 / US$1.00 2007-03-04 00:22:25 2007-03-04 08:52:15 fill US$13.17 US$12.70
173#### Limit Sell L$4,000 L$4,000 L$266 / US$1.00 2007-03-03 09:28:36 2007-03-03 10:40:48 fill US$15.04 US$14.51
171#### Limit Sell L$2,500 L$2,500 L$266 / US$1.00 2007-03-01 22:26:22 2007-03-02 01:07:24 fill US$9.40 US$9.07
171#### Limit Sell L$7,000 L$7,000 L$266 / US$1.00 2007-03-01 06:11:49 2007-03-01 10:37:43 fill US$26.32 US$25.39
170#### Limit Sell L$1,750 L$1,750 L$266 / US$1.00 2007-02-28 06:29:39 2007-02-28 12:58:07 fill US$6.58 US$6.34
169#### Limit Sell L$3,000 L$3,000 L$266 / US$1.00 2007-02-27 17:16:50 2007-02-27 18:31:10 fill US$11.28 US$10.88
169#### Limit Sell L$2,000 L$2,000 L$266 / US$1.00 2007-02-27 06:21:01 2007-02-27 12:59:58 fill US$7.52 US$7.25
168#### Limit Sell L$3,000 L$3,000 L$266 / US$1.00 2007-02-26 21:12:32 2007-02-27 09:10:51 fill US$11.28 US$10.87
168#### Limit Sell L$2,500 L$2,500 L$266 / US$1.00 2007-02-26 16:14:41 2007-02-27 06:00:14 fill US$9.40 US$9.06
168#### Limit Sell L$1,000 L$1,000 L$266 / US$1.00 2007-02-26 06:25:35 2007-02-26 15:12:17 fill US$3.76 US$3.62
167#### Limit Sell L$6,000 L$6,000 L$266 / US$1.00 2007-02-25 18:11:37 2007-02-26 09:38:19 fill US$22.57 US$21.77
166#### Limit Sell L$1,500 L$1,500 L$266 / US$1.00 2007-02-24 15:26:07 2007-02-24 15:33:11 fill US$5.64 US$5.44
166#### Limit Sell L$9,000 L$9,000 L$266 / US$1.00 2007-02-24 14:27:01 2007-02-24 14:55:17 fill US$33.85 US$32.65
165#### Limit Sell L$2,000 L$2,000 L$266 / US$1.00 2007-02-23 15:09:34 2007-02-23 18:14:34 fill US$7.52 US$7.25
165#### Limit Sell L$7,000 L$7,000 L$266 / US$1.00 2007-02-23 10:49:16 2007-02-23 12:22:31 fill US$26.33 US$25.40
165#### Limit Sell L$220,000 L$220,000 L$266 / US$1.00 2007-02-23 05:24:34 2007-02-23 08:52:25 fill US$827.18 US$798.08

The trouble with iPods

Thursday, December 14th, 2006

I’ve been having probs with my iPod for such a long time now. The white head-phones died out pretty quick. Speakers don’t work in either bud. Click wheel seems not to work, but is easily solved by rebooting the iPods operating system.

I don’t know if it was iTunes via upgrades, or the iPod, but i’ve lost 66% of my music collection some how.

Lately, the iPod has been corrupted. It gives me errors complaining that it can’t write to disk, or that it can’t read. It prompts me to revert back to factory settings. Even then, it has trouble reading and asks me to revert again.

currupted ipod.jpg

I am starting to have doubts about getting another iPod. For the price, it just isn’t worth 1 1/2 years of service. Would you pay 16 $US per month for a device that plays music, but gives you such problems until it finally goes bad? I’m just glad I didn’t pay for the thing to begin with.

On top of all this, a coworker had problems with his click wheel on a different model iPod. Rebooting didn’t help and he ended up getting it replaced free since he had only purchased it a few months before it started happening. He also had the same problems with the ear buds too.

My next addiction

Monday, October 23rd, 2006

Just heard about a game comming out called Spore. Perhaps one of the most ultimate sim games to come out. Check out this spore gameplay video to see what I’m talking about. Here is a spore demonstration video from E3.  Game comes out in about a year.

Brighter Worlds is back

Saturday, October 14th, 2006

I started up brighterworlds.com a few years ago as a place to play around with the hopes of making some kind of web-based game.  Eventually I let it go because I stopped using it.  Today it is back with a like-minded purpose.  I’m going to use the website to support my second life projects.  It’s hosted with ASP.Net 2.0 and an SQL 2005 database.  Angel likes the idea that it is comming back and that it goes well with second life.

Master Database Restoration

Wednesday, September 20th, 2006

I’ve been learning quite a bit lately about restoring databases from a complete database failure.  Although rite now, I’m am working with a test to verify we can restore from one.  I’m not involved in all the steps such as tape restoration, but I am involved in one of the most critical parts.  The restoration of the Master database.

It turns out that you can’t just restore a master database in SQL Servers normal operation mode (multi-user).  I had to start the service in single-user mode from the command line.  From there on out, you can go into enterprise manager and restore the master database.

Why is the master database so important that it needs single-user mode?  Because it contains all the data that the server itself uses for its own operation.  Everything from maintenance plans, other databases in the ssystem, user accounts, etcetera.

Just make sure if you restore a master database, that the version of SQL server is the same that it was backed up from.  This includes having the same service pack installed as well.  SQL Server SP3 master database can not be restored on SQL Server SP4.

Dr Who Season Two

Saturday, September 16th, 2006

I was watching my favorite show on the DVR tonight and saw a commercial for the second season of Dr. Who.  Wow.  I kinda got really excited over that.  I had to pause the tv, jump up and find my wife to tell her the news.  We purchased the first season back in July.  We had ordered it just as the season ended.

The funny thing is, I’ve been hearing bits and pieces of the second season from a podcast I listen to from the UK - DarkCompass.  Today DarkCompass came out with some kind of game called Trumps.  Lost of Dr. Who. stuff today here and there.

Blogging from within Second Life

Wednesday, September 13th, 2006

What do you know.  It seems that I now have a way to blog from within SecondLife.  I created a seperate account for my avatar “Dedric Mauriac” to post to this website.  So be on the lookout for SecondLife information from him for now.

Bean Bag Chairs

Thursday, September 7th, 2006

Bean bag chairs, it seems, are expensive.  Who would have guessed that a new one starts at about $150 US.  It has me wondering how much it would cost to build one from scratch.  It seems I would only save 33% and be left with something small that wasn’t professionally made.  Ugh!