Search Results: "dom"

15 February 2008

Stefano Zacchiroli: XQuery and XSLT 2.0 with Debian

XQuery 1.0 and XSLT 2.0: news and how to use them in Debian (long post about the second generation of the XSL family and how to use the related languages in Debian)
The 2nd generation of the XSL family At the beginning of 2007, W3C released a family of interrelated specification: XPath 2.0, XSLT 2.0, XQuery (1.0). The 3 specifications are based on the very same underlying data model which (finally!) supports typed values and exploits them to some extent, for example permitting some form of static type checking in XPath and XQuery. Types usually come from XML Schema, with both built-in and user-defined types supported. A brief overview of the 3 specifications and what they change in the state of the art follows. XPath 2.0 XPath 2.0 basically consists in XPath 1.0 + 3 new macro features. The first one is a revamp of those language features which are dealing with types, in order to better integrate them with the new typed data model. XPath now has operators to check whether a value belongs to a given type (so yes, type information are kept at run time), and to cast them from one type to another. The basic new type constructor is now the sequence, which replaces the old node-set solving many annoying issues, such as the impossibility of having a node ordering other than document order. The second feature is the improvement of standard library of functions which was ridiculously small in XPath 1.0; it is much better now. Additionally, 2nd generation languages (XSLT 2.0 and XQuery) now support the ability to define functions which will then be visible to inner (XPath) expressions, pushing yet forward the possibilities of plain old XPath. Functions can now also declare types in their signatures (for their arguments and return value) and untyped arguments will be automatically casted to them upon invocation. Hence, even if you are not using an implementation which assigns types to your XML trees, once you "enter" the typed world calling a typed function (almost all standard library functions are decently typed) you will be able to stay there avoiding annoying casts everywhere. Finally XPath 2.0 has turned into a powerful purely functional language and is now powered by constructs like conditionals, for-each loops, existential/universal quantifiers, and existentially-quantified comparison operators for sequences. Here is a complex expression to hwet your appetite (or scare you away ...), comments come as (: smiley faces :)
for $book in /bookshelf//books
return
  if ((every $author in $book/authors/author
       satisfies $author/nativeLang eq "it_IT")
      and $book/lang eq "it_IT")
  then $book
  else ()
(: think about the trouble of writing this in XSLT/XPath 1.0 ... :)

XSLT 2.0 XSLT 2.0 is what I would call a "bug fix release" of XSLT 1.0 + the routinary reworking of the language to deal with typed values, which is not sensibly different than what has been done for XPath 2.0. The fixed "bugs" are several, starting from the annoying issue of result tree fragments. They are basically tree snippets that in XSLT 1.0 you were able to generate for future use. Unfortunately they were not thaaat reusable, given that you were not even able to navigate them with XPath operators! Now the specification is much more clear and distinguishes final result trees from ordinary variables, which can now contain sequences of (navigable) tree nodes. Another important "bug" fixed is the new ability to output multiple documents with a single XSLT stylesheet: it marks the end of stupid extra post processing to be added in pipeline to a XSLT processor. Other minor "bugs" fixed are a limited amount of backtracking capabilities among imported templates, regular expression support directly in the language, and powerful grouping constructs on the lines of SQL's GROUP BY (but much more powerful). Here is a template snippet exploiting the latter feature:
<xsl:for-each-group select="*" group-starting-with="h1">
  <div>
    <xsl:apply-templates select="current-group()" />
  </div>
<xsl:for-each-group>

XQuery XQuery is the end of the chains imposed by XML-based syntaxes. Why the heck one has to use an XML syntax (as in the above snippet) only because she is manipulating XML tress is one of the mysteries of XML technologies which have always been floating around in my head. XQuery is the (supposedly) SQL equivalent for databases of XML documents, but is actually much more than that. I depict it in my head as the XML manipulation language with a syntax I can finally stand. Technically it is XPath 2.0 (say 80% of the whole language) + some extra ingredients (say 20%); so remember that every XPath 2.0 expression is also a XQuery expression. The main extra ingredient is the so called FLWOR expression (to be read: "flower expression", which in addition to the "smiley faces" used for comments gives a "back to 1968"-flavour to the language .... erm FLWOR/flower/flavour, no pun intended). A FLWOR expression is very similar to SQL's SELECT-FROM-WHERE: it lets you generate a tuple stream by iterating on sequences (F: for clauses), binding expression values to names (L: let clauses), filter out tuples which do not satisfy a required condition (W: where clause), order the survived tuples (O: order by clause), and finally return a sequence built using the residual tuple stream (R: return clause). The other interesting extra ingredient is the ability to build the XML snippets you want to manipulate. Within XQuery you do that using plain XML syntax (the only place where a sane-minded programmer actually wants to see it!) which also supports a classical interpolation mechanism to embed expressions which will be evaluated inside XML snippets, and also the other way around. A canonical XQuery example is:
for $t in doc("books.xml")//title,
    $e in doc("reviews.xml")//entry
where $t = $e/title
return <review>  $t, $e/remarks  </review>
(: braces denote the escaping context where XQuery expressions will
   be evaluated inside snippets; plain XML syntax is used for the
   other way around :)

But remember: XQuery for XML is much more than SQL for RDBMS, thanks to the implicit templating mechanism implemented by interpolation, and thanks to several language features fostering modularity (user-defined functions, library modules, XPath 2.0 standard library, ...) you can basically do with it any kind of XML manipulation you can imagine. I don't think I will ever write myself any other single line of XML output in DOM or XSLT ...
Cool, how can I use it in Debian? ... if only this stuff were decently supported in the open source world. Last time I checked, the author of most parts of the GNOME toolchain for dealing with XML (libxml2, libxslt, ...) was not intentioned to implement XSLT 2.0, not even mentioning XQuery. This comes as no surprise, the whole GNOME XML toolkit is written in C, and XSLT 2.0 / XQuery have reached a level of complexity and formal specification which usually entails a higher level approach. So on the GNOME side we are stuck. The other open source implementations of XSLT 2.0 / XQuery I'm aware of are Saxon and Galax. Saxon is an XSLT 2.0 and XQuery implementation written in Java, which is unfortunate per se. Additionally, it is also unfortunate that it is only partially open source. Indeed, Saxon is split into SaxonB (for "basic") which is open source under the Mozilla Public License and SaxonSA which is commercial. While SaxonSA is a fully conformant, XML Schema-aware processor, with support for static typing, SaxonB is a basic-conformant processor with no type-aware features and actually much less optimized than SaxonSA. This is annoying. (Much more annoying is the fact that SaxonSA's author is the only editor of the XSLT 2.0 specification and that instead of his mail address the specification includes an URL pointing to the website selling SaxonSA ...) Galax is an open source (IBM CPL / Lucent license) OCaml implementation of XQuery which is not fully conformant to the specification (though it gets quite close) which is type-aware and implements static typing. The only XQuery / XSLT 2.0 implementation available in Debian at the time of writing is SaxonB. The binary package is libsaxonb-java, kudos to Michael Koch and the Debian Java Maintainers for having packaged it (and to have stood some annoying pings of mine :-) bug #408842). To execute XQuery code you just have to aptitude install libsaxonb-java, prepare a query.xq file containing your query, and then execute something like:
CLASSPATH=/usr/share/java/saxonb.jar \
java net.sf.saxon.Query query.xq

note that the information in README.Debian are still referring to old Saxon versions, see bug #465894 which proposes a more up to date README.Debian. Similarly, to perform a XSLT 2.0 transformation you have to do something like:
CLASSPATH=/usr/share/java/saxonb.jar \
java net.sf.saxon.Transform -ext:off -s:input.xml -xsl:style.xsl -o:output.xml

Do not remove the -ext:off flag when processing untrusted stylesheets!, see bug #465885 for the reason. I've written some handier (1-liner) shell script helpers which remove the need of invoking java manually. They are attached to bug #465894 and I've proposed their addition to the saxonb package. Using them the above invocations become:
saxonb-xquery query.xq
saxonb-xslt -ext:off -s:input.xml -xsl:style.xsl -o:output.xml

Galax in Debian ... well, since long time I've been planning to package it (the ITP has been filed some months ago: bug #447984) and the authors sent me a newer version than what is available online to gather feedback before the long overdue final release. Unfortunately I've been lagging behind in finishing the packaging (which is tricky due to the need of binding libraries to several different languages: OCaml is native, but there is also Java for example). Hopefully this post will give me some renewed motivation for finishing the work ...
References
Acknowledgements Thanks to godog for his helpful comments.
Update: the helpers I've proposed have been accepted into the official package, I've also made available their manpages. Also the pending changes to README.Debian has been accepted. Kudos again to Michael Koch for his quick feedback on my patches!

MJ Ray: ISPs should not be forced to disconnect filesharers

Requiring Internet Service Providers to bar users for illegal downloading is stupid because:- 1. ISPs can't tell what we're sending over the network and aren't in a position to verify whether we have permission to send it. However, cutting off small businesses and home offices could kill some businesses. I own a share of my ISP (one of 6000 or so equal shares) and would vote against opening it up to that liability. I'm not surprised that ISPA has already said ISPs want to pass any liability back to the accusers. 2. government sometimes doesn't understand what can be downloaded legally. There's a famous case where a Trading Standards Officer complained to a Mozilla Foundation worker about their free Firefox browser because
"it makes it virtually impossible for us, from a practical point of view, to enforce UK anti-piracy legislation"
Source: Times Online 3. there is permission for "fair dealing" in copyrighted material for various purposes, including current affairs reporting and education, unless someone changed the law since I last looked! However, some organisations, including the BBC's 100-million-pound iPlayer, try to deny viewers those permissions, so it is easier to start from illegal copies than it is to deal with iPlayer (only works on some computers, installs bandwidth-using code into the system startup and so on). Finally, where did the 6 million illegal downloaders figure come from, ultimately? The film and music dominant producers? The Recording Industry Association of America has already spoken out against legally-required filtering, in http://www.news.com/8301-10784_3-9861460-7.html?part=rss&subj=news&tag=2547-1_3-0-5 Our software is available for free download and free sharing. The music and movie industries need to adapt, not be propped up by making ISPs pay through this sort of bad law. This isn't so much ISP disconnect as BPI logical disconnect!

MJ Ray: A Redway Question

Mrs Taylor asked:
"are the council allowed to reroute a redway or are they right of way and if so can you help me to prove that they are??"
I don't know. Do you? If no-one knows, I'd probably start by looking at the detailed OS maps for the area (which I think mark rights of way) and maybe make Freedom of Information Act requests for the order that established a particular redway. However, even if they are a right of way, a council could reroute it through the usual transport planning process, although a member of the public and any affected councillors should be able to speak against it at a hearing.

14 February 2008

Steve Kemp: Listen to me when I'm telling you

So today I'm a little bit lazy and I've got the day off work. As my previous plan suggested I wanted to spend at least some of the day tackling semi-random bugs. Earlier I picked a victim: less. less rocks, and I use it daily. I even wrote an introduction to less once upon a time. So lets take a look at two bugs from the long-neglected pile. These two issues are basically the same: They seem like simple ones to fix, with the same root cause. Here's an example if you want to play along at home:
 cp /dev/null testing
 gzip testing
 zless testing.gz
What do you see? I see this:
"testing.gz" may be a binary file.  See it anyway? 
When I select "y" I see the raw binary of the compressed file. So, we can reproduce it. Now to see why it happens. /bin/zless comes from the gzip package and is a simple shell script:
#!/bin/sh
# snipped a lot of text
LESSOPEN=" gzip -cdfq -- %s"; export LESSOPEN
exec less "$@"
So what happens if we run that?
$ LESSOPEN=" gzip -cdfq -- ~/testing.gz" /usr/bin/less ~/testing.gz
"/home/skx/testing.gz" may be a binary file.  See it anyway? 
i.e. it fails in the same way. Interestingly this works just fine:
gzip -cdfq -- ~/testing.gz   less
So we've learnt something interesting and useful. We've learnt that when LESSOPEN is involved we get the bug. Which suggests we should "apt-get source less" and then "rgrep LESSOPEN ~/less-*/". Doing so reveals the following function in filename.c:
	public char *
open_altfile(filename, pf, pfd)
	char *filename;
	int *pf;
	void **pfd;
 
/* code to test whether $LESSOPEN is set, and attempt to run the 
   command if it is */
		/*
		 * Read one char to see if the pipe will produce any data.
		 * If it does, push the char back on the pipe.
		 */
		f = fileno(fd);
		SET_BINARY(f);
		if (read(f, &c, 1) != 1)
		 
			/*
			 * Pipe is empty.  This means there is no alt file.
			 */
			pclose(fd);
			return (NULL);
		 
		ch_ungetchar(c);
		*pfd = (void *) fd;
		*pf = f;
		return (save("-"));
That might not be digestible, but basically less runs the command specified in $LESSOPEN. If it may read a single character of output from that command it replaces the file it was going to read with the output of the command instead! (i.e. Here less failed to read a single character, because our gzipped file was zero-bytes long! So instead it reverted to showing the binary gzipped file.) So we have a solution: If we want this to work we merely remove the "read a single character test". I can't think of circumstance in which that would do the wrong thing, so I've submitted a patch to do that. Bug(s) fixed. Incidentally if you like these kind of "debuggin by example" posts, or hate them, do let me know. So I'll know whether to take notes next time or not..

11 February 2008

Steve Kemp: A good cockerel always points north

I spent a while yesterday thinking over the software projects that I'm currently interested in. It is a reasonably short list. At the time I just looked over the packages that I've got installed and the number of bugs. I'm a little disappointed to see that the bugfixes that I applied to GNU screen have been mostly ignored. Still I have the day off work on Thursday and Friday this week and would probbly spend it releasing the pending advisories I've got in my queue, and then fixing N bugs in a single package. The alternative is to build a quick GPG-based mailing list manager. I'd like a simple system which allowed users to subscribe, and only accepted GPG-signed mails. The subscriber could choose to receive their messages either signed (as-is) by the submitter or encrypted to them. So to join you'd do something like this:
subscribe foo@example.org [encrypted]
--BEGIN PUBLIC KEY --
...
--ND PUBLIC KEY--
There is the risk, with a large enough number of users, that a list could DOS the host if it had to encrypt each message to each subscribers. But if the submissions were validated as being signed by a user with a known key it should be minimal, unless there is a lot of traffic. The cases are simple: There are some random hacks out there for this, including a mailman patch (did I mention how much I detest mailman yet today?) but nothing recent.

10 February 2008

William Pitcock: What a busy night

mmap()/vmsplice() root exploit and fun with Xen: Today has been a very busy day. First of all, a new exploit was discovered today that uses vmsplice to gain root access. Of course, there’s an unpleasant side effect to that exploit (so don’t try it on your machines!), it messes up the memory map and applications start crashing until you reboot your machine. When combined with Xen, things get worse: the hypervisor crashes and obviously takes out all of your domUs which is unpleasant. As a result, I upgraded my Xen-using stuff to 3.2, but the bug is still there. There’s a nice “feature” though: When the hypervisor crashes, it reboots so you can’t even get a crash log. Fantastic, except not. Xen 3.2 seems nice so far, I backported it to etch for use on my dom0’s. I haven’t noticed any major problems yet so that’s good. It’d be nice to have linux-image-2.6.23-xen backported to etch, that’ll probably be my next project (at the same time, I plan to patch out the vmsplice syscall so it can’t be exploited by users on my machines). Hopefully the backports.org maintainer will do a backport soon. dsyslog in NEW: dsyslog has been released (I did this yesterday actually), and is now in NEW as of today. For those of you who don’t know what dsyslog is, it’s a syslogging daemon I am writing from scratch for my needs. It has a 100% modular design; the core only provides a generic message processing and routing framework. Thanks to naoliv and dmb for collaborating on the packaging. upse 0.6.0 released: Today I also released upse 0.6.0, which adds the ability to use a PSone ROM instead of emulation so that you can listen to mods that require a replayer which depends random aspects of the ROM itself. Right now, this feature only works with upse123, but I will add support to the audacious plugin in 0.7.0. Please note that upse does not include a PSone ROM image as it’s pretty much guaranteed to be non-free. You can use a gameshark, or some sort of JTAG method to dump the ROM’s contents. (The ‘crash2′ replayer is especially a problem with this one.) Additionally, the new release features reworked modeling of the PSone’s SPU analog filters. srctool: A lot of people commented on my ideas for replacing srcinst with something more modern and powerful (presently called srctool). I’ll be sure to take a look at them over the next few days and comment back. freenode adopts DroneBL as part of their anti-trolling defense: LoRez notified me on freenode today that they are using DroneBL to help keep trolls and proxy abusers off the network. I wish them luck with their use of this, and recommend an additional blacklist as a supplement, dnsbl.anoxs.net. While I disagree with the way they have implemented their DNSBL, they do indeed get results.

9 February 2008

Stefano Zacchiroli: installing debian on zonbu mini desktop

installing Debian on Zonbu mini desktop ... ... it's trivial! Me and godog have bought a Zonbu Mini Desktop to replace our previous noisy caseful server. The supposed duties of such a server are just running some P2P clients and a slimserver for a Squeezebox (so yes, the Zonbu will also need to proxy a very big USB disk). I've discovered the Zonbu mini thanks to a blog post by caesar, and I'm quite happy about the hardware. It's absolutely noiseless, small, eye catching. Though I don't need particular performances, the only aspect that worried my was the I/O on the CF card, which apparently is a non-concern. The only missing bit in the hardware is a video output (only VGA is provided), a must if you want to use the Zonbu as a multimedia station. But this kind of usage wasn't on my plans, so ... FWIW, before buying the Zonbu I've also tried to evaluate the cost of building something similar by myself, but the only cost of the mother board almost dominates the final price of the Zonbu. So apparently it's a good device also price-wise. I haven't even tried the on-board Gentoo-derived installation. Well, in fact I had, but considering that the only monitor I've at home is a B/W 15 years old CRT, my chances to see something vanished at the precise moment the frame buffer started, of course they did not get any better when X started. The minute after that, I've fired up D-I.
Debian Installer vs Zonbu mini Installing Debian on the Zonbu mini is actually trivial: /me happy about the new geeky gadget
Sad note: according to godog's tests, the provided wifi (which is optional to buy) works either with ndiswrapper or with a binary kernel module built against Fedora kernel, that sucks.

Neil Williams: Chatting at conferences

I don't know why this is appears to be a problem but AFAICT there is no particular impediment in talking to delegates at conferences, no matter what the gender.
Maybe it is just the way that such discussions are begun or the tone being used or maybe it is just that my RealLife(tm) world involves a radically different environment.
Various stats claim that IT is massively dominated by male workers.
Many stats show that pharmacy is massively dominated by female staff.
Maybe it is just an indication that a degree in a course other than IT is more of a benefit than would otherwise appear.
As a single guy, the pharmacy world is little different to IT as far as conversations with colleagues is concerned. To me, that is how it should be.
Maybe I'm just too old to be deemed "a problem".

Russell Coker: An Obstacle for Women in the IT Industry

I was reading the Lenovo blog “Inside The Box” post about the TrackPoint Ambassador [1] program. What happened was that a Lenovo sales guy (wearing a shirt with a Lenovo logo) spent a day in airports talking to people who use Thinkpads and telling them about Thinkpad features. He also gave away new button caps for the TrackPoint (the mouse device in the middle of a Thinkpad keyboard). One interesting thing he noted is the reaction of women who seemed to think he was trying to chat them up. Their reaction was so negative that by the end of the day he was only promoting Thinkpads to men. To make this clear, gifts of free hardware and advice on technical issues related to computers were provided only to men because the reaction of women was bad enough that it wasn’t worth the effort! I am certain that this is not an isolated incident. When I am at a conference I am unlikely to start a conversation with a woman who I don’t know because it really offends me when I receive the “I’ve got a boyfriend” type response. I expect that others have had similar experiences and react in a similar way. The Lenovo blog post proves that this is not just a free software community issue but a more widespread IT industry issue. As the majority of experts in the IT industry are male it seems that women will miss opportunities to learn because of this. Recently Waugh Partners [2] performed a survey of the Open Source industry, ZDnet article about the survey notes that “55 percent said they were part of a couple” [3]. Of the 45% who are single it seems reasonable to assume that some are gay and therefore the incidence of a random guy at a Linux event being interested in chatting up women would be less than 45% even if we don’t count the single straight guys who refrain from hitting on women at conferences. I’m not sure how the rest of the IT industry compares in this regard. While this is only a small part of the problem, it seems like something that needs to be improved and which appears not to have had much attention paid to it.

8 February 2008

Lucas Nussbaum: dd + /dev/random fun

From Adrien Lebre, who seems to be having fun working on kDFS:
$ dd if=/dev/random of=file bs=1024 count=2
0+2 records in
0+2 records out
256 bytes (256 B) copied, 0.000705717 s, 363 kB/s
$ ls -l file
-rw-r--r-- 1 lucas lucas 256 2008-02-08 17:53 file
Can be easily explained using strace:
open("/dev/random", O_RDONLY O_LARGEFILE) = 0
[..]
open("file", O_WRONLY O_CREAT O_TRUNC O_LARGEFILE, 0666) = 1
[..]
read(0, "p(361241,360-330~M245y10=274U201c207v336a273"..., 1024) = 128
write(1, "p(361241,360-330~M245y10=274U201c207v336a273"..., 128) = 128
read(0, "362,LW5l.?2422225222320637510326335316374372"..., 1024) = 128
write(1, "362,LW5l.?2422225222320637510326335316374372"..., 128) = 128
close(0)                                = 0
close(1)                                = 0

Vincent Fourmond: Microsoft advertises embedded windows under "Embedded Debian" !

[embedded-debian-microsoft.png] Few days ago, I was looking at my gmail mails. As usual, there was a couple of ads on the right hand side of the screen (they never really bothered me before). But that day, there was something quite different: an advertisement for Microsoft under the term "Embedded Debian" ! Well, I can understand that Microsoft wants to advertise for the keywords "Embedded Debian". After all, if they do provide good embedded OS services, that is only fair. But to do so with a title "Embedded Debian" does not really qualify as fair use of the Debian trademark ! The trouble is that this is something hard to prove, as it appears seldom and apparently randomly. When I google for the terms Embedded Debian, I come up around every second time with nearly the same ad, but taking to www.microsoftembedded-de2.com. This domain does not appear to be connected to Microsoft anyhow (see its whois entry). Some other people tried and never saw the ad, as I did when I looked from another computer (a Windows one, funnily). The www.windowsembeddedsolutions.com link which is depicted above did only show up in my gmail account so far. However, that domain is owned by Microsoft, so they can't deny this comes from them. Why, are we scaring them so much ??

Benjamin Mako Hill: Protest DRM at the Boston Public Library

/copyrighteous/images/bpl_drm.jpg On Saturday February 9th, at 13:00, I'm going to be joining free software and anti-DRM activists to protest the use of DRM by the Boston Public Library on parts of its electronic collection. Those of us protesting are unhappy because the BPL has launched a new service powered by a company called OverDrive. The system gives BPL patrons access to books, music, and movies online -- but only if they use a Microsoft DRM system. There are lots of problems with the introduction of this system: it bars access to users of GNU/Linux and MacOS and creates a dependence on a single technology vendor for access. These are important issues, certainly. The worst problem, however, is much more fundamental. By adopting a DRM system for library content, the BPL is giving OverDrive, copyright holders, and Microsoft the ability to decide what, when, and how its patrons can and cannot read, listen, and watch these parts of the BPL collection. They are giving these companies veto power over the BPL's own ability to access this data -- both now and in the future. Cryptographically, BPL is quite literally handing over the keys to their collection. In the process, they are not only providing a disservice to their patrons. They are providing a disservice to themselves. The first-sale doctrine says that libraries can do essentially whatever they like with copies of books they purchase short of duplication, modification, or performance. Of course, copyright holders would prefer to charge a toll every time someone checks out a book. Public libraries were possible in spite of this desire because they were able to exploit power over the possession and control of their books in the interests of their patrons. With DRM, libraries will reduced to powerlessness. Of course, times have changed. As media and the ways we interact with it is increasingly digital, libraries have changed and will need to change more. But if public libraries are to succeed at their fundamental mission of spreading knowledge and serving communities, this change can't be at the expense of patrons' ability to control their own technology and libraries' ability to control their own collections. I've supported my academic library, MIT Libraries, as they took a risk and stood up to DRM when other institutions did not. And they won. BPL is the largest municipal library in the US and the third largest US library overall. It is the first library to be supported publicly, to be open to the public in the US, and to allow patrons to take home books to read and use them. BPL has an opportunity now to continue this history of leadership, of access, and of patron empowerment. If BPL stands up against DRM and in favor of its patrons' freedom and its own control of its technical destiny and collection, it may set an important precedent. If you're in or near Boston, please join me in Copley Square on Saturday to help make this happen. If you're not near Boston, please help put pressure on similar efforts in your own communities.

Aigars Mahinovs: (Latvian) Velost vvietas R gas centr

(This blog post is in Latvian and is about a public discussion that the capital of Latvia, Riga is having about where to put new bicycle racks in the center of the city. In the post I point to an article describing where to send in suggestions, point out a few possible locations for such racks and suggest installing racks with build-in locks that would require inserting a refundable coin to remove the key locking a bike in place) R gas dome v c ierosin jumus par jaunu velost vvietu novietojumu R gas centr . Es tur nos t ju sekojo us ieteikumus, parosieties ar j s. Vislab k velovietnes b tu izvietot t d viet , kas b tu p rredzama no ce iem, pa kuriem iet daudz cilv ku un ar kur b tu novietotas dro bas nov ro anas kameras, lai minimiz tu z dz bu risku. Viena vietne var tu atrasties Str lnieku laukum vai t tuvum , jo tur ir viegla piek uve no Krasta ielas. Vieta starp RTU ku Ka u 1 un
Krasta ielu var tu b t oti piem rota. Tas ar ierosin s studentus lietot velotransportu pa ce am uz lekcij m Ka u iel . Alberta laukuma var tu atrasties vieta velosip du novieto anai - vieta ir viegli pieejama no Stacijas puses un ir tuvu vair k m viesn c m. Ja ir pl ni izveidot Pay&Ride autom tisko velosip du nomu, tad is var tu b t par vienu no vislab kajiem punktiem dai iecerei. Pils laukums ir viegli sasniedzams no P rdaugavas pa Van u tiltu. Ja tur izveidotu velost vvietu, tad tas iev rojami atvieglotu iesp ju atbraukt ar velosip du pa J rmalas veloceli u p ri Van u tiltam, nogriezties pa labi un uzreiz dro i noparkoties. T pat l dzu apv rt ideju pielietot velovietnes ar ieb v tu atsl gu, lai neb tu nepiecie ams vest l dzi savu sl dzeni. Katrai vietai var tu b t sava sl dzene (bieza un pietieko i gara cietmet la trose) un atsl ga. Atsl gu var tu iz emt no sl dzenes tikai tad, kad sl dzene ir aiztais ta un sl dzenes meh nism ir ielikta 1 Ls mon ta. Atsl dzot sl dzeni ar atsl gu mon ta tiktu atdota atpaka . Tas nodro in s pret vand lismu, kad vienk r i vis m sl dzen m tiktu iz emtas atsl gas un aizmestas prom. Ta u jebkur gad jum j b t vieglam veidam k aizvietot nozaud t s atsl gas gan gad jumos kad velosip da pa nieks to pieprasa (tas var aiz emt vair kas dienas un pras t 5-10 Ls un iesnieguma uzrakst anu) vai ar kad velosip ds ir pamests piesl gt st vokl . Jaunas atsl gas izgatavo anai nevajadz tu pras t vair k k 1 Ls no pils tas bud eta, tad tas 1 Ls sl dzen os izdevumus atmaks s.

7 February 2008

Russell Coker: Political Blog Posts

Currently in the US the main political parties are deciding who will contest the next presidential election. Naturally this gets some commentary from all sides. Planet Debian has syndicated two blog posts commenting on these issues, it’s interesting to compare them: First John Goerzen writes a post about an issue he (and almost everyone in the Debian community) considers important - copyright law [1]. He quotes the Randall Munroe who is the author of www.xkcd.com (described by the author as “A webcomic of romance, sarcasm, math, and language“) which is wildly popular in the free software community (I believe that there is a fan-club which has meetings). Randall’s commentary is quite interesting and I recommend reading it [2]. The most noteworthy fact is that Barak Obama has sought advice from Lawrence Lessig - who has done more for the free software community than any other lawyer. John’s post doesn’t contain much original content, but citing a lengthy post from a highly regarded source and quoting a particularly relevant paragraph make it very noteworthy. Next Jaldhar Vyas writes about “the war against Islamic terrorism” [3] and makes the claim “we are finally gaining the upper hand in Iraq“. To consider that claim it’s best to read some expert commentary. William S. Lind [4] is a widely respected conservative who is an expert on military strategy, his comments about stabilising Iraq are always interesting [5]. It’s sufficient to note that William has been predicting failure for the US occupation of Iraq right from the start and that events over the last five years have proven him correct. William S. Lind’s thoughts on Democracy are interesting too [8], I don’t agree with him in this regard (I generally disagree with him on most things other than military matters) but it’s an interesting thought. Jaldhar also claims that “Democrats on the other hand have a closer association with the media who are behind many of the sillier IP laws“, this seems to be a reference the the “liberal media” conspiracy theories. There seems no clear party association with bad IP legislation (both the Democrats and Republicans do silly things in this regard), and debunking the liberal media claims can be done simply by watching some TV (choose a couple of random news shows on different channels). Fox is not the only right-wing news outlet. Jaldhar also has a conspiracy theory about the Supreme Court and the “need to ensure that the court does not veer leftward again as it will inevitably do during a Democratic administration“, not that the Democratic party is particularly “left” by whatever definition you might apply to the word. I prefer the www.politicalcompass.org analysis which shows that all the serious contenders in the Democratic primary are Authoritarian Right [6]. So the result of the next US presidential election will determine how authoritarian and right-wing the government will be, the fact that it will be authoritarian and right-wing is beyond doubt. That said it would be good if the authoritarian right-wing government that we (*) get at least has some decent policies in regard to IP law (which is the hope for Barak Obama). John Nichols has an interesting analysis of Ann Coulter’s support of Hillary Clinton over John McCain [7]. It would be interesting to see Jaldhar’s comments on this issue. (*) I use the term “we” when talking about US politics to acknowledge the fact that the Australian government will take orders from Washington. Some pundits predict that the Greens will be the second major party in Australian politics in a couple of elections time, so maybe in 8 years time we will have an Australian government that represents Australians instead of Americans. But for the entire duration in office of the next US president (be it 4 years or 8) they will be able to get the Australian government to do almost anything that they desire.

Alastair McKinstry: Back from Holidays

Chocolate lion Cormac and Caoimhe at a patisserie with Chocolate lion in Concarneau, Brittany
So, I'm back from Holidays, to find we now have a new Government in Ireland. (An unexpected choice of government, of which more later.) We were camping in Fouesnant, in Brittany; Family & Friends might like to see the holiday snaps here). Camping in France went well. With three children aged 7, 4 and 2, there is only so much you can expect from a family holiday. Like it or not, you have to mind the toddler fairly consistently, and the older kids would like your full attention too. This is a holiday ''for'' the kids; plan also a break ''from'' the kids later (a long-weekend, with kids at grandparents, for example). This was our first time camping abroad, and its well recommended. While we went touring with a camper van with the two older children two years ago, this is different in that we were at the campsite for almost two weeks: the kids got to meet and play with others in a way they couldn't before. Also, there were good facilities at the site in Fouesnant, and the swimming pools in particular were appreciated (Caveat emptor though: there were no lifeguards or supervision. We went off-peak, and there were apparently two accidents in the time we were there: a broken kneecap and chin when people came down the slides too soon after others and collided). It was the first time the children (a) had pocket money to spend, and (b) were able to walk to a (campsite) shop to spend it. Lessons were learnt in the finiteness of pocket money, especially by Caoimhe :-(. The weather was fairly good: two wet days (though not overly so, compared to what we're used to in Galway); enough to give the 'authentic camping experience'. And for the children especially, just warm enough. Long drives South were not an option with young kids, and we wanted to see Carnac and Brittany in general. We went touring to two places: Mont St. Michel, on the way down, Carnac, and locally around Quimper and Concarneau. At seven, Cormac is beginning to be old enough to enjoy this, but Sadhbh at 2 is too young, and easily aggravated. Caoimhe can appreciate some of it, such as the well recommended Breton museum in Quimper, seeing the local costumes and clothing is just her style at the moment. We're looking forward to going back when the kids are older, or we can enjoy touring on our own. The camp site is dominated by English / Dutch / Irish. It is still term-time in Britain and Ireland, which meant the children on the site was full of 2-4 year-olds, with a shortage of playmates for Cormac. Next time, synchronise with English school times, etc. We went during Cormacs term-time because it was much cheaper (1000 Euro) than high-season. If Cormac was having difficulty in school things would have been different, as it is, we had no qualms in doing so. Things will probably be different next year with Caoimhe also in school at the same time, and we would go later. Suffice it to say I think synchonisation of school timetables is a bad idea, as it has led to these huge price differentials and parents taking their kids from school. As a friend with experience of the French school system points out, they've spent the last 40 years desynchronising their timetables ... So would we go again, or buy our own tents, etc? possibly. The brochure for next year arrived already, with large discounts for booking early ... Tags , , , , , ,

Alastair McKinstry: New domain name under Jabber?

I've changed the domain name of my blog, etc. from scealnetworks.com to sceal.ie for various reasons: its shorter, I'm doing almost no networking work these days, and I've (personally) no intention of becoming an multi-national corporation in the near future. Still got the old domain, though, and heres the question: does anyone know if its possbile to redirect Jabber XMPP IM from one domain to another (e.g. in a 301-style redirect?) And also, here's a new Technorati Profile. Tags , ,

Biella Coleman: On Confidence, Geekdom, and Desire

So a few folks left some interesting comments in response to my link to the article on the rise of the alpha-girl based on the research of Harvard psychologist, Dan Kindlon. My response to both Joe and Karl is that it is worthy to lower the barriers to entry not because girls will change the cultural ecology of geekdom in positive ways (though they may) or because geekdom is inherently “omg totally awesome!!!!!!!!!!!!!!!!!!!!” but for a much more mundane reason: it may allow girls to follow interests and eventually discover a passion. I think it is a great idea if more women were involved in geekdom and open source development not because it is inherently great but because I am sure there a lot of women out there who would enjoy it (and by extension, I am sure a lot who would not). By highlighting this article I am not advocating some forced hacker-female-labor-migration-policy but pointing to the fact that social conditions outside of geekdom play a role in ensuring more participation among women. But let me explain a few things before I argue my position a little further. First a little clarification, especially now that I have read the article. By alpha the author does not mean dominant, aggressive, and totally jerky, which is what might immediately come to mind when you read/hear alpha (especially if one knows any alpha-geeks or alpha-lawyers for that matter, who are much worse, imho). And I certainly don’t want any more alpha-anything (alpha-women, alpha-dogs, alpha-cats, alpha-hamsters ) given our world is already chock-full of alpha-jerks. By using the term, the author basically means confidence, which apparently is on the rise among girls, leaving them much more likely to be go-getters, undaunted by explicit and implicit barriers and obstacles and thus more likely then ever to enter arenas that have been thought of as traditionally male or in fact totally dominated by males. If this trend is indeed in place, I think it is great and I hope that this eventually translates into more girls/women populating traditionally male areas whether it is neurology, movie directing, hacking, or surfing. What I appreciate about the article is that his research can help us question the idea that women are naturally averse to competition due to their estrogenic hormones while boys, brimming with testosterone, just love it and exude it. I never identified with that conventional well-worn script, in part because I guess I am fairly confident and somewhat competitive. Being in academia for the last 10 years, I have witnessed a lot of really confident women that have helped inspire me and keep me going, especially when times got rough. What is fascinating about the article (and by extension probably his book) is that gender parity and equity and changes in the psychological makeup of women have not changed overnight but have taken a much longer time to settle in place. We are only now bearing the fruits of structural and educational changes first instituted decades ago and that tackled some serious forms of discrimination. As a result, we are seeing girls and women donning a deeper confidence that may help them participate with more success in the arenas they want to whether it be sports or in the workplaces (though there are certainly still major barriers and issues, which are addressed in the article). So why would someone want to participate in the world of free software and hacking in particular? My first answer is there may be any number of reasons why anyone, female or male or transgender or whatever, may want to do so for the love of technology, to feel an intense belonging to a community who share your passions and who work together to create something with a lot of value, to enjoy the challenge of learning, to spread freedom to every corner of the earth, etc… It is not that geekdom is inherently fun and exciting but that it will be interesting to some slice of the population men or women (or other) and what is the harm in lowering the barriers to entry, especially if it brings enjoyment and frankly a lot of economic security too? There are a number of girls/women who already find it worthwhile and I am sure many more who would. And the point is not to create some policy to make sure that we shuttle women into hackerdom but as a society we should equip them with the necessary psychological tools so that if they think this is worthwhile, and discover that they love it, etc, they will dare to venture in there and more importantly, stay if they want to. In terms of Karls point that a lot of people are professional geeks in part because they d have trouble being anything else; like being gay, it s not a choice, I think that is far too narrow of an assessment, not to mention an outdated caricature of geeks. While there is certainly a class of socially awkward geeks (if that is what you mean??), I would say they are in the minority though they may certainly stand out precisely because they are the odd ducks and because the stereotype is so entrenched. Many geeks I have met, while they may pretty darn focused on geekdom, also have full and rich lives/personalities that cannot be easily collapsed into one immutable personality type. Yes they may be obsessed with tech but aren’t doctors, academics, musicians, lawyers sort of fanatical too? I spend like my whole week working on academic stuff (part of necessity, part out of love). And at least hacking has way better conferences and economic perks, which may help explain why people stay :-) Finally, I think you assume a little to strongly that we do what we do because we have a pre-formed existing desired to do so. While I think this is the case for many things (and I knew the minute I learned about anthropology, I wanted to be one, which was odd but it proved to be correct), I think desire is also formed as much through experience and hence the importance of exposure to different worlds and experiences. I know that there are many things I could have never imagined I would have loved–karoake and sailing are two things that come to mind—until I tried them about both took some degree of courage. In the later case, it took a lot of guts to move onto some ship at the age of 18 instead of going to college and I am so glad I did. This is an instance where confidence and an initial curiosity led to discovering a love and passion I never knew I had. So if desire can be formed and not just expressed, I think it is key to make sure people have all sorts of opportunities to cultivate the passions they never knew they had.

Russell Coker: Linux Resource Controls

Using the “ulimit” controls over process resource use it is possible to limit RAM for processes and to limit the number of processes per UID. The problem is that this often is only good for accidental problems not dealing with malicious acts. For a multi-user machine each user needs to be allowed to have two processes to be able to do anything (IE the shell and a command that they execute). A more practical limit is five processes for a single shell session (one or two background jobs, a foreground job where one process pipes data to another, and the shell). But even five processes is rather small (a single Unix pipe can have more than that). A shell server probably needs a limit of 20 processes per user if each user will have the possibility of running multiple logins. For running the occasional memory intensive process such as GCC the per-process memory limit needs to be at least 20M, if the user was to compile big C++ programs then 100M may be needed (I’ve seen a G++ process use more than 90M of memory when compiling a KDE source file). This means that a single user who can launch 20 processes which can each use 20M of memory could use 400M of memory, if they have each process write to a pages in a random order then 400M of RAM would be essentially occupied by that user. If a shell server had 512M of RAM (which until quite recently was considered a lot of memory - the first multi-user Linux machine I ran on the net had 4M of RAM) then 400M of that could be consumed by a single hostile user. Leaving 100M for the real users might make the machine unusable. Note that the “hostile user” category also encompasses someone who gets fooled by the “here’s a cool program you should run” trick (which is common in universities). I put my first SE Linux Play Machine [1] on the net in the middle of 2002 and immediately faced problems with DOS attacks. I think that the machine had 128M of RAM and because the concept was new (and SE Linux itself was new and mysterious) many people wanted to login. Having 20 shell users logged in at one time was not uncommon, so a limit of 50 processes for users was minimal. Given that GCC was a necessary part of the service (users wanted to compile their own programs to test various aspects of SE Linux) the memory limit per process had to be high. The point of the Play Machine was to demonstrate that “root” was restricted by SE Linux such that even if all Unix access control methods failed then SE Linux would still control access (with the caveat that a kernel bug still makes you lose). So as all users logged into the same account (root) the process limit had to be adequate to handle all their needs, 50 processes was effectively the bare minimum. 50 processes with 5M of memory each is more than enough to cause a machine with 128M of RAM to swap to death. One thing to note is that root owned system processes count towards the ulimit for user processes as SE Linux does not have any resource usage controls. The aim of the SE Linux project is access control not protection against covert channels [2]. This makes it a little harder to restrict things as the number of processes run by daemons such as Postfix varies a little over time so the limits have to be a little higher to compensate, while Postfix is run with no limits the processes that it creates apply to the global limit when determining whether user processes can call fork(). So it was essentially impossible to implement any resource limits on my Play Machine that would prevent a DOS. I changed the MOTD (message of the day - displayed at login time) to inform people that a DOS attack is the wrong thing to do. I implemented some resource limits but didn’t seriously expect them to help much (the machine was DOSed daily). Recently I had a user of my Play Machine accidentally DOS it and ask whether I should install any resource limits. After considering the issue I realised that I can actually do so in a useful manner nowadays. My latest Play Machine is a Xen DomU which I have now assigned 300M of RAM, I have configured the limit for root processes to be 45, as the system and my login comprise about 30 processes that leaves 15 for unprivileged (user_r) logins. Of recent times my Play Machine hasn’t been getting a lot of interest, having two people logged in at the same time is unusual so 15 processes should be plenty. Each process is limited to 20M of memory so overflowing the 300M of RAM should take a moderate amount of effort. Recently I intentionally have not used swap space on that machine to save on noise when there’s a DOS attack (on the assumption that the DOS attack would succeed regardless of the amount of swap). Now that I have put resource limits in place I have installed 400M of swap space. A hostile user can easily prevent other unprivileged users from logging in by keeping enough long-running processes active - but they could achieve the same goal by having a program kill users shells as soon as they login (which a few people did in the early days). But it should not be trivial for them to prevent me from logging in via a simple memory or process DOS attack. Update: It was email discussion with Cam McKenzie that prompted this blog psot.

6 February 2008

Aigars Mahinovs: Sneaky blacklisting of WiFi in HP laptops?

I’ve been there before, but somehow I hoped that HP has come to its senses, so when my girlfriend got a HP Compaq 6715b laptop with a Broadcom wifi card that does not work with the open source driver and randomly crashes under load with ndiswrapper driver, I said - “well, I’ll just get an Intel mini-PCIe wifi card and plug it in”. I should have know better. While there is no obvious impenetrable error message like on NX6110, the 6715b simply ignores any non-HP wireless cards. They do not show up in lspci and don’t even appear in Vista. I have all the latest drivers and latest BIOS. I will look a bit for a workaround, possibly along the same lines as before (make a non-HP wifi card look like a HP wifi card), but I really must say - despite all the support for Debian HP has on the server side, I will have to recommend everyone I know to never, ever buy any HP laptops! By having an easy access latch to the WiFi slot they seem to embrace user choice, but in the confines of their BIOS they just cut through the heart of it by only allowing their own cards to be installed and used. Note: it is possible that the card itself is non-functional, but given the previous experience and some similar messages on the forums about all kinds of other HP laptops .. I wouldn’t bet on that. I would love to be proven wrong on this or shown a way to either make the non-HP IPW3945 card work or how to make the original Broadcom wifi card work in a stable manner. Currently it causes 4-8 hard lockups a day if the laptop is left acting as a bittorrent seed for a few thousand clients. Now i am just too tired to deal with this reasonably and should rather head for bed.

Filip Van Raemdonck: PyGTK exception handler

A little utility that has been collecting dust on my harddrive over the past two years is an enhanced version of a PyGTK exception handling module that was originally posted to the PyGTK mailing list by Gustavo Carneiro. I've now uploaded it to the sysfs download area; it is essentially unlicensed, considered public domain by Gustavo according to his email message.

Besides fixing a API incompatibility with recent PyGTK releases, there are two main differences with the original functionality.
First, I've modified the traceback formatting to include two lines of context to each line in the traceback, one before and one after the called line. Also included is a printout of the identifiers referenced in the traceback lines — variables, usually. On my personal wishlist was also syntax coloring in the debug window, but this was both non-trivial to implement, and it would likely add considerably to the complexity of the error handler, thus increasing the chances that the error handler itself would fail.
The other main functionality change is possibility to email feedback to a predefined address — mainly meant for deployment and debugging of company-internal applications. To enable this feature, two identifiers feedback and smtphost must be set on the module. This can be either by modifying the code, or, better, by adding them after module import:
import gtkexcepthook
gtkexcepthook.feedback = 'valid@email.address.here'
gtkexcepthook.smtphost = 'relay.smtp.hostname'
Bugfixes, enhancements and feedback welcome at mechanix on rack66.net.

Next.

Previous.