says: "mastering the skills to maximize the tools"

Perth, an option

February 26th, 2008

I went to Perth on 21 Feb 2008 to make my first entry as a PR of OZ. Initially, i planned for Gold Coast, but since the airfare cost as much and i’ve never been there, i changed my destination. After this trip, i can conclude that my friends have been feeding me wrong information about the place. Yeah, you can say it is boring, but i like the pace and setting. Near to 30, you don’t expect me to jump up and down every minute anymore, right? I spent about 3+ days there at an auntie place. She is very friendly, and so are the other family members. Thanks to them, i had a superb yet real relaxing break there. Don’t wanna spend my time writing long stories where people don’t finish, i will just summarize my itinerary.

Here goes:

20th Feb - took the night train down to Singapore. My first and last. There was place to sleep, but the train ride was noisy and rocky. So if you are a light sleeper, forget it. Next time i rather travel by bus earlier.

_MG_5829 _MG_5832 _MG_5835
_MG_5836  

21st Feb - loiter around Singapore since my flight was at 3pm. Nothing much to buy after considering currency conversion. Reached Perth at 11pm and had no problem going through the custom. Slept like a pig after supper and a long day

22nd Feb - woke up late and auntie accompanied me down to city just to show me a few tips. After that, i was all alone. Took a bus up to King’s Park first and the view was great. Not going to describe here as i sucks at it, so browse the gallery. Walked around the city and explored their factory outlets which are just nearby. Followed auntie’s direction home. Nearly lost but i reached in one piece :D

_MG_5861 _MG_5865 _MG_5882
_MG_5897 _MG_5912

23rd Feb - Woke up very early to follow auntie to wholesale market. You never get price so cheap here and i was pretty shocked! Where do you get a box (a big one) of brocollis for mere AUD5?! And lots of fruits too! Joined the gang to Fremantle Market since most guides talk about it. Quite disappointed at the size but content matters. We walked around the beach area after and went home to runaway from the burning sun.

_MG_5914 _MG_5917 _MG_5920
_MG_5941 _MG_5958

24th Feb - Met up with old secondary classmates for lunch! Been a couple of years (ten years for one of them) since i last met them. It was great to catch up ;) In the late afternoon, went to the Cottesloe beach, and i find it very nice, and somemore it is near! Auntie brought me to Point Walter too, to see the stretch of strolling path which leads into the river. Time to go home tonight and quite sad to leave them. Gonna miss you all!

_MG_5969 _MG_5973 _MG_5977
_MG_5995 _MG_5997

All these while, i was considering Melbourne only as my migration target. After this trip, i like Perth very much too! Auntie kept asking me to move over there, and even starts to look out for house for me. Well, we will see in near future where i will end up at :)

Browse the gallery

Scenario: I have a number of patterns that I need to check and replace in a string. I don’t want to transverse the string and play with characters and length. What other option I have?

Read on… »

I want the library FAST!

January 28th, 2008

My MSDN 2008 Library didn’t install a direct link to launch help like the 2005 version. So i tweaked the 2005 shortcut and hoila, i have the shortcut for 2008 version. You like the F1, but i prefer this so i can easily answer people’s query without opening the IDE :D

Create a new Shortcut and put this in the shortcut path (single line):

"%YOUR PROGRAM FILES%\Common Files\Microsoft Shared\Help 9\dexplore.exe"
/helpcol ms-help://MS.MSDNQTR.v90.en /LaunchNamedUrlTopic DefaultPage

coalescing null yield return

January 26th, 2008

Ok the title means nothing at all, and they are not related too, except that they both are of C# family. As requested by Klaw, i am going to blog about it so that we all learn :D

Coalescing Null Operator

You are probably thinking what’s that. Maybe it is just me, but it is one of the cool subtle features in C# that I just discovered today. Shame on me ya. Basically you all are familiar with this:

string myStrVarB = (myStrVarA == null) ? "null string" : myStrVarA

So with coalescing null operator (??), you can shortened it to:

string myStrVarB = myStrVarA ?? "null string"

Let’s see, that is saving of 17 characters. Your boss sure will praise you for that :D On a side note, in case you don’t know, you can allow a scalar type to be null by using the nullable operator:

int? myInteger = null

yield return

Definition from MSDN: “Used in an iterator block to provide a value to the enumerator object or to signal the end of iteration”. I assume you have previous knowledge with IEnumerable (or iterator), so i am not going into detail with it. The yield statement appears only inside an iterator block and returns the value that is expected by the calling foreach statement. Cut the theory and show me the example.

public static IEnumerable Power(int number, int exponent)
{
	int counter = 0;
	int result = 1;
	while (counter++ < exponent)
	{
		result = result * number;
		yield return result;
	}
}

static void Main()
{
	// Display powers of 2 up to the exponent 8:
	foreach (int i in Power(2, 8))
	{
		Console.Write("{0} ", i);
	}
}

There you go, another simple bit of my learning :D

Sharlinie and Black Magic

January 23rd, 2008

Read about this super interesting post here. My first reaction upon reading just the first paragraph: WTF. Why so much publicity on hiring bomoh to find the poor gal? And worst, 50 of them?! You can say i am heartless as they were trying all their mights, but this is really getting overboard. You know what, i seriously suspect there is consipracy behind this. Some political parties could have paid for this at the back. Why? Election is near mah. Why there isn’t such big thing for Nurin before? Why now?

The bomohs predicted that she will return in 1 week. I really like to see theirs and public reaction if it doesn’t come true. If they are so good, why cant they determine the exact location?! When the power combine, they are Captain Bomoh mah. They could even say there are 3 kidnappers whom used black magic to trap her. WTF again?! Black magic and kidnap? So what now, we should all learn some of the arts so we can fight back when necessary. And from this statement, shouldn’t the police be searching all bomohs in Malaysia (since they know black magic)?

Not that i am pessimistic about Sharlinie safety but not this method alright. Even if you do, keep it low. Headline man, what is the paper thinking? Is Malaysia really that boring till we need to use such news for headline?

Begin Invoke..End Invoke

January 21st, 2008

First post in the category :D This group is mainly to share coding stuff that is out of layman term. If you are not programmer, stay away at all cost! :P

Found this very easy to read yet informative post on Asynchronous Method Invocation. I admit that what i know about .NET is merely the tiny tip of what the iceberg can offer. Oh hell, life is long and learning is life long, ain’t it? :)

Here’s a summary of what i learnt:

  • MethodInvoke - built in delegate in .NET that allow you to call a method that takes in no parameter
  • BeginInvoke - execute the target function and return to caller instantly
  • ThreadPool in .NET has a limit of 25. Avoid ’starving’ the pool else be fined by performance loss
  • EndInvoke - return proper values/parameters from the previous function call
  • IAsyncResult - log of all datas (exceptions, return value, output parameters, etc) after execution is completed
  • AsyncCallBack - used when you don’t wish to wait for completion of the execution (that’s the purpose of asynchronous call bah)
  • Command Pattern (ICommand interface) - rather than BeginInvoke, EndInvoke, CallBack everywhere in your Main(), apply this pattern to group calls together.

That’s all folks. I might not have explained everything properly, so best for you to read it yourself.

Original post

I am on Facebook

January 21st, 2008

You would be saying, “What? You are so out man! We’ve been fooling around in there for ages”. Alright alright, i know i am slow. The main reason that i registered for it was to view photos from my ex-colleagues. Only after i logged in, i found tonnes of my friends in there (who weren’t active in such portal before).

Frankly, i don’t like Facebook much, except that it is responsive and hell lots of friends are in there. They have too much of those ‘applications’ which complicate the whole thing. Whenever i browse profiles, i am only interested in the top section, where the biodata and photos links are. I still prefer Friendster style where things are kept to simplest form. Oh maybe i am not into ’socializing through the web’ now, so i don’t see the usefulness of those goodies.

Anyway, if you want to, you can find me in there with email digital.ric@gmail.com. Happy Facebook-ing! :D

20080119 Today’s Photo

January 19th, 2008

Dad and Mum at Rose Valley of Cameron Highland.

Retro Colors Stand out Original
_MG_5591a _MG_5591b _MG_5591-before

20080117 Today’s Photo

January 17th, 2008

Taiping lake. Merely up the contrast ridiculously to make it look like that.

_MG_5420a

Do our bit!

January 16th, 2008

Inspired by Blacksnail on her effort to start reducing waste (http://blacksnail.wordpress.com/2008/01/14/save-the-world-chapter-1-reduce/), i started a page to keep track of how am i doing in the same. If each of us can do the little bit (which doesn’t even need 0.01% of your daily effort), the world will be a better place to live in. Well, that’s if keeping politics and war aside :D

Support by visiting this page, and let’s help to keep earth the way it is!

pbpimg001.jpg