Eddy Chang

Greenhorn
+ Follow
since Apr 05, 2001
Merit badge: grant badges
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Eddy Chang

Source: http://www.visalaw.com/blog.html
Press Office
U.S. Department of Homeland Security
February 17, 2004
Contact: USCIS, Public Affairs
202-353-8472
Press Release
USCIS ANNOUNCES NEW H-1B PROCEDURES - REACHES CAP
Washington, D.C.-- U.S. Citizenship and Immigration Services (USCIS) announced today that it has received enough H-1B petitions to meet this year's congressionally mandated cap of 65,000 new workers. After today, USCIS will not accept any new H-1B petitions for first-time employment subject to the FY 2004 annual cap.

[Full text removed--Mark Herschberg]
[ February 20, 2004: Message edited by: Mark Herschberg ]
20 years ago
I also recommend reading Knock 'Em Dead 2004 by Martin Yate and How to Win friends and Influence People by Dale Carnegie
Other books to consider taking a look at are Resumes That Knock 'Em Dead and Cover Letters That Knock 'Em Dead.
If you are not sure about buying these books, take them out from your library and give them a test drive.
Are you willing to post your resume online so that we can take a look at it and give you feedback?
20 years ago
If it is a deadlocking problem, if you generate a thread dump for all the threads, and look at the stack traces, you should be able to identify where the deadlock is occuring is quite quickly.
Generate a thread dump for all threads in the jvm.
For unix machines: kill -QUIT process_id
For windows machines: CTRL+BREAK in the console window.
Look for threads in the "wait" state, and check out the stacktrace for those threads.
To identify which threads are in the wait state, read here:
http://developer.java.sun.com/developer/technicalArticles/Programming/Stacktrace/
If there are multiple threads in the wait state waiting for the same object/lock, that could point you to the code that is deadlocking.
Or the problem could be caused by an infinite loop somewhere in your code which the stacktraces generated by the thread dump will identify for you.
Eddy
20 years ago
Message as seen here: http://www.chunder.com/text/tellmeitaint.html
> Date: Thu, 26 Feb EST 12:44:58 -0500 (EST)
> From: bs@day.research.att.com
>
> Sorry to send you a form letter, but I have now received dozens of
> copies of that "IEEE interview" hoax. Yes, it is (obviously) a hoax.
> No, it is not a hoax done by me or any of my friends; had it been,
> it would have been less crude and more funny.
>
> If you want information about C++, see my articles and books.
> You can find references, articles, book chapters, and even a couple
> of genuine interviews on my homepages.
>
> - Bjarne
>
> Bjarne Stroustrup, AT&T Labs, http://www.research.att.com/~bs
20 years ago
Anything data that is sent over a socket regardless of the application should be in network byte order, ie big endian. Byte order is hardware dependent, ie intel x86 cpus are little endian and motorola cpus for example are big endian.
Java will send data for you in network byte order (big endian) so if your C++ application is on an intel cpu, then you will need to convert from big endian (network byte order) to little endian to be able to interpret the data properly.
The c++ application should call ntohl (network to host long) and ntohs (network to host short) to convert big endian integer values to the local host little endian values. You do not need to do any conversions for ascii strings. If you are sending floating point numbers, you will need to send those as a string and then convert the string back into a floating point value. Similarly, you could send the interger values as a string and then convert the string back to an integer.
This link may explain things clearer.
http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&th=18cc9e8a8f1cf78c&seekm=VA.000000be.0086bef3%40trmphrst&frame=off

Would using the java 'byte' data type instead of 'char' work?
20 years ago
On linux.

$java -version



$java test &
The other java processes listed are child threads spawned by the jvm.

$ps auxwwf | grep echang


What are the other threads? The ones listed in the thread dump.
$kill -QUIT 5257


[ April 07, 2003: Message edited by: Eddy Chang ]
20 years ago
The next time the application deadlocks, here are some things to try to determine if the deadlock is a result of a synchronizing lock in the java code or a result of a row lock in the database.
Generate a thread dump for all threads in the jvm.
For unix machines: kill -QUIT process_id
For windows machines: CTRL+BREAK in the console window.
Look for threads in the "wait" state, and check out the stacktrace for those threads.
To identify which threads are in the wait state, read here:
http://developer.java.sun.com/developer/technicalArticles/Programming/Stacktrace/
If there are multiple threads in the wait state waiting for the same object/lock, that could point you to the code that is deadlocking
or which finder methods are being called.
View the sql statements currently being run against oracle. I don't know the exact sql, but the v$sqltext and v$session tables will be of use. Do a search in deja.com for some usable sql. Depending on what sql statements you see and
how many occurances of the same sql statement you see, that will give you some hints into which tables/rows might be causing the deadlock.
http://groups.google.com/groups?selm=59ccou%24gqc%40atglab10.atglab.bls.com&output=gplain
select a.sid, a.username, b.sql_text from v$session a,v$sqltext b
where a.sql_address = b.address and a.sql_hash_value=b.hash_value
and a.username is not null and a.status = 'ACTIVE' and a.user# != uid
order by a.sid, b.piece;
Hope some of this helps you identify the deadlocking problem.
Eddy
20 years ago
Comparing timestamps is not completely reliable in detecting changes to a file. You can compare checksums of the file, using a md5 or crc32 checksum to determine if the file has changed.
You could do something like this:
1. The client calculates the checksum of it's files.
2. The client sends the checksum to the server.
3. The server calculates the checksum of it's file and compares it against the checksum that the client sent over (the client's checksum).
4. If the checksums do not match, then the server must have a newer file, send the file to the client.
As for the java code to calculate the checksum, you can probably find something using a search engine since I haven't done this before in java.
java.util.zip.CRC32 in the JDK and http://www.ietf.org/rfc/rfc1321.txt might get you started.
Eddy
21 years ago
Maybe this will help.
Running a Java 2 Application as an NT Service http://www.kcmultimedia.com/javaserv/
Eddy
22 years ago
When I made my reply above, I was going from memory, and I hadn't looked at Table 1.1, p10 of GoF. Now after reading the paragraphs below p10, it looks like my generalization is incorrect considering that most patterns use inheritance to some extent, and I can't come up with consistent examples to validate my statements. I should do more research before posting next time :-)
Eddy

[This message has been edited by Eddy Chang (edited June 04, 2001).]
The way that I distinguish object level and class level patterns, is that if it uses inheritence, then it is a class level pattern. If it uses composition, then it is an object level pattern.
Eddy
After thinking about this some more, a pure proxy pattern would not be used, but instead possibly a variation of the proxy pattern. Mark Grand has a documented a Cache Management pattern in his Patterns in Java book.
For a brief description of the Cache Management pattern, check out http://www.clickblocks.org/patterns1/pattern_synopses.htm
Eddy
Warren,
I don't have an answer to your question, but I would be interested in hearing what environment you application is being developed in (windows or unix), and which parts of your program you are programming in java and which parts in c++.
I thinking about writing a client ui application in win32 and using JNI to run a JVM so that I can program the networking component using JMS in java. I know that everyone will probably say to program the entire thing in java with swing, but i'm just thinking about this idea.
Eddy
22 years ago
To clarify my previous post, caching the pages sounds like a proxy pattern. Changing the state of the browser using the back and forward buttons sounds like a memento pattern. So it sounds like both patterns are used!
Eddy