Search Results: "eric"

28 February 2008

Erich Schubert: Vote Green, please.

There are communal elections in my region this weekend.Green campaignI'm a supporter and member of the Greens. Please support us by voting for us.Don't vote for CSU. Ever. Just think of what they've been doing towards spying on citizens, data retention and such. They fight against your freedom by blaming the "terrorists".[Yes, I am aware that these topics are national, not communal topics. But in communal topics it's the same thing. CSU wants to waste billions of money on a train which is 10 minutes faster at the airport, and which nobody is going to use because it's quite a bit more expensive. The money could be used for much better purposes, but I guess they owe some construction companies ... It is a fact that they have introduced study fees, despite the need for more high-qualified people; they should be putting more money into our universities instead of driving people away from higher education.]We could use up to 20% greens, and there is no way we're going to reach that anytime soon. So it's save to vote for the Greens. Even with your vote, they'll probably just reach 10%, and that definitely is a good thing for democracy. Nobody is talking about the Greens becoming the strongest party, you know... but we could use more Greens than we currently have in the parliaments. If we have 4-5 reasonably strong parties and changing coalitions, that helps fighting corruption.

21 February 2008

Tore S. Bekkedal: A very cute bug

Today, in a fit of fool-Hardy-ness, I upgraded one of my computers to the most recent Ubuntu development release, codename Hardy Heron. Amongst the several other bugs I encountered (the kernel not booting was a rather noticable one…) was this adorable little bug in tracker. (Some background info: Tracker is a file alteration monitor - like Apple’s Spotlight, and …whatever the Vista knockoff is called. ImageMagick is an image processing utility, invoked with the command “convert”.) So - picture this situation: Tracker is searching along, and encounters a graphics file. Being a graphics file, Tracker realizes it wants a thumbnail. Tracker calls convert. Convert creates a temporary file. Tracker notices a file has been created. It notices that this file is an image file, and therefore wants a thumbnail. Tracker calls convert… You can guess what happens from here on. :) This lovely bug reminds me quite a lot of a story I read a while ago which had been uploaded by Eric Smith to his wonderful PDP-6/PDP-10 resource and folklore website, “I/O Deja Vu, A Farce in One Act“. Worth a read. Update: Within ten minutes, the very helpful Saleem Abdulrasool (”compnerd” on IRC) helped me debug it and comitted a change to upstream, so it’s fixed in the next release (expected in a few days). Filed a bug on the Ubuntu package. I love FOSS. :)

20 February 2008

Erich Schubert: Enigma on Nokia N810 with tilt device

Watch the youtube video of the n810 with a tilt device.It's pretty cool to see Enigma running on the n810. The tilt device seems to be suprisingly good for playing Enigma, I wouldn't have expected that - Enigma is heavily designed to be played with a mouse.Congrats to the tilt stick makers and the Enigma porters for the n810.There will be a new release of Enigma in a few months, with serious engine improvements (several algorithms have been replaced with more efficient ones, leading to serious speed improvements in certain levels!). The code got a pretty big overhaul by the main developers, and the level API was also redesigned, so this will really be a major thing.

18 February 2008

Sune Vuorela: digital cameras

Dear lazyweb I have been looking for a small nice digital camera, one that of course takes nice pictures, but besides that have the following technical features: I want it to be using a generic cable for charging and transfering pictures because I am not that good at not loosing cables and chargers and such so a replacement cable should be very easy to get. And I want it to be a usb mass storage because I want it working with any computer. It kind of seems hard to figure out what devices to look at. Most “technical specifications” doesn’t contain information on wether it is a USB A => USB mini B cable or some vendor specific cable, nor do they contain information on wether it is a usb mass storage device or a device requiring mtp/ptp. Canon looks like it is doing mtp/ptp over a generic cable - and with a external charger.
Samsung tells deep inside their manuals that it uses the usb mass storage driver. Samsung uses a vendor specific cable, but is also charged thru this cable.
Kodak seems to be using a generic cable, a external charger and undefined how the communication with the computer is.
Olympus seems to be using a vendor specific cable and a external charger. But it is a bit unclear. Seems to be able to do both mtp and usb mass storage
HP seems to use a generic cable, standard AA batteries and no charger bundled, seems to be configured to use usb mass storage.
Sony uses memory sticks which are just too expensive.
Casio seems to use a generic cable, a external charger and is a bit unclear about communication. Could be usb mass storage though.
Nikon seems to use generic cable, mtp protocol and a external charger Argf. What have I missed?

16 February 2008

Ben Armstrong: Bits from the Debian Eee PC team

In the past few months in the Debian-EeePC team, a number of interesting things have been happening. Progress has been made to ensure the Eee’s drivers get merged upstream. Chris Snook from Red Hat has taken over atl2 upstream and has started merging it with the atl1 driver to make a unified atlx driver that will be suitable for inclusion in the kernel. As well, there is continued progress on the madwifi driver, with a patch now included to support version 2.6.24 of the Linux kernel. In the meantime, the Debian Eee PC Install HowTo has been under constant revision, even gaining recently the beginnings of translations in French and German. ACPI, another important piece of infrastructure for the Eee, is now supported in lenny and sid through Eric Cooper’s eeepc-acpi kernel module. This is a fork of the asus-acpi module renamed so that it won’t conflict with the in-tree version. It turns out that asus-acpi is deprecated, having been replaced by asus-laptop. Eric has been in touch with the asus-laptop maintainer to ensure the Eee-specific bits are merged so that we can eventually retire our forked version. There still remains at the top of our Todo list the issue of ACPI scripts to go with the kernel module. Having at first considered patching acpi-support, we have decided instead to start with Eric’s own scripts which will be packaged shortly for Debian. This gives us more freedom to tinker before considering submitting patches to more general laptop support packages like acpi-support. Finally, after Brendan M. had to send his Eee back to Asus for repairs, work stopped for a while on the custom debian-eeepc installer. Fortunately, he just got his system back from the shop as good as new and has returned with renewed vigor to that task. He has produced a new version of the installer which we are now testing. Thanks to the efforts of numerous users and developers who are being added to our ranks daily, we expect by the time Lenny releases we will be well on our way to providing a pure Debian solution for the Eee. Whether or not everything needed for the Eee is in Lenny at that time remains to be seen. We need to allow for how long it takes to get new drivers into the kernel. But if we miss the release, we will certainly provide backports and look forward to full support in the following release.

15 February 2008

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!

14 February 2008

Adeodato Sim : Hating the Spanish voting system

I’m obviously not discovering the Americas here, given the sheer amount of research, theory and whatnot one can find for this topic, but I need to vent. Also, please excuse my terminology and my bias. In Spain we have two main political parties, the one that advertises itself as the rightish-center option, but is sliiiightly more to the right than that (PP), and the one that wears socialism in its name, but is sliiiightly less to the left than that (PSOE). Then there are some minority parties, like the nationalists, and United Left (IU). So, ideally, my ballot -la-Debian would always be:
  [1] IU
  [2] PSOE
  [4] PP
  [3] None of the above
But sadly you can’t vote like that in the real world (?), and can only pick one. Without a fscking second round. So every election I’m left wandering in the cold land of tactical voting. One last interesting bit: when talking about my wishes for a two round system with a good friend, who also happens to be a PP fanboy, he said: “But with that system PP would never govern!” And I think there’s some truth to that.

12 February 2008

Erich Schubert: New flash, usability++

With the latest flash for Linux update, two of the biggest annoyances have disappeared. Yay for usability!It still sucks, and I'm only using it in rare cases by selectively loading Flash. I love FlashBlock, which replaces any flash crap with a 'Play' button. Now if we could only do the same for some of the Web 2.0/DHTML annoyances...[Note: it's not a particularly new version. r115 according to about:plugins. I was told it's like 3 months old. I just noticed the difference, maybe cause the Debian flash-installer package was just updated to this release, or because I use Flash so little. It was so unreliable for like ever that I wouldn't even start using any site that uses Flash for anything serious. Granted: I do use youtube, because there are some great Swing dancing clips there. But that only uses a tiny fragment of Flash but still has been killing my browser every now and then.][Update: I was misled by a clever Javascript that actually disabled the flash or shrank it or so when the menu popped up. E.g. the Toyota site http://www.toyota.com/corolla/ is still unusable unless you're using some flash blocker or do not have flash installed (apart from the flash assuming it were transparent, but it's rendered on all white). The menu still pops up under the flash, making it impossible to access many pages.]

11 February 2008

Miriam Ruiz: HIZ s abstract shooters: Finally in Debian

HIZ’s games Tatan, ProjectL and ES (ii-esu) have finally arrived to Debian repositories: tatan, projectl, ii-esu. Even though I’ve had some packages available for them for some time, I finally had to remove the music from them, as it wasn’t DFSG-free. The games are great anyway. They’re japanese abstract shooters of the style created by Kenta Cho, and also coded in D language. We had to rename “ES” to “ii-esu” (more or less its phonetical translation in japanese, AFAIK) as “es” was too much a generic game for a package and the binary. The next ones in my Indy Games TODO list are Linley Henzell’s Excellent Bifurcation and Garden of Coloured Lights.

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.

8 February 2008

Jeff Bailey: Osteopaths in the USA

In Montreal, I discovered the joy of visiting Osteopaths. An Osteopath managed to cure Leif's colic and let us sleep, and unlike a chiropractor, a treatment from Martine at Santenergie on the plateau of Montreal (shameless plug) would actually stay in effect for more than 20 minutes (Sometimes for weeks at a time).

Coming to the US, however, means learning a whole new variety of Osteo. Osteopathy was written into law early on, and has grown up as a full alternative to medical doctors - including the ability to prescribe medication. In practice what happens is that Osteopaths wind up in family practice as just another variant of MDs. The amount of "Osteopath" training that they've had compared to an MD turns out not to be that big anyway.

All hope isn't actually lost, though. There are two groups in the US, the American Academy of Osteopathy (Members recognised by the letters FAAO after their names), an the American Osteopathic Assocation (, AOA). Physicians can be fellowshipped into one or the other of these groups and they have different philosophies.

So there are three types of Osteopaths here:

1) Regular doctors (For all that it matters for the patients coming in)

2) Regular doctors who will practice some forms of Osteopathic Manipulative Medicine, but may not perform all techniques, and whom are more likely to be involved in "Integrative medicine" - helping find overall wholistic solutions to problems that might include manipulation, but might include other naturopathic solutions.

3) Osteopaths who specialise in manipulative medicine.

The downside to #3 is that these are people who've taken full medical degrees, and then had to further it with what an Osteopath would take at home. They're expensive, often don't accept any form of medical insurance, and are generally part of private practices.

With some back troubles I've been having recently, I managed to find a doctor in the #2 category who explained to me how this all works (followed by us figuring out that there's more to it than he can fix. But that's another story for later). He very kindly wrote it out for me on a napkin, so I'm copying it here before I blow my nose it in by accident. =)

7 February 2008

Eric Dorland: Jealousy

Martin's adventure makes me long for some scuba diving, which I haven't done for a couple of years now. Damn you, busy life!

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: The Curse of Oil

Jaldhar Vyas points to the rogues gallery of oil producing states and argues that Neoconservatism is good, well at least it gets rid of the dictators such as Saddam Hussein while it grabs the oil. As he ightly points out, we are researching new alternative energy sources, and just as importantly (or even more importantly) energy conservation. But we have been doing this for decades. Sooner or later we have to realize that the "Oil Crisis" isn't due to a shortage of energy sources: its due to deliberate politics to make us dependent on oil. Peak Oil is "only" a crisis for us consumers, dependent on oil to drive our cars, heat our houses, and supply our food. For oil companies, it means (1) they are shipping oil at a greater rate than ever before, (2) at higher demand than ever before, and (3) in circumstances where pesky politics like OPEC can't interfere and try and moderate the price down (I'm not arguing OPEC or cartels are good; its just that its long-term 'maximize the benefit for the oil producing nations' strategy interferes with oil companies shorter-term profit maximization). For the Oil Companies, its a good thing. In this context we have to see our current dependence on oil as the result of deliberate policy by the oil companies. The small filip that USanian governments have done towards alternative energy, such as funding Hydrogen fuel-cell research, nuclear power, etc. are so long-term, and so small in scale, that they have to be seen as deliberately not solving the problem. Thinking that research into alternative sources is good is gpoing to save us (disclaimer: as a scientist I think research is a good thing :-)) is missing the real problem. Its politics: the oil companies have simply been better at politics than the strugging alternatives; we need to recognize this, and fight for alternatives. When oil prices reach $100/barrel, and we struggle to pay rising food and energy bills, its because other have deliberately caused the crisis. Oil has often been called a Curse because of the effects 'Oil Wealth' have caused so many countries. They are not co-incidentally dictatorships; Saddam Hussein remained in power in Iraq for so long because it benefitted the West (see the weapons supplies to Iraq in the so-called "Iran-Contra" affair, for example). Ditto Saudi Arabia, remaining 'friends' of the USA despite its ties to 911. Overthrowing Saddam Hussein was about consolidating even more power in the Gulf than America had previously, not democracy. What was planned for Iraq was democracy in name only: all real power was already neutralised, with decisions to US benefit cemented in place before the parliament met: non-negotiable contracts already signed giving US companies control. This is straight imperialism, and cannot be considered democracy or a good thing. Tags , ,

5 February 2008

Aigars Mahinovs: Super bowl XLII

No Debian content here. Just like last year I decided to watch one of the largest sport events in the USA - the final game of the National Football League Super Bowl XLII (roman numerals are different for the sake of it :P ). I came to like the Japanese take on American football, so I watched the Superbowl last year and was appalled at the lack of any entertainment value in the game. I was told that it was one the worst Super bowls ever, so I gave it another try. Just like last year the American football looks to be very lawyer-friendly: bundles of complex rules and exceptions. The game could have been much simpler. Like for example, a lot of rues come from the fact that the game timer almost never stops. It is good for TV companies as they can plan their broadcast times better, but horrible for the stop-go game like the American football is. Just stopping the timer on every point the ball is stopped like they do in final seconds would cut out a lot of rules. Playclock and all. Rules on use of timeouts and stuff. Of course the game time would need to be adjusted down a bit. Now you have 4×15 minutes of ‘game’ where at most 20 minutes of that is in action. That game time is a lie - most of the time people are just standing around. Terminology irks me quite a lot. Why is it a “1st down” when there have been two “1st down”s just a few minutes ago? Something along the lines of “down counter reset” would be much clearer. And what is cryptic “1st & 10″ doing in the middle of the screen? It would have been much clearer if that info would be split: “Downs: 1/4″ and a measuring arrow between the ball and the yellow line with “10yd” written on it. And then there is an obscured “two in two” or “two for two” or “two in O” phrases which apparently means the same as “two 1st downs out of two tries” in the context. Can’t the commentators be a bit more elaborate and actually say the units of measurement? “Giants strength first tonight”? How about “in the lead”, English anyone? The camera placing editing is just horrible - the camera direction is switching all the time and that is confusing as hell. In normal football when professional camera teams are working, you always get all the shots from one side and even one general angle. If for clarity reasons a camera shot from other side is needed (usually in a replay) they always say that the image is from the reverse side in large letters on the screen. Here a lot of close-up shots were all over the place and even rotated around inside one shot! That might look fancy, but is just crappy camera work and editing. Then commentators start talking walls of numbers and walls of names. Unless you know by hearth who plays at what position, there is no way to understand what those people are saying. Than is just sloppy commentary. Is FOX incompetent in all possible ways? Then again the funky rules came into play just at the end of the first quarter - I have no idea why the ball was moved to the end line. Apparently the defender did or didn’t something. Did not see anything worth penalizing the team like that at all. They dropped the term ‘pass interference’ later on. Isn’t interfering with the pass the whole point of the defense play in this game??? Lawyer game, I’m telling you. And later on, pulling on guys arm while he is catching and being tackled apparently is just fine. And holding is illegal??? On the big penalty on the Giants the judge could have just said that the ball is out of bounds. Giving a 10yd penalty for such a minor thing is just ridiculous. The halftime show was kind of meh. Staged to extreme, but no soul nor sense. And what were all those people doing on the field? Isn’t that bad for the grass? And the commercials .. Average at best. Horrible at worst. For example a government commercial saying parents to protect their prescription medicine to .. help out your neighborhood drug dealer??? Oh and does anyone still doubt that media is controlled by republicans after that Coke commercial where the democrat is portrayed as bald and ugly and the republican is portrayed as the nice guy going for the compromise. And then they both Segway into the sunset? Brainwashing and prejudice embedded in a Coke commercial !?! WTF is going on in USA !? The 12-man-on-the-field penalty in the 3rd quarter is another legalese bullshit in the game. It is clear that the extra player had no effect on the game so it is just ridiculous for the judge to penalize the team for that. A couple small penalties were given for Patriots as well, judge bias was not as prevalent as last year. The camerawork stayed the same through the game - confusing, flashy and sloppy. Other cameras are in the shot line all the time. The game however did compensate for that all. The 4th quarter was very nice and exiting. I had no idea of the teams before the game, but I did like the Giants more - they just seemed to have more will and soul in their game. So I rooted for them since the 2nd quarter and it was very satisfying to see them win the game in the final seconds. Summary: good game, great final quarter, horrible coverage and crappy sideshows (adverts and halftime show).

Christoph Berg: Mouseover titles

Best(*) Firefox extension ever: Long Titles (Spotted on http://xkcd.org/about/) (*) PS: Of course Open in browser and Generic URL creator are also way cool.

4 February 2008

Gunnar Wolf: Switched!

Ok, the time has come. I have postponed this change too much - But finally, after three months of having hired my Dreamhost account (and stating so in this very blog), I finally made the switch from Jaws to Drupal.
Now I only hope I don't flood any planets with my RSS (I was careful to check the dates are consistent, but you never know), finish moving over my static content (I carried over about half of it already), play a bit with the theme, and... that's it! :D
Anyway, I promised my oh-so-not-generic-but-what-the-heck Jaws (0.7 at least) to Drupal (5.x) migration script. It worked like a charm - Ok, I only used it to move blog and photo albums/entries, but that's at least the most typical use AFAICT.
Now, I'll have to understand still some more terms and details in Drupal. For example, WTF? Why was jaws_to_drupal.pl renamed to jaws_to_drupal.pl.txt? (stated content-type, I guess) Why do my uploaded tar.gz files get renamed to tar_.gz even if I explicitly requested to allow .tar.gz suffix uploads? (same thing, I guess)

1 February 2008

Ian Wienand: Compare and Swap with PIC

Our Dear Leader Sam Hocevar has previously blogged about PIC and inline ASM. Today I came across a sort of extension to this problem. Consider the following code, which implements a double word compare and swap using the x86 cmpxchg8b instruction (for a bonus you can lock it to make it atomic).
#include <stdio.h>
typedef struct double_word_t  
	int a;
	int b;
  double_word;
/* atomically compare old and mem, if they are the same then copy new
   back to mem */
int compare_and_swap(double_word *mem,
		     double_word old,
		     double_word new)  
	char result;
	__asm__ __volatile__("lock; cmpxchg8b %0; setz %1;"
			     : "=m"(*mem), "=q"(result)
			     : "m"(*mem), "d" (old.b), "a" (old.a),
			       "c" (new.b), "b" (new.a)
			     : "memory");
	return (int)result;
 
int main(void)
 
	double_word w =  .a = 0, .b = 0 ;
	double_word old =  .a = 17, .b = 42 ;
	double_word new =  .a = 12, .b = 13 ;
	/* old != w, therefore nothing happens */
	compare_and_swap(&w, old, new);
	printf("Should fail -> (%d,%d)\n", w.a, w.b);
	/* old == w, therefore w = new */
	old.a = 0; old.b = 0;
	compare_and_swap(&w, old, new);
	printf("Should work  -> (%d,%d)\n", w.a, w.b);
	return 0;
 
This type of CAS can be used to implement lock-free algorithms (I've previously blogged about that sort of thing). The problem is that the cmpxchg8b uses the ebx register, i.e. pseudo code looks like:
if(EDX:EAX == Destination)  
    ZF = 1;
    Destination = ECX:EBX;
 
else  
    ZF = 0;
    EDX:EAX = Destination;
 
PIC code reserves ebx for internal use, so if you try to compile that with -fPIC you will get an error about not being able to allocate ebx. A first attempt to create a PIC friendly version would simply save and restore ebx and not gcc anything about it, something like:
  __asm__ __volatile__("pushl %%ebx;"   /* save ebx used for PIC GOT ptr */
		       "movl %6,%%ebx;" /* move new_val2 to %ebx */
		       "lock; cmpxchg8b %0; setz %1;"
		       "pop %%ebx;"     /* restore %ebx */
	    	       : "=m"(*mem), "=q"(result)
		       : "m"(*mem), "d" (old.b), "a" (old.a),
		         "c" (new.b), "m" (new.a) : "memory");
Unfortunately, this isn't a generic solution. It works fine with the PIC case, because gcc will not allocate ebx for anything else. But in the non-PIC case, there is a chance that ebx will be used for addr. This would cause a probably fairly tricky bug to track down! The solution is to use the #if __PIC__ directive to either tell gcc you're clobbering ebx in the non-PIC case, or just keep two versions around; one that saves and restores ebx for PIC and one that doesn't.

31 January 2008

Frank Lichtenheld: Some packages. debian.org,ubuntu.com updates

29 January 2008

John Goerzen: Why Are We So Afraid of Socialized Medicine?

I've been thinking about this for awhile, so time to put down some thoughts.

First, what is socialized medicine? If we listen to the politicians that label health care as "socialized", it seems to be "anything that is paid for by taxes and delivered free or cheaply to citizens." Putting aside the question of whether that meets the academic definition of socialism for the moment, let's look at things in the United States that are already socialized:



That's right. We trust the government with our children all day long for 13 years. For free!

Yet this is a country in which hospitals dump the homeless in the gutter for being unable to pay their bills. Even insured Americans find claims turned down for arbitrary reasons. People are afraid to change jobs for fear of losing health insurance.

Why is it bad to have the government pay for health care?

Here in the United States, our health care system is far from best in the world. It's not even top 10. Or 20. Our system encourages minimizing health care, and doesn't encourage preventative care.

I'd suggest that, in a democracy, it's best to have the government pay for health care. That's because, in a democracy, we are in control of the bureaucrats. If we wish to exercise common sense and pound into their heads that paying for preventative care makes good long-term sense, then we can do so at the ballot box.

So why the scare tactics about government being involved in health care?

Perhaps our real problem is that we have let government get out of our control? Perhaps we are too frightened of change to vote. Perhaps we've given up on a responsive government. Perhaps we think that the insurance companies and drug companies will never let us have a good health care system.

Yes, the lobbyists have a lot of power. But we have the power to remove it, and it's high time we used it.

The audacity of Obama to have hope. To say that we can do better. When Hillary Clinton falls in line with the Republicans and accuses him of having "false hope", effectively saying that we can't do any better, then is she -- or any Republicans -- really a candidate of change? I think that all these accusations from conservatives and Hillary that Obama has "false hope" has finally convinced me that he's the one to vote for. If everyone else claims that his ideas are too good, that his dreams too big, then I like him.

Oh, and you could substitute "college education" for "socialized medicine" everywhere in this article and get equally valid arguments.

Next.

Previous.