ChiaFong

Archive for October, 2008|Monthly archive page

Finally Something to help me blog about source code

In Programming on 17 October, 2008 at 7:00 am

Yes! Finally!  CopySourceAsHtml come to the rescue.  I was just wondering why is it that putting source code on to a HTML page is so difficult and I accidentally bump into a page that talk about using CopySourceAsHtml add in for Visual Studio 2008.  It is still a bit tedious but definitely much much better than manually hand code the html tag or using CSS.  CSS can help a lot as well but when you change your web design, you’ve got to remember to add the necessary CSS back and if you are on a web site that wants you to pay for using CSS then you are out of luck.

Developer who blog should definitely check out this wonderful add in.

Silverlight 2.0 is released

In Programming on 15 October, 2008 at 7:00 pm

And so the challenger to flash has finally come of age.  Silverlight 2.0 should be the one that really put Silverlight on the map but I’ve to agree that Silverlight 1.0 did help to jazz up the scene for the release of 2.0.  Be sure to check out this cool site that uses Silverlight 2.0, Hard Rock Memorabilia, by Hard Rock Cafe, especially if you are a fan of Jimi Hendrix or Elvis Presley or The Beatles or …

Next generation Windows, officially known as Windows 7

In OS on 15 October, 2008 at 7:00 pm

I was just talking about the change in codename from Vienna to Windows 7 and Microsoft officially announced that the new name for the next generation Windows is going to be Windows 7.  Simplicity? Copied from Apple?  I hope they didn’t pay some expensive product consultant to come out with this name.  Personally I’m neutral to the new name, it is the OS itself that matter.  And I sure hope that the pre-beta that Microsoft is going to review is closer to the one that they are going to ship.

Windows 7

In OS on 13 October, 2008 at 7:00 pm

It been a while, Microsoft has changed the codename of the next generation of Windows to simply Windows 7 instead of the previous Vienna.  With the PDC 08 coming real soon and Microsoft promise of letting the attendee have the first public bit of the OS, more and more information on the OS has been released.  It will be interesting to see the new features that Windows 7 is going to offer.

Omnia? No thanks.

In Electronic on 10 October, 2008 at 7:00 pm

But that is just my personal feeling, I’ve never like those phone without any keypad anyway.  Though I should say that SMS with Omnia is definitely better than iPhone as the predictive text input pick out the word that I want to type just after 3 characters, for iPhone it is like until the 2nd last character.  Overall the phone is sturdy, nice screen and it has a side bar kind of thing that let you drag and drop application just like the side bar on Vista.  The 5 mega pixel camera let you take really sharp picture such that even text on a printed label can be seen very clearly.  Also it has a smile detection feature, good for taking cute baby, you just need to point the camera and wait for the baby to smile and you have a very good picture to keep for memory.  Size wise it is just nice to hold when you want to make a phone call.

However the problem with Omnia is the Windows Mobile 6.1.  Since the OS has its own icon and Samsung take pain to create nice looking icon to complement their nice phone, the default icon use by the system look very much out of place.  And why is it that every Windows Mobile phone’s default system icon look so jagged, I thought by now icon should be looking sharp with so much advancement in technology.  What a disappointment.

Slow resizing?

In Programming on 8 October, 2008 at 7:00 pm

Ever feels that the WPF application that you are working on, seems to maximize or resize quite slowly?  If your system is not using a top end graphic card (e.g. on board graphic chip or Nvidia 9300 GS) the likely culprit might be the bitmap effect “dropshadow”.  Since bitmap effect is software rendered, turning on bitmap effect “dropshadow” on a large piece of UI graphic will be quite taxing on the graphic engine, thus resulting in somewhat slow performance when maximizing or resizing.  Turning these off will let you get a instantaneous performance boost.

If you have installed the Windows SDK and choose to install the WPF Performance Suite as well, you can make use of the Perforator which will let you see what part of your WPF app is rendered in software (if you’re using Vista, just do a Instant search for WPFPerf.exe).  If you have some performance issue with WPF application, this tool will be your friend, make full use of it!

So much for Apple’s ease of use claim

In Electronic, OS on 5 October, 2008 at 5:39 pm

I was helping my elder sis setting up her iPhone 3G.  She actually had her iPhone 3G for a while already but wasn’t able to download any application into her phone.  I was a bit puzzled when I heard that but it became clear once I sat down in front of her computer.  Her iTunes can’t run, somehow iTunes seems to crash every time it start up.  Data Execution Prevention (DEP) of Vista prevented iTunes from illegally accessing the system memory.  A bit of search found out that this kind of incompatibility happened for quite sometime already, since the days of iTunes 7.x but my sis is actually using the latest 8.0.  OK, so this might be some Vista problem, but a company as big as Apple can’t get their act together to make their software compatible with the latest OS?  And the OS has been out for nearly 2 years already!

Luckily my sis has another laptop with XP instead of Vista, thus I managed to install iTunes 8 on that laptop.  iTunes managed to startup with no problem this time and we quickly get to the part whereby iTunes ask to register the iPhone.  We were thinking “Why not” and so we started the registration process but the problem quickly came in the middle of trying to submit the payment method.  No matter how many times we try to click the submit button, iTunes just stay at the request for payment method page.  Finally we’ve got no choice but to choose “Cancel”, but that doesn’t help as well. iTunes needs to be restarted.  We tried to re-register but were told that the account is already in used.  We tried the apple account and everything seems OK.  Thus I decide just to carry on.

Since the iPhone 3G has some problem with the WiFi (all other devices can access the WiFi in the house with no problem but the iPhone just don’t like the WiFi, it can connect to the WiFi with no problem but it won’t display any website, keep saying that the server is busy) and that I’ve read somewhere in the papers that the original firmware that comes with the phone cause a lot of problem, I decided to help my sis upgrade her iPhone to the latest 2.1 firmware.  It seems simple, iTunes 8 detected that the phone needs the latest 2.1 firmware and there is this “Update” button.  So I click the update button and iTunes prompt an error, something like “unknown problem, code 9006”.  Good it tell me the problem is 9006 but what is 9006!  My goodness this is Apple software!  I quickly realize that iTunes was trying to download the firmware, I click on the downloading page and saw that the download goes until about 10Mb and the error appear.  I decided to try again, this time 12Mb and I tried again, 9Mb, and again 15Mb.  So it seems that there is some problem while trying to download the about 200Mb of firmware update and since there is no way the iTunes going to help, I’ve decided to keep trying.  Fortunately the download went through after several more retry and luckily the download didn’t stop at 199Mb.  But the thing is that automatically resuming an aborted download has been around for so long already, can’t iTunes just help to do that?

Sure enough the 2.1 firmware helps to make the iPhone agrees to work nicely with the existing WiFi and web surfing is now possible.  What a relief.  So we decided to try the Apple store and download some free applications into the iPhone.  Again problem strike, clicking the “Install” button produce nothing, then I realized that it is again trying to download something but the download status quickly disappear.  This time though I can’t get the download to work, but then I realized that there isn’t any error and I decide to check the iPhone “tab”.  Under the “Applications” tab, sure enough the application that we are trying to install was listed, but from the page you can see that the application is on the PC but it wasn’t sync to the iPhone.  When we were trying to setup the phone, we choose not to automatically sync the PC to the iPhone.  So we need to manually sync the downloaded application to the iPhone but iTunes didn’t tell us that we need to do this, after it download the application, it just stop there.

Yeah, so much for Apple’s claim that their software are easy to use and that their products never fail.  They are also human and they also make mistake, just like any other software or hardware company.

Implementing that flat button but get into a clicking problem?

In Programming on 1 October, 2008 at 3:15 pm

Ever try to implement an IE or Firefox kind of flat button (it look like just a image of a toolbar but if the cursor hover over it a square will appear around the image and make it look like a clickable button) in WPF but get into problem because it turn out that clicking the button becomes difficult as you will need to point accurately on the button’s image to activate a hit.  This is most likely because you are using x:Null for the background so that when the mouse cursor is not hovering above the button, the button will appear like a normal image.  Alpha channel to the rescue.  Instead of using “No Brush” (i.e. x:Null), you should actually play with the alpha channel.  Color definition in WPF is more than just RGB, it is actually ARGB with “A” representing the alpha channel.  Think of alpha channel as a opacity value, thus in hexadecimal, FF is full opaque and 00 is totally transparent.  Thus the background of the intended flat button should be declare as #00FFFFFF which is asking WPF to use a transparent color (when A is declare as 00, the value of RGB is actually not that important, as any value there will still mean that the resulted color is a transparent color).  This way even when the mouse cursor is on a transparent background (non-image area), it will still score a hit on the flat button.