| | Being experienced at programming does not guarantee that you can write Challenge winning Bots, but I decided for once to enter a Challenge. It's the Google AI Challenge I wrote about last week. The Details are below so you can follow my progress and success or failure. So long as it doesn't come last I'll be happy, but a top ten position would be nice! I'll have a very busy week, you have a great one! | | Defragging A Drive Hard Disks store data in concentric circles on a disk. Each circle is called a track and is made up of a number of sectors each holding data in a block of a few Kb in size). As files are usually much bigger than a sector, they are spread across many sectors and sometimes many tracks. Over time, as files are deleted and created, it may not be possible to store a file in consecutive sectors and reading it may take longer as the head has to wait for the other sectors and this can be a rotation or more which is a long time. It's fascinating watching the head move across the disk and a tribute to precision engineering that it can so quickly and precisely move to a specified track. Because the disk read head floats on a microscopic cushion of air that is less than the thickness of a human hair, you don't normally get to see the head moving as its in a case where the air is kept free of impurities, dust etc. Removing the case (as in the disk in this video Hard Disk) means that the disk is doomed to earlier failure though how soon depends on the air quality. More disk reads or writes means slower file I/o and that's when defragmentation software comes in to reorganize the sectors on disk. Windows has a rudimentary defragger but you can get a powerful open source one that does every version of Windows from NT onwards (not 95 or ME). Written in C, UltraDefrag is at version 4.0 and is designed to defrag as fast as possible. It can also move files to optimize for fast disk operations and also defrag during the boot up for those system files and registry that can't be defragged during normal operation. The thought of developing defraggers has always been a bit scary as the potential to mess up a disk seems quite high so congratulations to Dmitri Arkhangelski the author and his team for their work which is GPL licensed. | Kayak C# HTTP Server Kayak is interesting, especially if you're considering writing a game server as I do from time to time. I don't think its a full web server as much as a http server and request handling framework that maps http calls to C# methods with minimal syntax. The whole http model was designed nearly 20 years ago for sending text files to a browser. A full web-server does an awful lot more than Kayak usually through 3rd party modules, think cookies, authentication, JavaScript, and all of the complex http protocol that deals with page caching, expiry etc. Kayak has stripped that all away so you can add your own code from the ground up and build something entirely differently but still working of a basic http protocol. I wonder if it will work out the box on Mono. | Google AI Challenge - I've Entered it I'm not saying my Aboutbot entry will be any good and I'm not going to publish the source code until later this week but I fancied having a go at the Challenge, (see my entry about it) and even in the 12 days left I hope to have a bit of fun as I normally don't enter any challenges that I run, except where I have to write code to mark them or generate the answer. It's not the same anyway! So I'm sticking my neck out. As challenges go, writing a winning entry is an interesting task. You are given a map, and can get the location of where your opponent is at any time so what strategy to use? My first strategy is making sure my bot has plenty of room to roam in. That means identifying danger areas on the map and avoiding them. The first turn can be up to 3 seconds long. So my C# bot will generate a heat map with one byte for every map location indicating proximity to a wall, ranging from 0 (no danger) to 255 (wall) and points between. As the round progresses I'll update that with walls (both mine and my opponents) so that my bot can try and keep to the wide open vistas. However that has to be tempered with trying to trap the opponent's bot. The API allows reading of the opponent's bot's position so knowing where it is, my bot needs to head for it and try and limit the available space it has to maneuver in. If my bot can box it in and stay mobile itself then it wins the round. The first entry went in today (just the default C# bot) and is 418th (page 5) on the ratings page so plenty of scope for improvement. I'm now busy coding a new bot now and will keep entering revised bots so keep looking out. Anyone else got a bot entered we can watch? Email me and I'll publish their names. | Looping Loops Programming Challenge This runs until the end of February 2010. Write code to complete loops. | | | | C / C++ / C# Ads | | | | Featured Articles | | | | | | | | Sign up for more free newsletters on your favorite topics | | | | You are receiving this newsletter because you subscribed to the About C / C++ / C# newsletter. If you wish to change your email address or unsubscribe, please click here. About respects your privacy: Our Privacy Policy Contact Information: 249 West 17th Street New York, NY, 10011 © 2010 About.com | | | | | Must Reads | | Advertisement | |