Archive for the ‘Microsoft’ Category

The Entity Framework, EntityDataSource, OnContextCreated() and OnSavingChanges(…) – ObjectContext Constructor Not Firing OnContextCreated

Sunday, June 7th, 2009
When using the Entity Framework if you want to mess with your entities before they persist to the database one popular way to do it is to hook into SavingChanges from the OnContextCreated method of your Entities ObjectContext like so:

public partial class SomethingEntities
{
partial void OnContextCreated()
{
this.SavingChanges += new EventHandler(OnSavingChanges);
}

public void OnSavingChanges(object sender, System.EventArgs e)
{
//Do stuff
}
}

I was trying to do exactly this but was having a problem. The gosh darn thing wouldn’t fucking fire. In fact, none of the constructors on my Entities ObjectContext were firing. My controls were dancing around all over the place selecting and updating data but nay a constructor to be called.

My EntityDataSource looked like this:

<asp:EntityDataSource ID=”DataSource” ConnectionString=”name=SomethingEntities” DefaultContainerName=”SomethingEntities”
EnableDelete=”True” EnableInsert=”True” EnableUpdate=”True” EntitySetName=”EntityName” runat=”server” />

I was using both the ConnectionString and the DefaultContainerName property as initialization parameters to get the DataSource going. Turns out this wasn’t the right thing to do because when configured this way the DataSource never got my Entities ObjectContext to fire its constructors. I got it to work after some head scratching by changing it to:

<asp:EntityDataSource ID=”DataSource” ContextTypeName=”Namespace.SomethingEntities”
EnableDelete=”True” EnableInsert=”True” EnableUpdate=”True” EntitySetName=”EntityName” runat=”server” />

By using the ContextTypeName property instead of the ConnectionString and DefaultContainerName properties everything seemed to work. A constructor on my Entities ObjectContext was called which in turn called OnContextCreated which hooked up my SavingChanges method which now gets called when it should before changes are persisted to the database.

Problem solved.

HOWTO: Save disk space in Vista with SP2 by making SP1 SP2 and patches permanent

Wednesday, May 13th, 2009

I just installed Vista SP2. Then I merged SP2 and all other system packages into Vista permanently, freeing up lots of disk space. How does one do this?

  1. Click Start.
  2. In the search box, type cmd and press Enter. You’ll get a command window.
  3. Type compcln.exe
  4. You will be prompted as follows:


    This operation will make all service packs and other packages permanent on this computer. Upon completion you will not be able to remove any cleaned packages from this system.


    Would you like to continue? (Y/N):
  5. Answer “y” and Windows Component Clean will clean up all that crap.

That’s it. Now your system is a lot like a fresh Vista+SP2 build without all the leftover junk. Enjoy.

Apple: What are they smoking? Also, Sony and gigantic software updates.

Friday, February 6th, 2009

The iPhone could use a few things. I dunno, copy/paste comes to mind. A few thousand other things.

Apple just released 2.2.1 for the iPhone 3G. It’s a 246MB download. It claims to fix some things:

  1. Improves the stability of Mobile Safari
  2. Fixes an issue where some images saved from Mail do not display correctly in the Camera Roll

Okay, so… what? 246MB software update. Fixes what, two shared libraries? And we need to do a monolithic OS install for that? 246MB worth?

While I’m on this topic, Sony is guilty of this crap as well. My Playstation 3 just got an update (2.6) that was really large (140MB) and here’s what that gave me:

  1. Photo Gallery Application – support for the new Photo Gallery application, which gives users a fancier way of organizing and viewing photos stored on the PS3. Sort of. It’s crap, really.
  2. Support for DivX 3.11
  3. Guest Viewing of the PlayStation Store – provides guest access to PlayStation Store, enabling non-PlayStation®Network members to browse the storefront’s downloadable content, including games, game trailers, and demos, along with more than 4,200 movies and TV shows.

The best part of this update? The Photo Gallery application then needs to be installed separately from the XMB, after you update your PS3’s firmware. “To install the Photo Gallery application, go to the Photo section on the XMB, select Photo Gallery and press the X button.” Seriously, what the hell is it with these guys? I mean, my PS3 seems at times to be a progress indicator machine. Don’t even get me started on Playstation Home.

Meanwhile, a real software company like Microsoft can roll out incremental tiny updates to the Xbox 360 that are 1-3M and are pretty darned fast. The only huge update was when they replaced the entire OS with the new NXE. That was less than 128MB, still smaller than the PS3 update and about HALF the size of the iPhone update, and that replaced the ENTIRE OS with all new functionality.

Come on, step up Apple and Sony. Holy crap already.

Crackdown 1.5

Thursday, February 5th, 2009

This studio:

http://www.ruffiangames.com/

Is comprised of these people:

http://www.ruffiangames.com/profile

Note that a lot of them worked for Realtime Worlds on Crackdown. Note that they have signed with a major international publisher yada yada.

Crackdown 2? Holy crap, please?

Lips for the Xbox 360

Friday, January 16th, 2009

I’ve been playing Lips for the Xbox 360. It’s a Karaoke game that comes bundled with two wireless microphones. The commercials look good, and like a lot of Microsoft ads lately (and that bizarre NXE intro movie that plays when you first update to NXE) are a weird hybrid of American, European, and Asian aesthetic resulting in something that’s slightly surreal feeling. But, I digress.

Here are my first impressions.

Some positives:

  1. It’s fun!
  2. The microphones are really nice, and wireless. And soon they’ll work with Rockband via a patch.
  3. It has more of a range of ways that you can do well (pitch, stability, rhythm, vibrato) unlike a game like Rockband.

Some problems:

  1. The pitch indicator is unnecessarily hard to scan
  2. The game slows down with custom videos and two players. Keeping time is probably on the list of things a game like this MUST do, but it fails in this circumstance.
  3. When someone sends you a challenge, you receive no notification. Instead you have to go to My Lips then select Friends, then look at your list of friends. This is really and truly unacceptable.
  4. If you win a challenge after one try, and the other person has made both their attempts, you are forced to sing a second time anyway. You can work around this by starting the song, then immediately selecting quit, but it’s not great.
  5. The microphone handling is buggy, I’ve had microphones drop out in mid song (bot not disconnect, as that would trigger an onscreen message) and then start working again in 30 seconds.
  6. Only 40 songs come with the game, which would be fine if they had a large variety of downloadable tracks. At this point, the downloadable selection is like a Christmas Music store with a handful of other tunes, approximately 20. Weaksauce.
  7. The onscreen introduction of the symbology used int he game is nonexistent. It took me a while to figure out what the 6 medals stood for, and that should have been apparent right away. It’s 2009, we shouldn’t have to look in a manual.
  8. No in-game leaderboards. Huh?

I’ve read in forums that some people had problems figuring out the syncing process for the wireless microphones. The game manual has information in it that conflicts with the wireless microphone mini-manual, and neither one is clear. I didn’t experience a problem, but I can definitely see why some people have.

There’s also a Lips website at lips.xbox.com that promises but as of this writing it’s almost all “coming soon.”

I’m keeping the game, because I hope they release some more downloadable tracks in a reasonable timeframe, but I’m not optimistic based on the rate of release so far. If I were giving it a star rating, I’d rate it 250/400 stars.

Fable II Knothole Island DLC

Tuesday, January 13th, 2009

I just downloaded the Fable II Knothole Island DLC. Spoilers follow.

So far, I’ve been digging up a lot of crap. My character is fully developed (only missing Backflip for Completionist achievement, send me a message if you can help me because I’m not forking over cash for Pub Games to get the book I need) and my dog is all powered up, so while I’m trying to fix all the weather problems, he’s constantly nagging me to dig.

Fable II

Fable II

When you get to Knothole Island, it’s all iced over. Everything is blue and cold and everyone talks about how they are freezing and how their fingers might fall off at any moment. You meet a guy identified as the Chieftan, turns out he’s the guy that summoned you to the island. Yada yada yada the weather is all messed up can you help, and then the Chieftain sends you off to find the “Sun totem” which will restore heat. This involves going into a dungeon, then solving a few puzzles to open up the final room where you turn the heat up to 11.

The reason I say 11 is that as soon as I came up from the dungeon, wow, was it hot. It wasn’t even subtly hot, the heat effects were on overdrive. the grass was brown, and I was like holy crap I bet I turned up the heat too far. Sure enough, the next main quest on Knothole Island is to end the drought. And now everyone’s hot and upset that you overdid it the first time around.

I’ll digress for a moment to say that there’s a store in town called the Box of Secrets. It has a whole bunch of gift-wrapped packages sitting on tables. When you walk up to one, you see a vague explanation about what category of item it contains, and information about what items you need to trade for whatever is in the box. When it was icy cold, there were only a few packages, but when you turn the heat up they get another shipment and more (but not all) of the tables have gift-wrapped goodness. Here’s an example of things you need to trade for the packages:

  • marriage and how to survive it
  • pretty necklace
  • puny carrot x2
  • table wine x2
  • murgo’s big book of trading x2
  • crunchy chick x3
  • crucible peanuts x2

Anyway, you get the idea. That list isn’t complete, because I don’t want to bore you to tears. Right now I’ll digress even further to list the three achievements worth 100 gamerscore that the Knothole Island DLC adds to the base 1000 Fable II score:

  1. The Meteorologist: Bring all of Knothole Island’s weather problems under control, or help another Hero to do so.Fix all of the weather problems on Knothole Island
  2. The Collector: Acquire all the mystery items in The Box of Secrets shop, or see another Hero do so.
  3. The Bibliophile: Find all the books detailing the history of Knothole Island, or help another Hero to do so.

So, now I’m off to find the Storm totem to fix the drought, but I will bet someone the 800 Microsoft Points the DLC cost that that’s going to result in floods that I have to clean up.

The books that you need are just like silver keys, only they’re books. Your dog will detect them as treasure if he sees them, and they float in space the same way silver keys did. Kind of lame.

Got that Storm totem. Also I have to say I’m going to slap my dog if he doesn’t shut up for a while about the dig spots. Anyhow, with the Storm totem, sure enough it’s raining like mad. And sure enough the island is half under water, which weirdly is the level the ice was at when this all started (I think I see where this is going). Storm Key then opens the Storm Shrine. Did I mention, 26 dig spots so far?

What Knothole Island Has to Offer

What Knothole Island Has to Offer

The Storm Shrine was definitely an exercise in programming those colored orbs in a bunch of different ways and then just throwing the kitchen sink at you. Orb puzzle, open a door, orb puzzle, open a door and pull a lever, orb puzzle, kill a banshee on your way to fighting one of those trolls with the bad skin / exposed nerves problem. Then you get the Ice Totem, and yep, suspicion was correct, the island is back to the way you found it, all iced over. And then you immediately fight another banshee and then your dog is off finding more digs spots. When you get back to the Chieftan, there’s a whole bunch of disgruntledness and you have to make one of those Famous Fable Choices, this time 10,000 gold or the love of the people of Knothole Island. After all that, you’re awarded with the Meteorologist achievement and the ability to control the weather as needed.

I guess my final verdict is the DLC isn’t really worth the 800 Microsoft Points, at least not to me. It boils down to three quests to complete (all virtually identical), find 10 “silver key” books, and then hunt around for the items you need to get the items from the Box of Secrets store. And 3.5 million dig spots, which adds up to not quite what I had hoped for. The story does have a few moments of humor, but not enough to make up for all that it lacks. I wrote this article while I was playing, and the whole thing took 3 hours.

(Also, pet peeve, I can’t believe that even in the patch they still have the default option when you start playing set to “New Game” when you only use that one time, and you use “Continue” every other time. Seriously.)

I’ve heard some talk about a resurrection shrine on the island to bring your dog back if you selected to kill him off, but I didn’t do that so it’s not relevant for me. But no, I haven’t seen said shrine yet. Oh yeah, and if you have a spare Backflip book, please send me a FR on Xbox Live, my gamertag is Minimalist360.

Vista’s Search gets even better

Tuesday, June 24th, 2008

I’m not sure why this is a completely under-the-radar release, but it improves Vista’s search in myriad ways.

http://support.microsoft.com/?kbid=940157

Aha! I get it now! Microsoft / Facebook

Friday, March 14th, 2008

Microsoft’s $240 million investment in Facebook suddenly made more sense to me.

Facebook can’t monetize. Microsoft has a micropayment system (Microsoft Points) already in place. How many Xbox 360 Live users are on Facebook already? Switch on the micropayment system and all of those users have a micropayment wallet ready to spend.

The Zune users are also part of the Microsoft Points universe, but I don’t know how many of them there are. They both tie into the same system.

This could be huge, and I haven’t seen this discussed. Perhaps this is what this strategic investment is about? Or maybe I’m just full of myself.

Frustrating Vista x64 User Profile Folder problem

Friday, January 25th, 2008

I had to rebuild the OS on my laptop, so I started from scratch with Vista x64 Ultimate. All went well during the install, and updates were installed. No crashes, no problems.

When I started using the system, I noticed some differences from the other installs. I first noticed when adding the debugging symbols to Visual Studio. When I browse folder, this is what happens:

vs_issue1.JPG

The User profile folder, which is my case is supposed to be my username, “kk” ( and is on my desktop), instead is empty. When I click on it, I get the error “The folder cannot be used.” If you look at the image, there’s an extra space in there, it’s like the folder name being retrieved by the system is null.

Visual studio recovers from this and I can browse for the folder. Apple’s iTunes, however, fails. I keep my music on an external hard drive, but when I click on “browse…” to point my music folder there, I get the same error as above, but iTunes becomes unusable after I clear the dialog. Which sucks because iTunes also base64 encodes their preferences xml files rather than just writing them out as UTF-16 encoded, but I won’t pick on Apple too much since I am a shareholder. Oh wait, yes I will, what the hell kind of boneheaded decision was that?

In Internet Explorer, you can relocate your folder for cache. Here is what comes up on a properly working system:

proper_ie_dialog.JPG

And here is what happens on my system:
improper_ie_dialog.JPG

Note the lack of the User Profile folder in this dialog. So IE wins on the “smartness” of dealing with this issue, but it’s still an issue. On a system where this works properly, you can also browse “up” in certain dialogs to the top, which brings you to that User Profile, I get the same error in that case as well.

Some things I’ve done to try to fix this:

  • I tried searching through the Microsoft knowledge base, and I find many articles about “special folders” like Music and Pictures not having the correct icons, but nothing like this.
  • I spend about an hour with procmon watching what kind of registry access is made on the system to see if it’s some kind of problem there. That was so painful — when you open a browse dialog there’s a massive flurry of activity and nothing jumps out as a problem.
  • I’ve compared permissions, etc, on a working system with this system, identical.
  • I decided to create a new account on the machine, all new accounts being created have exactly the same problem.

It’s weird how crippling this is, it’s minor issue but it comes up a lot and it makes it hard to browse for files in general. If anyone has experienced this problem, please share your findings.

Formatting FAT32 partitions > 32GB on Windows Vista

Friday, November 2nd, 2007

After years of using “fat32format.exe” on Windows XP, which no longer works on Vista, whenever I have the need to format a large drive (>32GB) as FAT32 I have simply plugged it into my Mac in the office and formatted it there, since Windows doesn’t show an option for FAT32 format for drives over 32GB.

It turns out you can force a FAT32 format with the built in format command line utility. First, if the drive is already formatted with NTFS, give it a volume name. Or, go into disk manager and delete the partition and create a new simple partition, and do not format it. For this example I have a 120GB drive on E:, formatted as NTFS.

format /fs:fat32 /a:32k e:

This will prompt you if you want to proceed with the format, and if the partition is already formatted, it will ask you to type in the volume name to proceed. That’s it, all set. The /a:32k is the cluster size and /fs:fat32 sets the filesystem. For some reason you can’t combine these with the /Q (quick) flag, which would be nice.

You probably either need to have UAE off like I do 90% of the time, or run in an elevated command window.