I've recently started learning Python (again), and this time it seems to be sticking. The only problems I'm left with are the small, stupid ones that you only get if you've been writing Perl code for years:
re.match() != re.search()You'd expect re.match() and re.search() to be identical, but they're
not: re.match() only matches at the beginning of the string.
If you want "Perl-like" matching, use re.search(),
which will match even if the pattern doesn't start at the beginning of the
string.
break/continue vs last/nextI don't know why it took me ages to find this, but the Python
equivalents of Perl's last/next statements are
break and continue. And I keep remembering it the
wrong way around, too.
I'll keep updating this post with other "small things" I find as I'm getting to know Python better.
I've finally been able to get my Mac Mini to display proper 1360x768 output, without horrible scaling. It turned out that the framebuffer wouldn't accept the new resolution X asked for, and stayed on 848x480, while X would think the new resolution had been set. This, combined with the fact that X.org doesn't seem to have a built-in modeline for 1360x768, caused the breakage.
Now my "Monitor" section looks like this:
Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 30-61
VertRefresh 50-75
Modeline "1360x768" 84.50 1360 1392 1712 1744 768 783 791 807
EndSection
And my "Device" section like this:
Section "Device"
Identifier "ATI Technologies, Inc. Radeon 9200 (RV280)"
Driver "ati"
BusID "PCI:0:16:0"
Option "UseFBDev" "false"
Option "MonitorLayout" "TMDS,NONE"
EndSection
I've converted all the GWBASIC files I found on the floppy with my first programs to plain ASCII (well, Codepage 850) text files, and put them on my website.
The original disk contained a few more files: some DOS executables and some 'adapted' code from other people, but I'm not putting that online..
Op dit werk is een Creative Commons Licentie van toepassing.