|
About How this site is organized and what it's for Weblog start pageThe start page contains the most recent 15 articles. Home pageThe main home page of my website, not my weblog. Currently not used. ------------------ Articles by month Click here to get all the articles for a particular month. This month's articles (if any) Current month Today's articles (if any) Articles dated 2008/12/05 only ------------------ Subtopics ------------------
Site map
Search for text on this site
You may have to use search if I move files around! Listing of all articles by date
Flavours There's more than one way to view this weblog; these links display the current page in other formats. External links These are a few of my favourite sites. T E S T Slashdot yesterday Copyright © 2003-2007 Alternate Worlds Publishing, Boston MA USA Wenhua dageming de zhongyao jiaoxun shi bixu fandui geren mixin If I have been able to see further, it is because I am surrounded by midgets. Never ascribe to stupidity that which can adequately be explained by malice. "Your argument's repugnant and intriguing." "That's kinda my thing." |
Danny's Weblog2008 Nov 26 [ Wed ]Irritating problem with German text in an old blog entryI originally set the text mode for this site to iso-8859. This character set allows standard German characters to be used, and I used them for instance for my article on Hesse's "Demian": [http://www.panix.com/~dannyw/weblog/Opinions/Society/coded01.html] However, when I moved to using Unicode throughout the site, this encoding turns out to be incompatible with Unicode, and as a result that page displayed badly. I noticed this a few days ago, and fixed it today. I considered putting in the Unicode characters for the German characters, but eventually decided to use the HTML "character entities" instead – the ampersand things. This is probably less than ideal, but it should continue to work if I go back to iso-8859, as well as working for people who don't have Unicode support. I can't think of an easy way to fix this automagically throughout the site, so I will probably hand-patch individual articles as I encounter them in random browsing. I suppose the way this should be handled is by setting text spans to be defined as non-English. In principle that would allow automated editing, as well as helping searches, etc. 2008 Nov 20 [ Thu ]How to recover from Khmer-keyboard-layout password promptI was fiddling around with some Khmer text today and while I was poring through a paper dictionary the screensaver kicked in. When I tried to enter the password prompt, Ubuntu still retained the Khmer keyboard layout setting, so my password didn't work. I suppose it's nice that the password prompt helpfully mentioned that the Kh keyboard layout was selected, but overall this behavior seems suboptimal. It would seem desirable to flip the password prompt back to the default keyboard layout, just like at startup: after all, it has to be possible to enter the password at startup, so it can hardly do any harm to switch out of the current keyboard layout. ...Hmm, that's true for a single-user machine but I suppose if you have a real multi-user server you need to grab the default setting *for that user*, so that Sophiap or Somchai or Dmitri can choose a password in their own language. Anyway, there is a workaround. The password prompt that you get after the screensaver kicks in does have an option for "Switch user". This leads you to a full login screen like at startup, which lets you switch the keyboard layout. You can log in as yourself – it tells you you're already logged in – and then you come back to the original desktop. Phew! To make things easier in future, you can go to System prefs - Keyboard - Layouts - Layout options - Layout switching and choose a key or combination which would allow you to flip the layout while you're at the screensaver password prompt. Indeed, a key was enabled in the default setting after I installed the layouts. However, I rapidly turned it off again because it was so irritating when I hit that key by mistake. Perhaps you feel different. 2008 Nov 18 [ Tue ]Fix for nautilus-actions problem in Ubuntu 8.04Nautilus is the file manager provided by default with the Gnome window manager in Ubuntu. It allows you to define an executable program to open a certain filetype with, but the normal install doesn't give you many options. However, you can install the nautilus-actions package, which is much more flexible. And it installs the action in the r-click menu for that filetype. The install process puts a link in System - Preferences - Nautilus actions configuration. It just didn't seem to work when I tried it. The action that I created in the GUI didn't show up in the r-click menu. There is some discussion on the ubuntu site about a bug which can be fixed by copying a directory, but that tip didn't help either. It turns out that Nautilus only seems to load the nautilus-actions code when it starts up for the first time, and apparently Nautilus leaves some code running even after you close its visible windows, so to force it to completely restart you need to enter "killall nautilus". Then when you open a new Nautilus window, it should load nautilus-actions, and also show in the relevant r-click menus whatever actions you have created. After you've done killall once you don't need to do it again: when you create a new action it shows up immediately... Correction! The entries show up in the r-click menu, but they don't do anything until you restart nautilus. Weird. 2008 Nov 15 [ Sat ]Interesting HTML/CSS trick for headingsA heading is of course a block-level element; in other words at the end of the block there is an automatic linefeed. However, you can get rid of that with CSS. And it made me think I might be able to create a heading which is both left and right justified. After some tinkering, I reached this example:
<pre> <h1 style="background-color: #11cccc;" >Uploads <div style="margin-top: -1.2em; text-align: right; ">2008-11-14-19-20-33 </div> </pre> I can't put it in my blog directly, but here's a little test page (including the later modification below): [http://www.panix.com/~dannyw/blosxom/data/test25567.html] It shows that the right-hand side of the heading is right justified, as you can see by adjusting the window width. Sadly, I have not figured out a way of preventing the left and right sides from overwriting each other if the window width is too small. There is a "min-width" property in CSS, but apparently it is not supported in Internet Explorer. ...Hmm, it kinda works in Firefox like this (this is the version in the link):
<h1 style="background-color: #11cccc; " >Uploads <div style="margin-top: -1.2em; text-align: right; min-width: 18em; ">2008-11-14 -19-20-33 </div> </h1> It's not very polished – in fact, as you can see from the fiddly little constants, it's a bit of a kludge. Still, I think it's interesting. I don't remember seeing layouts like this. ...Oops,
I guess you could fake the h1 element with a suitable div and css, although that would not work well on non-css browsers. Oh well. Nice file explaining Khmer Unicode and text entryI have a vague feeling I found the Cambodian-language version of this a couple of years ago and couldn't find an English-language version. Anyway here it is: [http://www.cambodia.org/fonts/KhmerUnicode_Keyboard_Layout.pdf] I found it via this page: [http://www.cambodia.org/fonts/] which is also well worth a shot. Now that I can actually read it instead of gloomily puzzling out an approximation of the meaning word by word, there is a lot of useful info, for instance the order you need to enter diacritics when they pile up. Maybe next time I will remember this instead of having to go by trial and error. 2008 Nov 13 [ Thu ] New procmail info at Panix, and SudokuAbout fifteen years ago I needed to set up a .procmailrc file, and it was a bit of a struggle; I think in the end I needed to beg someone to help. Procmail is software which allows you to set up a bunch of rules to handle email automatically; in the .procmailrc file you can define which emails are to be handled by what commands. Procmail can (and usually does) shell out to external programs like perl, so actions can be arbitrarily complex. For instance, panix provides a spam detector that works via procmail. A few years ago I moved to Panix, and then realized I needed to set up the .procmailrc again. I think at the time I didn't have access to a backup of the previous .procmailrc file, and anyway I needed to make it do something different, so it was another bunch of work. I think this time I managed to figure it out by myself, except for something about the spam handler itself. Today I wanted to add another feature to my .procmailrc. The span of time was long enough since my previous adventure that I had forgotten most of the (whimsical) syntax, but when I did a Google search one of the first things that popped up was the following page: [http://www.panix.com/help/mail.procmail.html] which as you can see is produced by panix itself. This page is really excellent. As well as explaining procmail, it actually gives the most detail about Panix's email software that I have ever seen. So it was quite straightforward to debug the change (eleven tries later – blush). It reminds me of something I soon realized about learning Unix commands: you don't really start understanding them until you've read through *all* the man pages at least once. Then, the next time you read *all* through them, you understand a bit more. Repeat. I realized today that this is analogous to Sudoku. In some sense, if a Sudoku grid is solvable, then you could start by solving the cell in the top-left corner, then solve the next on the right, and so on. However, doing it that way would be so difficult that probably nobody has ever done it that way. Instead, you check each cell in turn until you find one that is solvable by executing *relatively few* rules – ie the rules you have managed to figure out for yourself – and then move on. What particularly made me think of this is the issue of case sensitivity. Even now, I occasionally forget that Unix/Linux is case sensitive. But I've noticed that quite a lot of Unix info, even that obviously aimed at rank beginners, does not mention it, or similar issues. And I'm not really complaining. There just really is a lot of stuff you need to know before you start, and in some ways you need to know *everything* before you start. So the most efficient learning process has to be iterative, like solving a Sudoku puzzle. And I'm starting to think that it may be generally true for all learning, or at least all efficient learning. 2008 Nov 09 [ Sun ]Days of future past -- micronukesWhen I was a boy I was very struck by something Isaac Asimov wrote in the Foundation series. He contrasted the Imperial nuclear power plants, huge and requiring complex maintenance, with the tiny, foolproof atomic gadgets produced by the Foundation. I retained a sort of contempt for the nuclear power plant concept: quite separately from the contemporaneous ecology-movement opposition to nuclear power, I saw them as clumsy and inelegant. A discussion of the predictions in the Foundation series: [http://www.markbetz.net/2008/08/28/the-funny-things-about-foundation/] General discussion of atomic energy and science fiction: [http://www.depauw.edu/sfs/backissues/18/berger18art.htm] A fission reactor is indeed amazingly crude in its basic principles. You need a physics degree to actually design one so it doesn't blow up, but a child can be trained to run one. Unfortunately, practical nuclear plants involve a vast, depressing pyramid of grimy, low-tech industries to support the mineral refining, steam handling, and power distribution areas of the process. Of course, even in the fifties, people assumed that fusion power was only ten years away. Today, it is still ten years away. What I should have foreseen was miniaturization. Of course, modern electronics can handle many of the functions which used to require a team of technicians, especially if a design can be produced in large numbers so that edge conditions can easily be analyzed in detail. But also, the loss in economies of scale can be outweighed by reducing the power distribution problems: if your demand is so close that transmission loss is so low you don't need high-voltage transmission lines, you cut out installed costs and gain efficiency. Here's a link to a micronuke from Toshiba which irritatingly makes my own point about the Foundation series: [http://www.technovelgy.com/ct/Science-Fiction-News.asp?NewsNum=1363] Now there's a story in the Guardian about a similar development at Los Alamos which "plans to start mass production within five years": [http://www.guardian.co.uk/environment/2008/nov/09/miniature-nuclear-reactors-los-alamos]
Over the last fifty years I have several times awakened from dreams in which I discover that a nuke plant is about to blow up; I flee along crowded streets, unable to warn the victims because the plant operators have denied the problem and destroyed my credibility. Oddly enough, the nuke plants in my dreams were not sprawling industrial sites but more like office buildings. Perhaps my subconscious was thinking M I N I A T U R I Z A T I O N. 2008 Nov 08 [ Sat ]Some fixes to my HTML in this blogI have never felt too worried about the fact that my site is one of the 97% of sites which have validation errors: [http://validator.w3.org/check?uri=http%3A%2F%2Fwww.panix.com/~dannyw/weblog/] However, I do occasionally check the validation, to make sure that no gross errors have crept in which could cause an actual display problem. A few days ago, I installed the HTML Validator 0.8.5.2 extension to Firefox, and naturally tried it out first. I have tried to make the HTML compatible with XHTML as far as possible, despite the warnings, but I haven't actually changed the DOCTYPE yet. The major issue that it found was that sections of text which I had marked with "blockquote" tags were not nesting properly with "p" tags. I use "p" tags to wrap every paragraph of text, but the Perl code was wrapping around the open and close blockquote paragraphs. I use a hacked version of one of the Blosxom plugins, I think originally called Textrite; it makes it easier to compose postings by doing things like automatically creating links from urls. However, the way it detects and handles paragraphs is rather inflexible, and I've had numerous problems with it. In the end, I fixed the "blockquote" issue the same way I had done a couple of years ago for the "q" tag (which I had mistakenly keyed into a lot of postings as if it were a block-level element): I put in some code that fixed up the original postings before the plugin got to the paragraph processor. Currently the main page has 0 fatal errors. However, there are many pages which are built from older postings that still show various errors. The ones I have made a mental note to avoid in future are these: 1. I had inserted a lot of links that use the & character, particularly for Slashdot. This needs to be converted to a character entity like this: "&" or the validator will think that it's a broken entity (at least for XHTML) – or worse, a valid entity which messes up the representation. I had used a hand-rolled utility which converts the "<" and ">" arrows, but really I should have been more careful. You could try using the gnu "recode" utility (but it's not provided at Panix): [http://www.delorie.com/gnu/docs/recode/recode_49.html] These urls for some reason are often incorrectly converted into links, also. I need to rewrite the code that creates the links; I can't just blindly change the ampersands to entities in the text of the url, because that would break the generated links. (Or would it? Hmm.) 2. The original Textrite plugin converted a lot of text-style elements into markup, like a line of dashes used as a separator into a "<hr>". Sometimes this markup conflicted with the paragraph processor, and sometimes it was just wrong: it produced special characters which were not actually compatible with the browser character set, or which mistakenly triggered on Khmer Limon characters. I had eliminated most of it, but had left the "<hr>" till this week. 3. I had used "code" tags for a long time as if they were block-level elements, with some css to try to make them work. This never really worked properly, and causes conflicts with the paragraph processor. I just use "pre" now, but I should probably use "code" for inline code, although this may result in conflicts with the css for the old bad usage. 4. Email and usenet headers are full of characters which need to be converted to character entities before posting.
The Obama vote and electoral system designThe British media seem to be gushingly welcoming to Obama. But more significantly, all media sources seem to think that there was a major difference between Obama and McCain. Personally, I think they were Kang and Kodos. Link to Simpsons' "Treehouse of Horror" VII, segment "Citizen Kang": [http://en.wikipedia.org/wiki/Treehouse_of_Horror_VII] Yesterday I was thinking about why the two-party system is so entrenched, and how it might ideally be changed, and I came up with the following idea. I don't suppose it's novel, but I couldn't find a specific discussion of it on Wikipedia: [http://en.wikipedia.org/wiki/Electoral_system] Instead of having a multitude of small constituencies arranged by geography, each offering a choice of a handful of candidates only to local voters, every candidate could be voted for nationally by any voter in the country. At the end of the election, there would be no winners and losers: every candidate who received any votes at all would be entitled to a vote in the national assembly, in proportion to the number who elected him (similar to voting in trade union congresses). This system probably seems strange. But it's not very unlike the system in Israel, where all candidates are national. Although in Israel, voting is by party. Now I'm not such a mug as to believe that the current PTB would ever institute such a system, because it would not be in the interests of the PTB. But I think the results for the voters would be interesting. It would mean that candidates whose appeal was bland, designed to appeal slightly to many voters, would each wind up with a small share of the bland vote. But niche candidates, who appealed very strongly to a small fraction of the voters, would wind up with a strong position. In other words the individual voter would not have to feel forced to choose between Kang and Kodos, and would wind up with some representation in the assembly, even if his candidate did not form part of a majority bloc. And politicians would not feel under so much pressure to conform to the views of the lowest common denominator of the voters. I think it has a few other advantages, in that it does not require runoff votes, and is fairly simple to describe. The only big disadvantage that I can see is that the number of candidates would probably be far too big to fit on the voting form. You would probably need to write down a code number for your preferred candidate, like "161507", and then the tally would be somewhat more burdensome and less transparent. But I think it would still be much more practical than voting systems which require voters to rank candidates in order, or many other proposed systems. Oh well. I wonder if I should invest in a "Don't blame me, I voted for Kodos!" T-shirt. [http://www.cafepress.com/Voted4Kodos.67328372] 2008 Oct 28 [ Tue ]AMQP -- a standard for middlewareMicrosoft has plans to embrace AMQP, a middleware standard promoted by Red Hat among others. [http://linux.slashdot.org/linux/08/10/27/1948210.shtml] I have often vaguely thought about software to administer normal office operations: things like "receive A, wait for X, do task 275, send result to K35 if less than 1000 and to K11 if greater". Reading the above article I became aware that any real business operates with multiple large applications and needs to stitch them together. The problem is that if each app has to communicate with each other app by itself, then if management wants to make a change in a business procedure they have to reprogram every app involved in that procedure. I now see that designing the business with a middleware layer hugely reduces the complexity of changing a business procedure. The individual apps can be designed to handle and generate relatively standardized messages instead of having to incorporate your specialized business logic, so for instance you could install an updated package straight from the vendor and it would continue to work (at least in theory). All your company's wacky business logic would be contained in the middleware layer, and you could make major changes like adding a completely new app without needing to rewrite any of the software for the other apps: the middleware would re-route and re-format any messages as required. I apologize if this is old hat to everybody who knows what "middleware" means. Before this I had not grasped the complexity issue. 2008 Oct 23 [ Thu ]Where Argentina goes, Britain and the USA will followLast month, I mentioned that I have assumed for forty years that by the time the baby boomers reach retirement age their savings will be stolen:
[http://www.panix.com/~dannyw/weblog/Opinions/Politics/Miscellaneous/credit01.html] Here's an article in Money Week – not exactly Socialist Weekly – describing the latest situation in Argentina:
But it goes on to make the same point as I did:
[http://www.moneyweek.com/news-and-charts/economics/the-credit-crunch-claims-its-biggest-victim-argentina-13892.aspx] 2008 Oct 09 [ Thu ]What did Paulson know?I recently speculated Paulson must have had some kind of insider information to make a ten-billion-dollar short bet: [http://www.panix.com/~dannyw/weblog/Opinions/Politics/Miscellaneous/credit07.html] I don't think we'll ever know what it was. But perhaps the following is a part of the puzzle:
See story in Business Week (2006 May 23): [http://www.businessweek.com/bwdaily/dnflash/may2006/nf20060523_2210.htm?campaign_id=rss_daily] From original story: [http://www.propagandamatrix.com/articles/october2008/091008Negroponte.htm] Inappropriate TV adsOne of the few things which make me think that the financial institutions had no idea of the crash is that the TV ads are still showing the same commercials they were before the crash. I think TV advertisers have the option of pulling ads on an emergency basis, so apparently the financial institutions do want these ads to be shown. And of course they are ludicrously inappropriate for the current situation, in which the investor is mainly thinking about the stability of the institution. I'm not talking about the current Abbey/Santander ad particularly here; that's just a terrible ad which would have been blatantly contemptuous of the customer even in the balmiest of economic conditions. Or the current UBS ad, which blithers portentously about how important "U" and "US" are. I wonder if it was "conceptualized" by a European ad agency, full of people who did not know what "BS" means in English. I mean the whole market segment. Apparently the institutions need to maintain advertising to grab people who are switching, even though the ads they have are incredibly ill-suited in the current climate. The Bradford and Bingley ad, for instance (does B&B even exist any more?). Bonus payments for financial executives and the banking crisisFir many years it has been routine for companies to pay bonuses to executives for various achievements, such as high profits or rises in the company's share price. When the tax rules were changed so that dividends became less attractive to investors, and the basic "compensation" for executives became shares in their own company, these bonuses translated into a large incentive to maximize the company's share price. This looks like a good deal for shareholders, right? And indeed the only objections that were published in the mass media were to the scale of the bonuses. But there are several major problems with the bonus system. 1. Bonuses are paid for gains, but there is no punishment for losses. So there is a large incentive to gamble. 2. Bonuses are paid for *short-term* variations, but do not include any correction for the *long-term* results of policies. So the executive has no incentive to make an investment which would be a drag on the share price for years until it paid off. 3. There are some bets which are like "betting on favorites", in horse racing terms. They usually pay off, so the executive has a large incentive to play them. Occasionally, however, they result in a huge loss. I think it's easy to see that the result would *inevitably* be a huge incentive to make risky bets. On the other hand, in most companies the efect of such bets is fairly easy to gauge. If you are running a manufacturing plant, and you stop investing in new machinery, this is more or less noticeable, and investors who favor fundamental analysis (my own bias) will drag down the share price. But in the finance industry, there are no reality checks. You couldn't go and *visit* a bank's holding facility for toxic investments, and actually *see* a dank pit of sewage with a few tattered certificates floating on the top. And the banks were inventing new, more complex, more leveraged securities all the time. You need at least a business cycle or two to develop a rule of thumb, but they were inventing new financial instruments much faster than that. So that's why the problem first showed up in the financial industry. Unfortunately the financial industry's problems come from those toxic investments. And they are toxic in the *real* economy. Governments around the world are borrowing hundreds of billions of dollars to buy banks whose value depends on their ability to make a profit, which depends on the ability of *real* businesses to make a profit. And those businesses were drowning under crazy short-term gimcrack schemes *before* their customers start to pay the bill for the bank bailout. Oh well. The US Army has had plenty of experience in suppressing urban protest, and anybody in the army who would have refused to use torture against helpless prisoners has by now been identified and eliminated. So I suspect the new boss is going to be same as the old boss. 2008 Oct 08 [ Wed ]Recent change to css styles on "pre" blocksFor a long time I had been meaning to do something about the way I displayed programming code samples in the text. Ordinary text automatically wraps at the right margin. But you can't put programming code in that format: all the lines would get jumbled together, so the text would be impossible to read. So I put the programming code inside "pre" tags, but for some reason browsers then completely ignore the right margin, so long lines would spill embarrassingly across it. I couldn't find a fix for a long time but maybe my GoogleFu has improved, because about a week ago I put a fix in the css for my site. There's two aspects: 1. For screen display, browsers now support a horizontal scroll bar. That is, the "pre" text is displayed in a window with a scroll bar. The window always fits inside the rectangle available for it in the design, but you can move the scroll button to see all parts of the line. Here is the code:
pre { overflow: auto; }
2. For printed pages, you obviously can't use scrolling. I had already implemented a separate .css for print (in order not to waste paper with navigation elements) so this wasn't hard to include (in addition to any other settings for "pre").
pre {
overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
white-space: pre-wrap; /* css-3 */
white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
/* width: 99%; */
word-wrap: break-word; /* Internet Explorer 5.5+ */
}
Several sites have variations of this so I'm not sure to credit – it isn't mine. I experimented with ways to indent the continuation lines but couldn't make it work. So the printed output shows line breaks that aren't really there – but it least it shows the entire line. Debug: hittotal: 90 startban: 1 dancookie: endbandate: 2008-12-07 banned: 0 tempdate: 2008-12-05 tert: jse: jsno jsh: 90 |
||||