wnd's weblog


December 2016
Mo Tu We Th Fr Sa Su
28 29 30 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
Categories
Archive

More on Game of Life in 6510 assembler

7 December 2016 09:02:09 my software

As it turned out, I never released the sources for the second generation of my Commodore 64 version of Conway's Game of Life. Unlike the earlier version, this second attempt packs four cells per byte. While it adds to the complexity, it also reduces time spent in data retrieval by a lot. This version uses lookup tables to count live cells by using a lookup table on zero-page.

Get the sources. You may also read an earlier entry and/or see the earlier version(s).

Permalink | Comments (0)

Stockholm, August 2009

28 November 2014 20:16:18 photos, travel

Vasa warship, Stockholm, Sweden Extremely minimal set of photographs from Stockholm, Sweden. If it weren't for Vasa, I suppose there photos could be from anywhere. You have been warned. See the few photos here.

Permalink | Comments (0)

N900/Fremantle and Iodine

15 June 2014 09:11:31 maemo, software

Grab a minimal-dependency iodine client start up script from here.

Long story short: I've rewritten iodine-client-start to have minimal dependencies and to run with standard Bourne shell. The only additional packages this script should require are iodine and iproute.

Back in the days when Nokia N810 was my main and only "internet tablet", I discovered iodine, a IP-over-DNS tunneling... thing. I set up my own server and tried to set up the client with provided iodine-client-start script. Things didn't work out-of-the-box and I soon discovered number of dependencies. Because I was keen to see iodine in action, I quickly built a package with all necessary dependencies in it. If my memory serves me right, I had to strip down things like ipcalc to run on Diablo, and compile some others. Eventually I got Iodine to work, and never bothered to properly package things.

When I finally got a N900 of my own, I tried to set up Iodine client for it as well but failed. Life being busy and all, I never get around to get things working. Until two weeks ago. I was walking back home from downtown and being nice and sunny day, I stopped to sit on a bench. I can't remember what I was going to check online, but in any case I tried to establish an internet connection using an open AP that happened to be there. It turned out it was one of those that requires a login. One thing lead to another, and by the time my head hit the pillow that night, I had a nice little script ready for field testing. Much to my surprise it worked without a hitch - except that the routing to my own subnet was broken from my iodined.

Permalink | Comments (0)

Vim and long lines

4 December 2013 18:29:11 rant, software
highlight LongLines ctermbg=red ctermfg=white
match LongLines /.\\%>81v/"

Some months ago I switched to i3 window manager after discovering a Vim option to highlight column 81. As silly as it may sound, not easily spotting long lines was one of the biggest reason for not switching earlier. However, colorcolumn option wasn't perfect. It messed up using X11 to paste text from Vim.

When I first grew tired to colorcolumn and loads and loads of unwanted whitespaces in pasted text, I figured I'd use X resources to configure rxvt to draw column markers. These markers would obviously be completely separate from actual text buffer. After struggling to introduce X resources in rxvt, I realised my plan also was flawed; this wouldn't work properly with Vim's windows.

When the time to have a Christmas party at work arrived, I realised I'd have quality time to work on this again. I patched rxvt with a private set of VT escape sequences to manage a list of column markers. Adding this functionality was surprisingly simple and the unminimised patch (without partially implemented X resources) was just 145 lines. The next step would be to create a Vim script, or in worst case scenario, patch Vim to send required sequences to set the markers.

When I was testing my fancy little patch, I came across some settings in Vim configuration file I had added for highlighting redundant whitespaces a decade earlier. That's when I realised I could use exactly same thing for highlighting long lines. It wouldn't be exactly as pretty as my fancy little patch, but there would be no patching and no compiling.

The next time I think I need to patch some piece of software, I really need to sit on my hands and think if it's really the only way. That would have a lot of time.

Permalink | Comments (0)

Linux, SD card readers and HAL

4 September 2013 17:59:31 for future reference, Linux

If your copy of GNU/Linux can't find your SD card in a reader, try running lshal (which can be found in package hal in Debian) and then check again.

Earlier today I was trying to copy the stuff from an micro SD card, but failed miserably as the kernel log didn't mention a thing about the card when it was inserted. Puzzeled, I inserted the card in my cheap Chinese Android tablet and behold, the stuff was there. I then tried the same card with a Linux laptop with no success. Baffled, I also tried other SD cards (regular and micro) with my desktop. None of the cards worked. The card reader appeared as /dev/sdg and that's all there was for it. At the same time using an USB adapter for the micro SD card worked perfectly fine.

After asking the almighty Google about this, someone suggested running lshal as a mean to investigate remotely similar problem. After installing HAL, running it and grepping the output I saw the card was now available through /dev/sdg1. dmesg now also mentioned this "newly" attached device.

Obviouly I've fallen behind after introduction of DEVFS and udev, as I didn't even think of HAL. In fact, I don't even really know what HAL is. I've known what it stands for, I've known that for quite some time, but that's about it. I still find it odd that dmesg didn't list the device until hald was started (upon running lshal). Also, if HAL was so crucial part of the system nowadays, why is it marked as optional in Debian? My understanding here is rather limited, but why did things work so differently for "plain" USB sticks?

Oh well, immediate problem solved. Perhaps I educate myself about all this later.

Permalink | Comments (4)