enrii.blog

A passionate programmer’s findings in the world of internet.

eGenting Programming Competition 2008

October 24th, 2008

eGenting Programming Competition 2008

It has already became a tradition of R&D department of eGenting to organise this event every year. I still can remember the feeling when I took part in the eGenting Programming Competition 2004. I felt very nervous, especially when you see hundreds of contestants coming from every part of Malaysia to be at this competition. I must say the questions are really challenging, not those that you can find in universities. It is really a good place to really know your real ability in programming.

If you think you are good in programming, why don't you prove whether you are right? This is a good chance to really test yourself. Highly recommended to fresh graduates! It is also a good place to get a well-paid job (as our economy is heading downwards at this moment)!

Details of the event

  • Competition date: 15 November 2008
  • Time: 10.00 am to 6.00 pm
  • Venue: Auditorium, 25th Floor Wisma Genting, Jalan Sultan Ismail, 50250 Kuala Lumpur.
  • Nature: Open-book handwritten programming task

Few changes to the event this year:

  1. The venue is no longer at Genting Highlands (which is sad). You no longer get free ride to Genting Highlands.
  2. This year they have abolished the professional category. Everyone can join the same category.

The registration will close end of this month. You still have 7 days to go. Register quickly. Don't miss this golden opportunity!

New website: eGenting Programming Competition 2008

Restore My Bluetooth Places Link

July 19th, 2008

I was unable to open or explore My Bluetooth Places for a while. Every time when I try to do so, I get the following error:

The path '::{6af09ec9-b429-11d4-a1fb-0090960218cb}' does not exist or is not a directory.

A forum thread at Tech Support Guy was very helpful. If you are facing the same problem, all you have to do is to add the following key to registry:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\{6af09ec9-b429-11d4-a1fb-0090960218cb}

Set the value as 'My Bluetooth Places', without the quotes. I am able to explore my bluetooth devices again.

I believe the key could have been removed by certain cleanup programs which are supposed to be doing good to your system but this is certainly a false negative.

Maxis Will Bring Apple iPhone 3G to Malaysia?

July 18th, 2008

Contrary to what I found earlier, The Malaysian Insider reported that:

Its understood that Maxis will offer the iPhone 3G in Malaysia at a competitive price below RM1,000.

It's a nice offer, since I have been using Maxis for years. Changing the plan will get me the new Apple iPhone 3G. However, The Edge Daily got a different response from Maxis:

When asked by The Edge Financial Daily in April if the telco planned to bring the iPhone here, Maxis chief executive officer Sandip Das had said Maxis had no plan at that time to bring in the phone as Apple had not decided on its Asian distribution policy.

Anyhow, Bernice certainly has a good point saying that it's not a good idea to get first generation products from Apple, especially the company is new in mobile phone business. On top of that, 3G services are still very expensive in Malaysia.

But, it is really very tempting. I'm not sure I could wait any longer once it reaches Malaysia.

Programming Brain Teaser

July 9th, 2008

I joined the fun to work on a programming brain teaser by Dustin Diaz (read the original post for details). The general rule is as follows:

Group together all duplicate items that occur anytime beyond twice by wrapping them with a tag, naturally "bookending" them.

Here's my solution in PHP:

$arr = array ('a', 'b', 'c', 'c', 'd', 'e', 'e',
'e', 'e', 'e', 'f', 'e', 'f', 'e',
'f', 'a', 'a', 'a', 'f', 'f', 'f');

$count = 0;
$prev = '';
foreach ($arr as $item) {
	if ($prev == $item) $count ++;
	if ($count == 2 && $prev == $item) echo '<strong>';
	if ($count >= 2 && $prev != $item) echo '</strong>';
	echo $item;
	if ($prev != $item) $count = 0;
	$prev = $item;
}
if ($count >= 2) echo '</strong>';

Give your comments, if any.

Update: After pointed out by gbyeow in the comment, I agree that it could be optimized. I was too overwhelmed by achieving the result that I forgot to optimize after I completed the code.

The optimized version:

$arr = array ('a', 'b', 'c', 'c', 'd', 'e', 'e',
'e', 'e', 'e', 'f', 'e', 'f', 'e',
'f', 'a', 'a', 'a', 'f', 'f', 'f');

$count = 0;
$prev = '';
foreach ($arr as $item) {
	if ($prev == $item) {
		$count ++;
		if ($count == 2) echo '<strong>';
	}
	if ($prev != $item) {
		if ($count >= 2) echo '</strong>';
		$count = 0;
	}
	echo $item;
	$prev = $item;
}
if ($count >= 2) echo '</strong>';

Troubleshooting Window XP c000021a Error (Blue Screen)

July 6th, 2008

I found some problems with the built-in bluetooth device in my HP laptop. So, I reinstalled the driver. I reboot the machine after installation completed. When the computer boot up, it failed to enter Windows. It only managed to reach the Windows XP boot up screen, then it restart again itself.

After a few rounds of self reboot, I think I could put it into safe mode then use system restore to restore the system back to the time before I install the new driver.

To put a Windows XP machine into safe mode, all you have to do is to keep pressing F8 button when the computer boots up. Then you will be displayed with an "Windows Advanced Options Menu", which you need to select "Safe Mode".

Unfortunately, safe mode didn't work for me. It has the same fate as before. It reboots before it can enter Windows. The next option I tried was Last Known Good Configuration, but still no luck.

Then, I tried Disable automatic restart on system failure in the "Windows Advanced Options Menu", initiated with the same F8 way.

The Windows XP loading screen showed up. Then, I get a blue screen with the following error:

STOP: c000021a {Fatal System Error}
The Windows Logon Process system process terminated unexpectedly with a status of 0xc0000139 (0x00000000 0x00000000).
The system has been shut down.

Now, I got the error code. I start another computer to search for a solution and I found a Microsoft Knowledge Base article titled How to troubleshoot a "STOP 0xC000021A" error. I thought I found the solution, but it asked me to use a command prompt to enable Dr. Watson. Is the guide silly or I'm the one stupid? How do I do it when I can't start anything, even safe mode in command prompt failed.

Another search result points me to this thread: Blue screen after installation on Win XP. The user mentioned:

Turned out that the problem was caused by the installer overwriting msvcrt.dll in System32, causing the crash.

So, my next attempt will try to replace the file using Recovery Console. Copy the file from another computer and put it into a USB drive. Plug it into the failed computer.

Then, start Recovery Console to copy the file.

  1. Put the Windows XP setup CD into the failed machine.
  2. Start/Reboot the computer.
  3. Press any key to boot from CD.
  4. You will get yourself into Windows Setup.
  5. When the "Welcome to Setup" screen appears, press R to start the Recovery Console.
  6. Press number to select the correct Windows XP installation, then enter the administrator password.

Now, I'm in the recovery console. These are what I did:

  1. Check the date and size of the msvcrt.dll. For my case, it is different from what I can find in another computer. The correct size is at around 335KB.
  2. Backup the original DLL in C:\windows\system32.
  3. Copy the file in USB drive to c:\windows\system32\msvcrt.DLL (Note: you may need to try a few drive letters to find your USB drive.)
  4. Enter "exit" to reboot the computer.
  5. Remove the Windows XP CD and USB drive.

And... my HP laptop is working!