hardstatus string "[screen %n%?: %t%?] %h"
November 8, 2005
November 6, 2005
My screenrc file
# kill startup message
startup_message off
# detach on hangup
autodetach on
# define a bigger scrollback, default is 100 lines
defscrollback 1024
# shell
shell -bash
# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue.
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.rW}%w %{.bW}%m/%d %C%a"
startup_message off
# detach on hangup
autodetach on
# define a bigger scrollback, default is 100 lines
defscrollback 1024
# shell
shell -bash
# An alternative hardstatus to display a bar at the bottom listing the
# windownames and highlighting the current windowname in blue.
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.rW}%w %{.bW}%m/%d %C%a"
September 7, 2005
August 26, 2005
AWK sort array
GAWK provides asort and asorti functions to sort arrays, but it is not useful in sorting arraying while wanting to keep the relationship between the index and the value. Here are two functions, zsort and zsorti, that do this.
Here is the code
Here is the result:
Here is the code
#!/bin/gawk -f
function zsort(a,b){
count=0;
delete b;
sort= "LC_ALL=C sort -k2nr -t,"
for (i in a){
printf("%s,%s\n",i,a[i]) |& sort;
}
close(sort, "to")
while ((sort |& getline line) > 0){
split(line,x,",");
count++;
b[count,1]=x[1];
b[count,2]=x[2];
}
close(sort)
return count;
}
function zsorti(a,b){
count =0;
delete b;
sort= "LC_ALL=C sort -k1nr -t,"
for (i in a){
printf("%s,%s\n",i,a[i]) |& sort;
}
close(sort, "to")
while ((sort |& getline line) > 0){
split(line,x,",");
count++;
b[count,1]=x[1];
b[count,2]=x[2];
}
close(sort)
return count;
}
BEGIN{
a["x"]=5; a["y"]=7; a["z"]=6; a["a"]=10;
# sort by the array value
num=zsort(a,b);
for (i=1;i<=num;i++){
printf("%s,%s\n",b[i,1],b[i,2]);
}
print "==============="
# sort by the array index
num=zsorti(a,b);
for (i=1;i<=num;i++){
printf("%s,%s\n",b[i,1],b[i,2]);
}
}
Here is the result:
a,10
y,7
z,6
x,5
===============
a,10
x,5
y,7
z,6
August 22, 2005
WordAloud released to sourceforge
I recently created my first open source project: WordAloud. It pronouces an English word and displays its definition. I find it very handy. I hope people will use it.
August 13, 2005
What is True Leadership
This is directly from the book by Suzanne Bates.
Here is the leadership value system articulated by our 293 respondents, in roughly descending order:
Integrity. .Responses in this category referred to both business dealings and personal interactions. The words most frequently used by respondents to frame this concept were honesty, integrity,ethics, fairness, candor,sincerity, trustworthiness, and truthfulness .
Vision.
Listening.
Giving feedback. Participants place a priority on giving credit where credit is due, including public praise for a job well done. They cited offering positive feedback when deserved and valuing employees' contributions.
Emotional intelligence. Treating people well and having empathy and compassionate highly rated.
Communication skills.
Knowledge and intelligence.
Managerial skills.
Follow-through ... Strong leaders are consistently concerned about how things come out, not just how they begin
Humility. An authentic leader is humble -- willing to seek information and advice and to admit mistakes when they occur.
Here is the leadership value system articulated by our 293 respondents, in roughly descending order:
June 26, 2005
Debate about who founded Chrisitianity
Recently, I got very interested in Qur'an. I want to compare it with Christianity. I found some very good articles: Who Founded Christianity - Jesus or St. Paul?
June 21, 2005
Some athlete stories
Have you ever heard of:
John Landy
How about:
Roger Bannister
On May 6, 1954, Roger Bannister became the first man in history to run a mile in less than 4 minutes. Within 2 months, John Landy eclipsed the record by 1.4 seconds. On August 7 1954, the two met together for a historic race. As they moved into the last lap, Landy held the lead. It looked as if he would win, but as he neared the finish he was haunted by the question, "Where is Bannister?" As he turned to look, Bannister took the lead. Landy later told a Time magazine reporter, "If I hadn't looked back, I would have won!"
The Armstrong story
The Tour De France, is a 2,126 mile bicycle race through the country of France, conducted in twenty stages over a period of three weeks, an average of over a hundred miles a day. Just for comparison, that's about the same as riding a bicycle from Morgantown, WV all the way to Miami, Florida, and then back again. The race includes a bit of everything: all-out sprints; long days traveling through the French countryside; agonizing climbs over the Pyrenees mountains; and then terrifying descents from those same mountains, in which the cyclists reach speeds of over 70 miles an hour. The athletes have to contend with all kinds of hazards: narrow streets, blown tires - even small children darting out into the road. And they ride in all kinds of conditions: heat, wind, rain, even hail. In short, it is one of the most grueling athletic contests ever devised by man.
Lance Armstrong's single-minded devotion to training; his willingness to suffer physically, to push his mind and body to their absolute limit, in the pursuit of athletic victory. That's really been the key to his success. Listen to this passage, which describes his preparations for the 1999 Tour De France:
"I went back to training. I rode, and I rode, and I rode. I rode like I had never ridden, punishing my body up and down every hill I could find. . . . I remember one day in particular, May 3, a raw European spring day, biting cold. I steered my bike into the Alps, with Johan following in a car. By now it was sleeting and 32 degrees. I didn't care. We stood at the roadside and looked at the view and the weather, and Johan suggested that we skip it. I said, "No. Let's do it." I rode for seven straight hours, alone. To win the Tour I had to be willing to ride when no one else would ride." - It's Not About the Bike, pp. 221-222
Riding a bicycle up a mountain, alone, in the freezing rain, for seven straight hours, is commitment. Lance was willing to undergo any amount of suffering, any amount of physical and mental punishment, in order to win a bike race.
Sometimes you have to run the race alone but don't give up.
John Landy
How about:
Roger Bannister
On May 6, 1954, Roger Bannister became the first man in history to run a mile in less than 4 minutes. Within 2 months, John Landy eclipsed the record by 1.4 seconds. On August 7 1954, the two met together for a historic race. As they moved into the last lap, Landy held the lead. It looked as if he would win, but as he neared the finish he was haunted by the question, "Where is Bannister?" As he turned to look, Bannister took the lead. Landy later told a Time magazine reporter, "If I hadn't looked back, I would have won!"
The Armstrong story
The Tour De France, is a 2,126 mile bicycle race through the country of France, conducted in twenty stages over a period of three weeks, an average of over a hundred miles a day. Just for comparison, that's about the same as riding a bicycle from Morgantown, WV all the way to Miami, Florida, and then back again. The race includes a bit of everything: all-out sprints; long days traveling through the French countryside; agonizing climbs over the Pyrenees mountains; and then terrifying descents from those same mountains, in which the cyclists reach speeds of over 70 miles an hour. The athletes have to contend with all kinds of hazards: narrow streets, blown tires - even small children darting out into the road. And they ride in all kinds of conditions: heat, wind, rain, even hail. In short, it is one of the most grueling athletic contests ever devised by man.
Lance Armstrong's single-minded devotion to training; his willingness to suffer physically, to push his mind and body to their absolute limit, in the pursuit of athletic victory. That's really been the key to his success. Listen to this passage, which describes his preparations for the 1999 Tour De France:
"I went back to training. I rode, and I rode, and I rode. I rode like I had never ridden, punishing my body up and down every hill I could find. . . . I remember one day in particular, May 3, a raw European spring day, biting cold. I steered my bike into the Alps, with Johan following in a car. By now it was sleeting and 32 degrees. I didn't care. We stood at the roadside and looked at the view and the weather, and Johan suggested that we skip it. I said, "No. Let's do it." I rode for seven straight hours, alone. To win the Tour I had to be willing to ride when no one else would ride." - It's Not About the Bike, pp. 221-222
Riding a bicycle up a mountain, alone, in the freezing rain, for seven straight hours, is commitment. Lance was willing to undergo any amount of suffering, any amount of physical and mental punishment, in order to win a bike race.
Sometimes you have to run the race alone but don't give up.
Fruit Dinner
This is the dinner we had today:
1 bag of green salad
2 Mangoes
4 Lemons (extracted juice)
6 Patatoes
12 Carrots ( extracted juice)
That's a interesting dinner, is it?
1 bag of green salad
2 Mangoes
4 Lemons (extracted juice)
6 Patatoes
12 Carrots ( extracted juice)
That's a interesting dinner, is it?
June 16, 2005
InfoWorld 2005 Compensation Survey
Regional Rewards:
San Francisco/San Jose: $169K
Boston: $150K
Denver:$149K
Orlando: $146K
New York: $142K
Atlanta: $113K
Washington:$100K
Raleigh/Durham/Charlotte: $97K
Chicago: $92K
Dallas/Fort Worth: $91K
San Francisco/San Jose: $169K
Boston: $150K
Denver:$149K
Orlando: $146K
New York: $142K
Atlanta: $113K
Washington:$100K
Raleigh/Durham/Charlotte: $97K
Chicago: $92K
Dallas/Fort Worth: $91K