Saturday, April 28

I donated my computer!

BREAKING NEWS: GRID.ORG MISSION COMPLETE
On Friday, April 27, 2007, Grid.org announced it has completed its mission to demonstrate the viability and benefits of large-scale Internet-based grid computing, and will be retiring its famous efforts to support critical health research.
I've participated in this project for 6 years, and below is statistics of my CPU donations:
That chart shows that 5 years and 119 days of my CPUs ran for this project, and I returned 3,486 results to the project, ranked 19,261 out of 1,341,217 members.

2001 Grid.org partnered Intel and Oxford University to start the Cancer Research Project. I downloaded software from it and ran the program in lowest priority.
When my computer is not working, it turns to calculation of Cancer Research Project. Totally 3.7 Million computers participated in this calculation, and submitted the result to research group.

You are still welcome to donation your CPU to the following projects(copied from grid.org):
With your help, the research institutes can save money from buying expensive Super-Computers and retrieve result faster.

Sunday, April 22

Depression: Introduction

Today I was waiting in a Medicentres clinic when I found an informative handout: Depression

I found a website has exactly the same information after I got home. I don't know who has the copyright, but I guess the information is well known, and it should be delivered to people as wide as possible. So I copy the information in this blog from the website, and change the formatting as shown in the handout of Medicentres.

Diclaimer: Please ask your doctor for medical advice.


Depression

Depression in a misunderstood illness. Below are several questions many people ask about depression. Please read all of these carefully and share them with others who care about you. After reading this feel free to ask us any of your questions.

1. WHAT IS DEPRESSION? It is an illness affecting the entire mind and body, causing a person to feel miserable in many ways. Imbalances in the chemical of the brain make it happen.

2. WHAT CAUSES DEPRESSION? We don’t know. We used to think it was due to anger held in or something very unhappy in a person’s life. We now know, however, that this illness happens to people who have no reason to be depressed, and who have no psychiatric problems. In other words, this is a disease often affecting normal and healthy people.

3. DOES HAVING A DEPRESSION MEAN THAT A PERSON IS MENTALLY ILL OR GOING CRAZY? No, but it will very often make him think he is.

4. IS IT VERY COMMON TO HAVE DEPRESSION? Yes, it is the most common illness seen in all of medicine. However, it is often confused with other illnesses. For example, many people who are told they have “low blood”, vitamin deficiency, sinus headaches, low sugar, menopause, “the change” “burnout”, and “all run-down and need rest”, actually will have a depression causing their trouble.

5. WHAT TROUBLE DOES A PERSON HAVE WHO HAS A DEPRESSION? A person with a depression will usually feel most of the following things:

  1. He will feel very tired all the time, even when he has not worked or exerted himself very much. He will be just as tired on days when he has rested as on days where he has worked hard.
  2. His sleep will usually be affected in one of two ways: He will either go to sleep and then wake back up during the night and remain awake, or else he will sleep too much, even during the day.
  3. He will feel very irritable. He will get upset very easily over little things that ordinarily would not upset him
  4. He will often feel very sad for no reason, and in fact, will often break into tears without knowing why.
  5. His normal sex drive will be very much decreased. In fact, it will often go away altogether.
  6. He will often have a headache, perhaps not very severe, but present most of the time. Almost any chronic pain elsewhere, such as in the abdomen or back, can be caused by depression. These pains are not imaginary; they are quite real and often severe.
  7. He will find it difficult to enjoy things. He will feel little enthusiasm, even for things he used to look forward to.
  8. He will often be constipated, or have other digestive symptoms such as abdominal pain or diarrhea. He may lose or gain weight.
  9. He will find it difficult to concentrate, to make decisions, to remember things, to get things done.
  10. He will often feel like he is an ineffective, worthless person, even though he knows he has no reason to feel that way.


6. IS THIS REALLY A SERIOUS ILLNESS? Yes. In a mild depression the person will often think he just has a case of spring fever, or that he is just getting a little older, but his efficiency will still be affected. In a more severe depression, it can be quite serious. This is the illness that can cause a very healthy and happy person to decide to kill himself.

7. CAN A PERSON DO ANYTHING TO FIGHT THIS ILLNESS? Not by his own efforts. This is a disease over which a person has no control, and it will do him no good to “try to fight this myself”.

8. IS THERE ANY EFFECTIVE TREATMENT? Very much so! There are several drugs which are usually very effective against depression. They are also very safe.

9. ARE THE MEDICINES TRANQUILIZERS, PEP PILLS, SLEEPING PILLS, PAIN PILLS, HORMONE PILLS, OR NERVE PILLS? No, none of these. They are call antidepressants.

10. ARE THEY ADDICTING? Absolutely not. A person cannot become addicted even though he takes these medications for years.

11. DO THE MEDICATIONS HAVE UNDESIRABLE SIDE EFFECTS? Unfortunately, they do have pesky side effects. They rarely have serious side effects. They will cause a person’s mouth to be dry. Some will cause drowsiness, although this is very temporary. Others cause drowsiness, nausea, headaches and increased nervousness. There are several other minor side effects that affect some people. Most side-effects go away within two weeks.

12. ARE THESE NOT THE SAME AS "PEP PILLS" OR "UPPERS" THAT I HEAR ABOUT? Absolutely not. Pep pills give anybody a sudden boost of energy. They are all dangerous and we do not use them. Antidepressants on the other hand will do nothing to a person without a depression, but will greatly help a person who has depression, by returning his brain chemistry to normal.

13. HOW LONG WILL I HAVE TO TAKE THEM? It varies. I recommend at least six months to a year or longer. Fortunately they can be taken safely for a lifetime, as frequently required.

14. YOU SAY DEPRESSION HAPPENS TO PEOPLE WITHOUT ANYTHING PERSONAL CAUSING IT? In many cases, yes. However, many people will have things in their personal life that are bothering them a great deal, and if the depression happens during this time, then everything gets much worse. For example, if they are having difficulty with their marriage or their job, and unfortunately get a depression also, then the difficulties just get worse, because their ability to cope with those difficulties is impaired.

15. WHAT SHOULD I TELL MY FAMILY ABOUT ALL OF THIS? We strongly recommend that you have them read this paper. A person with depression will almost always find that his husband or wife is very much affected by the way he feels. Very often our family will not realize that your symptoms are due to an illness, and will think that you simply do not love them anymore! They will often think the fault is somehow theirs. It is very important that they know that this is simply an illness, just as diabetes is an illness, and that neither you nor they are responsible for it. We would welcome them to come back with you to discuss this in detail. Even though they do not really cause your depression, it is still a great help to have your loved ones understand what is happening, why you need medication, etc.

16. DOES COUNSELING HELP DEPRESSION? Yes. Research shows that learning new ways to deal with stress, conflict and resolution of past hurts helps in the treatment of depression. The medicine only changes the brain chemistry, counseling helps you develop new patterns of relating to others and your world.


ANTIDEPRESSANT MEDICATIONS

Please read the following directions until you are certain you understand them thoroughly, but call us if there are any questions about your medications.

1. Antidepressants are listed below. The chemical names are capitalized. The brand names are listed in lower case below each one.

FLUOXETINE SERTRALINE CITALOPRAM PAROXETINE VENLAFAXINE BUEROPION TRAZADONE CLOMIPRAMINE
Prozac Zoloft Celexa Paxil Effexor Wellbutrin Desyrel Anafrani








IMIPRAMINE DESIPRAMINE AMITRIPTYLINE FLUVOXAMINE MIRTAZAPINE
NEFAZODONE
MAPROTOLINE DOXEPIN
Tofranil Norpramine Elavil Luvox Remeron Serzone Ludiomil Sinequan

2. Antidepressants must be taken regularly, not just when you feel like you need them. Please don’t stop taking them because you feel better and think you no longer need them. Stop them only when we tell you to.

3. The good effects of this medication will not show themselves for two to four weeks. Some of the medications will help you sleep right away, but all of the other benefits will be delayed. Then, when the medication does begin to work, you should notice: an increase in your energy, sex drive will return to normal, headaches will go away, and the tendency to cry and feel irritable will go away; in other words, you will feel back to normal.

4. When you do begin to feel better, don’t stop taking the medication. You will feel worse again if you do.

5. It is extremely important that we see you after 2 to 4 weeks to evaluate whether our diagnosis and treatment is correct. Whatever you do, do not stop taking the medication until you see us.

6. If anything troublesome happens which you think may be due to the medication, call us and let us know what is happening. Many times the problem will have nothing to do with the medication at all. However, it is true that with a few people there may be reactions such as nausea, diarrhea, headache, dry mouth, insomnia, nervousness, agitation, sweating, dizziness, tremor and sexual dysfunction, constipation, blurred vision, or delay of urination. Such side effects are usually temporary and can be controlled with other medications.

7. You should be able to work, drive, and carry out your usual activities while taking the medicine. When first beginning the antidepressant, you should use some caution about driving or engaging in other hazardous activity until you see how the medicine will affect you. Usually you can anything you wish, especially after the first two or three days. If you are too sleepy after that, or either cannot sleep, it usually means that we need to change the type of antidepressant to one that gives more or less drowsiness, and we can easily do that by phone. So call us if that is a problem.

8. You should be aware that the safety of these medications lies in the fact that you cannot die from troublesome life situations with them[Note 1]. If for example you do not have the true medical disease of depression, but instead are only working too hard, you will receive no “energy” from these pills. If you have no true depression, but instead are simply unhappy with a life situation that would make anybody unhappy, then the pills will give no happiness. If your headache or stomach ache should be due to some other disease, the pills will be of little help. They only work when you are depressed, and then they usually give dramatic and gratifying relief to all of the symptoms. So, you can see the basic difference between these medications and such drugs as alcohol “uppers”, “nerve pills”, sleeping pills, and the like. All of these drugs can be used as an “escape” from life’s problems, and as such can be habituating. The antidepressants cannot be used in that way, and this is their greatest safety feature.

9. The following is a list of new antidepressants which are specific in action and should be taken exactly as prescribed by your doctor:
Prozac, Luvox, Zoloft, Paxil, Serzone, Manerix, Effexor. [Note 2]

Thomas R McFarland, MD
Arlene McFarland, DNS
256-845-5606


[Note 1]
[Note 2]

Sunday, April 15

My Apology

I don't know, some comments were hidden in the last year. I've never read them before, and never replied.

Below is my reply for them:


...(to be completed)



Year 2006 is the darkest year in my life. You will be able to read the details in my biography 50 years later.

Labels:

A thousand dreams of you

是的,每年到了这个时候,总是会想起张国荣。




Oh, It's time to dream , a thousand dreams of you !
It's been so grand together, yes , together .
You thrilled me from the start .
You brought the spring again .
Your fingers touched the strings of my heart
and made it sing again .
I hope you dream a thousand dreams of me .
All things we're planed doing together .
And if you do, I dream my whole life through .
A thousand , a million , a zillion dreams of you !



链接

今年本来想写一写谭咏麟的,只是俗事繁忙,前两天看到了一个blog:
怀念哥哥,因此更珍惜校长
虽然没有把我的意思全表达出来,但是毕竟珠玉在前,我就只好停笔了。

Labels:

谢谢博主的转贴
 

Wednesday, April 4

On Error ... resume next?

I am an old style of C programmer, and I am satisfied with the try...catch way in error handling:
try{
An operation that might bring error
}catch{
When there is error, how to deal with it.
}
If an error is threw outside of try...catch block, it is a run-time error, and the program will stop execute.

The Java's error handling is too aggressive. Every error must be handled. If an operation has the probability to bring error, it will be defined to throw an error, then in the program you MUST either use try...catch to handle the error, or throw the same error to other programs. I have to admit that this is a good practice. The rigid rule push you to think of error when programming. In this way you won't feel lost, when the error actually happen.


In Visual Basic/VB.NET/ASP/ASP.NET, it is a different story. "On Error Goto 0" means that if error is threw, stop the program immediately. This is the default setting. Another option is "On Error Resume Next", which means to ignore the error, keep going to execute next line. The program will be:
On Error Resume Next
operations that might throw error
if err.number <> 0 then
display err.description
end if
Why can this bring trouble? Because there is no closing line in this model. When you start using "On Error Resume Next", it will be in this status until the program is finished, or reach "On Error Goto 0" command, which is not common. So from the "On Error Resume Next" to the end of this program, any error will be ignore. If you forgot to handle that in the "if err.number..." block, then no one realizes the existence of this error, and it is not handled at all.

The worst thing is, in VB/ASP development, it is recommended to put "On Error Resume Next" on top of the program, because you should always show beautiful interface/webpage to users. All errors will be covered from users, and programmers too.

Today I read an asp code about calling CDO.Appointment to create meeting in public calendar of exchange server. The program is something like:
On Error Resume Next
.....(some operations)
Conn.Open iMbx.BaseFolder
iAppt.DataSource.SaveToContainer iMbx.Calendar, Conn
if err.number<>0 then
show error message
end if
.....(more operations)
The program worked pretty good in the last 3 years. But last month, when the new Daylight Saving Time applied, we catch error 0x8004011B(Unknow Error). So we believe it has something to do with the DST and the patches we installed during this period. So we searched a lot of articles about DST and Exchange server and CDO control. None of the methods (installing hotfix, editing registry...) works.

Finally I found one obvious mistake in one sentence between "On Error" and "Conn.Open". When I looked up, I found more mistakes. It is a mystery how this code survive for 3 years. I deleted the "On Error Resume Next" and got rid of the errors one by one. Then, the program works happy ever after.


I still like the C language way. If an error is vital, there is no way to cover it, it is OK to let the program die. We only catch the error that we can cover elegantly. We don't cover EVERYTHING, as the VB programmers do. Java pushes us to think too much about dying. I am an optimist, and I don't like that feeling.

Labels: ,

Excelent article. You really helped me with the error handling schema in VB.
 
I'm so glad it helps.
 
That would be a great season to apply for jobs. Hope it would be as good for this summer too. For some resume services Calgary, contact Ken Docherty, he personally works with your resume.
 

Sunday, April 1

Refresh Rate of monitor

I joined a local IT consultant company, and visited some clients, then I realized that there were still so many CRT monitors being used, and most of them are running in default (60 Hz) refresh rate.

Refresh rate shows how many times the computer refreshes monitor in one second. When the electronic gun hit one spot of the CRT screen, the spot will show white (or color) spot, then it will dim off immediately. That's why the electronic gun has to come back to hit this spot, after scanning the whole screen. If the refresh rate is high enough, you feel that the spot is always white; but if the electronic gun is running slow, the refresh rate is low, you can feel the spot is white , dims off, then becomes white again. This is how flicker being introduced.
The refresh rate doesn't apply to LCD monitor, because for the LCD monitor, each spot is white (or color) if the voltage of this spot is high. The spots are controlled by vertical and horizontal voltage unit, and we don't need to "refresh" them.

So, now we now that low refresh rate can introduce flicker, or monitor flashing. How low is low? Our TV sets are running under NTSC (US, 60Hz) standard or PAL(Europe, 50Hz) standard, and these standards are developed in 1930s. So I would say that 50Hz is the lowest refresh rate human can stand of. Remember, when you are watching TV, you sit 2 meters away from the TV set, but when you are using computer, you are sitting 0.3 meters away from your monitor. You have to consider higher refresh rate for computer use. If it is too low, you can't stare to it for too long.
Dizzy, nausea, or even vomit are the normal feelings if the refresh rate is not suitable for you.

Different people feel different to the same refresh rate. I am more sensitive than others. Most people can't feel anything with 60Hz refresh rate, but I can actually see the monitor flashing. When I see a new computer, I can instantly tell if this computer is using 60Hz refresh rate without check the settings. The fact is: No matter you can feel the flashing or not, it is. It is hurting your eyes.

If you want to check the refresh rate of your computer, go to Control Panel->Display:



Then in the tab Settings you click "Advanced" and open a new window. The Monitor tab will show the refresh rate. 60Hz is Windows' default value. 10 years ago, setting a refresh rate higher than the hardware's specification can harm the monitor. Now the monitor can intelligently shut down the cable, if the refresh rate is too high. So Microsoft decides to adopt the lowest rate to fit into all monitors.

About Source Safe (Team Foundation)

In the new version of Visual Studio, Visual Source Safe is integrated into Team Foundation. Leon described one annoying feature:
In VSTS (in opposite to VSS) Check Out action does not perform Get Latest Version.
There actually one option to perform "Get Latest Version" when opening a project. But this feature is not enough. It is common for programmers to open one project 2 days before checking out one file. We usually don't shutdown computer in the evening, because we have so many windows(IE Windows, Firefox, notepad, Windows Explorer...) open when doing programming, and those windows are scrolled down to the perfect place where we can find what we want right the way. We want to continue our work next day when we get in the office. In these 2 days when the project is open, maybe some colleague made modification of the code. If you check out without getting latest version, you will have problem when you check in: The Team Foundation will say there is a conflict, and asked you to choose "Auto Merge" or "Manual Merge". I am not sure about "Manual Merge", but I did select "Auto Merge" and all my modification is lost.

Last week Leon wrote an add-on to get latest version before checking out. You can try it out.

Last week I bring my laptop to client's site to collect user's feedback and debug my program on-site. It is challenging to do debugging when a client looking over your shoulder and waiting to see the new program. But that is not what I am trying to talk here. The problem is, when I came back from client site, I manually copied my source code to my working desktop to replace the old version in the project, and check it in to Team Foundation. When I performed "Compare to history", I surprisedly found that
the filldiff said everything is changed. In one file, I only edited one line, but now it's hard to find which line is different, because it shows that the whole file is different. It should be easy to solve this problem, isn' it?

Labels: