python wtf: strip() eats too much

June 1st, 2010

Many of python-xml code is probably wrong. Tracing a bug, I found an interesting WTF. A minimal example:

import string
s1 =  "\xa0x\xa0"
s2 = u"\xa0x\xa0"
print repr(s1.strip())
print repr(s2.strip())
print repr(s2.strip(string.whitespace))

And what we see in the output?

Read the rest of this entry »

running TeX tools from non-standard locations

April 28th, 2010

In some configurations (for example, when using MacTeX), if you copy a TeX-related binary to non-standard location, the tool stops working. More precisely, if a tool uses kpathsea library, special setup is required. More practically, is you compile something like dvisvgm, it might not work.

Read the rest of this entry »

finding deleted files in a subversion repository

April 26th, 2010

I needed file which was deleted some time ago. Thanks to Subversion, the task is easy as long as you remember the name of the file. Unfortunately, it wasn’t a case. Fortunately, I found a magic spell. In the directory where the file was located, say: svn log –verbose, and the output will contain all the names and the revisions.

XML to paper publishing with manual intervention

April 15th, 2010

My paper “XML to paper publishing with manual intervention” is accepted for XATA 2010 (XML: Aplicações e Tecnologias Associadas), 19 and 20 May, Vila do Conde, Portugal. Abstract:

Read the rest of this entry »

unicode math in xelatex

March 26th, 2010

In XeTeX, an unicode version of TeX, it’s logical to use unicode math. However, till now (march 2010) unicode math publishing doesn’t work directly out of the box. Here are two solutions, one is fast (and not so wrong) and one is probably the future standard.

Read the rest of this entry »

entering special characters in vim

March 10th, 2010

Time to time, I forget it. Found again in some wiki: “Entering special characters“. In short: ^Vnnn or ^Vxnn. Note also: “how to input diacritic characters“.

converting sourceforge.net repository from CVS to subversion

March 9th, 2010

Probably there is no need to switch from CVS to subversion, but I’m starting to forget the options of the cvs command, therefore decided to migrate. Unfortunately, there is no button “convert” on the site, therefore I had to find how to do it manually.

Read the rest of this entry »

setting up a local macports repository

February 12th, 2010

Many OSes have port systems, Mac OS X has too. Macports provides a lot of useful software, but not all. If a software can’t be in the macports for some reason (for example, the software isn’t intended for public), one has to setup a local macports repository.

Read the rest of this entry »

TeXML is not at XML Prague 2010

February 12th, 2010

To my great surprise, TeXML presentation was not accepted for XML Prague 2010. It’s so unexpected, that I’m even not upset, only puzzled. TeXML is one of a few projects which are somehow revolutionary. Seems it’s my fault I didn’t make it clear. The abstract, the reviews and conclusions follow.

Read the rest of this entry »

chess diagrams on A6 cards using LaTeX - 2/2

December 4th, 2009

In the first part I wrote: “put to a template in your favourite text processor”. Attached is a template (class-file) for LaTeX and an example, the explanations are below.

Read the rest of this entry »

chess diagrams on A6 cards using LaTeX - 1/2

November 27th, 2009

As a part of improvement in chess, it is often recommended to analyze positions. The idea is good, but how to find time to do it? One option is to use otherwise unproductive time: walking, in bus, queues etc. I have printed positions with me, and always can analyze something.

Read the rest of this entry »

TexML and unicode characters for math operators

November 25th, 2009

Bug (?) report: “after switching from LaTeX(pdflatex) to XeTeX(xelatex) as the PDF generator something has ceased to work. Mathematical operators given as unicode characters in math formulas do not show up in the final document.´´

Read the rest of this entry »

running Fritz&Fertig (eng: Fritz and Chesster) in the parental control mode (Mac OS X)

September 24th, 2009

I purchased “Fritz und Fertig: Schach lernen und trainieren (”Fritz and Chesster: learn to play chess“, other languages also available). My opinion is simple: it’s a masterpiece and the best ever computer game for children.

Unfortunately, I got technical problems. Fortunately, solved them.

Read the rest of this entry »

chess publishing in latex, starting

September 15th, 2009

I’m experimenting with LaTeX and chess. As there is no “for dummies” information in internet, my notes (even if incorrect) could be useful for beginners.

So, the step 1. Print some game or some position.

Read the rest of this entry »

my wrappers around “includegraphics”

July 20th, 2009

To put an image to a document, LaTeX provides the command “\includegraphics“. As it often happens, due to LaTeX was designed for manual typesetting, this command is a nightmare for automatic generation. For a long time, I use a wrapper to solve 99% of the problems.

Read the rest of this entry »

importing as module when a file has a non-identifier name

June 12th, 2009

I need to reuse a function in a file. The usual way is just to import this file as a module. But what to do if the name is “bad”? The following doesn’t work:


import foo-bar as foo_bar
foo_bar.callme()

After trials and errors, the desired magic found:

Read the rest of this entry »

sharing files from linux to windows

April 27th, 2009

Yes, one installs and configures Samba. All I need is to access a big folder in the read-only mode. The quick and dirty solution is:

Read the rest of this entry »

calling batch files with ‘exit’

February 22nd, 2009

Consider ‘main.bat


call child1.bat
call child2.bat

What happens after ‘child1.bat‘ is finished?

Read the rest of this entry »

extending a virtual disk in vmware

December 26th, 2008

Extending a virtual disk in vmware

1. Backup!

2. Somewhere in the vmware installation directory, there is a tool named “vmware-vdiskmanager.exe“. There is a lot of options, for resize use “-x“:

vmware-vdiskmanager.exe -x 8Gb ...path.to.vm..../vm_disk.vmdk

(hint: type the command manually, do not copy/paste from web. Otherwise you can get typographical spaces or minuses instead of the usual ones.)

Read the rest of this entry »

wrong but fast fix

December 12th, 2008

After a small system upgrade an application started to crash with the message:

*** glibc detected *** sylpheed: double free or corruption (out): 0x0839e818 ***

The right thing is to trace the application and submit a bug report to the author, but I found a fast workaround. Set an environment variable before running the program:

export MALLOC_CHECK_=0