|
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/09/08 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 Weblog
2008 Sep 08 [ Mon ]
|
|||||||||||||||||
| សមាជិកព្រឹទ្ធសភាថៃ | Thai senators |
| មួយក្រុមដែល មានគ្នា ៧៧នាក់ | a group of 22 people |
| កាលពីថ្ងៃចន្ទបានចាប់ ផ្តើមដំណើរការបញ្ឈប់ | on Friday started progress in stopping |
| ការគាំទ្ររដ្ឋា ភិបាលថៃចំពោះសំណើរបស់រដ្ឋាភិបាល កម្ពុជា | support of the Thai government in relation to the [moment??] of the government of Cambodia |
| ដែលស្នើដាក់ប្រាសាទព្រះវិហារ | which proposes to put the temple of Preah Vihar |
| ចូលទៅក្នុងបញ្ជីបេតិកភណ្ឌពិភពលោក ។ | to enter the register [?] of belongings of the world [world heritage sites?] |
| កាសែតឌឹណេស្ហិនរបស់ថៃរាយការណ៍ | The newspaper "The Nation" of Thailand announced |
| ថាសមាជិកព្រឹទ្ធសភាទាំងនោះបាន | that these senators were able to... |
On Friday, a group of 22 senators in the Thai parliament began a bid to withdraw Thai government support for the Cambodian government's proposal that the temple of Preah Vihar should be registered as a World Heritage site. "The Nation", a Thai newspaper, reported that these senators were able to...
Incidentally, there are two newspapers called "The Nation" in Thailand. One is published in English; the name of the newspaper in the Khmer text is given in a phonetic form "der neyshun", so I'm assuming it's the English version that's being referred to.
Incidentally, this report seems to reflect the general attempt of the Thai and Cambodian governments and government-controlled media (ie practically all of it) to whip up tension between their citizens.
2008 Jul 01 [ Tue ]The description sounded interesting: Limon and similar non-Unicode ("USA International") fonts to Khmer Unicode and vice versa. I've written about the Limon issues before, eg here: [http://www.panix.com/~dannyw/weblog/Asia/Cambodia/Khmer-language/windowssetup01.html]
I had found khmerconverter while looking around in Ubuntu Synaptic Package Manager. I had installed it a couple of weeks ago, but I couldn't see where the installer had put the launcher and didn't bother proceeding. Today I happened to see the launcher (in Applications - Accessories) and tried it, but it appeared to do nothing.
I found the name of the executable in the launcher and was able to do "man khmerconverter", which helped by showing command-line options, but not enough (the spec for the formats is not clear). On the web I found: [http://www.khmeros.info/drupal/?q=en/download/converter] which suggested that the app had a gui wrapper.
After a while it occurred to me that I should try running the app from the console instead of the desktop. This revealed that it was complaining about the absence of the "tix" library for Tk. I found tix in Synaptic and installed it (no DVD necessary): clicking the launcher then brought up the gui. (It seems to me that if an app fails with an error message, the launcher, or the windowing environment, or something, should detect that and wait for you to read the error message instead of immediately closing the window. Oh well.)
Hmm. This is the first time I've seen where a Synaptics app has clearly failed to install a necessary package.
So how can you try it out? You can download Limon and ABC "legacy" fonts here: [http://www.everyday.com.kh/khmerfont/khmerfont.asp]
This page is also useful: [http://www.cambodia.org/fonts/] with eg "How to type Khmer Unicode", a PDF document, unfortunately in Khmer and without any keyboard layout diagram for people trying to use a non-Khmer-Unicode keyboard. (There may be some reference to such a thing, but I was barely able to puzzle out more than a few words here and there.)
After I had installed the fonts (by unzipping them to my /home/dannyw/.fonts folder), Firefox was able to view www.everyday.com.kh properly. When I checked the HTML source, it does indeed handle fonts in css, and the css specifies EOT fonts (ie the special downloadable font format for IE). So although Firefox can't handle those, it apparently knows it can default to the (newly-installed) TTF fonts by name. OTOH, the page layout was still all screwed up: all the text was scrunched into the right column. I was able to set Firefox to View - Page style - No style. This made it possible to select a block of several sentences of text from everyday.com, and I could copy it into OpenOffice.
Then I could save as an OpenOffice .odt file, which is apparently the native format for khmerconverter. The output looked OK as far as I could see, ie the glyphs appeared to match – I'm not claiming to be able to *edit* Khmer text!
So while I've hardly tested khmerconverter exhaustively, it does appear to be useful.
Here are some blocks of test text so you can judge the performance of khmerconverter (and check whether my page and your browser setup work together – in particular check whether your browser is set to override font specs – d'oh!)
Original Limon (only looks right if "Limon S1" font is installed on your system – I'm not bothering to set up an EOT font spec here):
smaCikRBwT§sPaéf mYyRkumEdl manKña 77nak;kalBIéf¶cnÞ)ancab; epþImdMeNIrkarbBaÄb; karKaMRTrdæa Pi)aléfcMeBaHsMeNIrbs;rdæaPi)al km<úCaEdlesñIdak;R)asaTRBHvihar cUleTAkñúgbBa¢IebtikPNÐBiPBelak .kaEstDweNsðinrbs;éfraykarN_ fasmaCikRBwT§sPaTaMgenaH)an
Unicode version (should display OK if *any* Unicode font on your system can handle the Khmer group of Unicode codes): សមាជិកព្រឹទ្ធសភាថៃ មួយក្រុមដែល មានគ្នា ៧៧នាក់កាលពីថ្ងៃចន្ទបានចាប់ ផ្តើមដំណើរការបញ្ឈប់ ការគាំទ្ររដ្ឋា ភិបាលថៃចំពោះសំណើរបស់រដ្ឋាភិបាល កម្ពុជាដែលស្នើដាក់ប្រាសាទព្រះវិហារ ចូលទៅក្នុងបញ្ជីបេតិកភណ្ឌពិភពលោក ។កាសែតឌឹណេស្ហិនរបស់ថៃរាយការណ៍ ថាសមាជិកព្រឹទ្ធសភាទាំងនោះបាន
PKD example (just so you can see if you have PKD installed – I was too lazy to figure out the phonetcs for the whole of the above text): kNom At dIG te
2008 Jun 27 [ Fri ]This is free software for many Canon digital cameras: [http://chdk.wikia.com/wiki/CHDK_for_Dummies]
It only installs till the batteries are removed, so it's safe to play with.
This is my experiences with installing it under Ubuntu Linux 7.1. Most, but not all, this info is from the CHDK website.
The docs say you need to check the firmware rev of the factory firmware in order to choose the correct download. I was able to get my original firmware rev by putting an empty file called "vers.req" in the root dir of the SD memory card. I had also to delete all photos/movies on the card, as otherwise when you put it in the camera it just shows you the media when you press FUNC SET. Press and hold FUNC SET, and press DISP. The first time, it shows you the version for a few seconds. If you immediately press FUNC SET again once, it shows something else. If you press it again, it shows the picture count, although for me it displayed only 223 - way too low.
Then I formatted the memory card in the camera. (I'm not sure that's really necessary but the web info told me to do it.) Then the general guide info to CHDK suggests using a special Windows utility to make the memory card bootable. The following guide includes Linux info so you can use hexedit to set a bootable flag: [http://chdk.wikia.com/wiki/A560] as part of the setup info for an A560 (but it seems to be valid for my A630 and presumably others).
Then I plugged in the SD card using a USB adapter. Ubuntu, and presumably all other modern Linux distributions, will mount a USB SD adapter automagically, but you don't want the SD card to be mounted while you're setting the bootable flag. The web info suggests using umount /dev/sdb1 (you can check if that device name is the same on your box by running dmesg), but this did not work for me: umount complained that /dev/sdb1 was not in /etc/fstab. The same thing happened for /media/drive. However, r-clicking on the drive icon and selecting unmount worked.
I was then able to run hexedit (at least after doing apt-get – it went fast). Unfortunately hexedit expects to use various keys like F1 which are grabbed by Gnome Terminal. I was able to turn them off with gterm Edit - Current profile. Then I was able to use F1 to get help on hexedit commands like Tab (to swap hex and text entry modes).
Then I downloaded the zip file containing the new firmware (two files). The CHDK site: [http://chdk.wikia.com/wiki/Downloads] has links to various different "builds" with different features. The download I actually got was the "allbest". It turned out there was only one version for the A630, ie the original firmware version is irrelevant. The download location is [http://grandag.nm.ru/hdk/autobuild/download.htm] (this is the latest, somewhat experimental version; you may prefer a more conservative one).
The main setup page does not specify where to put the two files, but I presumed the root dir. I unplugged the SD adapter and plugged it back in (so that Ubuntu would automagically remount it), and copied the files over.
I unmounted the adapter and unplugged it, pulled out the SD card, set the write switch to protected (write disabled) per the notes, and put it back in the camera. Then you enable the software just by turning on the camera. It starts up with a splash screen: it then shows a little rectangular area at the bottom left. You can then access most of the setups by pressing what the docs call the "Alt" key, ie the one at the top R of the "Func Set" button with a picture of a printer next to it, and then the MENU button.
Result: it works! There are indeed a bazillion features. However, I'm not sure how useful it is. The menu access is a little clumsy, it interferes in some ways with access to normal features, and it caused at least one lockup in a few minutes playing. However, it does provide one feature I desperately wanted: a battery status display. Apparently the camera has an actual voltage sensor: all you need to do is specify the voltage levels you consider as 0% and 100% (if you aren't happy with the default). I had no idea the camera had the hardware to do this. (OTOH, I just noticed that the battery level seems to go up as well as down... hmm.)
Another handy feature is to enable optical zoom during video recording. When you do so, it mutes (if you want) the microphone to avoid picking up the whir of the zoom mechanism. It refocuses after the zoom.
You can also download and run scripts, although I haven't tried that yet.
Other builds have extra features like remote control via the usb port.
2008 Jun 26 [ Thu ]
I wondered what the result is of providing UTF-8 bytes inside a webpage defined as iso-8859-en. It turns out that the browser, at least Firefox, believes the 8859 and displays the Cambodian as junk. So I've changed my meta charset spec to UTF-8 and it seems to work (even though vi at panix is showing the UTF-8 characters as a bunch of hex escape codes).
រីករាយណាស់ដែលបានជួបអ្នកទាំងអស់គ្នា ។
If the above shows as a bunch of junk for you, you presumably don't have a font available which handles those Unicode character codes. I haven't yet set up a font spec to try and let your browser know which font to try.
suə'sdəy
riik 'riɜy nah dail bɑɑn 'juəp 'neək ti'aɳ ɑh kniə
I should probably put in an example of my own PKD font as well, but as nobody has reported using it I feel too lazy.
2008 Jun 16 [ Mon ]
One of the reasons the perl programming language is so great is that there is a huge variety of modules avilable that you can use to add functionality. The CPAN site (http://search.cpan.org) has thousands. But installing them manually can be so clumsy and error-prone that I've found it easier to write my own code.
I had been aware for *years* that the best way to install modules was by using the CPAN module itself. But each time I tried to set it up at previous hosts or panix, I failed. (It works much easier when you are root, eg on my own Linux boxes.)
This time I seem to have succeeded. ("Danny, 1995 called and wants its issues back.")
Apparently the CPAN module *itself* was installed at panix, so I didn't have to do the whole "make install" thing on CPAN itself. However, the first time I tried running CPAN with something like
perl -MCPAN -e 'install Archie'
it apparently recognized that I didn't have any configuration defined and started asking me a bunch of questions that I didn't really know how to answer. But I knew that the *defaults* for CPAN would be to install to *system-wide* directories which I didn't have write access to. I tried using the "PREFIX" switch for the directories, but it didn't quite work. It looked like the ftp get was failing to bring in the source file, perhaps because of an error reported about "MD5 security checks". (Later I realized that impression was false – that message always appears.)
Incidentally, it's good to use a module like Archie as a test when you're setting up CPAN, because you don't want to mess up the links to a module you actually *need*. You can check whether a module is already installed (assuming your general perl setup has not been screwed up in the meantime!) like this:
perl -MArchie -e 1
which will silently succeed or produce an error message if Archie is not available.
Another irritating issue was that the CPAN setup script presents you with a ginormous list of possible mirrors, and the way to navigate and select them is not obvious. Apparently the list is fed to you via the "more" utility. Here are the tricks: when you get to the list, just press space to get another screenful, and repeat enough times to get to the end. Then you can enter one of the mirror addresses. I'm not sure how to add more than one – I wouldn't bother at this point.
Having licked my wounds overnight, I tried again this morning.
The following webpage would probably be a good guide for most people: [http://www.dcc.fc.up.pt/~pbrandao/aulas/0203/AR/modules_inst_cpan.html]
However, actually what I did was manually edit the ~/.cpan/CPAN/MyConfig.pm setup file that had been produced yesterday. This is what I ended up with:
> cat .cpan/CPAN/MyConfig.pm
$CPAN::Config = {
'build_cache' => q[10],
'build_dir' => q[/home/1/dannyw/.cpan/build],
'cpan_home' => q[/home/1/dannyw/.cpan],
'ftp' => q[/usr/bin/ftp],
'ftp_proxy' => q[],
'getcwd' => q[cwd],
'gzip' => q[/usr/bin/gzip],
'http_proxy' => q[],
'inactivity_timeout' => q[0],
'index_expire' => q[1],
'inhibit_startup_message' => q[0],
'keep_source_where' => q[/home/1/dannyw/.cpan/sources],
'lynx' => q[/usr/local/bin/lynx],
'make' => q[/usr/bin/make],
'make_arg' => q[],
'make_install_arg' => q[/home/1/dannyw/myperllib],
'makepl_arg' => q[PREFIX=~/perl5lib/ \_
LIB=~/perl5lib/lib INSTALLMAN1DIR=~/perl5lib/man1 \_
INSTALLMAN3DIR=~/perl5lib/man3],
'ncftp' => q[/usr/local/bin/ncftp],
'no_proxy' => q[],
'pager' => q[/usr/bin/less],
'shell' => q[/usr/local/bin/tcsh],
'tar' => q[/usr/bin/tar],
'unzip' => q[/usr/local/bin/unzip],
'urllist' => [q[ftp://mirror.nyi.net/CPAN/], \_
q[ftp://ftp.wayne.edu/cpan/]],
'wait_list' => [q[wait://ls6.informatik.uni-dortmund.de:1404]],
};
1;
__END__
Note the following:
1. Info on the web suggested that the "~" should work in this file, and I did use it for the "make5pl_arg", but in general, I used a fully qualified path for the home directory.
2. Web info suggested creating the .cpan etc folders manually first, but I guess running the initial CPAN setup script had done that for me
3. The install script probably also guessed the correct locations for the executables like 'pager' for me. I did verify every one manually (with eg "whereis less").
4. It wasn't obvious what syntax to use to allow multiple urls in the urllist, but I guessed right the first time.
5. The INSTALLMAN1DIR value looks like it would break something, but apparently didn't. Maybe it's not essential, because I don't know how it could work.
Now I could run "perl -MCPAN -e 'install Archie' and it seemed to be OK. But I had not fixed the path for modules in my shell, so trying "perl -MArchie -e 1" failed.
The web info provides the following examples for the bash shell:
export PERL5LIB=${PERL5LIB}:~/perl5lib
export MANPATH=~/perl5lib
I am running tcsh, so I knew I had to make some changes to that. But this is the output of the "setenv" command that works:
PERL5LIB=~/perl5lib/lib
having used eg "setenv PERL5LIB perl5lib/lib". This is what I needed in the .tcshrc file:
setenv PERL5LIB ~dannyw/perl5lib/lib
Remember that you can use "source .tcshrc" to run the commands in that file again without having to log out and back in – although some commands may have unwanted results, for example if you append a directory to a path repeatedly.
Note that my version has an extra "/lib" on the end. It didn't work without it. I don't know why the web example apparently did work for them without it.
Incidentally, the default perl at panix is indeed perl5:
This is perl, version 5.005_02 built for i386-netbsd
I don't know what to do if you're running perl4 or 6 (is anybody?)
I'm not sure why the web example tried to bring in an existing value for PERL5LIB. There wasn't one when I checked (perhaps too late) and running eg "perl -MCGI -e 1" still works. – Later: according to this website:
[http://www.perl.com/doc/manual/html/pod/perlrun.html]
the PERL5LIB variable is
A colon-separated list of directories in which to look for Perl library files before looking in the standard library and the current directory.so it seems to be a *user-defined* variable, so it is normally empty and it doesn't smash any existing definition if I just set it directly as above. Maybe the bash shell doesn't complain like tcsh if the variable is empty when you try to append to it. – Confirmed.
The MANPATH thing just doesn't work for me at all. Doing "perldoc Archie" works fine without it. Trying to append to MANPATH causes an error message. And if I set MANPATH without appending to the existing value, it makes "man bash" (or anything else) fail.
Some webpages say you need to do this: setenv MANPATH $HOME/perl5lib:${MANPATH} but that failed too. The really funny thing is that $MANPATH doesn't seem to be set to anything in the set or setenv lists, but setting it to something seems to screw up "man". I guess setting $MANPATH *completely overrides* the path set up in man.conf.
When I checked, the default search path for man set in /etc/man.conf seems to be really long and complicated. I couldn't see an easy way to get the current value for it into the environment variable. However it turns out that there's a "-m" switch to man which *adds* a search path to the existing (invisible) path, so I put the following line in .tcshrc:
alias man "man -m ~/perl5lib"
and it worked fine, ie both "man Archie" and "man bash" worked.
Now I have to actually try it with a module I need! Maybe I'll write that up later. If you have been following along and want to try it yourself, remember that cgi programs don't get your path from your user environment, so they will need something like
push(@INC, "/usr/lib/bliv/");
as I discuss in an old posting:
[http://www.panix.com/~dannyw/weblog/Computers/Programming/Perl/perltip01.html]
I had started to notice one report after another of dead or missing police officers. I was surprised to see no speculation about possible reasons for this string of deaths. I noticed in the London Times (2008-03-14 p9) the following summary:
Mr Munro's death follows the apparent suicides of Police Sergeant Richard Fuller, 55, in Calne, Wiltshire, and Michael Todd, 50, the Chief Constable of Greater Manchester.
plus this interesting statement:
Dewi Pritchard-Jones, the North Wales Coroner, took the unusual step of calling medical evidence at the opening of the inquest [on Chief Constable Michael Todd] in Llangefni, Anglesey, in order to dispel "suspicions and fears" about the "ridiculous" stories circulating in recent days.
If I was circulating any "ridiculous" stories, I think I would start with the interesting way Todd's cellphone signal led searchers to a location miles away from where he was found. Did his killers not realize that cellphone companies can monitor user's locations? Or did they deliberately lead rescuers away from where he was eventually found, rendered unconscious and left in freezing 80 mph winds without a jacket? Perhaps it was just essential to provide a pretext of suicide as fast as possible, so they used his cellphone to send text messages ostensibly from Todd, although the cellphone conveniently doesn't leave any evidence of who actually punched the messages in... while the person who sent the messages was miles away from Todd's dying body.
But what could lead HMG to kill *several* police officers at once? Perhaps it's like Waco, where most of the LEOs found dead had served as Clinton's personal bodyguards. What element of their past links them together?
Hmmm... also, that kind of thing would have been planned and set up in advance. Why were the killers in such a desperate, slipshod hurry?
From a Times Online article:
A Whitehall source said that Mr Todd's death had nothing to do with his work but was related to his personal life.
Well, he would, wouldn't he? The government also seems to be pushing the line that the real reason for Todd's murder is that he had led an investigation into the CIA rendition flights via British territory, but this seems implausible to me: HMG has been caught red-handed on much worse and the running-dog media just keeps shovelling the government's spin. And it doesn't explain the other two deaths.
This is not the most complex stuff I've done in Excel but it is all my own code and does something which I think is generally useful, so I thought I'd list it.
It's intended to be linked to a right-click; I leave that out as an exercise for the reader... especially as I now realize that I wrote the code for that part incredibly badly, although it does work. Hint: there is a parameter for this: application.CommandBars("Cell").Controls.add which prevents an option being added multiple times. See one of the books (I forget which) in my post: [http://www.panix.com/~dannyw/weblog/Computers/Programming/Excel/books01.html]
It's intended to make it easier to enter data in a typical Excel table where the same values recur multiple times. For instance, if you are entering vehicle expenses in a company garage, you probably need to enter the expenses for each car multiple times with the same info so that you can easily sort the data with a pivot table. With this sub, you can just leave a blank for repeating fields, and when you're ready you can just right-click on the table and select the sub, and a value will fill down into all the empty cells below it for each record and field. In many cases it will halve the entry time and cut out a lot of errors as well (ie ensure that each repeated value is identical).
Sub filldown()
' dW 2007-12-20 Loops through a range
' if a cell is blank, copy from previous row
' (we hope)
Dim cellnum, cellrow, cellcolumn, rowcount, columncount As Long
If TypeName(Selection) <> "Range" Then
Beep
MsgBox "This command requires a cell/range to be selected."
Exit Sub
End If
If Selection.Areas.Count > 1 Then
Beep
MsgBox "This command only works on a single range."
Exit Sub
End If
rowcount = Selection.Rows.Count
' You can't fill down if less than 2 rows
If rowcount < 2 Then
Exit Sub
End If
'
columncount = Selection.Columns.Count
' MsgBox ("Rows = " & rowcount & " Columns= " & columncount)
'
cellnum = 0
For Each cell In Selection
cellnum = cellnum + 1
' The \ operator does integer division
' First row is row 0
cellrow = (cellnum - 1) \ columncount
' Don't do anything on first row
If cellrow > 0 Then
cellcolumn = (cellnum - 1) Mod columncount
' MsgBox ("Cell: " & cellnum & "Row: " & cellrow & " Col: " & cellcolumn)
' I seem to have defined cell locations starting at 0,
' but Excel has cell x,y starting at 1,1.
' Need to handle cells with formulas separately
If cell.Value = "" Then
If Selection.Cells(cellrow, cellcolumn + 1).HasFormula Then
cell.Formula = Selection.Cells(cellrow, cellcolumn + 1).Formula
Else
cell.Value = Selection.Cells(cellrow, cellcolumn + 1).Value
End If
End If
End If
Next cell
End Sub
When you play with this, remember that Excel resets the undo stack every time you run a macro. If someone wants to fix this code so that it implements its own undo feature, that would be cool.
I vaguely remember reading an analysis of 1984 which suggested that Orwell thought that his world in 1948 actually *was* the world of 1984; he only set the novel in the future, with a few irrelevant sf touches like the telescreens and the names of countries, in order to get it published.
Unfortunately I couldn't find that idea in a casual web search. Indeed, one of the first webpages I found was so collossally badly written that I wondered how it could possibly have acquired pagerank: [http://studentweb.tulane.edu/~jgray1/]
This is much better, though tendentious: [http://findarticles.com/p/articles/mi_m1571/is_49_17/ai_81790763]
As usual the Wikipedia entry is valuable: [http://en.wikipedia.org/wiki/Nineteen_Eighty-Four] although it does not address my point.
My previous article re Orwell and Big Brother: [http://www.panix.com/~dannyw/weblog/Opinions/Politics/Miscellaneous/bigbrother01.html]
I have been thinking about this issue because for several years I have been reconsidering my entire worldview and tearing away successive layers of belief about historical events. Having come to believe that the British and US governments created the wars in Iraq and Afghanistan for their own purposes, I found it easy to see what HMG gained from the war in Ulster, and so forth.
In particular, 1984 shows scenes of grinding poverty which are more similar to the grim conditions of Britain in 1948 than the Ipods and holidays in Ibiza which we see around us. But what was Orwell actually saying? The Wikipedia article shows that in the world of the novel, the government ("inner party") deliberately kept the people in poverty:
The point of continuous warfare is to be rid of the surplus of industrial production to prevent the rise of the standard of living and make possible the economic repression of people.
I have been feeling more and more keenly that living standards for most people have hardly risen over my lifetime. It's true we have mobile phones and widescreen tvs, but many more important things – job security, public transport, access to medical care – have become much less satisfactory. And yet technological advances have taken place. Productivity has been steadily rising for fifty years; why are we still working 40-hour weeks? More people own their own homes now, but their homes' rise in value is at the expense of their own children. Do people realize that? That they are taking those holidays in Ibiza by refinancing a debt which is being imposed on their children?
So I believe Orwell's analysis was valid for 1948, and 1984, and 2008.
I haven't looked at PHP for years and needed to read through Sams' "Teach yourself PHP in 24 hours" recently.
Here are some basic tips for setting things up:
1. Assuming your Apache server allows you to use .htaccess files, you can set a bunch of useful stuff here, eg:
AddType application/x-httpd-php .php
For instance, if most of your site is real .html files but you want to put .php files in a certain folder, you can put an .htaccess file in that folder that tells Apache to run the php interpreter on .html files in that folder:
AddType application/x-httpd-php .html
(You don't want to do that in your root folder because it would waste time running the php interpreter on all the ordinary html files.)
2. The phpinfo() command inside php of course produces a nicely-formatted html file with all the setup information for php, and you need to look at it. In particular, you want to check which php version you have and what modules are loaded (irritatingly Panix has a rather old version with few modules compiled in).
Also, it's good to check the "config-file-path". This (assuming you have shell access) allows you to find the actual php.ini file to check any items not shown by the phpinfo() command.
3. If you don't control the server, you can still set php setup variables inside .htaccess. You use the "php_flag" directive to set a php variable and the php_value directive to set a php.ini variable to a value, eg:
php_flag short_open_tag On
php_value include_path ".:/home/corrdev"
4. Even if you can't use .htaccess files, as of php 4.0.5 you can set some .ini values within php pre itself, eg:
ini_set( "include_path", ".:/home/corrdev" );
5. Don't forget the main php website, eg:
[http://www.php.net/manual]
6. Here's the entire contents of a file you can save as test.php:
<?php phpinfo(); ?>
(I know putting that here makes me look like not the greatest programmer in the world, but every time I start looking at php again I find myself having to work out the basics of the syntax all over again.)
7. Here's some code which looks simple – ok, it is simple – but I find myself wondering whether it will work every time I start playing with php again (this is basically from the book's Listing 5.14 Returning to HTML Mode within a pre block):
<?php
$display_prices= true;
if ( $display_prices ) {
?>
<p>Interesting stuff to show in this case</p>
<?php
}
?>
I don't know about you, but if I had to figure out that syntax from scratch it would take a while.
2008 Feb 02 [ Sat ]
The following link explains in amusing detail just how unexceptional the Societe Generale trader M. Kerviel is in his skills, or indeed modus operandi: [http://www.theregister.co.uk/2008/01/31/kerviel/]
From what little I know about the situation in such companies, the article is not misleading.
2008 Jan 29 [ Tue ]Recently I've had to use Excel quite a lot. I used to be quite snooty about it (although I recognized that – after SQL Server – it was Microsoft's most respectable product). Now, having gotten into VBA programming, I have to admit you get a rather solid development environment.
Anyhow, I wanted to put in links to a couple of books I can recommend:
1. Excel 2007 VBA Programmming for Dummies - John Walkenbach
I actually read his version for Excel 2000 first. The two books are much the same. I had a feeling that he caught some errors in the new version, or maybe I just understood stuff more the second time through (I was unable to compare them except by memory).
I don't think Walkenbach ever did a version of this book for 2003. I don't think there was much difference between Excel 2000 and 2003, but there are a lot of changes in 2007 for the new menu ("commandbar") structure. And the 2007 book *only* documents the 2007 code - people expecting the book to be backwards-compatible with 2003 are going to be very disappointed.
But in general, I found the book quite ueseful.
Walkenbach recommends this "blog": [http://www.dailydoesofexcel.com/]
He also recommends reading Microsoft's own newsgroups via Google. Search Google Groups for microsoft.public.excel.programming, as well as several others under microsoft.public.excel.
2. The Absolute Beginner's Guide to VBA
The advantage of this book is it explains how to run multiple Office apps using VBA: for instance, to read your Outlook mailbox (or at least the header fields and a smidgen of the text) into Excel.
Also, it does show various useful examples in non-Excel apps, and I may need to take a shot at Word VBA sometime.
Incidentally, I rather wish the titles of these books weren't so embarrassing. Don't bring them to your client site! I've actually done some fairly complex stuff with Excel, and if clients ever see this blog they'll get the wrong idea. Hmm, then again if they see some of my other posts my goose is cooked anyhow!
Debug: hittotal: 36 startban: 0 dancookie: endbandate: banned: 0 tempdate: tert: jse: jsno jsh: 36