/* Quick and dirty pre-loaded DSO to make buggy javawsbin in JDK 1.4.2_07 work on Linux with kernel 2.6.x and glibc 2.3.4.Compilation: gcc -O2 -fPIC -g0 -shared -o mywait.so mywait.c
Usage (Bash): LD_PRELOAD=/path/to/mywait.so /path/to/javaws <Launcher URL> */ #include <dlfcn.h> #include <sys/wait.h>
int (*real_waitid)( idtype_t, id_t, siginfo_t *, int);
int waitid( idtype_t idtype, id_t id, siginfo_t *infop, int options) { int retVal = -1;
void *handle = dlopen( "/lib/libc.so.6", RTLD_LAZY); real_waitid = dlsym( handle, "waitid");
options = (options == 0) ? WEXITED : options; retVal = (*real_waitid)( idtype, id, infop, options);
dlclose( handle);
return retVal; } /* End pseudo-waitid() */
On a system where this bug does not manifest itself, I used "ps --columns 2000 -e -o "%a" | grep javaws" to grab the command line that is used by this executable to spawn the Java VM. I tried modifying this command line for my system (adjusting paths) and running it but it failed trying to download the JVM from Sun's site. After a bit of snooping around, I found out that it was looking for a file named "deployment.properties" in "$HOME/.java/.deployment" that is populated by the wrapper executable with the information on the JRE being used. So I just copied this file over from the system where stuff works and adjusted the paths. It finally worked as expected, albeit without the splash screen (which I do not regret losing at all).
Acrobat Reader
If you remove the utterly useless plug-ins from the Acrobat Reader installation folder, it starts up much faster.
As for Evince, my PC only has KDE and therefore I don't think I can use it. In any case, I like the way Adobe Acrobat Reader cleanly renders PDFs and I especially like the navigation and zoom controls. The last I checked, both XPDF and KPDF were rather lacking in this area.
JDK API Documentation
One of the minor irritants I face while programming in Java under Linux is that there is no ready equivalent of the JDK API documentation in WinHelp format that comes in so handy while looking up a method or class. The normal HTML format JavaDocs is rather painful for such tasks.
One of the options is to use either xCHM or GnoCHM with the same CHM file that I use under Windows. However the former needs wxWidgets and the latter needs GNOME, neither of which I want to install on my PC. Besides this, I do not want to support a closed-format document format that people are struggling to understand.
It seems that there is a Java-based solution called JHelpViewer to help out with this situation and my limited testing with it indicates that it is decent and does the job to a fair extent. However, I do not like the overhead of keeping a JVM instance running on my PC just to view JavaDocs. I think a better option would be to use something like Gtk2 instead.
Does no one else find it weird that Sun does not itself ship the JDK API documentation in the JavaHelp format?
Once again, the two problems that I had a chance to try out were not that difficult, but sloppy coding and muddled thinking made sure that my submissions would fail. The 300-point problem was to find out the minimum positive or negative steps needed by a stepping motor to reach any of the given target positions from a given current position. On this problem, integer overflow and underflow proved to be my undoing.
The 400-point problem was to find out the centre of gravity of a perforated rectangular sheet with rectangular holes. Here my solution just did not come close enough to the official solutions and I kept tweaking the multiplications and casts in my solution to match the results. After some time I even converted my solution over to fixed-point instead of floating-point, but it was still a bit off the mark. Such fiddling around ensured that I could not submit the solution in time, let alone attempt the 900-point problem.
My rating has dropped after this match, but still not enough to get me out of the darn Division 1. I look forward to being mauled once again in the next SRM on April 2.
The 250-point problem was a simple "find the length of the longest contiguous string of either As or Bs in the input". The 500-point problem was to find the sequence of unit fractions ("1/n") in descending order that add together to yield the given fraction "x/y". The 1000-point problem was to find the derivations needed to get to the input string given the productions of a simple non-left-recursive grammar.
The problems (as I have also noticed in the practice rooms) were not difficult per se, but had to be solved "correctly enough" within the given 75-minutes - much less if you also want to get a good score and ranking. It does not really matter if your code or design is elegant as long as it manages to pass all system tests as well as the challenges that other coders might throw at it. The permissible input is also severely restrained so that you do not usually have to worry about validating it.
One thing I noticed is that there were not many Indians among the toppers, while there were quite a few people from Poland. This is quite weird as I have met quite a few good Indian coders. Perhaps the lack of awareness, the lack of an enthusiasm for such competitions, the lack of decent net connections, the weird timings of the matches when converted to IST, etc. play a role. If you are an Indian coder reading this, please do consider taking part in these matches and letting your friends know about it.
FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.
Keep up with the latest Advogato features by reading the Advogato status blog.
If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!