Friday, February 13, 2009

This day, last year..

Cellphone chain, new haircut, and chocolate.
It was Thursday. Hey, It's valentine day.

I joked about the new haircut.
Didn't look her in the eye cause I was just kidding.
bu guan ni de fa xing shi shen me, dui wo ni shi zui meili de nu sheng.

Chocolate was nice, couldn't remember taste. but I was happy.
Lost the cellphone chain after two weeks :((. I wasn't fond of adding accessories, but never meant to get rid of it either :((

Thank you for all the love given and shared.
Thank you for all the memories... I cherish them even though they are no longer mine.

Those are all I have. I will keep them...until my heart stops beating.

Happy Valentine.

Sunday, January 25, 2009

What comes with the 9?

New year is over. A bit late for a resolution. Well, it’s Chinese New Year now, so I guess it’s alright. But I’m not sure I’m going to write one. Let’s start with a review. What happened before 9? What happened last year? Lots of things I taught OOP, lead a team. Not many projects. I also know the feeling of lost, regrets. For the first time in my life I feel completely useless despite every effort I make. I always try to give the best, to protect everyone I care. Time proves I failed. I wish I could be a good brother, a son my parents can depend on, a leader my men can trust. For the first time in my life I bow down to God and ask what’s happening to me.

When I’m doing all I can and result says I haven’t done anything. I feel tired very tired. When I fail, will someone help me? When I can’t be the son my parent want me, when I can’t be a brother they can rely on, I know they’ll accept me. After all they’re my family. But who will help us then?

When a leader failed, when can he turn to? I’ve bleed. I’ve faced the pressure and got crushed. Where can I turn for help? In an environment where everyone’s job is in the line, can the spirit of altruism grow?

I’m not super, I’m not perfect. Still I do hope there’s a little bit of me that useful. I know what I like. My passion to help others is still strong. I like teaching, training people. I’m happy to share what I know and I don’t mind if a trainee surpasses me. Would that be enough though?

I don’t know. As with the rest of the world, I’m facing this year with a little hope. That things will turns out beautiful in time. I got my PR this year. It was something I dreamed years ago. Yet, I’m not ready. As odd as it may sound I still want to stay a bit longer. I’m still hoping for a second chance.

What will happen? Can I stay longer? Will I have to give up my hope? Or will I have to give up my dream? To be honest I don’t mind, I don’t want it that much anymore. But the path is not only mine to choose. This year, I rest it In Him to lead the way. Meanwhile there's a lot of things I wish to write.

  • Quality we can never afford
  • Failure we can never accept: Result vs Effort
  • Software Quality vs Project Quality

I just hope I'll have the time to write them.


Monday, September 01, 2008

I'm a dreamer

Note: I made this one a long time a go.
Somehow I forget or I decided not to post it :).
I post it now, to say thanks :)

What is a dream? why we have dreams? what's wrong with dreaming? I'm not a philosopher. Although I might be able to answer those questions myself, it's only true for me, most likely not the same for someone else. Whatever I'm writing here it reflects my own feeling.

If a dream is something we unconsciously want the most, I dream of her when I was in Perth twice. on the night of my birthday, and on the last night before I flew back to Bali.

Will I be persistent enough to chase my dream?

I thank a special friend of mine who gave me this prayer that I now pray every morning before I go to work and every night before I sleep.

" Lord grant me the SERENITY to accept the things I cannot change
The COURAGE to change the things that I can
And the WISDOM to know the difference "

Tuesday, July 22, 2008

At what cost?

For as long as I can remember, there are always people expecting things from me. No matter where I am, no matter what I do, no matter how good I did it, there's always someone else who expects me to be better. But what does it take to be better? what do we have to sacrifice just to list up the priority? does it really worth all the pain?

This is not the life I want to live. I worked double, only to be assigned with a heavier task. I never have time to be with the one I treasure the most. My biggest regret is that I never gave enough, I never praised her enough.

I know I commented her a lot, scolded her. But that was because I care for her the most. For I know nothing she did wrong would made me love her less. When I was away, there was nothing I wanted more then coming back to see her. When I missed having dinner together, I kept the faith in my heart, hoping that some day I could make it up.

Call me childish, call me naive, call me a fool, but I do believe in true love. One love, one person, for the rest of my life. You may call it a pipe dream, but that's what I wanted and that's what I want to be. My love is not for fun. I wouldn't say it if had no intention of keeping it forever.

Now it just seems impossible. No matter how hard tried, I always got pulled to a direction I don't want to go. I wish one problem only comes when the one I'm facing is solved. I have issues, I have problems on my own, I want to have my own time, I want to be with the one I love. But there are people who depend on me. I must not crumble, I must not break down or those who rely on me will crumble too. Being the first son, I have to look strong in front of my family. As I climb up the career ladder, my boss, my clients, my friends and colleagues would hold on to me even more.

Why do I have to lose ? Why do I have to give up hope? Because the best is yet to come? Even so shouldn't it be my choice whether or not I want to be with the best? Why do I have to pay the consequences for something I never wanted? I'm already here, 1000 miles away from home, away from my lovely nephew, away from my family who loves me. And my only joy was when I had her by my side. Why is it taken away from me?

If only my prayers were answered, I'd give up everything else. I wish the Lord would give me what I want instead of what I need. The fact that I don't want it means I don't need it now. I don't want to be with the best. What she is now, is enough for me. It's my choice, and I've made it along time ago.

Friday, July 04, 2008

A bridge too far

it's almost midnite. I've just finished praying. Tired, but my heart can't rest yet.
I've said it before I have no interest in war. but somehow that's the only title I can think of for now. I guess the battle in my heart isn't over yet.

I know writing about how difficult it s to think as an analyst from a programmer perspective is probably more useful. Plus, it helps reminding me of tasks I should have done. But for now. that thing would have to wait. I can't focus anyway. Not when my heart is like this.

Why a bridge? It's a symbol of a path to another place. Some bridges are never meant to be crossed. I'm afraid what I'm writing here is one of them.

To me, Love is more beautiful and convincing if it grows out of friendship. I want to be sure it's love that I have in my heart, not passion, not ambition, and not just a physical attraction. Even more important, I want her to see the real me. Not me pretending to be cool, or cheeky, or anything that I'm not. I need to know if she's going to accept me the way I am, be proud of what I am, just as I am proud of her.

From friendship to love is not an easy step. I always have doubt in my heart. If no one supports me, does it mean I'm not good enough for her? Is it alright to say it? when the love fails, we might never get back. Which one you value the most? Your friendship or your love in your heart? How can you be sure it wont fail? that your love will last forever?

I believe love is not blind. Love admits what she can be, and what she can not be. Everything that she is and is not. It doesn't overlook the weaknesses but receive them. Likewise, love sees the future, it sees the obstacles and recognize it. For the sake the one I dear the most, I would have made sure the burdens are easy to bear.

If you think love is all you need to get through, then I beg to differ. I doubt it's love you have, sounds like it's an ambition or pride you're trying to keep. Would you call it love, if you take her away from her family? Can you call it love, if you know she can no longer do things that she like? Is it love you have, if you take her to a family that can not welcome her. Even if she is willing, that only means she loves you more.

Khalil Gibran said, when two people are together. One always loves more than the other. Question is, which one do you want to be? I always want to be the one who loves more. For that reason, I would wait and prepare everything for her. I will not take her away from those who love her. I will not take away her happiness and things that make her happy. I will not let her enter a place that is not friendly to her.

I'd rather wait until the day comes it's safe for her to hold my hand and cross the bridge together.

Sunday, June 29, 2008

Beijing huan ying ni

Everyone, have a look at this blog http://sanzz.wordpress.com/2008/06/12/bei-jing-huan-ying-ni/


I got the video clip form a friend of mine last week. I'd been searching for the lyric ever since, and finally found it with translation on the blog I mentioned above. "Welcome to Beijing" that's the loose translation for the title. It's the theme of Olympic game in Beijing 2008.

Although Beijin is not my home and might never be one (I'm an Indonesian by blood and by culture), I'm always fascinated by the Chinese growth and culture. The video shows them all. Versatile words of choice for the album, Rapid development of China, food, strong and varied traditions that survive for more than a thousand years. Surprisingly the video doesn't show any kungfu moves China was famous for.

I say this is the new look of China. Looks like everyone is happy with the result.

Salute Beijin for your creativity. Below is the lyric as I copy them.

北京欢迎你
Bei jing huan ying ni
Welcome to Beijing

迎接另一个晨曦,带来全新空气。陈天佳
Let’ s embrace another morning and enjoy its ever new air.
Ying jie ling yi ge chen xi, dai lai quan xin kong qi.

气息改变情味不变,茶香飘满情谊。刘欢
With the fragrance of tea, it smells different. But it feels great, full of friendship.
Qi xi gai bian qing wei bu bian, cha xiang tiao man qing yi.

我家大门常打开,开放怀抱等你。那英
Our door is always open. We are waiting for you open-armed.
Wo jia da men chang da kai, kai fang huai bao deng ni.

拥抱过就有了默契,你就会爱上这里。孙燕姿-Stefanie Sun
After a big hug, you’ll feel close with us. And surely you will love this place.
Yong bao guo jiu you le mo qi, ni jiu hui ai shang zhe li.

不管远近都是客人,请不用客气。孙悦
Our guests, no matter where you come from, please feel at home.
Bu guan yuan jin dou shi ke ren, qing bu yong ke qi.

相约好了在一起,我们欢迎你。王力宏-Wang Lee Hom
We promised to get together here. So welcome!
Xiang yue hao le zai yi qi, wo men huan ying ni.

我家种着万年青,开放每段传奇。韩红
We cultivate Chinese Evergreen in the garden. All the time, it is producing a new legend.
Wo jia zhong zhe wan nian qing, kai fang mei duan chuan qi.

为传统的土壤播种,为你留下回忆。周华健-Emil Chou
In the soil rich in traditions, we plant. Hope everything we plant here leaves you a great experience.
Wei chuan tong de tu rang bo zhong, wei ni liu xia hui yi.

陌生熟悉都是客人,请不用拘礼。梁咏琪
Our guests, no matter we’ve met before or not, please feel at ease.
Mo sheng shu xi dou shi ke ren, qing bu yong ju li.

第几次来没关系,有太多话题。羽泉
Even if you have been here for many times, you won’t feel bored ’cause we have vast new things for you.
Di ji ci lai mei guan xi, you tai duo hua ti.

北京欢迎你,为你开天辟地。成龙-Jackie Chan
Welcome to Beijing; we’ve done a lot for your visit.
Bei jing huan ying ni, wei ni kai tian bi di.

流动中的魅力,充满着朝气。任贤齐-Richie Ren
Its charm in ever changing is full of life.
Liu dong zhong de mei li, chong man zhe chao qi.

北京欢迎你,在太阳下分享呼吸。蔡依林-Jolin Tsai
Welcome to Beijing; let’s breathe together in the sunshine.
Bei jing huan ying ni, zai tai yang xia fen xiang hu xi.

在黄土地刷新成绩!孙楠
Let’s establish new records here in China.
Zai huang tu di shua xin cheng ji.

我家大门常打开,开怀容纳天地。周笔畅
Our door is always open. We are open armed, ready to embrace the world.
Wo jia da men chang da kai, kai huai rong na tian di.

岁月绽放青春笑容,迎接这个日期。韦唯
5000-year-old China is flashing a youthful smile, waiting for the day.
Sui yue zhan fang qing chun xiao rong, huan jie zhe ge re qi.

天大地大都是朋友,请不用客气。黄晓明-Huang Xiao Ming
Our guests, no matter where you come from, please feel at home.
Tian da di da dou shi peng you, qing bu yong ke qi.

画意诗意带笑意,只为等待你。韩庚-Hangeng from Super Junior
We paint pictures and write poems to express the joy for your coming.
Hua yi shi yi dai xiao yi, zhi wei deng dai ni.

北京欢迎你,像音乐感动你。汪峰
Welcome to Beijing; like moving music, our hospitality will warm your heart.
Bei jing huan ying ni, xiang ying yue gan dong ni.
让我们都加油去超越自己。莫文蔚-Karen Mok
Let’s try to challenge ourselves.
Rang wo men dou jia you qu chao yue zi ji.

北京欢迎你,有梦想谁都了不起。谭晶
Welcome to Beijing; people who have dreams are all bravo.
Bei jing huan ying ni, you meng xiang shei dou liao bu qi.

有勇气就会有奇迹。陈奕迅
If only you keep the courage, miracles will happen.
You yong qi jiu hui you qi ji.

北京欢迎你,为你开天辟地。阎维文
Welcome to Beijing; we’ve done a lot for your visit.
Bei jing huan ying ni, wei ni kai tian bi di.

流动中的魅力,充满着朝气。戴玉强
Its charm in ever changing is full of life.
Liu dong zhong de mei li, chong man zhe chao qi.

北京欢迎你,在太阳下分享呼吸。王霞, 李双松
Welcome to Beijing; let’s breathe together in the sunshine.
Bei jing huan ying ni, zai tai yang xia fen xiang hu xi.

在黄土地刷新成绩!廖昌永
Let’s establish new records here in China.
Zai huang tu di shua xin cheng ji.

北京欢迎你,像音乐感动你。林依轮
Welcome to Beijing; like moving music, our hospitality will warm your heart.
Bei jing huan ying ni, xiang ying yue gan dong ni.

让我们都加油去超越自己。张娜拉
Let’s try to challenge ourselves.
Rang wo men dou jia you qu chao yue zi ji.

北京欢迎你,有梦想谁都了不起。林俊杰-JJ Lin
Welcome to Beijing; people who have dreams are all bravo.
Bei jing huan ying ni, you meng xiang shei dou liao bu qi.

有勇气就会有奇迹。阿杜-Ah Du
If only you keep the courage, miracles will happen.
You yong qi jiu hui you qi ji.

我家大门常打开,开放怀抱等你。容祖儿-Joey Yung
Our door is always open. We are waiting for you open-armed.
Wo jia da men chang da kai, kai fang huai bao deng ni.

拥抱过就有了默契,你就会爱上这里。李宇春-Chris Li
After a big hug, you’ll feel close with us. And surely you will love this place.
Yong bao guo jiu you le mo qi, ni jiu hui ai shang zhe li.

不管远近都是客人,请不用客气。黄大炜-Huang Da Wei
Our guests, no matter where you come from, please feel at home.
Bu guan yuan jin dou shi ke ren, qing bu yong ke qi.

相约好了在一起,我们欢迎你。陈坤-Chen Kun
We promised to get together here. So welcome!
Xiang yue hao le zai yi qi, wo men huan ying ni.

北京欢迎你,为你开天辟地。谢霆锋-Nicholas Tse
Welcome to Beijing; we’ve done a lot for your visit.
Bei jing huan ying ni, wei ni kai tian bi di.

流动中的魅力,充满着朝气。韩磊
Its charm in ever changing is full of life.
Liu dong zhong de mei li, chong man zhe chao qi.

北京欢迎你,在太阳下分享呼吸。徐若瑄-Vivian Hsu
Welcome to Beijing; let’s breathe together in the sunshine.
Bei jing huan ying ni, zai tai yang xia fen xiang hu xi.

在黄土地刷新成绩!费翔
Let’s establish new records here in China.
Zai huang tu di shua xin cheng ji.

我家大门常打开,开怀容纳天地。汤灿
Our door is always open. We are open armed, ready to embrace the world.
Wo jia da men chang da kai, kai huai yi rong na tian di.

岁月绽放青春笑容,迎接这个日期。林志玲-Lin Ci Ling, 张梓琳
5000-year-old China is flashing a youthful smile, waiting for the day.
Sui yue zhan fang qing chun xiao rong, huan jie zhe ge re qi.

天大地大都是朋友,请不用客气。张靓颖
Our guests, no matter where you come from, please feel at home.
Tian da di da dou shi peng you, qing bu yong ke qi.

画意诗意带笑意,只为等待你。许茹芸, 伍思凯
We paint pictures and write poems to express the joy for your coming.
Hua yi shi yi dai xiao yi, zhi wei deng dai ni.

北京欢迎你,像音乐感动你。杨坤, 范玮琪-Fan Wei Qi
Welcome to Beijing; like moving music, our hospitality will warm your heart.
Bei jing huan ying ni, xiang ying yue gan dong ni.

让我们都加油去超越自己。游鸿明, 周晓欧
Let’s try to challenge ourselves.
Rang wo men dou jia you qu chao yue zi ji.

北京欢迎你,有梦想谁都了不起。沙宝亮, 满文军
Welcome to Beijing; people who have dreams are all bravo.
Bei jing huan ying ni, you meng xiang shei dou liao bu qi.

有勇气就会有奇迹。金海心, 何润东
If only you keep the courage, miracles will happen.
You yong qi jiu hui you qi ji.

北京欢迎你,为你开天辟地。飞儿-FIR, 庞龙
Welcome to Beijing; we’ve done a lot for your visit.
Bei jing huan ying ni, wei ni kai tian bi di.

流动中的魅力,充满着朝气。吴克群-Kenji Wu, 齐峰
Its charm in ever changing is full of life.
Liu dong zhong de mei li, chong man zhe chao qi.
北京欢迎你,在太阳下分享呼吸。5566, 胡彦斌-Anson Hu
Welcome to Beijing; let’s breathe together in the sunshine.
Bei jing huan ying ni, zai tai yang xia fen xiang hu xi.

在黄土地刷新成绩!郑希怡, 刀郎
Let’s establish new records here in China.
Zai huang tu di shua xin cheng ji.

北京欢迎你,像音乐感动你。纪敏加, 屠洪刚, 吴彤
Welcome to Beijing; like moving music, our hospitality will warm your heart.
Bei jing huan ying ni, xiang ying yue gan dong ni.

让我们都加油去超越自己。郭容, 刘耕宏, 腾格尔
Let’s try to challenge ourselves.
Rang wo men dou jia you qu chao yue zi ji.

北京欢迎你,有梦想谁都了不起。金莎, 苏醒, 韦嘉
Welcome to Beijing; people who have dreams are all bravo.
Bei jing huan ying ni, you meng xiang shei dou liao bu qi.

有勇气就会有奇迹。付丽珊, 黄征, 房祖明
If only you keep the courage, miracles will happen.
You yong qi jiu hui you qi ji.

北京欢迎你,有梦想谁都了不起。
Welcome to Beijing; people who have dreams are all bravo.
Bei jing huan ying ni, you meng xiang shei dou liao bu qi.

有勇气就会有奇迹。
If only you keep the courage, miracles will happen.
You yong qi jiu hui you qi ji.

北京欢迎你,有梦想谁都了不起。
Welcome to Beijing; people who have dreams are all bravo.
Bei jing huan ying ni, you meng xiang shei dou liao bu qi.

有勇气就会有奇迹!
If only you keep the courage, miracles will happen.
You yong qi jiu hui you qi ji.

Saturday, June 21, 2008

War & Love

Such a heavy title, but actually I have no idea about what I'm going to write a part of the title itself. I have no interest in war. However, perhaps I can start with a question what causes a war?or to put on generic term, what causes a fight. Hatred? ambition? greed? What about Love? Can it starts a war? I've heard countless stories about heroes fighting for things they love (country, leader, princess, you name it). But what about two people who love each other. Can there be war between them? Would love allow anyone to hurt each other so badly? Well.... I'm not married, so I'll leave the question to you all who claim you've found your love of a life time :)

If love is stronger, I believe one of them would give in and wait patiently until the other person forgives him/her. Perhaps even accept the punishment regardless he/she deserves it or not. All for the sake of love.

As a Christian, I know about Passions of the Christ since I was a kid. I've heard it too many times, the stories has become boring. Never have I thought what gives the strength to a man that makes him endure all the tortures without even once begging for mercy. If you ask all Christians, their answer would be the same - "Love".

Well, I guess the "L" word has lost its meaning since it's been said too may times. Maybe one must feel love first to be able to understand. There were times I would have taken all the punches thrown at me, if only I could see her smile again. I would have accepted any humiliation any day without complain, if that was the price I had to pay to be able to say those three words. Of course the courage, strength, and determination didn't last long. But for a moment, I felt like I knew what was Jesus doing on the cross and I could only imagine how big His love is.

I know forgiveness would wash away all the painful memories of a fight. Love has a huge healing power that can cure any heart's pain anytime. Now I wonder what would happen to one sided love? will the forgiveness come from the other person? Oh well, being the one who always on the loving side I will never know (hell that's a pathetic line... unfortunately it's true :((( ).

Monday, June 05, 2006

Environment Variables

Visual Studio 2003, C#

Recently I need to get user's data location.
I found out that I can get it using Environment.GetEnvironmentVariable("UserProfile").
So I'm curious, what else are in the Environment namespace. A nice article written by Naveen K Kohei can be found here http://www.codeproject.com/dotnet/netdiagnostics4.asp
in addition, I also list all variables on my machine. And here is the result :

Variable Name : SystemDrive
Variable Name : USERPROFILE
Variable Name : MSDevDir
Variable Name : INCLUDE
Variable Name : Path
Variable Name : LOGONSERVER
Variable Name : VS71COMNTOOLS
Variable Name : PROCESSOR_ARCHITECTURE
Variable Name : CVS
Variable Name : ProgramFiles
Variable Name : NUMBER_OF_PROCESSORS
Variable Name : CommonProgramFiles
Variable Name : TMP
Variable Name : APPDATA
Variable Name : ComSpec
Variable Name : FP_NO_HOST_CHECK
Variable Name : HOMEDRIVE
Variable Name : COMPUTERNAME
Variable Name : PROCESSOR_LEVEL
Variable Name : OS
Variable Name : PROCESSOR_IDENTIFIER
Variable Name : USERDNSDOMAIN
Variable Name : windir
Variable Name : USERDOMAIN
Variable Name : ALLUSERSPROFILE
Variable Name : USERNAME
Variable Name : PATHEXT
Variable Name : CLIENTNAME
Variable Name : HOMEPATH
Variable Name : SystemRoot
Variable Name : TEMP
Variable Name : LIB
Variable Name : PROCESSOR_REVISION
Variable Name : SESSIONNAME
Variable Name : Cor_Debugging_Control_424242

Friday, May 05, 2006

Create Rounded corner Form in C#.Net

From various source on the net

protected override void OnPaint(PaintEventArgs e)
{
//base.OnPaint (e);
GraphicsPath p = new GraphicsPath();
p.StartFigure();
p.AddArc(new Rectangle(0, 0, 40, 40), 180, 90);
p.AddLine(40, 0, this.Width - 40, 0);
p.AddArc(new Rectangle(this.Width - 40, 0, 40, 40), -90, 90);
p.AddLine(this.Width, 40, this.Width , this.Height - 40);
p.AddArc(new Rectangle(this.Width - 40, this.Height - 40, 40, 40), 0, 90);
p.AddLine(this.Width - 40, this.Height, 40, this.Height);
p.AddArc(new Rectangle(0, this.Height - 40 , 40, 40), 90, 90);
p.CloseFigure();
this.Region = new Region(p);

SolidBrush oBlackBrush = new SolidBrush(System.Drawing.Color.Black);
System.Drawing.Pen borderPen = new System.Drawing.Pen(oBlackBrush, 4);
e.Graphics.DrawPath(borderPen, p);
borderPen.Dispose();

p.Dispose();
}

Tuesday, April 25, 2006

Interface vs abstract class

Something I found on the net


http://www.dotnetjohn.com/articles.aspx?articleid=94


Interface vs abstract class

When should you use an abstract class, when an interface, when both? This table will help you decide.

Interfaces vs Abstract Classes
FeatureInterfaceAbstract class
Multiple inheritance A class may implement several interfaces. A class may extend only one abstract class.
Default implementation An interface cannot provide any code at all, much less default code. An abstract class can provide complete code, default code, and/or just stubs that have to be overridden.
Constants Static final constants only, can use them without qualification in classes that implement the interface. On the other paw, these unqualified names pollute the namespace. You can use them and it is not obvious where they are coming from since the qualification is optional. Both instance and static constants are possible. Both static and instance intialiser code are also possible to compute the constants.
Third party convenience An interface implementation may be added to any existing third party class. A third party class must be rewritten to extend only from the abstract class.
Is-a vs able or can-do Interfaces are often used to describe the peripheral abilities of a class, not its central identity, e.g. an Automobile class might implement the Recyclable interface, which could apply to many otherwise totally unrelated objects. An abstract class defines the core identity of its descendants. If you defined a Dog abstract class then Damamation descendants are Dogs, they are not merely dogable. Implemented interfaces enumerate the general things a class can do, not the things a class is.
Plug-in You can write a new replacement module for an interface that contains not one stick of code in common with the existing implementations. When you implement the interface, you start from scratch without any default implementation. You have to obtain your tools from other classes; nothing comes with the interface other than a few constants. This gives you freedom to implement a radically different internal design. You must use the abstract class as-is for the code base, with all its attendant baggage, good or bad. The abstract class author has imposed structure on you. Depending on the cleverness of the author of the abstract class, this may be good or bad. Another issue that's important is what I call "heterogeneous vs. homogeneous." If implementors/subclasses are homogeneous, tend towards an abstract base class. If they are heterogeneous, use an interface. (Now all I have to do is come up with a good definition of hetero/homo-geneous in this context.) If the various objects are all of-a-kind, and share a common state and behavior, then tend towards a common base class. If all they share is a set of method signatures, then tend towards an interface.
Homogeneity If all the various implementations share is the method signatures, then an interface works best. If the various implementations are all of a kind and share a common status and behavior, usually an abstract class works best.
Maintenance valign="top"If your client code talks only in terms of an interface, you can easily change the concrete implementation behind it, using a factory method. Just like an interface, if your client code talks only in terms of an abstract class, you can easily change the concrete implementation behind it, using a factory method.
Speed Slow, requires extra indirection to find the corresponding method in the actual class. Modern JVMs are discovering ways to reduce this speed penalty. Fast
Terseness The constant declarations in an interface are all presumed public static final, so you may leave that part out. You can't call any methods to compute the initial values of your constants. You need not declare individual methods of an interface abstract. They are all presumed so. You can put shared code into an abstract class, where you cannot into an interface. If interfaces want to share code, you will have to write other bubblegum to arrange that. You may use methods to compute the initial values of your constants and variables, both instance and static. You must declare all the individual methods of an abstract class abstract.
Adding functionality If you add a new method to an interface, you must track down all implementations of that interface in the universe and provide them with a concrete implementation of that method. If you add a new method to an abstract class, you have the option of providing a default implementation of it. Then all existing code will continue to work without change.

Friday, April 21, 2006

Work Related

C#.Net 2003 windows programming

//Get mouse position in client coordinates
Point p = picBoxDrawingArea.PointToClient(Control.MousePosition);

//Get Mouse Position on screen
Control.MousePosition;

Work Related

C#.Net 2003 windows programming

//Get mouse position in client coordinates
Point p = picBoxDrawingArea.PointToClient(Control.MousePosition);

//Get Mouse Position on screen
Control.MousePosition;

Thursday, April 13, 2006

Work Related

Doing Custom DataGridTextBoxColumn in C#.Net

This Column, has a Centered Header, but contains right aligned numeric data. Also the background Colour is changed according to cell value.

private StringFormat m_strFormat = null;

public UCCustomColumn()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitializeComponent call
m_strFormat = new StringFormat();
m_strFormat.Alignment = StringAlignment.Far;
m_strFormat.Trimming = StringTrimming.None;
}

protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
{

SolidBrush BackgroundBrush;
// Get value on current cell
double dValue = (double) this.GetColumnValueAtRow(source, rowNum);
string strValue = dValue.ToString(this.Format);
double dATValue,dUVValue;
if (rowNum ==0)
{
dATValue = (double)this.GetColumnValueAtRow(source, rowNum);
dUVValue = (double)this.GetColumnValueAtRow(source, rowNum+1);
}
else
{
dATValue = (double) this.GetColumnValueAtRow(source, rowNum-1);
dUVValue = (double)this.GetColumnValueAtRow(source, rowNum);
}

SolidBrush StrongBrush = new SolidBrush(Color.FromArgb(51,102,255));
SolidBrush MediumBrush = new SolidBrush(Color.FromArgb(153,204,255));
SolidBrush SoftBrush = new SolidBrush(Color.White);


if((dATValue >25.7) && (dUVValue >=3))
BackgroundBrush = StrongBrush;
else if((dATValue <=25.7) && (dUVValue >=3))
BackgroundBrush = MediumBrush;
else if((dATValue <=25.7) && (dUVValue <3))
BackgroundBrush = SoftBrush;
else
BackgroundBrush = SoftBrush;

g.FillRectangle(BackgroundBrush, bounds);
RectangleF CellBounds = new System.Drawing.RectangleF(bounds.Left, bounds.Top, bounds.Width, bounds.Height);
g.DrawString(strValue, this.DataGridTableStyle.DataGrid.Font, foreBrush, CellBounds, m_strFormat);
}

Monday, April 03, 2006

Work Related

Dependency walker Visual studio 6
a great way to look all public methods in a DLL

Work Related

Dependency Walker visual studio 6
is a good tools to view all public methods in a DLL

Work related

How to open PDF file programmatically in windows c#.Net

Solution 1
Use Process.Start()
Solution 2
host the web browser control in the C# application and
load this .pdf file into the browser control.

Note:
I haven't tried solution 2

Saturday, August 27, 2005

New meaning of blog

To be honest, I don't like the format of this blog I can't group things, unlike my friendster blog. I can even add new catagory there

That's the reason I rarely update this blog of mine. I almost forgot my user account and password.

I think it's time to change my Blog name, and the purpose of having it. It's no longger story of my life. Cause I didn't tell much of if in this blog.

I haven't decided yet, but I'll find something else to fill this site.

Friday, April 22, 2005


Left to right, top to bottom, Okky, David, Bayu, Riza, Mahdi. Bent down so the waterfall can be seen Posted by Hello

David and me. far back near the top of the waterfall. Posted by Hello

Left to right: Riza and Bayu, at higher place. If you see Bayu is a litle scared, It's because the stones are slippery Posted by Hello