Page 1 of 9 in the Programming category Next Page
# Wednesday, December 14, 2011

So here’s the scenario, you have 2 links below. In Internet Explorer 8 and above right click on both of them and check out the difference in behavior.

Link One

What you should see is that for Link One you’re able to see the options you expect to see when right clicking on a link, which is the usual Open In New Window, New Tab, etc. etc. options. But for Link Two you don’t see such options.

This bothered me for quite a while wondering what was causing this problem. Finally after some poking around I figured it out. The HTML for Link One looks like this.

<a href=”http://www.windowsphone.com”>Link One</a>

Nothing out of the ordinary there. Now let’s look at Link Two.

<a href=”http://www.windowsphone.com”><div>Link Two</div></a>

Notice that there’s a DIV tag enclosed in the A tag. And it seems like this causes IE to decide not to show the typical right click on link options. Any element that has a CSS display attribute of BLOCK or INLINE-BLOCK contained in an A tag will cause IE to NOT display the typical link context menus on right click.

Definetly a bug. Doesn’t seem to be anyway around it. So… just remember this behavior and not use BLOCK tags inside A tags. The only other fix for your page is to force compatibility mode I guess, since pressing the compatibility mode button in IE8 fixes the problem. But that just introduces other problems.


Wednesday, December 14, 2011 1:30:41 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Monday, October 24, 2011

I was preparing my Silverlight XNA hybrid application in Windows Phone 7.5 Mango presentation demo project for TechInsights 2011 (Sign up now!) When I hit a problem, The ContentManager  threw an exception whenever it was time to load an asset. Specifically it was a KeyNotFoundException.

After some digging around it seems like there's a problem with the project template itself. (!) The gist of it is, in the App.xaml.vb file. Under the InitializeXNAApplication function. You'll find the line below :-

If obj Is GetType(IGraphicsDeviceService) Then

This line is supposed to find an obj that implements IGraphicsDevicesService and add it into a list of services. But the code is wrong, this line needs to be changed to:-

If TypeOf obj Is IGraphicsDeviceService Then

In order to work properly. This ONLY affects the Visual Basic Windows Phone Silverlight And XNA Application project template.

The main question I'd like to ask is how the heck did this error make it out to the release SDK? Since I do remember everything working during the CTP. Also, even Microsoft's own VB code samples for this project type uses the correct method call.


Monday, October 24, 2011 10:09:00 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Sunday, March 13, 2011

While working on my little XNA sample I bumped into a little problem. No matter how much time I spent on it, I can't draw for the heck of it. And not to mention, the total time it'd have taken me to draw a set of sample sprites might have allowed me to finished another code module on the sample.

In a suddden eureka moment I picked up the Asoblocks I bought a while back, put together some models and then took this photo.

Source

The individual elements were then color keyed so I'd have a pretty nice template to work with.

player

Then it was a matter of resizing the image and adding some extra details and viola…

invaderwin

Definetly better than me trying to draw the whole thing!


Sunday, March 13, 2011 6:20:15 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Saturday, March 12, 2011

Microsoft's XNA is a game development framework which allow the creation of games for various platforms through the use of Managed .Net code. What I found extremely nifty while I was doing some research was that once I had a simple app running on Windows Phone 7. (emulator only since I've run into a little snag trying to obtain deployment credentials)

invadershot

Since the app code is pretty simple, if I wanted to create a Windows desktop app all I needed was to select Create Copy Of Project For Windows and... Windows version of the same app!

invaderwin

Yes, I realize its because I have no UI code or anything platform specific, but I can't help but geek out a little by selecting Create Copy Of Project For XBOX 360 , added some code to control via the gamepad instead of the keyboard and...

DSC01389

As I've dabbled with DirectX previously in the past its very welcome to know that in XNA you get to worry about the important things like how to write your game then worry about detecting device context, getting exclusive access to hardware, etc. etc.

Hope I'll find more time to play with this.

You can try out the Windows version of the program here. Unfortunately, you need a pretty decent video card before you can run it.

Update – Figured out that there's a lower requirement Reach profile I can compile the program for, you can get it here.

You'll need to install the XNA Framework Runtime if you don't already have it by any other means.

Arrow keys to control the ship, Space to fire, Z to enagage DEATH BLOSSOM mode!


Saturday, March 12, 2011 1:48:31 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Thursday, July 22, 2010

This post is used to test Facebook's fb:like widget after I done some editing to the system.

Ok.. I give up, this whole thing just works REALLY REALLY weird, I can only suggest that if you want to use the fb:like button then do remember to put the Open Graph tags.


Thursday, July 22, 2010 10:15:48 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Wednesday, July 14, 2010

Ok, I've nabbed the new Beta developer tools for Windows Phone 7 (and still cursing the fact that no offline installer is available) dropped it into a test VHD and did a quick test project to test out wheter the previous Silverlight 4 port of the library works on the phone (and also in Silverlight 3) and... well.. it works without a hitch, so if you were looking for a QRCode library for use in  Windows Phone 7.

Download it here.

Enjoy!


Wednesday, July 14, 2010 10:59:24 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Friday, June 25, 2010

Google has a great barcode reading program/library in the form of ZXing. They had a CSharp branch already but not a Silverlight one. So I looked through the code a little and ported the QRCode portion of the library for Silverlight use by doing the following

  • Replaced System.Collections.Arraylist with System.Collections.Generic.List <Object>
  • Replaced System.Collections.HashTable with System.Collections.Generic.Dictionary <Object,Object>
  • Removed all Serializable attribute markings
  • Forced all calls to System.Text.Encoding to use UTF-8 as the encoding type.

While the first two changes might have a performance impact to the code, it's the LAST change that worries me since it deals with encoding, specifically I worry about exactly how well can the code deal with NON English content... oh well, that's a challenge for another day I guess.

What is that you say? Talk is cheap.. then GIVE IT A TRY!! How does it work? Create some tags.. save the tags as PNGs, then Read some tags by loading images which contains tags. Or.... Take a PICTURE of a tag using your webcam! Oh.. if your webcam can't take nice sharp images, you might want to invest in an autofocusing camera like the Microsoft LifeCam HD-5000.

DSC09111

What's that you say? It's an Open Source project therefore I need to contribute my code back into the trunk? Well.. sure... the source for the sample along with the lib is here.

The code was compiled for Silverlight 4, technically I don't *think* I used anything that won't allow it to work with Silverlight 3 though.

As to how to actually contribute it back in the trunk errr.. I guess I'll have to get in touch with the guys that's handling the project.

So.. 2 things that need to be done now.

  • See how to integrate with RawVideoStream and read tags off a LIVE video stream
  • See if the library works with Windows Phone 7

The 2nd would be a bit more difficult since I DON'T HAVE A WINDOWS PHONE 7 device! :P


Friday, June 25, 2010 12:03:57 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Monday, May 03, 2010

So after Facebook comment integration. Now I've got Twitter integration. At least I hope I have. This is going to be the post I test it on!


Monday, May 03, 2010 6:32:41 PM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Sunday, May 02, 2010

Is that sometimes they don't want to show up. I have to refresh the page to make them appear. Right now with our internet being shot to hell it's hard for me to tell if it's the line or problem with code.


Sunday, May 02, 2010 10:15:16 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
# Monday, April 12, 2010

Well I'm done packing and ready to head out the the Malaysian launch of Visual Studio 2010 tomorrow, and if you can't make it there physically, you can still watch a LIVE webcast of the event if your office Internet holds up at the local event site.

I'm done packing, and I'm bringing a little friend for a little trial run.

DSC06419

And of course, because a hacked up little cage containing a SLAB and a bunch of velcro straps would probably scare the bejesus out of everyone.

DSC06418

Now I just like look like some dumb schmuck who is hanging a small bag from the probably fragile and not meant for load bearing hook on his bag.

Seriously... I don't know if the little strap will hold or not! Not even sure how long the battery would last... heck the last time I was in Sunway Pyramid Convention Center, cell phone reception was pretty crappy! Would I even got proper signal in there this time?


Monday, April 12, 2010 12:56:38 AM (Malay Peninsula Standard Time, UTC+08:00)  #    Comments [0]  | 
Page 1 of 9 in the Programming category Next Page