mike zhang

Ranch Hand
+ Follow
since Feb 26, 2002
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by mike zhang

Originally posted by Ron Newman:
Does the file's contents ever change (because of some other program's action) while your servlet is running?
If not, you might consider writing a small Listener that reads the file and stores its contents in a ServletContext property. That way, you'll only have to read the file once, and you'll safely do so before the servlet is ever invoked.


well, the problem is I may have thousand files and their contents are fixed.
However, the problem is "which" file will be read is run time dependent. It depends on what user picks from some GUI, for example if user chooses "Europe"/"London"/"stock"/"report1", then it will read a specified file that matches to this criteria (the files are created in advance). So it is hard load so many files.
Is there any other way to ensure the the thread safe ?
21 years ago
I want to do 2 things: find out the unix machine name, and finds if a specified file exists in a certain directory.
I am familiar with unix script so I know it is very easy to do it using script (use 'uname'..). Can somebody tell me what's the java syntax to do these two things on unix (assume my code is on UNIX only) ? Plus, in java, is it fast to find if a specified file exist in a certain directory assuming there may be 1000 files over there ?
thanks,
21 years ago
Hello,
In my servlet, it opens a file located on the server and gets its content (a special HTML string), then it sets this content as an attribute and forward to a JSP. In the JSP, it gets this content string and display it.
I know there are MANY ways to accomplish the same purpose. but, assuming I just want to open a file on the server and then read its content(String) and set in an attribute to JSP, the question is --- Since there will be MANY requests coming in, so is it safe to let the servlet open and read the file and then close it ? will there be thread issue ? Be reminded, I ONLY read that file, I don't write or modify it.
Thanks,
mike
21 years ago
You are right, Mr. Young. I will immediately quit from this topic discussion.
22 years ago
Rufus wrote;
**************
I see why the company likes you.
Did you really think your collegues were going to bash you at lunch?
I don't have the time to explain things to you, Rich doesn't have the patience.
**************
Do you really think I "need" your explanation ?
I just wish you could explain to yourself well, don't worry about others.
BTW, you said "Rich doesn't have the patience."
Pardon me ?
22 years ago
Holmes wrote;
********
I think we all look miserable, don't we? Lets look at the root of the problem, not its leaves.
********
Holmes, not everyone can see this point as you can...
22 years ago
Rich wrote:
**************
If you really got your MSCS "from a USA top 30 CS graduate school," they should be ashamed. It must be an easy program to complete.
**************
Rich,
They are not ashamed. They like me. I worked as TA for one year and RA for one year. When I left the professor wanted me to stay to work with him.
You said I can't count, maybe I really can't 'count' because I have covered too much in mathmetics from Partial differential equations to numerical methods, from advanced probability to statistics, from graph theory to number theory, I have learned much more than CSMC required courses. That's why the CS department asked me to teach some undergraduate kids "discrete math" in the summer, it was fun for me. Again, it is top 30 CS graduate school and it is in east coast... People understood that I have bit accent but we communicated perfectly. As a matter of fact, these days if you go to any top 10 US schools, you will see many professors who are immigrants and came here as "guests" first. They are all more knowledgable than you Rich. Rich, I don't need your evaluation, I got excellent evaluation from professors, boss, colleagues, friends, most Americans I know, that's enough. Your words doesn't mean anything to me.
Following your logic, we should also send those non citizen graduate students home because they take the schlarship and TA/RA positions. As long as there is one American who is qualified for that TA/RA position, that foreign student should be sent home. So, Rich, I guess you should make another web site to propose that, hah ?
22 years ago
Rufus wrote:
***********************
It was on the TV show, maybe it's not on the web page. I'm pretty sensitive to immigration issues.
I don't think I heard something that was not said.
Mr. Truth, I'm just sniping the Indians like the Indians ( and the rest of the world ) have sniped US so many times. If you go back in this thread, I make a clear statement about the foreigners taking pot shots at the natives. We're tired of it.
If you go back in history, US was the cheap labor that put Italian shoemakers out of business. This is the beauty of the free market system. Free trade has been a problem, for some. for a long time.
I have more foreigner friends than I do natives.
I carry the native American blood. My British cousins visited India. They used to wear red coats.
Correcting the injustices in the H1-B system will benefit east and west.
We have many problems to solve with IT: cancer, AIDS, pollution and unreliable utilities.
Humanity needs the brain power of Asia.
The US labor force cannot adapt at the speed of light or in internet years.
We are a society and when some won't follow the laws, anarchy is likely to break out. If we were to throw a necktie party for an H1-B person, you would denounce us as murderers. We just broke a law, what's the big deal?
*******************

??? Guess I need some help in interpretation.
22 years ago
Rich,
it seems your recent two message shows more wit than your former ones. At least you stay calmer, that's what I like. That's step one in changing attitude.
when you feel others are doing name calling on you , don't you feel you are doing some childish things when you do those spelling and typo catching on others ? Here, I don't want to keep going that way to divert the topic.
just as you said "A very small group of wealthy individuals, corporations and PACs control the political process". Their decision may significantly help or hurt the Americans' lives.
In this modern world, no country should and could completely closes its door to foreigners. When a boat hits a rock and water starts leaking into it, the first thing is to see if the hole can be fixed or blocked (may not be a proper terminology), instead of pushing some people into water to drop the weight. I don't know why some people like to focus on the minor part instead of the critical issues. I can tell you : those 50,000 H1B visa include lot of people who is holding the jobs. I have never heard such a thing these days in any country: Company asks foreigners to quit job just because they need to make rooms for citizens. I mean, if this foreigner is just laid off, I agree he/she should go home. But it is unfair to force him/her to quit the job if he/she is working on it well. That's why I say your idea of "sending all H1B home" is unfair and wrong.

As for you mentioned some companies "illegally" hired H1B visa by underpaying them. I think it is just case by case. There are always some people abusing the laws. they abuse everywhere, like Enron, MCI, those CFO/CEO are real killers to American employee. How much can 50,000 H1B people make annually ? how much did those bad guys make in the fraud ? My point is, we can NEVER 100% prevent any bad guys from taking advantage of policy, we can set more strict laws to monitor, but by no means should we completely abandoning it just because there are some bad guys and companies.
If you propose to setting up a strict monitoring law for this H1B, I totally agree with you. But your slogan is "sending all of H1B home". I don't think it makes sense.
22 years ago
Rich,
I think any kind of verbal argument doesn't mean anything. Let the fact talk. By the end of this year, if your proposal of "sending all H1B and/or non-citizen" comes true, I will post a message "I am a loser". If you fail, I just need you to post "this is Rich who whined for months, but my proposal failed".
Let us wait to see who will fail.
22 years ago
Rich,
Once again, I truly don't want to offend others using word "loser". But that word first came out from another person (I forgot the name) who replied to your thread. And I felt there is indeed something wrong with your attitude. Why am I not the only one who uses 'loser attitude' on you ??
Don't just blame others, blame congress, president, country. Look at you, look at yourself, from the first message to the end, your abnormally keep whining and whining without any rest. How many people support you ? Ask yourself. What image have you left to others ? I happened to mention your name to few fellows in today's lunch. All of their response is "we always have such people, don't bother with them. let them whine." These fellows are all Americans.
22 years ago
Rich wrote :
*********
mike,
Again, I find your "loser" statement to be offensive. You do not know me. You do not know how much education I have. You know nothing about me except you have trouble matching wits with me.
If you really got your MSCS "from a USA top 30 CS graduate school," they should be ashamed. It must be an easy program to complete. If your "minor field is applied mathematics," you must be joking. You could not even count.
I went to highly rated universities for both my BS and MSCS. By the way, my GPA was 3.9 at both universities. Obviously, they both produce more polished individuals than the school you attended.
Rich
***********
Rich,
I think your university should be shamed to produce sore losers (In the beginning I was hesitating to use this word, but your consistent clown behavior made me feel it is very proper to use it for you...) who can only whine, cry, "intelligently" argue that other people can't count because they had a typo in the number. I am impressed by what kind of intelligence you have. Why do you think there a "wit match with you" ? Come on, I said "loser" because I saw your negative attitude, I have no intension to make any education or other background comparison with you. Your background means nothing to me I totally don't want to know, let alone compare with you. I can accomplish all this kind things by using a second language in a second country. How about you ? You were born and raised in this country, and eventually you can just beat some others on English grammar and catching their number counting error ? Like 1-2-3, if they count as 1-2-2 accidently, you say they can't count. Wa, you are the man. Real smart American man !

you say you are polished ? Wa, Wa, polished to wine, maybe ? Degree doesn't represent everything, GPA doesn't stand for your intelligence. We all have high GPA. What really means something is attitude. US Air Force has a saying "Attitude determines altitude". With your attitude in life, you will never to able to really succeed (maybe you view your little accomplishment as 'success').
22 years ago
Posted by Rufus:
*****************
Mr. Truth usually you like to flaunt the magnificence of thousand years old culture.
Mr. Truth usually you like to point out how smart the H1-Bs are.
Electricity is unreliable.
Pollution is terrible.
Water is unreliable.
Maybe your should not entertain me. May be you should go home and clean up your country.
***********
What country is this ? India ? We have never been there. Look at your sentence "Maybe your should", "May be you". Are you trying to confuse non native English speaker ??
Using your quote -- "Many rules were made before you were born", AND US IMMIGRATION RULE IS JUST ONE OF THE RULES, man.
22 years ago
John, those US companies provided jobs, true, otherwise how do they make money ? But they hurt the local job market stability and many other local companies have to lay off the workers, so the scenario is: they create 1 job, but 5 more workers lose their jobs because of them. are many local labor association propose to kick those US companies owners out.
What I want to say is -- I disagree with those local workers in my home country, just like I disagree with Rich. I believe every country should allow certain level of competition including source from foreigners. This kind of competition is healthy and beneficial to the country. For example, USA imports so many Japanese cars, why ? because they are good and reliable. Have you or your relative or your American friends bought a japanese car ? Why don't you or they refuse to buy it and only buy US made cars ? Don't think ever think they occupy your market (They also hire local US workers)? (I am not a Japanese..) Maybe you do, but fortunately we are glad to see those American car manufactures are catching up, Buick is no longer a silly tank, and Ford is no longer something enjoying being seen by mechanic. Why ? Because competition forces them to improve.
22 years ago
Jason,
You said "In my home country there are also some US owned companies...
Who employ almost all local workers. Not the same thing.
"
You only think about the employee part -- whether they are local or US people. My point is: These US companies bring competition to local companies and some of the local companies failed or went bankrupted during the competition. This brought big issue of unemployment for local people. But those USA companies are still running there. So, what's wrong with those H1B workers in US ? Why can't they add competition to US labor market ? Of course you can say it is not US companies' fault to beat local ones in the competition, then I will say you better not complain that US citizens failed in job market competition here.
22 years ago