Windows 8

19. September 2011 02:29 by gogman in Development, Microsoft, Technology  //  Tags: ,   //   Comments (2)

Microsoft had their Build conference here in Southern California last week. For the first time in 10 or so years I am genuinely excited with what they presented.

I grabbed the developer preview and installed it on my primary development machine on a new hard drive. It ran surprisingly well out of the box. I only need to update two drivers to have it functionally equivalent to my Windows 7 install:

  • I needed to update the video driver to the latest nVidia beta to get the HDMI output to work. The VGA port worked just fine with the default Windows 8 nVidia driver, but I don’t do analog.
  • I needed to install the Windows 7 64-bit driver for the O2Micro SD reader, it was not recognized by Windows 8 during the setup. The same thing happens with Windows 7.

Other than that, it’s been a pretty uneventful preview aside from the WONDERFUL new features, enhancements, and the LOVELY Metro interface. I even have Minecraft, Team Fortress 2, and Visual Studio 2010 Ultimate with all the Mango developer tools running on it like butter. I may actually use it day to day.

Having had a Windows Phone 7 phone since day one, I have longed to see the Metro interface on a tablet and PC. Looks like I got my wish! As for developing apps for Windows 8, it’s cake. A few tiny changes in a little bit of code and methodologies as well as some new name-spaces. Not really much at all considering the re-imagining of Windows. All I can say is that I can’t wait to see what comes next!

Here’s the Keynote speech from Build Day 1. It’s amazing how excited and how much enthusiasm everyone is showing. I think Microsoft may have gotten its’ Mojo back!

 

Steven Sinofsky is the man.

Simple XNA Cross Platform Settings Manager

25. January 2011 12:50 by gogman in Development  //  Tags: , , ,   //   Comments (0)

One of the joys of doing XNA development is the ability to do cross-platform applications quite easily. I must admit I am really enjoying being able to reuse 99% of my code on the PC, XBox, and Windows Phone 7.

One of the common things all applications need, regardless of platform, is a way to persist application settings between application runs. While there are built-in features and many open source libraries available to persist application settings, I found that most were overkill for what I needed.

For me, a simple static class the exposes settings as a series of properties on an object are all I really need.

I present my simple SettingsManager.

This class uses IsolatedStorage on all platforms and requires no special permissions to read and write the settings file. It literally is a drop-in solution for persisting your applications settings.

It exposes only two methods:

  • LoadSettings
  • SaveSettings

It also exposes one object that contains your applications settings:

  • Settings

This class is very simple to use. Simply call LoadSettings in your application constructor and then you have access to all your application settings – even on the first run of your application. Any time you change a setting, simply call SaveSettings. Since the class is static, you have access to all of your settings from anywhere in the application which I find helps simplify the code I write since the application settings are now just essentially global variables.

All you need to do to adapt this for your app is simply change the namespace and modify the AppSettings class to contain the properties you wish to persist. Also don’t forget to set the defaults for those properties in the AppSettings class initializer. Setting the defaults is very important as these are the values your application will see when the settings file is initialized.

Ok, enough talk – here’s the code.

#region usings
using System.IO;
using System.IO.IsolatedStorage;
using System.Xml.Serialization;
#endregion
 
namespace YourNamespace
{
 
  #region application settings
 
  public class AppSettings
  {
 
    public bool HasRunOnce { get; set; }
    public bool IsFullScreen { get; set; }
    public bool EnableMusic { get; set; }
    public bool EnableSfx { get; set; }
 
    public AppSettings()
    {
      // Create our default settings
      HasRunOnce = true;
      EnableMusic = true;
      EnableSfx = true;
 
      // Since this is cross platform, you can decide what default values to use for a platform.
      // In the case of full screen, phones and XBoxes are always full screen.
      // In the phone an XBox applications, we don't let the user change this setting.
#if WINDOWS
      IsFullScreen = false;
#else
IsFullScreen = true;
#endif
 
    }
  }
 
  #endregion
 
 
  #region settings manager
 
  static class SettingsManager
  {
 
    private static string fileName = "settings.xml";
    public static AppSettings Settings = new AppSettings();
 
 
    public static void LoadSettings()
    {
      // Create our exposed settings class. This class gets serialized to load/save the settings.
      Settings = new AppSettings();
      //Obtain a virtual store for application
#if WINDOWS
      IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForDomain();
#else
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
#endif
      // Check if file is there
      if (fileStorage.FileExists(fileName))
      {
        XmlSerializer serializer = new XmlSerializer(Settings.GetType());
        StreamReader stream = new StreamReader(new IsolatedStorageFileStream(fileName, FileMode.Open, fileStorage));
        try
        {
          Settings = (AppSettings)serializer.Deserialize(stream);
          stream.Close();
        }
        catch
        {
          // An error occurred so let's use the default settings.
          stream.Close();
          Settings = new AppSettings();
          // Saving is optional - in this sample we assume it works and the error is due to the file not being there.
          SaveSettings();
          // Handle other errors here
        }
      }
      else
      {
        SaveSettings();
      }
    }
 
 
    public static void SaveSettings()
    {
      //Obtain a virtual store for application
#if WINDOWS
      IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForDomain();
#else
IsolatedStorageFile fileStorage = IsolatedStorageFile.GetUserStoreForApplication();
#endif
      XmlSerializer serializer = new XmlSerializer(Settings.GetType());
      StreamWriter stream = new StreamWriter(new IsolatedStorageFileStream(fileName, FileMode.Create, fileStorage));
      try
      {
        serializer.Serialize(stream, Settings);
      }
      catch
      {
        // Handle your errors here
      }
      stream.Close();
    }
 
  }
 
  #endregion
 
}

Enjoy!

28 Days Later - Windows Phone 7 and the Samsung Focus

30. November 2010 00:56 by gogman in Technology, Development  //  Tags: ,   //   Comments (0)

ATT_i917-Cetus_front1_400x400November 8th was a good day for lovers of smartphones, social networking, and the Internet. AT&T and Microsoft released three new Windows Phone 7 phones in North America. The HTC Surround, LG Quantum and Samsung Focus.

I picked up a Samsung Focus and have now been using it for 28 days both as a consumer and developer. I decided to take some time and post some of my thoughts on Windows Phone 7 OS, the hardware, and the reaction from the technology press.

This is a long post that I hope you find is not a complete waste of your time.

More...

Yes, I am Still Alive

23. September 2010 02:21 by gogman in Development  //  Tags: ,   //   Comments (2)

I’ve been very busy spending about 10-12 hours a day learning XNA for the PC, Windows Phone 7 as well as learning 3DS Max 2011.

It’s been 15 years or so since I wrote a videogame and never one in 3D. I have to say, I am enjoying it. 3D is not so bad. In some ways it’s actually easier than 2D game development. And oh, the tools, oh the lovely tools! It’s amazingly nice to have to NOT write all the low level code. The last game I wrote utilized Mode X graphics and the display code was done in assembler. It took a very long time to build the tools and libraries required to build the game. Now it’s so nice to be able to concentrate on the high-level code and object management instead of writing all the low level tools and libraries – and do it all for 1920x1080 pixels. What a difference a decade and a half makes :)

Hopefully I’ll have some tech demos up here soon. I didn’t have to deal with pixel shaders, vertex shaders, or frustum culling 15 years ago so there is a lot to learn and catch up on.

Comment Spam, Punishing Users and Bugs – Oh My!

2. August 2010 20:28 by gogman in BlogEngine.NET Extensions, Development, Open Source  //  Tags: ,   //   Comments (13)

spam It seems that there has been an issue with posting comments on my blog. When posting a comment people would be greeted with the message "Sorry, the following error occurred while processing your comment: There was an error in the callback."

I had received a couple of reports regarding this but could never seem to replicate it. Well, it turns out the bug only happened to users who are not signed into my blog – which would be everyone but myself. I discovered this by accident after forgetting to sign into my blog and posting a test comment after getting a message regarding the error (thanks Aunt Pat!). All I could mange to to say to myself was: Duh….

After a couple of other tests verifying the bug existed, I set about trying to resolve the cause. The first place I started was in the extensions I use in the commenting system to help prevent spammers from littering the comments with useless comments and links. I disabled the Askimet and reCaptcha extensions and lo and behold, the bug went away! My gut instinct seemed to have paid off – for the moment.

At this point I decided to leave the extensions disabled, enable comment moderation, and not pursue the issue any further. I really hate forcing users to enter a CAPTCHA to post a comment. Entering a CAPTCHA is, at least in my mind, a form of punishment inflicted on the user by spammers and overly uptight sysadmins and being it was the wee hours of the morning, I decided to grab a quick round of TF2 and then go hit the sack. All was well in Well Rounded Geek land.

Upon waking the next morning, I engaged in my usual ritual of checking my email while slurping on a Red Bull and rubbing the sleep out of my eyes. My eyes rapidly opened as I was stunned to find 33 notification emails from my blog letting me know a comment had been posted. 33 comments all while I was lost in slumber! WOOHOO! People love me! Now wide awake, I logged into my blog to find that every single comment was spam.

Bloody hell! Mo&%er fu^@*!ng spammers!

After spending 20 minutes updating the filters on my blog and deciding that enough was enough, I hit Google. I had to find out what was causing the callback errors and doing a Google search first is a lot faster than firing up a full debugging session.

Luckily for me I almost immediately came across a forum posting describing the same issue I was having. Continuing to read down the thread, lo and behold I came across the exact problem I was having. And the best part: there was a fix posted by Andrea Dottor.

I immediately backed up copies of the offending files and implemented the fix. BAM! No more callback errors with all spam filters and services enabled. VICTORY! SUCK IT SPAMMERS!

There bug? It turned out to be a rather pedestrian mistake: trying to return the wrong type of object when calling the BlogService.LoadFromDataStore function inside the ReCaptcha component. I have posted the changed source code here:

All credit goes to Andrea Dottor for finding the bug and posting the solution.

So, dear readers and commenters, I apologize for the fact that you have to input the CAPTCHAs and jump through the hoop to post here. I don’t want you to have to do it, but the bloody spammers leave me no choice…

WRGprettyPhoto BlogEngine.NET Extension Update

6. July 2010 10:11 by gogman in BlogEngine.NET Extensions, Development  //  Tags:   //   Comments (0)

My WRGprettyPhoto Extension has been updated to version 1.1.

If may be downloaded here.

Thanks to everyone who reported bugs.

VS2010 Ultimate Upgrade – Loving it!

9. June 2010 20:46 by gogman in Development  //  Tags: , , ,   //   Comments (0)

VS2010 Ultimate I haven’t posted in a few days as I have moved on from Visual Studio 2008 Professional to Visual Studio 2010 Ultimate and have been neck deep in exploring the new IDE and features.

So far, I am loving it! I only had one small glitch that was strange and didn’t affect the operation: The registered owner and organization was listed as Microsoft.

How to change the Visual Studio 2010 registered owner and organization information:

Close all instances of Visual Studio 2010

Fire up RegEdit and:

On 32-bit Windows follow the below steps:

Edit the values under:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\Registration\UserName
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization

On a 64-bit Windows follow the below information:

Edit the values under:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\Registration\UserName
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\RegisteredOrganization

When that is done, start the Visual Studio 2010 Command Prompt and run: DevEnv /setup

Let that run and when it is done, close the Command Prompt and Visual Studio 2010 and you should now see the correct user information listed.

Extensions, Templates and SDKs

I am loving the new suite of extensions, templates and SDKs available for VS2010. Here are the ones I am using so far:

So far I think Microsoft has done a great job with this version of Visual Studio.

Good job guys!

Apple – The Digital Dealer and Pimp

31. May 2010 16:39 by gogman in Development, Apple  //  Tags:   //   Comments (0)

The New Evil Empire?Apple has passed Microsoft to become the largest tech company in terms of market capitalization. This is quite a remarkable feat considering that Apple commands about 6% of the operating system market compared to Microsoft’s 90%. Besides the fact that both Microsoft and Apple produce operating systems, in reality, they are very different companies. 

If one delves into the numbers, it becomes very clear that Apple has ridden to the top on success in the mobile space and media – in particular, the iPhone, iPod, and iTunes – not on traditional computers or operating systems. It’s still too early to see what impact the iPad will have on their bottom line, but based on history, one can expect it to be substantial.

For most of their lives, Apple has primarily been a hardware manufacturer while Microsoft had been primarily a software manufacturer. Sure, Microsoft does manufacture hardware, but it’s primarily to support the software side of the business and Apple does manufacture software as well, but it’s primarily to support the hardware side of the businesses.

 

 

'”3.3.1 — Applications may only use Documented APIs in the manner prescribed by Apple and must not use or call any private APIs. Applications must be originally written in Objective-C, C, C++, or JavaScript as executed by the iPhone OS WebKit engine, and only code written in C, C++, and Objective-C may compile and directly link against the Documented APIs (e.g., Applications that link to Documented APIs through an intermediary translation or compatibility layer or tool are prohibited).”

 

 

However, in the last few years, Apple has quietly crept into the software side of the equation with almost nobody noticing. No, they’re not going head to head with Microsoft, rather, they have become a software pimp.

Things are changing in a big way for Apple.

A bit of advice to Steve Jobs and the Cupertino Kids – watch your back.

 

 

http://www.apple.com/pr/bios/gore.html

Introducing the WRGprettyPhoto BlogEngine.NET Extension

UPDATED 6 July 2010: WRGprettyPhoto 1.1 - contains minor bug fixes and reliability improvements - Download WRGprettyPhoto.1.1.zip – 3.72kb.

When I decided to adopt BlogEngine.NET as my primary website publishing platform, I knew there might be a few issues with the scripts I had been using on my old site. As I began testing, I discovered, much to my chagrin, that one of my favorite scripts – Lightbox 2 – did not work with BlogEngine.NET.

After a little research, I discovered that the incompatibility came down to a much used function in the JavaScript library for the blog sharing the same name as a function in the Scriptalicious library: function $(id) in the blog library and function $(element) in the Scriptalicious library.

I looked through both sets of code and decided that rewriting the code to use a different function name was just too much work and would complicate upgrading either set of scripts.

Deciding to find an alternative to Lighbox 2, I went to the extensions page on the BlogEngine.NET website and saw an extension named prettyPhoto. After visiting the author’s page and checking out the prettyPhoto javascript library website, I installed the extension and support libraries.

For some reason, the extension failed to work for me. I am not sure why it did not work, but it just did not. By this point I was set on using prettyPhoto so I manually set it up and got it working. It was at this point that I sadly realized I would no longer be able to use Live Writer’s built in Lightbox 2 editing support due to the different tag names used by prettyPhoto and the lack of the reference to the Lightbox 2 library on the site.

This got me thinking, why not write a prettyPhoto extension that not only “tricks” Live Writer into enabling support for Lightbox 2 but also works with that support in a smart way to enable prettyPhoto to use it. And while at at it, why not make it smart enough to only load the prettyPhoto library and the jQuery library only when needed?

After reading the BlogEngine.NET extension developer documentation, I jumped right in and after a few hours of learning, coding, and testing, I had my new extension completed: WRGprettyPhoto 1.0.

Download WRGprettyPhoto.1.1.zip – 3.72kb

 

Features:

  • Enables and works with Lightbox 2 support in Windows Live Writer.
  • Saves bandwidth by only referencing the prettyPhoto script when needed.
  • Optionally saves bandwidth by only referencing the jQuery script library when needed.
  • Complete control over the appearance of prettyPhoto from within the extension settings without ever needing to write code.

Setup:

  1. Download prettyPhoto (minimized version recommended) and extract the prettyPhoto folder in the archive into the root folder of your website.
  2. Download the WRGprettyPhoto archive and copy the WRGprettyPhoto.cs file from the WRGprettyPhoto archive into the App_Code\Extensions folder.
  3. Optional: If you use Windows Live Writer and want to use the built in support for LightBox2 with prettyPhoto, copy the file file lightbox.js from the WRGprettyPhoto  archive into the prettyPhoto\js\ folder.
  4. Optional: If you already have the jQuery library script referenced in you site you may skip this step. If you do not and would like WRGprettyPhoto to dynamically load and unload jQuery as needed then download the jQuery Library (minimized version recommended)  and place it in a folder on your site. I place mine in a folder off the root folder named Scripts.

Configuration Notes:

If you enable Live Writer Lightbox 2 editing support for use with prettyPhoto you MUST complete setup step #3 and refresh your blog settings in Windows Live Writer. Once you do this you should see the following when you click the options button after inserting an image into your post:LiveWriter_LightBox_Support All you have to enter here is the gallery name for the photos you wish to display in prettyPhoto.

If you wish the have WRGprettyPhoto mange the loading of jQuery only when needed, you MUST complete setup step #4. The URL you enter must be a relative URL (eg: Scripts/jQuery.js) to the location where you have placed the jQuery library. A leading slash is not required.

The other options on the extensions page are pretty self explanatory.

Support and Licensing:

Please send me any bugs or feature requests you may have ASAP. You may either use the contact form or the comments on this post.

This extension is not licensed in any way and is given away free for you to do with what you will. All I ask is please keep the comment header in the extension source code intact and link back here if you improve upon or use WRGprettyPhoto as a base for your own custom extension.

Happy blogging!

About The Bloggers

gogman

gogmanBorn naked, unable to communicate, walk, or feed himself, Gogman overcame these handicaps to become a technologist, decent open water sailor, pretty darn good cook, husband, cat lover, and mediocre blogger.

Gogman works as the CTO at Atomic Goat Studios, an independent game studio start-up located in Southern California developing games for the PC, XBox 360, and Windows Phone 7.

Member Hawaii Yacht Club

dantwo

dantwoFound in a universe that probably exists, Dantwo prides himself on his ability to use the laws of nature to perform complex tasks; such as operating a keyboard.

A graduate student and teaching assistant by trade, he is also found enjoying games, technology, rudimentary philosophy, and observing the universe.

We miss you Andrew

Recent Comments

Comment RSS