Tuesday, April 10, 2012

Trying out Mosh

Found another tool from HN with over 700 upvotes. Why not give it a try?!?

Mosh is another terminal application which handles unstable internet connection. It also employs a local buffer so that you get instant response after each keystroke. The latter is what I have always wanted to see for a very long time. I have a VPS account with RackSpace, and with crappy internet connection here it took very long before each character appears on my screen after each keystroke, making it very hard to work with.

Notes for the problems I encountered while trying to install and use Mosh:
  • I have to install Mosh on both the server and the client. I installed Mosh on both my the OS X and my Ubuntu 64-bit server.
  • OS X's terminal is, by default, sending its LC_* environment variable when you SSH to another machine. LC_CTYPE is set to UTF-8 by default and it is fine under OS X Lion. But when this is send to my Ubuntu server, it caused a problem with setlocale call. Must comment out SendEnv line in /etc/ssh_config on my Mac. Thanks to tip from this page! - http://thegreyblog.blogspot.com/2012/02/fixing-mac-os-x-lions-ssh-utf-8-issues.html
With this, I can mosh to my Ubuntu server, the same way as I do with ssh:

$ mosh m3rlinez@gantserver.com

I got the response from each keystroke almost instantly as advertised, albeit there was usually an initial long lag before I could type smoothly. This was impressive as the response time was waaaay better than a normal ssh. Way to go Mosh!


Sunday, September 25, 2011

Reply: Some thoughts on tests' maintainability

This was to reply to an interesting post of my friend. Unfortunately, Blogger is not able to handle my long comment. Maybe it is too long, or may Blogger think I am a spammer. Anyway, the comment is long enough for me to dedicate one of my post here for it:


Interesting post. I'm in my first years practicing unit testing too. Won't miss leaving a long comment here!

It seems the very problem about unit testing for you is about maintainability of the test cases. It was a question for me too about how many tests to write for particular class. The lower number of tests you write, the lower maintainance problems, right?

There are some occassions I avoid writing tests for. I am not claiming these are right or wrong but it seems to work for me.

#1: During our undergrad years, I was introduced to unit testing (with JUnit.) What I remembered are that we are encouraged to write tests for as many methods as possible. We even generated the tests for plain getter/setters. Come to think of it now, that was totally unpractical!

So now I just skip the simple methods I am sure there are only silly test cases for it.

#2: Another thing is about writing test for private methods. When you design a class, you are giving your users some kind of contract by providng public methods. These are something that should be broken or be changed often. If you need to change these often, you may have to admit the class is incorrectly designed and thus rewrite/add the tests.

However, I do not test private methods. This give me some room of flexiblity where I can change/optimize/organize the inner working of the class. I can change the signature/working of private methods any way I would like to, but I just need to make sure the public methods do pass the tests.


#3: I do have some tests you referred to as 'small acceptance tests.' However, to perform 'unit' testing, you test one and only one class. If the class depends on some other concrete classes then you have to change them to abstract/interface instead. If you are testing more than one classes than that may be considered as 'integration' testing, or some other names.

That was quite hard core! While I know this, I don't mock out some dependencies for small classes. That would require some efforts. But still, I would write integration tests for it.


Clearly, innovations in our world do not start with requirements from users. So all these models starting from requirement gathering are all WRONG. If you want to introduce something now, use whatever you like and do whatever you want to. But if you are building something big, you must also need to look into the rear mirrors and you do need some confidence going forward. Unit tests, test coverage, etc. are some of the answers to that.



Sunday, July 10, 2011

Generating Permutation with Javascript

I got hit by an interesting problem of “Zebra Puzzle” the other day. It is a well known logic puzzle believed to be first invented by Albert Einstein.

The question here is, how do we use our favorite programming language to solve this problem?

The first obstacle I found is that we need to generate all permutation of given list. Say if we have [1,2,3], we have a total of 3! = 6 which are [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1]. I couldn’t find simple Javascript code for this so I ended up writing one. Reinventing the wheel is fun, isn’t it? :))

Wikipedia suggests the following algorithm for generating all permutation systematically.

The following algorithm generates the next permutation lexicographically after a given permutation. It changes the given permutation in-place.

  1. Find the largest index k such that a[k] < a[k + 1]. If no such index exists, the permutation is the last permutation.
  2. Find the largest index l such that a[k] < a[l]. Since k + 1 is such an index, l is well defined and satisfies k < l.
  3. Swap a[k] with a[l].
  4. Reverse the sequence from a[k + 1] up to and including the final element a[n].

Here is my PermutationGenerator module implemented in Javascript.

/////////////////////////////////////////////
// Permutation Generator
// - generate all permutation of given string
// array
// - Natthawut Kulnirundorn <m3rlinez at email by google>
// http://www.solidskill.net 10 July 2011
/////////////////////////////////////////////

var PermutationGenerator = (function () {
var self = {};

// Get start sequence of given array
self.getStartSequence = function (list) {
return list.slice(0).sort();
};

// Get next sequence from given array
// Ref: http://en.wikipedia.org/wiki/Permutation#Systematic_generation_of_all_permutations
self.getNextSequence = function (list) {
// Make clone
var a = list.slice(0);

//The following algorithm generates the next permutation lexicographically after a given permutation. It changes the given permutation in-place.
// 1. Find the largest index k such that a[k] < a[k + 1]. If no such index exists, the permutation is the last permutation.
var k = -1;
for (var i = 0; i < a.length - 1; ++i) {
if (a[i] < a[i + 1]) { k = i; }
}
if (k == -1) return null; // means this is the last one

// 2. Find the largest index l such that a[k] < a[l]. Since k + 1 is such an index, l is well defined and satisfies k < l.
var l = -1;
for (var i = 0; i < a.length; ++i) {
if (a[k] < a[i]) { l = i };
}
if (l == -1) return null; // impossible

// 3. Swap a[k] with a[l].
var tmp = a[k]; a[k] = a[l]; a[l] = tmp;

// 4. Reverse the sequence from a[k + 1] up to and including the final element a[n].
var next = a.slice(0, k + 1).concat(a.slice(k + 1).reverse());

return next;
};

return self;
} ());





Test cases, also serve as a user guide :)



/////////////////////////////////////////////
// Test Cases
/////////////////////////////////////////////

var PermutationGeneratorTest = (function () {
var self = {};

function getStartSequence_Test1() {
var a = ['red', 'white', 'green', 'yellow', 'blue'];
var res = PermutationGenerator.getStartSequence(a);
log('input = ' + a);
log('output = ' + res);
}

function generateSequence(list) {
var current = PermutationGenerator.getStartSequence(list);
var count = 1;
log('start = ' + current);
while (true) {
current = PermutationGenerator.getNextSequence(current);
if (current == null) { break; }
log('next' + (++count) + ' = ' + current);
}
}

function getNextSequence_TestNormal() {
generateSequence(['English', 'Spanish', 'Japanese']);
}

function getNextSequence_TestEmpty() {
generateSequence([]);
}

function getNextSequence_TestRepeat() {
generateSequence(['gant', 'gant', 'korkore', 'jan']);
}

self.runTests = function () {
log("=== getStartSequence 1 ===");
getStartSequence_Test1();
log("=== getNextSequence Normal ===");
getNextSequence_TestNormal();
log("=== getNextSequence Empty ===");
getNextSequence_TestEmpty();
log("=== getNextSequence Repeat ===");
getNextSequence_TestRepeat();
};

return self;
} ());







I have put the working example on http://www.solidskill.net/ZebraPuzzle.htm. There are other parts of code that search through the solution space, setup the constraints for Zebra puzzle. But they are not discussed here.



There are some things to note about this implementation though. First, it is not very efficient. You can see in the getNextSequence(..) loop that there are loops used to search for k and l that satisfy the conditions.



Second, there could be problem with list of integers. The Array.sort() in Javascript sort using string interpretation by default. So [4, –1, 100, 500].sort() would return [-1, 100, 4, 500] instead of expected [-1, 4, 100, 500]. One must give Array.sort() function the comparer in order to properly sort list of integer. I design this module to work with list of strings initially.



Hope this helps those who are looking for permutation generation code.

Sunday, January 9, 2011

Seagate GoFlex TV “Logon Failed”

goflex_tv_screen_320x340

I just recently got my hands on Seagate’s GoFlex TV. In combination with my existing 32” LG TV, this device would allow the playbacks of the movie files, in so many supported formats, from the USB storage device directly to my 1080p TV. This sounds very perfect to me as I often find it’s not very easy to turn on my desktop PC just to watch movies. The device comes with LAN adapter which allows it to connect to your home network, and view YouTube, Picasa, or playback from network’s shared folder. Moreover, to my surprise, it also supports USB keyboard! This was beyond my expectation.

Enough for the introduction.

Playing back from USB storage was fine and good, and it works nicely with my Buffalo portable HDD out of the box. The real pain kicks in when I tried to play my *.mkv file sitting on my Windows 7 PC’s shared folder. The GoFlex keeps asking for username and password which I entered numerous times over few hours, and without success. It keep showing “Logon Failed” message on the screen! This is pretty annoying.

Search from Google didn’t give much help, but the search on Seagate’s user forums itself revealed a thread containg instructions which fix the problem! Original post at http://forums.seagate.com/t5/FreeAgent-Theater/FREEAGENT-A-Guide-to-get-the-most-out-of-your-FAT/td-p/48382

WINDOWS 7, NETWORK PROBLEMS:

So, you have Windows 7, but you can't get your FAT+ to log on to the network.  Well here's some instructions to help you get around that:

 

First go to the Control Panel, then select Network & Sharing Center, then on the left pane select "Change advanced sharing settings".

  • Then select in the settings:
  • Turn on network discovery
  • Turn on file & printer sharing
  • Turn on sharing so anyone with network access can read & write files in the Public folders
  • on Media Streaming  (I'll come back to that)
  • Enable file sharing for devices that use 40 -or 56-bit encryption
  • Turn off password protected sharing
  • Now make sure you have the same setting for both Home or Work & Public profiles
  • For the Media Streaming, select "Chose media streaming options...",  the on the "Show devices on:" dropdown box select "All networks".  You should then see something that says "Unknown Device", make sure that it has "Allow" beside it.

 

IF that doesn't work, try this:

 

Click Start and type Regedit in the search and click Regedit.exe
Navigate to the following location in the registry editor.


HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Lsa\

1. On the right side Double Click on everyoneincludesanonymous and in the window that pops up, change the value data from a 0 value to a 1

2. Double Click on NoLmHash and in the window that pops up, change the Value Data from a 1 value to a 0

3. Now navigate to the following location in the registry editor
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanManServer\Parameters


Double Click on restrictnullsessaccess and change the 1 value to a 0

Reboot your pc and you should now be able to connect to your pc from you Freeagent Theater+

This works for me, I also have my drives shared with full access on my LAN

You will still see the Login screen  just click OK and you should have access to your drives.

(Originally submited by ColinK)

This should also work with Vista.

Here a link for WINDOWS XP network problems.  (Give a few Kudos to bodhi78 for this one)

This took so much time from me that I would like to share this with other GoFlex TV users. I lived happily, enjoyed 1080p, the last 12 hours ever since the fix :)

Thursday, May 28, 2009

DLL problem with Wise Installation System and 8.3 filenames

This is from one the action item I deal with at the workplace. The user can install our software but when he tried to use one of the functions, the Visual Basic 6.0 application shows a message box indicating “Automation error.” This is a well-known Windows DLL problem which can be fixed easily using regsvr32 MyDLL.dll command. But I have to dig into the reason why the installer can’t get it job done correctly on the customer’s machine.

From what I known, the installer is created with Wise Installation System. I don’t know the precise version the development team used. But there is a known issue floating around the internet about the installer’s incompatibility problem with systems that disabled the generation of 8.3 filename.

I tried to reproduce the problem at work. The steps started with fresh installation of Windows Server 2003 and running fsutil behavior set disable8dot3 1 command. You can also check the current value of disable8dot3 by fsutil behavior query disable8dot3.The important thing to note that you have to restart the machine once for this changes to make effect.

After that, I installed the product. And the problem is reproduced! The fix is easy. Just uninstall the software, set disable8dot3 option to 0, restart, reinstall, and everything works!

The disable8dot3 option is set to 0 on a default installation of Windows. But there is a well-known tweak to disable this 8.3 name generation to improve directory browsing performance. This would break the Wise installer from working correctly.

I can’t reproduce the issue in the first place because I don’t know I have to restart the machine :(

Tuesday, March 17, 2009

.NET Parallel Computation Made Easy : System.Threading.Parallel

I had conduct a simple experiment for some time ago. It's about the performance of .NET program running on a multi-core processor versus the same program running on the single-core one. The result from my experiment shows that if you have a normal .NET program implemented without multi-threading, there will be no significant performance difference between running it on multi-core and single-core system.

I found it hard to create a multi-thread version of my classic old "Prime Generator" program. The hardest part is I don't know the appropiate number of thread to create since I had no information about the system the program is runnning on. And the threading code just looks ugly .. developers with no multi-threading background will find it hard to understand and maintain. Take my old code for example.


The Rescue
This is where Microsoft Parallel Extensions to .NET Framework 3.5 comes in handy. It simplify the process of constructing the multithread code yourself. There are many useful stuffs under System.Threading.Parallel. But I find System.Threading.Parallel.For is the easiest to understand and utilize :)


Here is the plotting between the data set size and time used in millisecond on my machine with Intel(R) Core(TM)2 Duo CPU E6750 @ 2.66GHz. The System.Thread.Parallel.For actually takes extra computation time on the first call which makes me wonder why an ordinary for-loop outperforms parallel version at very first version of my benchmark. However, after the first call, the parallel version outperforms ordinary for-loop as expected.

I believe the results will be different on a quad core machine too :)


Hope this helps.

Tuesday, February 10, 2009

C# Lambda Expression on MonoDevelop and Ubuntu

I always wanted to try out coding C# application on Ubuntu Linux. The most popular IDE of choices for this would be MonoDevelop by Mono Project. I installed MonoDevelop through Synaptic the same way I did with other applications.

It was a surprise to me to found out that Mono even supports some new features from of C# such as Lambda Expression and Object Initializer!


The only problem is their IDE, MonoDevelop, still not support autocompletion (a.k.a. Intellisense) of Lambda Expressions and Object Initializers. Moreover, it marks the code as error by underlining them in red.

In conclusion, Mono looks promising. And I just can't wait to see more Linux people coding new apps in C#!

Sunday, January 18, 2009

Netbeans and Nimbus Theme on Windows Vista



Actually I should name this topic "Netbeans and Nimbus Look & Feel (L&F)" but that would eliminate many search terms that use word "theme" instead :)

To set your Netbeans, in my case it's 6.5, to use the new Nimbus theme, just look under your Netbeans installation folder/etc/netbeans.conf file. It is usually located at C:\Program Files\NetBeans 6.5\etc\netbeans.conf. Then just append --laf Nimbus to netbeans_default_options.

So it looks like this:

...
# command line switches:

netbeans_default_options="-J-Dorg.glassfish.v3.installRoot=\"C:\Program Files\glassfish-v3-prelude\" -J-Dcom.sun.aas.installRoot=\"C:\Program Files\glassfish-v2ur2\" -J-client -J-Xverify:none -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true --laf Nimbus"
# Note that a default -Xmx is selected for you automatically.
...
Then save the file and restart your Netbeans, and proud of your new Netbeans Nimbus theme!

Note:
  • To edit the netbeans.conf file under Windows, you may need editor that capable of editing unix text file. I recommend using Netbeans itself to edit this file instead of Notepad.
  • If you want to change the theme back to default then you can just remove the added options from netbeans.conf file. I recommend you to bookmark this page so you will not forget where to set this option :P
Hope this helps!

Saturday, December 13, 2008

Why I hate MacBook ..



Where to put my plug in ?

Friday, December 5, 2008

Solution to Thinkpad X200 Random Freezing Problem


Around one month ago, I got my new Thinkpad X200 and I was very happy. I plugged it to AC power and enjoy installing new programs on new Windows Vista. Until I found out later that my new Thinkpad randomly freezes when running on battery. The cursor turns into an Vista's wait cursor, and I cannot do anything with the system. Even Ctrl + Alt + Del gave me no response.

The freezing becomes really annoying when I have to do a presentation to professors at my university. X200 freezed, locked up, and I can only hold power button to do a hard-shutdown!

I begin to dig deep into this problem. The first clue was ThinkVantage Access Connections, my X200 often freezes when I mess with wireless connectivity too much. So I uninstalled it but the freezing problem still persists.

The next clue was Intel Turbo Memory (ITM) and ThinkVantage Active Protection System (APS.) I found this from "Random Lockups when on battery" thread of tabletpcreview.com.

From my understandings, The ITM is a fast memory which provides fast access to some hard disk/virtual memory contents. And APS provides shock protection to hard disk and is one of the best Thinkpad's features. The problem happens when Windows Vista push Turbo Memory into power-saving mode and then APS trying to access Turbo Memory content. The freezing is then happened. Please correct me on this if I am wrong.

The fix was easy. You just need to go to Vista's Control Panel -> Power Options -> Change Plan Settings ->Change Advanced Power Settings ->Hard disk ->And then disable "Windows Hybrid Hard Disk Power Savings Mode"

After I changed my settings for default plan, no single freezing occurs when on battery! I am now so happy with my new Thinkpad X200 :) I think I can blame no one but Lenovo for this problem. They should do some more deep QA on their Thinkpads before start shipping. I think this problem is very serious and it affects Thinkpad's brand IMHO.

Sunday, November 30, 2008

LINQ with MySQL

LINQ to SQL from Microsoft supports only their SQL Server. How about other popular DBMS such as MySQL ?

I investigate the first result returned from Google using "LINQ with MySQL" query: DbLinq. It's an opensource project which provides "LINQ to SQL" for other databases include MySQL, PostgreSQL, Oracle and SQLite.

However, the project is still at its very beginning stage and I think it will take some time before we can use it in production environment, IMHO.

Here is my setup of DbLinq with MySQL

  • Visual Studio 2008 Professional
  • MySQL 5
  • DbLinq 0.18
  • Windows Vista
1. I first have my database prepared, its name is "Items".

2. Run DbMetal which is a tool comes with DbLinq in "build" folder. I use the following command for my MySQL server. I have user root with no password.

C:\Downloads\DbLinq-0.18\DbLinq-0.18\build>DbMetal /server:127.0.0.1 /database:items /provider:MySQL /user:root /code:Items.cs
DbLinq Database mapping generator 2008 version 0.18.0.0
for Microsoft (R) .NET Framework version 3.5
Distributed under the MIT licence (http://linq.to/db/license)

>>> Reading schema from MySQL database
<<<>


3. You will have a C# code file, Items.cs in my case, automatically generated. This file contains C# classes generated from database schema and the mapping attributes.

4. You may want to compile the project now. I found some errors in my cases:
  • There is no type specified for fields of MySQL's Enum type. You can fix this easily by insert C#'s "string" type. In my case: private _gender; to private string _gender;
  • EntitySet cannot be resolved. Change every occurances to System.Data.Linq.EntitySet instead.

If you can compile your project, you can proceed to the next step.

5. Here is my code for querying from MySQL database. From my setup, it's an ASP.NET web application with a single GridView on the Default.aspx page.



6. Run and see the result : )

Monday, November 17, 2008

Com Eng Undergrad Project Showcase at Nitad 15




If you are in Thailand you must not miss this! :)

I will also, hopefully, arrange the showcases of my course projects in Computer Graphics and Image Processing there too.

The venue will be Building 4 of Faculty of Engineering, Chulalongkorn University, between 26 - 30 November 2008.

Here are some screen shots taken from my project with my friend, Opalism, in Image Processing course. Can you guess what's it all about :) ?


Friday, November 14, 2008

How to Lock Zoom level in Firefox


Since Firefox 3.0, I find the "Full Page Zoom" function very useful in daily life. The only problem with this function in Firefox is that it has no support for "default" zoom level. That is, when you navigate to the new web pages, you need to adjust the zoom level every time.

Fortunately, someone has built the extension to solve this problem. The No Squint add-on allows you to set default zoom level. And I'm living happily with it for a week so far :)

Get No Squint Now

Monday, November 10, 2008

Invitation to 15th Nitad, Bangkok, Thailand

Nitad: 26-30 Nov 2008

"Nitad" is an engineering exhibition held at Faculty of Engineering, Chulalongkorn University, Thailand, once every three years. You don't want to miss this chance! Here are what you might expect from Nitad
  • Course project showcases from many students in all engineering fields.
  • The famous RoboCup world champ team, Plasma-Z, in action!
  • Guidance for high school students who are finding more info about faculty of engineering and its sub departments.
  • Fun activities!

You may like to watch a promotion video by SlaSua :) It's a great one in my opion. And it summarizes what we have in Nitad.

Saturday, November 1, 2008

Google DevFest Bangkok Wrap-up

Yesterday, I attended the DevFest Bangkok workshop, organized by Google team, at Chulalongkorn University.

The event was fun and I spent most of my time in Chat room o__O (huh ??) There are 3 sessions which are

OpenSocial: It is an API which serves as middle-tier for Social Network. So the social network application developers don't have to re-implement their application for every different social networks they target. The first presenter, Patrick Chanezon, described the overview of OpenSocial API before passed the control to other API implementers from Hi5 (it is actually a video session), Friendster, eXo Platform, and Globant.

  • Add as friends: chanezon, pamela.fox, ...
  • chanezon, jeremi23,

OpenSocial Foundation Vote

Coding Resources
Links about opensocial in general, many tags to refine what you want to read
http://delicious.com/chanezon/opensocial

Links to code samples and resource for opensocial
http://delicious.com/chanezon/opensocial+code

OpenSocial tutorial
http://code.google.com/apis/opensocial/articles/tutorial/tutorial-0.8.html
code:
http://opensocial-resources.googlecode.com/svn/samples/tutorial/tags/api-0.8/


Google Maps: Presented by Pamela Fox. The session demonstrated various uses of Google Maps API and its flexibility. The API is flexible enough to created a Zombie-shooting game also demonstrated in the session. @pemela.fox is also very active user in the chat room : ) Slides

App Engine: I think the attendees are interested in this session the most. The presenter, Patrick, gives overview of App Engine. I personally like Google-style presentation. The slides are simple and embedded many humour (BigTable.) The Simple AJAX Chat demo app is actually the chat room attendees were using.





Wiki Code Walkthrough (not used in talk, may be useful)



The event finished around 10 PM, which is very unusual for any formal event in Thailand. And I would like to say special thanks to my friends in CP32 who makes this happen : ) Because of my constraint (there is only one thing, you know :P), I can't help them much in organizing the event at my university. And what they have done is one of very great technical event in Thailand.

Most of the material are from this page: http://docs.google.com/View?docid=dggjrx3s_2390ww9hw5fh

Monday, October 13, 2008

Using Custom Icon for Your USB Flash Drive


Isn't it great to have your personalized USB Flash Drive Icon ?

First things you need to do is to prepare your own icon. If you still cannot get one, I recommend you to read my post: Create your .ICO Icon File.

Follow the steps below to change your USB Flash Drive icon.
  1. Copy your prepared icon to the most outer location of your flash drive. In this post, my icon name is"dora.ico"

  2. You will now have to create "autorun.inf" file at the same location as your icon. I recommend you to download my autorun.inf file from here (Right click on the link and click Save Target As ..) and put it on your flash drive.


  3. Change the content of autorun.inf file by double click on it. You will need to change my "dora.ico" to your icon name. Don't forget to save the updated file before closing Notepad.
    [autorun]
    icon=dora.ico
  4. Safety remove your flash drive and plug it in again. And your flash drive icon will be changed to the specified icon : )

Creating Your .ICO ICon File

There are times when you need to create your own .ico icon files :) With your own icons, you can do many things to personalize your workspace. For example, Using your icon for a USB Flash Drive's Icon or your icon for your file folder.

Creating an icon file is easy. All you need is a icon editing software. In this post I will show you how to create icon using Sib Icon Editor which can be downloaded and used free of charge. You can find the download link at the end of this page.

To create an icon using Sib Icon Editor, follow the steps below.

  1. Start the Sib Icon Editor program.

  2. In most cases, you will want to create icon from photo or prepared image from another image editing program. We will click on "Create a new icon from image file" in this step and choose your image.

    Create a new icon from image
  3. The image will be imported. You can configure some parameters of the generated icon in this step.

    Configure icon parameters
  4. You can do some further editing. When you're done, click on the File menu and Save as... to save your icon file.

    Save your icon file
  5. The icon files created from the program will have .ICO as extension.
Icon file
You can now use the icon created anywhere you want : )

Related Pages:

Sunday, October 12, 2008

New Microsoft Touchless Demo: Multi-touch without Touch

Well, Microsoft has just release their new Touchless SDK which enables the user to give input using gesture, without touch :) This is possible via the use of color tracking with web camera.


The Touchless SDK is an open source SDK for .NET applications. It enables developers to create multi-touch based applications using a webcam for input. Color based markers defined by the user are tracked and their information is published through events to clients of the SDK. In a nutshell, the Touchless SDK enables touch without touching.


However, I found that running the demo isn't quite straight forward. Here is what you need to do.

  1. Set up your web camera by selecting the camera you want to use in "Camera" page.

  2. Set up the markers. You need to use "Markers" which should be objects with bright colors such as tennis ball, a plastic toy. You need to get the web camera to see your marker and click "Add A New Marker" button. The image will be freeze and you need to mark area of your marker by click on the image and drag a circle around your marker. After that, the demo will be able to track your marker like this.


  3. Now, enjoy the demo! :)

For those who still cannot run the demo now, you can watch the video of demo program running here.



Related Page:

Saturday, October 11, 2008

Control Windows Media Player using Windows Mobile Devices

I once coded a Power Point controller for Windows Mobile. It works great and I wanted to bring similar things to other applications, such as Windows Media Player, too.

However, I found Bluetooth Remote Control for Windows Mobile. And it is actually working for me :) I can now get Windows Media Player to play next song, increase/decrease the volume .. from my bed. Doesn't that sounds cool ? :P

Here are some few things to note:
  1. You need a PC and a Windows Mobile Device all with Bluetooth radio. The PC must also runs Microsoft Bluetooth or Widcomm/Broadcomm bluetooth software (technically called a Bluetooth Stack.)
  2. Don't forget to check "Allow Bluetooth devices to find this computer" in Bluetooth setting in Control Panel.



  3. The setup is straight forward. Just install the software on PC with Windows Mobile devices connected.
  4. To use the application, run the Bluetooth Remote Control Server on PC and run the Client in your Windows Mobile Device. Select the server from list and you can now enjoy the application :)
Download Bluetooth Remote Control

Sunday, October 5, 2008

A New Hope for PSP Emulator on PC

Actarus has just release "Sam", the new PSP Emulator which runs on PC. At the current stage, the emulator can only run some PSPSDK examples and homebrew games developed by the community.

Actarus, the author, also provides source code of this emulator at his page. You can check it out here (Sam)

I wish the emulator will be able to use with commercial games soon :)