![]() |
9 April 2005I've completely moved the website to a more editable format using Oddmuse. The new URL is simply http://www.vankuik.nl/.11 February 2005I wrote a piece on queuing mechanisms. It grew somewhat larger so it deserves its own page. 28 January 2005God, I hate it when they "optimize" XML and force a single line of XML, sized > 500k, without whitespace, linefeeds or anything down your throat. So, here's an XML beautifier, powered by xmlindent. 21 January 2005Outside work I received a question: "We need a WebDav implementation which is complete, has admin screens and is also reachable with FTP". Two solutions were found: heavily hacked Apache and Oracle IFS. The problem is that for the latter, one would need an experienced DBA who can administer the midtier. Then there's an additional thing that needs attention. If you want to customize IFS, you'll need to look into its API, the CM SDK (Content Management Software Development Kit). That API is basically split into two parts: one part for the quick-and-easy tasks of copying, deleting, moving, etc. and a second part which goes deeper and with which you can really modify the workings of IFS. It makes the API really baroque, but also really powerful. I've used the CM SDK, but only for quite simple tasks; reading, writing and deleting files and folders. Looking at the baroque API, a thing occurred to me: who'd need more? It's a filesystem in the database. You can completely modify it. Great. Then it hit me. But who really needs to modify his filesystem?. You have an answer? Because I am really, really curious. However, while you don't necessarily need the baroque part of the interface, it's there as well as its more simple counterpart. And besides that, the whole product is pretty unique. I don't know any other offering which has so many interfaces to file sharing mechanisms (FTP, WebDAV, NFS, SMB/CIFS, et cetera) and is combineable with your database-driven applications. As with many things, there are both advantages and disadvantages and before choosing, it's a good thing to be knowledgeable on both. 18 January 2005As an addition to the previous post, I'd like to add that issuetracking is of course just one facet of a whole project. Now, I'm not yet an expert on this, but Asa of Mozilla fame definitely is. Check this weblog entry for a highly interesting post on the subject. 17 January 2005Looking back, I miss a lot of things that should've been in the curriculum of my education. I've said something about reading source code, but what most computer science students also miss, is a feeling for the difficulty of managing software engineering of big projects. In my opinion, every student should have a look at the issue system of a big project. I had some irritations in using OpenOffice and decided to see what the problem was with the bug I was experiencing. Take a look at tracking issues. 12 December 2004Reading source code is one of those things that I feel that nobody likes, while the advantages are so clear. You can brush up language skills, find out how other people solve things, learn different architectures, find out what the quality of a code base is, play spot-the-pattern et cetera. One cause could be that you don't learn reading other people's code in college. On the contrary, they want you to create little pieces of code that can easily be kept in one head and where correctness is easily demonstrated. The real world doesn't work like that. If your day job isn't maintaining other people's code in the first place, then you'll get to see your colleague's code at the end of the project when they move on and you get to stay for a little while. Either way, you'll just have to accept that you don't understand everything and get on. For those people who still have that barrier, I did a little writing on how to search through code and getting it to work the way you want it, without feeling lost. We're going to look at Starfighter. 15 November 2004I've updated the comment on the database logging package, see here. 11 November 2004The Dutch Java User Group, NL-JUG, organized a conference on the 12th of November called the JFall. For the internal magazine at my employer, I've reported on the proceedings. Only in Dutch! 8 November 2004I've done a presentation on SSH for a group of Unix beginners. I've put it on-line since it might be useful to others. PowerPoint format of course, because I'm a Wine/CrossoverOffice customer. 15 October 2004 - How to remotely debug using jdbFirst compile your java code with the '-g' option. Deploy the compiled code to your server. Then start the virtual machine on the server with debugging parameters: -Xdebug -Xrunjdwp:transport=dt_socket,address=6000,server=y,suspend=n Then either use JDeveloper or the standard (implementation reference) debugger from Sun, which is called 'jdb'. In the first case, go to Tools, Project Properties, flip open Debugger, click Remote and check Remote Debugging. Select 'Attach to JPDA' which means we attach to a Sun JVM. Then click OK and click the debug icon. Fill in the hostname and the address which you specified in the debugging parameters, for example 'oxdaps20a' and '6000'. To debug with jdb, open a shell or DOS box and type: jdb -attach your.development.box:6000 On the jdb>prompt, type the line use /path/to/sourcefiles to tell the debugger where it can find the source files. Set some breakpoints with the 'stop' command and then wait for the breakpoints to hit. Type 'list' to see where the flow of control is when a breakpoint was encountered. Type 'next' to go to the next line. Type 'step' to step into a method. Note: when either debugger acts funny, i.e. breakpoints are set but never hit, breakpoints cannot be set, or the code stops in places where it shouldn't stop (empty lines, comments), chances are that the code that's running is different from what you are looking at. Compile and deploy your code again and start debugging again. When the JDeveloper debugger acts funny, use jdb instead. The JDeveloper debugger is more tuned to work with the Oracle JVM (OJVM), which coincidentally is now also available on Linux. Note: when you debug a virtual machine, all threads halt, affecting other people's work. With jdb it's possible to let other threads continue, see also 'help thread'. With JDeveloper this is not possible (and I've heard that there aren't any other commercial debuggers that can do this either). Note 2: if you want the virtual machine to wait while you remotely connect with the debugger, change the VM option 'suspend' to 'n'. 11 October 2004I'm putting some handy Java code snippets on-line at this page. 30 September 2004I've run into some more issue on the use of 9i SCM with JDeveloper. You might want to check the reworked section on JDeveloper/Linux. 31 August 2004Need a good way to print out source code on Linux? Use a2ps. For Java code (where not all of my colleagues adhere to the 80 columns lim^H^H^Hreligion), I use a2ps --media=A4 --chars-per-line=100 --line-numbers=1 filename.java. This prints out your code nicely in two smaller pages on each A4. Now I still need to figure out how to make strings print with Courier or other proportional font. 6 August 2004
They say that automatic garbage collection is one of the advantages of Java. That doesn't quite get you off the hook completely. True, it saves you from having to delete each new object you create, as one would in C++. However, besides memory there are other resources that are scarce (diskspace, network, database) but those aren't cleaned up automatically as opposed to the objects that represent them. For instance, below is a routine which reads a textfile into a string: private String readFile(File file) throws IOException { BufferedReader in = null; try { String line = null; StringBuffer contents = new StringBuffer(); in = new BufferedReader(new FileReader(file)); while ((line = in.readLine()) != null) { contents = contents.append(line + "\n"); } return contents.toString(); } catch (Exception e) { return null; } }Have you spotted the error? I was in a hurry when I coded this method and I certainly didn't. The error is that the reader needs to be closed: finally { if (in != null) { in.close(); } }This method isn't heavily used but when there is a maximum of 1024 open files and the application runs a few hours, you'll get messages in your logs stating that you opened Too many files. (By the way, the maximum can be found with ulimit -n if you're using the Bash shell). What is nasty, is that that message doesn't really tell you exactly where you open too many files. Rather than pouring over all that code, I used truss on the Solaris box (on Linux, it's called strace). This command can tell you which system calls an application makes. System calls are basically the commands that you can give to the kernel. Your favourite programming language may have nice libraries or even have some drag-and-drop widgets, but it all comes down tot asking the kernel whether you can open that file. The kernel will then do the work of checking permissions, checking whether the file is actually there, returning an error if necessary, et cetera. An example of a system call is open, or fork, or something else. As said before, truss and strace can tell us which system calls an application makes. I was interested in the open and close calls. After I had done a ps to find the process ID (pid) of the running app, I typed truss -t open,close -p 7601 -f > trussoutput.txt 2>&1. When the application had run for some time, I interrupted truss, opened it in vi and threw away all pairs of open and close calls. What remained, were the open calls that had no counterpart. Since the arguments to the system calls are also shown, the filename shows up. And that definitely rang a bell; I knew immediately which piece of code opened that file. 2 August 2004You'd like a nice way to order the output of (Oracle) SQL in an arbitrary way? For instance, if you query a table with filenames and the customer first wants the files with extension xml, then pdf and finally raw, you could use a query like done below: select ast.filename, decode(ast.extension, 'pdf', 1, 'raw', 2, 0) sort_order from assets ast order by sort_order The syntax for decode is a bit confusing. Basically, it's a bit like a Java switch statement. First, name the column whose value you want to substitute. Then, you get the original-new value pairs. The final parameter is for the case where none of the original values match. 31 July 2004I'm currently reading The Pragmatic Programmer and although it contains a lot of those things that are pretty much common sense, there are some true gems in there as well. Especially the part about tracer bullets. The project I'm currently working on, consists of a number of workflows. One of the flows I'm working on, has to support different production stages; it goes too far to explain, but it's enough to say that there are multiple stages of which the first is the simplest. Some of those workflows contained steps that were unexpectedly large and had changing requirements, meaning they were difficult to plan. Estimates would change all the time, causing some *cough* friction here and there. As a remedy, we would first get the full flow working for the first production stage and when the flow ran flawless from start to end, we would build uit each step in the flow to support the next stage. Hunt and Thomas (the Pragmatic Programmers) call this tracer bullets, which contain a phosphor payload that flashes when it hits the target. In the dark, the gunman then knows that his aim is right. The idea is good, but it's immensely difficult to resist the temptation when you're frantically coding! Because you're in the Flow and when you've done one part of the functionality, you can see those methods and data structures dangling in front of you. However, you still should break out of the flow at the correct time, synchronize with your team members and the QA people, and get that workflow to, well, flow. It's amazing what this does to management, the customer and the developer. When the flow works partly, it gives a feeling of confidence to all the parties. This is definitely a good thing. 13 July 2004Some cool bash/Linux stuff: If you're using bash, put a line TMOUT=600 in /root/.bashrc. The user will automatically logout after 10 minutes. If you're often cd'ing into a mounted directory, this might mean a lot of typing. For instance, at a client I always have to change to directory /mnt/es-groups/EWII for the project files. To shorten typing, I created the following line in my .bash_profile file: export CDPATH=".:/mnt/es-groups/EWII". When I type cd Documents, I find myself immediately in the project's documentation directory! bash even tab-completes! UNIX Commands No One Ever Heard Of ™... Type script and press enter. A new shell will be started. Now do whatever you like. When you're done, press CTRL-D on an empty prompt. script will reply with something like Script done, file is typescript. The new file will contain whatever you've typed, including screen output! Fun to put in your friend his/her login scripts.... |
UsefulOnline XML beautifierArticlesAdjusting StarfighterJFall Proceedings (Dutch) Cooperation Oracle India (PPT) Java 1.5 new features (PPT) (Dutch) Java 1.5 new features (PPT) (English) JDeveloper 10g new features (Dutch) Linux On The Desktop Evolutionary Database Design (Dutch) UML and JDeveloper A Small Oracle 9i database JDeveloper on Linux About fetching, parsing and transforming RDF files in PL/SQL Article on HTT, for PL/SQL developers Hosted by ![]() Other writingsJava Code SnippetsRandom Linux stuff Linux on a Dell D600 Unintelligible requirements std_mingetty remembers user names ![]() StudyIntrusion Detection Systems: general overview and technical insights (PDF) (HTML)History, current situation and future of Intrusion Detection Systems (PDF) Limitations of intrusion detection systems (PDF) Internals of Snort, an open-source IDS (PDF) The above four, summarized (PDF) Huidige praktijk van Intrusion Detection onder Novell Netware (PDF) For a quick laugh, look here... |