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 »
Posted by olpa in python | No Comments »
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 »
Posted by olpa in windows, linux | No Comments »
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 »
Posted by olpa in windows | No Comments »
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 »
Posted by olpa in windows | No Comments »
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
Posted by olpa in linux | No Comments »
December 8th, 2008
Upgrading a macports (darwinports) package is not as easy as
$ sudo port upgrade something
In many cases I need the following command:
Read the rest of this entry »
Posted by olpa in Mac | 1 Comment »
December 8th, 2008
In addition to the conference checklist, I now need a checklist for local chess tournaments.
Read the rest of this entry »
Posted by olpa in chess | No Comments »
November 11th, 2008
For development purposes, I’d like to run a rsync server on a Mac.
People in forums recommend to avoid the default system rsync, which is accused of being buggy. Instead, they recommend RSyncX.
Read the rest of this entry »
Posted by olpa in Mac | 2 Comments »
November 11th, 2008
It’s quite easy to create a local MacPorts repository. Unfortunately, the documentation doesn’t say how to share the repository with others. After trials, errors and reading the source code, I’ve found the answer: the only way is rsync.
Read the rest of this entry »
Posted by olpa in Mac | No Comments »
October 24th, 2008
I’ve noticed that headers and footers of the documents, generated by XeLaTeX, use some other font instead of Helvetica. After digging into the LaTeX code, the problem is solved.
Read the rest of this entry »
Posted by olpa in publishing, TeX | 2 Comments »
October 17th, 2008
Do you generate [La]TeX files using Python? If yes, do you escape the special characters. Haven’t you forgotten to escape also empty strings?
To avoid reinventing the wheel, I tried to use TeXML libraries. This is the right choice, but one has to use a little trick.
Read the rest of this entry »
Posted by olpa in python, TeX, TeXML | 1 Comment »
September 30th, 2008
ALSA is the Advanced Linux Sound Architecture. The system can forward ALSA sound to PulseAudio.
Read the rest of this entry »
Posted by olpa in linux | 2 Comments »
September 27th, 2008
PulseAudio is a sound server. Applications feed music to PulseAudio, and PulseAudio decides what to do with it. For example, it can send the sound over network.
When I tried to use this feature for the first time, I failed. Therefore, I experimented with a more user friendly software (see multimedia over network I, and the second attempt was successful.
Read the rest of this entry »
Posted by olpa in linux | No Comments »
September 26th, 2008
I need to get utf-8 (unicode) data instead of 8-bit from a Microsoft Access database (ODBC connection). It seems I’ve finally found the answer:
It’s impossible.
Read the rest of this entry »
Posted by olpa in Uncategorized | No Comments »
September 24th, 2008
I wanted to convert text to curves in PostScript. The well-known tool to do it is pstoedit (alternatives are welcome). Unfortunately, it worked only partially.
Read the rest of this entry »
Posted by olpa in publishing | No Comments »
September 24th, 2008
I want to:
* run a program on a work PC, and
* see and hear it in action on a leisure PC.
The first attempt is failed, therefore I started to search for a solution using the step-by-step approach. The first step is to make sure that multimedia over networks works at all.
Read the rest of this entry »
Posted by olpa in linux | No Comments »
September 20th, 2008
I always used vim (for example, “Ctrl-K” “:” “u” for “ΓΌ”), but now I found a way to input such characters into any application, using the core feature of X11/xorg. The explanation and the table are here: “ISO-8859-1 compose keystrokes in Linux” (thanks Andrew Daviel).
Reminder for myself: on my system, it’s enough to add “compose:ralt” to the option “XkbOptions” in “xorg.conf” and use “Alt Gr” key.
Posted by olpa in linux | No Comments »
August 19th, 2008
After upgrading my Linux, I’ve got sound lost. Everything looked ok — all the modules are loaded, all the special devices are created, no complaints in logs, — but no sound.
Read the rest of this entry »
Posted by olpa in linux | No Comments »
July 10th, 2008
There is a number of XML-editors, but there are no user-friendly ones (except FraemMaker). A standard XML editor is a tool for programmers, to play with XML. But technical writers need an user-centric XML editor, to play with a document, not with XML.
Read the rest of this entry »
Posted by olpa in publishing | 5 Comments »
July 8th, 2008
Posted by olpa in chess | No Comments »