Until not too long ago I had kept my CV in DocBook, then I converted it to XMLRésumé (but the project really looks dead nowadays), now I am converting it to HR-XML/Resume. Yes, I know, its project admin just recently declared this SourceForge project as inactive. But then, what alternatives are there?
Of course, I want to edit HR-XML files in emacs using a RELAX-G grammar, but I didn’t find any on the web. Well, that’s not really a huge problem. Take a few nice sample files (of any XML), stuff them into trang, and trang creates a RELAX-NG grammar from them. Of course, that kind of grammar is far from perfect, but it’s better than nothing, and you can always improve it manually, that’s not that hard. That way I created a RELAX-NG “compact grammar” for HR-XML/Resume last night.
The grammar created actually has problems with InternetWebAddress and Competency, but I was able to fix that for my personal use.
HR-XSL comes with a nice “XMLRésumé -> HR-XML/Resume” converter, that way my old XMLRésumé CV got converted into a good initial version for HR-XML/Resume. HR-XSL uses DocBook for creating HTML and PDF, but there is also a “DocBook -> RTF” converter, that I want to make use of.
Blog
-
my CV or Resume in XML
-
perl’s pattern matching enhanced by “named capture buffers”
python has long had it: symbolic groups. They allow you to refer to a substring matched by a symbolic group name: “(?P<id>)”, id in this case. Now perl has drawn equal: “(?<id>)” does the same job, and the feature is called named capture buffers. Read it up in the perlre manual page or online here! Basically the pieces go to “%+”, i.e. a hash array by the name of “+”.
-
emacs, *-other-window, splitting horizontally
After I upgrading to emacs-23 quite a couple of months ago, all these functions called *-other-window split my screen horizontally instead of vertically, as they have done for the last 20 years or so.
Getting it split vertically was really a pain. Today I found, that I just needed to set split-width-threshold to nil (well, I have never dreamt of that thing so far …), best done through customization. I should have searched for that solution months ago …Update 2013-02-21:
I had written this article quite a while ago, but still I had neither remembered this article nor the name of the variable to customize. Well, this ocurred to me (again…) after starting to use W32 emacs [Link]. I really experience getting split frames to windows horizontally as a severe pain. -
bash version 4 and associative arrays
The new builtin array variable BASH_ALIASES is a nice example for an associative array.
If you do an ”echo ${BASH_ALIASES[@]}” you see all the values, if you do a “set | fgrep BASH_ALIASES” you see, to what the indexes map.Update:
In December, when I got aware of the new feature, I thought, there is no way to get the list of indexes.
But there is: ${!name[@]} and ${!name[*]} return the list of array keys. This gets explained in the section Parameter Expansion. I am sorry, if my former statements caused confusion. -
my 1st steps in Java: extending a JasperReport sample program using Apache Commons CLI
iReports and JasperReports (and also JasperETL and much more) are open source software, that you can find on JasperForge.org.
I intended to extend jasperreports-3.6.2/demo/samples/text/TextApp.java, so that it would take “-Dname=value” style options. There was a need to make TextApp.java a little more flexible, and that was quite easily to achieve making use of getProperty calls.
A friend had given me the hint recently to have a look at “System.getProperty()“, but
it turned out to only provide the caller with properties like"os.name", according to http://java.sun.com/docs/books/tutorial/essential/environment/sysprop.html. So that wasn’t quite the route to follow.I started my day googling for “getopt java”, found that nice package “Apache Commons CLI“, made use of it within that JasperForge utility, and started scripting a batch run around that utility’s targets named “fill…” resp. “text…” in bash, resp. their new sisters, that I derived from them today. Next step is to rewrite that shell script as Windows batch script file resp. as python script to be used in a Windows environment. This work is almost “production ready”, but I am facing quite some necessary paperwork, so that the software developed can get made serious use of.
Looks like the Jasper guys had not expected their software to be used like that. The “.jrxml” gets designed using iReport on a Windows box or whatever; after that it is being made use of on any kind of server executing Java classes with access to a database. (I wonder, whether that approach would also work with JasperETL.)
I am quite satisfied with my 1st steps in Java in that JasperReport environment.
I really had no idea and also no perspective of getting thrown into Java development during a commercial project, and even in the context of JasperReport. I do like this.
Update / 2010-03-05:
The atomar production steps described within TextApp.java‘s build.xml are rather nice and instructive, but they make use of those routines within TextApp.java, where target file names (incl. directory path) get strictly derived from source file names. I added resp. derived productions steps, that make use of thoses methods of the API, that allow you to name the destiny’s name explictily. And I also added chains of productions steps into the java source file, so that the calling shell resp. “whatever” script wouldn’t have to deal with calling the chained steps one by one itself. So far there are chains starting at .jrxml and at .jasper, and chains that end at .txt and also at .pdf. The idea is to place intermediate files on local disks within temp. directories instead of close to the source resp. final target file (maybe) somewhere on a network file system. -
python and class methods
Yes, they are supported, but you have to use an extra magic function call:
classmethod = classmethod(classmethod)
-
software documentation
From the book Expert Python Programming, “Documenting Your Project“, “Use a Simple Style“:
You are not writing fiction, so keep the style as simple as possible.
And with a few more words:
(Another author) made an analysis […] to try to understand, why his books sold so well. He made a list of all best sellers in the marketing area and compared the average number of words per sentence in each one of them. He realized, that his books had the lowest numbers of words per sentence (thirteen words). This simple fact […] proved that readers prefer short and simple sentences, rather than long and stylish ones.
-
using associative arrays in your code
How many lines of code does it take for your new piece of code, before you introduce an associative array?
How many lines of code does it take for your new piece of code, before you introduce a class?
Yes, I know, Bourne shell doesn’t come with the concept of associative arrays, of course it also doesn’t know classes or object orientation. Right, a simple 20 or 30 lines shell script for copying and renaming files may not have the need for associative arrays or classes. But if your script gets longer, pls rethink, whether Bourne shell is the right choice for your task, or whether you make really good use of ruby, perl, or python!
Your next steps may be writing unit testing and using continuous integration. It’s not your customer, who should request it, it should be your serious professional style, your way to deliver proper services. If you are not familiar with the terms, look them up — I provided you with proper links to interesting and informative articles.