Computers

How to fix multiplayer_msg_general_failure

In Heroes of Might and Magic IV (aka Heroes of Might and Magic 4, HOMM 4, HOMM IV) this error occurs when the name of the executable used to launch the program differs:

multiplayer_msg_general_failure

The content of the executable does not matter, it is the name. So both must use for example h4tour351.exe, even though in Equilibris 3.51 it has the same content as h4mod.exe.

Thursday, November 6th, 2008 Computers No Comments

JNI (Java Native Interface): Exception in thread “main” java.lang.UnsatisfiedLinkError: Can’t find dependent libraries

How to fix UnsatisfiedLinkError in JNI

I have never had problems with JNI. In the few situations when I needed it, it just worked. But last week someone asked me for help with his problem. When I tried to reproduce it, I found out that it had spread even to my old JNI programs which worked until 2006!

When running a program that uses a native function the following error occured:

Exception in thread "main" java.lang.UnsatisfiedLinkError: Test.dll: Can't find dependent libraries

It’s obviously a linker problem related to the generation of the .dll file. I have no idea why it occurs now and didn’t occur in the past. Different OS, compiler version, something like that? For some reason both the linker of Visual Studio and the linker of GCC started to think that is was a good idea to replace all method names by some arbitrary name which then cannot be found at runtime.

Fix for GCC

To fix that with GCC, the linker opion --add-stdcall-alias can be used.

gcc -Wl,--add-stdcall-alias -mno-cygwin -shared -I/cygdrive/c/Program\ Files/Java/jdk1.6.0_05/include -I/cygdrive/c/Program\ Files/Java/jdk1.6.0_05/include/win32 -o HelloWorld.dll HelloWorld.c

Fix for Visual C

For Microsoft Visual C Compiler it should theoretically be possible with a linker option as well.

Find out the correct linker option

First compile and link in the usual way that didn’t work. This will create the .dll file which results in the error we are talking about. Then use the dumpbin tool to list the procedure names:

dumpbin HelloWorld.dll /EXPORTS

You will find your procedure name, something like _Java_HelloWorld_print@8. Now try to guess what the name should be. My guess in this case would be Java_HelloWorld_print. This would result in the linker option /EXPORT:Java_HelloWorld_print=_Java_HelloWorld_print@8

Supply the linker option
  1. Use a #pragma comment in the source file:
    #pragma comment(linker, "/EXPORT:Java_HelloWorld_print=_Java_HelloWorld_print@8")

    OR

  2. Split into linking and compiling and provide the option to the linker in the command line, OR
  3. Supply it to the compiler at the end using /link:
    cl -I"C:\Program Files\Java\jdk1.6.0_05\include" -I"c:\Program Files\java\jdk1.6.0_05\include\win32" -MD -LD HelloWorld.c -FeHelloWorld.dll /link /EXPORT:Java_HelloWorld_print=_Java_HelloWorld_print@8

Option 3 is probably the easiest. After that dumpbin will show that now there is an additional procedure with the correct name:

dumpbin HelloWorld.dll /EXPORTS

I even compared it with the working .dll I created with GCC (see above), and it looks the same! But it doesn’t work, still getting the same error!

50 USD through PayPal for a solution and an explanation why the current way doesn’t work even though the procedure name is the same as in the working .dll created with GCC. (Only the first solution gets the price; only valid as long as this text is here.)

Monday, September 22nd, 2008 Computers No Comments

uCertify review

Recently the PR department of uCertify approached me and asked me to blog a review about their exam preparation kit. Since this is an interesting topic to me (see my posts Whizlabs vs. Enthuware, and Effective Enthuware) and since I would get a free simulator, I agreed.

uCertify produces preparation kits for many different IT certifications, including SCJA, SCJP, SCJD, SCWCD, SCBCD, SCMAD and SCDJWS. I got the one for SCBCD 5.0 (Sun Certified Business Component Developer for the Java Platform, Enterprise Edition 5, CX-310-091), which costs USD 59.99, to test it. I used the uCertify PrepEngine Version No: 12.21.05.

Strengths

  • A nice looking user interface with good usability, especially regarding all the little things. For example it is possible to click on the answer itself, not only on the checkbox next to it. Several keyboard shortcuts are available.
  • It has an optional study mode for every kind of test. When enabled, it says immediately which answers were wrong, rather than evaluate all answers only after they have been given. This provides a more harmonic way of learning and measuring progress.
  • It automatically shuffles the order of the answers. That’s an awesome feature that I miss in Enthuware and Whizlabs! It prevents me from remembering the position of the right answer instead of really learning the right answer.
  • The explanations to answers are good and include diagrams where it makes sense.
  • Huge amounts of study material are included! It is not only a simulator, it is a full preparation kit, just as promised.
  • Aside from the option to study the topics using small articles in the style “What is the PreDestroy method?” and larger articles about complex topics, there is an interactive mentor that almost provides the feeling of having a real private teacher. In small chunks it presents the exam topic as specified by Sun, then explains it, and afterwards asks me a question about it to check whether I understood it.
  • There is a feature to discuss any single question with others, similar to a forum thread. Once there are more users this can be very useful. I tried it a few times, and it took more than a day to get my comments “approved”. Hope that gets better.
  • Questions can be assigned a custom tag. For example I can give several questions the tag “unsure” or “do again before exam” and then create a custom test based on the tag. I would highly recommend to use this feature to assign box IDs according to the Leitner System, similar to how I described it for Enthuware in Effective Enthuware. (Note that numbers and short names are problematic, so use for example “bbbb” for box 2.)

    uCertify custom test screen

  • There are lots of features which I didn’t cover in this review, because there are so many. I covered the ones I considered important to my way of learning, but one of the other ones might just be the feature you always wanted.
  • Question quality and exam topic coverage: I trained for a section using Enthuware until I was able to answer all questions in Enthuware corectly. After that I tried questions for the same topic in the uCertify simulator. I passed on the first try, but there were some exam-relevant topics that had not been covered enough in Enthuware! (Concrete example: It is possible to get through the Enthuware questions without fully understanding MEMBER [OF] in JPQL. uCertify did not let me get away with that.) Nothing against Enthuware - it is possible that this test would have worked the other way round in the same way. Simulators have different strengths and weaknesses.

Weaknesses

  • It doesn’t have a direct way of selecting a range of questions. For example I can’t easily create a test with questions 1 - 6 of topic X and later questions 7 - 12 of topic X. (To do that, I have to add all questions to the pool, sort by ID, then delete some of them, remember which ones I deleted, do the others later.)
  • Support. I used the general support, not the one for paying customers, because I am not really a paying customer. My questions were answered only partially sometimes, and one of three support requests was ignored completely. Let’s just hope they provide better support for normal customers.
  • The license is complicated. I asked the support about it, but still don’t understand if I can install the product years later on different hardware. An on-line activation is required. I wouldn’t recommend buying it if you are planning to use it for longer than a year, unless you sort this out.
  • Getting the custom tags, an important feature (see above), to work was a challenge. First I tried tags like “1″, or “2″, and they just didn’t show up in the custom test dialogue. Then I tried “a” and “b”, still no success. So I tried “11111″ (maybe it’s a length issue?). Then it showed up, but when I tried to add the questions with that tag, only two or three, it added more than 100 to the question pool. In brief, my impression is that there are certain rules for tags: 1. At least 3 or 4 chars; 2. no numbers (or not only numbers?).
  • Portability - requires Windows. Maybe one of the thin emulators like Wine can handle it? VMware certainly can.
  • The integrated help is a single, huge page.

Conclusion

uCertify provides more than Enthuware or Whizlabs. I cannot answer the very important question of which simulator provides the most relevant questions regarding the real exam, and if someone who uses the complete preparation kit of uCertify will get a better result in the real exam than a low budget learner with Enthuware plus free study material. More fun with uCertify - well, that’s indeed possible due to the nice user interface and the interactive mentor. The complicated license and poor support are a problem.

Register to get a 10 % discount on any uCertify PrepKit.

Friday, July 25th, 2008 Computers 4 Comments

Glassfish: WebService in Session EJB

I just got the strangest error message when trying to use a stateless session EJB as a WebService in Glassfish v2 u1:

[#2008-07-13T16:41:25.366+0200SEVEREsun-appserver-pe9.0javax.enterprise.system.tools.deployment_ThreadID=12_ThreadName=Thread-31_RequestID=d816d64c-543d-47ac-b339-2231f346754eException occured in J2EEC Phase
com.sun.enterprise.deployment.backend.IASDeploymentException
	at com.sun.enterprise.webservice.WsUtil.runWsGen(WsUtil.java:1817)
	at com.sun.enterprise.webservice.WsUtil.genWSInfo(WsUtil.java:2089)
	at com.sun.enterprise.deployment.backend.AppDeployerBase.loadDescriptors(AppDeployerBase.java:328)
	at com.sun.enterprise.deployment.backend.AppDeployer.deploy(AppDeployer.java:200)
	at com.sun.enterprise.deployment.backend.AppDeployer.doRequestFinish(AppDeployer.java:129)
	at com.sun.enterprise.deployment.phasing.J2EECPhase.runPhase(J2EECPhase.java:169)
	at com.sun.enterprise.deployment.phasing.DeploymentPhase.executePhase(DeploymentPhase.java:95)
	at com.sun.enterprise.deployment.phasing.PEDeploymentService.executePhases(PEDeploymentService.java:871)
	at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:266)
	at com.sun.enterprise.deployment.phasing.PEDeploymentService.deploy(PEDeploymentService.java:739)
	at com.sun.enterprise.management.deploy.DeployThread.deploy(DeployThread.java:174)
	at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)
#]

Apparently there is a problem in this Glassfish version that prevents it from showing the proper Exception as JAX-WS reports it. The verifier only barfed random shit at me, too.

I updated to the lastest Glassfish to get a better error message, but then it even worked without an error. Strange days.

Sunday, July 13th, 2008 Computers No Comments

VMWare asynchronous TSCs on Opteron

A rare VMWare error message is this one, occuring when the virtual machine is being launched:
Your host does not have synchronized TSCs. Please read VMware Knowledge Base article 2041.

Your host does not have synchronized TSCs. Please read VMware Knowledge Base article 2041.

When that error message pops up it is likely that all sorts of time-related things will go wrong in the guest system: Video playback, audio for the video, double-clicks.

An example environment where this can occur:

  • Host system Windows XP
  • CPU AMD Opteron for socket 939 (175, 180, 185, 190)
  • Certain drivers, such as those installed by MSI Live Monitor (AMD CPU Driver 1.3.2.16?)

Fix

I fixed the problem by adding these lines on the bottom of the .vmx file:

processor0.use = TRUE
processor1.use = FALSE
host.noTSC = "TRUE"
ptsc.noTSC = "TRUE"
host.TSC.noForceSync = "TRUE"

That way the guest system only has a single core CPU and only one core of the Opteron helps to emulate it, but that seems to be the only disadvantage.

Saturday, July 5th, 2008 Computers No Comments

Whizlabs vs. Enthuware

I bought several exam simulators for mock exams:

  • The one for SCJP 5.0 (CX-310-055) from Whizlabs
  • The one for SCWCD 1.4 (CX-310-081) from Whizlabs
  • The one for SCBCD 1.3 (CX-310-090) from Whizlabs
  • The one for SCDJWS (CX-310-220) from Whizlabs
  • The one for SCEA (CX-310-051) from Whizlabs
  • More recently: The one for SCBCD 5.0 from Enthuware

License

Enthuware uses a pretty normal end user software license, while Whizlabs plagues the user with a complicated activation procedure, only to limit the use to three CPUs! So when the user upgrades the CPU or gets a new computer, the license is lost. The three CPUs for which it works have to be chosen within 6 months after the purchase. That makes it pretty much useless for what I bought it, which is to keep my knowledge about topics that I currently don’t need at work up to date. Whizlabs simulators cannot be used for that. This is not much of an issue when the user wants to learn for a certificate and will never need the simulator again afterwards.

Learning process, repetition scheme

Whizlabs simulators have certain features which try to adept to the user (”adaptive testing”). As far as I know they do not follow proven methods from the field of education science, though.

Enthuware’s direct support for such features is limited. However, its comment system provides great flexibility for custom systems. My article Effective Enthuware describes how to use the Leitner System in the Enthuware Test Studio. That is the system for this type of learning.

Supported Platforms

Enthuware Test Studio requires JRE 5.0. The Whizlabs simulators support all common Microsoft Windows versions.

Errata

Enthuware Test Studio provides a direct link to the Enthuware forum post in which that question is being discussed. That can be helpful to find out if the proposed answer is incorrect, but recently I was usually the first one to check that out, so there were no other comments about that question.

Useability

Whizlabs has a Flash based GUI. It works well, but most things must be done with the mouse.
Enthuware uses the common key and mouse bindings for GUIs (Swing with system’s default L&F).

Price

For most exams the Whizlabs products are a little more expensive than the Enthuware products. For example Whizlabs SCBCD 5.0 Preparation Kit for USD 74.95, Enthuware EJB+ Full Version for USD 29.00.

Question Quality

The big unknown. I do not know anything about a conclusive study regarding the question qualities. They are both at least okay.

Question Quantity

Untransparent for Whizlabs products, and varies from product to product.

Conclusion

I recommend the Enthuware products. The knock-out arguments are the license and the Leitner System support. A really nice objective test from a huge organisation would help, like the tests we have for cars and such, a test which would also examine question quality and study time / exam result ratio. But this market is just too small, so you have to do with subjective reports like mine.

See also the Effective Enthuware article.

Tags: , , , , , , , , , , ,

Friday, July 4th, 2008 Computers 3 Comments

Ignore my IP in AWStats

I use AWStats to get statistical usage information about my websites. The problem is that for less important websites like my private one I often test and develop directly on the production system. That creates many garbage entries in the HTTP log.

AWStats has the option SkipHosts for the configuration file, but my IP changes all the time.

So what I did was this:

Modify awstats.pl

...
if ($param =~ /^SkipHosts/) {
    @SkipHosts=();
        #foreach my $elem (split(/\s+/,$value)) {
        #       if ($elem =~ /^REGEX\[(.*)\]$/i) { $elem=$1; }
        #       else { $elem='^'.quotemeta($elem).'$'; }
        #       if ($elem) { push @SkipHosts, qr/$elem/i; }
        #}
        ####
        my $ips="/home/whoever/ips.txt";
        open(DAT, $ips) || die("can't open ip list");
        my @lines=<DAT>;
        close(DAT);
        foreach my $line (@lines)
        {
                chop($line);
                my $esc='^'.quotemeta($line).'$';
                push @SkipHosts, qr/$esc/i;
        }
        ####
        next;
        }
...

(You may want to keep the old code which I commented out and concatenate it with your values for @SkipHosts.)

Log my IPs

How that can be done depends on the situation. In my case I can safely assume that I have logged in to the web server over ssh with most IPs that I would use, so I added this to the .bash_profile:

echo $SSH_CLIENT | egrep -i -o '([[:digit:]]+\.){3}[[:digit:]]+' >> ips.txt

Hope it helps someone.

Tags: , , ,

Sunday, June 29th, 2008 Computers 1 Comment

Effective Enthuware

Based on my certifications I have a some experience with exam simulators and mock questions from other sources. The years I served as a student assistant at the Leibnitz Institute for Science Education as well as my personal interest in this topic supplied me with a background in learning techniques. This post describes how to apply the Leitner System to the Enthuware Test Studio.

The Enthuware Test Studio is a software that can mock a test environment and provide various additional exam preparation tools. “Question Banks” can be purchased for it and loaded. I bought the Question Bank for the Sun Certified Business Component Developer for the Java Platform, Enterprise Edition 5 (CX-310-091), because I have the old version of the certificate and want to upgrade.

The Leitner System

The Leitner System is a method of grouping questions based on how often and when they need to be repeated. Enthuware Test Studio does not directly support it, but unlike Whizlabs it provides an indirect way using the study notes.
Enthuware Test Studio Missed Questions

  • When an answer is wrong, the question will end up in the section “Missed Questions” automatically
  • That section shows the questions in a table which can and should be sorted by the custom note (”My Note”)
  • After a missed question has been tried again, enter the corresponding box number of the Leitner System as a note using the “Edit Note” button on the bottom of the question window. (Increase number for correct answer, back to box one for wrong answer.)
  • Re-order by “My Note” when the boxes changed. Repeat questions in a frequency based on their box number (low numbers more often).

Shortcomings:

  • Only questions that have been missed the first time will end up in the “Missed Questions” section, although according to the Leitner System they would still have to be repeated a couple of times in decreasing intervals. But especially when time is short this can also be an advantage. If any questions can be skipped, then those which had been answered correctly at the first attempt.
  • It is possible to memorise the position of the answers in a multiple-choice or single-choice question, because Enthuware Test Studio does not support shuffling the order of the answers.

I found those shortcomings to be acceptable.

Overall learning approach

  • Learn the basics about the test subject from a general book or tutorial and practice. (The Sun EE Tutorial is great for SCBCD, SCWCD and SCDJWS.)
  • Study a single exam topic from the certification, for example in Mikalai Zaikin’s study guides
  • Make a custom test in Enthuware Test Studio with a subset of the available questions for this exam topic (not too many) and take it.
  • While repeating this routine for the other questions of the same exam topic and later for other exam topics, integrate repeating of missed questions based on the system above into your daily routine.

Tags: , , , , , ,

Sunday, June 29th, 2008 Computers 2 Comments