Yahoo Messenger Status On a Web Page

Recently have a requirement in my work that required me to embed a YM online status on the web page. Get to know from my helpful colleague, where I can use YQL to do some query to get the status, what it will do is do a REST call and return us with a XML, and we can get the status within the XML.

After another round of searching, found a more simple way, using the URL in the image tag directly will made the life easier.

<a href="ymsgr:sendIM?YahooID">
  <img src="http://opi.yahoo.com/online?u=YahooID&amp;m=g&amp;t=0" border="0">
</a>

Where the URL thingy in <a> tag is the code that called up YM to send a message like how Live Messenger does (I guess, not yet tested with YM). The src in the <img alt="" /> tag is to get the online status picture from Yahoo by passing in the ID, while the t parameter is the image type, option from 0-24. Obviously, the YahooID need to be replaced.

December 20, 2009 · Stephen Saw

T3Desk

Found another desktop enhancement/management/eye candy freeware, the T3Desk, it looks cools at the beginning, it got nice spinning animation.

What it does is actually is when minimizing the windows while pressing the shortcut key, it will turn the windows in to a 3D windows and placed on desktop, which in turn it will change direction where it face real time when moving around the desktop.

Final thought, it made my desktop even more clustered than usual, even though they claim to be alt-tab alternative, which alt-tab is navigating through windows that is actually “minimized” into the taskbar, while T3Desk “minimized” by just simply making it a small 3D windows on desktop, which in turn it breaks the the thumbnail preview in Vista (I believe it will also in Windows 7).

December 20, 2009 · Stephen Saw

VirtualBox 3.1.2 Fixed My Ubuntu

Run my Ubuntu in VirtualBox back then before 3.0, I can enable the normal graphics effects, like menu fading, and others. When I upgraded to 3.0, it breaks everything, even the basic menu fading also not working, it stuck in half transparency and stays until I click on something else.

The VirtualBox 3.1.2 update dialog bugging me every time I open my VirtualBox interface, and today I finally installed. Run the VBoxLinuxAdditions-x86.run to update the client addition, and the Display option shows extra option, which is enable the 2D acceleration, I enabled both 2D and 3D, and now it works like a charm, I can even do full graphic effects in my Ubuntu 9.10 box. Yay!

December 19, 2009 · Stephen Saw

JoliCloud Another Linux Distro?

Another free OS for netbook appears, perhaps trying to take on Google’s Chrome OS? Downloaded the ISO and tested it.

JoliCloud setup screen
JoliCloud setup screen

Setup option screen, looks like Ubuntu, with different color and name.

JoliCloud initializaing
JoliCloud initializaing

Loading screen is actually nicer than Ubuntu. Nice and sleek dark gray with a nice HP Mini (I guess) there, with a nice orange color progress bar.

JoliCloud homescreen
JoliCloud homescreen

After login, greet with a nice black and simple screen, which all of the menu item is just like other Linux distro.

JoliCloud Homebase
JoliCloud Homebase

When click on the cloud on top right item, it’ll bring us to the jolicloud homebase, which I’m not interested to try out.

JoliCloud file browser
JoliCloud file browser

Clicking on the folder and other stuff still open a windows like usual Linux distro.

Beside of the home screen, most of the thing looks like Ubuntu to me, and the home screen might get people not so use to it on first time use, as it does not looks like usual Windows, Mac OS X, or other Linux distro desktop, well, at least for me, is eye catching, but I prefer usual desktop, so Ubuntu still the suit me best.

December 12, 2009 · Stephen Saw

Cable Management with Wire Loom and Bata

Cables and dust all over the place under my desk, I can’t stand it anymore, head to hardware store to grab a 2 meter long wire loom, cost me RM17, quite costly for such thing.

Well, CPU sits on the floor, and 1 extension and 1 power regulator on the floor. Can’t put everything in the tube thing, so decided to grab my dvi cable, 2 USB extension and my Xbox wireless receiver and put inside the tube, and then go through the back of my LCD, the little hole on the stand there, nicely hiding the tube and all other cables.

Found my cheap ass Bata shoe box laying there on the cold floor, decided to put it on good use, become the cable box, holding my extension and my speaker’s heavy adapter, the extension host my LCD, CPU, speaker and my phone charger, and made some tiny holes for speaker and charger cords, and big one for LCD and CPU.

Now everything is pretty ok, but the cables still showing under the table, not much, next phase should get some thing to put behind of the table and hang those cables, and made it well hidden.

Wire loom cable management
Wire loom cable management

December 12, 2009 · Stephen Saw

Running .NET EXE In Linux

Being a .NET developer from the beginning made me having headache how to run my application in the Linux environment, without having to learn other language, like C++. Thankfully there is Mono project in Linux, the open source .NET environment in Linux and Mac, can even use on Windows.

Running Ubuntu 9.10, we must first get MySQL server and client installed, and also the MonoDevelop. Using the Ubuntu Software Center, which provide very easy and straight forward installation. To install MySQL, first search for the MySQL Server, Administrator and Query Browser.

Ubuntu Software Center searching for MySQL
Ubuntu Software Center - MySQL

After that is the extension for the CLI to use MySQL connection. We can use the Synaptic Package Manager to install the connector.

Synaptic Package Manager install MySQL CLI
Synaptic Package Manager - CLI

Lastly is the main course, MonoDevelop, can also easily install from Ubuntu Software Center, by searching MonoDevelop.

Ubuntu Software Center searching MonoDevelop
Ubuntu Software Center - MonoDevelop

MySQL is just the same like Windows’ version, the GUI also the same as well. So it didn’t cause much trouble to get the database setup. MonoDevelop can be launch from Programming –> MonoDevelop. It more or less looks like the Microsoft Visual Studio 2005, so we pretty much do all the same thing like what we do in Visual Studio, with C# 2.0, exactly the same way (in this testing).

Testing MySQL in MonoDevelop
Testing MySQL in MonoDevelop

Well, without using Wine, I still not able to figure out how to un the exe by double click, but with Mono, we can run the exe using the Terminal.

Running MonoDevelop
Running MonoDevelop

Without having much learning to be learn, I can easily create a simple apps using .NET knowledge and run it in Linux, thanks to the Mono project. Can’t wait to get my hand on the Moonlight project and also looking forward for the LINQ. 😀

December 6, 2009 · Stephen Saw

Simple String Encryption

There is one neat little Data Protection API (DPAPI) built in since Windows 2000, and we can access it using .NET through ProtectedData class from System.Security.Cryptography namespace.

To use ProtectedData, first we need to add System.Security.Cryptography reference to our project. With 2 obvious and simple method Protect and Unprotect, which clearly stated is to encrypt and decrypt. It’s dealing with bytes, so converting from bytes and to bytes is needed.

Here’s the code example:

' Create a simple byte array containing data to be encrypted.  
Dim secret As Byte() = {0, 1, 2, 3, 4, 1, 2, 3, 4}

'Encrypt and convert to string for display purpose 
Console.WriteLine(Text.Encoding.Default.GetString(ProtectedData.Protect(Text.Encoding.Default.GetBytes(stringToEncrypt), secret, DataProtectionScope.CurrentUser)))

'Convert encrypted string to bytes, decrypted and converts back to string  
Console.WriteLine(Text.Encoding.Default.GetString(ProtectedData.Unprotect(Text.Encoding.Default.GetBytes(data), secret, DataProtectionScope.CurrentUser)))

Cool and easy 😀

December 2, 2009 · Stephen Saw

Microsoft Office 2010

Microsoft Office 2010 gone public beta, woohoo~. Received invitation to download the Starter edition, fool around for a little while, I’m quite lovin it.

Well, the ribbon is still there, but it’s not so clustered look, it now giving rather flat and clean feel. I don’t have the new graphic thing in my version, so I’m not so sure about it, but seen it in video before, it’s pretty amazing for a simple photo editing needs. There is also some collaboration features there for paid version, yes, Starter Edition is free! Of course, with little ads here and there, but this article might be exaggerated a bit, from what I’ve seen in the beta, is just a small tiny ads there, you won’t even notice is there if you concentrating on your work, of course, if one would have open Word just to look at the interface, there is no point to get a Word installed. So finger cross for no big changes coming for the ads.

There are few things that in the Starter Edition I quite enjoy is the Print preview, rather than it open up a new windows for the print preview, it is there on the menu, live update while we tweaking the print setting on the left hand side. Plus, since Office auto save for a interval of time, we can easily revert back to certain period of the draft. And my favorite one (beside free), is the portable install, we can install our Office 2010 to a pendrive, for around ~300MB of space, and it works pretty well so far. But it created a Local Disk (Q) drive in My Computer, I’m not sure what is it for and how to remove it yet.

Microsoft bringing free version of SQL Server, Visual Studio, and now Office for people who don’t need those fancy and powerful feature for no cost, and I hope to see more products that will have an alternative free version, hmm..what else could we all use, Windows? nah… they won’t.

November 23, 2009 · Stephen Saw

ASP.NET 2.0 PostBack Event not Firing

I’m developing Ajax enabled web application using asp.net 2.0 , having working for very long time, one fine day all button not working, all codes that suppose to fire after postback is not firing after page postback. I had no idea what happened, it might be web.config that I mis-configured, or JavaScript that conflict with my Ajax engine.

So I had decided to start a fresh Ajax enabled web application project, quickly drag and drop a button and a label, code the button with

Label1.Text = "Testing"

Put a breakpoint on the only line of code for tracking, F5 run it and it just not hitting the breakpoint after the page is postback, it just simply postback for nothing! Quickly hand on another fresh pure ASP.NET web project, done the same thing and the same thing just keep happened.

Being so helpless for first time, looking over Internet for solution, most of the similar problem can be solved by reinstalling the IIS, the framework and using some properties for the button. I can’t solve mine here. Told my boss I need time to get it solved, right after told him, I remembered that I did some altering on my ASP.NET configuration in IIS during testing for localization. Quickly head back to the IIS and compared with the setting of the IIS that sits quietly on our network machine.

These are the steps taken to locate and fix the culprit:

  1. Right click on the Default Web Sites, select Properties
  2. On the Default Web Sites Properties, select ASP.NET tabs, and click on Edit Global Configuration.
  3. On the ASP.NET Configuration Settings, select Application tabs.
  4. The Request Encoding and Response Encoding is the culprit for everything, I had altered it to some other value and it not working, well changing it back bring everything back to life!!

Default web sites properities
Default web sites properities

ASP.NET configuration settings
ASP.NET configuration settings

November 16, 2009 · Stephen Saw

Touching Wiimote Whiteboard

Browsing over the Internet, come across the Johnny Chung’s post on the Wiimote Whiteboard, which utilizing the Wiimote to detects infrared signal, with the helps of a calibration software running, turn whiteboard into “touch” enabled whiteboard.

The theory (explained by Johnny Chung) which upper front of the Wiimote is a camera that will detects only infrared light, which the infrared is emitted by the sensor bar. Pairing the Wiimote to PC via Bluetooth (Gosh, Wiimote has Bluetooth), hooking up with the calibration software. Is cool that Windows detects Wiimote as a input device without any hassle. Pressing and holding the Button 1 and Button 2 on Wiimote will let it pairing to the Bluetooth.

1st Round test with TV remote, which emitting infrared signal as well, but the result was terrible, during calibrating with the software, suppose there are 4 point to be calibrated, when pressing button on the TV remote, it blink and sending few signal, which skipped 2 of the point, ends up the TV remote calibrated badly, somehow it can be detected, but not usable.

Bought a Infrared LED from a electronic store, due to forgotten to buy wire to hook up the LED legs, have to ripped out one of my spare cable on my PSU, which then it works. To test the LED, I had to view the light over my PDA’s camera, because we can’t see it with our eye.

After tested everything, is time to mod a Infrared Pen, ripped an old pen, joining wires together, and it ends up like this.

Battery attached to pen
Battery attached to pen

LED mounted on pen
LED mounted on pen

The LED mounted on the pen, had to use tapes to wrap around the LED to make it fit on outside. Haven’t got the pushbutton switch for the on/off function, just had to leave two wires at the moment.

Wiimote pen wiring route through back of pen
Wiimote pen wiring

Wires are pull from the LED out to the back and extend with extra wires to reach the battery

Wiimote pen LED lighting up
Wiimote pen LED lighting up

Infrared in action, which the light can only be seen in camera screen. The light looks dim to me. Too bad, it works, but not working well. 🙁

November 16, 2009 · Stephen Saw