Finished translation of namespace transformer to Python

I originally started to write my XML Boiler software in Ada. Ada compiler has too many bugs.

I switched to Java. I discovered for myself that Java byte arrays are limited to about 4GB of bytes, this makes problematic processing of big XML files. I switched to Python.

Now I have finished translating it from Java to Python. Now I can continue to implement features. Yet much work remains.

Posted in Programming, XML | Leave a comment

Library to spawn a process with given input and receive its output

I have created a C library to span a process with given input and receive its output.

One cannot just write to stdin of a process and then read its stdout through pipes, because this way it may lead to a deadlock.

Instead use my library:

It is an alpha release, tested on Linux.

During its development I managed to crash Linux:

Posted in Linux/Unix, Programming | Tagged , , , , , , , , | Leave a comment

A new problem appeared writing automatic XML transformations

This is about Automatic transformation of XML namespaces.

Previously I divided all transformations into two groups:

  1. with a given source and target namespace (as converting DocBook into HTML);
  2. with only source given but not the target (as for XInclude).

Today I’ve realized that it is a wrong division. Instead we need to split into:

  1. transformations for transforming from a specified source to a specified target;
  2. transformations for which transformation should happen if we have correct source namespaces, not depending on which is the target namespace.

The second kind is some kind of “reducing” as XInclude reduces one XML file to another (and this usually are transformation in “right” direction even if the destination namespace is not in our list of destination namespaces). The “reduce” is defined as an operation which should always happen over an XML file even if the target namespace is not in our set of expected target namespaces.

But “reducing” is not absolute. Sometimes we may want to reduce from a given source namespace and sometimes not. Reduce is some relative property: The same namespace may be considered as a source of reduce and sometimes not. For example one may want to convert XInclude tags and attributes into another XML namespace which describes inclusion (instead of reduce).

We are yet to understand relative of what is the reduce. How we specify when a reduce is in our set of reduces and when no.

Sorry if I explained not quite clearly, this is a work in progress.

This is a new hard (fundamental) problem appeared before me while developing Automatic transformation of XML namespaces. I have solved some other fundamental problems after some despair and hope to solve this problem too.

Posted in XML | Leave a comment

Expired access token in Google OAuth

I sought in Internet how to determine from Google response whether an access token is expired. I found no definitive answer.

So, finally I created an access token and waited for a hour to see the Google response when I try to use this token.

The Google response (with a partial list of HTTP headers) is below:

HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="", error=invalid_token
Content-Type: application/json; charset=UTF-8

Username/Password Authentication Failed.

A weird thing is that Google says that it is application/json but the response body is not a JSON.

So the only way is to check whether the response HTTP status is 401.

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Why Linux is better than Windows

One man asked me: I have heard of Ubuntu Linux, but have never seriously considered using it. What makes it “good”?

Here is my reply (not aspiring for completeness, Linux has other advantages also):

I could say that the “main” advantage over Windows is that the system goes together with applications. You can update ALL installed applications with single command.

You can easily update all programs to the newest version and after this you sometimes may even not reboot.

After my Linux was installed, I had Alt+F4 like Windows to close the current window. I reconfigured it to Ctrl+Esc. Can you do similar key rebinding with Windows?

Also it is more reliable, less affected to trojans.

Linux is faster and requires less resources.

You choose from several windowing systems: including Gnome (which I use), KDE, and others. (In Windows you are limited to user32.dll and nothing other.) In my opinion Gnome is much more convenient than Windows.

When you buy a new computer, you can easily copy the files from the old computer, and there is no need to reinstall Linux or applications anew. (Not so with Windows.)

However, there are some drawbacks:

Not all videocards work, it is difficult (or impossible with some models) to configure an UPS.

I haven’t succeed to configure hibernation of the PC.

There is no PhotoShop or MS Office (however there is Gimp and LibreOffice).

Posted in Hardware, Linux/Unix | Leave a comment

Split HTML into separate chapters and ToC

Yesterday I have written a simple program which splits an XHTML file into several chapters (separate HTML files) and ToC.

The program is fully customizable and themeable.

Get it at

Posted in XML | Tagged , , , , , | Leave a comment

Google AdWords bug slowed down my ad campaign :-(

I have started a Google Grant AdWords campaign for an USA based nonprofit recently (about two days ago).

It worked well and I was enjoyed.

But then it was closed for “maintenance” as they say for 2-3 days (I don’t remember the exact word Google used to describe “maintenance”.) After about a day maintenance seemingly ended.

But now I have another problem: Google says “Your keyword isn’t triggering ads to appear on Google right now due to a low Ad Rank. Ads are ranked based on your bid and Quality Score.” for seemingly every of my 355 keywords and so the account is stale. Many of my keywords have 6/10 (and maybe above, I have not checked every keyword) rank and I could expect this is enough to show.

Also, this message “Your keyword isn’t triggering ads to appear on Google right now due to a low Ad Rank. Ads are ranked based on your bid and Quality Score.” is sometimes displayed twice (instead of once as it should be) in the keyword performance popup.

Sometimes a keyword start to work for a short interval of time and then disappears again. So I have a click each 30 minutes or so.

I suspect Google bug. (Yes, I have written them through the Feedback form that I report a bug.)

I’ve called AdWords support. They have said me that I should remove broad match keywords like Bible and also for three keywords like Bible translation, “Bible translation”, and [Bible translation] leave only one of the three.

I didn’t try to follow the Google’s employee advice, as it seems a wrong advice for me.

I have reported the bugs to Google.

Posted in Uncategorized | Tagged , , , , , | 2 Comments