<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8092461</id><updated>2011-10-29T21:33:41.962-07:00</updated><title type='text'>Tech Embassy</title><subtitle type='html'>The part I enjoy in software development is the design part. I found it very interesting and thought-provoking experience.
And in this blog, I am going to share my ideas, and my finds.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default?start-index=101&amp;max-results=100'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>115</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8092461.post-1971853960006394119</id><published>2008-02-26T09:20:00.000-08:00</published><updated>2008-02-26T09:47:16.608-08:00</updated><title type='text'>Founding our place in a community</title><content type='html'>We are relational animals.&lt;br /&gt;We belong to the community-based species, where animals live together in groups.&lt;br /&gt;We came from Apes, who are  community-based species.&lt;br /&gt;We were born out of the relationship of two people.&lt;br /&gt;And the day we are born, we belong to our first community, which is the family system.&lt;br /&gt;Community whether small or large can be of great value to us.&lt;br /&gt;&lt;br /&gt;But, if we have not had good experiences with our family, then our identity and role in any future community would be under stress.&lt;br /&gt;&lt;br /&gt;Establishing a place within community has a lot of value but it may mean facing and working through past hurts that have come by way of community.&lt;br /&gt;&lt;br /&gt;A healthy community is built through a process of freely giving and of openly receiving.&lt;br /&gt;Contributing in a healthy way to the community will come from a healthy sense of identity, and a clear purpose.&lt;br /&gt;Our healthy, and true inner sense of purpose will manifest itself into a natural desire to contribute into the world around us, including our communities, and to openly receive from the world around us, creating a healthy "competition" inside the community.&lt;br /&gt;&lt;br /&gt;A healthy "competition" is a behavior that will open to receive and learn, and to give freely&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-1971853960006394119?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/1971853960006394119/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=1971853960006394119' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1971853960006394119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1971853960006394119'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2008/02/founding-our-place-in-community.html' title='Founding our place in a community'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-6307382550591524934</id><published>2008-02-21T16:21:00.000-08:00</published><updated>2008-02-21T16:41:27.388-08:00</updated><title type='text'>0.5 + 0.5 =1</title><content type='html'>In the previous post, I've mentioned that in our society we have a wrong idea, that a relationship will complete us.&lt;br /&gt;&lt;br /&gt;The general idea in our society that man is a half, and a woman is the second half, and they combine into one&lt;br /&gt;0.5 + 0.5 = 1&lt;br /&gt;&lt;br /&gt;People refer to their spouses as "my other half"&lt;br /&gt;&lt;br /&gt;We could not be a complete&lt;br /&gt;Anyone of us has issues, fears, attachments and emotions that prevent us from living our life to its full, and from living a heartful life.&lt;br /&gt;In that sense, we are not complete.&lt;br /&gt;We need to grow up.&lt;br /&gt;And this is the life journey is all about.&lt;br /&gt;About growing up.&lt;br /&gt;&lt;br /&gt;We grow up, emotionally, physically, career wise, mentally.... etc&lt;br /&gt;&lt;br /&gt;Every experience in our life is an opportunity to learn more about ourselves, and to heal some old wounds, and to go deeper into our purpose of living.&lt;br /&gt;&lt;br /&gt;So, maybe we are not complete in that sense.&lt;br /&gt;&lt;br /&gt;But the idea of me being complete with someone else, who is not complete as well, doesn't mean it has to work.&lt;br /&gt;&lt;br /&gt;So, I have issues, wounds, fears....etc&lt;br /&gt;and I go into an intimate relationship with someone else who has other issues, fears...etc&lt;br /&gt;&lt;br /&gt;And I think that my spouse will help me grow up, and heal those fears, or wounds&lt;br /&gt;&lt;br /&gt;and for a healthy relationship, this is what the relationship is about.&lt;br /&gt;&lt;br /&gt;So, it is going to be 0.5 + 0.5 = 1&lt;br /&gt;&lt;br /&gt;But for unhealthy relationship, where our fears prevent us from understand the dynamics that are going on into our relationship&lt;br /&gt;Or our fears block us from admitting that we need to grow up, then the formula will be different.&lt;br /&gt;&lt;br /&gt;The formula will be 0.5 * 0.5 = 0.25&lt;br /&gt;&lt;br /&gt;Each side of the relationship will try to control the other side, and makes him feel guilty, or down in order to feel secure.&lt;br /&gt;&lt;br /&gt;In this situation, each side will feed the other side of his fears, and wounds, instead of healing the other side wounds.&lt;br /&gt;We become stuck on arguments that could repeat itself for years.&lt;br /&gt;&lt;br /&gt;Instead of healing and growing up, we will become stuck, and destructive&lt;br /&gt;&lt;br /&gt;The challenge is to keep our relationship as 0.5 + 0.5 = 1&lt;br /&gt;&lt;br /&gt;And when we feel it is going to be 0.5 * 0.5, then it is time to move out with a clean loving way.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-6307382550591524934?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/6307382550591524934/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=6307382550591524934' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6307382550591524934'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6307382550591524934'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2008/02/05-05-1.html' title='0.5 + 0.5 =1'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-4587567706212274853</id><published>2008-02-15T08:45:00.000-08:00</published><updated>2008-02-15T09:31:26.181-08:00</updated><title type='text'>The most important love</title><content type='html'>So, it is Valentine and everyone is talking about love.&lt;br /&gt;So, I thought I will talk about love, and about the most important love in our life.&lt;br /&gt;&lt;br /&gt;Loving ourselves.&lt;br /&gt;&lt;br /&gt;The starting point of receiving love in our lives is to fully love ourselves.&lt;br /&gt;Loving ourselves ,as well, is the first step of loving others.&lt;br /&gt;Without loving ourselves, then no matter how much love is coming in our direction, we won't be able to receive deeply that love.&lt;br /&gt;And without loving ourselves, then we cannot give real love to others.&lt;br /&gt;&lt;br /&gt;Loving ourselves give us the feel of completeness, or the feeling that we are complete.&lt;br /&gt;if we feel incomplete in ourselves, or we feel that we need a relationship to be complete then this feeling is an indication that we steel need to love ourselves more.&lt;br /&gt;&lt;br /&gt;If we feel that we need a relationship to be complete then we are in co-dependency situation, where we are dependent on the relationship to accept and love ourselves.&lt;br /&gt;&lt;br /&gt;Unfortunately, our culture in someway building more co-dependency in our view of life.&lt;br /&gt;How many times someone mention his partner as "My other half"&lt;br /&gt;like a person is just a half person, and he/she is not complete without the other half.&lt;br /&gt;and worst when a man talk about his wife/spouse as "my best half"&lt;br /&gt;Like he is the worst half, and she is the best half&lt;br /&gt;&lt;br /&gt;In the movie "Jerry Maguire", Tom Cruise in a "Romantic" moment in the movie talks to his love in the movie and say : "You complete me", and the music plays in the background and the actress smiles and her tears goes down.&lt;br /&gt;&lt;br /&gt;In movies, songs, TV or in all our culture, we have been grown up in the idea that love and relationships complete us.&lt;br /&gt;&lt;br /&gt;Unfortunately, this is a totally wrong idea, because if we are not complete, then we cannot give love, and we cannot receive love.&lt;br /&gt;&lt;br /&gt;We cannot go in a deep level of love and into deeper levels of relationship without being complete and feel the strength in ourselves, to give and receive love.&lt;br /&gt;&lt;br /&gt;Without being complete, and feeling the strength in ourselves, then any relationship could be a co-dependency environment.&lt;br /&gt;And this is why breaking-up is so difficult for some people, because the relationship was a source of feeling worthy, then breaking up means feeling unworthy.&lt;br /&gt;&lt;br /&gt;True love, comes from strength, confident, complete personality.&lt;br /&gt;And the only way to get all those is to love ourselves deeply.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-4587567706212274853?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/4587567706212274853/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=4587567706212274853' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/4587567706212274853'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/4587567706212274853'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2008/02/most-important-love.html' title='The most important love'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-5184596797161162976</id><published>2008-01-08T11:34:00.000-08:00</published><updated>2008-01-08T11:56:12.143-08:00</updated><title type='text'>My first physical healing</title><content type='html'>After I've read about &lt;a href="http://en.wikipedia.org/wiki/Energy_medicine"&gt;Energy Medicine&lt;/a&gt;, I've decided to avoid taking any chemical-based medicine.&lt;br /&gt;According to the energy medicine, we can heal our body by activating the energy in our body.&lt;br /&gt;&lt;br /&gt;And I had the first test few weeks ago.&lt;br /&gt;My co-worker had a cold, and I picked up the germs.&lt;br /&gt;I felt the cold is starting to winning the battle in my body.&lt;br /&gt;So I did the following:&lt;br /&gt;&lt;br /&gt;1 - I drunk lots of distilled water , and I mean a lot, which maybe 4 or 5 letters a day.&lt;br /&gt;Distilled water will balance the Acid-Alkaline in the body, and the more balance we have in Acid-Alkaline, the more our immune system can fights germs effectively.&lt;br /&gt;&lt;br /&gt;2 - I eat Papaya, and water melon, because both of them raise up the Alkaline level of the body.&lt;br /&gt;Usually and because we eat salt, protein and sugar, then our body is more acidic, and raising up the Alkaline, will help put back the balance in Acid-Alkaline.&lt;br /&gt;&lt;br /&gt;3 - I start to activate more the throat Chakra.&lt;br /&gt;Throat Chakra is the energy center that is responsible of keeping the throat, nose healthy.&lt;br /&gt;I dressed up in blue color to add more energy to the throat chakra.&lt;br /&gt;As well, I practiced some singing.&lt;br /&gt;&lt;br /&gt;I did the above for two days and in tow days, I didn't have any symptoms of cold, and I did that while I was still working, and I didn't take any day off.&lt;br /&gt;&lt;br /&gt;That was the first test I did, since I decided to avoid the chemical-based medicine&lt;br /&gt;I didn't know how much successful I can do to avoid totally any medicine.&lt;br /&gt;&lt;br /&gt;One practice that can help boost our immune system, and help our body fight germs and viruses is &lt;a href="http://en.wikipedia.org/wiki/Kundalini_yoga"&gt;Kundalini Yoga&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;I am practicing more Kundalini Yoga.&lt;br /&gt;&lt;br /&gt;My objective is to not take any chemical-based medicine in all my life.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-5184596797161162976?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/5184596797161162976/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=5184596797161162976' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/5184596797161162976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/5184596797161162976'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2008/01/my-first-physical-healing.html' title='My first physical healing'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-3010258323809699643</id><published>2007-12-11T19:39:00.000-08:00</published><updated>2007-12-11T19:47:14.702-08:00</updated><title type='text'>Quotes from Jalal Al-Din Al-Rumi</title><content type='html'>&lt;ul&gt;&lt;li&gt;&lt;span class="sqq"&gt;Your task is not to seek for love, but merely to seek and find all the barriers within yourself that you have built against it.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="sqq"&gt;Lovers don't finally meet somewhere. They're in each other all along.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="sqq"&gt;Out beyond ideas of wrongdoing and rightdoing, there is a field. I will meet you there.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="sqq"&gt;Let the beauty of what you love be what you do&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="sqq"&gt;Don't grieve. Anything you lose comes round in another form.&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="sqq"&gt;You were born with wings. Why prefer to crawl through life?&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;And finally my favorite:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;span class="sqq"&gt;Why do you stay in prison when the door is so wide open?&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class="sqq"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-3010258323809699643?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/3010258323809699643/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=3010258323809699643' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/3010258323809699643'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/3010258323809699643'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/12/quotes-from-jalal-al-din-al-rumi.html' title='Quotes from Jalal Al-Din Al-Rumi'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-1743573407876824588</id><published>2007-11-19T19:34:00.000-08:00</published><updated>2007-11-19T19:45:54.085-08:00</updated><title type='text'>Conflict in intimate relationship</title><content type='html'>In an intimate relationship, we are going in a journey of discovering and binding more into the other part of the relationship.&lt;br /&gt;During that journey we expose more of ourselves.&lt;br /&gt;And we discover more of the other part.&lt;br /&gt;Sometimes those parts of ourselves scare us, and we don't want to expose them.&lt;br /&gt;And that is the major source of conflict in a relationship.&lt;br /&gt;When a conflict occurs in a relationship, then it is a sign that the relationship is going into more deeper level.&lt;br /&gt;going into more dipper level, triggers our fears and old wounds in the subconscious, which manifest themselves into conflicts.&lt;br /&gt;Any conflict is an opportunity to go deeper in the relationship, and make the relationship more strong, if we know how to use the conflict to discover and learn about ourselves and heal our wounds.&lt;br /&gt;Every conflict in an intimate relationship is an opportunity for us to grow up.&lt;br /&gt;&lt;br /&gt;But if we were too scared of doing so, and maybe we become scared of admitting that we should grow up, then we move to judging the other person, or blaming and manipulating.&lt;br /&gt;&lt;br /&gt;Judging, controlling, and manipulating are tools that maybe are effective in controlling the other part of the relationship, but what we are doing in this case is betraying ourselves, before we are betraying the other part.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-1743573407876824588?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/1743573407876824588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=1743573407876824588' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1743573407876824588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1743573407876824588'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/11/conflict-in-intimate-relationship.html' title='Conflict in intimate relationship'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-6951224217576443042</id><published>2007-11-19T11:07:00.000-08:00</published><updated>2007-11-19T11:17:36.361-08:00</updated><title type='text'>Songs from the heart</title><content type='html'>A new wonderful friend of mine, &lt;a href="http://www.anthonyburbidge.com/index.php?s=front&amp;amp;p=index"&gt;Anthony Burbidge&lt;/a&gt; is an artist.&lt;br /&gt;He writes and performs lovely heartfelt songs.&lt;br /&gt;His songs are full of wisdom, and love&lt;br /&gt;If you want a lovely gift for Christmas, I encourage you to buy his CD.&lt;br /&gt;I am writing here the lyrics of my favorite songs of his&lt;br /&gt;&lt;br /&gt;&lt;div align="center"&gt;&lt;u&gt;&lt;span style="font-size:180%;"&gt;You're Not Alone&lt;/span&gt;&lt;/u&gt;&lt;/div&gt; &lt;div align="center"&gt; &lt;/div&gt;     &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;For most of my life I've felt alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;As if who I really am could never be known&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Too lost in my head to ever see&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;That most of the world feels like me&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;But now my heart's become my guide&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;And I have opened up to life&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;And I can see&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;I'm not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;I'm not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;I'm not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;In this life&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Now I wonder are you hurting on your own?&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Do you believe you need to live your life alone?&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Are you in your head?&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Are you in your hurt?&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Have your lost your way?&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Can you not see your hurt in me?&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;I feel the same.&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Oh let your heart become your guide&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;I know you'll shine when you open up to life&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;And you will see&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;You're not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;You're not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;You're not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;In this life&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;Just as the stars share the ancient skies&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;So goes the truth of you and I&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;That deep within we share a secret code of life&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;A common thread that's sown too deep to be denied&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;So may our hearts become our guides&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;I know we'll shine when we open up to life&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;And we will see&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;We're not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;We're not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;We're not alone&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;In this life&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;---&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;And may you see&lt;/span&gt;&lt;/div&gt; &lt;div align="center"&gt;&lt;span style="font-size:85%;"&gt;You're not alone&lt;/span&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-6951224217576443042?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/6951224217576443042/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=6951224217576443042' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6951224217576443042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6951224217576443042'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/11/songs-from-heart.html' title='Songs from the heart'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-8081605737105845398</id><published>2007-11-07T11:40:00.000-08:00</published><updated>2007-11-07T11:52:27.447-08:00</updated><title type='text'>Receiving the abundance in life</title><content type='html'>Life will give us in many different ways and many different forms, if we are open to receive what is appropriate for us.&lt;br /&gt;We can have an expectation that the life will nourish us, and support us.&lt;br /&gt;I call that a healthy expectation, because it build trust in the universe, and make us remove any blocks of receiving, that could arise from the non-trust.&lt;br /&gt;&lt;br /&gt;But there are other types of expectations that are unhealthy.&lt;br /&gt;When we start to demand to fulfill our needs by specific expectations, then we set ourselves for being let down.&lt;br /&gt;When we attach to specific expectations then we block our selves from the other ways that the life is trying to give us through.&lt;br /&gt;&lt;br /&gt;To receive fully, we must open fully, and trust fully.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-8081605737105845398?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/8081605737105845398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=8081605737105845398' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/8081605737105845398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/8081605737105845398'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/11/receiving-abundance-in-life.html' title='Receiving the abundance in life'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-7229079493918002662</id><published>2007-10-29T11:53:00.000-07:00</published><updated>2007-10-29T12:02:23.448-07:00</updated><title type='text'>Embracing happiness and well-being</title><content type='html'>Happiness and well-being come naturally when we find and live our purpose in life.&lt;br /&gt;But when we are still looking for our purpose, then we can move the right steps forward by following our intuition, which is the voice of our true essence.&lt;br /&gt;&lt;br /&gt;When we consolidate and follow our intuition then our internal sense of well-being builds.&lt;br /&gt;And then we can have more sense and get more inspired of our purpose.&lt;br /&gt;Having a sense of purpose and applying it in our life, feeds our passion, inspiration and even our creativity.&lt;br /&gt;Following our purpose will open the true gifts that we have deep inside.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-7229079493918002662?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/7229079493918002662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=7229079493918002662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7229079493918002662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7229079493918002662'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/10/embracing-happiness-and-well-being.html' title='Embracing happiness and well-being'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-7808615440380325243</id><published>2007-10-19T14:24:00.000-07:00</published><updated>2007-10-19T14:30:56.580-07:00</updated><title type='text'>Words of wisdom</title><content type='html'>- Experience is a hard teacher because she gives the test first and the lesson afterwards.&lt;br /&gt;&lt;br /&gt;- When you complain about something or someone, you give it or them power over you.&lt;br /&gt;&lt;br /&gt;- Peace of mind is not the absence of conflict but the ability to deal with it.&lt;br /&gt;&lt;br /&gt;- To live a creative life, we must let go of letting our fear of being wrong stop us from stepping forward.&lt;br /&gt;&lt;br /&gt;- Our lives are not determined by what happens to us, they are determined by how we respond to what happens.&lt;br /&gt;&lt;br /&gt;and finally:&lt;br /&gt;&lt;br /&gt;- A person with a heart near breaking from witnessing the pain in the world cries out to God: "Look at the distress in the world, why you don't send help?"&lt;br /&gt;God responds, "I did send help, I sent you."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-7808615440380325243?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/7808615440380325243/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=7808615440380325243' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7808615440380325243'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7808615440380325243'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/10/words-of-wisdom.html' title='Words of wisdom'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-4682685325721364627</id><published>2007-09-04T22:38:00.000-07:00</published><updated>2007-09-04T23:30:18.819-07:00</updated><title type='text'>The roots of energy and emotions</title><content type='html'>I've been always fascinated by the emotions.&lt;br /&gt;Why humans have emotions and feelings.&lt;br /&gt;And why those emotions and feelings are very primitive in animals, and very complex in human.&lt;br /&gt;The smarter the animal is, the more complex its feelings are.&lt;br /&gt;We have more than feelings.&lt;br /&gt;We have feelings that are rooted in the sub-conscious where we don't know about them, or we are not conscious about them, but they are driving our life.&lt;br /&gt;Those feelings and emotions are driving our daily life, and generate our energy.&lt;br /&gt;Why animals always have energy, where some humans are lacking energy.&lt;br /&gt;Why when we get depressed, we loose energy.&lt;br /&gt;What is the relation between our emotions, our physical being, our thoughts, and our energy?&lt;br /&gt;I was reading in this field, and I am fascinated by how much I didn't know about that field.&lt;br /&gt;I am fascinated by how much I didn't know about myself.&lt;br /&gt;It is impossible to describe everything in one post, so I will try to just describe briefly what I found.&lt;br /&gt;&lt;br /&gt;We have thoughts that are generated in our mind, that are generated by our perception of life.&lt;br /&gt;Some of those thoughts will generate emotions.&lt;br /&gt;Every emotion that we have had felt, was not only effecting the mind, but as well the body.&lt;br /&gt;Those emotions effected our cells, our digestive system, and all our body.&lt;br /&gt;Those emotions stored their effects in our body.&lt;br /&gt;So our body is a storage medium for all our emotions since we were born.&lt;br /&gt;Even with emotions that we felt when we were 1 year old, and we are totally not conscious about those emotions, or those memories, but they are stored in the sub-conscious and in our body&lt;br /&gt;&lt;br /&gt;Every single small physical process in our body is effected by those emotions that we have had.&lt;br /&gt;And our physical appearance, and our health will be a result of all of that.&lt;br /&gt;Which means all our physical illness is rooted back to our emotions.&lt;br /&gt;And which means that we can cure our physical illness by both a physical and spiritual approach.&lt;br /&gt;&lt;br /&gt;The conventional medicine, that depend on drug, is a passive type of cure.&lt;br /&gt;You have to follow the instruction of the doctors and take the drug, that does its job in killing the germs and protecting the body. Our role in this process is very passive.&lt;br /&gt;&lt;br /&gt;Where the spiritual approach is an active approach that target the root of the illness, which is the spiritual/emotional part, and try to heal it, and then renovate the cells and the physical body by having a positive thoughts and positive attitude, and eating healthy. Our role in this process is very active.&lt;br /&gt;&lt;br /&gt;In the spiritual approach, we are doing the healing, and we are the leader of the healing process.&lt;br /&gt;&lt;br /&gt;In the conventional medicine, the drug is the cure, and we cure the physical illness but we don't heal the emotional/spiritual roots.&lt;br /&gt;&lt;br /&gt;The difference between the conventional medicine, and the healing process, is one make us passive, and one make us active.&lt;br /&gt;&lt;br /&gt;The physical health is a manifestation of our emotions, and so our energy.&lt;br /&gt;Our energy is a reflection and a measure for our physical health.&lt;br /&gt;The positive thinking, will help the digestion, and all chemical activities in the body to run fast, so we generate energy.&lt;br /&gt;Where negative thinking will block all the processes, and accumulate the toxic in the body.&lt;br /&gt;&lt;br /&gt;All our physical illness is rooted back to our emotions, and some are obvious like: heart disease, back pain, cancer.&lt;br /&gt;We can heal most of those illness by healing the roots, and then eating healthy and take care of our bodies, which allows the body to protect and reconstruct itself.&lt;br /&gt;We are capable of healing our-selves, but unfortunately, our culture doesn't understand that, and the giant pharmaceutical corporations are hiding these information from us.&lt;br /&gt;&lt;br /&gt;I am not saying that we should not take any medicine.&lt;br /&gt;Sometimes, we are not spiritually and emotionally have the enough energy that is important for our healing, and then we need to take the drugs.&lt;br /&gt;But adding a spiritual healing to our drugs will boost the results.&lt;br /&gt;&lt;br /&gt;I like to talk about the roots of the energy in our body which is the chakras, but I will leave it to another post, because it is large subject.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-4682685325721364627?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/4682685325721364627/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=4682685325721364627' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/4682685325721364627'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/4682685325721364627'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/09/roots-of-energy-and-emotions.html' title='The roots of energy and emotions'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-7579478368729527941</id><published>2007-09-04T17:22:00.000-07:00</published><updated>2007-09-04T17:38:02.703-07:00</updated><title type='text'>Conflict Resolution</title><content type='html'>Every conflict we face in our life either in job, relationship, is a reflection of an internal conflict that we didn't solve inside of us.&lt;br /&gt;If we are clear of what we want, and we love ourselves, and then we can naturally express our boundaries and being self-assertive, so that make it clear to others what we want and what extent we are willing to go.&lt;br /&gt;At the same time, and because we are respecting our boundaries, then we respect the boundaries for others, and then we can have an open heart approach to any conflict that we face.&lt;br /&gt;&lt;br /&gt;But a conflict will occur when we cannot be self-assertive, and have trouble expressing our boundaries.&lt;br /&gt;And we don't respect our own boundaries, then we don't respect other people boundaries.&lt;br /&gt;So, we could do some "compromise" which we expect something in return, or even go into the sacrifice&lt;br /&gt;&lt;br /&gt;Both compromise and sacrifice means that we have expectations, that could not be met.&lt;br /&gt;And then we go into conflict because our expectations didn't come up even with the sacrifice that we offered.&lt;br /&gt;&lt;br /&gt;The conflict is an indication that something inside of us should be changed.&lt;br /&gt;We should know how to express our boundaries.&lt;br /&gt;We should love and trust ourselves, so we can trust ourselves to express those boundaries.&lt;br /&gt;When we respect our boundaries, then it is easy to respect other people boundaries, and accept "NO", without feeling rejected.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-7579478368729527941?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/7579478368729527941/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=7579478368729527941' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7579478368729527941'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7579478368729527941'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/09/conflict-resolution.html' title='Conflict Resolution'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-2718365433392990974</id><published>2007-07-30T00:40:00.000-07:00</published><updated>2007-07-30T00:41:14.147-07:00</updated><title type='text'>Culture of oppression and culture of liberation</title><content type='html'>Arts, ideologies, religions, traditions, ethics, values... all are products of the culture that we are living in.&lt;br /&gt;We think that we live in one culture, but actually beneath the surface there are two different cultures that are fighting.&lt;br /&gt;Each culture produces its own ethics, value systems, religions and arts.&lt;br /&gt;They are opposing each other, many times consciously and some time unconsciously.&lt;br /&gt;But only one of them is a mainstream culture.&lt;br /&gt;The main stream culture in north America, is a culture of oppression, because it reproduces our main believes, and it continuously reproduces the box that we have to think inside of.&lt;br /&gt;It continuously reproduces and reaffirms our view to the world, and how we understand the world.&lt;br /&gt;And it continuously regenerates our value system and our ethics.&lt;br /&gt;&lt;br /&gt;The other culture, which is the underground culture, is a culture of liberation.&lt;br /&gt;Because it liberates us from the bondages of the old culture, and produce arts, ethics, values, and religions that are more humanized and centered toward the benefits of the human being as a whole.&lt;br /&gt;The liberating culture, liberates us from the boundaries, and the boxes that limit our thinking.&lt;br /&gt;It allows us to think out of the box.&lt;br /&gt;It liberate us from the dehumanized values, and ethics that are controlling our society, and redefine more humanized values and ethics&lt;br /&gt;It redefines us as human, it reclaims our rights to live with dignity and pride, and it redefines equality among all people.&lt;br /&gt;&lt;br /&gt;In my blog, I will try to make it a voice for the liberating culture.&lt;br /&gt;I will point out to sites, authors, arts and articles that are exploring and discovering the new territories of the new paradigm of social justice, spirituality and humanity.&lt;br /&gt;&lt;br /&gt;Keep tuned because I will discuss very important artists and art productions.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-2718365433392990974?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/2718365433392990974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=2718365433392990974' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2718365433392990974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2718365433392990974'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/07/culture-of-oppression-and-culture-of.html' title='Culture of oppression and culture of liberation'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-6761120739072934056</id><published>2007-07-30T00:20:00.000-07:00</published><updated>2007-07-30T00:31:49.628-07:00</updated><title type='text'>The gift inside</title><content type='html'>We all are gifted.&lt;br /&gt;We all have gifts to give to the universe.&lt;br /&gt;It all starts when we start to listen to our true selves.&lt;br /&gt;It all starts when we appreciate what we really are.&lt;br /&gt;The problems start when we follow our ego, or the expectations of our environment.&lt;br /&gt;&lt;br /&gt;Sometimes we don't care about our strengths because they are not aligned with the expectations that are in the outside world, or the expectations of our egos.&lt;br /&gt;&lt;br /&gt;If you want to unleash your real strength, or gift, then you should start by appreciate who you really are.&lt;br /&gt;Appreciate the authentic of you.&lt;br /&gt;In the common used words: "Be true to your self"&lt;br /&gt;The path to unleash the strength and the gift, is to allow yourself to be out.&lt;br /&gt;Feel your emotions, and give yourself the freedom to be itself.&lt;br /&gt;But that is another post.&lt;br /&gt;&lt;br /&gt;And meanwhile repeat this to yourself.&lt;br /&gt;I am alive, which means I am loved by the divine universe.&lt;br /&gt;The intelligence in the universe loves me, that is why I am alive.&lt;br /&gt;I am here to fulfill a purpose, and my duty is to unleash that purpose and live it in my life.&lt;br /&gt;and so it is.&lt;br /&gt;With love&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-6761120739072934056?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/6761120739072934056/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=6761120739072934056' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6761120739072934056'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6761120739072934056'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/07/gift-inside.html' title='The gift inside'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-2098851974915484715</id><published>2007-07-10T13:26:00.001-07:00</published><updated>2007-07-10T13:26:31.591-07:00</updated><title type='text'>Personal leadership</title><content type='html'>Before I delve into the subject of leadership, let me start with something related to it.&lt;br /&gt;Being our true selves.&lt;br /&gt;It takes courage to be our true selves.&lt;br /&gt;Specially when the environment around us has expectations that are not in alignment with what we really are.&lt;br /&gt;Starting from family and parents. Some of us grew up with parents that had expectations.&lt;br /&gt;And those expectations usually were attached to giving love and blessing.&lt;br /&gt;So in order to get the love and blessing of our parents we had to meet their expectations.&lt;br /&gt;And getting the blessing of parents was a survival issue, because we depended on their acceptance to survive.&lt;br /&gt;&lt;br /&gt;Continuing to school, friendship, relationships, works...&lt;br /&gt;each of the above might has its own expectations, that might not be aligned with our true selves.&lt;br /&gt;From childhood, and many of us, we were not encouraged to follow our personal choice.&lt;br /&gt;&lt;br /&gt;Bit by bit, we will lose our conscious regarding making choices in our lives.&lt;br /&gt;&lt;br /&gt;As long as we are unconscious about making our choices in life, we are vulnerable to be manipulated, controlled by others.&lt;br /&gt;We are vulnerable to fall under co-dependency, where we seek other approvals, and other acceptance to get the self-worth.&lt;br /&gt;We will always look to the outside to get guidance.&lt;br /&gt;&lt;br /&gt;The personal leadership starts from getting the consciousness of our personal choices.&lt;br /&gt;Starts from reclaiming ourselves as our own leaders.&lt;br /&gt;Personal leadership means looking inside and listening to our essence to get guidance.&lt;br /&gt;&lt;br /&gt;And finally I will repeat this affirmation for myself:&lt;br /&gt;I am reclaiming back the power of guiding my own life, to myself.&lt;br /&gt;I am the leader of my own life, and I am powerful, and knowledgeable that I can guide myself to peace, abundance and love, and so it is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-2098851974915484715?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/2098851974915484715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=2098851974915484715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2098851974915484715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2098851974915484715'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/07/personal-leadership.html' title='Personal leadership'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-6568432369548410502</id><published>2007-06-28T09:00:00.000-07:00</published><updated>2007-06-28T09:37:40.393-07:00</updated><title type='text'>Responding and Reacting</title><content type='html'>There is a profound statement that says: "How we do anything is how we do everything"&lt;br /&gt;&lt;br /&gt;If I want to rephrase that statement I would say:&lt;br /&gt;What we are inside, is expressed outside, in every moment and every action we do.&lt;br /&gt;&lt;br /&gt;If we are doing the same things over and over, and if there are patterns that keep occurring in our lives, then it is a sign that something has to change from inside.&lt;br /&gt;&lt;br /&gt;Every challenge that the universe brings to us, is a challenge for us to grow up, and change what is inside.&lt;br /&gt;&lt;br /&gt;Living from inside, and getting the power and the energy from inside is what finally matters.&lt;br /&gt;&lt;br /&gt;Let me give an example here:&lt;br /&gt;If we feel insecure, and powerlessness, and we think by having an opposite reaction by showing power, and being aggressive is the answer, then we are just being in the same loop, and we didn't change from inside.&lt;br /&gt;Aggressive people, who show power will never feel security, and will never have peace.&lt;br /&gt;&lt;br /&gt;Those aggressive people did "React" to their powerlessness feeling.&lt;br /&gt;They didn't "Respond", because responding need power from inside which they don't have.&lt;br /&gt;&lt;br /&gt;All the power should come from inside, and if we don't have that feeling then it is a sign for us to concentrate on the inside and Grow up.&lt;br /&gt;&lt;br /&gt;There is an opportunity for us to grow everyday.&lt;br /&gt;We grow up, emotionally, physically, career wise, and socially.&lt;br /&gt;&lt;br /&gt;The universe is full of abundance, even with the challenges that the universe is bringing to our lives, they are opportunity for growing up and get the blessing.&lt;br /&gt;Even when we faced with challenges that we never wanted them in our lives, or with failures, then it is up to us how to respond to them.&lt;br /&gt;&lt;br /&gt;But first we have to be in place where we Respond to the challenges, and not React.&lt;br /&gt;React comes from a place of lack, and powerlessness, where Respond comes from a place of power and assertion.&lt;br /&gt;&lt;br /&gt;Even in places and moment that we feel powerlessness and we don't have control over things, then we should not react, but instead feel the grieve of that situation.&lt;br /&gt;&lt;br /&gt;Feeling the grieve, and living the grieve is a blessing because it opens our channel to get more love and blessing from the outside.&lt;br /&gt;&lt;br /&gt;Finally I would repeat this statement for myselfL&lt;br /&gt;Everything in the universe is an opportunity and a message from the universe to my soul to grow continuously, and get tuned with the love and the abundance that in the universe, and so it is.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-6568432369548410502?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/6568432369548410502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=6568432369548410502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6568432369548410502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6568432369548410502'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/06/responding-and-reacting.html' title='Responding and Reacting'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-982250063919776111</id><published>2007-06-08T22:18:00.000-07:00</published><updated>2007-06-08T22:58:08.476-07:00</updated><title type='text'>Living a purposeful life</title><content type='html'>Life has no meaning.&lt;br /&gt;We wake up like everyday, go to work, eat and sleep like everyday.&lt;br /&gt;Life by itself, is meaningless.&lt;br /&gt;We define our meaning for life.&lt;br /&gt;We create meaning by creating a purpose for our life.&lt;br /&gt;To know our true purpose in life, we have to tap deep inside our soul, and our true essence.&lt;br /&gt;Maybe we are living our life, disconnected from our soul.&lt;br /&gt;We live in our "Role" or our "Ego"&lt;br /&gt;But our role, and our ego, are not the same as our soul.&lt;br /&gt;The soul seeks true service in life, where the Role seeks labels, and positions and material attachments  to try to find a value.&lt;br /&gt;&lt;br /&gt;When we disconnect from our true self, then we are disconnected from the true energy, the true value, and the true purpose, and then we try to cover it up by looking for better car, better house, and looking for a management position, just to give our Role values and worth, and all that because we lost our true worth which is our true essence and our soul.&lt;br /&gt;&lt;br /&gt;Thomas Merton wrote:&lt;span style=";font-family:Helvetica;font-size:85%;color:black;"   &gt;&lt;span style=";font-size:10;color:black;"  &gt; &lt;i&gt;&lt;span style="font-style: italic;"&gt;if one is not called to solitary life, the more he is alone the more he will worry about living and forget to live.  &lt;/span&gt;&lt;/i&gt;Merton was a monk and he was speaking about finding our true vocation and how if we are not spending our days doing what we love we begin to forget the needs of the soul and therefore our humanity.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;When we follow our true purpose in life, and when our true essence is vibrant and live, then we are connected to unlimited energy, and unlimited feeling of worth and value.&lt;br /&gt;Then when we look for a leadership position, it is because leadership is a true service that we can provide, and not a label that give our role a worth.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Let me tell you my story.&lt;br /&gt;I have been living my role for long time, and neglecting my true essence.&lt;br /&gt;And now I am trying to come back to my soul.&lt;br /&gt;I found it difficult to leave my role behind, and follow my soul, specially when I have a job, a house, and a life that I get used to.&lt;br /&gt;So, I thought about it, and I came to an innovative solution.&lt;br /&gt;My solution is to bring my soul to my role.&lt;br /&gt;My solution is to bring my unlimited and unconditional love and forgiveness to my work environment.&lt;br /&gt;I convinced my co-worker to buy fair-coffee instead of normal coffee.&lt;br /&gt;I am volunteering in community-based projects that build healthy communities.&lt;br /&gt;&lt;br /&gt;When we get right with the life we are currently living, we open up the channels for creative ideas and growth.  Resisting what we are doing is deadly.  It just puts us in a holding pattern and there is nowhere to go.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-982250063919776111?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/982250063919776111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=982250063919776111' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/982250063919776111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/982250063919776111'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/06/living-purposeful-life.html' title='Living a purposeful life'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-2297152682208117234</id><published>2007-05-27T04:32:00.000-07:00</published><updated>2007-05-27T04:55:27.795-07:00</updated><title type='text'>Delving into the anger</title><content type='html'>The anger has been misunderstood, and misused for long time.&lt;br /&gt;The anger is originated from the "power of life".&lt;br /&gt;The love and anger has the same deep source, which is loving our essence, and ourself.&lt;br /&gt;Usually I have been suppressing my anger almost all my life.&lt;br /&gt;When I was a child I was ashamed after being angry, so all my life I was playing the nice guy role.&lt;br /&gt;In the surface, I am that nice guy, gentle, and polite, but the inside was full of anger.&lt;br /&gt;I was oppressing that anger, and wasting energy on oppressing that anger.&lt;br /&gt;So I had a power that is coming from inside, which expressed as anger, and I am wasting more power to oppressed that internal power.&lt;br /&gt;No wonder that I was feeling tired, empty, lack of energy all that time.&lt;br /&gt;Every morning was a battle to wake up and go to work.&lt;br /&gt;No energy inside.&lt;br /&gt;&lt;br /&gt;So I started to permit myself to express that anger, and after I did that I discovered what beneath that anger.&lt;br /&gt;the anger is a power of life that is coming from inside to protect us.&lt;br /&gt;When we feel of place where we don't have choice, then we feel being a victim, and then the anger comes to protect us.&lt;br /&gt;Instead of oppressing that anger, we should tap into its energy and forward it to our healing.&lt;br /&gt;We should first look back and see where that place of no choice was originated, and learn how we can make boundary for ourselves to protect ourselves.&lt;br /&gt;And then forward the energy of anger to be constructive instead of destructive.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-2297152682208117234?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/2297152682208117234/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=2297152682208117234' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2297152682208117234'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2297152682208117234'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/05/delving-into-anger.html' title='Delving into the anger'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-3790804166550024294</id><published>2007-04-16T11:41:00.000-07:00</published><updated>2007-04-16T12:01:08.490-07:00</updated><title type='text'>Spiritual seeds</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.sustland.umn.edu/implement/images/planting_seeds_6l.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://www.sustland.umn.edu/implement/images/planting_seeds_6l.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;It is spring again, and it is time for people to plant their seeds in their backyards, and gardens.&lt;br /&gt;All grocery stores right now, display seeds of vegetables, and flowers.&lt;br /&gt;As I am planting some vegetable seeds in my backyard, I am thinking of the seeds that I want to grow in my inner backyard, and in my life.&lt;br /&gt;What I will get in my life, is a result of the seeds that I am planting right now in my self, and in my spiritual life.&lt;br /&gt;After I plant the seeds in my backyard, I want to take care of them, feed them and eliminate the weeds around them.&lt;br /&gt;The same with my spiritual seeds, that I have to feed them and eliminate the weeds around them.&lt;br /&gt;&lt;br /&gt;I decided to grow the seeds of unconditional love, and unconditional forgiveness for my self, and for everybody else.&lt;br /&gt;these seeds are going to grow to success, happiness and connection with the universe.&lt;br /&gt;I am going to eliminate the weeds of hate, blame, judging, and attachment.&lt;br /&gt;&lt;br /&gt;My inner garden is going to bloom this summer with happiness, success and love for my self and for others.&lt;br /&gt;&lt;br /&gt;I know a beautiful story of how to feeds our spiritual seeds.&lt;br /&gt;The story goes like that&lt;br /&gt;&lt;br /&gt;An old Cherokee is teaching his grandson about life. "A fight is&lt;br /&gt;going on inside me," he said to the boy. "It is a terrible fight&lt;br /&gt;and it is between two wolves.&lt;br /&gt;&lt;br /&gt;One is evil - he is anger, envy, sorrow, regret, greed, arrogance,&lt;br /&gt;self-pity, guilt, resentment, inferiority, lies, false pride, superiority,&lt;br /&gt;and ego.&lt;br /&gt;&lt;br /&gt;The other is good - he is joy, peace, love, hope, serenity, humility,&lt;br /&gt;kindness, benevolence, empathy, generosity, truth, compassion,&lt;br /&gt;and faith. This same fight is going on inside you - and inside&lt;br /&gt;every other person, too."&lt;br /&gt;&lt;br /&gt;The grandson thought about it for a minute and then asked his grandfather,&lt;br /&gt;"Which wolf will win?"&lt;br /&gt;&lt;br /&gt;The old Cherokee simply replied, "The one you feed."&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-3790804166550024294?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/3790804166550024294/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=3790804166550024294' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/3790804166550024294'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/3790804166550024294'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/04/spiritual-seeds.html' title='Spiritual seeds'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-6298991739749560716</id><published>2007-04-09T23:36:00.000-07:00</published><updated>2007-04-10T00:08:54.362-07:00</updated><title type='text'>The ultimate health guide</title><content type='html'>One of the ideas that is triggering me right now is to write a book about the ultimate health guide.&lt;br /&gt;Spiritual health, and physical health.&lt;br /&gt;Spiritual health by having positive thinking, and creative thoughts every moment in life.&lt;br /&gt;And physical health by eating raw food, and practice yoga that re-connect ourselves to our body.&lt;br /&gt;&lt;br /&gt;Eating raw food is a new challenge for me.&lt;br /&gt;I am trying to adopt 100% raw food diet, but it is very difficult.&lt;br /&gt;Specially when I want to eat outside.&lt;br /&gt;&lt;br /&gt;The problem with eating raw food, is you have to be 100% raw food consumer.&lt;br /&gt;Otherwise, you cannot get the full benefits, even when you are 97% raw.&lt;br /&gt;&lt;br /&gt;The benefits of raw food is beyond the imagination.&lt;br /&gt;Just compare us to the animals in the wild.&lt;br /&gt;Do the wild animals get sick, and even when they rarely get sick, do they need chemical medicine to get better?&lt;br /&gt;Do they need coffee to get energy to wake up in the morning?&lt;br /&gt;&lt;br /&gt;Our life style is very unhealthy, and it lacks of energy.&lt;br /&gt;We wake up in the morning and we need coffee to get some energy.&lt;br /&gt;Then at lunch we eat meat that require long time to digest, and require lots of energy to be digested.&lt;br /&gt;And because we cannot get enough rest to digest the food at lunch, then we feel low of energy.&lt;br /&gt;So the solution is to drink coffee again.&lt;br /&gt;The coffee after lunch is a recipe for disaster&lt;br /&gt;Coffee will  be mixed with the food, and it slows down the digestion process more.&lt;br /&gt;As well, it sucks the Calcium out of the body, and the Calcium is essential for lots of digestion processes.&lt;br /&gt;&lt;br /&gt;Then we get sick, and we use chemical-based medicine.&lt;br /&gt;Actually it become very hard for our body to fight the germs, and the virus because our body is already full of toxic from the food.&lt;br /&gt;&lt;br /&gt;That is why a wild animal won't get sick, and even get sick, his system can fight that.&lt;br /&gt;But our body is already full of toxic, so the immune cells are confused with what is there in our body.&lt;br /&gt;&lt;br /&gt;Raw food will be full of energy, full of enzymes that are essential to digest the food.&lt;br /&gt;By eating raw food, we won't get sick&lt;br /&gt;Our skin will be healthy, and we will feel the energy all the time&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-6298991739749560716?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/6298991739749560716/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=6298991739749560716' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6298991739749560716'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6298991739749560716'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/04/ultimate-health-guide.html' title='The ultimate health guide'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-6227907775982029186</id><published>2007-04-08T20:28:00.000-07:00</published><updated>2007-04-08T20:59:30.004-07:00</updated><title type='text'>A story that changed my life</title><content type='html'>I will tell you a story that changed my life.&lt;br /&gt;It is a very ordinary story, but thinking about it will reveal lots of ideas.&lt;br /&gt;&lt;br /&gt;A friend of mine is teaching Tai Che&lt;br /&gt;She has been teaching Tai Che for the last 6 years, and now she is a professional teacher and earn enough money by just teaching Tai Che.&lt;br /&gt;&lt;br /&gt;She was introduced to the Tai Che by a coincidence.&lt;br /&gt;10 years ago she went to a dance class.&lt;br /&gt;But the class was canceled or she forget the time, and she didn't find the dance class, but she found a class for Tai Che.&lt;br /&gt;&lt;br /&gt;She was interested to know what is Tai Che, and after few years she ended up teaching Tai Che.&lt;br /&gt;&lt;br /&gt;The moral of the story is: there are lots of abundance in the universe around us, but we should be ready to accept it.&lt;br /&gt;&lt;br /&gt;Let me explain&lt;br /&gt;If that story did happen to me one year ago, I would act differently&lt;br /&gt;I will be disappointed by missing the dance class, and either will blame myself for forgetting the correct time or get upset on the organizer to not letting me know the shift of time, and I will go back home disappointed, angry, and upset.&lt;br /&gt;&lt;br /&gt;The disappointment, anger, upset, hatred or any negative feeling or thinking are blocking our channels to the world and the universe.&lt;br /&gt;So that anger won't let me think of trying or even noticing the Tai Che class.&lt;br /&gt;&lt;br /&gt;But she acted differently, because she was ready for new things in her life.&lt;br /&gt;She was ready to receive the abundance in the universe.&lt;br /&gt;She was ready to see the universe as it is.&lt;br /&gt;She was flexible, because she was not controlled by the negative thoughts, but instead was opening her soul to the universe.&lt;br /&gt;&lt;br /&gt;Negative thinking is a block between us and the universe.&lt;br /&gt;&lt;br /&gt;Negative thinking is not a pure thought, because they don't create anything&lt;br /&gt;They are re-actions and they are originated in the right side of the brain ( or the analytical part)&lt;br /&gt;&lt;br /&gt;The pure thoughts are creative and they are originated in the left side of the brain ( the creative side)&lt;br /&gt;&lt;br /&gt;That simple story of the Tai Che teacher made me think about myself, and my perspective to the world.&lt;br /&gt;Am I seeing the whole picture?&lt;br /&gt;Could I be missing lots of stuff?&lt;br /&gt;&lt;br /&gt;So, I start opening my channels to the world by eliminating my negative thoughts.&lt;br /&gt;Observing my negative thoughts, and replace them with positive creative thoughts, was the guarantee that I won't miss a lot, and I will receive the abundance in the world.&lt;br /&gt;&lt;br /&gt;Positive thinking is not an easy thing to do.&lt;br /&gt;It is not a decision&lt;br /&gt;It is a practice, and daily behavior&lt;br /&gt;I am leaning step by step&lt;br /&gt;And the more I learn, the more I feel stronger.&lt;br /&gt;&lt;br /&gt;This is one of my new goals: Receive the abundance in the universe, and make sure I am not blocking it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-6227907775982029186?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/6227907775982029186/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=6227907775982029186' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6227907775982029186'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6227907775982029186'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/04/story-that-changed-my-life.html' title='A story that changed my life'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-7980927413084274961</id><published>2007-03-30T11:11:00.000-07:00</published><updated>2007-03-30T12:57:32.538-07:00</updated><title type='text'>The pursuit of happiness and love</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.cgstock.com/pics/4186.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://www.cgstock.com/pics/4186.jpg" alt="" border="0" /&gt;&lt;/a&gt;  &lt;p class="MsoNormal"&gt;Everybody is looking for happiness and love, and everybody is trying to be happy and loved.&lt;br /&gt;Some work hard to be happy.&lt;br /&gt;But most of us forget about the real true happiness and love.&lt;br /&gt;Do you want to know where is the true happiness?&lt;br /&gt;Then look at the children.&lt;br /&gt;Can you be happy more than a child?&lt;br /&gt;Can't you see that the child is a true happy person?&lt;br /&gt;&lt;br /&gt;The child is happy not because he has lots of money.&lt;br /&gt;The child is happy not because he has the latest car, and the hottest spouse.&lt;br /&gt;The child doesn't love you because you are rich.&lt;br /&gt;&lt;br /&gt;The child loves you because he is a loving human being.&lt;br /&gt;The child is happy because his soul and his essence is a happy essence.&lt;br /&gt;&lt;br /&gt;When we grow up, we will be taught to leave our true essence behind and wear the mask that our society want us to wear.&lt;br /&gt;&lt;br /&gt;How many of us while we were growing up hear these sentences:&lt;br /&gt;Grow up and don't act like a child&lt;br /&gt;Be responsible and find yourself a job to do.&lt;br /&gt;Work hard in order to success&lt;br /&gt;No pain, no gain&lt;br /&gt;&lt;br /&gt;Can you see all the messages that are coming from these sentences?&lt;br /&gt;All of them ask you to leave your essence, and your intuitive, spontaneous character, and pursuit achievements that are outside of us.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We were taught to get attached to materials and stuff outside of us, and we relate our value on those attachments&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;span style=""&gt; &lt;/span&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Our values will be measured of what career we have, or what possession we have&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We get attached to the outside, and forget our true essence&lt;/p&gt;  &lt;p class="MsoNormal"&gt;And we relate our happiness and love to the outside attachments that we have.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;But are those values that we are learning from society are really any good?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Are those values that we learned about hard work, and high achievers, and being tough are any good?&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Let me ask you this question:&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Compare our life now, with 50 years ago&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Now we have more materials, we have better cars, better houses, better health care and higher living standards&lt;/p&gt;  &lt;p class="MsoNormal"&gt;But ask the people how much stress level is different between now and 50 years ago, and the answer will come as we have now more stress level.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;This is indication that we are doing something wrong.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;We are getting attached to the outside and forget ourselves.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;That is why you find many people are looking for happiness and they don’t know what happiness is and what love is.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Growing up should not mean leaving our happy essence behind.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Working hard should be generated from our intuitive soul, and not forced on ourselves.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Actually if we work motivated by our intuitive needs, and spontaneous character then we can achieve way more than any hard work.&lt;/p&gt;&lt;p class="MsoNormal"&gt;And the word: No pain, no gain is BS&lt;/p&gt;&lt;p class="MsoNormal"&gt;Actually many athletes right now are discovering the importance of meditation , beside the exercises, because they found that meditation and reconnecting with your inner self, help you control more your body.&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The true way to happiness is by unlearning all these values that we being taught while we were growing up.&lt;/p&gt;  &lt;p class="MsoNormal"&gt;The true way to happiness is by loving everybody unconditionally&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Growing up doesn’t mean leaving our true essence behind&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Growing up means living a fulfilling life, and purposeful life&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Growing up means finding our true purpose in life&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Growing up means building the skills for filtering all negativity and negative thoughts, and replace them with loving positive feeling and thoughts&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Growing up means building the skills to see the true essence of everyone surround you, and drop the masks that they are wearing&lt;/p&gt;  &lt;p class="MsoNormal"&gt;People could wear a mask of rudeness, or ignorance or negative behaviors &lt;/p&gt;  &lt;p class="MsoNormal"&gt;Those masks are not them&lt;/p&gt;  &lt;p class="MsoNormal"&gt;Growing up means don’t name and label other by their mask, but see their loving, essence inside that could be trap inside walls, and then you can see the abundance that is coming from them, which you could block out by labeling them&lt;/p&gt;&lt;p class="MsoNormal"&gt;When we label people, like this guy is a moron, and that guy is obnoxious, then we are not grown up enough to see their abundance and their true essence. We are labeling them because we are labeling ourselves and we limit our view to the world.&lt;/p&gt;&lt;p class="MsoNormal"&gt;&lt;br /&gt;&lt;/p&gt;  &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-7980927413084274961?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/7980927413084274961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=7980927413084274961' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7980927413084274961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7980927413084274961'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/03/pursuit-of-happiness-and-love.html' title='The pursuit of happiness and love'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-6740920334074715508</id><published>2007-03-16T14:23:00.000-07:00</published><updated>2007-03-19T00:34:07.101-07:00</updated><title type='text'>Starting Now, It's going to be ok</title><content type='html'>A wonderful friend of mine is blogging.&lt;br /&gt;His words are spreading inspiration, and love for everybody.&lt;br /&gt;The love and inspiration come from his soul to the outside world to touch everybody, even with the pain that he carries.&lt;br /&gt;If you feel down, just go to his web site, which is one word of: &lt;a href="http://www.startingnowitsgoingtobeok.com/blog/"&gt;Starting now, it is going to be ok&lt;/a&gt;&lt;br /&gt;You will find something that will inspire you, for sure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-6740920334074715508?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/6740920334074715508/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=6740920334074715508' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6740920334074715508'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/6740920334074715508'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/03/starting-now-its-going-to-be-ok.html' title='Starting Now, It&apos;s going to be ok'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-1417545407128469066</id><published>2007-03-13T22:45:00.000-07:00</published><updated>2007-03-13T22:53:13.695-07:00</updated><title type='text'>Has the world gone completely mad?</title><content type='html'>I have a story that fit in &lt;a href="http://www.prvsoftware.ca/cs/blogs/mikes_dump/archive/2007/02/21/865.aspx"&gt;the serious of posts&lt;/a&gt; that &lt;a href="http://www.prvsoftware.ca/cs/blogs/mikes_dump/default.aspx"&gt;Mike&lt;/a&gt; is writing about&lt;br /&gt;&lt;br /&gt;I am a member of Calgary Vegetarian group, and few days ago, I've heard a story that is completely insane.&lt;br /&gt;&lt;br /&gt;A couple from the group are vegan&lt;br /&gt;Both the wife and the husband don't consume any animal products including milk and dairy products&lt;br /&gt;they have a 4 months old girl, and they decided to feed her soy milk instead of cow milk.&lt;br /&gt;&lt;br /&gt;somebody complained about them to the social services, and a social worker showed up at their door, ask them if it is true that they feed their child soy milk, instead of cow milk.&lt;br /&gt;The couple admitted that they feed their child soy milk.&lt;br /&gt;&lt;br /&gt;The social worker said, that this is not recommended by Health Canada, and he asked to do full health test on the child&lt;br /&gt;He did a full heath test, and all the test results were wonderful, but the social worker challenged them to take custody of the child, if they don't follow Health Canada's food recommendation and feed the child cow milk.&lt;br /&gt;&lt;br /&gt;Can you believe that?&lt;br /&gt;the government wanted to take over the child custody&lt;br /&gt;The couple asked a lawyer, and asked their MLA, MP&lt;br /&gt;&lt;br /&gt;after a lot of researching, their lawyer told them it is easier and cheaper to lie&lt;br /&gt;Yes, to lie&lt;br /&gt;&lt;br /&gt;so they bought few child milk cans, and they put them in their kitchen&lt;br /&gt;and the next visit of the social worker, they showed him the cans and they told him that from now on, they are feeding their child cow milk.&lt;br /&gt;&lt;br /&gt;Ok, you think that this is not a complete madness.&lt;br /&gt;Health Canada and the social services wanted to be sure that every child is protected in Canada&lt;br /&gt;&lt;br /&gt;Ok, wait to hear my story, and you know what I am talking about.&lt;br /&gt;&lt;br /&gt;I rented a room in my basement to the wrong person.&lt;br /&gt;It was a mistake, but to make the story short, I won' t say how I ended up renting her.&lt;br /&gt;She is a single mom, who smokes a lot , inside the room , in my house.&lt;br /&gt;I am trying to kick her outside the house for that, but that is different story.&lt;br /&gt;&lt;br /&gt;She is a single mom, and has one year old child.&lt;br /&gt;She is smoking in the face of her child.&lt;br /&gt;Her room stinks of the smoking smell, and the child is getting all of that&lt;br /&gt;&lt;br /&gt;She shouts and screams at her child, and she let him crying for hours.&lt;br /&gt;Yes, for hours&lt;br /&gt;&lt;br /&gt;Day before yesterday, she left him in the room, in his bed, and she left the home.&lt;br /&gt;&lt;br /&gt;I left the home for hours and came back and I found the child still crying and she was not back yet.&lt;br /&gt;&lt;br /&gt;I called the child abuse service 5 times, for the last two months&lt;br /&gt;5 times, I called the child abuse service, and they didn't do anything yet.&lt;br /&gt;&lt;br /&gt;So, you see when a couple of vegan feeds their child what they think is good for her, the government try to take the custody of the child, and when there is a case of abuse, the government is doing nothing&lt;br /&gt;&lt;br /&gt;Has the world gone completely mad?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-1417545407128469066?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/1417545407128469066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=1417545407128469066' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1417545407128469066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1417545407128469066'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/03/has-world-gone-completely-mad.html' title='Has the world gone completely mad?'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-8191137599925433947</id><published>2007-03-02T10:25:00.000-08:00</published><updated>2007-03-02T10:40:32.061-08:00</updated><title type='text'>It is a wonderful day today</title><content type='html'>Today my project got a boost.&lt;br /&gt;In the place I am working at, there is a committee that is responsible of all the IT projects that are going on.&lt;br /&gt;And this committee has a regular meeting on the beginning of every month.&lt;br /&gt;On their meeting yesterday, the committee mentioned my project, and how we implemented the OLAP and the data warehouse approach to solve our problems.&lt;br /&gt;I heard that the approach was received by excitement, and the members where impressed.&lt;br /&gt;My project manager got the feedback of that meeting from his coordination manager.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-8191137599925433947?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/8191137599925433947/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=8191137599925433947' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/8191137599925433947'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/8191137599925433947'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/03/it-is-wonderful-day-today.html' title='It is a wonderful day today'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-3145403456497726116</id><published>2007-02-27T19:56:00.000-08:00</published><updated>2007-02-27T21:20:28.043-08:00</updated><title type='text'>OLAP and data warehouse, or the end of the world as we know it</title><content type='html'>As I promised my dear readers before, that I am going to cover OLAP services (Online Analytical Processing) in Sql Server, so here I am doing my duties.&lt;br /&gt;Data mining, or data warehouse is a different world than what we used to know in the database systems.&lt;br /&gt;&lt;br /&gt;Database systems offers many services for the applications ans users, like:&lt;br /&gt;1 - Allow concurrent users to access the database simultaneously.&lt;br /&gt;2 - high performance of common used transactions like: querying, adding and updating data.&lt;br /&gt;3 - data validation&lt;br /&gt;&lt;br /&gt;Well, all of the above services are not required for data warehouse.&lt;br /&gt;&lt;br /&gt;The usual database that we know, is optimized for high performance transaction processing, that is why they are called OLTP (online transaction processing database)&lt;br /&gt;&lt;br /&gt;Let's see the difference between OLTP database and data mining database&lt;br /&gt;&lt;br /&gt;&lt;table border="1" width="100%"&gt;&lt;thead&gt; &lt;tr valign="top"&gt; &lt;th class="th" scope="col" align="left" width="52%"&gt; &lt;p class="table-para"&gt;Data warehouse database&lt;/p&gt;&lt;/th&gt; &lt;th class="th" scope="col" align="left" width="48%"&gt; &lt;p class="table-para"&gt;OLTP database&lt;/p&gt;&lt;/th&gt;&lt;/tr&gt;&lt;/thead&gt; &lt;tbody&gt; &lt;tr valign="top"&gt; &lt;td class="td" align="left" width="52%"&gt; &lt;p class="table-para"&gt;Designed for run analysis on business data&lt;/p&gt;&lt;/td&gt; &lt;td class="td" align="left" width="48%"&gt; &lt;p class="table-para"&gt;Designed for real-time business operations&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td class="td" align="left" width="52%"&gt; &lt;p class="table-para"&gt;Optimized for bulk loads and large, complex, unpredictable  queries that access many rows per table&lt;/p&gt;&lt;/td&gt; &lt;td class="td" align="left" width="48%"&gt; &lt;p class="table-para"&gt;Optimized for a common set of transactions, usually adding  or retrieving a single row at a time per table&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td class="td" align="left" width="52%"&gt; &lt;p class="table-para"&gt;Loaded with consistent, valid data; requires no real time  validation&lt;/p&gt;&lt;/td&gt; &lt;td class="td" align="left" width="48%"&gt; &lt;p class="table-para"&gt;Optimized for validation of incoming data during  transactions; uses validation data tables&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr valign="top"&gt; &lt;td class="td" align="left" width="52%"&gt; &lt;p class="table-para"&gt;Supports few concurrent users relative to OLTP&lt;/p&gt;&lt;/td&gt; &lt;td class="td" align="left" width="48%"&gt; &lt;p class="table-para"&gt;Supports thousands of concurrent users&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;Ok&lt;br /&gt;I will explain the data warehousing by writing a conversation between an ordinary database user and an OLAP expert.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1 - when do I need Data Warehouse?&lt;/span&gt;&lt;br /&gt;If you have historical data, or data with millions and millions of records, then you need data warehouse.&lt;br /&gt;Don't put your historical data in your OLTP database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2 - Why It is bad to put my historical data in my OLTP database?&lt;/span&gt;&lt;br /&gt;Because the more data increase, the more it takes time to index the data on input/update transactions.&lt;br /&gt;Maintaining the indexed cost more.&lt;br /&gt;Query the database become slower.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;3 - So, what can I do with my historical data?&lt;/span&gt;&lt;br /&gt;Shove it in your data warehouse database.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;4 - So, is data warehouse is only a repository for the historical data?&lt;/span&gt;&lt;br /&gt;No, it is more than that.&lt;br /&gt;It is a system that tailer, and reconstruct this data in a meaningful way for you and your managers.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;5 - wait, did you say meaningful? so do you mean that the data in its RDBMS format is meaningless?&lt;/span&gt;&lt;br /&gt;Yes, the historic data is meaningless in its historic format.&lt;br /&gt;Take the case of retail shops across the country as an example.&lt;br /&gt;Retail shops like Zelers for example, store every transaction on every day.&lt;br /&gt;this information could provide log of transaction.&lt;br /&gt;But after two years, these transactions lose their values.&lt;br /&gt;No need to have this log.&lt;br /&gt;But this information is still valuable if we want to look at them in higher level.&lt;br /&gt;Like how much profit every shop is doing?&lt;br /&gt;or how much sales for play station in Calgary?&lt;br /&gt;&lt;br /&gt;This is the essence of a data warehouse&lt;br /&gt;Data warehouse is about organizing the "raw" data into meaningful views to the users.&lt;br /&gt;Again if we look at the retail shop example, then it is organizing the sales data by shop, date, city, product...etc.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Ok, I know what is data warehousing, so how can I build my data warehouse?&lt;/span&gt;&lt;br /&gt;First, you analyze your data and find the following:&lt;br /&gt;Measures, dimensions and cubes.&lt;br /&gt;Measures: are the key performance indicators in your system. For our example in the retails is the sales.&lt;br /&gt;Dimensions: are the ways you look at the data. For our example: we look at sales by products, shop, location, age of buyers...etc.&lt;br /&gt;Cube: is multi-dimensional view for your measures.&lt;br /&gt;&lt;br /&gt;I will continue how  to create cubes on the next posts.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-3145403456497726116?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/3145403456497726116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=3145403456497726116' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/3145403456497726116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/3145403456497726116'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/02/olap-and-data-warehouse-or-end-of-world.html' title='OLAP and data warehouse, or the end of the world as we know it'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-5366064455988719966</id><published>2007-02-27T16:00:00.000-08:00</published><updated>2007-02-27T16:42:17.628-08:00</updated><title type='text'>Hints for bulk copying data in Sql Server</title><content type='html'>I have some hints to use with the bcp.exe utility in Sql Server, that will improve the performance.&lt;br /&gt;&lt;br /&gt;What is bcp?&lt;br /&gt;bcp utility, is a command line utility that allow users to bulk copy data between tables in     different databases.&lt;br /&gt;&lt;br /&gt;Hints to use it:&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;1 - Always use Order in the hint clause:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you are copying data between tables that are indexed using clustered indexes, then you should add a option to the command line to tell the bcp that both source table, and target table are clustered indexed, and ordered.&lt;br /&gt;The command line will be:&lt;br /&gt;bcp [source-table] in [filename] -S[servername] &lt;span style="color: rgb(255, 102, 102);"&gt;-h ORDER([columns])&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why?&lt;/span&gt;&lt;br /&gt;To save you from re-indexing the target tables, after uploading the data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;When you need it?&lt;/span&gt;&lt;br /&gt;When you are copying huge tables, or even small tables, and the tables are indexed with clustered index  (which is recommended practice).&lt;br /&gt;In my case, I am copying many million of records, and re-indexing the table will take 2 hours.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So what this command line option is doing&lt;/span&gt;?&lt;br /&gt;When you use bcp to get data out of the source database, and the source table is indexed with clustered index, then you are getting ordered data.&lt;br /&gt;And when you upload the data to the target database, Sql server will load the data and re-index the data, but with this option, you let the sql server knows that the data is already ordered.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;2 - The second hint, use the "TABLOCK" in the hint clause&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Why?&lt;/span&gt;&lt;br /&gt;To reduces lock contention&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;When you need it?&lt;/span&gt;&lt;br /&gt;When you are copying huge tables, or even small tables, and you don't mind to block the table from being accessed by the users during the upload process .&lt;br /&gt;IMHO, you don't need users to access tables while the data is uploaded.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;So what this command line option is doing?&lt;/span&gt;&lt;br /&gt;This command line will acquire a table-level lock during the upload process.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;How to use it?&lt;/span&gt;&lt;br /&gt;bcp [source-table] in [filename] -S[servername] &lt;span style="color: rgb(255, 102, 102);"&gt;-h TABLOCK&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-5366064455988719966?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/5366064455988719966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=5366064455988719966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/5366064455988719966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/5366064455988719966'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/02/hint-for-bulk-copying-data-in-sql.html' title='Hints for bulk copying data in Sql Server'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-7120785207563946103</id><published>2007-02-15T15:11:00.000-08:00</published><updated>2007-02-15T16:18:37.011-08:00</updated><title type='text'>Coming out of the closet</title><content type='html'>Yes, I am coming out of the closet.&lt;br /&gt;I am feeling like I am a DBA, and I am not afraid to say it.&lt;br /&gt;Maybe you guys will start to hate me (and maybe you already have), or judge me for that, but I don't care anymore.&lt;br /&gt;&lt;br /&gt;I will say it to everybody, I feel like a DBA.&lt;br /&gt;&lt;br /&gt;For the past three months, I was working heavily with Sql server, and its technologies.&lt;br /&gt;For the last three months I didn't write any line of code, but instead working on the database side, trying to find better performance for some queries.&lt;br /&gt;&lt;br /&gt;I am working with a table that has 40+ millions records.&lt;br /&gt;And I want to deliver a view on top of that table that has 205 columns, and all of those columns are aggregation functions.&lt;br /&gt;&lt;br /&gt;The view is required by a third party engineering tool, that our business users use, to run some calculations and then we need to store those calculations to use it in our applications that we are building.&lt;br /&gt;&lt;br /&gt;If you think that this view is insane, then I will tell you that the calculations are not easy.&lt;br /&gt;&lt;br /&gt;For example, to know how much oil remaining in an oil pool, you have to know a lot, like&lt;br /&gt;1 - how much production was on the first month of production&lt;br /&gt;2 - how much production was on the first six months of production&lt;br /&gt;3 - how much average temperature, pressure of the pool for the first six months of production.&lt;br /&gt;4 - how much max temp, pressure were there on the pool and when&lt;br /&gt;5 - how much min temp, pressure and when&lt;br /&gt;6 - how much production was on the last month, and last six months...&lt;br /&gt;...&lt;br /&gt;and on, and on&lt;br /&gt;&lt;br /&gt;All the above calculations are done to find out some information, that we need in our application, like how much oil remaining, or how many gas remaining, and how many years can a pool produce with the native pressure, and when we should add artificial pressure....?&lt;br /&gt;&lt;br /&gt;most of those are going to be calculated by a third party engineering tool, and some of them are going to be calculated by us.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The task to provide the data for that third party tool was assigned to our team.&lt;br /&gt;&lt;br /&gt;I started doing that task, thinking that it is just a view that look at the data in different way.&lt;br /&gt;&lt;br /&gt;But I ended up with a whole new system.&lt;br /&gt;&lt;br /&gt;I worked to find ways to produce that huge view with a decent response time, by using "Indexed views","covering calculated index", and partitioning.&lt;br /&gt;But both didn't work, on Sql server 2000, or Sql Server 2005.&lt;br /&gt;&lt;br /&gt;So we had two options:&lt;br /&gt;&lt;br /&gt;1 - either to do a batch that generates those calculation (weekly) and stores the result.&lt;br /&gt;&lt;br /&gt;2- or the more excitement  is to use OLAP Services (where we are going to do the same but with OLAP terminologies).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So, I looked on the OLAP services on Sql Server.&lt;br /&gt;&lt;br /&gt;OLAP services provides ways to do data mining on Sql server, like for example generate some&lt;br /&gt;aggregations functions and store them in aggregation tables.&lt;br /&gt;&lt;br /&gt;The task was not easy one.&lt;br /&gt;I had to change a lot in my workplace&lt;br /&gt;The more obstacles were bureaucratic obstacles, beside the technical ones&lt;br /&gt;&lt;br /&gt;But the DBAs here, were on my side.&lt;br /&gt;Actually the DBAs are the one who initiated the OLAP project.&lt;br /&gt;&lt;br /&gt;Of course the project was expanded to deal with all similar huge tables, and not only the ones that I am dealing with.&lt;br /&gt;&lt;br /&gt;My current work has huge tables with millions and millions of records.&lt;br /&gt;But all those tables exist in one database, that has the default configuration as OLTP database.&lt;br /&gt;&lt;br /&gt;We had to have another database that is configured for OLAP activities.&lt;br /&gt;and then build a process to move the data from the "corporate" database to this OLAP database.&lt;br /&gt;&lt;br /&gt;The DBAs here were waiting for a project like mine to convince the management to have a data mining service.&lt;br /&gt;&lt;br /&gt;We (the DBAs and I) started to establish an OLAP environment for our data.&lt;br /&gt;We are still having lots to do, but the excitement already started.&lt;br /&gt;I am dealing with lots of new technologies and lots of new things to learn&lt;br /&gt;Business Intelligence, Data Cube, Dimension views, Horizontal Dimension, Vertical Dimension and more...&lt;br /&gt;&lt;br /&gt;We have a target to finish on end of March for the test, and then end of April for Production.&lt;br /&gt;&lt;br /&gt;I will summarize what I've learned about OLAP services, and writing another post for that.&lt;br /&gt;&lt;br /&gt;But man, Sql Server sucks&lt;br /&gt;&lt;br /&gt;Keep tuned&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-7120785207563946103?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/7120785207563946103/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=7120785207563946103' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7120785207563946103'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/7120785207563946103'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/02/coming-out-of-closet.html' title='Coming out of the closet'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-2748334837289243991</id><published>2007-02-09T11:49:00.000-08:00</published><updated>2007-02-09T12:26:36.353-08:00</updated><title type='text'>Changing my perspective</title><content type='html'>Changing our perspective regarding anything in life, requires lots of power and knowledge.&lt;br /&gt;Stephen Covey talked about "the power of paradigm shift"&lt;br /&gt;&lt;br /&gt;I found my self accustomed  to the usual perspective, and I found that I am having automatic and repetitive patterns in my reactions, or actions in my life. and I would think that what I am doing is my free welling and my free thoughts, where in reality, I am not involving my creative mind, (or my left side of the brain), but instead I am involving my repetitive mind (or the right side of the brain), even with tasks that requires "real thinking".&lt;br /&gt;&lt;br /&gt;How can I change my perspective regarding anything in life?&lt;br /&gt;Am I in the right path?&lt;br /&gt;Am I seeing the whole picture?&lt;br /&gt;Am I having a critical thinking approach?&lt;br /&gt;&lt;br /&gt;Having a critical thinking, and being able to change my perspective, is not a decision, that I can make.&lt;br /&gt;It is an attitude that requires work, and practices.&lt;br /&gt;&lt;br /&gt;So, this is what I was doing for the last few weeks&lt;br /&gt;Everyday, and at the end of the day, I will think of a major event that happened to me that day, or a major decision that I took on that day&lt;br /&gt;And then, I will examine why I did that reaction, or why I had that decision?&lt;br /&gt;&lt;br /&gt;is it because I am accustomed to see the the world in my usual perspective?&lt;br /&gt;How can I see that major event or decision differently?&lt;br /&gt;&lt;br /&gt;This is a tool that I am using to develop more wide-minded perspective in life.&lt;br /&gt;&lt;br /&gt;for example&lt;br /&gt;Usually I judge narrow-minded people, and have a judgment that narrow-mind is a bad thing.&lt;br /&gt;But to do a critical thinking is to find if there are virtues for a narrow-minded mentality?&lt;br /&gt;&lt;br /&gt;Actually I am being a narrow-minded when I just think that narrow-mind is always a bad thing.&lt;br /&gt;&lt;br /&gt;I can apply this to anything, or anybody I encounter in life.&lt;br /&gt;&lt;br /&gt;If I found somebody as obnoxious, I will try to look at him/her in different way, or find a different way to look at him.&lt;br /&gt;&lt;br /&gt;This example, is not what Stephen Covey meant by "the power of paradigm shift"&lt;br /&gt;But I am talking about the tools that we can use to accomplish this paradigm shift, or being able to accomplish the paradigm shift&lt;br /&gt;&lt;br /&gt;What I developed through that exercise, is more flexibility and loving relationship with my atmosphere, and the environment I am working through, and of course more loving relationship to many people around me.&lt;br /&gt;&lt;br /&gt;This loving relationship, will nourish my own life, with more joyful life&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-2748334837289243991?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/2748334837289243991/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=2748334837289243991' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2748334837289243991'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2748334837289243991'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/02/changing-my-perspective.html' title='Changing my perspective'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-1396787096352079993</id><published>2007-02-03T20:06:00.000-08:00</published><updated>2007-02-03T20:23:04.550-08:00</updated><title type='text'>Is the war coming?</title><content type='html'>More and more you can see the conservative American media talking about the threat that is coming from Iran.&lt;br /&gt;Even some conservative anchors mentioned that Iran is already in war with US.&lt;br /&gt;Brzezinski, the former national security adviser, expected that there is a war coming on Iran.&lt;br /&gt;&lt;br /&gt;The neo-conservatives are trying to find a way out of the hole called Iraq, and they still think Iran has anything to do with the chaos there.&lt;br /&gt;&lt;br /&gt;It is interesting how the American people will react, specially when all scientists of the world united to deliver a message to the world that global-warming is more dangerous than all terrorist threats in the world.&lt;br /&gt;&lt;br /&gt;But the media is doing a mind-wash to create a monster out of Iran, as they did before with Saddam, and his weapons of mass destruction&lt;br /&gt;&lt;br /&gt;If the war really initiated against Iran, then it will be disaster for USA and for Canada as well&lt;br /&gt;and as consequence, the racism will increase in North America&lt;br /&gt;&lt;br /&gt;It is going to be tough time, for everybody&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-1396787096352079993?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/1396787096352079993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=1396787096352079993' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1396787096352079993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/1396787096352079993'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/02/is-war-coming.html' title='Is the war coming?'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-458902948140368057</id><published>2007-02-02T10:58:00.000-08:00</published><updated>2007-02-02T11:10:19.432-08:00</updated><title type='text'>My ranting on global warming</title><content type='html'>Today the Paris  summit said, and very clearly that the global warming is caused by human activities.&lt;br /&gt;Politicians in Canada start to jump on the wagon of cleaning the air propaganda.&lt;br /&gt;&lt;br /&gt;What bother me is the people who said, Canada is not contributing a lot of global warming, then let's forget it and concentrate on China and India.&lt;br /&gt;&lt;br /&gt;Well, I want to tell those smart asses the following:&lt;br /&gt;&lt;br /&gt;1 - It is not fair to compare a nation with 1 billion population with 30 millions population, specially when Canadians are the most polluting nation in the universe, if we calculate it by capita.&lt;br /&gt;&lt;br /&gt;2 - assholes, China and India are producing green gas houses because they are producing our goods.&lt;br /&gt;Just go to any shopping mall, and see what is there that is made in Canada?&lt;br /&gt;&lt;br /&gt;Do you want a long time to guess?&lt;br /&gt;&lt;br /&gt;Well, let me tell you&lt;br /&gt;Nothing we have and buy is made in Canada&lt;br /&gt;&lt;br /&gt;It is all made in China and India&lt;br /&gt;&lt;br /&gt;So we use those cheap labors and slaves to work for us cheap, and at the same time we ask them to reduce their activities&lt;br /&gt;How smart is that? eh?&lt;br /&gt;&lt;br /&gt;Guess what idiots&lt;br /&gt;if China reduced its activities, we Canadian won't have toilet papers to clean our asses.&lt;br /&gt;Get that idiots.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-458902948140368057?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/458902948140368057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=458902948140368057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/458902948140368057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/458902948140368057'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/02/my-ranting-on-global-warming.html' title='My ranting on global warming'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-5563394276068419449</id><published>2007-01-31T11:29:00.000-08:00</published><updated>2007-01-31T23:56:45.336-08:00</updated><title type='text'>Materialized views between Oracle and Sql Server</title><content type='html'>I've been working for last month on creating materialized views in Sql Server 2000.&lt;br /&gt;As someone who worked before on materialized views in Oracle, I find it beneficial to compare between the two.&lt;br /&gt;&lt;br /&gt;First of all, what is materialized view?&lt;br /&gt;It is a view that stores its result data, so it can use them later in subsequent queries on that view.&lt;br /&gt;Means that next time you query this view, it doesn't have to go back to the underlying table, but instead get the data from the view's storage.&lt;br /&gt;&lt;br /&gt;Why do you use materialized view?&lt;br /&gt;If you have a query that is complicated and consumes lots of time, and resources, then it is better to store the result, and next time just go to the result.&lt;br /&gt;&lt;br /&gt;What if the original data in the underlying tables, changed?&lt;br /&gt;Then you have to find a mechanism to update the view.&lt;br /&gt;And in this point where Sql Server and Oracle are different.&lt;br /&gt;&lt;br /&gt;Oracle model is different than Sql Server model.&lt;br /&gt;&lt;br /&gt;In Oracle, you (the developer) are responsible of updating the view, by running a scheduled task that run the view and update the result.&lt;br /&gt;Actually when you define the materialized view in Oracle, you can define as well when and how often you want to update that view.&lt;br /&gt;Where is SQL, it is automatic and dynamic.&lt;br /&gt;&lt;br /&gt;So, it seems that Sql Server has advantages on Oracle.&lt;br /&gt;But wait. Just see what are the limits of materialized views in Sql server&lt;br /&gt;The indexed view (or the materialized view) cannot have any of the following:&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;View definition must always return the same results from the same underlying data.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Views cannot use non-deterministic functions.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;The first index on a View must be a clustered, UNIQUE index.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;If you use Group By, you must include the new COUNT_BIG(*) in the select list.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;View definition cannot contain the following&lt;br /&gt;&lt;ol type="a"&gt;&lt;li&gt;TOP&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Text, ntext or image columns&lt;br /&gt;&lt;/li&gt;&lt;li&gt;DISTINCT&lt;br /&gt;&lt;/li&gt;&lt;li&gt;MIN, MAX, COUNT, STDEV, VARIANCE, AVG&lt;br /&gt;&lt;/li&gt;&lt;li&gt;SUM on a nullable expression&lt;br /&gt;&lt;/li&gt;&lt;li&gt;A derived table&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Rowset function&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Another view&lt;br /&gt;&lt;/li&gt;&lt;li&gt;UNION&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Subqueries, outer joins, self joins&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Full-text predicates like CONTAIN or FREETEXT&lt;br /&gt;&lt;/li&gt;&lt;li&gt;COMPUTE or COMPUTE BY&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Cannot include order by in view definition&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;/ol&gt;As you can see, there are lots of limitation with Sql Server.&lt;br /&gt;And actually all those limitation are there because Sql Server team wants to make the view dynamic.&lt;br /&gt;&lt;br /&gt;But when I was trying to use the indexed view, I was frustrated because I couldn't do any complicated view&lt;br /&gt;&lt;br /&gt;Why do we want materialized view?&lt;br /&gt;Isn't to store the result of a complicated view?&lt;br /&gt;&lt;br /&gt;we don't want to use materialized view for select from customer where location is NewYork, right?&lt;br /&gt;we want to use materialized view for complicated view that does outer join, self-join, union and aggregation functions&lt;br /&gt;&lt;br /&gt;but all those are not allowed in indexed views&lt;br /&gt;&lt;br /&gt;The second point that you think Sql server model has advantage over Oracle, is Sql server model is dynamic, which means changed data in underlying tables are immediately reflected in the view.&lt;br /&gt;&lt;br /&gt;But again, why do you need materialized views?&lt;br /&gt;you need it in data warehouse environment more that OLTP environment&lt;br /&gt;you need it in huge databases, and not a table that has 3 records&lt;br /&gt;&lt;br /&gt;Oracle model is simple but it works&lt;br /&gt;Sql server is complicated, and that is why it is limited&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-5563394276068419449?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/5563394276068419449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=5563394276068419449' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/5563394276068419449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/5563394276068419449'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/01/materialized-views-between-oracle-and.html' title='Materialized views between Oracle and Sql Server'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-4927231921816616262</id><published>2007-01-29T10:42:00.001-08:00</published><updated>2007-01-29T10:55:15.696-08:00</updated><title type='text'>A book that worth every penny</title><content type='html'>I will point you to a book worths every penny of its price.&lt;br /&gt;&lt;br /&gt;Just to let you know, I am a cheap bastard, when it come to buy technical books, because I found the internet can answer all my questions.&lt;br /&gt;And usually I buy only quality books, which means books that deserve to buy it and deduct its price from the beer budget, or from the hooker budget.&lt;br /&gt;&lt;br /&gt;This book worths every penny&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://ec1.images-amazon.com/images/P/0201700468.01._BO2,204,203,200_PIsitb-dp-500-arrow,TopRight,45,-64_OU01_AA240_SH20_SCLZZZZZZZ_.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px;" src="http://ec1.images-amazon.com/images/P/0201700468.01._BO2,204,203,200_PIsitb-dp-500-arrow,TopRight,45,-64_OU01_AA240_SH20_SCLZZZZZZZ_.jpg" alt="" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Believe me&lt;br /&gt;I am so enthusiastic about it, and I am very rarely get enthusiastic about technical books.&lt;br /&gt;&lt;br /&gt;If you think that you know T-SQL, or how to write sql procedure, then you will find with this book that you are still a kid in the third grade.&lt;br /&gt;If you think yourself the master of T-SQL and you think that you know all documented and non-documented features of T-SQL then I will give you a warning, that reading this book could put you in deep depression, because you will discover that you still didn't know it all.&lt;br /&gt;&lt;br /&gt;Get it right now from &lt;a href="http://www.amazon.com/Gurus-Server-Stored-Procedures-CD-ROM/dp/0201700468/ref=pd_bxgy_b_img_b/104-3546107-9426312"&gt;Amazon&lt;/a&gt;, or from &lt;a href="http://www.chapters.indigo.ca/books/item/books-978020170046/0201700468/Gurus+Guide+To+Sql+Server+Stored+Procedures+Xml+And+Html+The?ref=Search+Books%3a+%27The+Guru%27s+Guide+to+SQL+Server+Stored+Procedures%27&amp;amp;sterm=The+Guru%27s+Guide+to+SQL+Server+Stored+Procedures+-+Books"&gt;Chapters &lt;/a&gt;(which is cheaper)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-4927231921816616262?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/4927231921816616262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=4927231921816616262' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/4927231921816616262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/4927231921816616262'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/01/book-that-worth-every-penny_29.html' title='A book that worth every penny'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-2927555580193439715</id><published>2007-01-28T13:54:00.000-08:00</published><updated>2007-01-28T18:39:22.362-08:00</updated><title type='text'>The power of case statement</title><content type='html'>What do I mean by case statement here, is the case statement in T-SQL, which is equivalent to the "Decode" function in Oracle.&lt;br /&gt;&lt;br /&gt;I will show in this post how to use the case statement to build pivot queries that replace the self-join and the "Unions".&lt;br /&gt;&lt;br /&gt;So first, you ask, why I should replace the Unions statements and the self-join with the case?&lt;br /&gt;&lt;br /&gt;The answer is:&lt;br /&gt;&lt;br /&gt;1 - the case statements helps make the code cleaner, and more clear&lt;br /&gt;2 - reduce the lines of code&lt;br /&gt;3 - and most important boost the performance&lt;br /&gt;&lt;br /&gt;I was trying to build pivot queries for 8+ millions records tables, and I was finding trouble time, keep the query using the indexes of the table.&lt;br /&gt;I tried to build a materialized views (indexed views) in Sql Server 2000, but the indexed views doesn't work with "Unions"&lt;br /&gt;&lt;br /&gt;And the case statement played a main role solving my problems&lt;br /&gt;I will show here how to use the case statement in creating pivot queries.&lt;br /&gt;Usually you do pivot queries by either moving the transferring the rows to columns or the columns to rows, or maybe both&lt;br /&gt;&lt;br /&gt;1 - Transferring the rows to columns&lt;br /&gt;Let us start from a table "Production" that contains the well production for every well, and it contains the production of oil, and gas.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_g297008Q7m0/Rb0p6r1IXRI/AAAAAAAAAAU/MG05Rs4Nwyw/s1600-h/ProductionTable.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_g297008Q7m0/Rb0p6r1IXRI/AAAAAAAAAAU/MG05Rs4Nwyw/s320/ProductionTable.jpg" alt="" id="BLOGGER_PHOTO_ID_5025218847390063890" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;where fluid_type could be 'GAS' or 'OIL'&lt;br /&gt;&lt;br /&gt;we want to create a query that looks like the following:&lt;br /&gt;&lt;table class="MsoTableGrid" style="border: medium none ; border-collapse: collapse;" border="1" cellpadding="0" cellspacing="0"&gt;  &lt;tbody&gt;&lt;tr style=""&gt;   &lt;td style="border: 1pt solid windowtext; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;Year&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;Month&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;Well_ID&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;Gas_Production&lt;/p&gt;   &lt;/td&gt;   &lt;td style="border-style: solid solid solid none; border-color: windowtext windowtext windowtext -moz-use-text-color; border-width: 1pt 1pt 1pt medium; padding: 0in 5.4pt; width: 88.6pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;Oil_Production&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;   &lt;/td&gt;  &lt;/tr&gt;  &lt;tr style=""&gt;   &lt;td style="border-style: none solid solid; border-color: -moz-use-text-color windowtext windowtext; border-width: medium 1pt 1pt; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 88.55pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;   &lt;td style="border-style: none solid solid none; border-color: -moz-use-text-color windowtext windowtext -moz-use-text-color; border-width: medium 1pt 1pt medium; padding: 0in 5.4pt; width: 88.6pt;" valign="top" width="118"&gt;   &lt;p class="MsoNormal"&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/p&gt;&lt;br /&gt;&lt;/td&gt;  &lt;/tr&gt; &lt;/tbody&gt;&lt;/table&gt;&lt;br /&gt;as you can see, we want to transfer the values (rows) to columns.&lt;br /&gt;&lt;br /&gt;the traditional way to do it by join the table to itself as follows:&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;&lt;i&gt;&lt;span style="color: rgb(0, 51, 102);"&gt;select main.year, main.month, main.well_id,&lt;br /&gt;gas.production as gas_production, oil.production as oil_production&lt;br /&gt;from production main&lt;br /&gt;outer join production as gas&lt;br /&gt;on main.year = gas.year and main.month = gas.month and main.well_id as gas.well_id&lt;br /&gt;outer join production as oil&lt;br /&gt;on main.year = oil.year and main.month = oil.month and main.well_id as oil.well_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;    &lt;p class="MsoNormal"&gt;Now, to use the case instead of the self-join&lt;br /&gt;Let's create a table called Fluid_types with one column "Fluid", that has two rows only 'GAS' and 'OIL'&lt;br /&gt;&lt;br /&gt;and compare the previous code with the following:&lt;br /&gt;&lt;/p&gt;&lt;p class="MsoNormal"&gt;  &lt;/p&gt;&lt;p class="MsoNormal" style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;Select year, month, well_id,&lt;br /&gt;(case fluid = 'GAS' production end) as gas_production,&lt;br /&gt;(case fluid = 'OIL' production end) as oil_production&lt;br /&gt;from production, fluid_types&lt;i&gt;&lt;span style="color: rgb(0, 51, 102);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;  As you can see the code is cleaner, and as well faster&lt;br /&gt;&lt;br /&gt;Now, let's see how to do columns to rows&lt;br /&gt;Let's supposed the opposite of what we had in the previous example:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://bp1.blogger.com/_g297008Q7m0/Rb0xsr1IXTI/AAAAAAAAAAk/0HDHUN9DiYI/s1600-h/ProductionTable1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://bp1.blogger.com/_g297008Q7m0/Rb0xsr1IXTI/AAAAAAAAAAk/0HDHUN9DiYI/s320/ProductionTable1.jpg" alt="" id="BLOGGER_PHOTO_ID_5025227402964917554" border="0" /&gt;&lt;/a&gt;and we want to list the table to shows one column as production, and the gas, oil as fluid_type&lt;br /&gt;&lt;br /&gt;the traditional way is as follows&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;select year, month, well_id, 'GAS' as fluid_type, gas_production&lt;br /&gt;from production&lt;br /&gt;union&lt;br /&gt;select year, month, well_id, 'OIL' as fluid_type, oil_production&lt;br /&gt;from production&lt;i&gt;&lt;span style="color: rgb(0, 51, 102);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;to use case, we should use again the table fluid_types&lt;br /&gt;&lt;br /&gt;&lt;p class="MsoNormal" style="background: rgb(255, 255, 153) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"&gt;select year, month, well_id, fluid_type,&lt;br /&gt;(case when fluid_type = 'GAS' then gas_production&lt;br /&gt;when fluid_type = 'OIL' then oil_production&lt;br /&gt;end) as production&lt;br /&gt;from production, fluid_types&lt;i&gt;&lt;span style="color: rgb(0, 51, 102);"&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;br /&gt;The most important about the above code, is the case statement will use any indexes that underlying the table&lt;br /&gt;Where the union will most probably disable most indexes&lt;br /&gt;&lt;br /&gt;Hope that was helpful&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-2927555580193439715?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/2927555580193439715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=2927555580193439715' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2927555580193439715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/2927555580193439715'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/01/powerful-of-case-statement.html' title='The power of case statement'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://bp1.blogger.com/_g297008Q7m0/Rb0p6r1IXRI/AAAAAAAAAAU/MG05Rs4Nwyw/s72-c/ProductionTable.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116855485426552621</id><published>2007-01-11T14:12:00.000-08:00</published><updated>2007-01-11T14:39:17.170-08:00</updated><title type='text'>The backward of developing to an interface</title><content type='html'>I am using a third party GIS data provider that is COM-based.&lt;br /&gt;And I thought to build a wrapper around it to isolate the code change if we decide in the future to move to another provider (which is very likely to happen).&lt;br /&gt;So, I was trying to build the wrapper to look similar to the ADO.NET providers, by implementing the IDbConnection, IDbCommand, and IDataReader interfaces.&lt;br /&gt;So the final design is an "Adapter" that looks like ADO.NET provider, but it deligate all the code inside to the GIS data provider.&lt;br /&gt;&lt;br /&gt;And While I was implementing the IDbConnection, IDbCommand, and IDataReader, I was surprised that in .NET 2.0 there are new abstract classes:&lt;br /&gt;DbConnection, DbCommand, and DataReader.&lt;br /&gt;These classes belong to the "base provider profile" in ADO.NET.&lt;br /&gt;&lt;br /&gt;The question is:&lt;br /&gt;Why Microsoft shifted from Interface to abstract classes?&lt;br /&gt;I don't see any common code that can be re-used between different providers.&lt;br /&gt;Interfaces make pefrect sense, and give freedom to implement it to any class, regardless of the type of that class, so you can even implement it to a StreamReader, or Xml reader and writer.&lt;br /&gt;&lt;br /&gt;But after I googled it, I found &lt;a href="http://msdn.microsoft.com/data/default.aspx?pull=/library/en-us/dnvs05/html/vsgenerics.asp"&gt;this article on MSDN&lt;/a&gt;&lt;br /&gt;If you look in the article and in the section titled "Base Classes" you will find the the reason.&lt;br /&gt;The reason is: interfaces are immutable, which means if you want to extend an interface to add a property or a member, you cannot do that.&lt;br /&gt;You have to create another interface like IDataReader2 which inherits from IDataReader and add the new member.&lt;br /&gt;In that article there is a specific example of the property HasRows of IDataReader.&lt;br /&gt;&lt;br /&gt;That is why Microsoft shifted to abstract classes, instead of interfaces&lt;br /&gt;&lt;br /&gt;But what I found in the book "Head first design pattern" that programming to an interface doesn't mean a real OOP interface (like c# interface), and it could mean an abstract class.&lt;br /&gt;So it is still programming to an interface, but it limit the inheritance ability.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116855485426552621?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116855485426552621/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116855485426552621' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116855485426552621'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116855485426552621'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2007/01/backward-of-developing-to-interface.html' title='The backward of developing to an interface'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116380529049281665</id><published>2006-11-17T14:52:00.000-08:00</published><updated>2006-11-17T15:14:50.800-08:00</updated><title type='text'>Building Alberta's future using Agile methodology</title><content type='html'>Looking at our -soon to be- past premier Ralph Klein, and his methodology in planning for the future of Alberta, you will get to know that Ralph Klein is a huge fan of agile methodology, and specifically to most pragmatic way like XP.&lt;br /&gt;First, he doesn't believe in any written plan, that is why in the last election, he didn't provide any platform or any plan for his election compaign, and he had only his debt-free achivement.&lt;br /&gt;Second, he is going with the principle "the easiest thing that works"&lt;br /&gt;For example, with the increasing of salaries of Albertans, and the high-cost of labors, he suggested to stop building.&lt;br /&gt;Stop building schools, hospitals, roads, or anything&lt;br /&gt;This is the easiest thing that works, right?&lt;br /&gt;&lt;br /&gt;Even the estimation that for the next 10 years, Alberta's population will increase 100,000, which create higher pressure of the province's essential services.&lt;br /&gt;Actually we are already witnessing the effects of the boom, on the health-care, and municipal services, and housing.&lt;br /&gt;&lt;br /&gt;But again, the province and the conservative government has no plan at all for the future.&lt;br /&gt;remember, water-fall approach is bad, so don't plan for anything&lt;br /&gt;Just go with Agile way, and the easiest thing that works&lt;br /&gt;&lt;br /&gt;The agile methodoloy should be good enough, but the only thing that the conservatives are forgetting is the refactoring.&lt;br /&gt;&lt;br /&gt;but the system works, right?&lt;br /&gt;&lt;br /&gt;Our houses worth more now, and we are getting more money.&lt;br /&gt;But we have less access to health-care, education...&lt;br /&gt;&lt;br /&gt;Actually some idiots are saying that Alberta's boom has negative effect on the middle and lower class.&lt;br /&gt;But those people are fan of water-fall methodology, who are still living in a cave, and still expecting the government to show a plan for the future.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116380529049281665?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116380529049281665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116380529049281665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116380529049281665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116380529049281665'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/11/building-albertas-future-using-agile.html' title='Building Alberta&apos;s future using Agile methodology'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116334397868904303</id><published>2006-11-12T06:13:00.000-08:00</published><updated>2006-11-12T07:06:19.386-08:00</updated><title type='text'>Don't use this realter</title><content type='html'>I just sold my home in Edmonton through &lt;a href="http://www.filipchuk.com/"&gt;a real estate agent&lt;/a&gt; that I found later he is total dump if he is not dishonest.&lt;br /&gt;Don't use &lt;a href="http://www.filipchuk.com/1389_contact.jsp.html"&gt;this agent&lt;/a&gt; because you will regret it for your life&lt;br /&gt;&lt;br /&gt;my agent is on &lt;a href="http://www.filipchuk.com/1389_contact.jsp.html"&gt;this picture&lt;/a&gt; and he is the man on the right side, but anyway don't use the whole office services.&lt;br /&gt;&lt;br /&gt;When I met him, I didn't really have a good knowledge of the prices in my area, and I built my assumption on a previous estimation by another agent 2 months ago.&lt;br /&gt;As well there was another house in my area that was sold one month ago, that I've visited. The house was totally renovated with hardwood floor.&lt;br /&gt;I asked the owner after the house sold, and I knew that the house was sold 300,000.&lt;br /&gt;Those are the two entries that effected my assumptions.&lt;br /&gt;But it seems that the prices in Edmonton and in my area was changing so fast that even 2 months were so long.&lt;br /&gt;&lt;br /&gt;I discussed with the agent and he suggested to put the price as 255,000 even this is less than the market price, and we signed the contract&lt;br /&gt;&lt;br /&gt;the next day I called him and told him that I want to change the list price, but he said that he has a strategy&lt;br /&gt;his strategy is to list with lower price and make many offers to compete and get the higher.&lt;br /&gt;he said that this strategy works very fine.&lt;br /&gt;I told him and I insisted that I don't like this strategy, and I would prefer the opposite strategy which is listing with higher price, and get offers that are negotiable.&lt;br /&gt;He was not listening to me, and whenever I speak he cut me off and tell me "Trust me, I am doing the best for you"&lt;br /&gt;I was telling him that it is not trust, but I don't like this strategy, and I want to change the price, period.&lt;br /&gt;he keep not listening to me, and keep talking the same shit about trust relationship.&lt;br /&gt;&lt;br /&gt;I've called him for two days during the weekend, but keep the same way of dialog.&lt;br /&gt;&lt;br /&gt;on Monday he listed the house with the same old low price, and he didn't change it.&lt;br /&gt;and for the first day, the house got nine offers, none of them was less than 255,000&lt;br /&gt;the highest was 275,000 with conditions, and the second was 272,500 without any conditions.&lt;br /&gt;&lt;br /&gt;I've told him that I would like to send a counter offer for the second one, but he tried to convince me that this is not a good thing and the buyer is looking for other houses, then he cut me off as usual, and told me that he will call me 1:00 pm&lt;br /&gt;he called noon, and he put pressure on me to accept the offer.&lt;br /&gt;I was very nervous that moment, and I didn't want to give an answer, but he was putting pressure on me, that I accepted verbally&lt;br /&gt;&lt;br /&gt;He sent me the offer by fax, and he kept calling me every hour to send the offer back&lt;br /&gt;&lt;br /&gt;I stopped answering his calls, and kept the whole Tuesday doing me own research&lt;br /&gt;&lt;br /&gt;I found that in the last two months the prices has been changed, even for the last month&lt;br /&gt;I've visited my friend who is an agent in Calgary, and we scanned all houses that has been sold in the area in the last month.&lt;br /&gt;&lt;br /&gt;I found that 272,xxx was a good deal for the buyer, but for the seller (me), I could get higher if I waited more&lt;br /&gt;&lt;br /&gt;It is very difficult to know the real price when all houses in the area are going in renovation campaign&lt;br /&gt;&lt;br /&gt;most of the residents in my area used to be old, and seniors.&lt;br /&gt;Theses seniors are selling for younger couples and all the couples are renovating.&lt;br /&gt;even there are companies who are buying houses in my area, renovating and selling&lt;br /&gt;that drives the prices up for the lase month, even with a house that is not renovated like mine.&lt;br /&gt;&lt;br /&gt;for sure with time I could get higher maybe with 10,000 or 20,000 in best case&lt;br /&gt;But I could wait 2 months for that offer to come&lt;br /&gt;&lt;br /&gt;anyway, at the end of the day, I decided to accept the offer, and I singed the offer and fax it back.&lt;br /&gt;&lt;br /&gt;but I send the agent and his boss an email, saying that he was not a help for me at all, and he was pressuring me instead of helping me.&lt;br /&gt;&lt;br /&gt;they didn't bother even to respond.&lt;br /&gt;&lt;br /&gt;another reason to say fuck all bad real estate agents&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116334397868904303?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116334397868904303/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116334397868904303' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116334397868904303'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116334397868904303'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/11/dont-use-this-realter.html' title='Don&apos;t use this realter'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116284285892821674</id><published>2006-11-06T11:41:00.000-08:00</published><updated>2006-11-06T14:41:47.476-08:00</updated><title type='text'>family values, oh yeh</title><content type='html'>Today at the food court, there was a homeless who was looking inside the garbage bins, and take the food that was left in the bins and eat it.&lt;br /&gt;I was shocked to see such a miserable situation.&lt;br /&gt;I thought that the people are going to help him, and give him food or money&lt;br /&gt;but instead, the security guy came to kick him outside&lt;br /&gt;&lt;br /&gt;Then I asked myself, why this conservative government who wants to pretect our family values by preventing gay marriage and abortion, is not doing any thing to help the people in needs&lt;br /&gt;&lt;br /&gt;Isn't Jesus Christ asked to feel compasion about people in need?&lt;br /&gt;if the conservatives are trying to protect our "christian" values, then why they only chose to abolish the gay marriage, and abolish abortion?&lt;br /&gt;Why they don't include all the christian values?&lt;br /&gt;&lt;br /&gt;Or It is just about forcing others to be the way we want them to be?&lt;br /&gt;&lt;br /&gt;It's all bullshit, you see&lt;br /&gt;It's just bullshit and lies&lt;br /&gt;&lt;br /&gt;that homeless man is an Albertan, and he has rights in the wealth that Alberta has&lt;br /&gt;Ralph Klein is selling our resources cheap, and creating an elite class that skim all the benefits, leaving others to strugle with their daily lives.&lt;br /&gt;&lt;br /&gt;It's all fucking lies&lt;br /&gt;It's not about fucking family values&lt;br /&gt;It's about control, and a fucking mentality of controling others, and hiding behind the family values.&lt;br /&gt;&lt;br /&gt;fuck the conservatives, and the people who vote conservative&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116284285892821674?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116284285892821674/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116284285892821674' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116284285892821674'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116284285892821674'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/11/family-values-oh-yeh.html' title='family values, oh yeh'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116199786121817593</id><published>2006-10-27T18:01:00.000-07:00</published><updated>2006-10-27T18:11:01.703-07:00</updated><title type='text'>Stephen Harper is a man of dignity</title><content type='html'>I have a deep respect for Stephen Harper&lt;br /&gt;He said that he is not going to withdraw our troops from Afghanistan because Canadians have a commitment.&lt;br /&gt;We cannot make a commitment and turn it down the next day.&lt;br /&gt;And Harper is the man of commitment&lt;br /&gt;Even he didn't hesitate one second to withdrew Canada from Kyoto commitment&lt;br /&gt;But keep Afghanistan commitment is more important to the world, and to the people of the world&lt;br /&gt;He said, People of the world want us there.&lt;br /&gt;You have to believe him&lt;br /&gt;He did ask everybody in the world, and the people of the world told him that they want Canadians in Afghanistan&lt;br /&gt;&lt;br /&gt;I am assuming he asked the people of the world at the same time, if they want Kyoto, and people of the world told him that they don't want Kyoto&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116199786121817593?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116199786121817593/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116199786121817593' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116199786121817593'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116199786121817593'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/10/stephen-harper-is-man-of-dignity.html' title='Stephen Harper is a man of dignity'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116197045166937968</id><published>2006-10-27T10:31:00.000-07:00</published><updated>2006-10-27T10:34:14.366-07:00</updated><title type='text'>A culture of extremes</title><content type='html'>When you turn on the TV to watch the reality TV, soap operas or the ads, you will see very thin, fit models.&lt;br /&gt;No curves, and no overweight, where everybody is fit&lt;br /&gt;The reality is totally opposite&lt;br /&gt;North America has the highest percent of obesity in the world&lt;br /&gt;&lt;br /&gt;Turn on TV, and you will be overwhelmed with programs on how to save whale in the ocean, or how to save the forests&lt;br /&gt;And the reality is totally the opposite&lt;br /&gt;North Americans and Canadians are the highest polluting country per capita in the whole world&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Turn on TV, and you will be overwhelmed with programs that show you how you can save poor children in Africa, and how you can contribute to help financially poor people who are dying from hunger&lt;br /&gt;&lt;br /&gt;The reality is totally opposite&lt;br /&gt;North American inner cities has the same high percent of infant mortality as the third world&lt;br /&gt;inner cities has conditions similar to the third world&lt;br /&gt;We (North Americans) are sending our troops to Iraq and Afghanistan to kill, and torture people&lt;br /&gt;Our corporations is all over the third world, in South America, in Africa raping off resources, funding dictator governments to take off oil, coffee, and everything else they can get free.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Turn on TV, and watch Hollywood movies, and you see heroes, who have high morals, who are strong, who fight for justice, and help everybody in needs&lt;br /&gt;And the reality is totally the opposite&lt;br /&gt;We live in huge homes, driving fancy cars, and we don’t care about our neighbor&lt;br /&gt;We don’t care about our community&lt;br /&gt;We care about our neighborhood just because it effect the price of our house&lt;br /&gt;We don’t care about our city&lt;br /&gt;There are people who are dying from poverty in the city, but we don’t want to know about them&lt;br /&gt;There are children in our city who are victim of violence and poverty, but we choose to drive our cars, and comeback to the home, and watch big screen TV, and send money to a child in Africa&lt;br /&gt;&lt;br /&gt;It seems to me that the more evil we are, the more we get the extreme opposite on TV&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116197045166937968?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116197045166937968/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116197045166937968' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116197045166937968'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116197045166937968'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/10/culture-of-extremes.html' title='A culture of extremes'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116188665018248749</id><published>2006-10-26T10:49:00.000-07:00</published><updated>2006-10-26T11:17:30.673-07:00</updated><title type='text'>Why does the default ValueType.Equals use reflection</title><content type='html'>&lt;a href="http://techembassy.blogspot.com/2006/10/data-types-checking-for-equality.html"&gt;In my last post &lt;/a&gt;I did mention that with any value type equality check, the CLR will use reflection to do the equality check.&lt;br /&gt;My resource for that information was the &lt;a href="http://msdn2.microsoft.com/en-us/library/2dts52z7.aspx"&gt;msdn web site&lt;/a&gt;&lt;br /&gt;The enquiring minds like mine will ask themselves, why the CLR does that for god sake?&lt;br /&gt;Aren't the two value types are storing the values in memory, and just comparing the two memory values will result of the value check?&lt;br /&gt;&lt;br /&gt;The answer is, not really&lt;br /&gt;What if the value type contains a reference type&lt;br /&gt;What if you define a struct "MyValueType" that reference a class like a string for example.&lt;br /&gt;Like the following code&lt;br /&gt;&lt;br /&gt;publie struct MyValueType&lt;br /&gt;{&lt;br /&gt;   public string someStringValue;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Then comparing the two memory values will result with reference equality (are the two instances of the string the same), instead of the object values.&lt;br /&gt;So let's suppose the CLR is just comparing the two values in the memory&lt;br /&gt;then what is going to happen with the following code?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; public MyValueType var1, var2;&lt;br /&gt; var1.someStringValue = "ABC";&lt;br /&gt; var2.someStringValue = "ABC";&lt;br /&gt; Debug.WriteLine(var1.Equals(var2));&lt;br /&gt;&lt;br /&gt;the output will be "false";&lt;br /&gt;&lt;br /&gt;and of course you don't want that&lt;br /&gt;&lt;br /&gt;So, the CLR will use reflection, and check if there is any reference type in the struct definition, and if there is any, it will call the Equals method of that class defintion.&lt;br /&gt;&lt;br /&gt;So, the result of the previous statement &lt;br /&gt;var1.Equals(var2) will be True&lt;br /&gt;&lt;br /&gt;That is why CLR uses the reflection to know the members of the struct.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116188665018248749?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116188665018248749/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116188665018248749' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116188665018248749'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116188665018248749'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/10/why-does-default-valuetypeequals-use.html' title='Why does the default ValueType.Equals use reflection'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116172880192269805</id><published>2006-10-24T15:26:00.000-07:00</published><updated>2006-10-24T15:27:43.283-07:00</updated><title type='text'>NUnit equality check</title><content type='html'>In NUnit we can check for equality by using Assert.AreEqual&lt;br /&gt;The method Assert.AreEqual can accept two arguments as object&lt;br /&gt;I am using my won class which override its Equals method, and I was curious to see if the Assert.AreEqual will call the overriding Equals method, or instead will do a reference check&lt;br /&gt;By using the &lt;a href="http://www.aisto.com/roeder/dotnet/"&gt;Lutz Roeder's Reflector&lt;/a&gt;, I tracked down the Assert.AreEqual, and I found that it is indeed using the overriding static Equals of the class&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116172880192269805?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116172880192269805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116172880192269805' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116172880192269805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116172880192269805'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/10/nunit-equality-check.html' title='NUnit equality check'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116172746145387202</id><published>2006-10-24T14:40:00.000-07:00</published><updated>2006-10-24T15:07:46.646-07:00</updated><title type='text'>Data Types: Checking for Equality</title><content type='html'>There are three ways to check for equality&lt;br /&gt;1 - the == operator&lt;br /&gt;2 - the Static Equals method&lt;br /&gt;3 - the instance Equals method&lt;br /&gt;&lt;br /&gt;When you use any of the above methods for any reference type, by default it does a reference equality check, which means it check if the two objects are the same one (point to the same instance)&lt;br /&gt;If you want to change this behavior, you have to write your own implementation for those methods in your code.&lt;br /&gt;An example of this, is the System.String class, which overrides all the above methods to check for value equality.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For the value type, the story is different&lt;br /&gt;When you define a value type (struct in c#, structure in VB), then by default this value type will do value checking.&lt;br /&gt;The CLR actually uses reflection, to check the members of the value type, and do equality check for each one.&lt;br /&gt;So if your customized value type contains only primitive values (int, double, string,..) then you don't have to override the above methods&lt;br /&gt;But you might need to override them if you are concern about the performance&lt;br /&gt;Reflection is slow, and overriding them will call your decleared method and avoid using the reflection.&lt;br /&gt;Or you want to override them if your value type contains non-premitive data types, or you want to do customized equality check&lt;br /&gt;&lt;br /&gt;for all reference type, you have to override this equality check otherwise it does a reference equality check.&lt;br /&gt;&lt;br /&gt;what is the difference between all of those methods?&lt;br /&gt;&lt;br /&gt;The static equals is going to call the instance equals, but first it check if the values are null&lt;br /&gt;Static Equals is better to use for the following reason&lt;br /&gt;&lt;br /&gt;If you use instance equals and one of the object was null, then null reference exception will be generated, where is static equals will handle this and return false.&lt;br /&gt;We know that Exceptions are expensive, so avoiding them is better.&lt;br /&gt;&lt;br /&gt;But otherwise the Static equals will end up calling the instance equals.&lt;br /&gt;&lt;br /&gt;the == operator is different.&lt;br /&gt;it is checking for reference equality, so if you override the Equals method, then you better override this operator as well, or use Equals all the way&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116172746145387202?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116172746145387202/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116172746145387202' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116172746145387202'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116172746145387202'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/10/data-types-checking-for-equality.html' title='Data Types: Checking for Equality'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-116097903480957988</id><published>2006-10-15T22:53:00.000-07:00</published><updated>2006-10-15T23:10:35.326-07:00</updated><title type='text'>Calgary Dollars</title><content type='html'>There is a brilliant idea in Calgary, called &lt;a href="http://www.calgarydollars.ca/"&gt;Calgary Dollars&lt;/a&gt;&lt;br /&gt;it is local currency that is circulated in local shops (&lt;a href="http://www.calgarydollars.ca/listing/"&gt;only the shops that accept it&lt;/a&gt;)&lt;br /&gt;It is a way to build better local economy, and help build a healthy community.&lt;br /&gt;&lt;br /&gt;When I spend my money using Calgary Dollars, I know my money is going to be circulated and comeback to the community.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-116097903480957988?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/116097903480957988/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=116097903480957988' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116097903480957988'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/116097903480957988'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/10/calgary-dollars.html' title='Calgary Dollars'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115998803147920795</id><published>2006-10-04T11:47:00.000-07:00</published><updated>2006-10-04T11:53:52.070-07:00</updated><title type='text'>GML is getting better</title><content type='html'>In my current project, we are trying to communicate between applications sending Geodata.&lt;br /&gt;I was trying to use &lt;a href="http://en.wikipedia.org/wiki/Geography_Markup_Language"&gt;GML&lt;/a&gt;&lt;br /&gt;I remembered that I tried to use GML in old time at my old job at Telus Geomatics, and that time the GML specification was huge, though I did my own small version of GML&lt;br /&gt;&lt;br /&gt;But nowadays, &lt;a href="http://www.opengeospatial.org/"&gt;OGC&lt;/a&gt; developed a new simpler version of GML&lt;br /&gt;&lt;br /&gt;The old specification document was 267 pages long&lt;br /&gt;the new specification document is only 160 pages long&lt;br /&gt;&lt;br /&gt;way to go &lt;a href="http://www.opengeospatial.org/"&gt;OGC&lt;/a&gt;&lt;br /&gt;You made my day&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115998803147920795?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115998803147920795/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115998803147920795' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115998803147920795'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115998803147920795'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/10/gml-is-getting-better.html' title='GML is getting better'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115956877670862389</id><published>2006-09-29T15:23:00.000-07:00</published><updated>2006-09-29T15:26:16.933-07:00</updated><title type='text'>How does god work: an explenation</title><content type='html'>I have an idea that was hunting me for a long time.&lt;br /&gt;Whenever I read a book about life, universe, creation, and those stuff, I found the author delves into science, which make it unpleasant to other to read about.&lt;br /&gt;My idea that is hunting me, is to write a book about tips, and tricks, or kind of gotchas in universe.&lt;br /&gt;Like for example, &lt;br /&gt;Gotcha # 1: in 4 dimensions universe, if you have a right-hand glove which have its thumb on the right.&lt;br /&gt;If you turned that glove around, to see the other face, the thumb will stay on the right&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I want to write some gotchas like that, and collect them in a book&lt;br /&gt;Gotchas that are originally from the same dry laws and theories like the general relativity, or quantum mechanics&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I am trying to find the interesting things about the universe, and take the dry science and put it in an interesting way that everybody will enjoy reading about.&lt;br /&gt;&lt;br /&gt;That is my hunting idea.&lt;br /&gt;I like to collect all those gotchas, maybe in a future book&lt;br /&gt;But meanwhile, I will work on writing what I found interesting in this blog&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115956877670862389?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115956877670862389/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115956877670862389' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115956877670862389'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115956877670862389'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/how-does-god-work-explenation.html' title='How does god work: an explenation'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115956862621306393</id><published>2006-09-29T14:43:00.000-07:00</published><updated>2006-09-29T15:23:47.223-07:00</updated><title type='text'>How does God work, Part 2: It's bigger than what you see babe</title><content type='html'>Things could be bigger than what you see, or even smaller than what you see.&lt;br /&gt;We see stuff in our own dimensions, and measures.&lt;br /&gt;Our measurements are going to be different if we are in another place in the universe&lt;br /&gt;&lt;br /&gt;Like for example&lt;br /&gt;Everybody know the black holes, which are swallowing everything that is close to them&lt;br /&gt;The universe -which arguably is 4 dimensions- will be condensed and squeezed when it is close to the black hole&lt;br /&gt;&lt;br /&gt;Einstein’s relativity theory, is about the universe we are living in, is 4 dimensional universe, adding the time as a dimension to the 3 dimensions space&lt;br /&gt;&lt;br /&gt;Matters and energy in the universe will change the shape of this 4 dimensions universe&lt;br /&gt; &lt;br /&gt;back to the black hole, the universe that is close to the black hole will be squeezed, and condensed.&lt;br /&gt;&lt;br /&gt;So, if we (from the earth) are watching a spaceship that was swallowed by a black hole, then, we will see the spaceship is moving in a speed, but the more it is close to the black hole, the slower it appears to us, and when it is in the black hole, we see it that it is taking for ever to disappear in the black hole.&lt;br /&gt;&lt;br /&gt;The truth is, this spaceship still going on the same speed, but the space is condensed, and the time is condensed&lt;br /&gt;So what appear to us as a centimeter, it is actually thousands of kilometers for them, and what is appear to be one day for us, it is actually few years for them&lt;br /&gt;&lt;br /&gt;So the universe could be bigger that what we see.&lt;br /&gt;Size doesn’t matter.&lt;br /&gt;Size could be deceptive&lt;br /&gt;&lt;br /&gt;Beside there are tons of matters that are there and we don't see it, but we can measure it in other ways, and they are called hidden matters, but that is another post&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115956862621306393?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115956862621306393/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115956862621306393' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115956862621306393'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115956862621306393'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/how-does-god-work-part-2-its-bigger.html' title='How does God work, Part 2: It&apos;s bigger than what you see babe'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115956251098907441</id><published>2006-09-29T13:04:00.000-07:00</published><updated>2006-09-29T14:05:24.066-07:00</updated><title type='text'>Not bad customer serverice experience</title><content type='html'>Finally I found a customer service that is not bad.&lt;br /&gt;And yes, it is in Canada.&lt;br /&gt;Now, you think in your mind, "hey common, no BS"&lt;br /&gt;Yes, it is a Canadian company that has a "not bad" customer service.&lt;br /&gt;Actually, I rated it "not bad", but maybe somebody else will rate it bad.&lt;br /&gt;&lt;br /&gt;So, what is the story?&lt;br /&gt;&lt;br /&gt;On 12th of August, I had a flight from Montreal to Edmonton.&lt;br /&gt;I was attending a wedding in Montreal, and I was coming back.&lt;br /&gt;&lt;br /&gt;The flight was scheduled on 10 AM.&lt;br /&gt;I reached Montreal airport at 9:00 AM.&lt;br /&gt;I always come to the airport one hour before the flight, if the flight was inside the country, and that always worked for me.&lt;br /&gt;&lt;br /&gt;Usually, I do my check-in online, before I come to the airport, or I bring my reservation number with me, and do it on the computer at the airport.&lt;br /&gt;I never waited in the check-in baggage line&lt;br /&gt;But on that day I didn't have access to the internet the day before, so I couldn't do both, and I had to go using the check-in line.&lt;br /&gt;&lt;br /&gt;The check-in baggage line was very busy, and there were two clerks only.&lt;br /&gt;It took 20 minutes, for my turn to come to the check-in desk.&lt;br /&gt;The time I was at the check-in desk, was 9:25 something.&lt;br /&gt;&lt;br /&gt;The clerk said, that this is too late, and there are more security measures that will take longer, so it is too late to check in, and I have to go to the sale section, and re-schedule my flight.&lt;br /&gt;I didn't have a choice, and I did go to the sale, to find out that my ticket was not refundable (which I knew already), and I have to buy a new ticket.&lt;br /&gt;&lt;br /&gt;Now, you know when you have to buy a ticket right away, how much it cost you?&lt;br /&gt;for one way ticket to Edmonton, it was $650&lt;br /&gt;&lt;br /&gt;I was swallowing my anger, and I wanted to scream and fight, but I thought with the restrict security measures at the airport that day, it was not a wise thing, specially I have middle-eastern background&lt;br /&gt;&lt;br /&gt;So, I decided to shut up and buy a ticket.&lt;br /&gt;I thought to go and check with WestJet to see if they have better deal.&lt;br /&gt;&lt;br /&gt;After waiting for 20 minutes again on west-jet because the two clerks, who are check-in + sales clerks, were busy to put a dog in special box to carry him on the airplane, and it took them around 20 minutes to do that.&lt;br /&gt;I reached the check-in/sale clerk, and asked about flight to Edmonton.&lt;br /&gt;&lt;br /&gt;There was no flight to Edmonton, but there was one to Calgary that cost $480&lt;br /&gt;&lt;br /&gt;I thought in my mind that coming from Calgary to Edmonton, will cost me around one hundred, so it doesn’t worth it.&lt;br /&gt;&lt;br /&gt;So I went back to buy the ticket to Edmonton from AirCanada&lt;br /&gt;&lt;br /&gt;To my bad-luck that ticket was gone (it was the last available ticket), and the only option was buying on business level which cost $1500&lt;br /&gt;&lt;br /&gt;I went back to WestJet and bought the ticket to Calgary.&lt;br /&gt;&lt;br /&gt;Coming from Calgary cost me around $80, besides the waiting, the wasted time.&lt;br /&gt;&lt;br /&gt;Later, I've sent an email to customer service of AirCanada, complaining, and explaining the problem.&lt;br /&gt;&lt;br /&gt;I've sent them the receipt of WestJet of 500$&lt;br /&gt;I didn't send the cost of the bus from Calgary to Edmonton, and I thought if I got the 500$ will be OK.&lt;br /&gt;&lt;br /&gt;They answered me back, and they said that they can refund me my original ticket (the one at 10: am that I missed) which was $380, and for the difference with $500, they will cover it with a gift voucher that worth that difference.&lt;br /&gt;&lt;br /&gt;So I've got refund for $380, and a voucher worth $120.&lt;br /&gt;&lt;br /&gt;I was satisfied with this; even it was bad experience that I don't want to go over it again.&lt;br /&gt;&lt;br /&gt;If you ask me, would I fly with AirCanada again?&lt;br /&gt;I will say, probably yes, but I will make sure that I will come to the airport 2 hours before the flight.&lt;br /&gt;&lt;br /&gt;-------------Edited&lt;br /&gt;&lt;br /&gt;Actually I want to add more about the horror that I faced that day at the aiport.&lt;br /&gt;After I bought the Calgary ticket, I knew that my visa is going to its max.&lt;br /&gt;I have only one credit card which is a visa card with limit of $1000, and my bank account was clost to zero, (after the mortgage, and the car payment was done).&lt;br /&gt;I knew that if I had any money left, then I should buy the bus ticket from Calgary to Edmonton, so I called the grey hound and booked the ticket.&lt;br /&gt;&lt;br /&gt;After that, I tried to do a phone call using my visa card, and it was refused.&lt;br /&gt;It was horror moment, when I am more than 2000 miles from my house, and have nothing in my pocket.&lt;br /&gt;I won't forget that moment at all.&lt;br /&gt;&lt;br /&gt;--------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115956251098907441?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115956251098907441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115956251098907441' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115956251098907441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115956251098907441'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/not-bad-customer-serverice-experience.html' title='Not bad customer serverice experience'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115893849224425471</id><published>2006-09-22T08:21:00.000-07:00</published><updated>2006-09-22T08:21:34.466-07:00</updated><title type='text'>You have to hate Bill Smith</title><content type='html'>I am Edmontonian to the bone.&lt;br /&gt;And I like Edmonton more than Calgary.&lt;br /&gt;But man, I have to tell you, Calgary with slightly more population than Edmonton, is doing better job as a city than Edmonton.&lt;br /&gt;&lt;br /&gt;If Edmonton is going to be famous about something, then it will be famous about "the city that will ever be a town"&lt;br /&gt;&lt;br /&gt;In all the booming of Alberta, Calgary and Edmonton are growing up.&lt;br /&gt;But Bill Smith managed to be a bad mayor.&lt;br /&gt;When he was a mayor, he did nothing.&lt;br /&gt;He let the business decide what is good for them, and didn't have any impact.&lt;br /&gt;The result was a town-city that is growing up in size, but not establishing itself as a city.&lt;br /&gt;&lt;br /&gt;I thought Calgary is a red-neck city.&lt;br /&gt;I thought Calgary is conservative.&lt;br /&gt;I thought Calgary is just for money.&lt;br /&gt;&lt;br /&gt;But boy, come to live here and see for yourself&lt;br /&gt;&lt;br /&gt;Edmonton is the city that doesn't want to admit that it is not a city.&lt;br /&gt;&lt;br /&gt;I saw in Calgary more community-oriented activities than what I saw in Edmonton for 5 years.&lt;br /&gt;&lt;br /&gt;I saw in Calgary more community-oriented services that what I saw in Edmonton for 5 years.&lt;br /&gt;&lt;br /&gt;Please, don't get me wrong.&lt;br /&gt;I still love Edmonton.&lt;br /&gt;and at the end, Edmonton has the fringe, and the folk festival when Calgary has the stampede, and that is enough to say about the taste of the two cities.&lt;br /&gt;&lt;br /&gt;But I am blaming here the official of city of Edmonton.&lt;br /&gt;&lt;br /&gt;Bill Smith is an idiot.&lt;br /&gt;&lt;br /&gt;Who knows me, know well that I've been never harsh on anybody.&lt;br /&gt;But for Bill Smith, I will do an exception this time&lt;br /&gt;&lt;br /&gt;Bill Smith is an idiot, and he lost a good chance for Edmonton to be a city.&lt;br /&gt;&lt;br /&gt;Stephen Mandel has lots of work to do.&lt;br /&gt;And so far I didn't see anything done yet.&lt;br /&gt;But we only can wait and hope.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115893849224425471?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115893849224425471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115893849224425471' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115893849224425471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115893849224425471'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/you-have-to-hate-bill-smith.html' title='You have to hate Bill Smith'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115889536897957361</id><published>2006-09-21T20:12:00.000-07:00</published><updated>2006-09-21T20:38:48.253-07:00</updated><title type='text'>How does God work, Part II: The dirty-simple principle</title><content type='html'>The universe is driven by simple priniciples and laws.&lt;br /&gt;They are very simple, but they control the universe.&lt;br /&gt;They are the base of other more complex laws.&lt;br /&gt;&lt;br /&gt;The first priniciple is: the universe is dirty and simple&lt;br /&gt;I mean, all things, and everything in the universe is going in its simplest, easiest possible option.&lt;br /&gt;&lt;br /&gt;If you throw a stone from the 10th floor on high-rise building, the stone will fall in a free falling, to the earth.&lt;br /&gt;&lt;br /&gt;The gravity law says that the stone will go in vertical path.&lt;br /&gt;&lt;br /&gt;But actually the vertical path is just a special case, in that time and that place.&lt;br /&gt;The quantum mechanice says that there are hundreds of options of possible path which this stone can go through, and the vertical path is the easiest, simplest.&lt;br /&gt;The universe chose the simplest path, or the simplest option in any situation.&lt;br /&gt;&lt;br /&gt;Do you know the term "simple and dirty way"?&lt;br /&gt;&lt;br /&gt;Yes, the universe is dirty.&lt;br /&gt;It is chaos.&lt;br /&gt;The universe is Chaos.&lt;br /&gt;Nothing in order.&lt;br /&gt;What we think it is an order, it is actually a special case.&lt;br /&gt;&lt;br /&gt;It just happend that we only see the order, and we don't see the chaos&lt;br /&gt;So, the first principle that control the universe, is simplicity.&lt;br /&gt;&lt;br /&gt;for any action, there are lots of possibility, and the universe chose the simplest, easiest to do.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115889536897957361?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115889536897957361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115889536897957361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115889536897957361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115889536897957361'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/how-does-god-work-part-ii-dirty-simple.html' title='How does God work, Part II: The dirty-simple principle'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115889263148043454</id><published>2006-09-21T19:36:00.000-07:00</published><updated>2006-09-21T20:10:49.226-07:00</updated><title type='text'>How does God work, Part I: Introduction</title><content type='html'>Ok&lt;br /&gt;&lt;br /&gt;Folks (the two people who are reading this blog)&lt;br /&gt;&lt;br /&gt;I am going to write about the subject that fascinate me most.&lt;br /&gt;About how the universe works.&lt;br /&gt;&lt;br /&gt;It has nothing to do with programming in .NET, but it is about how the universe writes the perfect script code to run itself.&lt;br /&gt;It is about who is writing the code that run the universe.&lt;br /&gt;It is about what are the patterns that out there, and how the universe is designed&lt;br /&gt;What is the architectural diagram, and the design diagram behind this system that is called universe?&lt;br /&gt;&lt;br /&gt;You are going to discover the CLR of the universe.&lt;br /&gt;&lt;br /&gt;be tuned&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115889263148043454?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115889263148043454/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115889263148043454' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115889263148043454'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115889263148043454'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/how-does-god-work-part-i-introduction.html' title='How does God work, Part I: Introduction'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115881359960863873</id><published>2006-09-20T21:35:00.000-07:00</published><updated>2006-09-20T21:42:14.746-07:00</updated><title type='text'>I am going Raw</title><content type='html'>After being a vegeterian for 2 years, I decided to go a further step ahead and start eating raw food diet.&lt;br /&gt;&lt;br /&gt;Eating raw food is better than cooked food, it preserves the anzems, and all nutritions in the food, which will be destroyed in the cooking process.&lt;br /&gt;&lt;br /&gt;In order to know more details about raw food check the websites&lt;br /&gt;&lt;br /&gt;www.rawfoods.com&lt;br /&gt;eat.rawfood.com&lt;br /&gt;&lt;br /&gt;I will still eat cooked food, in case I was in restaurant, but at home I am going 100% raw for vegetables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115881359960863873?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115881359960863873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115881359960863873' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115881359960863873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115881359960863873'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/i-am-going-raw.html' title='I am going Raw'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115881212104387736</id><published>2006-09-20T21:05:00.000-07:00</published><updated>2006-09-20T21:26:35.840-07:00</updated><title type='text'>Fat is good for your body</title><content type='html'>More and more studies showing little fat in your body is good for your health.&lt;br /&gt;&lt;br /&gt;This article shows that &lt;a href="http://www.sciencedaily.com/releases/2006/09/060920082942.htm"&gt;fat droplets&lt;/a&gt; are storing excess of protein.&lt;br /&gt;&lt;br /&gt;Another study I read before shows that storing excess of energy as fat is necessary for your body&lt;br /&gt;&lt;br /&gt;Actually, fit, 0 fat body is very fragile&lt;br /&gt;&lt;br /&gt;Fat plays the role of the battery.&lt;br /&gt;Or, in electricity, they use capacitor to store the excess of electricity, that could otherwise damage the circuit.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115881212104387736?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115881212104387736/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115881212104387736' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115881212104387736'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115881212104387736'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/fat-is-good-for-your-body.html' title='Fat is good for your body'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115878320071880214</id><published>2006-09-20T13:13:00.000-07:00</published><updated>2006-09-20T13:14:46.973-07:00</updated><title type='text'>And finally, after long wait, the web client software factory</title><content type='html'>The software factory, as a concept, is an initiative from Microsoft to build ready to use software components, which makes building an application an easy process similar to playing with the &lt;a href="http://www.lego.com"&gt;Lego game.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;That was the concept&lt;br /&gt;&lt;br /&gt;And for action, and on marketing side, Microsoft's Patterns and Practices section takes responsibility to build these software factories&lt;br /&gt;&lt;br /&gt;So far there were two major Software factories&lt;br /&gt;&lt;br /&gt;1 - &lt;a href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=6fde9247-53a8-4879-853d-500cd2d97a83"&gt;The web service software factory&lt;/a&gt;.&lt;br /&gt;2 - &lt;a href="http://msdn.microsoft.com/practices/default.aspx?pull=/library/en-us/dnpag2/html/scsflp.asp"&gt;The smart client software factory&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But recently, Microsoft started a new initiative: &lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=websf"&gt;the web client software factory&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Web client software factory is a "framework" which is a combination of guidances, patterns, documentations, tutorials of how to build robust, secure, and scalable web clients with ASP.NET, ASP.NET Ajax (Atlas), and workflow foundation.&lt;br /&gt;&lt;br /&gt;I was waiting long time for this product, because most of what I am using is web development.&lt;br /&gt;&lt;br /&gt;But at the same time, I am little disappointed.&lt;br /&gt;I was expecting more than guidances, and patterns.&lt;br /&gt;I was expecting something like a "framework"&lt;br /&gt;&lt;br /&gt;Actually Microsoft, or other partners did publish before some of the guidance and patterns&lt;br /&gt;&lt;a href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=bb9aecfe-56ba-4ca9-8127-44e551b90962"&gt;Guidance Explorer&lt;/a&gt; has lots of guidance packages for web application.&lt;br /&gt;&lt;br /&gt;But it is just first release, and I am waiting for more&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115878320071880214?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115878320071880214/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115878320071880214' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115878320071880214'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115878320071880214'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/and-finally-after-long-wait-web-client.html' title='And finally, after long wait, the web client software factory'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115835562234245014</id><published>2006-09-15T14:22:00.000-07:00</published><updated>2006-09-15T14:27:53.903-07:00</updated><title type='text'>OMG, what I did to my self</title><content type='html'>A &lt;a href="https://leisureguy.wordpress.com/2006/07/11/lavendar-tea-tree-oils-unsafe-for-boys/"&gt;new article says&lt;/a&gt; that Lavender oil mimics the estogen, which is the female sex hormone.&lt;br /&gt;So using lots of lavender oil, will grow breasts in boys&lt;br /&gt;&lt;br /&gt;In the last few years I have been using lavender oil-based shampoo&lt;br /&gt;&lt;br /&gt;I am stopping from this moment to use this shampoo&lt;br /&gt;&lt;br /&gt;(P.S: I have lots in the stock, so if you want I can provide them free)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115835562234245014?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115835562234245014/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115835562234245014' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115835562234245014'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115835562234245014'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/omg-what-i-did-to-my-self.html' title='OMG, what I did to my self'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115821392127578110</id><published>2006-09-13T22:28:00.000-07:00</published><updated>2006-09-14T06:06:32.333-07:00</updated><title type='text'>The nation of cool</title><content type='html'>This is a subject that I've always loved to talk about.&lt;br /&gt;COOL&lt;br /&gt;This four letters word (Cool).&lt;br /&gt;How it effects our life, and what is behind this word.&lt;br /&gt;What are the social conscientiousness behind this word.&lt;br /&gt;I've always thought that the word "cool" serves more than a word in the dictionary.&lt;br /&gt;It is fabricating our conscientiousness.&lt;br /&gt;It is destroying our boundaries.&lt;br /&gt;It is forcing us to follow.&lt;br /&gt;It is pushing us to outside our bodies.&lt;br /&gt;and most importantly, it is making us feel that we are better, or "WE ARE COOL".&lt;br /&gt;&lt;br /&gt;Common, eliminate, and supress your differances, because you should be cool&lt;br /&gt;&lt;br /&gt;We will be programmed, fabricated, just to be cool.&lt;br /&gt;&lt;br /&gt;Just switch on the TV, and you will be overwhelmed by tons of ads on how to be cool&lt;br /&gt;loosing weight&lt;br /&gt;What not to dress&lt;br /&gt;Extreme makeup&lt;br /&gt;and more, and more&lt;br /&gt;&lt;br /&gt;The way we dress, the way we look, is reflecting ourself from inside&lt;br /&gt;To make change in your outside, you should first accept yourself from inside&lt;br /&gt;It is the essential step, to do anychange in your life&lt;br /&gt;To love, and touch ourselves is the key to know ourselves and to grow up emotionally&lt;br /&gt;And this is the way to change, and going forward in life&lt;br /&gt;&lt;br /&gt;But the way they put it on TV, will make you forget about the inside of you, and follow what the fashion and the industry do.&lt;br /&gt;It increases the gab between human and themselves.&lt;br /&gt;We are living in a culture where we lost touch with our humanity.&lt;br /&gt;We are fabricated in emotion, in the way we look, exactly like the fast food we eat.&lt;br /&gt;&lt;br /&gt;all of that , in order to be cool.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;are you wondering after all, why you always have this hunting feeling that you have to fit in this society.&lt;br /&gt;In order to fit, you have to be cool&lt;br /&gt;and in order to be cool, then you have to show the money&lt;br /&gt;&lt;br /&gt;who is getting the benefits after all&lt;br /&gt;It is them&lt;br /&gt;&lt;br /&gt;The word cool is used to force you to buy.&lt;br /&gt;If you don't buy this cool stuff, you won't fit, and you will be outside.&lt;br /&gt;If you want to be inside, then be cool.&lt;br /&gt;&lt;br /&gt;If you want to condense the capitalism in one word, then it is "cool"&lt;br /&gt;If you want to condense the consumerism in one word, then the best word is "cool".&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So&lt;br /&gt;If you want to stop giving them power&lt;br /&gt;Then join me&lt;br /&gt;I am not cool&lt;br /&gt;I don't want to be cool&lt;br /&gt;I don't care and don't even bother to know how to be cool&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115821392127578110?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115821392127578110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115821392127578110' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115821392127578110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115821392127578110'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/nation-of-cool.html' title='The nation of cool'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115808395372645876</id><published>2006-09-12T10:59:00.000-07:00</published><updated>2006-09-12T11:05:56.693-07:00</updated><title type='text'>Word Search &amp; Replace tips</title><content type='html'>I was impressed by Microsoft word&lt;br /&gt;In search &amp; replace, you can have so many options&lt;br /&gt;You can search for specific paragraph format, or for example you can search for color of the text&lt;br /&gt;We have documents that contains requirements, and I want to import them to requirement database&lt;br /&gt;The document contains two entries for each requirement, the requirement name, and the description&lt;br /&gt;the requirement name exists on a new line where the indent is 0&lt;br /&gt;and the description exists on a new line where the indent is 0.25"&lt;br /&gt;&lt;br /&gt;I was succeded in inserting xml tags, that surround the requirement name and the description based the formating using the search and replace.&lt;br /&gt;and then I saved the document as text, where I imported into the requirement database&lt;br /&gt;&lt;br /&gt;That saved me lots of time, because I have 3 documents, each with 80+ requirements.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115808395372645876?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115808395372645876/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115808395372645876' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115808395372645876'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115808395372645876'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/word-search-replace-tips.html' title='Word Search &amp; Replace tips'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115766563862250323</id><published>2006-09-07T14:44:00.000-07:00</published><updated>2006-09-07T14:47:20.540-07:00</updated><title type='text'>Design By Contract in .NET</title><content type='html'>New tool that start with (N), which implement Design by contract programming in .NET&lt;br /&gt;the tool is &lt;a href="http://weblogs.asp.net/whaggard/archive/2006/09/05/nContract-_2D00_-Quick-Start-Guide.aspx"&gt;nContract&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115766563862250323?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115766563862250323/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115766563862250323' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115766563862250323'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115766563862250323'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/09/design-by-contract-in-net.html' title='Design By Contract in .NET'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115656225032773057</id><published>2006-08-25T20:17:00.000-07:00</published><updated>2006-08-25T20:17:30.540-07:00</updated><title type='text'>Framework Vs. Libraries</title><content type='html'>I blogged before about the framework vs. libraries and I found this picture that describe the difference between both&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/6130/317/1600/fig25_01_0.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/6130/317/320/fig25_01_0.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Framework encapsulates the process flow, and the interactions between the modules that the developers write, so developers won't worry about wiring their modules together.&lt;br /&gt;&lt;br /&gt;Where library is about re-usability and extensibility.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115656225032773057?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115656225032773057/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115656225032773057' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115656225032773057'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115656225032773057'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/framework-vs-libraries.html' title='Framework Vs. Libraries'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115518867346473994</id><published>2006-08-09T22:13:00.000-07:00</published><updated>2006-08-10T07:51:00.090-07:00</updated><title type='text'>Discover with SOS how Generics are implemented</title><content type='html'>SonOfStrike is a neat tool.&lt;br /&gt;You can discover what is going inside the CLR.&lt;br /&gt;&lt;br /&gt;I used it to discover how the Generics are implemented&lt;br /&gt;&lt;br /&gt;I will create a simple windows console application&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;    class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            List&amp;lt;Int32&amp;gt; myIntList = new List&amp;lt;Int32&amp;gt;();&lt;br /&gt;            List&amp;lt;String&amp;gt; myStrList = new List&amp;lt;String&amp;gt;();&lt;br /&gt;            Console.WriteLine("Hello World!");&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;I am using here the List&amp;lt;T&amp;gt; generic type that comes with the class library.&lt;br /&gt;I am defining two constructed types of the List generic type, one constructed type with String as type argument, and the second with Int32 as type argument.&lt;br /&gt;&lt;br /&gt;Let us start our journey with SOS, by adding a break point on the line: Console.WriteLine ("...");&lt;br /&gt;&lt;br /&gt;and Run with debug&lt;br /&gt;&lt;br /&gt;when the program in the debug mode, and in the immediate Window, enter the command&lt;br /&gt;&lt;br /&gt;&lt;span style="color:red"&gt; !Load SOS &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now, Let's discover the objects inside the Heap of the AppDomain&lt;br /&gt;&lt;br /&gt;we use the command DumpHeap -stat&lt;br /&gt;&lt;br /&gt;&lt;Span  style="color:red"&gt; !DumpHeap -stat &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the dump heap command will give statistics about the objects created in the heap&lt;br /&gt;the list will looks like the following:&lt;br /&gt;&lt;span style="font-style:italic;"&gt;&lt;br /&gt;      MT    Count    TotalSize Class Name&lt;br /&gt;791240f0        1           12 System.Int32[]&lt;br /&gt;790fdd5c        1           12 System.Security.Permissions.SecurityPermission&lt;br /&gt;&lt;span style="color:green"&gt;7919f9fc        1           24 System.Collections.Generic.List`1[[System.Int32, mscorlib]]&lt;br /&gt;7912b0cc        1           24 System.Collections.Generic.List`1[[System.String, mscorlib]]&lt;/span&gt;&lt;br /&gt;790fd5b4        1           24 System.OperatingSystem&lt;br /&gt;790fc79c        1           24 System.Reflection.Assembly&lt;br /&gt;790fb668        1           28 System.SharedStatics&lt;br /&gt;790fce28        1           32 Microsoft.Win32.Win32Native+OSVERSIONINFO&lt;br /&gt;79124544        1           36 System.Int64[]&lt;br /&gt;790fd444        1           40 Microsoft.Win32.Win32Native+OSVERSIONINFOEX&lt;br /&gt;790fbcfc        1           40 System.AppDomainSetup&lt;br /&gt;790fdc3c        1           44 System.Security.FrameSecurityDescriptor&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see, there are two objects of the type List&lt;br /&gt;&lt;br /&gt;Now, let us discover what methods these two different constructed types has&lt;br /&gt;We start with the constructed type with Int32 type argument.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:red"&gt; !DumpMT -md 7919f9fc &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the method table is the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;MethodDesc Table&lt;br /&gt;   Entry MethodDesc      JIT Name&lt;br /&gt;79354bec   7913bd48   PreJIT System.Object.ToString()&lt;br /&gt;793539c0   7913bd50   PreJIT System.Object.Equals(System.Object)&lt;br /&gt;793539b0   7913bd68   PreJIT System.Object.GetHashCode()&lt;br /&gt;7934a4c0   7913bd70   PreJIT System.Object.Finalize()&lt;br /&gt;795599e4   79282850   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].get_Count()&lt;br /&gt;79563b60   79282718   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.get_IsFixedSize()&lt;br /&gt;795645e0   79282728   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.Generic.ICollection&lt;T&gt;.get_IsReadOnly()&lt;br /&gt;79564bd0   79282738   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.get_IsReadOnly()&lt;br /&gt;79564fa0   79282748   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.ICollection.get_IsSynchronized()&lt;br /&gt;795653fc   79282758   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.ICollection.get_SyncRoot()&lt;br /&gt;79559b48   79282858   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].get_Item(Int32)&lt;br /&gt;79559f0c   79282860   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].set_Item(Int32, Int32)&lt;br /&gt;795658e8   79282768   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.get_Item(Int32)&lt;br /&gt;79565cd0   79282778   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.set_Item(Int32, System.Object)&lt;br /&gt;7952a2a0   79282878   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Add(Int32)&lt;br /&gt;795660d8   79282788   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.Add(System.Object)&lt;br /&gt;7955b61c   792828a8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Clear()&lt;br /&gt;7952b0c8   792828b0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Contains(Int32)&lt;br /&gt;79566520   79282798   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.Contains(System.Object)&lt;br /&gt;79566720   792827a8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.ICollection.CopyTo(System.Array, Int32)&lt;br /&gt;7955c6b8   792828c8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].CopyTo(Int32[], Int32)&lt;br /&gt;79566a84   792827b8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator()&lt;br /&gt;79566c40   79143a58   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IEnumerable.GetEnumerator()&lt;br /&gt;7955ef0c   79282940   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].IndexOf(Int32)&lt;br /&gt;79566e40   792827c8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.IndexOf(System.Object)&lt;br /&gt;7955f59c   79282958   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Insert(Int32, Int32)&lt;br /&gt;79567110   792827d8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.Insert(Int32, System.Object)&lt;br /&gt;79560c00   79282980   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Remove(Int32)&lt;br /&gt;7956751c   792827e8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].System.Collections.IList.Remove(System.Object)&lt;br /&gt;79560f3c   79282990   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].RemoveAt(Int32)&lt;br /&gt;79559030   79143a78   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]]..ctor()&lt;br /&gt;79561520   79282830   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]]..ctor(Int32)&lt;br /&gt;79559484   79282838   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]]..ctor(System.Collections.Generic.IEnumerable`1&lt;Int32&gt;)&lt;br /&gt;795596d0   79282840   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].get_Capacity()&lt;br /&gt;79559880   79282848   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].set_Capacity(Int32)&lt;br /&gt;7955a164   79282868   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].IsCompatibleObject(System.Object)&lt;br /&gt;7955a61c   79282870   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].VerifyValueType(System.Object)&lt;br /&gt;7955aaf4   79282880   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].AddRange(System.Collections.Generic.IEnumerable`1&lt;Int32&gt;)&lt;br /&gt;7952a560   79282888   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].AsReadOnly()&lt;br /&gt;7955aee4   79282890   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].BinarySearch(Int32, Int32, Int32, System.Collections.Generic.IComparer`1&lt;Int32&gt;)&lt;br /&gt;7955b2d0   79282898   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].BinarySearch(Int32)&lt;br /&gt;7955b43c   792828a0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].BinarySearch(Int32, System.Collections.Generic.IComparer`1&lt;Int32&gt;)&lt;br /&gt;7969ba74   79282808     NONE System.Collections.Generic.List`1[[System.Int32, mscorlib]].ConvertAll(System.Converter`2&lt;Int32,!!0&gt;)&lt;br /&gt;7952b3e4   792828b8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].CopyTo(Int32[])&lt;br /&gt;7955be54   792828c0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].CopyTo(Int32, Int32[], Int32, Int32)&lt;br /&gt;7955d070   792828d0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].EnsureCapacity(Int32)&lt;br /&gt;7955d220   792828d8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Exists(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955d380   792828e0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Find(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955d594   792828e8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindAll(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955d6f0   792828f0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindIndex(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7952c93c   792828f8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindIndex(Int32, System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955e088   79282900   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindIndex(Int32, Int32, System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955e204   79282908   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindLast(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955e3a0   79282910   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindLastIndex(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955e51c   79282918   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindLastIndex(Int32, System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955e6a0   79282920   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].FindLastIndex(Int32, Int32, System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;7955e8cc   79282928   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].ForEach(System.Action`1&lt;Int32&gt;)&lt;br /&gt;7953e260   79282930   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].GetEnumerator()&lt;br /&gt;7955ec8c   79282938   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].GetRange(Int32, Int32)&lt;br /&gt;7955f1ac   79282948   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].IndexOf(Int32, Int32)&lt;br /&gt;7955f394   79282950   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].IndexOf(Int32, Int32, Int32)&lt;br /&gt;7955f734   79282960   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].InsertRange(Int32, System.Collections.Generic.IEnumerable`1&lt;Int32&gt;)&lt;br /&gt;7955f994   79282968   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].LastIndexOf(Int32)&lt;br /&gt;7955fc54   79282970   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].LastIndexOf(Int32, Int32)&lt;br /&gt;79560928   79282978   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].LastIndexOf(Int32, Int32, Int32)&lt;br /&gt;79560ce0   79282988   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].RemoveAll(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;795254a0   79282998   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].RemoveRange(Int32, Int32)&lt;br /&gt;795615ec   792829a0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Reverse()&lt;br /&gt;79525700   792829a8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Reverse(Int32, Int32)&lt;br /&gt;79525800   792829b0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Sort()&lt;br /&gt;795259d0   792829b8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Sort(System.Collections.Generic.IComparer`1&lt;Int32&gt;)&lt;br /&gt;79525b74   792829c0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Sort(Int32, Int32, System.Collections.Generic.IComparer`1&lt;Int32&gt;)&lt;br /&gt;79525d8c   792829c8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].Sort(System.Comparison`1&lt;Int32&gt;)&lt;br /&gt;79562160   792829d0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].ToArray()&lt;br /&gt;79526254   792829d8   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].TrimExcess()&lt;br /&gt;79526520   792829e0   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]].TrueForAll(System.Predicate`1&lt;Int32&gt;)&lt;br /&gt;795266a8   79143a80   PreJIT System.Collections.Generic.List`1[[System.Int32, mscorlib]]..cctor()&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see, all the methods of the type Generic.List were implemented using the type (Int32) of the argument type.&lt;br /&gt;&lt;br /&gt;and as you expect, the same will be repeated for the String&lt;br /&gt;&lt;br /&gt;Then, the question is, who is generating these methods?&lt;br /&gt;It is not the C# compiler, because if you investigate the generated IL code, you won't see these methods, beside why you do that when generic is CIL compliant and cross-languages.&lt;br /&gt;&lt;br /&gt;It is the JIT compiler, who generate these methods&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115518867346473994?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115518867346473994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115518867346473994' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115518867346473994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115518867346473994'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/discover-with-sos-how-generics-are.html' title='Discover with SOS how Generics are implemented'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115506233517011839</id><published>2006-08-08T11:20:00.000-07:00</published><updated>2006-08-08T11:40:04.020-07:00</updated><title type='text'>Nullable types and DataReader</title><content type='html'>In .NET 1.1, a value type cannot be null.&lt;br /&gt;The value type is allocated in the stack, and the allocated memory will store the actual value, so the value type is always initiated with a value.&lt;br /&gt;&lt;br /&gt;This creates a problem, when you want to represent that the value type has no valid value.&lt;br /&gt;&lt;br /&gt;what if you want to have a function that return Int32, but you don't want to return a value when the function fails.&lt;br /&gt;&lt;br /&gt;Some functions return (-1) to represent invalid value, but what if (-1) could be a valid value?&lt;br /&gt;&lt;br /&gt;Should you throw an exception?&lt;br /&gt;&lt;br /&gt;That is why .NET framework 2.0 introduced the nullable value types.&lt;br /&gt;In 2.0 you can define a nullable Int32&lt;br /&gt;The type will be Nullable&lt;Int32&gt;&lt;br /&gt;&lt;br /&gt;One of the issue regarding non-nullable value types was SqlDataReader&lt;br /&gt;&lt;br /&gt;SqlDataReader.GetInt32 will return an Int32 value&lt;br /&gt;But what if the database value was null&lt;br /&gt;In case of Null, the function was throwing InvalidCastException&lt;br /&gt;So, you have to check if the value null with IsDBNull before calling the function GetInt32 to make sure that it is not null&lt;br /&gt;&lt;br /&gt;In version 2.0, I was expecting that the SqlDataReader will be updated to handling the null in better way&lt;br /&gt;&lt;br /&gt;I was expected the DataReader.GetInt32 will return a nullable Int32 (Nullable&lt;Int32&gt;), which will contain null if the database is null&lt;br /&gt;&lt;br /&gt;But it seems that the .NET Class Library team didn't catch up with the BCL team.&lt;br /&gt;&lt;br /&gt;in .NET 2.0 we still has to check for IsDBNull, otherwise it throw an exception&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115506233517011839?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115506233517011839/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115506233517011839' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115506233517011839'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115506233517011839'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/nullable-types-and-datareader.html' title='Nullable types and DataReader'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115472376800929631</id><published>2006-08-04T13:23:00.000-07:00</published><updated>2006-08-04T13:36:28.156-07:00</updated><title type='text'>Performance quiz #8</title><content type='html'>const. vs. readonly&lt;br /&gt;What is the difference between readonly and const?&lt;br /&gt;&lt;br /&gt;you can define a variable by using const, or readonly&lt;br /&gt;&lt;br /&gt;private const Int32 constExample = 2000;&lt;br /&gt;&lt;br /&gt;or&lt;br /&gt;&lt;br /&gt;private readonly Int32 constExample = 2000;&lt;br /&gt;&lt;br /&gt;The answer:&lt;br /&gt;const is faster.&lt;br /&gt;const is solved by the compiler on the compile time.&lt;br /&gt;So when c# will encounter any code that refer to the constExample, it will replace it with the value 2000&lt;br /&gt;&lt;br /&gt;Where readonly is solved at runtime, where a memory location will be allocated to store the value 2000.&lt;br /&gt;&lt;br /&gt;What are more differences between const and readonly&lt;br /&gt;&lt;br /&gt;readonly can be assigned during class construction, for example&lt;br /&gt;&lt;br /&gt;public class Example&lt;br /&gt;{&lt;br /&gt;     private readonly Int32 myvalue; /// initialization of myvalue can be here&lt;br /&gt;     public Example()&lt;br /&gt;     {&lt;br /&gt;         ///as well myvalue can be set here&lt;br /&gt;     }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;where the const can be set only inline on the declaration statement itself.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115472376800929631?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115472376800929631/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115472376800929631' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115472376800929631'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115472376800929631'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/performance-quiz-8.html' title='Performance quiz #8'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115471657754874488</id><published>2006-08-04T11:16:00.000-07:00</published><updated>2006-08-04T11:36:17.653-07:00</updated><title type='text'>Parsing DateTime puzzle</title><content type='html'>&lt;a href="http://www.hanselman.com/blog/"&gt;Scott Hanselman&lt;/a&gt; wrote &lt;a href="http://www.hanselman.com/blog/WhatGreatNETDevelopersOughtToKnowMoreNETInterviewQuestions.aspx"&gt;some questions that every developer should know&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;One of the question is : what is wrong with this statement: DateTime.Parse(myString);&lt;br /&gt;&lt;br /&gt;I tried to find answer on the internet, and I couldn't find answer.&lt;br /&gt;&lt;br /&gt;So, I am going to guess&lt;br /&gt;&lt;br /&gt;I am guessing it could be one of two problems:&lt;br /&gt;&lt;br /&gt;1 - culture related issue&lt;br /&gt;2 - exception handling issue&lt;br /&gt;&lt;br /&gt;1 - culture related issue:&lt;br /&gt;Parse will try to parse the string for a valid date time&lt;br /&gt;if you didn't specify a format provider, so by default, (which is in our case), the Parse will try to match the string to the current culture format provider&lt;br /&gt;So an example like DateTime.Parse ("01/02/2006")&lt;br /&gt;To know if it is going to be 1st of February, or 2nd of January, that depends on the current culture settings&lt;br /&gt;If you are not sure what the current culture is, or you want to specify how the string will be interpreted, then either you should specify the format provider, or use ParseExact which allow you to specify the pattern that you are using.&lt;br /&gt;&lt;br /&gt;2 - exception handling:&lt;br /&gt;Parse will throw an exception, when it fails&lt;br /&gt;Exception are expensive, and slow&lt;br /&gt;so that is why .NET 2.0 provides TryParse, which return false in case the parse fails&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;those were my guess&lt;br /&gt;I might be wrong&lt;br /&gt;If anybody knows the correct answer, feel free to share it&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115471657754874488?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115471657754874488/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115471657754874488' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115471657754874488'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115471657754874488'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/parsing-datetime-puzzle.html' title='Parsing DateTime puzzle'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115471489142387500</id><published>2006-08-04T10:39:00.000-07:00</published><updated>2006-08-04T11:16:01.676-07:00</updated><title type='text'>Tips for DateTime</title><content type='html'>Why you cannot compare DateTime to null, or you cannot set DateTime to null?&lt;br /&gt;&lt;br /&gt;Well, you cannot set any value type to null.&lt;br /&gt;&lt;br /&gt;value types store the real value in the variable.&lt;br /&gt;&lt;br /&gt;When you define an Int32 variable, this variable will be allocated in the stack, and will has an empty memory, which will equal to value 0;&lt;br /&gt;&lt;br /&gt;so, if you put define something like &lt;br /&gt;Int32 intVar = 0;&lt;br /&gt;Actually you are adding code that is not necessary, because when the Int32 value will be allocated, it will has a value of 0;&lt;br /&gt;&lt;br /&gt;The DateTime is a value type, and it is stored in the stack as 8 bytes.&lt;br /&gt;The DateTime is stored internally as a number, and the number will represent how many times are there from the January 1, 0001&lt;br /&gt;&lt;br /&gt;So, value of 0 (which is the initial value of DateTime) will represent January 1, 0001 (aka DateTime.MinValue)&lt;br /&gt;&lt;br /&gt;that is why, when you define a value of DateTime, it is initialized with MinValue&lt;br /&gt;&lt;br /&gt;When you add 1 to the integer value in the variable, you are adding 100 nanosecond&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115471489142387500?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115471489142387500/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115471489142387500' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115471489142387500'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115471489142387500'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/tips-for-datetime.html' title='Tips for DateTime'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115465109872366269</id><published>2006-08-03T17:04:00.000-07:00</published><updated>2006-08-03T17:26:06.696-07:00</updated><title type='text'>Performance quiz #7</title><content type='html'>Property vs. field, &amp; inline method&lt;br /&gt;&lt;br /&gt;What is the difference in performance between defining a public field or a public property.&lt;br /&gt;I mean by pubilc field, is a variable in a class that is defined as public.&lt;br /&gt;&lt;br /&gt;Let's compare between these two codes&lt;br /&gt;&lt;br /&gt;public class A&lt;br /&gt;{  &lt;br /&gt;   public string myData;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Or&lt;br /&gt;&lt;br /&gt;public class A&lt;br /&gt;{&lt;br /&gt;   private string _myData;&lt;br /&gt;   public string MyData&lt;br /&gt;   {&lt;br /&gt;      get&lt;br /&gt;       {&lt;br /&gt;         return _myData;&lt;br /&gt;       }&lt;br /&gt;       set&lt;br /&gt;       {&lt;br /&gt;           _myData = value;&lt;br /&gt;       }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The answer: there is no big difference between the two.&lt;br /&gt;the public field is faster, but it is a small difference in time.&lt;br /&gt;The code of the public property will be transleted by the compiler to a method call.&lt;br /&gt;&lt;br /&gt;So why there is no big difference in the perofmance.&lt;br /&gt;&lt;br /&gt;The reason is the public property was translated to a method call in the native code.&lt;br /&gt;But because the code of that method is very small, the compiler will not generate the code as a seperate method call, instead it will inject the generated code of the method inside the main body of the class.&lt;br /&gt;&lt;br /&gt;This type of method called "Inline method"&lt;br /&gt;&lt;br /&gt;Inline method are very effecient, and very fast, because they don't go through the normal cycle of other method calls by pushing the data, and the address to the stack, and move the execution pointer of the current application to the new method&lt;br /&gt;&lt;br /&gt;So, how can you program for an inline method?&lt;br /&gt;&lt;br /&gt;The compiler is the one who decide if the method will be inlined or not.&lt;br /&gt;For a method to be inline, it has to meet the following conditions:&lt;br /&gt;&lt;br /&gt;1 - Methods that are greater than 32 bytes of IL will not be inlined. &lt;br /&gt;    (it is difficult to know how many instructions in c#, because each statement in &lt;br /&gt;      c# will be translated differently in IL)&lt;br /&gt;2 - Virtual functions are not inlined. &lt;br /&gt;3 - Methods that have complex flow control will not be in-lined. &lt;br /&gt;     (Complex flow control is any flow control other than if/then/else; &lt;br /&gt;      in this case, switch or while)&lt;br /&gt;4 - Methods that contain exception-handling blocks are not inlined, though methods &lt;br /&gt;     that throw exceptions are still candidates for inlining. &lt;br /&gt;5 - If any of the method's formal arguments are structs, the method will not be inlined. &lt;br /&gt;&lt;br /&gt;If you wrote a method for a class, and the method meets the previous conditions, then the compiler will inline the method.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115465109872366269?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115465109872366269/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115465109872366269' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115465109872366269'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115465109872366269'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/performance-quiz-7.html' title='Performance quiz #7'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115450625665083999</id><published>2006-08-02T00:53:00.000-07:00</published><updated>2006-08-02T01:10:56.776-07:00</updated><title type='text'>method table and polymorphism</title><content type='html'>&lt;a href="http://techembassy.blogspot.com/2006/08/explore-clr-with-sonofstrike.html"&gt;In the previous post&lt;/a&gt;, I used the SOS to show the method table of a simple class&lt;br /&gt;&lt;br /&gt;The method table contains the addresses of the methods that the class has access to, in the following order:&lt;br /&gt;&lt;br /&gt;1 - Virtual methods from the base type(s)&lt;br /&gt;2 - Virtual methods from any interfaces &lt;br /&gt;3 - Virtual methods from the current type &lt;br /&gt;4 - Non-virtual functions of the current type&lt;br /&gt;&lt;br /&gt;and we got an example as the Type ConTest.Program has the follwoing method table&lt;br /&gt;&lt;br /&gt;79354bec 7913bd48 PreJIT System.Object.ToString()&lt;br /&gt;793539c0 7913bd50 PreJIT System.Object.Equals(System.Object)&lt;br /&gt;793539b0 7913bd68 PreJIT System.Object.GetHashCode()&lt;br /&gt;7934a4c0 7913bd70 PreJIT System.Object.Finalize()&lt;br /&gt;00913030 00912fd8 JIT ConTest.Program.Main(System.String[])&lt;br /&gt;00913040 00912fe0 NONE ConTest.Program..ctor()&lt;br /&gt;&lt;br /&gt;this is how the CLR knows on the runtime where to find the proper method&lt;br /&gt;&lt;br /&gt;OK, what about the non-virtual methods of the base type&lt;br /&gt;&lt;br /&gt;Like a good example would be the method "GetType" that is derived from System.Object&lt;br /&gt;&lt;br /&gt;System.Object.GetType(): is a sealed method, and no other type can override it&lt;br /&gt;&lt;br /&gt;how the CLR knows how to call the method without the method table?&lt;br /&gt;(notice that GetType doesn't exist in the dumped data of the method table of ConTest.Program)&lt;br /&gt;&lt;br /&gt;the answer is: the CLR doesn't need to know the address, because the compiler at the compile time can determine the "sealed" method that is used and call this method&lt;br /&gt;&lt;br /&gt;the method table is used for the virtual method that can be overrided&lt;br /&gt;&lt;br /&gt;The polymorphism is acheived by using the method table.&lt;br /&gt;&lt;br /&gt;So, why we need the sealed local methods in the method table?&lt;br /&gt;&lt;br /&gt;this is another post...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115450625665083999?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115450625665083999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115450625665083999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115450625665083999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115450625665083999'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/method-table-and-polymorphism.html' title='method table and polymorphism'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115450154579414784</id><published>2006-08-01T22:53:00.000-07:00</published><updated>2006-08-02T01:24:29.676-07:00</updated><title type='text'>Explore the class methods with SonOfStrike</title><content type='html'>In order to dive in more depth in the CLR, and how does the CLR create objects, and deal with the memory, we can use a tool that is part of the Framework SDK called SonOfStrike (SOS)&lt;br /&gt;&lt;br /&gt;SonOfStrike (SOS), is an assembly that will be loaded inside Visual Studio during debug session, and allow the developer using the debugger to enter command to discover the memory inside the CLR&lt;br /&gt;&lt;br /&gt;Using SOS is so easy, and actually is so fun to work and discover the CLR inside.&lt;br /&gt;&lt;br /&gt;I am going in the following posts, to use SOS to get lots of information about the CLR.&lt;br /&gt;&lt;br /&gt;So, Let us start a fun journey inside the CLR&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Open Visual Studio&lt;br /&gt;Create a new windows console project (C# please)&lt;br /&gt;I will call my project ConTest&lt;br /&gt;&lt;br /&gt;inside the main code write the following code&lt;br /&gt;&lt;br /&gt;class Program&lt;br /&gt;    {&lt;br /&gt;        static void Main(string[] args)&lt;br /&gt;        {&lt;br /&gt;            Console.WriteLine("Hello World!");&lt;br /&gt;            Console.Read();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;the code is so simple, it defines a class called "Program" that has a method called "Main"&lt;br /&gt;&lt;br /&gt;Now, before you run, let us change one setting to allow us to see the unmanaged code&lt;br /&gt;&lt;br /&gt;right-mouse click on the project and select properties&lt;br /&gt;and from the project properties, and on the "Debug" tab, check the checkbox "Enable unmanaged code debugging"&lt;br /&gt;&lt;br /&gt;Now build the project, and put a break point on the first line of the code, and go to : Debug, start Debugging&lt;br /&gt;&lt;br /&gt;After the debug session started, and waiting for you to start debugging, go to the immediate window&lt;br /&gt;in the immediate window enter the following command&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red"&gt;!Load SOS (or .load SOS)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;(I will always write the command in red)&lt;br /&gt;&lt;br /&gt;this will load the SOS assembly&lt;br /&gt;&lt;br /&gt;Now, we can call SOS commands&lt;br /&gt;&lt;br /&gt;All SOS commands work with the memory locations, so we have to know where are the stuff in the CLR&lt;br /&gt;&lt;br /&gt;As a first step, let's get the address of the class "Program" (which is the main class in our project)&lt;br /&gt;&lt;br /&gt;the command that give us the address is Name2EE, which translate the name to the EE address (EE stand for Execution Engine, aka the CLR)&lt;br /&gt;&lt;br /&gt;so let's start by sending the command&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;!Name2EE ConTest.exe ConTest.Program&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;the output will be similar to the following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Module: 00912c14 (ConTest.exe)&lt;br /&gt;Token: 0x02000002&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style:italic; color:blue;"&gt;MethodTable: 00912fe8&lt;br /&gt;EEClass: 0091125c&lt;/span&gt;&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Name: ConTest.Program&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The output gave us the addresses of two more entities: the Class address and the MethodTable address&lt;br /&gt;&lt;br /&gt;What is the method table?&lt;br /&gt;&lt;br /&gt;first let us discover what is the method table by finding out what inside this table&lt;br /&gt;and we will send another command: DumpMT (dump method table)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: red;"&gt;!DumpMT -md 00912fe8&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and the output will be&lt;br /&gt;&lt;br /&gt;EEClass: 0091125c&lt;br /&gt;Module: 00912c14&lt;br /&gt;Name: ConTest.Program&lt;br /&gt;mdToken: 02000002  (C:\Documents and Settings\gab\My Documents\Visual Studio 2005\Projects\ConTest\ConTest\bin\Debug\ConTest.exe)&lt;br /&gt;BaseSize: 0xc&lt;br /&gt;ComponentSize: 0x0&lt;br /&gt;Number of IFaces in IFaceMap: 0&lt;br /&gt;Slots in VTable: 6&lt;br /&gt;--------------------------------------&lt;br /&gt;MethodDesc Table&lt;br /&gt;   Entry MethodDesc      JIT Name&lt;br /&gt;79354bec   7913bd48   PreJIT System.Object.ToString()&lt;br /&gt;793539c0   7913bd50   PreJIT System.Object.Equals(System.Object)&lt;br /&gt;793539b0   7913bd68   PreJIT System.Object.GetHashCode()&lt;br /&gt;7934a4c0   7913bd70   PreJIT System.Object.Finalize()&lt;br /&gt;00913030   00912fd8      JIT ConTest.Program.Main(System.String[])&lt;br /&gt;00913040   00912fe0     NONE ConTest.Program..ctor()&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ok&lt;br /&gt;what is the method table?&lt;br /&gt;&lt;br /&gt;When the CLR create an object, it will allocate the memory in the managed heap&lt;br /&gt;The object will have the following structure&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/6130/317/1600/fig136_01_0.0.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/6130/317/320/fig136_01_0.0.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;BR&gt;&lt;br /&gt;as you can see, there is 4 bytes which are used for multithreading purpose, and there is the pointer to the method table, and then there is the data that is stored inside this class&lt;br /&gt;&lt;br /&gt;the method table is a table of pointers to the methods of this class, or the methods that this class has access to&lt;br /&gt;&lt;br /&gt;this class "Program" has one method which is Main&lt;br /&gt;the other methods are the ones that inherited from the System.Object (only the virtual methods), because "Program" as any other class in .NET is inheriting from System.Object&lt;br /&gt;As well there is the constructor for the class&lt;br /&gt;&lt;br /&gt;the addresses of the above methods are stored in the method table&lt;br /&gt;&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Virtual_method_table"&gt;Method table&lt;/a&gt; is the mechanism that allow to override or not override a method from the base class.&lt;br /&gt;&lt;br /&gt;I will describe more about it in the following post&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115450154579414784?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115450154579414784/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115450154579414784' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115450154579414784'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115450154579414784'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/explore-class-methods-with-sonofstrike.html' title='Explore the class methods with SonOfStrike'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115444299796338136</id><published>2006-08-01T07:19:00.000-07:00</published><updated>2006-08-01T07:38:59.103-07:00</updated><title type='text'>Performance quiz #5 (Corrected)</title><content type='html'>What is the difference in performance between these two classes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;code #1&lt;br /&gt;---------&lt;br /&gt;public class Foo&lt;br /&gt;{&lt;br /&gt;   public void SomeMethod();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Code #2 &lt;br /&gt;------------&lt;br /&gt;public class Foo&lt;br /&gt;{&lt;br /&gt;   public virtual void SomeMethod();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answer: The sealed method (non-virtual) is faster.&lt;br /&gt;This is correction to the previous post that compare between c# and VB&lt;br /&gt;I forgot VB, (Well, I didn't use it for 7 months) and that the default is NonOveridable, which is the same as c#, and thanks to &lt;a href="http://graysmatter.codivation.com/"&gt;Justice&lt;/a&gt; to remind me of this point&lt;br /&gt;&lt;br /&gt;Anyway the point of the quiz was built around the virtual method is slower than the sealed method&lt;br /&gt;&lt;br /&gt;The reason:&lt;br /&gt;because virtual method can be overrided, then when the CLR creates the object in the managed heap, and stores the pointers to its methods, it doesn't point to the method directly. Instead it uses &lt;a href="http://en.wikipedia.org/wiki/Virtual_table"&gt;virtual method table&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The following is a description on how the performance is effected by the virtual method table&lt;br /&gt;&lt;span style="font-style:italic;"&gt;Note that a virtual call requires at least an extra indexed dereference, and sometimes a "fixup" addition, compared to a non-virtual call, which is simply a jump to a compiled-in pointer. So, calling virtual functions is inherently slower than calling non-virtual functions. Although this is often not a factor in real-world efficiency, it can be.&lt;br /&gt;&lt;br /&gt;In addition, virtual function calls usually cannot be inlined. While a compiler could replace the lookup and indirect call with, e.g., a conditional execution of each inlined body, such optimizations are not common.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115444299796338136?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115444299796338136/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115444299796338136' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115444299796338136'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115444299796338136'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/08/performance-quiz-5-corrected.html' title='Performance quiz #5 (Corrected)'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115430878015478305</id><published>2006-07-30T18:11:00.000-07:00</published><updated>2006-07-30T18:20:33.400-07:00</updated><title type='text'>Performance quiz #6</title><content type='html'>Serializable classes&lt;br /&gt;&lt;br /&gt;Find the fatest between the follwoing two code lists:&lt;br /&gt;&lt;br /&gt;Code #1&lt;br /&gt;------------&lt;br /&gt;[Serializable()]&lt;br /&gt;public class Foo&lt;br /&gt;{&lt;br /&gt;   private string _property1;&lt;br /&gt;   public string Property1&lt;br /&gt;   {&lt;br /&gt;     get { return _property1;}&lt;br /&gt;     set { _property1 = value;}&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;code #2&lt;br /&gt;---------&lt;br /&gt;[Serializable()]&lt;br /&gt;public class Foo&lt;br /&gt;{&lt;br /&gt;   private string _property1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Answer:&lt;br /&gt;Code #2 is faster, cause when the class is serialized, all its public properties will be serialized, though there is more to work on code #1, than code #2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Conclusion:&lt;br /&gt;Don't define public properties, if you don't need them.&lt;br /&gt;This rule is a good rule for OOP as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115430878015478305?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115430878015478305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115430878015478305' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115430878015478305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115430878015478305'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/performance-quiz-6.html' title='Performance quiz #6'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115430133359904120</id><published>2006-07-30T16:15:00.000-07:00</published><updated>2006-07-31T12:34:09.210-07:00</updated><title type='text'>Performance quiz #5</title><content type='html'>VB.NET Vs. C#&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Update:&lt;br /&gt;I was wrong in this point.&lt;br /&gt;By default VB will be NonOveridable.&lt;br /&gt;which means they both have the same performance.&lt;br /&gt;So, I updated the post...&lt;br /&gt;----------------------------------&lt;br /&gt;&lt;br /&gt;What is the difference in performance between VB.NET and C#&lt;br /&gt;Let us define a class Foo which has a method called SomeMethod&lt;br /&gt;&lt;br /&gt;C# code&lt;br /&gt;---------&lt;br /&gt;&lt;br /&gt;public class Foo&lt;br /&gt;{&lt;br /&gt;   public void SomeMethod();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;VB.NET code&lt;br /&gt;------------&lt;br /&gt;Public Class Foo&lt;br /&gt;&lt;br /&gt;    Pubic Sub SomeMethod()&lt;br /&gt;    End Sub&lt;br /&gt;End Class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Question: what the difference in the performance between the two?&lt;br /&gt;&lt;br /&gt;Answer: Both have the same performance..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115430133359904120?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115430133359904120/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115430133359904120' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115430133359904120'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115430133359904120'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/performance-quiz-5.html' title='Performance quiz #5'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115430023888799756</id><published>2006-07-30T15:43:00.000-07:00</published><updated>2006-07-30T15:57:19.160-07:00</updated><title type='text'>Performance quiz #4</title><content type='html'>Single assembly Vs. Multiple assemblies&lt;br /&gt;&lt;br /&gt;If you have an application that has three tiers (UI, BLL, and DAL), and every access to the application will requires access to the tree tiers.&lt;br /&gt;Which is faster to have the code in one large assembly, or in different assemblies&lt;br /&gt;&lt;br /&gt;The answer is: One large assembly is faster to load than multi-smaller assemblies&lt;br /&gt;&lt;br /&gt;The reason is:&lt;br /&gt;Loading an assembly requires:&lt;br /&gt;1 - Load the metadata, where instead of loading once for one file, we load many metadata.&lt;br /&gt;2 - Security Check, where every assembly load requires a check that the user and the code has the right to access this assembly.&lt;br /&gt;3 - Native code generated:&lt;br /&gt;Loading an assembly will trigger ngen.exe to compile the IL code to native code and load the generated native code in memory.&lt;br /&gt;Every assembly will be stored in one or more memory pages, depending on the size of the assembly&lt;br /&gt;one large assembly will be better laid out in fewer pages and more densely than smaller assemblies.&lt;br /&gt;As well JIT compile time will be reduced for one assembly than for many assemblies&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="http://www.microsoft.com/products/info/product.aspx?view=22&amp;pcid=8a7bbc4a-7906-40c0-9c98-7caba7526593&amp;type=ovr"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115430023888799756?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115430023888799756/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115430023888799756' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115430023888799756'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115430023888799756'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/performance-quiz-4.html' title='Performance quiz #4'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115417911408545900</id><published>2006-07-29T06:04:00.000-07:00</published><updated>2006-07-29T09:19:27.286-07:00</updated><title type='text'>Performance quiz #3</title><content type='html'>Passing by value and by reference&lt;br /&gt;&lt;br /&gt;Let us suppose that we have a method "ManipulateDate", that will get a parameter of DateTime&lt;br /&gt;&lt;br /&gt;What is the difference in performance between passing the datetime as value, or as reference&lt;br /&gt;&lt;br /&gt;Code #1&lt;br /&gt;---------------&lt;br /&gt;public void ManipulateDate(DateTime myDate)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;code #2&lt;br /&gt;---------------&lt;br /&gt;public void ManipulateDate(ref DateTime myDate)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The answer:&lt;br /&gt;For DateTime, passing by reference is faster than passing by value&lt;br /&gt;&lt;br /&gt;The reason:&lt;br /&gt;When you call a method and pass parameters, three things will happen:&lt;br /&gt;1 - The parameters will be copied to the stack&lt;br /&gt;2 - the stack pointer will have the new location to the copied data.&lt;br /&gt;3 - the execution of the program will start from the code of this specified method&lt;br /&gt;&lt;br /&gt;All the value type parameters will be copied by copying the data itself, where for the reference type variables, the parameter will contain the address of the variable in the memory&lt;br /&gt;&lt;br /&gt;The address is 4 bytes size, so each reference type parameter requires copying 4 bytes of data.&lt;br /&gt;Though, any value type that has size more than 4 bytes, would be faster to pass it as reference than pass it by value.&lt;br /&gt;&lt;br /&gt;Passing by reference will effect the variable value, if the value was modified inside the sub-procedure.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115417911408545900?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115417911408545900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115417911408545900' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115417911408545900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115417911408545900'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/performance-quiz-3.html' title='Performance quiz #3'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115417791378977123</id><published>2006-07-29T05:26:00.000-07:00</published><updated>2006-07-29T05:58:33.863-07:00</updated><title type='text'>Performance quiz #2</title><content type='html'>Struct Vs. Class&lt;br /&gt;What is the difference in performance between struct and a class&lt;br /&gt;Let us suppose that we want to define an entity "Point" that has two variables&lt;br /&gt;and let us define it using struct and class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;public struct Point &lt;br /&gt;{&lt;br /&gt;   public int x, y;&lt;br /&gt;&lt;br /&gt;   public Point(int p1, int p2) &lt;br /&gt;   {&lt;br /&gt;      x = p1;&lt;br /&gt;      y = p2;    &lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;-----------------------&lt;br /&gt;public class Point&lt;br /&gt;{&lt;br /&gt;   private int x, y;&lt;br /&gt;   public int X { get{ return x;}.....&lt;br /&gt;   public int Y { get{................&lt;br /&gt;   public Point (int xPar, int yPar)&lt;br /&gt;   {&lt;br /&gt;     x = xPar;&lt;br /&gt;     y = yPar;&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The answer is:&lt;br /&gt;The struct is a value type, and the class is a reference type&lt;br /&gt;Allocating and deallocating value types is way faster, cheaper, and cleaner than allocating/deallocating reference types&lt;br /&gt;&lt;br /&gt;If you are interested to know more then continue with the following explanation.&lt;br /&gt;&lt;br /&gt;When you define a new variable, the CLR will try to allocate somewhere in the memory for that variable&lt;br /&gt;Where that variable is stored, depends on the type of variable, is it value type of a reference type.&lt;br /&gt;&lt;br /&gt;All local declared variables and parameters are stored in the stack, which is the memory that is accessed by the code.&lt;br /&gt;The value types are stored as data inside the stack, where for the reference type, the data is stored somewhere else, and the stack contains only the address of the date in the memory&lt;br /&gt;These reference type variables exist in somewhere else in the memory called the "Managed heap".&lt;br /&gt;&lt;br /&gt;Creating a new value type variable will requires only copy this value inside the stack.&lt;br /&gt;creating a new reference type variable will allocate some memory in the managed heap, and get the address, and store it into the stack, so we have pointer to that object.&lt;br /&gt;&lt;br /&gt;When the program finish execute, the stack will be released, though releasing all the data and variables that are stored there&lt;br /&gt;Though you don't need to clean after value types variables because they are gone when the program exit.&lt;br /&gt;But it is different story for the managed heap, where it is not cleaned after the code exit.&lt;br /&gt;.NET solves this problem by introducing the garbage collector&lt;br /&gt;&lt;br /&gt;This was the reason why allocating/deallocating value type is cheaper and cleaner than reference type.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115417791378977123?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115417791378977123/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115417791378977123' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115417791378977123'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115417791378977123'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/performance-quiz-2.html' title='Performance quiz #2'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115412808600287538</id><published>2006-07-28T15:41:00.000-07:00</published><updated>2006-07-29T05:26:37.316-07:00</updated><title type='text'>Performance quiz #1</title><content type='html'>I want to continue the subject of the data types, in more depth.&lt;br /&gt;Specially how the CLR deals with different data types.&lt;br /&gt;And I thought writing some quizzes will be a nice way to present such a tedious subject, and make it an interesting subject.&lt;br /&gt;&lt;br /&gt;Quiz #1: (Arrays)&lt;br /&gt;&lt;br /&gt;What the difference in performance between these three pieces of code&lt;br /&gt;&lt;br /&gt;Code #1&lt;br /&gt;-------------------------------------------&lt;br /&gt;Int32[] SomeArray = new Int32[10] {0,1,2,3,4,5,6,7,8,9};&lt;br /&gt;&lt;br /&gt;for (Int32 i=0; I &lt; SomeArray.Length; i++)&lt;br /&gt;{&lt;br /&gt;    DoManipulateNumber(SomeArray[i]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;-------------------------------------------&lt;br /&gt;Code #2&lt;br /&gt;Int32[] SomeArray = new Int32[10] {0,1,2,3,4,5,6,7,8,9};&lt;br /&gt;Int32 ArrayLength = SomeArray.Length;&lt;br /&gt;for (Int32 i=0; I &lt; ArrayLength; i++)&lt;br /&gt;{&lt;br /&gt;    DoManipulateNumber(SomeArray[i]);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Code #3&lt;br /&gt;-------------------------------------------&lt;br /&gt;Int32[] SomeArray = new Int32[10] {0,1,2,3,4,5,6,7,8,9};&lt;br /&gt;IEnumerator ArrayEnum = SomeArray.GetEnumerator();&lt;br /&gt;while (ArrayEnum.MoveNext())&lt;br /&gt;{&lt;br /&gt;    DoManipulateNumber(ArrayEnum.Current);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The Answer is: &lt;br /&gt;In .NET version 1.1,  #1 is the fastest, and #3 is the slowest&lt;br /&gt;In .NET version 2.0, both #1, and #3 are faster than #2&lt;br /&gt;&lt;br /&gt;In .NET version 1.1, using the enumeration is still expensive, but in version 2.0, lots of enhancements have been done to improve the enumeration, and hence the code snippet #3 is as fast as #1&lt;br /&gt;&lt;br /&gt;but why #1 is faster the #2?&lt;br /&gt;&lt;br /&gt;I did mentioned this before&lt;br /&gt;Becaus .NET code is a managed code, so the language compiler, and the JIT compiler will generate code for every time you access the array, to make sure that you are not going beyond the array&lt;br /&gt;But in Code#1, the C# compiler is smart enough to know that the loop that check for the array length won't go beyong the array boundaries, so it eliminate this auto-generated code, but in code #2, the C# compiler has no way to know that we are comparing for the array boundary, so it add this auto-generated code&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115412808600287538?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115412808600287538/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115412808600287538' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115412808600287538'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115412808600287538'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/performance-quiz-1.html' title='Performance quiz #1'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115354380210967346</id><published>2006-07-21T21:48:00.000-07:00</published><updated>2006-07-21T21:59:01.723-07:00</updated><title type='text'>Data Types: Single, Double and Decimal</title><content type='html'>In this post, I am going to cover the single (or float in c#), double and decimal.&lt;br /&gt;Representing real numbers in binary format was always a tricky issue in any programming language, and in any system.&lt;br /&gt;Because we shift from decimal representation to binary, then lots of real numbers don't have equivalent in the binary representation.&lt;br /&gt;The solution is to get the closet number.&lt;br /&gt;&lt;br /&gt;Most programming languages use two ways to represent numbers with decimal points&lt;br /&gt;&lt;br /&gt;1 - fixed-point formats&lt;br /&gt;2 - floating point formats&lt;br /&gt;&lt;br /&gt;The fixed point format stores this number as integer and has a fixed scale factor of 10&lt;sup&gt;-n&lt;/sup&gt; , to represent the part after the decimal point.&lt;br /&gt;As an example, the Money type in SQL Server uses fixed-point format, and it always consider the contained number to have 4 digits after the decimal point.&lt;br /&gt;so for example the number: 123.5678 will be stored as 1235678, and the number 123.45 will be stored as 1234500.&lt;br /&gt;&lt;br /&gt;The floating point format, is different that its scale factor is variant (that is why it is called float).&lt;br /&gt;so storing a number requires two part, the number without the decimal point (also called the significant) and the scale factor (also called the exponent)&lt;br /&gt;&lt;br /&gt;As I mentioned, lots of decimal numbers or (base-10) numbers don't have equals in the binary, so an error exists when representing an 10-base number in the binary, and this error is called round-up error.&lt;br /&gt; &lt;br /&gt;The big problem is the arithmetic operations on numbers with errors will introduce further errors.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In .NET I will discuss the single, double, and decimal and what is the differences between them&lt;br /&gt;&lt;br /&gt;Let's try the following:&lt;br /&gt;&lt;I&gt;&lt;br /&gt;Console.WriteLine(((float)(1/3.0F))*3);&lt;br /&gt;Console.WriteLine((((float)(1/3.0F))*3) &gt; 1);&lt;br /&gt;Console.WriteLine((((float)(1/3.0F))*3) == 1);&lt;/I&gt;&lt;br /&gt;&lt;br /&gt;the output of the previous code will be&lt;br /&gt;&lt;I&gt;&lt;B&gt;&lt;br /&gt;1&lt;br /&gt;true&lt;br /&gt;false&lt;br /&gt;&lt;/B&gt;&lt;/I&gt;&lt;br /&gt;and let's try this with double&lt;br /&gt;&lt;I&gt;&lt;br /&gt;console(((double)(1/107.0))*107.0);&lt;br /&gt;Console.WriteLine((((double)(1/107.0))*107.0) &lt; 1);&lt;br /&gt;Console.WriteLine((((double)(1/107.0))*107.0) == 1);&lt;br /&gt;&lt;/I&gt;&lt;br /&gt;the output will be:&lt;br /&gt;&lt;I&gt;&lt;B&gt;&lt;br /&gt;1&lt;br /&gt;true&lt;br /&gt;false&lt;br /&gt;&lt;/B&gt;&lt;/I&gt;&lt;br /&gt;now try the same with decimal&lt;br /&gt;&lt;I&gt;&lt;br /&gt;Console.WriteLine (((decimal) 1/3) * 3);&lt;br /&gt;&lt;/I&gt;&lt;br /&gt;the output will be : &lt;br /&gt;&lt;I&gt;&lt;B&gt;&lt;br /&gt;0.9999999999999&lt;br /&gt;&lt;/B&gt;&lt;/I&gt;&lt;br /&gt;&lt;br /&gt;What the hell is going on?&lt;br /&gt;Let's see how .NET stores the real numbers.&lt;br /&gt;All the types, single, double and decimal are floating-point format, and they all store the number in three part&lt;br /&gt;1 - the signal (positive or negative)&lt;br /&gt;2 - the significant&lt;br /&gt;3 - the exponent&lt;br /&gt;&lt;br /&gt;Let us start by single&lt;br /&gt;Single stores all the three parts in 32 bits&lt;br /&gt;the signal is one bit, the exponent is 8 bits, and the significant 23 bits&lt;br /&gt;&lt;br /&gt;the double is very similar to the single but with more space to store data, so it has more precision:&lt;br /&gt;the double will have 64 bits.&lt;br /&gt;the signal one bit, the exponent is 11 bits and the significant is 52 bits&lt;br /&gt;&lt;br /&gt;both double and single store the number in base 2 format, and that provide good performance&lt;br /&gt;&lt;br /&gt;so what about the decimal&lt;br /&gt;&lt;br /&gt;the decimal store the number is base 10 format&lt;br /&gt;it has as well three components: the sign, the exponent, and the significant&lt;br /&gt;the decimal will has 128 bits&lt;br /&gt;one for the signal, 5 for the exponent, and 122 for the significant&lt;br /&gt;&lt;br /&gt;Because the decimal is base-10 number, it is way slower than the double or single, but it represent more the real life numbers&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115354380210967346?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115354380210967346/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115354380210967346' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115354380210967346'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115354380210967346'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/data-types-single-double-and-decimal.html' title='Data Types: Single, Double and Decimal'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115347748259146121</id><published>2006-07-20T19:26:00.000-07:00</published><updated>2006-07-21T03:24:42.676-07:00</updated><title type='text'>Data Types: More about Collections</title><content type='html'>Tips for best performance:&lt;br /&gt;&lt;br /&gt;1 - If you care about performance then try to use strong type collections instead of ArrayList&lt;br /&gt;strong type collections will avoid using the boxing/unboxing processes that is associated with the ArrayList which help the performance.&lt;br /&gt;&lt;br /&gt;2 - Array Initialization&lt;br /&gt;To initialize an array with values there are two ways&lt;br /&gt;    A- in the decleration part like:&lt;br /&gt;           Int32[] myArray = new Int32[5] {1,2,3,4,5};&lt;br /&gt;    B- by initializing every element in the array alone like:&lt;br /&gt;           Int32[] myArray = new Int32[5];&lt;br /&gt;           myArray[0] = 1;&lt;br /&gt;           myArray[1] = 2;&lt;br /&gt;           .....&lt;br /&gt;&lt;br /&gt;    The first code is cleaner, and gives better performance if it is in C#&lt;br /&gt;    when you compile the code in c# it will copy the values inside the heap header of the assembly and it does a copy memory during runtime.&lt;br /&gt;    &lt;br /&gt;    but if the code was in VB.NET then the compiler will generate a seperate assignment for every element, exactly like the option B&lt;br /&gt;&lt;br /&gt;3 - avoid allocating large arrays for temporary use&lt;br /&gt;One of the worst performance hit for .NET is to allocate large chunk of data, or any data that is larger than 85K.&lt;br /&gt;CLR won't store this data inside the field of a class. Instead, the CLR will store it inside a special memory location in the heap, and this location won't be cleared by the garbage collector as the same as the other part of the memory.&lt;br /&gt;In general, avoid storing temporary data that is larger than 85K.&lt;br /&gt;I am going to cover this issue in another post.&lt;br /&gt;&lt;br /&gt;4 - Pre-allocating the ArrayList:&lt;br /&gt;even ArrayList, or any other CollectionBase class have a dynamic size, but that comes with cost.&lt;br /&gt;When you add an item to the list, and the list was full, the CLR will expand the size to be twice the current size, and that is better approach than adding one small space every time.&lt;br /&gt;But allocating the whole amount of memory for the first time can boost the performance to 3 times for creating and accessing the ArrayList items later.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115347748259146121?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115347748259146121/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115347748259146121' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115347748259146121'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115347748259146121'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/data-types-more-about-collections.html' title='Data Types: More about Collections'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115344017604991015</id><published>2006-07-20T16:05:00.000-07:00</published><updated>2006-07-20T17:02:56.130-07:00</updated><title type='text'>Data Types: Arrays and collections</title><content type='html'>System.Array is the base class for all types of collections in .NET.&lt;br /&gt;All classes that are defined in System.Collections.x are inheriting from System.Array.&lt;br /&gt;When you define an array that use value type like : Int32[] abc, then the compiler will create an object that inherits from the System.Array.&lt;br /&gt;&lt;br /&gt;in .NET there are two types of arrays:&lt;br /&gt;1 - the simple array, which is a single dimension, zero-based array, where the lower bound index is always zero, also called SZArray.&lt;br /&gt;2 - the multi-dimensional, non-zero based array, where you can have the lower bound index to be any number, we will refere to it as MDArray.&lt;br /&gt;&lt;br /&gt;you can define the SZArray by simply define any variable of type array with one dimention&lt;br /&gt;for example : Int32[] intArrayVariable.&lt;br /&gt;You define a MDArray whenever you define two, or more dimensions arrar, or define an array with a specified lower-bound index using the static method Array.CreateInstance&lt;br /&gt;&lt;br /&gt;CLR is optimized to use the SZArray, and the performance is way higher that the MDArray.&lt;br /&gt;As well many programming languges -specially C#- will optimize the compiled code to eliminate any performance consuming process when you use the SZArray&lt;br /&gt;&lt;br /&gt;For example in the following code:&lt;br /&gt;&lt;br /&gt;int [] arr = new Int32[5] {1 , 2, 3, 4, 5};&lt;br /&gt;for (int ix = 0; ix &lt; arr.Length; ++ix){&lt;br /&gt; //use arr[ix]&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;The CLR as a managed environment for a safe code, will run a index check for any code that use the array, to make sure that the code doesn't access the memory outside that array boundaries&lt;br /&gt;The check is run for every access to the array, which means in the previous code in every single statement inside the loop.&lt;br /&gt;This process of boundary checking will effect the performance.&lt;br /&gt;But C# compiler is smart enough to know that the previous code won't access any memory outside the boundary of the array, because we are checking the end of the array, so the compiler will eliminates the IL code that usually is generated to check the boundary.&lt;br /&gt;Some of this performance boots are not available in the compilers of other languages.&lt;br /&gt;&lt;br /&gt;When you need to define two dimensions array, it is way better to define the array as an array of array rather than two dimensions array, because the array of array is a SZArray of SZArrays, so the performance will be way better&lt;br /&gt;&lt;br /&gt;for example the following code will define two dimension array&lt;br /&gt;&lt;br /&gt;Int32[,] twoDimensionArray = new Int32[5,5];&lt;br /&gt;&lt;br /&gt;where the following code will define a Jagged array (an array of arrays)&lt;br /&gt;&lt;br /&gt;Int32[][] jaggedArray = new Int32[5][5];&lt;br /&gt;&lt;br /&gt;Collections:&lt;br /&gt;&lt;br /&gt;System.Collections and System.Collections.Specialized contains many tailored arrays.&lt;br /&gt;It is worth it to read through all types that are defined in these two namespaces.&lt;br /&gt;Try to use the class that match your requirements, and that because it contains all the special methods that your require and as well these methods are optimized for performance.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115344017604991015?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115344017604991015/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115344017604991015' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115344017604991015'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115344017604991015'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/data-types-arrays-and-collections.html' title='Data Types: Arrays and collections'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115311799546754167</id><published>2006-07-16T22:49:00.000-07:00</published><updated>2006-07-16T23:33:15.556-07:00</updated><title type='text'>Data types part II: Reference type, Value type and Boxing</title><content type='html'>The Common Type System (CTS) supports two categories of types, the value types, and reference type.&lt;br /&gt;The value type directly contains its data, where a reference type contains a reference to the actual value's memory address.&lt;br /&gt;&lt;br /&gt;Every class defined in the code is inheriting from System.Object, and it is a reference type. The instance of that class stores the memory's location of that instance's data.&lt;br /&gt;&lt;br /&gt;The value types are simpler, and the instance of a value types is storing the actual data. Usually the built-in value types are the primitive data types like Integer, Boolean, Double, ...Etc&lt;br /&gt;Programmers can define more complex value types using Structures&lt;br /&gt;&lt;br /&gt;Value types don't contain any method, or event, or whatever related to any class&lt;br /&gt;&lt;br /&gt;But how we can call method from a value type?&lt;br /&gt;How can we call ToString() method from any integer variable?&lt;br /&gt;&lt;br /&gt;The answer related to a process called Boxing&lt;br /&gt;&lt;br /&gt;When you call ToString() method for an integer (Int32), the CLR will create an object that corresponds to the Int32, in a process called Boxing&lt;br /&gt;The Boxing create an object that wraps the data, and inherits from System.Object, so you can call any method of System.Object on the value type variable.&lt;br /&gt;&lt;br /&gt;Even Boxing will create an object that is different from its base value type, but calling the GetType() method that is iherited from System.Object will result of displaying the value type&lt;br /&gt;&lt;br /&gt;for example the follwoing code&lt;br /&gt;public static void Main()&lt;br /&gt;{&lt;br /&gt;int i = 12;&lt;br /&gt;Object o = (Object)i;&lt;br /&gt;&lt;br /&gt;Console.WriteLine(i.GetType());&lt;br /&gt;Console.WriteLine(i.GetType().BaseType);&lt;br /&gt;Console.WriteLine(i.GetType().GetHashCode());&lt;br /&gt;Console.WriteLine(o.GetType());&lt;br /&gt;Console.WriteLine(0.GetType().BaseType);&lt;br /&gt;Console.WriteLine(o.GetType().GetHashCode());&lt;br /&gt;Console.WriteLine(i.GetType() == o.GetType());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Its output is:&lt;br /&gt;&lt;br /&gt;System.Int32&lt;br /&gt;System.ValueType&lt;br /&gt;113273860&lt;br /&gt;System.Int32&lt;br /&gt;System.ValueType&lt;br /&gt;113273860&lt;br /&gt;&lt;br /&gt;calling .GetType() will run an implicit boxing process, and casting the variable i to an object is an explicit boxing&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115311799546754167?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115311799546754167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115311799546754167' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115311799546754167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115311799546754167'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/data-types-part-ii-reference-type.html' title='Data types part II: Reference type, Value type and Boxing'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115277207260476051</id><published>2006-07-12T23:27:00.000-07:00</published><updated>2006-07-13T08:57:05.853-07:00</updated><title type='text'>In depth: the CLR Data types: Part I</title><content type='html'>Finding about the Decimal and Double, alerted me to the fact that there could be more to discover in depth about the .NET data types.&lt;br /&gt;In the few coming posts I am going to dive in depth of the CLR and the data types.&lt;br /&gt;I am going to cover why each data type used, performance tips, and more.&lt;br /&gt;&lt;br /&gt;I searched the web in many web sites for these tips, and tried to collect as much information as I can. &lt;br /&gt;At the end of each post I am going to list my resources.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In part I, I am going to cover the System.String object.&lt;br /&gt;&lt;br /&gt;1 - why System.String is sealed?&lt;br /&gt;2 - comparing strings: what the best method to use&lt;br /&gt;3 - the string is immutable type, what does that mean?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 - Why System.String is sealed?&lt;br /&gt;The String object provides many methods that handle and manage the value inside the string. Some of these methods are optimized for speed, and a huge amount of the String's functionality is implemented using unmanaged code.&lt;br /&gt;That will raise a security issue, because the string is implemented with unmanaged code, then injecting a derived type of the string could give hackers a direct access to the memory.&lt;br /&gt;That is why the CLR designers didn't want anybody to alter the behavior of the String functionality, otherwise it would give the hacker a way inside the buffer and direct memory access inside the CLR.&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="http://www.amazon.ca/gp/product/1590591410/702-7500355-0126444?v=glance&amp;n=916520&amp;v=glance"&gt;Maximizing .NET performance&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2 - comparing strings: what the best method to use?&lt;br /&gt;there are four ways to compare two strings&lt;br /&gt;lets assume we have two variables&lt;br /&gt;String s1 = "a";&lt;br /&gt;String s2 = "b";&lt;br /&gt;&lt;br /&gt;the four ways to compare these two strings are&lt;br /&gt;&lt;br /&gt;   1 - the comparision operator: &lt;br /&gt;      s1 == s2 in c#&lt;br /&gt;      s1 = s2 in VB&lt;br /&gt;&lt;br /&gt;   2 - the Equals static method of the string object&lt;br /&gt;     String.Equals(s1, s2);&lt;br /&gt;&lt;br /&gt;   3 - the method Equals of the string object which overrides the Equals method of the System.Object&lt;br /&gt;    s1.Equals(s2);&lt;br /&gt;&lt;br /&gt;   4 - the static method Compare of the String object&lt;br /&gt;        String.Compare (st, s2, ...);&lt;br /&gt;&lt;br /&gt;so which one to use?&lt;br /&gt;The first three methods are binary comparision, where the last one is cultural-aware comparision which take care of cultural differences, and case-insensitive.&lt;br /&gt;&lt;br /&gt;The static method Equals of the String object is strong typed, and it accept only string type as arguments&lt;br /&gt;The static method Equals run first a type check, and then null check and then run the binary equality.&lt;br /&gt;&lt;br /&gt;the Equals method of the string object is an override version of the Equals method of the System.Object&lt;br /&gt;And here is the formula about the performance&lt;br /&gt;if the two variables are string and both of them are not null then both Equals (the static, and the non-static methods) have the same speed&lt;br /&gt;but if one of the above conditions is not true then the Static Equals is faster, because it detemine the equality before doing binary check&lt;br /&gt;So, the static Equals is always faster or the same speed as the non-static Equals&lt;br /&gt;In other word, alawys use the static method&lt;br /&gt;&lt;br /&gt;but what about the comparision operator?&lt;br /&gt;this part is funny&lt;br /&gt;in C#, the comparision operator will be compiled to call the Static Equals, so it is as fast as the static Equals&lt;br /&gt;but in VB is different&lt;br /&gt;Because of the backward compatibility with "Option Compare" in VB, the comparision operator is slower than the static Equals&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3 - the string is immutable type, what does that mean?&lt;br /&gt;&lt;a href="http://blah.winsmarts.com//Post.aspx?postID=45"&gt;there is a wonderful post by Sahil Malik &lt;/a&gt;who talks about this specific issue, so I am not going to add any more after Sahil&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115277207260476051?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115277207260476051/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115277207260476051' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115277207260476051'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115277207260476051'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/in-depth-clr-data-types-part-i.html' title='In depth: the CLR Data types: Part I'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115271958805930578</id><published>2006-07-12T08:27:00.000-07:00</published><updated>2006-07-12T08:53:08.143-07:00</updated><title type='text'>Decimal, double and float, and SqlMoney</title><content type='html'>What is the difference between Decimal, Double and Float in .NET framework?&lt;br /&gt;&lt;br /&gt;Float can represent numbers as large as 10&lt;sup&gt;38&lt;/sup&gt;, with accuracy of about 7 digits&lt;br /&gt;&lt;br /&gt;Double is larger, and it can represent numbers up to 10&lt;sup&gt;308&lt;/sup&gt;&lt;br /&gt;&lt;br /&gt;But, if you need precise accuracy, with no round-off numbers at all, then use Decimal, because both Float and Double have the round-off problems of representing the float numbers in binary&lt;br /&gt;&lt;a href="http://www.codeproject.com/dotnet/ExtremeFloatingPoint1.asp"&gt;This is a nice article&lt;/a&gt; about the problem of floating numbers in general, and what .NET approach to solve the problem&lt;br /&gt;&lt;br /&gt;Why I am talking about this?&lt;br /&gt;&lt;br /&gt;Because, I have been working on a financial package for the last 6 months&lt;br /&gt;I had no financial experience before, but I knew about the problem of round-off of cents.&lt;br /&gt;&lt;br /&gt;In finance, the round-off of a cent is a problem in every system&lt;br /&gt;You have to pay attention to how to round-off the money to cents, because these round-off with high quantity and accumulating with the time, could mean significant amount of money&lt;br /&gt;&lt;br /&gt;So in financial packages, the rule of thumb is:&lt;br /&gt;1- in database always use Money datatype (in Sql Server) to store the money&lt;br /&gt;2- in .NET code use Decimal to represent the data&lt;br /&gt;when you read data from SqlServer, using .NET Sql adapter, the Money will be translated to Decimal&lt;br /&gt;If you use SqlDataReader, or you use dataset, both will get the Money type of SqlServer as .NET’s Decimal, or you can get them as SQLType.SqlMoney (which is internally represented as decimal)&lt;br /&gt;&lt;br /&gt;In the package that I am working on, which I inherited from somebody who was supposed to have a pervious experience in accounting, all the money values are represented as Double, which is wrong&lt;br /&gt;And the funny thing that we use SqlDataReader to read the Money, and it is translated to Decimal, and we convert it to Double&lt;br /&gt;&lt;br /&gt;So I spent the last day to convert every single f*%$ Double in the DAL, BLL to Decimal&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115271958805930578?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115271958805930578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115271958805930578' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115271958805930578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115271958805930578'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/07/decimal-double-and-float-and-sqlmoney.html' title='Decimal, double and float, and SqlMoney'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115143760702833744</id><published>2006-06-27T11:56:00.000-07:00</published><updated>2006-06-27T12:46:47.110-07:00</updated><title type='text'>A look back, Part I</title><content type='html'>In my work we are at the end of our project.&lt;br /&gt;I like to put the things that I learned from this project, and what things that has changed in the way I work.&lt;br /&gt;&lt;br /&gt;There are two major things that I learned from this project:&lt;br /&gt;1 - How to be more productive.&lt;br /&gt;2 - How to be a positive factor in any future project.&lt;br /&gt;&lt;br /&gt;I am going to talk today about the productive part, leaving the second part to another post.&lt;br /&gt;&lt;br /&gt;Being productive is not an easy job. You need the proper environment, the proper tools, and the personal attitude to do that.&lt;br /&gt;In my current work, I was lucky I had the first two, the environment and the tools&lt;br /&gt;&lt;br /&gt;The new thing for me, in this project was the awesome business analysis, and requirements that we have.&lt;br /&gt;The Business Analyst, did a great job (at least from my perspective), of writing the requirement is Use Cases.&lt;br /&gt;This was the first time for me to read professional use cases, done by a professional business analyst.&lt;br /&gt;Combining the requirements with great tools is a good arsenal.&lt;br /&gt;&lt;br /&gt;The tools that we were using were extraordinary&lt;br /&gt;We use Rational tools, and we use the complete set of the tools&lt;br /&gt;Let me describe what I can do with the software&lt;br /&gt;With opening a Use Case, I can read what is required of this case.&lt;br /&gt;The use case is related to other documents, like Business Rules, Dictionary, UI Specifications...&lt;br /&gt;on the use case documents there are links to show the related business rules, and the terms, and UI specifications&lt;br /&gt;There is a command to print all the related items to the current use case, so I can have paper documents of all things that are related to my use case&lt;br /&gt;&lt;br /&gt;Second tool is time tracking or "work order".&lt;br /&gt;I open a "Work Order" tool called Clear Quest from Rational tools, and I find the items that are assigned to me&lt;br /&gt;and let's say that there is a Use case that is assigned to me&lt;br /&gt;When I open Visual Studio, and if I want to check out an item, or add new porject, and I want to relate this project to the source control from Rational, then I have to assign this process with a work item that is assigned to me&lt;br /&gt;&lt;br /&gt;in this way, I can keep track of my time&lt;br /&gt;before I start working, I put estimated time of this work item, and after I check in, and close the item, I can get the real time of development&lt;br /&gt;&lt;br /&gt;in my working team, the project manager usually devides each use case to 3 working items: the UI, the Data Layer, and the Business Layer&lt;br /&gt;of course these work items, can be changed&lt;br /&gt;&lt;br /&gt;after I finish the use case, I assign it to a tester.&lt;br /&gt;the tester will read through the documentation, and test it thoroughly&lt;br /&gt;when he/she finds bug, it will be assigned back to me as "Defect"&lt;br /&gt;and again, when I want to modify the code, I have to check out, and I have to assign a work item which is the defect in this case, and continue as before&lt;br /&gt;&lt;br /&gt;at the end of the day, I can compare my estimation time, with the real time.&lt;br /&gt;I get from the system, when I did check out the first item under this work item, and when I did transfer this item to the test.&lt;br /&gt;Usually we estimate the use case items (each tier) by days and the defects by hours.&lt;br /&gt;&lt;br /&gt;I really like working with such tools, and I don't like to work without them anymore&lt;br /&gt;&lt;br /&gt;Just for comparison with the other Work Order system that I used before&lt;br /&gt;I tried before different work order systems, and I really hated them all. Event I hated the process of logging my time.&lt;br /&gt;&lt;br /&gt;A big change with the tools that I am having now.&lt;br /&gt;Big change between moving from hating the tools and the process itself, to loving the tool and don't imagine yourself working without it.&lt;br /&gt;&lt;br /&gt;The proper tool is a big difference.&lt;br /&gt;&lt;br /&gt;The second factor beside the tools, is the environment&lt;br /&gt;The work here is so schedule oriented&lt;br /&gt;You have to finish on schedule, and many times sacrificing quality&lt;br /&gt;Even it is bad because you have to do lots of shortcuts in the code, but surprisingly it will teach better schedule orientation, and better time management&lt;br /&gt;I got to know what items, I don't estimated well, and I worked on improving them&lt;br /&gt;&lt;br /&gt;For example, I found my self always short on UI, and always underestimate the UI work&lt;br /&gt;I worked on finding better and faster ways to manage my UI to be done.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115143760702833744?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115143760702833744/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115143760702833744' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115143760702833744'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115143760702833744'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/06/look-back-part-i.html' title='A look back, Part I'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115103874048700029</id><published>2006-06-22T21:39:00.000-07:00</published><updated>2006-06-22T21:59:00.696-07:00</updated><title type='text'>Thread pool development</title><content type='html'>from my previous post, I talked about implementing my own simplified thread pool.&lt;br /&gt;I tried to find other implementations for background processing, and actually there are plenty of them.&lt;br /&gt;&lt;br /&gt;I found many implementations of thread poolings.&lt;br /&gt;The developers share the opinion that the default thread pooling of the CLR is not effecient.&lt;br /&gt;&lt;br /&gt;There is the famous &lt;a href="http://www.gotdotnet.com/Community/UserSamples/Details.aspx?SampleGuid=bf59c98e-d708-4f8e-9795-8bae1825c3b6"&gt;Stephan Toub's Thread pool&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and there another thread pool by &lt;a href="http://www.codeproject.com/csharp/SmartThreadPool.asp"&gt;Ami Bar&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;as well there is tutorial on the &lt;a href="http://www.codeproject.com/csharp/xythreadpool.asp"&gt;code project about how to write thread pool&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;and finally, the most exciting project is the BackGroundWorker for .NET 1.1&lt;br /&gt;&lt;br /&gt;in .NET version 2.0 there is a new class called "BackGroundWorker" which as its name indicate, handles background processes in seperate threads&lt;br /&gt;&lt;br /&gt;Juval wrotes an article on how to &lt;a href="http://www.devx.com/codemag/Article/20639?trk=DXRSS_DOTNET"&gt;implement the functionality of BackGroundWorker in .NET 1.1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Actually I am leaning toward implementing the second choise, which is called the "Smart thread pool"&lt;br /&gt;It has more way options than my "tiny code" that I wrote&lt;br /&gt;It gives ability to controls the threads which I might need to do in order to build more robust solution for the emailing service&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115103874048700029?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115103874048700029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115103874048700029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115103874048700029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115103874048700029'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/06/thread-pool-development.html' title='Thread pool development'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-115084761165115066</id><published>2006-06-20T16:13:00.000-07:00</published><updated>2006-06-20T16:58:14.610-07:00</updated><title type='text'>doing background processing in ASP.NET</title><content type='html'>In the application I am working on right now, there are many modules that send emails to a list of clients, and some of these emails have attachments.&lt;br /&gt;The client list could reach thousands of emails addresses.&lt;br /&gt;&lt;br /&gt;There is a WebService that is responsible of sending an email.&lt;br /&gt;The WebService has a web method (SendEmail), that accept an email address, and all other information (like attached files), and communicate with the email server to send the email.&lt;br /&gt;(I was not the one who decided to put the email functionality as a webservice, so that part was beyond my control.)&lt;br /&gt;&lt;br /&gt;The webservice will be called by different functionalities, different modules, from many areas, and different application types, ASP.NET applications, windows applications, window services..&lt;br /&gt;&lt;br /&gt;We were concerned about responsiveness of the web service like: what if one of these emails was a huge in size, then the webservice could timeout.&lt;br /&gt;&lt;br /&gt;Other concern was raised, which is related to performance.&lt;br /&gt;This web service shares other web services the same web server, so we were concern about effecting other applications on the same server&lt;br /&gt;&lt;br /&gt;Calling the web service asynchronously will return back to the client immediately, so the client won't timeout, but with many email requests, and each one is createing a seperate thread from ASP.NET thread pool, then it is not a good solution, keeping in mind the thread pool has limited number of threads, and increasing this number to a very large number, will risk to crash the web server.&lt;br /&gt;&lt;br /&gt;I couldn’t find a way to limit the number of threads for one AppDomain, or a web service. The only setting that effect number of threads is in machine.config, which effect all applications&lt;br /&gt;&lt;br /&gt;The factors that effect our decisions where:&lt;br /&gt;1 - I wanted the web service to return immediately to the client&lt;br /&gt;2 - and at the same time, consume limited number of threads&lt;br /&gt;3 - Baring in mind that the result of the webservice is not required at the runtime.&lt;br /&gt;If a client will send email, and the process fails, then the client doesn’t need to know about it immediately&lt;br /&gt;&lt;br /&gt;I found out from &lt;a href="http://www.rob-howard.net/"&gt;Rob Howard&lt;/a&gt; website that he did something similar during development of the community server forum.&lt;br /&gt;For each new post on the forum, they want to send emails to the subscribed users, notifying them on changes&lt;br /&gt;&lt;br /&gt;So Rob solution was to run the process in the background, consuming one thread only&lt;br /&gt;&lt;br /&gt;I took similar approach, (and I am curios to find other approaches to this problem)&lt;br /&gt;The approach is like implementing my own “thread pool”&lt;br /&gt;&lt;br /&gt;I kept in a database, a record that store the value of the number of current running threads.&lt;br /&gt;&lt;br /&gt;The webservice will behave as follows&lt;br /&gt;&lt;br /&gt;1 – the webservice will receive a request from a client, then it initiates another thread to do the email, and returns back immediately to the client&lt;br /&gt;&lt;br /&gt;2 – Before the webservice initiate the thread, it will compare the value of the current running thread stored in the database and compare it to the maximum number of the thread that we want to define.&lt;br /&gt;&lt;br /&gt;3 - if the value of the current running threads is less that the defined maximum number, then the thread will be created.&lt;br /&gt;&lt;br /&gt;4 – otherwise, I will create a timer that will be triggered after a period of time to do the process again&lt;br /&gt;&lt;br /&gt;Notice that creating a timer, won’t consume a thread&lt;br /&gt;&lt;br /&gt;5 - When the thread finish sending email, it will decrement the value in the database&lt;br /&gt;&lt;br /&gt;6 - Proper exception management was handling any error arise from not accessing or updating the thread count value in the database.&lt;br /&gt;&lt;br /&gt;To test the solution, I did testing using Performance monitor, monitoring the number of logical threads, and physical threads&lt;br /&gt;The solution worked fine, where just few threads were created concurently, and other requests were queued using the timer (System.Threading.Timer).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;the disadvantage of this approach is consuming the memory&lt;br /&gt;When I call the timer, I send to the timer, the (email Object) which contains all the data with the attachements, and this "email object" is stored in the stack.&lt;br /&gt;so when we queue one thousand of requests, there are one thousand objects are stored in the stack.&lt;br /&gt;&lt;br /&gt;We compared the advantages and disadvantages, and we decided that the memory is the lesser of two evils comparing to the process timing out, or comsuming all the threads of the thread pool.&lt;br /&gt;&lt;br /&gt;If I had choise, I wouldn't send the email data to the webservice, and instead, I will let the webservice generate the data required,  or I will queue the whole service that will generate the data and send email, but that is beyond my control.&lt;br /&gt;&lt;br /&gt;other approaches could exist, and could be better that this one, and I am concern about finding better approach if any exist.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-115084761165115066?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/115084761165115066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=115084761165115066' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115084761165115066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/115084761165115066'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/06/doing-background-processing-in-aspnet_20.html' title='doing background processing in ASP.NET'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114853665859510605</id><published>2006-05-24T22:35:00.000-07:00</published><updated>2006-05-24T22:57:38.640-07:00</updated><title type='text'>Initial thoughts for my framework</title><content type='html'>Instead of going around and wasting time, I thought I will start to build something just for the experiment sake.&lt;br /&gt;I will start to build a framework around the MVC (or MVP) enterprise pattern, and the framework will be build using Depency Injection framework.&lt;br /&gt;There are many DI frameworks out there, and most of them are free like &lt;a href="http://www.springframework.org/"&gt;Spring.NET&lt;/a&gt; and Pico.NET, but I am leaning toward &lt;a href="http://www.gotdotnet.com/codegallery/codegallery.aspx?id=e915f307-c1c6-47c4-8ea0-cb4f0346fba0"&gt;Object Builder&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I prefer Object Builder for these reasons:&lt;br /&gt;1 - because it is from Microsoft Practices &amp; Patterns&lt;br /&gt;2 - It is used by the Enterprise Library 2.0, and here &lt;a href="http://www.agileprogrammer.com/oneagilecoder/archive/2006/01/03/10564.aspx"&gt;Brian Button talked about that&lt;/a&gt;&lt;br /&gt;3 - It is from the same team that built &lt;a href="http://msdn.microsoft.com/vstudio/teamsystem/Workshop/gat/default.aspx"&gt;GAT&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.agileprogrammer.com/oneagilecoder/"&gt;Brian Button&lt;/a&gt; one of the best guys who can talk about building frameworks, and how Microsoft Patterns and Practices team built the proper tools for that matter.&lt;br /&gt;&lt;br /&gt;Actually the tools that are coming from Patterns and Practices can significally speed up the development process, and implement the best practices smoothly in your code&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114853665859510605?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114853665859510605/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114853665859510605' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114853665859510605'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114853665859510605'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/05/initial-thoughts-for-my-framework.html' title='Initial thoughts for my framework'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114828488882070681</id><published>2006-05-22T00:38:00.000-07:00</published><updated>2006-05-24T22:59:45.306-07:00</updated><title type='text'>Library vs. Framework</title><content type='html'>A framework is more than a library, and actually maybe has nothing to do with a library.&lt;br /&gt;&lt;br /&gt;Here is &lt;a href="http://martinfowler.com/bliki/InversionOfControl.html"&gt;an interesting article&lt;/a&gt; on &lt;a href="http://martinfowler.com/bliki/"&gt;Martin Fowler's blog&lt;/a&gt; about Inversion of control, but in the article, Martin discuss the difference between the library and the framework, as well he refers to &lt;a href="http://www.laputan.org/drc/drc.html"&gt;another article about frameworks&lt;/a&gt;.&lt;br /&gt;I can summarize the points in both articles in the following:&lt;br /&gt;&lt;br /&gt;A library is about reusable functionalities, but a framework is about reusable behaviors.&lt;br /&gt;A library is something you call/inherit from your code, but framework is something that calls your code or provide services for your code.&lt;br /&gt;A library is a collection of components and classes, where framwork is how abstract classes and components interact with each others.&lt;br /&gt;&lt;br /&gt;I can explain the framework by this definition:&lt;br /&gt;Framework is an abstract design that embodies how the application works, and it has "hooks" where you can "inject" your module, or component.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114828488882070681?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114828488882070681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114828488882070681' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114828488882070681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114828488882070681'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/05/library-vs-framework.html' title='Library vs. Framework'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114750796835931587</id><published>2006-05-13T00:42:00.000-07:00</published><updated>2006-05-13T01:14:40.026-07:00</updated><title type='text'>The killer tool: GAT</title><content type='html'>Building frameworks involves writing guidances, standards, code convention...&lt;br /&gt;Before going to cover new frameworks and talking about business rules engine, I want to re-introduce a wonderful tool: &lt;br /&gt;&lt;a href="http://lab.msdn.microsoft.com/teamsystem/workshop/gat/intro.aspx"&gt;Guidance Automation Toolkit&lt;/a&gt; (GAT)&lt;br /&gt;&lt;a href="http://techembassy.blogspot.com/2006/01/double-automated-power.html"&gt;I introduced GAT before&lt;/a&gt;, and I want to re-talk about it for two reasons&lt;br /&gt;1 - because it is a wonderful tool in general.&lt;br /&gt;2 - because it's a great tool specially to build and use frameworks.&lt;br /&gt;GAT is a visual studio 2005 extension, which is a combination of code generation tool, and visual studio templates.&lt;br /&gt;It allows to build templates for sultion, project and items, and relate wizard-like interfaces, which help auto-generates code for your project&lt;br /&gt;&lt;br /&gt;In my framework that I am going to build, I am going to use GAT a lot.&lt;br /&gt;I found as well that many other existing frameworks, are using GAT.&lt;br /&gt;&lt;br /&gt;In the next post I will talk about a framework for building web services (so I will skip the business rules subject now)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114750796835931587?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114750796835931587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114750796835931587' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114750796835931587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114750796835931587'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/05/killer-tool-gat.html' title='The killer tool: GAT'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114724878801357248</id><published>2006-05-10T01:12:00.000-07:00</published><updated>2006-05-10T01:13:08.026-07:00</updated><title type='text'>Writing Frameworks (Part II): Business framework</title><content type='html'>One of the most successful frameworks out there is &lt;a href="http://en.wikipedia.org/wiki/Csla"&gt;CSLA&lt;/a&gt; by &lt;a href="http://www.lhotka.net/weblog/"&gt;Rockford Lhotka&lt;/a&gt;&lt;br /&gt;What is CSLA, and how it can help you?&lt;br /&gt;&lt;br /&gt;Building n-tier applications become easier with various tools that the industry produce to help speeding up the process, and auto-generating the plumbing code which the developer has to write.&lt;br /&gt;A usual "old-fashion" n-tier application consists of three major tiers: The Data Access layer, The Business layer, and the Presentation Layer.&lt;br /&gt;Even some modified versions will add to these three layers some more layers, like the service, and splitting the Presentation between Presentation and UI, but the concept is the same, which is splitting responsibilities.&lt;br /&gt;Building the DAL is easy using the Code Generation tools like &lt;a href="http://www.codesmithtools.com/"&gt;Code Smith&lt;/a&gt;, &lt;a href="http://msdn.microsoft.com/vstudio/teamsystem/Workshop/gat/default.aspx"&gt;Guidance Automation Toolkit&lt;/a&gt;, or some of the ORM tools that are available.&lt;br /&gt;These tools can save lots of time building the plumbing, repetitive code, and even auto-generate the Unit test code.&lt;br /&gt;The UI tier, as well could be auto-generated based on the database.&lt;br /&gt;The Business Layer is one of the most difficult ones, because it holds the business rules which could be impossible to auto-generate.&lt;br /&gt;ORM tools could help by auto-generating the business objects with simple business rules that are imported from the database constraints, but they cannot help with more complex business rules.&lt;br /&gt;&lt;br /&gt;CSLA is a library that you can integrate it with your business layer to add basic functionalities to this layer.&lt;br /&gt;&lt;br /&gt;Lhotka published a book describing in details his framework.&lt;br /&gt;The book &lt;a href="http://www.amazon.com/gp/product/1590593448/sr=1-1/qid=1147242886/ref=sr_1_1/002-1436032-9764034?%5Fencoding=UTF8"&gt;"Expert C# Business Objects"&lt;/a&gt; describes in details what the CSLA is.&lt;br /&gt;&lt;br /&gt;The basic functionalities that CSLA provides for each class that inherits from it are:&lt;br /&gt;1. n-Level undo capability&lt;br /&gt;2. Tracking broken business rules to determine whether an object is valid&lt;br /&gt;3. Tracking whether an object's data has changed (is it "dirty"?)&lt;br /&gt;4. Support for strongly typed collections of child objects&lt;br /&gt;5. A simple and abstract model for the UI developer&lt;br /&gt;6. Full support for data binding in both Windows Forms and Web Forms&lt;br /&gt;7. Saving objects to a database and getting them back again&lt;br /&gt;8. Table-driven security&lt;br /&gt;9. Other miscellaneous features&lt;br /&gt;&lt;br /&gt;The first three functionalities are provided as a super class called BusinessBase, and any class that inherit from BusinessBase will inherits these capabilities&lt;br /&gt;The first 4 functionalities are very clear, so I am not going to describe them&lt;br /&gt;&lt;br /&gt;5 – A simple and abstract model for the UI developer: &lt;br /&gt;When business objects are inheriting from CSLA, then CSLA will provides an extra layer on the top of the business objects that abstract the details of the objects, and allows the UI to see the objects and the data as simple unified classes.&lt;br /&gt;&lt;br /&gt;6 - Full support for data binding in both Windows Forms and Web Forms&lt;br /&gt;CSLA doesn’t count on .NET data binding, but has its own data binding that is more robust and flexible&lt;br /&gt;&lt;br /&gt;Both 5 and 6 will provide loose coupling between the business layer that implement CSLA and the UI.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Option 7 is a full ORM solution built-in CSLA&lt;br /&gt;CSLA can create in run-time objects that are derived from a relational database, or on design time it will auto-generate the code for that.&lt;br /&gt;&lt;br /&gt;And at last, the Table-driven security is a way to associate security tags to any objects, and it is implemented in the base classes of CSLA, so any class that inherits from them will inherits these capabilities.&lt;br /&gt;&lt;br /&gt;CSLA was widely accepted as a framework, and has its own forums.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Next post will be : Business Rules Engine: dream and reality&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114724878801357248?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114724878801357248/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114724878801357248' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114724878801357248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114724878801357248'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/05/writing-frameworks-part-ii-business.html' title='Writing Frameworks (Part II): Business framework'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114724524832890170</id><published>2006-05-10T00:13:00.000-07:00</published><updated>2006-05-10T00:24:18.506-07:00</updated><title type='text'>Writing Frameworks (Part I): Introduction</title><content type='html'>In my job, we are doing many projects for the government.&lt;br /&gt;All projects deal with mostly the same issues, and require similar functionalities.&lt;br /&gt;In the recent days I was doing lots of research on how to build a framework that has built-in functionalities, which you can carry from one project to another.&lt;br /&gt;I use the term "Framework" by its largest meaning.&lt;br /&gt;It could be just few tools that can help auto-generate code, or it could be "Core" library of classes that do lots of basic functionalities, and you can inherit them, or integrate them smoothly in your project.&lt;br /&gt;&lt;br /&gt;As well I was looking of what is considered a good design for a framework.&lt;br /&gt;I mean if you decide to build a framework, how you can design it well.&lt;br /&gt;&lt;br /&gt;The book &lt;a href="http://www.amazon.com/gp/product/0321246756/102-2994549-4474533?v=glance&amp;n=283155"&gt;Framework Design Guidelines&lt;/a&gt; provides invaluable insight about the code conventions and what to do, and don't to build frameworks.&lt;br /&gt;But I was looking beyond the code, to the architecture, and I was looking for some already existed frameworks.&lt;br /&gt;&lt;br /&gt;In the following posts I am going to cover many of these frameworks, and combine it with the book "Framework Design Guidelines" and other books to get the reoccurring patterns, and find the best practices, and guidelines (with wider scope than the previously mentioned book) in building frameworks.&lt;br /&gt;&lt;br /&gt;The following posts are combination from many websites, books and existing applications.&lt;br /&gt;So keep tune, because you will find many valuable information&lt;br /&gt;&lt;br /&gt;Before I start delving into the existing frameworks, I like to draw an analogy between writing software with a framework, and raising a child&lt;br /&gt;&lt;br /&gt;Writing software with a good, well designed framework is like raising a child in a healthy family.&lt;br /&gt;The child will raise up, feeling &lt;span style="font-weight:bold;"&gt;Confidence &lt;/span&gt;in his environment, doesn’t hesitate to express his &lt;span style="font-weight:bold;"&gt;Needs&lt;/span&gt;, because he knows that they are going to be satisfied, and the result is a child who is raised up with a spontaneous personality, who looks for his position in life and fill it with success.&lt;br /&gt;The same with writing a module in a good framework, your module (which is your child) knows that his needs are satisfied, and he will work spontaneously in his safe environment to accomplish his job.&lt;br /&gt;&lt;br /&gt;But when you write software with no framework, or a bad framework, then it is like raising a child in a dysfunctional family&lt;br /&gt;The child is always feeling unsafe in his environment, feeling scared of expressing his needs, because he could get punished, and the child will grow up isolated, cannot communicate with his environment, always afraid of braking some rules.&lt;br /&gt;&lt;br /&gt;And writing a module in bad framework is exactly like that child.&lt;br /&gt;The module, is always alerted for braking down the system, and trying not to express his needs, because it is difficult to satisfy them, and at the end, you will get a module, that cannot be spontaneous in his environment.&lt;br /&gt;&lt;br /&gt;In the following post I am going to cover the following:&lt;br /&gt;&lt;br /&gt;Writing Business Framework: CSLA as an example&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114724524832890170?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114724524832890170/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114724524832890170' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114724524832890170'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114724524832890170'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/05/writing-frameworks-part-i-introduction.html' title='Writing Frameworks (Part I): Introduction'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114555773247450483</id><published>2006-04-20T10:16:00.000-07:00</published><updated>2006-04-20T13:25:48.820-07:00</updated><title type='text'>Customer services with the big business and tiny people</title><content type='html'>I installed an exhaust fan in my bathroom in the last weekend&lt;br /&gt;&lt;br /&gt;The problem with installing any household item, that you cannot really test it, without installing the whole system&lt;br /&gt;I mean there is no way to "Unit test" every piece, and no "Stub" to do aggregation tests&lt;br /&gt;&lt;br /&gt;the only way is to install the whole system, and find if it is working or not&lt;br /&gt;&lt;br /&gt;before I installed the fan, I noticed some holes in the frame of the fan. The holes were just for mounting the fan on the wall.&lt;br /&gt;I was concern of leaking moisture into the attic&lt;br /&gt;So I went bank to Rona, and asked them about the holes, and their answer was it is a good idea to seal them, even they are tiny&lt;br /&gt;&lt;br /&gt;But after I installed the fan, and check if there is any air leakage, I found there are some ohter tiny holes on the motor housing&lt;br /&gt;Although these tiny holes are in millimeter size, but the air is coming out from them&lt;br /&gt;&lt;br /&gt;They could exist to provide ventilation for the motor, so I cannot seal them, but the same time I am concern about moisture leaking&lt;br /&gt;So I decided to ask the maintenance department of the manufacturer&lt;br /&gt;&lt;br /&gt;When I called the maintenance, a female voice answered me&lt;br /&gt;I thought first, that this lady is the one that take the calls and connect people with the proper technician "GUYS"&lt;br /&gt;&lt;br /&gt;but for my surprise when I asked for somebody to help me answering my concerns, she offered to help me.&lt;br /&gt;&lt;br /&gt;I described for her my concerns, and after 15 minutes it was obvious that she doesn't have any idea about how a fan work&lt;br /&gt;So after 15 minutes discussion she asked me "So maybe you are looking for a technician?"&lt;br /&gt;and I told her "Yes, I am indeed"&lt;br /&gt;&lt;br /&gt;She transfered me to the proper "GUY", and I left a message for him leaving my phone numbers&lt;br /&gt;&lt;br /&gt;Two days, and I am still waiting&lt;br /&gt;I called 4 times, and leaving messages with my phone numbers (I didn't forget to leave area codes as well)&lt;br /&gt;&lt;br /&gt;I thought they didn't understand my problem, so in my last message, I just mentioned that I have concern about one of their product that I bought and please call me back&lt;br /&gt;&lt;br /&gt;Of course a big company like this, when they have lots of business going on, they don't care about a one person, who bought one fan&lt;br /&gt;&lt;br /&gt;I am sure, if I left a message saying that I am a contractor and I bought 2000 of your fans, that they will call me back in the next hour&lt;br /&gt;&lt;br /&gt;When the business become so big, they don't care about individuals&lt;br /&gt;&lt;br /&gt;the moral of the story is:&lt;br /&gt;Business is better than government, only on some occasions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;PS:&lt;br /&gt;----------------------&lt;br /&gt;The bathroom fan I bought, from a company called Broan.&lt;br /&gt;I found later that Broan is a Canadian company, that was bought by an American company NuTone (similar to any successful Canadian company)&lt;br /&gt;-------------------------&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114555773247450483?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114555773247450483/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114555773247450483' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114555773247450483'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114555773247450483'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/04/customer-services-with-big-business.html' title='Customer services with the big business and tiny people'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114365405810038984</id><published>2006-03-29T09:38:00.000-08:00</published><updated>2006-03-29T09:40:58.110-08:00</updated><title type='text'>cool GPS application</title><content type='html'>this blackberry GPS application, will remind you of something to do when you are close to a specific location&lt;br /&gt;&lt;br /&gt;what you have to do is to feed your blackberry with what you what to do, and which location it should be&lt;br /&gt;and when you are clost to that location it will alert you&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.bbhub.com/2006/03/28/get-reminders-sent-to-your-blackberry-7520-with-naggie/"&gt;read more&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114365405810038984?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114365405810038984/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114365405810038984' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114365405810038984'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114365405810038984'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/03/cool-gps-application.html' title='cool GPS application'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114329092580388670</id><published>2006-03-25T04:20:00.000-08:00</published><updated>2006-07-12T23:25:35.966-07:00</updated><title type='text'>In depth: the CLR Data types: Part I</title><content type='html'>Finding about the Decimal and Double, alerted me to the fact that there could be more to discover in depth about the .NET data types.&lt;br /&gt;In the few coming posts I am going to dive in depth of the CLR and the data types.&lt;br /&gt;I am going to cover why each data type used, performance tips, and more.&lt;br /&gt;&lt;br /&gt;I searched the web in many web sites for these tips, and tried to collect as much information as I can. &lt;br /&gt;At the end of each post I am going to list my resources.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;In part I, I am going to cover the System.String object.&lt;br /&gt;&lt;br /&gt;1 - why System.String is sealed?&lt;br /&gt;2 - comparing strings: what the best method to use&lt;br /&gt;3 - the string is ammutable type, what does that mean?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1 - Why System.String is sealed?&lt;br /&gt;The String object provides many methods that handle and manage the value inside the string. Some of these methods are optimized for speed, and a huge amount of the String's functionality is implemented using unmanaged code.&lt;br /&gt;That will raise a security issue, because the string is implemented with unmanaged code, then injecting a derived type of the string could give hackers a direct access to the memory.&lt;br /&gt;That is why the CLR designers didn't want anybody to alter the behavior of the String functionality, otherwise it would give the hacker a way inside the buffer and direct memory access inside the CLR.&lt;br /&gt;&lt;br /&gt;Reference: &lt;a href="http://www.amazon.ca/gp/product/1590591410/702-7500355-0126444?v=glance&amp;n=916520&amp;v=glance"&gt;Maximizing .NET performance&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2 - comparing strings: what the best method to use?&lt;br /&gt;there are four ways to compare two strings&lt;br /&gt;lets assume we have two variables&lt;br /&gt;String s1 = "a";&lt;br /&gt;String s2 = "b";&lt;br /&gt;&lt;br /&gt;the four ways to compare these two strings are&lt;br /&gt;&lt;br /&gt;   1 - the comparision operator: &lt;br /&gt;      s1 == s2 in c#&lt;br /&gt;      s1 = s2 in VB&lt;br /&gt;&lt;br /&gt;   2 - the Equals static method of the string object&lt;br /&gt;     String.Equals(s1, s2);&lt;br /&gt;&lt;br /&gt;   3 - the method Equals of the string object which overrides the Equals method of the System.Object&lt;br /&gt;    s1.Equals(s2);&lt;br /&gt;&lt;br /&gt;   4 - the static method Compare of the String object&lt;br /&gt;        String.Compare (st, s2, ...);&lt;br /&gt;&lt;br /&gt;so which one to use?&lt;br /&gt;The first three methods are binary comparision, where the last one is cultural-aware comparision which take care of cultural differences, and case-insensitive.&lt;br /&gt;&lt;br /&gt;The static method Equals of the String object is strong typed, and it accept only string type as arguments&lt;br /&gt;The static method Equals run first a type check, and then null check and then run the binary equality.&lt;br /&gt;&lt;br /&gt;the Equals method of the string object is an override version of the Equals method of the System.Object&lt;br /&gt;And here is the formula about the performance&lt;br /&gt;if the two variables are string and both of them are not null then both Equals (the static, and the non-static methods) have the same speed&lt;br /&gt;but if one of the above conditions is not true then the Static Equals is faster, because it detemine the equality before doing binary check&lt;br /&gt;So, the static Equals is always faster or the same speed as the non-static Equals&lt;br /&gt;In other word, alawys use the static method&lt;br /&gt;&lt;br /&gt;but what about the comparision operator?&lt;br /&gt;this part is funny&lt;br /&gt;in C#, the comparision operator will be compiled to call the Static Equals, so it is as fast as the static Equals&lt;br /&gt;but in VB is different&lt;br /&gt;Because of the backward compatibility with "Option Compare" in VB, the comparision operator is slower than the static Equals&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3 - the string is ammutable type, what does that mean?&lt;br /&gt;&lt;a href="http://blah.winsmarts.com//Post.aspx?postID=45"&gt;there is a wonderful post by Sahil Malik &lt;/a&gt;who talks about this specific issue, so I am not going to add any more after Sahil&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114329092580388670?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114329092580388670/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114329092580388670' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114329092580388670'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114329092580388670'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/03/in-depth-clr-data-types-part-i.html' title='In depth: the CLR Data types: Part I'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114151470645051925</id><published>2006-03-04T15:22:00.000-08:00</published><updated>2006-03-04T15:27:12.103-08:00</updated><title type='text'>This is hilarious</title><content type='html'>I couldn't resist, even though this could trigger some riots in the other part of the world, but it is hilarious&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/6130/317/1600/spotthewoman.jpg"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/6130/317/320/spotthewoman.jpg" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114151470645051925?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114151470645051925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114151470645051925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114151470645051925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114151470645051925'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/03/this-is-hilarious.html' title='This is hilarious'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114067510486144194</id><published>2006-02-22T21:47:00.000-08:00</published><updated>2006-02-23T09:06:27.816-08:00</updated><title type='text'>Software factories, DSL and ClipCode-GoF</title><content type='html'>ClipCode-GoF-DSL is a new tool that you can add to Visual Studio 2005, and it allows you to generate code of the Gang of Four design patterns.&lt;br /&gt;It provides a graphical diagram where you can design your application, drag and drop any GoF design patterns, and the tool will generate the skelton code for you.&lt;br /&gt;&lt;br /&gt;A picture worth 1000 words, so I hope the picture below will explain a lot.&lt;br /&gt;&lt;br /&gt;This tool was built using the new DSL-SDK for Visual studio 2005.&lt;br /&gt;What is DSL?&lt;br /&gt;DSL stands for Domain Specific Language, and it is a language that is developed to handle specific domain problems in contrast to General purpose languages like (c#, vb).&lt;br /&gt;I can think of DSL as kind of Macro-language which was developed to handle specific tasks for specific buisness, and those macros are constructed from other general purpose language like c#, VB.NET&lt;br /&gt;&lt;br /&gt;Martin Fowler has &lt;a href="http://www.martinfowler.com/bliki/DomainSpecificLanguage.html"&gt;a good post on DSL&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;Using DSL helps you get good abstraction of your architecture or desing, and look at it from buisness terms and besuiness requirements viewpoint, and hiding the implementation details.&lt;br /&gt;&lt;br /&gt;Microsoft developed DSL-SDK that allows you to develop your own DSL language, and it is part of their software factories strategy.&lt;br /&gt;You can construct your own domain terms, and entities, and associate skelton code with it, and then with graphical diagram and drag and drop you can build your application by drag and drop what you want.&lt;br /&gt;ClipCode-GOF-DSL was one of the early adapter for this technology&lt;br /&gt;In order to use ClipCode-GOF-DSL you have first to install DSL-SDK from Microsoft.&lt;br /&gt;&lt;br /&gt;you can download ClipCode-GOF-DSL from &lt;a href="http://www.clipcode.biz/workshops/dsl.html"&gt;here&lt;/a&gt;&lt;br /&gt;and Microsoft DSL-SDK &lt;a href="http://msdn.microsoft.com/vstudio/DSLTools/"&gt;here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;------------------&lt;br /&gt;Edited&lt;br /&gt;&lt;br /&gt;I want to add that DSL-SDK is a part of Visual Studio SDK which is a tool that helps you build more add-ins and applications that can be intergrated with visual studio&lt;br /&gt;---------------------&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.clipcode.biz/workshops/dsl-overview-small.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px;" src="http://www.clipcode.biz/workshops/dsl-overview-small.png" border="0" alt="" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114067510486144194?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114067510486144194/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114067510486144194' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114067510486144194'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114067510486144194'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/02/software-factories-dsl-and-clipcode.html' title='Software factories, DSL and ClipCode-GoF'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114035242925021415</id><published>2006-02-19T04:33:00.000-08:00</published><updated>2006-02-19T04:37:58.120-08:00</updated><title type='text'>AOP is the next evolution in software development</title><content type='html'>AOP enhances the system's architecture.&lt;br /&gt;AOP helps build cleaner design.&lt;br /&gt;AOP solves the system-level challenges&lt;br /&gt;AOP makes the software more maintainable&lt;br /&gt;AOP helps developers be more productive&lt;br /&gt;And more, … &lt;br /&gt;&lt;br /&gt;I’m not bullshiting you&lt;br /&gt;I didn’t come up with these statements; I’ve just read them from articles and posts discussing AOP.&lt;br /&gt;&lt;br /&gt;So why the AOP is so wonderful?&lt;br /&gt;In order to explain that we have to understand the limits of OOP and what are the major barriers that OOP cannot solve.&lt;br /&gt;&lt;br /&gt;We can think of a typical software system as several core and system-level concerns.&lt;br /&gt;These concerns are independent from each other.&lt;br /&gt;For example a banking system comprises business-rules, business processing, auditing, authentication, security, performance, debugging, multithreaded, validation and so on…&lt;br /&gt;These concerns are independent.&lt;br /&gt;OOP has shown its strength when it comes to modeling behavior, and modeling the business-domain, but it is not adequate when the behavior span over many unrelated modules, or a module should handle many unrelated behaviors.&lt;br /&gt;&lt;br /&gt;For example, let’s examine the code that handles a bank transaction, which exists in a class called transaction. The code in the class should validate the input parameters, check the security and authentication, perform logging and auditing, and if there is any caching that enhance the performance, then we could add code to validate the cache&lt;br /&gt;All these cross-cutting concerns tend to affect multiple business modules.&lt;br /&gt;Using OOP alone, these crosscutting concerns span over multiple modules, resulting in systems that are harder to maintain&lt;br /&gt;&lt;br /&gt;The OOP alone will lead to these major problems:&lt;br /&gt;1 - Less code reuse:&lt;br /&gt;When we add cross-cutting concerns in the original code, then we make the code less reusable, because these concerns won’t be required in other areas&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2 – Low productivity:&lt;br /&gt;The developer should pay attention to many concerns, and he/she cannot concentrate on the main responsibility of the class&lt;br /&gt;&lt;br /&gt;3 – Less cohesion:&lt;br /&gt;By adding cross-cutting concerns into a class, we break the cohesion of the class, and add responsibilities that are not related to the business domain that the class represent.&lt;br /&gt;&lt;br /&gt;AOP is the next big step in programming methodologies&lt;br /&gt;AOP which helps you think of the system as “Aspects” or concerns, will take these burden of handling cross-cutting concerns to outside, and let the developer concentrate on modeling the business logic, which result in cleaner design for the module-level logic.&lt;br /&gt;And with regarding these concerns, each concern or aspect will exist in a separate central place, and therefor it doesn’t scatter among many modules&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114035242925021415?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114035242925021415/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114035242925021415' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114035242925021415'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114035242925021415'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/02/aop-is-next-evolution-in-software.html' title='AOP is the next evolution in software development'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114034783347739151</id><published>2006-02-19T02:44:00.000-08:00</published><updated>2006-02-19T05:03:36.450-08:00</updated><title type='text'>AOP and partial classes</title><content type='html'>Is it possible that the partial class in .NET 2.0 is a way to implement AOP?&lt;br /&gt;&lt;br /&gt;If we debate how much this idea could be valuable, then I would say that, there are two major barriers:&lt;br /&gt;&lt;br /&gt;1 - Altering the behavior: &lt;br /&gt;With partial classes we can add code to an already developed class while keeping the original class code not effected.&lt;br /&gt;But –according to what I read about partial classes-, partial class semantic is limited to add method and properties, but there no way to modify a method or alter its behavior, which is what AOP does&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2 - Scattered implementation of the functionality&lt;br /&gt;AOP in principle aims to add functionality to an application, by writing code in one central place&lt;br /&gt;which means, if I want to add auditing functionality to an application, the auditing code, pointcuts and the join-points, will be –all- configured in one central place.&lt;br /&gt;Obviously I cannot implement this feature using partial classes&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;So I tried to search the internet to find if somebody tried to use partial classes to implement AOP before, and I was not surprised that some people tried it, and they sent requests to Microsoft and Anders Hejlsberg to extend the semantics of partial classes to enable weaving code into the original code.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.jnsk.se/weblog/posts/aopnetupdate.htm"&gt;Read the post here&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In that post, the author called this approach to use partial class for AOP, "the poor man AOP"&lt;br /&gt;&lt;br /&gt;I was glad to hear that, because it tells me that I think as a poor man, and not as a filthy bourgeoisie&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114034783347739151?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114034783347739151/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114034783347739151' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114034783347739151'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114034783347739151'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/02/aop-and-partial-classes.html' title='AOP and partial classes'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-114015741321199523</id><published>2006-02-16T22:22:00.000-08:00</published><updated>2006-02-16T22:23:33.223-08:00</updated><title type='text'>Marketting yourself as IT professional</title><content type='html'>wow &lt;br /&gt;&lt;a href="http://tarrysingh.blogspot.com/2006/02/redhot-future-of-it-part-i-marketing.html"&gt;very intersting article&lt;/a&gt; on how to market yourself&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-114015741321199523?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/114015741321199523/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=114015741321199523' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114015741321199523'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/114015741321199523'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/02/marketting-yourself-as-it-professional.html' title='Marketting yourself as IT professional'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-113969162479997578</id><published>2006-02-11T13:00:00.000-08:00</published><updated>2006-02-11T13:15:51.633-08:00</updated><title type='text'>My Aspects on Aspect, Part III</title><content type='html'>In this post I am going to cover the source instrumentation-based platforms.&lt;br /&gt;&lt;br /&gt;Source instrumentation, or sometimes it is called source transformation is an approach in AOP code that will associate our original code that we are intercepting with the new code that we are weaving.&lt;br /&gt;Then we compile both codes, and the compiler will read both source codes, and weave the AOP code inside the original code (the target code).&lt;br /&gt;Obviously, this approach requires its own compiler, because the native .NET compiler won’t do that for us.&lt;br /&gt;&lt;br /&gt;The only platform that is in production right now is EOS, and there are other platforms but they are still in Beta versions&lt;br /&gt;EOS comes with its own extended c# compiler, and it works only with c#.&lt;br /&gt;&lt;br /&gt;You can download EOS &lt;a href="http://www.cs.virginia.edu/~eos/download/"&gt;from this location&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Real life example&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;&lt;br /&gt;Going back to our example of bank account&lt;br /&gt;&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;Namespace BankApplication&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Public class Account&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string Email&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;…..&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt; &lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Boolean Withdraw (int amount)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// ….. code to withdraw from the account.&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Then comes the AOP code&lt;br /&gt;&lt;br /&gt;First step I define the email as an aspect&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;Namespace MyAspect&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Public aspect Email&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Email(string emailAccount)&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// … initialize your email server&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;second step is to “introduce” the behavior of sending email to the class Account. In AOP terms this called introduce the advice&lt;br /&gt;&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;introduce in BankApplication.Account&lt;br /&gt;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static void SendEmail()&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;  &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myemailserver.send(this.Email);&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The previous code will weave the method SendEmail into the compiled Account class.&lt;br /&gt;Which means if you open the compiled assembly by ildasm, and examine the class Account, you will see the method SendEmail into that class.&lt;br /&gt;&lt;br /&gt;third step is to define when do we want to run the advice, and in AOP terms this called join-point&lt;br /&gt;&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;static after execution (public Boolean &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BankApplication.Account.Withdraw()) :  call proxysendemail();&lt;br /&gt;public void proxySendEmail()&lt;br /&gt;{&lt;br /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BankApplication.Account.SendEmail();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;As you can see, the original code of the bank account was not affected at all.&lt;br /&gt;After we compile the code with EOS compiler, and we examine the generated assembly, we will see in the IL code that the class Account has a method called SendEmail, and as well we will see that after each call for the method Withdraw, there is a call for this method SendEmail&lt;br /&gt;&lt;br /&gt;the whole ASP code will look at the end like this&lt;br /&gt;&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;Namespace MyAspect&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Public aspect Email&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Email(string emailAccount)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// … initialize your email server&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;introduce in BankApplication.Account&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public static void SendEmail()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myemailserver.send(this.Email);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;static after execution (public Boolean &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BankApplication.Account.Withdraw()) :  &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;call proxysendemail();&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public void proxySendEmail()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;BankApplication.Account.SendEmail();&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-113969162479997578?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/113969162479997578/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=113969162479997578' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113969162479997578'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113969162479997578'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/02/my-aspects-on-aspect-part-iii.html' title='My Aspects on Aspect, Part III'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-113968679933978880</id><published>2006-02-11T11:25:00.000-08:00</published><updated>2006-02-11T11:42:27.983-08:00</updated><title type='text'>More about ContextBoundObject</title><content type='html'>In the last post (part II), I rushed in explaining ContextBoundObject.&lt;br /&gt;I just wanted to mention ContextBoundObject as an option to build AOP, even it is debate that this is not a real AOP, and beside the performance burden that ContextBoundObject will have on the application.&lt;br /&gt;&lt;br /&gt;Anyway, if you want real examples of using ContextBoundObject, then refer to these two articles&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/02/03/aop/"&gt;Building AOP using ContextBoundObject&lt;/a&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/msdnmag/issues/03/03/ContextsinNET/"&gt;Decoupling components&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Both articles are from MSDN magazine, and both have code to download&lt;br /&gt;as well there is a good article on &lt;a href="http://www.theserverside.net/articles/showarticle.tss?id=AspectOrientingNET"&gt;the server side website&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;of course, the code is similar between these three articles.&lt;br /&gt;In brief, whenever you inherit from ContextBoundObject, CLR will create a proxy for that target class (the class that is inheriting), and create a linked list of messages to communicate between the proxy and the target object.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://msdn.microsoft.com/msdnmag/issues/02/03/aop/AOPfig10.gif"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 160px;" src="http://msdn.microsoft.com/msdnmag/issues/02/03/aop/AOPfig10.gif" border="0" alt="" /&gt;&lt;/a&gt;&lt;br /&gt;You have to implement IMessageSink, which is the linked list of IMessage(s).&lt;br /&gt;And in IMessage you can write you own customization of the code&lt;br /&gt;the IMessageSink, will handle transfering the call along the linked list messages&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-113968679933978880?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/113968679933978880/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=113968679933978880' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113968679933978880'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113968679933978880'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/02/more-about-contextboundobject.html' title='More about ContextBoundObject'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-113964489580609468</id><published>2006-02-10T23:42:00.000-08:00</published><updated>2006-02-11T03:20:08.830-08:00</updated><title type='text'>My Aspects on Aspect, Part II</title><content type='html'>&lt;p style="font-family: Arial;"&gt;In these posts that I am writing about AOP, I am going to cover all the platforms that implement AOP in .NET.&lt;br /&gt;To find all the platforms that support AOP in .NET, please refer &lt;a href="http://csharp-source.net/open-source/aspect-oriented-frameworks"&gt;to this web site.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;As I said in my last post, all the platforms that implement AOP can be categorized under two major categories:&lt;br /&gt;1 - Source Instrumentation.&lt;br /&gt;2 - IL Instrumentation.&lt;/p&gt;&lt;p style="font-family: Arial;"&gt;Actually, and to be accurate, there is a third approach, which is &lt;b&gt;runtime instrumentation.&lt;/b&gt;&lt;br&gt;In &lt;b&gt;Runtime instrumentation&lt;/B&gt;, the CLR will intercept calls for classes and methods.&lt;br /&gt;This approach is natively supported by .NET, but it is not considered an AOP valuable option, for the following reasons:&lt;br /&gt;1 - It is very heavy on performance.&lt;br /&gt;2 - The code that is being intercepted, should inherits from the object &lt;b&gt;ContextBoundObject&lt;/b&gt;, and this requirement contradicts with the concept of AOP, which is weaving behaviors into an application without affecting the original code of the application.&lt;br /&gt;For the above reasons, many developers don’t consider this approach an AOP, and it is not widely used.   &lt;br /&gt;But anyway I will speak briefly about this approach in the following section before I move to talk about the existing AOP platforms.&lt;/p&gt;&lt;u&gt;&lt;font face="Courier" color="#0000FF"&gt;&lt;b&gt;DYI AOP (Do It yourself) AOP &lt;/b&gt;&lt;/font&gt;&lt;/u&gt;&lt;p style="font-family: Arial;"&gt;Any developer can implement AOP without having any extra platform, by using the &lt;b&gt;ContextBoundObject&lt;/b&gt; in .NET.&lt;br /&gt;By inheriting from &lt;b&gt;ContextBoundObject&lt;/b&gt;, a class can be intercepted (interceptable) by the CLR. When the CLR call that class, it reads its attributes to find what it should do.&lt;br /&gt;&lt;br /&gt;How ContextBoundObject works?&lt;br /&gt;&lt;br /&gt;To understand in depth how CLR does that then refer &lt;a href="http://msdn.microsoft.com/msdnmag/issues/03/03/ContextsinNET/"&gt;to this article&lt;/a&gt;.&lt;br /&gt;But in brief, I would say that the CLR creates a proxy which would be a façade for the class/method in concern.&lt;br /&gt;The proxy will call the target class/method by going through pipelines of "Messages"&lt;br /&gt;The developer can write Custom behavior in these messages.&lt;br /&gt;The messages have a linked list structure (each message points to the next one), and the call from the proxy passes from one message to another.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;&lt;u&gt;Real Life Example&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;Let’s suppose I have a class called Account (which represents a bank account), and lets suppose there is a method called Withdraw.&lt;br /&gt;&lt;br /&gt;Whenever I call this method, I want to send an email to the owner of the Account.&lt;br /&gt;&lt;br /&gt;Let’s suppose for the simplicity sake that the email is a property of the Account (I know this is not a good design, but just for the sake of the simplicity of this example)&lt;br /&gt;In the conventional way of programming, I would do the following&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;Public Class Account&lt;br /&gt;{&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string Email&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get { .....}&lt;br /&gt;         &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;set { .....}&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;     &lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public boolean Withdraw(int amount)&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#00FF00"&gt;// ... code to withdraw from the account&lt;/font&gt;&lt;br /&gt;          &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myemailserver.send(this.Email);&lt;br /&gt;     &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;&lt;br /&gt;as you can see I am adding to the Account class a responsibility that it is not of its concern, which breaks a good OOP design (why an account should know about email).&lt;br /&gt;&lt;br /&gt;How we can do it with ContextBoundObject?&lt;br /&gt;&lt;br /&gt;First step, we have to mark the method Withdraw by an attribute, to inform the CLR to intercept the method.&lt;br /&gt;We add an attribute to the Withdraw method, and lets suppose this attribute called SendEmail (which we are going to create).&lt;br /&gt;So the code will be like this &lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;public class Account : ContextBoundObject&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;…&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[SendEmail(this.Email)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Boolean Withdraw(int amount)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#00FF00"&gt;// ...the code to withdraw from an account.&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;The above code tells the CLR, to use the attribute SendEmail and its associated code, whenever it encouters this Withdraw method.&lt;br /&gt;&lt;br /&gt;Next let's create this attribute SendEmail&lt;br /&gt;As I said, when a class inherits from ContextBoundObject, the CLR will create a proxy and let the proxy call the original class, passing the call through many messages (where we can write our customized code).&lt;br /&gt;The code is complex and long, so I will just write something descriptive, and not the actual code, to show what is going on&lt;br /&gt;&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Reflection;&lt;br /&gt;&lt;br /&gt;namespace MyCustomAttributes&lt;br /&gt;{&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[AttributeUsage(AttributeTarget.All)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#00FF00"&gt;/* this just to tell the compiler that the attribute SendEmail will be assigned to any target (class, method, property…)*/&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public sealed Class SendEmail : System.Attribute&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public SendEmail(string emailAccount)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;font color="#00FF00"&gt;//constuctor&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;myemailserver.send(emailAccount);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The code for the Account class will be (the following part is real code)&lt;br /&gt;&lt;p style="background-color: #EEEEEE; font-family: Courier;"&gt;&lt;br /&gt;using System;&lt;br /&gt;using System.Reflection;&lt;br /&gt;using MyCustomeAttributes;&lt;br /&gt;&lt;br /&gt;namespace BankApplication&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public class Account : ContextBoundObject&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public string Email &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;…&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[SendEmail(this.Email)]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;public Boolean Withdraw (int money)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;//…the code to withdraw.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;}&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;As I mentioned before, the ContextBoundObject effects the performance of the application, that is why this approach is not used.&lt;br /&gt;&lt;br /&gt;In the next posts I will start writing about real third-party platforms of AOP.&lt;br /&gt;&lt;br /&gt;stay tuned&lt;br /&gt;&lt;br&gt;&amp;nbsp;&lt;br /&gt;&lt;br&gt;&amp;nbsp;&lt;br /&gt;&lt;br&gt;&amp;nbsp;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-113964489580609468?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/113964489580609468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=113964489580609468' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113964489580609468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113964489580609468'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/02/my-aspects-on-aspect-part-ii.html' title='My Aspects on Aspect, Part II'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8092461.post-113869604226599041</id><published>2006-01-31T00:26:00.000-08:00</published><updated>2006-01-31T00:44:01.526-08:00</updated><title type='text'>My Aspects on Aspect, Part I</title><content type='html'>I wrote before briefly about AOP, and I didn’t have time to &lt;br /&gt;experience with it more.&lt;br&gt;&lt;br /&gt;I was very interested to know more about it, and tried to &lt;br /&gt;catch any article that has AOP in the subject, and I found many frameworks that implement AOP in .NET world; each one has its own cons and pros.&lt;br&gt;&lt;br /&gt;But I didn’t find really a comprehensive article that describe AOP in details and at the same time describe the differences between these frameworks, and how each one achieved its goals, so I vow to myself to take this responsibility/opportunity to collect all these scattered pieces into one “the only you will ever need” type of article&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/u&gt;&lt;br&gt;&lt;br /&gt;In brief, AOP is a programming approach that help to define some behaviors in one place that would otherwise be distributed throughout your source code.&lt;br&gt;&lt;br /&gt;We can by using AOP to add behaviors or change behaviors of the code without really modify it, and we accomplish that by declaring this new behavior outside the code, in a central place.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Definition&lt;/b&gt;&lt;/u&gt;&lt;br&gt;&lt;br /&gt;(P.S: AOP world, is full of new key terms, and I am going &lt;br /&gt;to highlight these terms.)&lt;br&gt;&lt;br /&gt;The AOP lets you &lt;b&gt;&lt;i&gt;intercept&lt;/i&gt;&lt;/b&gt; your application for specific classes, methods or calls (called: &lt;b&gt;&lt;i&gt;jointpoint&lt;/i&gt;&lt;/b&gt;) and run some actions (called: &lt;b&gt;&lt;i&gt;advice&lt;/i&gt;&lt;/b&gt;), which may change the behavior of those classes or methods (&lt;i&gt;&lt;b&gt;jointpoints&lt;/b&gt;&lt;/i&gt;) whenever it encounters them.&lt;br&gt;&lt;br /&gt;The way to define these &lt;b&gt;&lt;i&gt;jointpoint&lt;/i&gt;&lt;/b&gt; should be outside the scope of the code that we are intercepting, by declaring &lt;b&gt;&lt;i&gt; pointcut &lt;/i&gt;&lt;/b&gt;in a central place.&lt;br&gt;&lt;br /&gt;The AOP framework will inject the &lt;b&gt;&lt;i&gt;advice&lt;/i&gt;&lt;/b&gt; inside the code, in a process called &lt;b&gt;&lt;i&gt;weaving&lt;/i&gt;&lt;/b&gt;.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;There are different frameworks that implement AOP in .NET. &lt;br /&gt;Those frameworks use different approaches, and each one has its own pros and cons.&lt;br&gt;&lt;br /&gt;They all do the same, by declaring &lt;i&gt;&lt;b&gt;pointcut&lt;/b&gt;&lt;/i&gt; to &lt;i&gt;&lt;b&gt;intercept&lt;/b&gt;&lt;/i&gt; &lt;br /&gt;some &lt;i&gt;&lt;b&gt;jointpoint&lt;/b&gt;&lt;/i&gt;, and declare &lt;i&gt;&lt;b&gt;advices&lt;/b&gt;&lt;/i&gt; to be &lt;i&gt;&lt;b&gt;weaved&lt;/b&gt;&lt;/i&gt; on the fly when the framework encounters these &lt;i&gt;&lt;b&gt;jointpoints&lt;/b&gt;&lt;/i&gt;.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;In the following posts, I am going to list the different frameworks and technologies they use to implement AOP.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;&lt;b&gt;Technologies&lt;/b&gt;&lt;/u&gt;&lt;br&gt;&lt;br /&gt;The technologies used are totally different between the frameworks.&lt;br&gt;&lt;br /&gt;Some use the source code to write and modify the source code, where others use the IL to write on top of it, so you don't need the source code.&lt;br&gt;&lt;br /&gt;Some will require the original code to comply to a specific standard, more specifically to write code that is intercept-able, where others will run on any code out there without pre-requirements.&lt;br&gt;&lt;br /&gt;&lt;br /&gt;We can divide the AOP frameworks into different categories.&lt;br&gt;&lt;br /&gt;First category I will use to divide, and I will speak about in this post is the language level&lt;br&gt;&lt;br /&gt;&amp;nbsp;&lt;br&gt;&lt;br /&gt;in this category, we can divide the frameworks into two major sections&lt;br&gt;&lt;br /&gt;1 - Source Instrumentation&lt;br&gt;&lt;br /&gt;2 - IL Instrumentation&lt;br&gt;&lt;br /&gt;&amp;nbsp;&lt;br&gt;&lt;br /&gt;&lt;u&gt;Source Instrumentation&lt;/u&gt;&lt;br&gt;&lt;br /&gt;This technology will read the source file of the code, and read the pointcuts, joinpoints, and advices that we created in another file, and compile them together, by adding the advices into the result assembly.&lt;br&gt;&lt;br /&gt;for sure this process requires a special compiler, and not the one that comes with .NET framework&lt;br&gt;&lt;br /&gt;The AOP frameworks who implement this approach provide their own compiler&lt;br&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;IL Instrumentation&lt;/u&gt;&lt;br&gt;&lt;br /&gt;This technology, as from its name will work on the IL level, so it doesn't require the source code.&lt;br&gt;&lt;br /&gt;It read the assembly, decrypt its code, and weave &amp;quot;something&amp;quot; into it and generate a new assembly.&lt;br&gt;&lt;br /&gt;What the &amp;quot;something&amp;quot; that is weaved into the new assembly, is different again between many platforms&lt;br&gt;&lt;br /&gt;I will explain later what is weaved in each platform.&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;and stay tune for the next part&lt;br&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8092461-113869604226599041?l=techembassy.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://techembassy.blogspot.com/feeds/113869604226599041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8092461&amp;postID=113869604226599041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113869604226599041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8092461/posts/default/113869604226599041'/><link rel='alternate' type='text/html' href='http://techembassy.blogspot.com/2006/01/my-aspects-on-aspect-part-i.html' title='My Aspects on Aspect, Part I'/><author><name>Ghassan Karwchan</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='21' height='32' src='http://3.bp.blogspot.com/-TTFUlSv2i2c/TqZ3p5fjbrI/AAAAAAAAAD4/cOjTNgCQopE/s220/IMG_5124.JPG'/></author><thr:total>0</thr:total></entry></feed>
