Odi's astoundingly incomplete notes
New Entries
Stuffed pepperoni with quinoa
It's as simple as it sounds, delicious and vegan. If you don't know quinoa, it's cooked like rice. Unlike rice however it's complete in amino acids.
Use your favourite vegetable for the filling. We used zucchini and soy cream. The red sauce is basically just passata with salt.

Use your favourite vegetable for the filling. We used zucchini and soy cream. The red sauce is basically just passata with salt.
Add comment
Why you never develop on a branch
I always tell my fellow coders: never develop new features on a branch.
By branch I mean a stable release CVS branch. That is usually a bit "old". HEAD is quite volatile. New concepts are introduced, old ones removed. Refactoring occurs on the HEAD.
So if you start to build something on the old branch and then port it to HEAD, your code may be based on old/deprecated concepts and will fail to support new features correctly.
Another factor is human errors: forgetting to port a patch between branches. If you develop on the branch, your customer is happy. But in the next release he will be unhappy when he notices that a change has been lost. If you develop on the HEAD you get immediate feedback from a customer when you forget to backport a change.
In general it's easier to write the code for HEAD and then backport it to the branch world. Also the backport should happen gradually and not as a big bang.
By branch I mean a stable release CVS branch. That is usually a bit "old". HEAD is quite volatile. New concepts are introduced, old ones removed. Refactoring occurs on the HEAD.
So if you start to build something on the old branch and then port it to HEAD, your code may be based on old/deprecated concepts and will fail to support new features correctly.
Another factor is human errors: forgetting to port a patch between branches. If you develop on the branch, your customer is happy. But in the next release he will be unhappy when he notices that a change has been lost. If you develop on the HEAD you get immediate feedback from a customer when you forget to backport a change.
In general it's easier to write the code for HEAD and then backport it to the branch world. Also the backport should happen gradually and not as a big bang.
Excel CSV WTF
Tethering with HTC Hero on Gentoo
I have added a section on that to my MacBook Pro page. Also the kernel config has been updated accordingly.
ata failed command: FLUSH CACHE
I got bitten by this problem in a 2.6.31 and .32 Linux kernel:
The machine is a media PC with an nVidia Corporation nForce2 chipset. Two IDE disks are attached to the PATA bus and running as md RAID-1 volumes. The disks are really old and may not be the best quality (thus the RAID-1...).
There is a patch that may actually address exactly this problem, by simply retrying the command.The patch is in 2.6.34 and will be in 2.6.33.4 and 2.6.32.13.
Apr 28 16:21:53 kernel: ata2.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
Apr 28 16:21:53 kernel: ata2.00: failed command: FLUSH CACHE
Apr 28 16:21:53 kernel: ata2.00: cmd e7/00:00:00:00:00/00:00:00:00:00/a0tag 0
Apr 28 16:21:53 kernel: res 40/00:01:00:00:00/00:00:00:00:00/a0 Emask 0x4 (timeout)
Apr 28 16:21:53 kernel: ata2.00: status: { DRDY }
Apr 28 16:21:55 kernel: ata2: soft resetting link
Apr 28 16:21:55 kernel: ata2: soft resetting link
Apr 28 16:21:55 kernel: ata2: nv_mode_filter: 0x3f39f&0x3f39f->0x3f39f, BIOS=0x3f000 (0xc700c6c0) ACPI=0x3f01f (20:60:0x1f)
Apr 28 16:21:55 kernel: ata2: nv_mode_filter: 0x739f&0x739f->0x739f, BIOS=0x7000 (0xc700c6c0) ACPI=0x701f (20:60:0x1f)
Apr 28 16:21:55 kernel: ata2.00: configured for UDMA/100
Apr 28 16:21:55 kernel: ata2.00: configured for UDMA/100
Apr 28 16:21:55 kernel: ata2.01: configured for UDMA/33
Apr 28 16:21:55 kernel: ata2.01: configured for UDMA/33
Apr 28 16:21:55 kernel: ata2.00: device reported invalid CHS sector 0
Apr 28 16:21:55 kernel: ata2.00: device reported invalid CHS sector 0
Apr 28 16:21:55 kernel: end_request: I/O error, dev sdb, sector 58604962
Apr 28 16:21:55 kernel: md: super_written gets error=-5, uptodate=0
Apr 28 16:21:55 kernel: md: super_written gets error=-5, uptodate=0
Apr 28 16:21:55 kernel: raid1: Disk failure on sdb3, disabling device.
Apr 28 16:21:55 kernel: raid1: Operation continuing on 1 devices.
Apr 28 16:21:55 kernel: ata2: EH complete
Apr 28 16:21:55 kernel: ata2: EH complete
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 kernel: disk 1, wo:1, o:0, dev:sdb3
Apr 28 16:21:55 kernel: disk 1, wo:1, o:0, dev:sdb3
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: RAID1 conf printout:
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: --- wd:1 rd:2
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 kernel: disk 0, wo:0, o:1, dev:sda3
Apr 28 16:21:55 mdadm[5734]: Fail event detected on md device /dev/md1, component device /dev/sdb3
Apparently a cache flush timed out. This leads to a failure of the RAID and the disk goes offline. Just removing and re-adding it with mdadm of course fixes the RAID again. But it occurred a couple of times and is annoying.The machine is a media PC with an nVidia Corporation nForce2 chipset. Two IDE disks are attached to the PATA bus and running as md RAID-1 volumes. The disks are really old and may not be the best quality (thus the RAID-1...).
There is a patch that may actually address exactly this problem, by simply retrying the command.The patch is in 2.6.34 and will be in 2.6.33.4 and 2.6.32.13.
The protein myth
Meat is high quality protein1. Meat gives you all the protein your body needs.
1see bottom for definition
These are the words you have most likely heard. And they are true. They are one of the top facts used by the meat industry to trick you into believing that you need to eat meat. And that is not true. You don't need meat - at all. You can even get rid of all animal products in your diet. With no adverse effects - rather the opposite.
What few people realize:
It's near to impossible to suffer from a lack of protein
Unless you live in a region where famine is a common problem.
Also a vegan diet delivers all essential amino acids.
Because vegans don't eat only a single vegetable. The 8 essential amino acids are abundant in the following plants:
What is "high quality" protein?
The building blocks of all proteins are amino acids. There are 20 different amino acids. All but eight of them can be made by your body by chemical reactions. The other eight you have to eat and ingest. They can not be made by your body. They are thus called "essential amino acids", because it is essential to eat them.
Protein (or a combination of proteins) that contains all the essential amino acids (and any number of nonessential ones) is called "high quality". Animals and the human body store essential compounds in generous quantities in order to compensate any temporary shortage. Thus meat contains a lot of high quality protein.
1see bottom for definition
These are the words you have most likely heard. And they are true. They are one of the top facts used by the meat industry to trick you into believing that you need to eat meat. And that is not true. You don't need meat - at all. You can even get rid of all animal products in your diet. With no adverse effects - rather the opposite.
What few people realize:
It's near to impossible to suffer from a lack of protein
Unless you live in a region where famine is a common problem.
Also a vegan diet delivers all essential amino acids.
Because vegans don't eat only a single vegetable. The 8 essential amino acids are abundant in the following plants:
- Isoleucine and Leucine: sesame, peanuts
- Lysine: pulses (beans, lentils, peas), spinach, buckwheat, amaranth, quinoa
- Methionine: sesame, cereals, broccoli, mushroom, cauliflower, avocado, potatoes, spinach, peas, oranges
- Phenylalanine: peanuts, sesame, peas
- Threonine: lentils, sesame
- Tryptophan: spirula, sesame, sunflower seed
- Valine: sesame, peanuts
What is "high quality" protein?
The building blocks of all proteins are amino acids. There are 20 different amino acids. All but eight of them can be made by your body by chemical reactions. The other eight you have to eat and ingest. They can not be made by your body. They are thus called "essential amino acids", because it is essential to eat them.
Protein (or a combination of proteins) that contains all the essential amino acids (and any number of nonessential ones) is called "high quality". Animals and the human body store essential compounds in generous quantities in order to compensate any temporary shortage. Thus meat contains a lot of high quality protein.
Going veg
I have gone vegetarian since the beginning of the year. I have stopped drinking milk. Although I am not avoiding milk altogether: I still consume milk as an ingredient (like butter in cookies), eat yogurt and cheese. I have stopped eating egs. Although I am not avoiding eggs strictly: I still eat cake, pasta that contains eggs, but not an omelett. I only eat fish when by the sea. The sea is an 8 hour's drive away.
Why? Several reasons:
So what do I actually eat? This is what this new catgory in this blog is going to be about. Random facts surrounding a vegetarian/vegan diet. Random recipies or notes of what I eat. Random experiences I make while becoming a vegetarian.
Why? Several reasons:
- health: meat is the most unhealthy food in the long term (obesity, cancer, heart diseases, diabetes, rheumatic diseases, osteoporosis)
- disgust: I work next to the slaughterhouse. Sometimes the smell is unbearable. The screams of these animals tear your heart apart.
- ethics: animals are no longer born - they are produced (sounds familiar? Like that scene in The Matrix?). Industrialized killing of lives for their meat. Mass breeding. Each about year 10 times as many animals are killed than people live on earth.
- sustainability: meat is horribly inefficient use of resources. Farmland vs. grazing land. Crops for animal food. Rainforest for farmland. Water. CO2. Methane. Dung. Name any environment problem.
- fairness: the 3rd world produces the food for the animals of the rich instead their own food. Most people on earth have a nearly vegan diet, but most of earth's resources are used to produce meat.
So what do I actually eat? This is what this new catgory in this blog is going to be about. Random facts surrounding a vegetarian/vegan diet. Random recipies or notes of what I eat. Random experiences I make while becoming a vegetarian.
FWIW, I gave up meat in 1993/4, and actually grew rapidly quite a lot fatter.
I don't expect you need me to tell you this, but try to avoid the grim and tasteless dishes which are just veggie versions of meat dishes. Meat-eaters sometimes lack the imagination (or confidence) to offer anything else, and may need educating. I deal with that by example: my friends, including meat-eaters, know me as a good cook, and take pleasure in proud and honest veggie food.
- niq
I don't expect you need me to tell you this, but try to avoid the grim and tasteless dishes which are just veggie versions of meat dishes. Meat-eaters sometimes lack the imagination (or confidence) to offer anything else, and may need educating. I deal with that by example: my friends, including meat-eaters, know me as a good cook, and take pleasure in proud and honest veggie food.
- niq
WS implementors
Next time you implement a webservice framework, please:
- make it difficult to produce invalid SOAP messages. Your generated SOAP messages should conform to the schema and mapping in the WSDL.
- make sure you escape XML correctly. Use an XML infrastructure, not string operations.
- support all features of XML schema, not just a subset
- make sure you handle namespaces correctly
- make sure you handle nil, empty elements and optional elements correctly and in a simple way for the user
- certain attributes in schema definitions have standardized defaults. Make sure you use them in the absence of these attributes.
- make sure you handle timezones in dates/times correctly
- generate code from WSDL. Never generate WSDL.
- issue useful error messages from your utilities instead of just crashing
- make the generated code look nice.
- use the documentation from the WSDL as API doc.
- make the generated code useful for a programmer
- don't try to hide something behind a mapping infrastructure. Someone will have to go down and do the dirty work one way or another. A mapping file is not better than code.
- give the programmer also access to the raw SOAP message. Preferably both as string and parse tree
- make message logging simple and let the programmer choose to log it in any other way
- east shit, poo gold
- if you fail to do that, don't call your product WS-capable. You can just as well use a proprietary binary protocol because your broken WS implementation will never be able interact with the real world.
Jack ok, but PulseAudio?
I heard a lot about PulseAudio. I have used Jack. I read Lennart's post about PulseAudio and Jack. Still I don't see why I "need" PulseAudio. I have never used it. And I am not missing a thing. Audio comes out of my Gentoo box just fine using plain ALSA. No KDE phonon. No arts. No esd. Just ALSA. So what's the point of having PulseAudio altogether? Maybe you can enlighten me.
Notes from readers, my comments appended:
Notes from readers, my comments appended:
- per application volume control: but you don't need PulseAudio for that. Applications are doing that fine without it.
- sane volume control (ALSA presents lots of sliders, most of them doing nothing): okay. I like the volume control on a Mac: there is a single control, period. Like on your stereo. Big round knob.
- seamless switching between different audio devices (think speaker -> bluetooth headset): okay. Fine for me, I have internal laptop speakers, and headphones.
- mixing audio in userspace where it belongs: whatever, that is a purely academic problem.
- and most important: fixing long-standing bugs in some ALSA drivers: what? when your car is broken, you buy a horse?
- sound over a network: okay, I can see uses for that in VMs and media servers. Again I have no use for it.
- per application volume control
- sane volume control (ALSA presents lots of sliders, most of them doing nothing)
- seamless switching between different audio devices (think speaker -> bluetooth headset)
- mixing audio in userspace where it belongs
and most important: - fixing long-standing bugs in some ALSA drivers...
- sane volume control (ALSA presents lots of sliders, most of them doing nothing)
- seamless switching between different audio devices (think speaker -> bluetooth headset)
- mixing audio in userspace where it belongs
and most important: - fixing long-standing bugs in some ALSA drivers...
- sound over a network
for example, PulseAudio help me to fix problem with flash plugin - there was no sound on my debian unstable.
No URL alias in Tomcat?
Is there seriously no way to create an arbitrary (i.e. cross-context) alias for an URL in Tomcat? I don't want a HTTP redirect, I don't want inefficient reverse-proxying, I don't care about cookie security (as cookies are not used), I don't want HTTPD in front. Just a simple stupid alias. That is the alias URL calls the same servlet code as the aliased URL. Also known as URL rewriting.
I want: http://localhost:8080/old-service -> http://localhost:8080/axis/services/new-service
Filters and not even Valves can do that, because implementations must not "change request properties that have already been used to direct the flow of processing control for this request". Seriously? 2010?
Reason: I have a webservice that has been migrated to a completely different infrastructure, and thus a different context. The clients should not need to be changed. And the clients don't support redirects.
I want: http://localhost:8080/old-service -> http://localhost:8080/axis/services/new-service
Filters and not even Valves can do that, because implementations must not "change request properties that have already been used to direct the flow of processing control for this request". Seriously? 2010?
Reason: I have a webservice that has been migrated to a completely different infrastructure, and thus a different context. The clients should not need to be changed. And the clients don't support redirects.
Why not run Tomcat in Apache 2.0 and then you can do your aliasing from Apache 2.0... ref aliasing in tomcat, I'm not sure on that (I assume from your rant that it isn't possible).
Best regards
Steve
Best regards
Steve