Wednesday, January 10, 2007

microsoft bob lives

thanks to the miracle of Virtual PC, I am able to run the Microsoft Bob operating system. here are some screenshots (click images for full-size versions).

this UI was meant to revolutionize the OS business, but it fell flat on its cute puppy face. you may notice though, that the dog survived. you can find him in Windows XP.


- the Microsoft Bob OS sign in screen

the idea for Microsoft Bob was that you click on the picture that represents that task that you want to do. want to call someone? click on the phone.


- the main room in the OS

there is even a Microsoft Bob box in the company museum. within Microsoft culture, the project has become the archetype of failure.


- how deep was this mouse hole?

Wednesday, January 03, 2007

my kittens hate nazis

lucky guy that I am, santa brought me a copy of call of duty 3 this Christmas. here's my sob story for the day.

being a fan of the xbox 360 achievements, I've been working through some of them. today I was trying for the close combatant award which requires that you finish a mission without firing a shot - only melee attacks and grenades are allowed. I was on the last checkpoint and about to launch into the final assault when one of my cats nuzzled up to the controller and managed to press the trigger. my rifle fired and that was it for my hard work; I had to start again from the beginning. :(

I guess she was just too eager to get into the fight.

Thursday, December 21, 2006

showing a bitmap in XNA

I've seen some crazy complicated samples online for something that should be very simple - showing a bitmap in XNA. I even found one article that suggested using pointers. ha!

here's the simple version that I used to show augmented reality markers on my TV. unfortunately, it seems that the TV scan line is going to prevent this from actually working as an AR demo.

#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Storage;
#endregion

namespace Xbox360Game1
{
public class Game1 : Microsoft.Xna.Framework.Game
{
GraphicsDeviceManager graphics;
ContentManager content;

//Added for bitmap
public static Texture2D SpriteTexture;
public static SpriteBatch SpriteBatch;
public Point Velocity;
public Point Location;
public Point Size;

public Game1()
{
graphics = new GraphicsDeviceManager(this);
content = new ContentManager(Services);
}

protected override void Initialize()
{
base.Initialize();

//Added for bitmap
SpriteBatch = new SpriteBatch(this.graphics.GraphicsDevice);
}

protected override void LoadGraphicsContent(bool loadAllContent)
{
if (loadAllContent)
{

//Added for bitmap
SpriteTexture = content.Load("base0_128");

}

base.LoadGraphicsContent(loadAllContent);
}

protected override void UnloadGraphicsContent(bool unloadAllContent)
{
if (unloadAllContent == true)
{
content.Unload();
}
base.UnloadGraphicsContent(unloadAllContent);
}

protected override void Update(GameTime gameTime)
{
// Allows the default game to exit on Xbox 360 and Windows
if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
this.Exit();
base.Update(gameTime);
}

protected override void Draw(GameTime gameTime)
{
graphics.GraphicsDevice.Clear(Color.CornflowerBlue);

//Added for bitmap
Location.X = 100;
Location.Y = 100;
Size.X = 512;
Size.Y = 512;
Game1.SpriteBatch.Begin();
Game1.SpriteBatch.Draw(Game1.SpriteTexture, new Rectangle(Location.X, Location.Y, Size.X, Size.Y), Color.White);
Game1.SpriteBatch.End();

base.Draw(gameTime);
}
}
}

Wednesday, December 20, 2006

'Canada's Best' books

has anyone else seen the "Canada's Best" list that Chapters compiled?

they asked 150,000 irewards members to list their favourite Canadian books of all time (both fiction and non-fiction). however, this is a bit misleading since they don't actually say what the resultant sample size was.

it's clear to me that the entries are heavily biased towards books that were published in the last few years. for example, jPod (#11) is listed ahead of Microserfs (#58). I have a hard time seeing how that could happen unless the people who voted for jPod haven't read Microserfs.


also, some of the best books are clearly missing from the list. for example, Whale Music by Paul Quarrington should obviously be included.

BTW - two authors have ten books each in the list of 100 books: Atwood and Coupland.

here are my favourite book lists:
favourite geek books
favourite fiction books

Wednesday, December 13, 2006

debug xbox 360 without xbox?

it didn't take long for me to realize that the GSE XNA xbox 360 project forces a deployment to the xbox 360 when you debug or build. so how do you work on your xbox 360 game when you're in the coffee shop?

there doesn't seem to be any way to disable the deployment, so - unless you take your xbox with you - it's a bit of an issue. even adding Any CPU as an additional platform in the configuration manager didn't work. I found a forum post about debugging without the xbox 360, and it seems that the current solution is a bit of a hack:

"You can start a new Windows Game and link all the files from the 360 project. It would probably take about 30 seconds to set up. After you create the Windows Game project, right click on the project in the Solution Explorer, select Add Existing Item, select all the files in the dialog, click the arrow on the Add button and select Add As Link. Any changes made in either project will be reflected in the other."

there is a second solution in the post (manually altering the project file), but it isn't recommended.

Monday, December 11, 2006

xbox creators club live!

the xbox 360 creators club is up and running. this option allows game developers to use the XNA game development platform to create and run xbox 360 games.

although the game studio express (GSE) dev environment is free, the creators club requires an xbox live subscription and a creators club membership.

refer to the XNA blog (and the GSE docs) for details about setup. once you have everything installed, you can connect your xbox 360 to your pc and begin to work your magic.

this screenshot shows an xbox 360 project deployed and running on an xbox 360. the project is running in debug mode and a breakpoint has been hit - all while still listening to the iPod connected to the 360... nice.


- debugging an xbox 360 project - click for full-size version

Wednesday, November 29, 2006

vs.net cross language debugging

the attached image shows a solution with an unmanaged C++ wrapper (for a C++ .lib) and a C# application project.

whilst debugging, you can cross the language barrier and debug into both projects. in the attached screen, a breakpoint in C++ is being hit, but the application running is the C# app. cool hey!


- C++ breakpoint hit while debugging C# project

of course, this is all old news, the actual reason for this post is debugging issues with this sort of debugging.

the most common error is: "The breakpoint will not currently be hit. No symbols have been loaded for this document".

first steps from a newsgroup post:

1. Verify that you are in debug mode and not release mode.
2. Verify that the timestamp of the .pdb file is the same as the .dll or .exe that you're generating. If they are not, remove all of the binaries
and recompile your entire solution.
3. If the additional assemblies you are trying to debug are not part of your solution (i.e. other projects), go under the properties for the solution and be sure to include the "Debug Source Files" and "Debug Symbol Files" locations of the additional assemblies you're trying to debug.

despite all of this, when I started debugging, everything worked fine in the C# code, but the breakpoints in the CPP files show "No symbols have been loaded for this document." When I look at the modules, the status for the CPP DLL is "Symbols loaded." but there is an exclamation mark and the error "The module did not load at the default load address."

I was running in debug mode for both projects. I tried rebooting. I tried deleting all the debug files and rebuilding. and I also tried the steps in this help doc: How to: Debug in Mixed Mode.
this included adding /ASSEMBLYDEBUG to the native DLL project - I also tried w/out this statement.

I tried changing the debug build dir for the C++ project to be the debug dir of the C# project, but that didn't help.

it turned out that my issue was with my function import. I had the wrong entry point specified, so the code wasn't being called properly. why this problem manifested as it did, I don't know. I get the same behaviour as before (e.g. the breakpoints are still inactive at first), but when the debugger gets to the CPP files with breakpoints, they work.

the rest is from the article: How to: Debug in Mixed Mode

"The following procedures describe how to debug both managed and native code, also known as mixed-mode debugging. There are two scenarios for doing so, depending on whether the DLL or the application is written in native code:

The calling application that calls your DLL is written in native code. In this case your DLL is managed, and both managed and native debuggers must be enabled to debug both. You can check this in the Property Pages dialog box. How you do this depends on whether you start debugging from the DLL project or the calling application project.

The calling application that calls your DLL is written in managed code and your DLL is written in native code.

Note
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To enable mixed-mode debugging in a native EXE calling a managed DLL
In Solution Explorer, select the project. On the View menu, click Property Pages. In the Property Pages dialog box, expand the Configuration Properties node, and then select Debugging. Set Debugger Type to Mixed or Auto.

To enable mixed-mode debugging in a managed EXE calling a native DLL
In Solution Explorer, select the project. On the View menu, click Property Pages. In the Properties Pages, click the Debug tab. Under the Enable Debuggers group, select the Enable unmanaged code debugging check box.

Note
For the debugger to attach to code written in C++, the code needs to emit DebuggableAttribute. You can add this to your code automatically by linking with the /ASSEMBLYDEBUG (Add DebuggableAttribute) linker option."

Monday, November 27, 2006

st john water polo

this weekend, I played in a water polo tournament in st john, new brunswick. I play for dalhousie university (in halifax, nova scotia); we were playing against teams from st john and tracadie.


- a nice offensive foul in the hole


- yes, it's a rough game :)

truly canadian road sign

this sign is in fredericton, new brunswick. it must be the most canadian sign on the planet.



- no left turn to tims

Wednesday, November 22, 2006

Fatal error cannot open LIBC

When migrating Visual Studio projects from VS 2003 to VS 2005, I encountered the error:
Fatal error cannot open "LIBC".

I thought I'd post the solution to make it easier for others to find.

To remove the error, navigate to Configuration Properties -> Linker -> Input. Then, add "libc" or "lib.lib" under Ignore specific library. In earlier versions of VS it was set to libc.lib.

I found the reference on this page about migration issues: Migrating to Visual Studio 2005

Wednesday, November 15, 2006

quick update

wow, how time flies. I haven't written anything here in ages. the reason for this is simple. I'm working hard on the augmented reality book for pragmatic, and I have also started on a new project that will be announced soon.

Monday, October 30, 2006

xbox 360 mods banned?

it looks like ms has been banning people for using mod chips on their xbox 360s. they are doing this because, at this time, the only reason to use the 360 mod chips is to play illegal copies of games or remove the region protection so that one can run games from other regions.

this has nothing to do with modding actual games. modding games - as I've written way too many times - is great as long as you're not doing it to cheat. any chance I get, I'll remind everyone that modding is not the same as cheating! if you go on xbox live and play a mod, then hell ya - you're cheating. but that's not what most good modders are doing.

many modders are out there creating cool mods that they enjoy on their own LANs. i.e. when everyone knows that they're playing a mod. they're not trying to level up like a wuss or play an illegal copy of fusion frenzy.

Saturday, October 28, 2006

halo 3 info coming

go to 1up.com for impending info. about halo 3.

they aren't giving out much info. yet, but they did let slip that the mongoose is back and there will be a new type of grenade called the spike.

Wednesday, October 18, 2006

schools ban tag

this topic is way off my regular routine, but it's just so ridiculous that I can't resist. some schools in the US are banning tag and other "contact sports" during recess. although this story makes me shake my head, I've seen this sort of logic applied to university students - more about that in a second.

first of all, calling tag a "contact sport" is enough to show the lack of logic in these bans. the people responsible say that they have made these decisions in the name of safety. I used to work with young children, and I used to lifeguard. no matter what you do, kids will still fall down and get bumps and bruises. the plain truth is that kids get hurt - they get hurt a lot. BTW - when I was growing up, I saw far more injuries in gym class than I saw during recess.

personally, I agree with the idea that kids need to learn how to play safely together. as Manhattanville College education professor, Rhonda Clements said, through play "They learn to change and to problem-solve." as for the argument that unsupervised kids can't be trusted to resist the temptation to resort to full contact, I have two points to make:

1. my understanding is that all schools have some sort of supervision during recess. so it's not true to say that the children aren't supervised at all. if there are schools out there that have no supervision during recess, then that should be addressed. kids need to be protected from the outside world far more than they need to be protected from one another.

2. if this is really a move to curtail bullying, then it should be dealt with properly. don't punish all of the kids because of the bullies.

now onto the university example. while working at a residence advisor, I was unfortunate enough to be working when the administration decided to enforce a ridiculous student party policy. at the residence in question, party organizers were already obliged to fill out paperwork and ask for permission before they could host a party - after the rule change, things crossed the line of reason. one of the new rules was that no more than 25 people could attend a party at any time. that's 25 people out of a house of about 200 and a residence of over 1100.

the new rules had one effect, the parties moved off residence grounds. and maybe that was the point all along. if the party isn't at the residence, then the administration isn't responsible for what happens there.

in other words, let the kids play somewhere else.

Monday, October 16, 2006

Xbox 360 saved my iPod

as with many other first generation iPod owners, I find that my device is pretty much useless unless it is plugged in. there is a flaw that has significantly limited the battery life. this problem is so prevalent that a successful class action suit was launched against apple - although they are trying to weasel out of paying my settlement.

but then along came the Xbox 360 and its out of the box support for iPods and other music sources. all I had to do was plug my iPod into one of the Xbox 360's USB ports and presto! I actually have a use for my iPod. it's now a fixture in the living room - not exactly what they had in mind when they made it, but it works.

despite the great press, there were other issues with the original iPods, and some of them have been addressed. for example, it used to be that the "On The Go" playlist was erased every time you connected your iPod to iTunes - now that was annoying. but it was fixed fairly quickly. other problems have not been addressed. a good example is gapless playback. I doubt this occurs on the solid state iPods, but if you have a hard drive version, you probably know what I'm talking about. there is an almost inexplicable delay as the iPod searches the hard drive for the next song. there is even an online petition to try to convince apple to add this feature. issues like this are the reason why I bought a creative MuVo for running. the MuVo is great, and the fact that it stills works after I accidentally ran it through a wash cycle, makes me even happier that I bought it.

microsoft is about to launch the zune portable media player to compete with the iPod. lots of people have said - in a knee-jerk fashion - that microsoft is wasting their time, that there is no way that they can compete with the iPod. well I tend to agree with one dimension of those statements, it will be tough to compete with the almost religious fervor that surrounds the iPod. I'll admit that I was disappointed by the original iPod. other than the size of the drive, I didn't think that it was as useful as my 1998 diamond Rio.

from that experience, I feel that I gained an objective view. but for many people, the iPod was their first MP3 player, so they didn't know that things could be even better. I can see that iPods have cool interfaces - but also that these interfaces aren't as easy to use with 6000 songs on the device. I can see that iPods are important to apple, and I'd like to see great companies like apple do well. but, I can also see that there are plenty of features that aren't available on iPods, if other players offer those features, I wonder what the devout will say?

iTunes 7 appears to be trying to address the gapless issue - at least in iTunes - because I'm currently waiting as it's "Determining Gapless Playback Information" for the 5929 songs on my iPod. oh wait... the battery died near the end :P

but I don't want to complain... thanks to the Xbox 360, I can actually use my iPod for something other than car trips.

Thursday, October 05, 2006

AR book screenshot

I thought I'd share this figure from the augmented reality (AR) book that I'm working on for the pragmatic bookshelf. it's in a section about setting up a webcam for AR - the little critter is a dilute calico field mouse... er, I mean kitten.




update: sadly, this image was cut :(

Friday, September 29, 2006

IE 'command line' searches

dwarning: this trick requires a change to the registry. if you're not familiar with backing up the registry, do not try this!

here are some registry entries that make it easy to search common sources from the Internet Explorer (IE) address bar. it's so fast - no mouse required - that I thought I'd share it.

once you have this running, just type the shortcut and your search word into the 'Address' bar at the top of IE and you're searching. I've added a bunch (e.g. Dictionary.com to the list), but you can add your own - as long as the site's seach has the right URL format. for example, to look up a word, I simply type "d word" into the IE address bar and I'm taken to the dictionary.com search results for "word."

Instructions:
1. save these registry entries in a new text file with the .reg extension

--- cut this line out - begin ---
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\g]
@="http://www.google.com/search?q=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\q]
@="http://moneycentral.msn.com/scripts/webquote.dll?iPage=qd&Symbol=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\mscom]
@="http://search.microsoft.com/search/results.aspx?qu=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\msdn]
@="http://search.microsoft.com/search/results.aspx?View=msdn&qu=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\d]
@="http://dictionary.reference.com/search?q=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\fr]
@="http://www.wordreference.com/fr/Translation.asp?enfr=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\en]
@="http://www.wordreference.com/fr/en/translation.asp?fren=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\cd]
@="http://www.computer-dictionary-online.org/index.asp?j=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\a]
@="http://www.amazon.com/s/ref=nb_ss_b/102-1261000-9844923?url=search-alias%3Dstripbooks&field-keywords=%s"

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\bt]
@="http://btjunkie.org/search?q=%s"
---- cut this line out --- end ----------

2. double-click your .reg file - you'll get a prompt asking if you're sure then a message saying that changes were made

3. your virus scanner may ask you to approve the changes to the registry

Public Examples:

g 'terms' - Google search
d 'word' - dictionary.com
q 'symbol' - stock quote
ms 'terms' - Microsoft.com search
msdn 'terms' - developer network
en 'french word' - translate to English
fr 'english word' - translate to French
j 'term' - look up in Jargon Dictionary
bt 'term' - search torrents on BTJunkie.com

when I was at MS, I also used to use these Microsoft Internal Examples:

m - MSW search
o - http://office search
p - mysite on http://office

if you don’t like the abbreviations they’re easy to change — just change the key shortcut for the entry.

remember, if you have IE open, ALT+D is the keyboard shortcut to get to the address bar.

note: don't send your version to people as a .reg file. virus scanners will not like it. you can change the extension to .txt.

update: as deighvan commented, "TweakUI (a free microsoft 'powertoy') does this easily." (thanks for the comment BTW) I'm a fan of TweakUI, and the Power Toys in general (especially Command Prompt Anywhere), but it's not needed if all you want is a few searches.


- the TweakUI Power Toy setting IE searches

Thursday, September 28, 2006

WAR halo wars!

the Halo Wars teaser is amazing...

I'm a big RTS fan, so I'm thrilled that Halo seems to be getting the quality attention that it deserves in the genre.


Tuesday, September 05, 2006

the zen of robotron

many gamers have enjoyed the classic arcade staple Robotron 2084. now that robotron is available for the xbox 360, a whole new generation is being introduced to the manic game.

robotron is action packed and often frustrating. in fact, there will be times when the game seems unfair. here are some simple truisms that can help save your sanity during games of robotron.





- live and let live?


10. accept that your eyes will lie
the robotron engine allows more than one enemy object to occupy the same space. this means that just because you destroyed the robotron in front of you, you may not be safe when you run forward.

9. accept what you are given
don't expect to get a certain score for each wave. the hulks will destroy many of the people before you can rescue them.

8. it's not over until it's over
even if you destroy all of the robotrons, you may still be killed. there will be times when you are killed at the same time as you destroy the last enemy on the wave. when you spawn, the level will be complete, but you will have lost a life.

7. have faith in your dodging skills
you cannot predict the path of projectiles. for example, the projectiles fired by the enforcers will curve towards you. you can only do your best.

6. the game will not give you time
the grunts will accelerate over time, so there will be occasions when you are going for that one last human and a grunt will accelerate into you.

5. you will not always get better
you must accept that your score will not improve in a linear, or predictable manner. success in robotron is based on the ability to collect people and some levels offer more people than others. this means that you have to except to have good games and bad - based on how successful you are during the waves with more people.

4. accept your fate
there will be lives where you really don't have a chance. a quark or spheroid may kill you before you have time to move out of the centre of the wave.

3. robotron does not respect your plans
you may think that if you clear all enemies other than one grunt, you will have an easy time rescuing all of the remaining people. this will work most of the time. however, there will also be times when that last grunt walks into an electrode - thereby committing suicide and finishing the wave before you have rescued the people.

2. there may not be a way out
on waves such as wave 10, you will be rushed. you may not have an escape route.

1. love your addiction
you will play again.

Sunday, September 03, 2006

XNA spacewar

I recently posted a message about the exciting XNA Game Studio Express release. this is a fantastic move by microsoft that will eventually allow anyone to develop games for the Xbox 360.

as microsoft wrote to XNA Beta participants, "The Microsoft XNA team is pleased to inform you that the Microsoft XNA Game Studio Express (Beta) is now available at the Microsoft Download Center from the following location: http://msdn.com/directx/XNA/gse."

after you get GSE, you can build the spacewar project and play the game.


- the spacewar title screen


- old school spacewar


- fancy

as for playing spacewar without a keybaoard, a game developer friend of mine who teaches at BCIT, sent me this advice:

it is possible to get Spacewar working with the keyboard by uncommenting the #declare on the first line in gamepadhelper.cs. to make it work with my NVidia card I had to add the line
graphics.AllowMultiSampling = false; after the graphics component declaration on the line:
Microsoft.Xna.Framework.Components.GraphicsComponent();

for more XNA samples, visit xnaspot.com.