Search Results: "mak"

17 September 2007

Colin Watson: Encodings in man-db

I've spent some quality upstream time lately with man-db. Specifically, I've been upgrading its locale support. I recently published a pre-release, man-db 2.5.0-pre2, mainly for translators, but other people may be interested in having a look at it as well. I hope to release 2.5.0 quite soon so that all of this can land in Debian. Firstly, man-db now supports creating and using databases for per-locale hierarchies of manual pages, not just English. This means that apropos and whatis can now display information about localised manual pages. Secondly, I've been working on the transition to UTF-8 manual pages. Now, modulo some hacks, groff can't yet deal with Unicode input; some possible input characters are reserved for its internal use which makes full 32-bit input difficult to do properly until that's fixed. However, with a few exceptions, manual pages generally just need the subset of Unicode that corresponds to their language's usual legacy character set, so for now it's good enough to just recode on the fly from UTF-8 to some appropriate 8-bit character set and use groff's support for that. man-db has actually supported doing this kind of thing for a while, but it's been difficult to use since it only applies to /usr/share/man/ll_CC.UTF-8/ directories, while manual pages usually aren't country-specific. So, man-db 2.5.0 supports using /usr/share/man/ll.UTF-8/ instead, which is a bit more appropriate. Also, following a discussion with Adam Borowski, man-db can now try decoding manual pages as UTF-8 and fall back to 8-bit encodings even in directories without an explicit encoding tag; if this fails for some reason, you can put a '\" -*- coding: UTF-8 -*- line at the top of the page. I'm still debating whether Debian policy should recommend installing UTF-8 manual pages in /usr/share/man/ll.UTF-8/ or just in /usr/share/man/ll/. Initially I was very strongly in favour of an encoding declaration, but now that man-db can do a pretty good job of guesswork I'm coming round to Adam Borowski's position that people should be able to forget about character sets with UTF-8. Opinions here would be welcome. One thing I haven't moved on is that any design that assumes that the encoding of manual pages on the filesystem has anything to do with the user's locale is demonstrably incorrect and broken; I'm not going to use LC_CTYPE for anything except output. However, maybe "UTF-8 or the usual legacy encoding provided that the latter is not typically confused for the former" is a good enough specification, and that still has the desirable property of not requiring a flag day. I'll try to come down from the fence before unleashing this code on the world.

Miriam Ruiz: Storing data in $HOME directory

When packaging games, one of the operations I often have to do to the source code is modifying it so that it uses absolute file and directory names instead of relative ones. When coders develop for Windows, or when they develop their games to be able to play them from their home directory, they just would go that way and won’t care about it, but when the idea is installing the files in the system, the Filesystem Hierarchy Standard (FHS) must be respected, and thus things will need to be place in their proper directories. For read-only files, this is not a big deal, all that has to be done is replacing the relative file name in the file opening commands with the absolute one, doing fopen(”/usr/share/games/package/dir/file”) instead of fopen(”dir/file”). I usually prefer to do it like fopen(DATADIR “/dir/file”) and set DATADIR from the Makefile, with a -DDATADIR=\”/usr/share/games/package\” switch added to the CFLAGS, and maybe also setting it inside the code if it’s not previously defined (#ifndef and so). There are some files and directories in which doing this is not possible, because they want read-write permissions. This files include saving the configuration, hiscores, new levels created with the game editor, game saves and so. They might be moved to some directory under “/var/lib/”, and create a new group en the system so that it’s writable, and so on. I don’t like that approach a single bit. I prefer to move all tthat data to the user’s directory. This is not as straightforward as it was for read-only data, but it’s not really that difficult anyway. It would be more or less like:
#ifndef _WIN32
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>
#include <pwd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif
#ifndef _WIN32
char file[PATH_MAX];
char *home;
struct passwd *passwd;
if (!getuid()   !(home = getenv("HOME"))) 
passwd = getpwuid (getuid());
home=passwd->pw_dir;
if (!home) 
fprintf(stderr, "$HOME is not defined.n");
exit(-1)
 
 
if (strlen(home) > PATH_MAX - sizeof("/.package/settings.ini")) 
fprintf(stderr, "$HOME is excessively long.n");
exit(-1)
 
snprintf(file, sizeof(file), "%s/.package", home);
mkdir(file, S_IRWXU   S_IRWXG   S_IROTH   S_IXOTH) == 0;
strncat(file, "/settings.ini", sizeof(file)-1);
#else
char file[21];
snprintf(file, sizeof(file), "./Data/settings.ini");
#endif
FILE *f = fopen(file, "w");
Sometimes you also need that the files are already created, you can check if they already exist with stat(), and then acting accordingly, either creating them from your C code, or maybe triggering a system() shell call whith whatever is needed.
struct stat stat_buf;
stat(file, &stat_buf);
if (stat(file, &stat_buf) == -1) 
int settings_fd = creat(file, O_WRONLY);
close(settings_fd);
 
NOTE: I’ve updated the code to add some suggestions. Thanks to Gon ri Le Bouder and Nico Golde.

Stefano Zacchiroli: vim-errorformat

Vim development workflow: 'errorformat' + ":make" Gintautas, it seems you're approaching the problem in a non-vim way. Have a look at the 'errorformat' option (":help 'errorformat') and more generally at the quickfix mechanism (":help quickfix"). It seems to me that what you want to do should be solved with a Makefile invoking the unit tests (at that point executing ":make" inside vim would trigger the testing) + an appropriate 'errorformat' setting which recognize the strings returned by your tests.

16 September 2007

Christian Perrier: RWC: Rugby spirit

An interesting story that give some idea of what makes rugby somewhat different from many other (even professional) sports: yesterday, after their defeat agains New Zealand, "Os Lobos" of Portugal got their revenge by beating the All Blacks....at soccer. Indeed, after the match, while warming down at Gerland's stadium, the two teams improvised a soccer match which the portuguese won by 3-1. Then both teams went to the All Blacks changing room and shared some beers in the traditional "third half" of a rugby match. Would anyone imagine this during the soccer world cup?

Russell Coker: iRiver H320 and Liquid

Recently my iRiver [1] H320 had some milk based drink spilt on it. I’m not sure what the drink was (I discovered it when my iRiver stopped working and the drink was dry) but it smelled like coffee or hot chocolate when I washed it off (I considered tasting it but decided that knowing exactly which drink had damaged my iRiver probably wouldn’t help me fix it). The initial problem was that no buttons other than the play button (which is also used to turn it on) worked. When I first discovered this I had no way of hitting the reset button so my iRiver played until the battery ran flat. I tried to disassemble it by removing the five tiny phillips-head screws from the sides, but that didn’t make any part of it loose. I tried using a small amount of force on the front piece of plastic and broke two of the clips that hold it in place while getting another two loose without breaking (but there were still at least four clips to go). Then I realised that the problem was that the keys were physically sticking and that maybe if I washed the keypad out I might get it to work. So I spent some time in a cycle of dripping water into my iRiver, pressing the buttons to get some of the nasty stuff dissolved, and then using a towel to soak up some of the water with milk or whatever. After repeating this for a while the buttons all seemed to work well apart from the play button which kept registering presses when I wasn’t touching it. This meant that it always automatically turned on and then played a song in a stuttering manner as the play button is also the pause button and it paused and played as rapidly as it could. Finally I left it in the sun to dry for a few hours, which seemed to do some good. The play button mostly works now. Also it seems quite easy to get water between the front layer of protective plastic and the layer behind (which actually houses the keypad). So I have several large drops of water spread out between the layers which move around as I squeeze it. I think that if I get that dried out before algae can grow then everything will be fine.

Gintautas Miliauskas: Opening files quickly in Vim

My Python development environment consists of a GVim window for editing code and a gnome-terminal for running the unit tests. This works out well, but leaves some integration to be desired. In particular, jumping to a test failure point is a little cumbersome. I used to do it this way: copy the filename from the traceback, switch to vim, then type :e, paste the filename with middle-click (now I know I can use * instead) and press Enter, then enter the line number and press G. That is barely acceptable; this particular wart has even contributed to pushing a ex-co-worker towards Emacs (the horror!). I have written a small vimscript function to make the aforementioned use case slightly easier. Now to jump to a failure point, just triple-click the corresponding line in the traceback (that selects the whole line), switch to Vim and invoke the function, which scrapes the clipboard for a filename and line number and opens it in the active buffer. Installation: paste the OpenFileFromClipboard function in your ~/.vimrc and bind it to a key by adding the following lines to your .vimrc:
nmap  :call OpenFileFromClipboard()
imap  :call OpenFileFromClipboard()
These commands bind the key F4 to our function. The first command handles normal mode, and the second handles insert mode (hence the to momentarily escape the insert mode). You can of course change the shortcut to whatever you like. The function should handle following types of references from the clipboard: I hope someone finds this useful.

15 September 2007

Biella Coleman: Save the Arecibo Observatory

There are many amazing things in Puerto Rico and one of them is the technologically (and I would add, aesthetically) stunning Arecibo Observatory, which was featured prominently in the Jodi Foster movie, Contact. Due to massive funding cuts, its future is threatened. This is a site of great scientific and cultural importance for PR, so I really hope they manage to find the funding that will make it survive far into the future. There is a facebook group
(by the name of “Do NOT close the Arecibo Observatory: Earth’s largest radiotelescope”) opposing the closure but I don’t yet know of any other site for halting the cuts. I will post one once I do. And if we lose the observatory, we might sadly lose another fine creature, the mysterious chupacabra who apparently was first called into his goat sucking action thanks to the great observatory of ours, which does send signals to find alien life. So sans Arecibo, we lose a great scientific instrument and may lose the beloved mascot of goat terror, the Chupacabra :(

Lior Kaplan: Hebrew, Perl and a License Hell

Three months ago Gal-Gur Arie asked me to package a Perl module named Locale::Hebrew. The goal is to enable Hebrew support in xmltv which uses a Perl script to pull the Israeli TV schedule. See #432748. Gal’s request falls under my Debian Hebrew category, otherwise I would refer his request to the Debian Perl Group. I started to work on the package, and reached the part of creating the debian/copyright file. In the Perl code, everything was OK, as it’s licensed under the Artistic License. But then I notice a bidi.c file with the following “license”:
Source code in this file and the header file may be distributed free of charge by anyone, as long as full credit is given and any and all liabilities are assumed by the recipient.
But it also had this:
Copyright (C) 1999, ASMUS, Inc. All Rights Reserved
As the “license” isn’t free, and the previous line pretty much makes that clear, I couldn’t upload the package to the archive. Maybe to non-free but I prefer that would be my last option. I was able to contact the copyright holders, and ask for clearing the license. Preferably with re-licensing the code with the GPL or other OSI approved license. Asmus Freytag answered me that there’s an updated version of the file in unicode.org with a proper references to a license, and suggested that I should check if it that’s OK for me. That license isn’t a free software license, but has en exclusion clause for certain files:
Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation (the “Data Files”) or Unicode software and any associated documentation (the “Software”) to deal in the Data Files or Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files or Software are furnished to do so, provided that (a) the above copyright notice(s) and this permission notice appear with all copies of the Data Files or Software, (b) both the above copyright notice(s) and this permission notice appear in associated documentation, and (c) there is clear notice in each modified Data File or in the Software as well as in the documentation associated with the Data File(s) or Software that the data or software has been modified.
To me, this seems free according to the DFSG. So I got a second opinion at debian-legal just to be sure. Well, now that the licensing issues are over, I needed to check that the software can work with the new bidi.c file. Audrey Tang (the original upstream) was kind enough to help with the testing, but here tests showed that too much have changed in the new bidi.c file, and the program doesn’t build correctly. So I’m back in square one… I got back to Asmus Freytag for a license change, this time asking for the unicode.org license. Asmus didn’t approve my request, and referred me to unicode.org for an answer. Full correspondence is available in the liblocale-hebrew-perl’s ITP. The problem is that I can’t be sure the file originated at unicode.org, as there isn’t any reference to them. And anyway, any license change should be done by Asmus Inc. and not unicode.org. Any one with contacts in Unicode, Inc. ? The best solution would probably be writing a Perl bindings around libfribidi as was done for Python. The problem is that I don’t have a volunteer for that. Bummer.

14 September 2007

Peter Makholm: Just another Pontifex?

Ok, just going to do something scary:
$_=pack"C*",33..86;$o='NRCRIMGZLLLCXZBCVUIOR';$o=~s/./chr((ord($&)-13-&f)%26+97)
/eg;$_=$o;s/r/r /;s/l/l /;sub v $v=ord(substr($_,pop))-32;$v>53?53:$v s/p/P/;sub
f s/U$/U$ /;s/U(.)/$1U/;s/V$/V$ /;s/V(.)/$1V/;s/(.*)V$/V$1/;s/V(.)/$1V/;s/(.*)([
UV].*[UV])(.*)/$3$2$1/x;$c=v 53;s/(. $c )(.*)(.)/$2$1$3/;(v v)>52?&f:v v s/t/t /
;print"\u$_,\n";[substr qr/(.*)([UV].*[UV])(.*)/i,qw(Just another Perl hacker,)]
and now back to the regular schedule….

Russell Coker: More About Google Earth

I recently wrote about problems with Google Earth [1]. In comments it was pointed out to me that there are some Debian packages of it in contrib. Installing the package ttf-bitstream-vera solved the font problem and running it directly (not through ssh -Y) on a machine with DRI support made it run reasonably fast on a machine with identical hardware to my mother’s. The animation is quite slick when the hardware works, and I have used it a bit. However I’m still disappointed in the program. The animation should be disabled for hardware that doesn’t support it at a reasonable speed (a reasonable default would be to disable animation if the display is :10.0 so that it doesn’t try to do animation over ssh). Also the feature of having movement continue should be disabled if there is any question about the performance. When performance (of scrolling and network access) is good it’s nice to be able to swipe with the mouse and have the scenery slide past until you tell it to stop. When performance is bad it’s annoying to have it keep trying to slide somewhere and make the entire machine run slowly.

13 September 2007

Simon Richter: So much for plans

I need to learn about posting plans. As was to be expected, this didn't work out the way I wanted to. Step one of my plan was rearranging everything so I could work without the laptop, which means moving the Pegasos back into my room. Since I still need it as a DSL router until I find a better solution, and there is no cable between the modem and my room, I thought about using the wireless network for that (the AP is right next to the modem). So I switched off VLAN mode everywhere (the AP cannot mix tagged and untagged traffic on one port, and the modem cannot do VLAN tagging either), and plugged a zd1201 USB network adapter into the Pegasos. Worked so far with an Ad-Hoc network, now let's make it talk to the AP. Fire up wpa_suppos^H^Hlicant, see the mess. After some googling I found out the problem: the zd1201 Linux driver does not support WPA. As my flatmate might need the network tonight and cables around the place are bad for moving in, I shall make it work in the most ugly way imaginable: with WEP. This means: if you drive by my place and crack one of the networks with WEP, you only risk a 50% chance of ending up in my honeypot. I wonder if I should write a shell script that occasionally "negotiates" a new key with the AP by setting it over SNMP.

Simon Richter: Things I do after spending a day in front of a computer

Okay, apart from finishing the move from the laptop back to the Pegasos (I compiled d2x-xl yesterday, today is reserved for the more serious stuff), this evening will be dedicated to cooking and my other pet project, xcontrol. So, it will be risotto, wireless networks and autobuilders, in no particular order. In other news, I've been running an archive rebuild to find out which packages actually implement the build-arch and build-indep targets. Out of the first 70, I've counted 11. Since so many packages would be affected, a mass filing of wishlist bugs is probably not the way to go, so I guess I'll set up a web page with the results (after making my autobuilder more robust; it still gets too easily confused) and try to shame people into updating their packages.

Lucas Nussbaum: Which distribution on Thinkpads: really the good question to ask?

After Dell, Lenovo decided to ask users which Linux distribution they should put on Thinkpads. Seriously, who cares? If I buy a laptop that comes with Linux pre-installed, my first step would be to reinstall it from scratch, exactly like with a laptop with Windows pre-installed. Because the choices that were made wouldn’t match mine (think of partitioning, etc). Or simply because I wouldn’t totally trust the hardware manufacturer. So, what would make me happier about a laptop? I couldn’t care less about which distribution comes preinstalled. If Lenovo wants to make me happy, there are two ways: It’s not _that_ hard: some manufacturers got it right, at least for some of their products. There are many manufacturers contributing code directly to the Linux kernel, for network drivers for example. But maybe this is just about marketing and communication, not about results? Because after all, Dell and Lenovo will look nice to the random user. While playing-by-the-rules manufacturers are hidden deep in the Linux changelog.

Theodore Ts'o: Moving to Wordpress

Because I’ve been getting a little frustrated with the lack of trackback support, prohibition against Javascript, etc. I’ve decided to set up a Wordpress installation on my private machine. For now, I have things set up so that posts made on my Wordpress blog will get mirrored onto my LiveJournal account. I may do some friends-locked posts still on LJ, but my general philosophy is to not post anything I might consider private on a blog, friends-locked or no. So we’ll see how often I make use of that option.

Theodore Ts'o: Moving to Wordpress&#8230;

Because I’ve been getting a little frustrated with the lack of trackback support, prohibition against Javascript, etc. I’ve decided to set up a Wordpress installation on my private machine. For now, I have things set up so that posts made on my Wordpress blog will get mirrored onto my LiveJournal account. I may do some friends-locked posts still on LJ, but my general philosophy is to not post anything I might consider private on a blog, friends-locked or no. So we’ll see how often I make use of that option. Originally published at Thoughts by Ted. Please leave any comments there.

12 September 2007

Brice Goglin: Debian X.org notes - Got specs?

So, this time it was for real! AMD really meant it when they announce the release of specifications of ATI boards last weeks. During XDS2007 at Cambridge, we received the actual specs, 2 PDFs files, 460 pages for the M56 (Mobility X1600, r5xx board) and 436 pages for rv630. The files are now online, but I am not going to give the link here since the web server already suffered too much today (and the URL is easy to find anyway). People should NOT understand this as if we were going to get an open-source driver for all ATI boards next weeks. First, these are only 2D specifications for r500 and r600. 3D specs are expected in a couple weeks once AMD fixes the remaining issues. r300 specs might arrive later. Also, these specifications are pretty hard to use, as expected. There are something like 9000 registers in r6xx boards, and these PDF files are just description of these registers. It's of course far away from being a "How-to write a driver?". So if you want to help, there will be lots of things to do. We also got a demo from some Suse guys of the driver there are working on. They got these specs about 2 months ago. And they already have some part of modesetting working. It means you might get your X server to start. There are about one hundreds different chipsets with their own quirks, so still lots of work to do. And then lots of performance things, 3D, ... to do. This driver is called "Radeon HD" so far. It will remain separated for now, but it might end up being merged with the upstream ATI driver later since the 3D engine are very similar (I personally hope it will happen). The reverse-engineered Avivo driver is dead now then. Fortunately, Jerome Glisse has been aware of the event for a couple months now, so he didn't waste to much time working on it. xserver-xorg-video-avivo will remain in Debian experimental until the new driver arrives. The good thing about Avivo is that it (and the ongoing Nouveau driver for Nvidia) led to the development of very nice reverse-engineering tools (revenge, renouveau, mmio trace, ...). They will be very useful for other graphic boards, or even some network hardware. Of course, many thanks to AMD for making this happen!
(Permanent link) 

Otavio Salvador: Couldn t a better look-and-feel README be done for Debian CDs?

I’ve blogged about win32-loader integration and after looking the final result of it I got very impressed since it’s very easy to install Debian from Windows however, the README displayed for the user would get some work and I’d like to know if someone that has those skills (well, I lack them) could try to work on that and propose those improvements at debian-boot and debian-cd mailing list. I do think it would be nice since it could make the first contact with Debian, for a Windows user, much nicer… anyone interested?

Otavio Salvador: Move from Windows to Debian has never been so easy!

Since some time, Robert Millan has been working at a tool to make the Debian GNU/Linux installation easier for Windows users[1]. His work has been integrated on Debian Installer daily images and now on Debian-CD (tool used to produce the Debian .iso images) and hence provinding a better user experience.
1. http://packages.debian.org/sid/win32-loader
Up to now, the user would see a “MS-DOS Window”[2] while running Debian autorun to open the README.html existent inside of the CD. It was ugly and user would need to know how to use the CD-ROM to boot and maybe even know how to set the BIOS to allow it. It has improved a lot since it now instead loads a nice graphical application that loads the README (and uses translated versions if available) and minimize itself[3], the tool allows the user to reboot the system and use the Windows bootloader to load the installer without requiring any special knowledge from the user.
2. http://people.debian.org/~rmh/d-i/win32-loader/autorun/before.ogg 3. http://people.debian.org/~rmh/d-i/win32-loader/autorun/after.ogg
Update: Those screencasts were done by Robert, not by me.

Benjamin Mako Hill: Software Freedom Day Boston

This Saturday, September 15, is Software Freedom Day 2007. With more than 300 teams registered, there's a good chance that there's something going on near you. I'll be helping at the Software Freedom Day event in downtown Boston where I'll be giving a talk on a still undetermined topic. I'll also be helping out with GNU/Linux and RockBox installs and letting folks play with my XO and OpenMoko. If you are into free software, open source, or GNU/Linux, please show up to your local SFD event. Go ahead and bring your friends who are not yet familiar with free software -- this event is primarily for them. In Boston, there will be refreshments, talks, demonstrations, and installs. Bring your laptop, desktop, iPod, or other DAP -- or just bring yourself and a friend.

Russell Coker: Some Good and Bad Ideas for Recruiting

Eweek has an interesting article about Microsoft’s latest bad hiring idea [1] (their previous one was hiring a model to try and give the idea that IT work is cool [2]). They have created a web site hey-genius.com to try and get people who consider themselves to be geniuses to work for them. One significant problem with this idea is that the amount of ego required to claim the title of genius is significantly greater than the amount of ego that makes it impossible for two people to work in the same office. Google’s methods of trying to attract candidates are much more sensible, for example setting mathematical and logical problems and inviting people who can solve them to apply for work. People who can solve maths and logic puzzles tend to be good programmers because essentially programming is about solving such puzzles while also relying on having memorised a huge number of facts and numbers. If you can solve the logic puzzles then you are probably half-way to becoming a decent programmer. The next problem is that the web site doesn’t work very well. In fact it works so badly that some people have suggested that the aim of the exercise is to make job offers to the people who give the best suggestions as to how to improve the web site. It gave a black window with Konqueror and with Firefox it didn’t appear to offer full functionality (and required a pop-up for no good reason too). But one useful thing about it is that it links to the Microsoft Jobs Blog [3] which is a really good recruiting idea. There are posts about various benefits that MS offers it’s employees, about visits by MS representatives to schools, and other things that will surely be of interest to people who like MS. I recommend that everyone who works in HR reads that blog and considers whether something similar would work for them (I think it would work for all large companies). Another interesting thing to note is that there are glamour photos of recruiting agents. I suggested in my previous post that they should “find some cute female MS employees and get them to do the promotion”, well it seems that MS was already doing similar things before I suggested it! One significant thing that they could do to improve their jobs blogging is to have a blog with job adverts with category based feeds for all the different categories. This would permit someone who is interested in XML work to get a feed of the XML jobs category and wait for something suitable to come up. I believe that every company that advertises more than two positions per year should have a RSS feed of the job adverts. It allows syndication feeds of adverts from multiple companies which job seekers can poll for positions that match their skills.

Next.

Previous.