Galaksija genuine advantage
22.09.2007 20:36
There's a lot of Galaksija emulators out there. First there's one for DOS and Windows. Then you have one for ZX Spectrum and now also for SAM Coupé.
So how can you, as a simple user, be sure that you're getting the real 1980s Galaksija experience instead of some emulator of a questionable origin? Well, fear no more: Galaksija genuine advantage software will tell you exactly what kind of machine is behind the display you are looking at:
On a more serious note. It's amazing that Galaksija can be emulated so well on another machine of its class (same CPU with similar clock frequency), but it isn't that hard tell apart emulator from the real thing.
This diagnostic program just looks at properties of different sections of Z80 address space. CNST means that you get consistent values from it, suggesting there is something attached to the bus at that address and MMRY means that it can remember a value that was previously written to it (like RAM for example). Emulators also patch some bytes in ROM, so a check sum is calculated and compared to a known value.
Update: Here's how it looks when it runs on an emulator:
Latex tip
21.09.2007 23:54
I have a feeling I had this problem at least once before, found the solution and forgot about it. So, here's the whole story hoping I won't forget about this the third time.
The twoside option to the article document class in Latex makes the document suitable for duplex printing (for example by making margins slightly different on odd and even pages, etc.). It's just one of those little things that make Latex documents look really nice when printed. However Latex documentation doesn't mention that it also has one nasty side effect...
It changes page layout from this:
to this:
Why is this you ask? Some grepping through the Latex configuration brings up this little gem (in article.cls):
\if@twoside \else \raggedbottom \fi
Which means that the raggedbottom option is not enabled if the twoside option is enabled. I'm sure a perfectly reasonable explanation exists for this (as it seems to for every other thing in Latex), however to me this kind of layout just looks plain ugly.
The solution is obviously to include a \raggedbottom command at the beginning of the document. This way the page layout you've painstakingly fine tuned doesn't break when you switch from single side to duplex printing.
z80dasm 1.1.0
17.09.2007 22:43
A few days ago I uploaded version 1.1.0 of z80dasm. Here are a few bits from the changelog:
Rewritten symbol table routines. Replaced old symbol table from dz80 that used statically allocated strings with some more modern code. Better comments in the symbol file regarding where and how a particular symbol is used is a nice side effect of this.
Support for input symbol files. You can now give the disassembler knowledge about known symbol values (constants, function locations, etc.) in the form of a standard Z80 assembler symbol file.
Support for splitting binary file into data and code blocks. Along with the symbol file you can also now give z80dasm a description of data and code sections in the binary file you're working on. It will then write data sections with "defb" or "defw" directives in the assembly file instead of disassembling them.
Collection of Galaksija demos
24.08.2007 18:28
Here's a short video of all of new demos that are included in the 0.2.0 release of Galaksija development tools:
Chariots of Fire
23.07.2007 0:15
Chariots of Fire is a short (260 bytes) program for Galaksija that plays a part of "Chariots of Fire" track by Vangelis.
The music it produces resembles some of the more advanced beeper music from Sinclair Spectrum. I was always curious how people were able to reproduce anything else than simple tones on a 1-bit D/A converter and this small program was nice a opportunity to learn about it.
It turns out that the code implements two independently running loops with a slightly different frequency. Each one of them changes the state of the audio output on each iteration (from 1 to 0 or 0 to 1). Result is an oscillator that slowly changes its duty cycle from 0% to 100% and back again. Here's the waveform of one note:
(listen)
The changing duty cycle periodically shifts the signal's energy from lower to higher frequencies and back again. Since the beeper (or whatever is between the audio output and your brain, including your ear) has a limited bandwidth, a lot of the higher frequencies get cut off. This means that the sound gets periodically stronger and weaker, which can be used to produce the illusion that the square wave signal has an envelope added to it.
Compare this with a simple square wave of the same frequency:
(listen)
And here is the same square wave with an added envelope, roughly matching the changing duty cycle:
(listen)
Dancing Demon on Galaksija
15.07.2007 16:04
Dancing Demon was a famous game for Tandy TRS-80 model I written by Leo Christopherson. I found out about it when I was researching the origins of Galaksija's operating system.
It turns out TRS-80 and Galaksija not only have very similar BASIC interpreters but also very similar graphics capabilities (which led me to believe Galaksija's ROM was based on Tandy's ROM, not Microsoft BASIC, but that is another story). To prove that, I ported Dancing Demon to Galaksija:
Of course, the whole program didn't fit into Galaksija's 6 kB of RAM (I believe the TRS-80 model on which the original Dancing Demon ran had 16 kB). I had to strip away the editor and basically everything else except the dancing animation (however you can still edit the dancing routine with BASIC editor in Galaksija's ROM). Melody playback also didn't make it (besides, Galaksija's software video would make that tricky), but I did manage to preserve the clicking sound (played back through Galaksija's cassette port, of course).
Source will be included in the next release of Galaksija development tools.
Galaksija demo
27.06.2007 0:49
Here'a a short assembly program (around 180 bytes of code) that demonstrates a small part of Galaksija's considerable graphics abilities :).
Some screenshots (it actually looks quite nice in motion if you're looking from far enough):
Manic Miner
21.06.2007 23:50
Manic Miner was one of the first computer games I played. It was also the first game I tried on my newly repaired Spectrum. Out of curiosity I did some googling around for technical information about this game. It turns out there's plenty floating around the Internet.
I was quite amazed that besides being one of the most popular games on the Spectrum it was also very well designed. The author (Matthew Smith) pushed a lot game's complexity from code into data: there's a pretty simple game engine taking the bottom 12 kB of Spectrum's 48kB RAM. The rest is available for data describing maps, sprites, etc. Within engine's limits you can make your own monster-infested levels simply by manipulating the data structures with no need to modify (or even understand) the engine's machine code. This made it possible for other people to make completely new games (I guess people would call them mods today) using his engine: there are several tens of them listed at World of Spectrum. This was made even simpler by the fact that the original Manic Miner release didn't employ any copy protection schemes or fancy loaders - you could push BREAK after the first part of the game's code loaded and do some simple modifications directly from Spectrum's BASIC, without needing some extra software.
It's also interesting how the engine development progressed over time: With Manic Miner's engine you could load at most 20 levels into Spectrum's memory (in addition to the engine) with each level taking 1024 bytes. It supported conveyor belts, crumbling floors and two types of monsters per level. The next version of the engine (used in the sequel Jet Set Willy) on the other hand supported 60 levels (256 bytes each) and added swinging ropes, stairways, more monsters per level and ability to connect different levels so that the player can freely walk between them instead of just passing from the first to the last level like in Manic Miner.
All this reminds me of for example more recent ID software's games like Doom and Quake. They are also written in much the same way: a compact, simple engine and a larger WAD file, containing data about the levels. Not surprisingly these game engines were also used in a large number of other games.
Here some further technical reading: Jet Set Willy and Manic Miner internals.
Lolcode
20.06.2007 12:47
If you think C supports some funny syntax, how about this:
HAI CAN HAS STDIO? PLZ OPEN FILE "LOLCATS.TXT"? AWSUM THX VISIBLE FILE O NOES INVISIBLE "ERROR!" KTHXBYE
Lolcode is a new Turing-complete language that will probably end up along such legends as Whitespace and Brainfuck. They even have a book cover ready:
z80dasm 1.0.0
18.06.2007 13:55
Here's the first release of z80dasm, my fork of the dz80 disassembler.
Some basic information about it can be found here. More details in the README file and the included man page.
Enjoy.
Assemble, disassemble, assemble, ...
14.06.2007 23:50
I'm getting tired of hunting Z80 assembler and disassembler bugs each time I want to focus on researching Galaksija's operating system.
Today I wanted to squash all those bugs once and for all, so I turned z80asm (a nice Z80 macro assembler) against its bitter rival z80dasm (my soon-to-be-released fork of dz80 Z80 disassembler).
After a long debugging session of z80dasm, I finally got the desired result (interestingly I found no new bugs in z80asm):
$ stress Final results of stress testing =============================== Tested: 2000 Failed: 0 $
(In each iteration this script copies 16kB of data from /dev/urandom, disassembles and assembles it and compares the result with the original)
IPv6 connectivity in Debian
11.06.2007 11:55
Hruške wrote about how to get IPv6 connectivity in Debian.
A few days ago I found out by accident that there is a simpler way: just install the tspc package (Some web site said to me "you are using IPv6" and I said "Wow. When did I configure that?" then remembered I installed some IPv6-related package a while ago to read its documentation). No configuration necessary and it works from behind a NAT.
It is a different kind of connectivity though (point-to-point tunnel versus 6to4), but it's good enough for just poking around the 128 bit address space and trying out a few pings.
PVM over firewalls and the Internet
06.06.2007 23:06
PVM was designed to connect different machines into a cluster over low-latency high-speed LANs. Some applications however do not need good connectivity between cluster nodes in order to work efficiently.
Now imagine you have a four-way Opteron machine at your disposal and the only thing that prevents you from adding it to your virtual machine is the fact that it is 30 km away and the only route to it leads through two firewalls and a block of public Internet.
PVM uses a combination of TCP and UDP connections for communication between nodes so you can't use SSH port forwarding. However there is a way to tunnel any kind of traffic over SSH and make a simple virtual private network using a combination of SSH and PPP daemons (see VPN HOWTO) which will also support PVM traffic.
The complete installation described in the HOW-TO is too complicated for one time use. So here are simple step-by-step instructions:
- Make sure you can make an SSH connection from master to opteron with a single command and without entering a password (e.g. by using RSA or DSA authentication). To traverse firewalls you can use SSH port forwarding for this connection (since you only need one standard TCP connection from master to opteron to achieve this - in my case it was SSH-over-SSH-over-SSH)
- Download and install pty-redir on master. It's only 100 lines of code, so it's easy to audit if you're worried about security.
- Install pppd on both master (the local host that runs the pvm console and controls the cluster) and opteron (the remote host you want to add to the cluster). Pray that both machines have ppp support enabled in kernel.
- Put the following into /etc/ppp/options on master:
- Put the following into /etc/ppp/options on opteron:
- Run ./pty-redir /usr/bin/ssh -C -c blowfish -t -e none -o 'Batchmode yes' -i path-to-your-rsa-key opteron-host-name /usr/sbin/pppd on master.
- Run pppd /dev/ttyp0 192.168.X.1:192.168.X.2 on master (replace /dev/ttyp0 with the device name that is printed by the previous command) Choose X so that these two IPs do not conflict with any other networks master and opteron are connected to. 192.168.X.1 becomes master's IP and 192.168.X.2 becomes opteron's IP in this little VPN.
- Write a PVM hostfile like this:
- Start PVM on master: pvm -n192.168.X.1 hostfile
- Enjoy :)
noauth
ipcp-accept-local ipcp-accept-remote proxyarp noauth
192.168.X.1 sp=1000 192.168.X.2 sp=10000 ...and any other local machines in your cluster
Galaksija tools 0.1.0
29.05.2007 10:15
From the README file:
This is a loose collection of tools for use with Galaksija home
microcomputer:
gtp2wav - Convert a binary Galaksija tape file to an audio file for
loading to a Galaksija computer through the sound card.
bin2gtp - Encapsulate a Z80 machine code block into a Galaksija tape
file together with a simple BASIC loader.
pgm2scr - Convert a bitmap to a Galaksija video framebuffer.
chargendump - Inspect and dump characters from a Galaksija character
generator ROM image.
include/ - Header files for use with a Z80 assembler that contain useful
macro definitions for writing assembly programs for
Galaksija.
examples/ - Example assembly programs for Galaksija
Get the tarball here.
gEDA desktop integration
14.05.2007 17:19
Remember those icons I made for gEDA file types? Here's a neat little package that includes all those icons and some configuration files.
There's a simple install script inside that installs everything in your home directory. It adds gEDA applications to the "Applications" menu and makes Nautilus (and Konqueror also AFAIK) aware of the file types they support.
Congratulations Ericsson!
05.04.2007 18:03
When restarting after a software crash, the Sony Ericsson P990 smart phone will print the following message:
Your phone has restarted in order to improve performance.
Best. Idea. Ever. This not only gives you a perfectly sound explanation why you lost that email you were typing for the last 5 minutes on the tiny keyboard but also gives you a warm fuzzy feeling that your phone is now even better than before. Everyone knows that you have to restart your computer when it starts feeling slow, right? So obviously this phone detects that it is slowing down ever before you notice and restarts itself. Great!
I bet that the engineer that came up with that message got a big promotion.
Ubuntu also just works
23.03.2007 18:50
I should have known that my last post will backfire.
On Wednesday I installed Ubuntu 6.10 on my friend's laptop (HP Pavilion ze4600). I was greatly surprised how everything worked out of the box. Including hibernation and special shortcut buttons on the keyboard for the speaker volume, web browser and email. On the same day my Powerbook went belly-up when I unplugged my (properly unmounted) iPod. It crashed so bad that I had to remove the battery (first time the usual long press on the power button didn't work).
On the second thought, almost everything worked on Ubuntu. Getting TV output to work for example required some googling and installing the atitvout command line utility. Also GNOME's keyboard preferences crashed when I tried to set up more than two different keyboard layouts (it's a known bug - I had similar problems on Debian some time ago and it will probably be fixed in the April release). On the other hand suspend-to-RAM crashes the computer and according to some web pages I saw it doesn't look like it will be fixed any time soon.
The installation itself was also a bit tricky, but that wasn't Ubuntu's fault. The computer doesn't have a working CD driver and can't boot from USB devices, so I had to boot it through the network (roughly following these directions). For some reason then the Slovenian and German Ubuntu mirrors didn't work (the installer said the packages are corrupted) and it took forever to download everything from a US mirror.
However in the end the whole thing required far less manual tweaking than I expected (as Debian user). Congratulations to the Ubuntu developers!
Siemens C35 firmware version
15.03.2007 18:52
How to check the firmware version on a Siemens C35 mobile phone:
- In the menu choose Setup -> Phone -> Status -> Phone identity. Phone's IMEI number appears on the screen.
- Press the left-most multifunction key (its function is not marked on the display).
This took me quite some time to figure out. It seems to be standard practice today to remove all information from the official manufacturer's website as soon as a particular model goes out of production.
Galaksija: Spaghetti
18.02.2007 1:42
Over-optimization does terrible things to the code...
So far I've disassembled and annotated two large chunks of Galaksija's ROM - the video interrupt handler and cassette loading and saving routines. I had to do that to find out how the original hardware worked. Fortunately these two parts were simple to figure out compared to some other parts of the code that resides in that tiny 4K EPROM.
Some parts are written in a way that I would never otherwise consider possible: you probably heard about parts of code that are also used as ASCII strings, but how about jumps that are no not aligned with opcode boundaries? Apart from a handful of documented ROM functions there is almost no structure in the code. A single RET instruction for example can be used as an exit point for tens of separate functions.
To give you some idea of the complexity involved, here are some call graphs. Each box represents a chunk of machine code. Thin black arrows show jumps and loops, thick black arrows show neighboring blocks of code (where execution goes from one block to the other without a jump), red arrows show function calls and blue arrows show calls by RST instructions.
Circular boxes are entry points (two interrupt vectors and a reset vector), rectangular boxes are code in the first 256 bytes of the ROM that can be accessed by RST instructions. Other boxes represent other parts of the code.
This graph is only approximate of course. Various tricks in the code make it impossible to do an accurate static analysis (especially with my 175 line Perl script). Dynamic jumps and jumps not aligned with opcodes for example are not shown or are shown wrong.
Here's the original Postscript file I used to create images above. Make sure you have plenty of swap space and a good Postscript interpreter before you open it.
Fancy hidden Firefox feature
21.01.2007 22:27
I've just heard about a well hidden and very useful feature in Firefox from FLOSS Weekly podcast's interview with Ben Goodger. If you right-click on a search field on some website you can add a shortcut to your address bar that makes searching a lot faster.
For example, if you make a lot of searches on tablix.org, you can do something like this: right click on the text entry and select "Add a keyword". Then type a keyword (like "tablix" for example) in the dialog window that pops up.
You can now search Tablix documentation simply by typing "tablix" and some search terms separated by spaces in the address bar of your Firefox.
Airport wireless security
01.01.2007 11:55
This popped-up in my Bookmarks menu today at Munchen Airport (via multicast DNS or Rendezvous as Apple prefers to call it. I did nothing special really):
I hope they remembered to order a new imaging drum in time. It's certainly going to wear out quickly when someone sets that each printout must come in 99 copies...
gEDA Symbols UI
22.12.2006 15:51
After some discussion a few days ago on the geda-dev mailing list I made this Gnome HIG compliant interface to the gedasymbols.org database.
It allows you to browse and download schematic symbols without starting your web browser, which makes gedasymbols.org much more convenient. In the good old Gnome tradition it also asks minimal amount of questions - my goal was to make a simple tool that just works and doesn't need any configuration.
First time you start it you have to select a local repository for storing symbols. The directories in the list are taken from the existing gEDA configuration files. If you use some other directory that's not on the list it is also automatically added to gEDA configuration. The code is even smart enough to show this dialog again whenever it detects you changed files in ~/.gEDA by hand.
The code is written in gtk2-perl and the interface is designed in Glade (I used Bostjan's G-Tablix as a working example of a gtk2-perl program).
Schematic capture, part 2
22.11.2006 21:50
Some time ago I did a short comparison between XCircuit and GSchem. At that time I was only using GSchem for a few days so I was a bit biased.
Now I have been using GSchem regularly for about 4 months and during that time I've used it to draw the complete schematics for Galaksija motherboard, its keyboard and also a number of smaller circuit. Since I now have quite a bit more experience with this application I feel I need to correct some of things I previously said about GSchem.
Usability
In my previous post I've mentioned that XCircuit's key bindings and overall work flow seems to be more efficient. I still agree with that. Moving and editing placed components is still awkward compared to XCircuit, even after you get used to it. For example, now I got used to delete a net and draw it again instead of trying to move its vertexes into the correct position.
I submitted a patch that makes some additional keyboard shortcuts possible (like panning with cursor keys, which is normal in XCircuit) and it got accepted to the official version. So this is now a bit better than 4 months ago. Still most keyboard shortcuts use two keypresses which I find a bit odd. This is configurable with some Scheme scripts however I'm a bit too lazy to do a complete overhaul of keyboard bindings (and I'm pretty sure such a change would not be appreciated by GSchem developers and other users)
Stability
CVS head version is quite stable and is perfectly usable for day-to-day work. Compared with some projects that break their CVS builds every few days this is very nice.
Component enumeration
This is still isn't working very well in the official version, but things should improve soon. I've submitted a patch with a new autonumbering dialog. It's not yet in the official version of GSchem, but I'm working with some gEDA developers to make it good enough to be merged with CVS head.
Symbol library
After working a bit with GSchem I found out that the symbol library included with the program is bit too inconsistent for my taste. There are for example different symbols for circuits from the 74 family that are drawn in a slightly different style. I ended up redrawing quite a lot of them to correct pin spacing, placing, symbol attributes, etc.
A bigger problem is that some symbols are using VDD and VSS global nets for supply and ground while some are using Vcc and Gnd. This isn't obvious when you are drawing the schematic (unless you check each symbol you place) but can cause a lot of confusion when you are drawing the PCB from the automatically generated netlist and some chips don't have ground connected.
First try at making icons
07.11.2006 0:16
This is the result of my first attempt at making icons with Inkscape. I've made this set for the coming F5J competition scheduler that will use Tablix for its timetabling engine.
I tried to stick to the guidelines of the Tango project although these icons will probably only be used on Windows:
Numerical electromagnetics, 2
24.08.2006 18:47
Another nice picture. This time it shows the distribution of current in a square U-shaped turn. It was quite easy to add this functionality because the equations for electrostatic field and current field turn out to be very similar. This also made a nasty bug pop up in one of the numerical functions which took two days to find (lesson learned: it pays to always use the search and replace functionality of the text editor, even when it seems that it is faster to do those three little changes by hand).
You can see that most of the current flows near the inner corners of the turn. The bright outline of the conductor is an artifact of the finite difference method. I'm still working on how to remove that.
In logarithmic scale the small current through the composite substrate can be seen.
Numerical electromagnetics
21.08.2006 21:00
Here are some nice pictures generated with a piece of software I have been working on for the previous week. This (it still needs a name - suggestions are welcome) will be a tool for numerical analysis of printed circuit boards. It is my last project as part of my undergraduate study of electronics.
Currently it can take any printed circuit board designed with PCB, calculate stray capacitances between traces and print them out in a SPICE-compatible format. As a side effect it also generates pretty pictures of electrostatic field strengths.
This picture shows the strength of the electrostatic field in a simple PCB that forms a plate capacitor: the top copper layer is grounded and the lower layer is at a fixed voltage. The vertical dimension is exaggerated.
Plates aren't shown on the picture. You can see the bottom one as a black outline against the electric field because there is no field inside the plate.
This is the result of running the simulation on a board I designed some time ago. You can see that at one point the field strength reaches around 40 kV/m. That is the point where the ground and supply trace are closest together - between the pins of the voltage regulator.
The program uses a finite difference method to calculate electric field and I believe it would be quite simple to extend it to also calculate trace resistance. It may even be possible to use it to calculate magnetic fields and inductances, however I haven't looked into that yet.
The code is a mess right now. I will put the source on-line as soon as I get things together and find some time to document things.
Free tools for schematic capture
26.07.2006 23:58
I know of two free software tools for schematic capture of electronic circuits: the first is called Gschem and is part of the gEDA package and the other is XCircuit.
I have been using XCircuit exclusively for a couple of years now, mostly for board level design but also for a couple of integrated circuits. I've began using it because at that time it was the only free solution I found and because I also used it to draw other illustrations for various papers and reports for the Faculty. However lately I've been looking for another program to replace XCircuit. I've been working on more and more complicated circuits and I feel that getting rid of XCircuit shortcomings will out weight the time needed to learn to use a new interface efficiently.
So here is a short comparison of Gschem and XCircuit (as I've only worked for two days with Gscheme, this may be a bit biased):
XCircuit
Pluses
- Very efficient one-key keyboard shortcuts (examples: "e" for edit, "r" for rotate, etc.). You have one hand over the alphanumeric part of the keyboard and the other hand on the mouse. The mouse cursor stays mostly in the center of the window and you rarely have to move it to the menu bar.
- Very consistent use of mouse buttons. In all situations the middle mouse button is for "ok/yes", right mouse button for "cancel/no" and left button for "maybe" (it moves cursor to the next possible choice). This further removes need for any menu interaction.
- Default tool is for drawing nets. You spend most of your time drawing connections, so this a very good thing.
- Encapsulated Postscript is its native format. This means it's incredibly easy to embed schematics in Latex documents. It's also quite easy to edit files directly in a text editor.
- Unselect function. If you select only one object too many with a box select, you can point your mouse to that object and hit "x" to deselect it. This saves time when trying to select everything except that thing over there.
Minuses
- In all those years I haven't figured out how generate PCB compatible netlists from schematics. The tutorials work, but once I get to custom symbols I'm lost. I usually printed out the schematics and wrote netlists by hand.
- Connectivity detection is weird. There is no strong distinction between nets (that should "conduct" electricity) and decoration (e.g. symbol outlines) - or at least I haven't figured it out.
- No automatic component enumeration or bill of materials generation.
- Symbol library management is a nightmare. I'm actually using Vim to copy new symbol definitions from a temporary file to the central library file. Also the library that comes with the distribution only contains basic symbols.
- Is it written in TCL? Or Python? C?
- Symbol rotation is a lossy operation. Select an object and rotate it 360 degrees in steps of 15 degrees. If you are lucky, the end result will still resemble the original.
- Hard to work with opaque symbols because there is no easy way to control drawing order.
- Orphaned Debian package.
Gschem
Pluses
- Very good symbol library management: Multiple directories, system-wide and local library automatically merged together, symbol versioning. Extensive library is already included with the distribution.
- Netlist generation works and is PCB compatible. It even makes a template PCB file with all components added to the board.
- Has a basic support for "slots", that is multiple independent devices in one physical package.
- Attribute editor!
- Multiple copy & paste buffers that are actually easy to use (still haven't figured out how to do that efficiently in Vim).
- Automatic enumeration of pins. A bit more awkward than in some proprietary software but useful nonetheless.
- It is written in Scheme and C and appears to be quite easy to modify and extend.
- The native format is simple and in ASCII, so it is easy to make a diff or edit it in a text editor.
Minuses
- Compared with XCircuit, the keyboard shortcuts are kind of slow. Most take two key presses, sometimes with an additional modifier key. In most cases you also have to select an object before the keyboard shortcut will work. So an operation that takes one key press in XCircuit takes two mouse button clicks and two key presses in XCircuit.
- Net editing is very slow. "Rubberband" mode applies only when moving symbols and parts of nets (not moving vertexes) and even then the connected nets don't stay aligned on right angles. It is faster to delete a net than to edit it (and deleting isn't very fast either, because you can't select a whole net at once but only each segment at a time).
- Component enumeration does not appear useful. It ignores slots and I can't make it start numbering components with 1 instead of 100.
- "Stable" version crashes every 10 minutes with a very simple circuit displayed. (CVS version seems better).
- What's with leaving "gschem.log" in each and every directory?
In conclusion, I think I'm going to try to work with Gschem for a bit longer. If it will turn out that I'll be able to use netlist generation on real projects that thing alone will outweigh all of Gschem's minuses. I've also downloaded the code from CVS and it looks really nice. I already have a couple of patches that correct the most annoying things (at least for me).
So after maybe a month, we'll see what I will be able to add to the lists above.
Firefox, meet Vim
22.07.2006 22:03
Mozex extension for Firefox allows you to use an external editor for editing text in text entry boxes on web sites. And suddenly editing long Wiki pages becomes a bit less painful...
This extension is one of those things that once you find them you can't imagine how you managed to do any work without them.
NAT and IRC
07.07.2006 23:03
I just found out that you have to load the ip_nat_irc kernel module on the firewall in order for outgoing IRC DCC transfers to work. The ip_conntrack_irc module, as inviting as it looks, doesn't work by itself.
Is it just me or netfilter kernel modules really don't have any official documentation? My Google searches for ip_conntrack_irc resulted only in numerous more or less informative and more or less up to date mailing list and forum posts. The best source of information I have found so far are the comments in the code itself.
Tablix on Windows
19.06.2006 10:42
Yes, it is actually possible to run Tablix on Windows XP!
The binary in the screenshot was compiled with GCC under Cygwin, but once it is built does not require a Cygwin installation.
You have to make some moderate changes to the Tablix source before it will compile cleanly on Windows. (Some of the changes are documented in the Wiki). Autotools (automake, autoconf, libtool, ...) fail spectacularly on Cygwin so also a new set of Makefiles is required.
PVM is horribly broken on Microsoft's systems, so Windows machines can't be a part of the cluster. After some testing it turned out that Tablix can solve problems of moderate size quite efficiently even in debug mode (i. e. genetic algorithm with a single population without using PVM), but you have to do some tweaking of the genetic algorithm parameters.
Minimalist spam
17.06.2006 21:31
Someone is trying to post spam to mailing lists on my server. They are sending spam to the correct mailing list address with my old email address in the From: field.
Since I'm subscribed to the list with my new address, the Minimalist mailing list manager bounces spam back to me, with the attached warning saying that I'm not subscribed.
I got 50 such emails in just one day. This would wrack havoc on the mailing list if they would succeed to spoof my proper email address.
Is this only a coincidence or is this work of some bot that is smart enough to find the email addresses of people that are subscribed to the list (from the list's archives for example) and spoof them?
I don't currently see any simple way of preventing people from providing spoofed email addresses to the Minimalist. This spam is coming from a DSL IP range in Morocco so if this will get any worse, I'll simply route this IP range to /dev/null.
VIM 7.0
18.05.2006 10:54
VI Improved 7.0 packages got into the Debian Unstable repository today (just 10 days after the upstream release)! Now it's just an apt-get install away from my machine...
Mail.app weirdness update
25.03.2006 23:47
I've fixed my problem with Mail.app today.
The problem was that when Mail said The certificate for this server has expired it actually wanted to say The root CA certificate that signed the certificate for this server expired. Another fine example of misleading error messages.
The fact that the keychain that holds root CA certificates isn't accessible by default on Mac OS X just further complicated things. You can only add certificates to it by selecting a mysterious X509 Anchors keychain on the Add Certificate dialog but there is no obvious (or documented as far as I know) way of deleting them. It took quite a lot of experimenting (for example with the quite limited security command line tool that claims to be able to do just about anything the Security framework is capable). In the end, I found out that you can access the X509 Anchors keychain by simply opening the Keychain application, choosing Add Keychain... from the menu and selecting /System/Library/Keychains/X509Anchors.
More Mail.app SSL weirdness
24.03.2006 2:12
Mac OS X Mail application on my Powerbook earlier today suddenly realized that we are way past February 2008, which means that the SSL certificate for my mail server expired and I can't read my mail.
To make things a bit more interesting, the Keychain thingie keeps telling me that the certificate is still valid. The system date and time are also correct as far as I can see and Thunderbird on another computer and another operating system is perfectly happy with this certificate.
This has no effect.
As always, things like this happen at most unfortunate times.
Why I like free software
13.03.2006 10:15
I really like the way art.gnome.org displays dates. Instead of giving you a boring "Mon Mar 11 02:25:47", that leaves you wondering what the current date and time is, it will for example simply say "Two days ago".
I would like to display document modification dates in this same way in the next version of my Nanobeagle search engine. Of course, I could write a function that gives a date in this form myself. It would probably be just a matter of some simple arithmetic and comparisons, but why should I reinvent the wheel?
So I set out to find the original function behind this date display. A quick search through the FAQ and Forums on the site revealed no information on what software art.gnome.org is running. When searching for "art.gnome.org software" on Google all hits were about the graphical front-end software "Gnome Art" not the CGI scripts that are running the site itself.
Ok, perhaps GNOME people store their web scripts in their CVS repository. My first guesses were "web" and "web-devel-1" projects, but they seem to only contain static pages. Finally it turned out that "art-web" was the right choice. A quick cvs checkout and grep for the word "yesterday" later, I found the FormatRelativeDate() function I was looking for.
"Open terminal" Nautilus script
11.02.2006 17:03
Put this script in your $HOME/.gnome2/nautilus-scripts directory. Make sure it has execute permission set.
You can then open a terminal window from the Nautilus context menu. If you have any directories selected in Nautilus one terminal window will be opened for each of them. Working directories will be automatically set to the directories selected in the browser. If no directories are selected only one terminal will be opened with the working directory set to the directory currently opened in Nautilus.
Udev, part 3
06.02.2006 16:03
Referring to my previous post, the right way to get serial devices back under udev is to load kernel module 8250.
And yes, the serial devices are still named /dev/ttyS0, /dev/ttyS1, etc. in spite of Serial HOWTO claiming otherwise.
Internationalization in Tablix
01.02.2006 17:00
I'm easily annoyed by software that doesn't work or somehow mangles Slovenian characters č, ž and š. So I really want Tablix to work correctly with all languages.
Currently Tablix already handles different languages quite well, but according to LibXML documentation this is a mere coincidence, since a lot of my code is not written in The Right Way. I want to correct that.
However more I look into this subject more it seems to me that this task is really complicated. The main problem in internationalization is that for each string stored in the memory you must know exactly what its encoding is. This is not as trivial as it sounds, since there are a lot of different sources of strings in Tablix:
- Strings obtained from the LibXML are the least problematic, since all are encoded in UTF-8. These are also nicely contained in xmlChar type.
- Constant strings, internationalized with GetText (_() macro), are encoded in the encoding of the current locale which can be anything.
- Simple constant strings in C. I guess these are in whatever encoding the C source file was, but I'm far from sure after some googling.
- Strings returned by sprintf(). I think these should be in the encoding of the current locale, but again not sure.
- Command line arguments obtained from argv. Current locale I guess.
A similar problem appears when these strings are written somewhere. But here at least the situation is a bit less foggy.
- All strings passed to LibXML must be UTF-8.
- Strings written to the console must be in the current locale encoding.
- Strings written to HTML files must be in the encoding of that file.
- File names must probably be in the current locale encoding. Not sure.
I'll buy a beer for anyone who can clarify the points I'm not sure about.
Templator
31.01.2006 1:32
I just managed to clean up and somewhat document the Templator script I made for the OpenOffice.org conference web site last September.
This is the first of a series of tools I developed in a hurry during those three days and that also proved useful for other projects. Other tools and scripts will probably follow in the more or less near future, depending on my free time and sleep patterns.
More GNOME xkb weirdness
14.01.2006 21:51
It seems these damn GNOME xkb errors are spreading. Now my home machine has contracted them too after upgrading from GNOME 2.10 to 2.12. And unfortunately the solution I mentioned previously no longer works.
Deleting all dot files in my home directory also doesn't help.
Making /var/lib/xkb world-writable - no effect.
/etc/X11/xkb/rules/xorg - check.
Asking for help on IRC in #gnome - no answer, since this problem has already been discussed to death on all sorts of message boards, mailing lists, wikis, bugzillas (earliest posts I could find regarding this were from 2002!). Of course, it could be that the error or my machine is caused by something completely different than in all those other hundred case, but how can I tell? The fscking error message is exactly the same and offers no clues on what caused it.
GNOME keyboard troubles
12.01.2006 23:56
If you are getting annoying error messages like these every time you start GNOME or try to change the keyboard layout with gnome-keyboard-preferences and if setxkbmap seems to be working fine, check if you have this file: /etc/X11/xkb/xkbcomp. If you don't have it, try to find it somewhere (I found it in /usr/X11R6/bin) and make a symlink like this:
$ ln -s /usr/X11R6/bin/xkmcomp /etc/X11/xkm/xkbcomp
Why exactly one needs to spend a couple of hours stracing various Gnome binaries to get to this conclusion is left as an exercise for the reader (hint: try running a rogue gnome-settings-daemon from a terminal).
More useful error messages
10.01.2006 23:15
This is another fine example of how not to code your web application. The following window opened when I clicked on a link saying something like click here for details.
For english speakers: the text in red says "System error report" and the smaller text says "System error: Error".
So as I understand this, the detailed description of this error is that the system error report had a system error reporting an error which was caused by an error. Just great!
Why you should read planet.debian.org from time to time
30.12.2005 16:10
Wow. I just found out that Linux kernel on my machine wasn't using all of the available memory.
