Archive for the ‘Computers, Phones and stuff’ Category

XNX? (that’s short for “XHTML’s not XML?”)

XHTML documents are (at least I always believed so) XML documents, and as such, should be parsed with an XML parser. I don’t know of any parsers or data models which would even be able to distinguish

<div></div>

from

<div/>

So I would assume that both are valid markup. Or maybe, both would be invalid. But as far as  I know, neither DTD nor XSD can allow mixed content on an element, but forbid it to be empty, so they must both be well-formed and valid (validated) XML. Maybe there are rules for XHTML which go beyond the pure XML validation, but to check those, there are special validators. And since application-level validation must take place on the data model, not on the serialized syntax level, any such application-level-rule would be defined on a layer of abstraction that cannot possibly see which syntax was used on the parsing-level.

So I am completely baffled to see that:

  • Both ways are accepted without any warnings by the W3C Validator.
  • The online version of HTML tidy also accepts both as valid input, no warnings.
  • But while “tidying” the markup, it changes one of them into invalid XML that is not even well-formed (!!!), by changing <div/> into <div> without a closing tag.
  • Firefox 3.6 completely refuses to display invalid XHTML, like the one generated by tidy.
  • But it accepts both <div></div> and <div/> without complaining.
  • It displays <div></div> correctly, but (that’s the second shocking thing) completely messes up my page when I use <div/>.

So there are subtle differences between two identical things, which are silently misinterpreted by three software tools (validator, tidy, firefox) which should either do the right thing, or tell me that I’m doing wrong.

There are folks on the internet who say that in HTML, <element/> is not a valid syntax at all. Others say that in HTML, empty div’s, even <div></div> is not allowed. See here and here.

But whatever they say, I’m doing XHTML, and it is completely against any logic that there’s any difference between <div></div> and <div/>.

I don’t know whether to blame the W3C, or the Firefox implementors, or the ones of tidy for this, but if XML and XHTML were good for anything, than it would be to eliminate those syntactical subtleties and save me from wasting hours on chasing errors in my markup which, by definition, cannot be errors at all.

(PS: If you don’t get the meaning of the title… it’s an allusion to “GNU” which is an acronym for “GNU’s not Unix”, which is kind of misleading, because GNU is very Unix-like – actually, it’s an attempt to be another Unix. And since the whole XML-XHTML-thing is kind of misleading as well…)

Helping relief units in Haiti and Chile – from my desk

OSM helped Haiti

When an earthquake struck Haiti in January, many organizations and companies donated geospatial data, and the volunteering individuals involved with OpenStreetMap did a great job putting it together and produced maps of Port au Prince. Not only were those maps accurate and up-to-date, but they also featured information about collapsed buildings, mobile hospitals and emergency accommodations. This was only possible because they could use satellite data that was both up-to-date and extremely detailed – and there was an unbelievable number of such sources.

It’s notable that some days before the disaster, the OSM-maps for that city where a white spot with some lines.

Port au Prince - before and after

Port au Prince - before and after

I heard of it several weeks later, and was very sorry to have missed that opportunity to help and promised to myself to lend a hand the next time something similar happens.

Now Chile needs help – and sources

Last weekend, there was a severe earth quake in Chile, and this time I noticed the incident some hours after it had happened. Of course, there was already something setup in the OSM wiki, but map sources were sparse. Even now, we still wait for up-to-date mid- and high-resolution imagery, and are basically stuck with 10 years old images from Santiago and very bad material for all the other regions.

Images from RapidEye

On Monday, the German company RapidEye AG published a 5000×5000 pixel JPEG of
the city “Concepcion” and its surrounding area. They announced to publish future
images and a reference from before the earth quake soon. See
http://www.rapideye.de for more information.

The resolution seems to be 6.5m (high enough to see larger roads, but
too low to actually see any damages). And, sadly, the image suffers
from heavy JPEG compression artifacts. This seems to be tile 1822122
which is (along with other tiles) available from the geodata kiosk at
http://kiosk.rapideye.de/DataDoorsWeb/Order.aspx in diverse formats
(GeoTIFF, etc.) but at the same resolution, priced about 186 Euro
(approx. 250 US-Dollar. Maybe there is a way to get it for free, but
following the usual checkout process, that amount would be billed.)

Since I did not plan to pay that amount, I gave a shot at the JPEG. After installing some plugins into JOSM and realigning the picture, my first step was to trace out all the areas which looked like residential buildings. This is a nice trick to indicate where some mapping has to be done: If someone notices those typical gray areas on the map, he can expect residential roads as well. If there are no roads, this is sign for missing data.

Look at this map (it’s interactive) and see for yourself:

After some hours, when I had done all of those gray areas, my eyes (and possibly my brain and the simple neural nets behind my retina) got used to the blurry, low-contrast satellite image, and I was bold enough to actually trace some roads and upload them. But still it’s very dissatisfying to be stuck with that kind of material, unable to do a great deal of helping work.

Areas which in which I did more than just gray surfaces

Areas which in which I did more than just gray surfaces

Fast, faster, OSM

Maybe it’s worth adding that normally it takes about a week until new map features are rendered into the map and can be seen online. I hoped that under the current circumstances it would be a bit faster, and was very surprised and pleased to see that my data was actually rendered and ready for consumption less then 2 minutes after I uploaded it. Wow.

Failing at the easiest things – e.g. printing

Printer by the OatmealThis post was originally written on December 3rd, but I forgot to publish it.

If you want a funny version if this, go read “Why I believe printers were sent from hell to make us miserable” by the Oatmeal. If you want to know how well printers succeeded at the task of making me miserable, read on…

I just want to moan about the miserable feeling that I get when even the easiest things fail. I think this is because in most cases, I just can’t figure out if it’s just those things that fail, or if it’s me.

One such thing is printing. I have to hand in several homeworks per week, and being the kind of nerd I always was, I prefer to write the solution on a computer, using LaTeX. In this portable environment, it can’t even shock me if my laptop breaks, because there’s always some other machine around that can process LaTeX. And while there always may be problems with how to typeset a given formula, a solution can always be found. In the ideal case, I can find it in 2 minutes with google, but even when I struggle for 30 minutes, this comes with a certain feeling of pride, having achieved something, having learned a valuable piece of knowledge for the future.

Then I have to print it, which can be done on one of 12 printers at my university. It either works, which really isn’t enough to give me a real, intense, fuzzy warm feeling. Or, if it doesn’t work, it fails. I hit print, and nothing happens. Or, I hit print, and it says “done”, but the paper just isn’t there. Or, I hit print, it says “processing”, says this for about 20 minutes (while the printer actually does nothing), then it forgets my order and prints something else for someone who’s luckier than me.

No matter in what way it fails, a true solution lies beyond my reach. Yeah, I could buy myself a printer, but that involves money… you guess the problem. Everything else is just not under my control. So I come to the university early, planning more than 1 hour to print 3 (!!) pages of black and white text. Given more time, I can always try again to print. Which I always have to pay for, probably even when it fails.

Today, I spent more than 1,5 hours printing my three pages. I used 4 university PCs in 2 rooms, 6 printers in 3 rooms, my own OQO UMPC, and a PC in a copy shop which had about 20 printers, but failed even more than the entire university gear.

I had to hand in my homework 40 minutes late, causing considerable overhead for my professor and his assistant, who was already gone with the homeworks which were handed in on time. It was ok, but of course I don’t know home many times it will be OK in the future. And even though he didn’t say anything nasty, it gave me the feeling of having failed. Having failed personally, on a trivial task. And without any trace of a proof, I guess everybody else manages to print things on time. Well, call me a pussy for that, as I could just forget about it and be happy.

But the aftermath is, that the additional time I spent printing, was initially planned to do another homework and hand in some even more important papers to the university. My schedule just is too packed to reserve 5 hours a week just for printing some pages. As you might suspect, the responsible office was closed by the time I had my homework printed. And, guess what, I already planned to hand this in yesterday, but I first had to print it, and by the time this was done, well the office was also closed. So I have to go there the next time they open, which leads me to missing at least one lecture – plus the two I missed yesterday by printing. Which is ok, because when I don’t hand in those papers by tomorrow, all my lectures and homeworks and everything is meaningless anyway.

And slowly I come to the bitter conclusion, that my entire life might eventually fail, not because of big catastrophes, but because of the accumulation of small failures, adding up beyond the sum that the society is able to compensate.

So you might find my personal misery and its nasty details rather uninteresting or even annoying. Everybody thinks so, and because of that, I can’t reply to questions like “Why did you hand in your homework late?” with an answer like “Yeah, you know [insert the whole blog post here], that’s why.” Instead, the answer would be more like “Because I’m an idiot who can’t even manage the most simple things in life, that’s why.” I might want to add “There’s also a good reason for it, but you wouldn’t want to know the details.” In the end, I start to believe that I’m that idiot.

And you might ask from where I take the time to think and write about it. Well, while waiting for my printouts, of course.

So, whats the end of the story? Finally, I ended up with my document, that is, three copies of that document, and eventually found 7 more copies of the papers I wanted so print yesterday, scattered through the printer rooms. I guess there are 4 more copies of my homework on their way, too. Hooray.

Note from today: I might want to add that I bought a printer some weeks later, and now I’m floating in endless happiness.

Why is it so hard to have some libraries installed?

Edit: I asked a related question on stackoverflow.com, but since it was “not programming related” (!!!) is was moved over to superuser.com, where I got a nice answer and an even nicer comment to the answer. Now I know that “apt-file” can figure out which library to install, and 90% of my usual lib-install-sorrow is cured by this nice tool. Anyway, some cases remain where I just have to give up. You can read more about it here.

I feel completely lost each time I have to fulfill the dependencies of some C or C++ code.

I really do understand C, C++, static and dynamic libraries, header files and linking, as well as the packet manager “aptitude” but when it comes to the practical part, I have absolutely no idea what to do.

I mean, I know what to do on a theoretical level, and most of the time, I can even archive it. But over the year’s, I got so much better in all aspects of programming, but concerning library dependency resolution, I still feel like the 6 year old boy writing his very first for-next-loop. After going though this trouble so many times, there still is no pattern, no deterministic approach to follow, just desperate  fiddling around and running in circles.

First of all, I think it must be possible to get this libraries as a recompiled binary. If I had to compile them myself, I would be stuck in a recursive problem because I had to fulfill their dependencies, which involves compiling them as well, but first… I feel there must be something in between getting only the end-user executable and getting the full source of without binaries.

Sometimes, I manage to find a download, but it doesn’t say where to put it. So I prefer a packet manager, but that does not make it easier at all.

You might be tempted to say: It’s not that hard. Well, it is. If you don’t believe, read on.

Just an example

I will introduce an example to explain my problem, but really, I don’t ask for a specific solution for those three libs, I want some deeper understanding of how to approach that problem in general. I experienced the same with many more libs, and I remember having the same general problems when I was still using windows.

Three little libraries

I want to use code which states that “It utilizes glib2, curl and openssl” – it does not say anything else about it. All of that libs are absolutely standard, so it shouldn’t be hard at all to get them. I think this means I need static libraries from those projects, as well as header files. In the source I want to use, there is

#include <curl/curl.h>
#include <openssl/md5.h>
#include <glib.h>

And none of them is found at compilation time. I never know if this is really a missing file, or just misconfiguration of my build process, so each time I end up doing a fully recursive file search on my whole hard drive to see if those files are present anywhere. This time, they aren’t. Of course, I knew that I need to somehow get glib2, curl and openssl onto my computer. I think I can install them via apt-get.

So I tried sudo apt-get install curl openssl (let’s forget about glib for a moment). Still there is no curl.h on my system and all md5.h instances on my system have nothing to do with openssl. I know that some packages have variants with suffixes like -dev, -devel, -src, -source or a lib- or lib prefix, but I never know which to choose, and sometimes there are none of those at all.

Installing curl (and, by pure chance, also openssl)

For curl, there is the choice between curl, curlftpfs, flickcurl-doc, flickcurl-utils, gambas-gb-net-curl, gambas2-gb-net-curl, gimp-libcurl, gnupg-curl, libcurl-ocaml, libcurl-ocaml-dev, libcurl3, libcurl3-dbg, libcurl3-gnutls, libcurl3-gnutls-dev, libcurl3-openssl-dev, libcurl4-gnutls-dev, libcurl4-openssl-dev, libflickcurl-dev, libflickcurl0, libghc6-curl-dev, libghc6-curl-doc, libghc6-curl-prof, liblua5.1-curl-dev, liblua5.1-curl0, libwww-curl-perl, php4-curl, php5-curl, python-pycurl, python2.4-pycurl, slang-curl, spl-curl, tclcurl, xmms2-plugin-curl and somehow I figured out that libcurl3-dev sounds nice, but how do I really know? In the end, this also installed libcurl4-openssl-dev and got me a matching version of openssl’s md5.h.

Lucky me, bacause I wouldn’t have known which one to chose from openssl, aolserver4-nsopenssl, globus-openssl-progs, libcrypt-openssl-bignum-perl, libcrypt-openssl-dsa-perl, libcrypt-openssl-random-perl, libcrypt-openssl-rsa-perl, libcrypt-openssl-x509-perl, libcurl3-openssl-dev, libcurl4-openssl-dev, libengine-pkcs11-openssl, libengine-tpm-openssl, libglobus-gsi-openssl-error-dev, libglobus-gsi-openssl-error-doc, libglobus-gsi-openssl-error0, libglobus-openssl, libglobus-openssl-dev, libglobus-openssl-module-dev, libglobus-openssl-module-doc, libglobus-openssl-module0, libopenssl-ruby, libopenssl-ruby1.6, libopenssl-ruby1.8, libopenssl-ruby1.9, libopenssl-ruby1.9.1, libpathfinder-openssl-1, libxmlsec1-openssl, openssl-blacklist, openssl-blacklist-extra, openssl-doc, pyopenssl-doc, python-openssl, python-openssl-dbg, python-openssl-doc, python-pyopenssl, python2.4-pyopenssl, since there is no -dev package with a generic name for openssl.

glib

But still, this leaves me without glib, which is not to be confused with glibc. There are no matching packets, only glibc-doc and glibc-source. Starting from the reference page, I think there is no logical way I could find a download without using a search engine, but via google I managed to download a copy at http://www.gtk.org/download-linux.html – but it forced me to sudo apt-get install gettext in order to ./configure and make. It has dependencies on 6 other libraries, and I don’t want to think about what would have happended if I lacked those.

I think it’s worth saying that during this compilation, make called another make, which called bash, which called another bash, which called make, which called another make, which called bash, which called another bash, which called make, which called gcc which in turn called gc1. Is this depth of recursion really needed to build a low level helper library?

Whatever. After this, I have a glib.h in /usr/local/include/glib-2.0/. After adding this path to the include directory of the preprocessor, I end up with 363 errors inside glib’s header files. And with not a single idea how this is possible.

This is the standard case.

I’m totally used to create a hello world project, include a single .h file (like windows.h in the old Microsoft days) and start “fixing” 23 errors in that header. I can’t really believe there are real errors in major headers like windows.h but on the other hand, I don’t remember any project without them. Normally, it takes about 2 hours until my hello word can be compiled again, but from that point on, I can program anything I like without hitting any trouble.

But facing 363 errors, I’m completely convinced that

#include <iostream>
#include <curl/curl.h>
#include <openssl/md5.h>
#include <glib.h>

int main()
{
    std::cout << "Hello shit";
}

is better left as it was, without encrypted network access.

The while-else-loop

Sometimes, “while” and “if” are interchangeable, for example while if you are “iterating” over a collection that will only contain one or zero elements. In Java, both constructs have the same syntax, so I often find myself switching from one to the other.

Yesterday, I didn’t notice that my “if” construct already had an “else” branch, and so I created a while-else-loop. It took Eclipse like 10 seconds to realize that there’s something wrong, so when I saw my error after about 5 seconds, I instantly though “maybe that’s valid Java, and nobody ever noticed…”. Well it isn’t, but now I’m asking: why? And while I’m talking about the while-else-loop, what about for-else?

Often, you find yourself dealing with empty collections manually, like this:

Collection<Stuff> myStuff = getStuff();
if(myStuff.isEmpty())
{
    System.out.println("I've got no stuff.");
}
else
{
    for(Stuff s : myStuff)
    {
        System.out.println("I've got " + s.getDescription());
    }
}

Wouldn’t it be nice to have something like

Collection<Stuff> myStuff = getStuff();
for(Stuff s : myStuff)
    System.out.println("I've got " + s.getDescription());
else
    System.out.println("I've got no stuff.");

That would be pretty neat. But once you think about common loop idioms, there’s even more to invent.

And sometimes, you have to do something before the first and after the last line, but not if there are no lines. Or you have to do something between the lines, or just before the last one. Imagine your collections contains {socks,cups,dust,chocolate,nails} and you want to create an output like this:

I’ve got socks, cups, dust, chocolate and nails.

Normally, this involves heavy if-else action, and counting, like that:

Collection<Stuff> myStuff = getStuff();
if (myStuff.isEmpty()) {
	System.out.println("I've got no stuff.");
} else {
	int size = myStuff.size();
	int counter = 0;
	System.out.print("I've got ");
	for (Stuff s : myStuff) {
		System.out.print(s.getDescription());
		if (counter < size - 1)
			System.out.print(", ");
		else
			System.out.print(" and ");
		counter++;
	}
	System.out.print(".n");
}

Imagine writing it like that:

Collection<Stuff> myStuff = getStuff();
iterate(Stuff s : myStuff)
{
    before:
        System.out.print("I've got ");
    for:
        System.out.print(s.getDescription());
    between:
        System.out.print(", ");
    beforelast:
        System.out.print(" and ");
    after:
        System.out.print(".n");
    empty:
        System.out.print("I've got no stuff.n");
}

For While it may be overkill to put this into the Java language, I think it might be the right time for me to look into a language that has the degree of flexibility that allows me to introduce such constructs myself, without patching the compiler.

PS: Any ideas how to get syntax highlighting  into wordpress, given the fact that I want to use it for non-existing syntax constructs?

Random Malware Site – comes randomly, goes randomly

To reduce the risk of sending you to a malware site, I did not hyper-link the URLs which seemed unsafe to me. Thus, you can click any hyper-link in this blog post.

I just set out to read something about complexity. I used the google search box in Firefox to look for “law complexity simplicity”. The first result led me to http://lawsofsimplicity.com/ – which is supposed to be the companion website to a famous book (that I once started reading but did not really like that much). After several redirects, one of which was http://click-go.net/search.php?q=law+complexity+simplicity

I ended up with a rather pretty made fake Windows Explorer, performing a virus scan, and warning me about an infected system. It automatically started downloading a setup.exe and somehow noticed each attempt to cancel that download. Many other popups appeared, some of which looked pretty realistic, and none of which were blocked by Firefox 3.5. It was hard to get out of it, because every killed message triggered two other ones. Whatever this site had to tell me about simplicity, my experience was anything but simple! Maybe I was right to dislike the book…

Luckily I’m on a Linux system and don’t get fooled that easy by some would-be-internet-explorer. Anyway, since I have wine on my computer, I’m not even save from windows malware on my Linux any more (if you don’t believe, click it). To help fighting such crap, I decided to report that site at http://www.google.com/safebrowsing/report_badware/ – so I started filling out the form, and before submitting it, I decided to double check my findings. And on the second try (and the third and fourth and fifth…) the first site just loaded normally, no redirect at all, and even the click-go site seemed rather OK.

Now I’m wondering which of those is true:

  • I’m just too dumb to surf the web
  • A trustworthy site such as lawsofsimplicity.com actively supports malware
  • lawsofsimplicity.com just got hacked
  • The hackers are smart enough to trigger their stuff just once in a while to make it harder to detect and report
  • Or maybe there is something wrong with my local machine or the connection with the internet

If you’re feeling like willing to take a risk, you might try the URLs above for yourself and tell me if you experienced any weird stuff. If you do:

  • Consider filing a report to google (or other well known places to report malware)
  • Don’t blame me if that f***ed up your computer. I’ve warned you!

Update

I just had a look at my browser history. I found out some of the URLs that I got redirected to, but it still seems incomplete. I’d rather not post those URLs in directly here, because I fear that my blog might be blacklisted as well, but if you are interested, you can download a text file that contains all those suspicious URLs.

Plain text, XML trees and graphs – and why reality takes more than this

Did you ever wonder why plain text files cannot contain structured data very well, for example, why the “good old” ini files look so awful and chaotic in larger applications? Of course, it’s because plain text is plain. But not “plain” as in “not colorful and with nice font variations” but “plain” as in “flat, linear”. It has lines, one after another, and each line has characters, one after another. And that’s basically all.

Ini files

Ini files, though never really specified, may have some more: headings in square brackets, and key value pairs. Maybe even comments. But still, complex data is hard to handle that way. (So is there are formal distinction between plain text files and ini files? Think about it, because the rest of the text has 11 other possibilities to ask a similar question, which I won’t do.)

XML

This is where XML comes in. It is completely hierarchical, with a root element and any number of nested child elements. Then there are text nodes and attribute nodes, where text nodes can contain any text they like, and attributes consist of keys and values. This is a lot more structure than a plain text file, and is suited to represent almost every information you can think of. If you are used to XML, you just think in hierarchical structures, as if the whole world would consist of nodes with subnodes. And this seems only natural, since reality surely doesn’t consist of something linear like a plain text file. Sometimes, it’s not exactly clear what goes where: When you put statistics of what has been bought where and when into an XML file, is the <location> a child of <time>, or vice versa? Who cares, as long as it is a tree. If you really need it the other way round, you can always come up with some simple 143 line XSLT to transform it on-the-fly.

Graphs

So let me tell you something important: The world is not a hierarchical thing, it’s not a tree. There is more than just linear structures and trees, for example there are graphs. To step up from XML to something graph based is like stepping up from plain text to XML. Some of the XML advocates would jump in yelling “But XML can represent graphs, like with RDF or OWL”. That’s true, because an RDF document is just a special form of XML document. Just as an XML document is just a special case of a plain text document. And because the is-a-relationship is transitive, an RDF document also is a plain text file, and as such, even plain text is capable to represent a graph.

Even more?

We’ve just seen three levels of structures and higher-order structures. So is an RDF-like graph the highest order of structure? No, because in RDF, you have triples of subject, predicate and object. You can express much with it, but there are lower level graphs, were connections are not directed, or higher level ones, where a connection can have more participants than just subject, predicate and object, like an adverb. Or you can bind the adverb to the triple, which needs reification (treating the relation as an entity, so it may be the endpoint of some other relation), but RDF has only very poor support for reification. Or you can have any number of objects bound by a single relation… the possibilities are endless.

Yet, when a programmer has to deal with information and thinks about graphs, it’s too easy to get stuck at what RDF gives you, just as it is too easy to take an RDF graph for its XML tree representation, and take this tree for the linearized plain text file. This is a mental issue, something each programmer has to overcome (and even I suffered from). Sometimes, it’s even wrong to think in documents, and you have to deal with the entities on another level, which my also be a mental problem.

Limiting technology

On the other hand, the technologies we use to manipulate that data is mostly web based, that means built on top of http, which is a protocol to request – guess what – plain text files. We do not have the technology to address actual entities or relations as nicely as we address plain text files. There are efforts to do this, but I call them “suboptimal” at best.

Then there is tabular data, which is best kept in a relational database. Of course, you can always put it into texts, trees or graphs, but it does not really fit. Just as you can put any text, tree or graph into some database tables.

Summary

To summarize my key points:

  • XML is better than plain text, because trees are more advanced than linear structures
  • Graphs are even better than trees
  • There’s even something “above” graphs, but this is too complex to be addressed here
  • RDF seems to be a nice representation of graphs, but it only models one special case of general graphs
  • It’s nice to be able to map graphs to trees and map them to linear plain text
  • Tables are just another way to store information, sometimes better than text, trees and graphs, sometimes worse
  • But we need protocols that work on another layer than just addressing plain text documents by their URL

These are some of the points that Cubenet aims to do better. I write this partly because I’m sure I already know how to do better, and partly because I must remind myself that some of this is still a great mystery to myself.

Using Tomcat (or anything Java) on a virtual server

When it comes to serving web pages, two technical trends (among others) are prevalent: virtual servers and server side Java. To the end user, both are completely transparent, and even the server administrator might forget the fact that his server is virtual, because from experience he can tell that it behaves exactly as a physical server. It seems only natural (not even worth mentioning) to combine both trends.

In fact, this is not as easy as you might guess. Lets say you have a virtual server, running Ubuntu 9.04, and have installed sun-java6-jdk, and decompressed tomcat-6.0.18 somewhere.  The most trivial way to start it is

tomcat-6.0.18/bin/startup.sh

which is likely to tell you something like

Using CATALINA_BASE: /(...)/tomcat-6.0.18
Using CATALINA_HOME:   /(...)/tomcat-6.0.18
Using CATALINA_TMPDIR: /(...)/tomcat-6.0.18/temp
Using JRE_HOME:       /usr/lib/jvm/java-1.6.0-sun

While this might seem as if the server was started successfully, nothing really happened. A look into /(…)/tomcat-6.0.18/logs/catalina.out might show something like

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

This is due to the way memory management is handled on virtual servers, which you can read here. It has nothing to with the actual amount of RAM that Tomcat needs, it also appears that a simple command like “java -version” tries to allocate more memory then it is allowed to (284 MB on my vServer). Several sites recommend to set the -Xmx option when starting Java, mostly by modifying scripts which are not made to be modified. Some others advise changing /etc/java-1.5.0-sun/jvm.cfg to prefer the client VM over the server VM, or even to delete the server VM and symlink it to the client version.

Not only is it highly absurd that you have to use a client VM on a server just because the server is not capable of running the server VM, but it also is impossible, because Java 6 seams to have no client implementation on 64 bit processors – and of course virtual servers run on 64 bit machines (mine has at least 44 GB of RAM, how would it handle this on 32 bit?).

Using -Xmx seems to work, even though you do not want to change each and every script that calls java or javac. To encompass this, you can set the environment variable JAVA_OPTS to something like JAVA_OPTS=”-Xms10m -Xmx256m”, which is definitely picked up by Tomcat, and maybe used by other scripts which run java or javac. Sadly, many scripts do not, and there seems to be not way to make java “just run” on a virtual server.

With the proper options, java does run, but Tomcat does not. It keeps on saying

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

I started writing this blog post hoping that I would conclude with a working solution, but as it seems right now, I just cannot find one. I will keep trying, possibly not only searching the web but also posting questions like I did on serverfault.com and in the end I will update this post to reflect the solution.

One more note: whil this works for calls to the “java” binary, it does not for “javac”, which does not directly accept -Xms and -Xmx. You have to use -J-Xms and -J-Xmx instead.

Me, my websites and blogging

My first website

Since I had an Internet connection, I also had a homepage. Because PHP and other dynamic web languages were not part of the free hosting services at this time, I wrote my own offline homepage generator, or what would be called a “content management system” nowadays. It’s “offline” because it ran locally on my PC, generated an number of html-files, and left it up to me to upload them over my 33 kbit/s line.

As you can see on the picture, I had a well planned site structure for the site, which regrettably has never been filled with content. For me, the work flow was not “Oh, today I might want to fill in some of the gaps on my website… like… err… this one: Musik”. Rather, I had some thought and just needed a platform to express it.

A post-based website

Because of this, I added a post system to hpd2, which allowed me to put a new post on the home page that would push the older posts into an archive. It turned out that my early posts either belonged into the “private” category, or into “programming”, so I implemented a simple category system. Sadly, the most “recent” picture of that website is about 10 years old and just before I built the post system.

Some time late, I remember it to be around Christmas, one of my PCs ran into serious hardware problems, which made me personally unhappy, at the same time hindering me to fulfill my programming visions regarding Open GL. I could still update my website and share my sorrow with the world , but should this go into “private” or “programming”? This was the first time I felt the need for something better than just categories. And so I went ahead an invented what would late be known as “tags”.

A break

Some months later, I finally realized that no one is interested in reading about my life, both privately and programatically, so I eventually stopped updateing that site. After maybe a year without updated it had undergone the automatic garbage collection of the web host and was lost until today, when I found an old offline copy on one of my hard drives.

What’s a blog?

In the retrospective, it’s pretty clear that my website was a blog, but at that time, I did neither know the word “blog” nor the concept behind it – it was kind of my invention, even though I was not the first to invent it. That’s typically me: Being on the bleeding edge when it comes to my own creativity, but lagging years behind in noticing what’s happening around me.

One of my websitesSome years later, blogs became so popular that even I heard of them. My first thought was: “Who would be interested to read that stuff?”, and only after that the resemblance of “blogs” and my first website came to my mind. So I thought about blogging as a collective abberation, with myself as one of the first to have gone through it. I came to my senses and stopped it, and so would they.

Consequently, my next website was planned from the beginning without a blog. Anyway, it was at least as ugly as the ones before and suffered other fundamental problems which made me abandon it rather soon.

A comeback

Well, time has proven that blogs are not that brain dead, and now that I have familiarized myself with reading blogs (as you can see on the right sight in my blog roll), it seems to be the right time to come back to that good old habbit of writing a blog.

So what can you expect from it? It’s definitely going to be kind of nerdy, as I’m definitely a nerd. Whenever possible, I’ll be trying to write in a way that lets the non-nerds understand me, so that after some time of constant consumption of my thoughts, they might eventually also become nerds ;) Other than that, don’t expect anything, ok?

Return top

Hallo!

Ich bin Lena und schreibe hier über alles, was mir gerade wichtig ist. In letzter Zeit also Frauenrechte, Gesellschaft, Politik, Transsexualität, Privates, Computerzeugs... Ich freue mich über konstruktive Kommentare!

Blog abonnieren

Email: