Happy New Year
Talking about ‘The Big Rewrite’
Summary of C# 3.0 Features
Your capabilities
The No A**hole Rule
2) They have significant difficulties in the arena of self-management. These bosses seem unable to manage their own emotional responses and actions."
- Lies
- Betrays trust or confidences
- Manages up, not down
- Micro-manages
- Steals credit or the spotlight from others
Also read Guy Kawasaki’s review here Book Review: The No Asshole Rule by Robert Sutton. Guy writes, "Walk away and stay away. Don’t be afraid to leave a bad situation. It’s unlikely you’ll change the assholes into good people; it’s much more likely that you’ll descend to their level."
And spaces didn’t allow me write a sshole, And I had to retort to some tricks to get it take the word. Pardon me for the uncivilized language, but we are talking about uncivilized people here.
Tags: NoAssHoleRule, Corporate
Quotable Quote
Even so, one step from my grave,
I believe that cruelty, spite,
The powers of darkness will in time
Be crushed by the spirit of light.
Talking about Red Light Special
I am tired of back linking entries from Thiru. But what the hell, they are so good.
Quote
Red Light Special
Two men were in a car when they had to stop at a red signal light.The man at the wheel did not say anything.
The other man by his side, fretting and fuming, said, "The time we
waste at these red lights – why, a man could write a book!"The driver still said nothing.
Finally the man beside him said, "Didn’t you hear what I said?"
"No."
"How come you did not hear? I was talking".
"Whom were you talking to?""I was talking to God," he said. "I’ve been making it a practice every
time I get to a red light to pray for one of my friends. It is wonderful
how many folks I have on my prayer list and how many I have time to
pray for in this way."
Turn off autocomplete for credit card input
Talking about Key to Success!!
I had seen this some time back in Thiru‘s Blog. When I saw it again today in Smitha’s blog, I thought I will not miss linking to it this time.
Quote
Once upon a time a very strong woodcutter asked for a job with a timber merchant, and he got it. His salary was really good and so were the working conditions. For that reason, the woodcutter was determined to do his best.
His boss gave him an axe and showed him the area where he was supposed to fell the trees. The first day, the woodcutter brought down 15 trees." Congratulations," the boss said. " Carry on with your work!"
Highly motivated by the words of his boss, the woodcutter tried harder the next day, but he only could bring 10 trees down. The third day he tried even harder, but he was only able to bring down 7 trees.Day after day he was bringing lesser number of trees down.
" I must be losing my strength", the woodcutter thought. He went to the boss and apologized, saying that he could not understand what was going on." When was the last time you sharpened your axe?" the boss asked.
" Sharpen? I had no time to sharpen my axe. I have been very busy trying to cut trees …"
That’s right. Most of us NEVER update our skills. We think that whatever we have learned is very much enough. But good is not good when better is expected. Sharpening our skills from time to time is the key to success.
Continuations, Coroutines, Closures, Iterators
The wikipedia definition of continuation: "a continuation is a representation of the execution state of a program (for example, the call stack or values of variables) at a certain point."
Coroutines, Iterators, Closures etc.
In Traditional program structure there is one main routine which calls subroutine(s) to accomplish a task. When a main routine calls a subroutine, the sub routine executes starting from the beginning (no matter how many times we call it). Once the sub routine is done it pops the locals out of the stack and pushes the return value on to the stack and the main routine begins executing from where it left off.
The traditional producer consumer problem. The producer produces an entity which the consumer consumes. The producer and consumer themselves can be expressed a separate coroutines. In an environment without threads this could be handy. Coroutine 1: read input coroutine 2: process input and return to coroutine 1 and so on…
Iterators are one place where this suspend resume model will be helpful a lot. Let us see a simple example in C#
public class Person {
private ArrayList friends;
public Person() {
friends = new ArrayList();
}
public void AddFriend(Person friend) {
friends.Add(friend);
}
public void RemoveFriend(Person friend) {
friends.Remove(friend);
}
public IEnumerable<Person> Friends {
foreach(Person friend in friends) {
yield return friend;
}
}
}
public class Program {
public static void Main(string[] args) {
Person sendhil = new Person();
sendhil.AddFriend("Hitesh");
sendhil.AddFriend("Prakash");
sendhil.AddFriend("Sridhar");
sendhil.AddFriend("Manu");
foreach(Person friend in sendhil.Friends) {
// Do something
}
}
}
No one would ever write such a program, may be they’ll just expose the ArrayList’s IEnumerable / IEnumerator evil twin. Anyways this is just to demonstrate the use of iterators. At the yeild return key word the execution state of the program is saved (this is all compiler magic) and the call returns to the caller (Main function). When the next iteration starts the execution resumes in where it left off early. In trivial
Sequence generators can be implemented using the yield return statements. For an example see Don’s blog entry (a fibonacci example using iterators is there). http://pluralsight.com/blogs/dbox/archive/2005/04/17/7467.aspx
http://www.intertwingly.net/blog/2005/04/18/Blocks-for-Box
http://www.martinfowler.com/bliki/Closure.html
The above entries describe closures in a nice way. To quote Sam the following statement describes the power of closures. "The lock example above is a specific example whereby the language designers had enough foresight to build a similar feature into the language. In Ruby, such features need not be a part of the language, as you can build your own." C# Using block is another one which i can think of. Rather than having a static language with these features built in wouldn’t it be better if you work in a language that gives you power and
http://www.intertwingly.net/blog/2005/04/13/Continuations-for-Curmudgeons
http://mojave.cs.caltech.edu/papers/cont-tut.ps
Use the online ps viewer to view it (http://view.samurajdata.se/)