perl win32 OLE arcana: 1

An obscure problem encountered while trying to set the cell background color in Excel:

$sheet->Range("q2q6")->Interior->{ColorIndex} =8;

returns the following message: OLE (0.1709) ERROR 0X800a03ec METHOD/PROPERTYGET “Range” at blahblah

A search turned up several long discussions that were ultimately totally irrelevant. The problem is that you can’t set color using this kind of range with this method; if you use this method, you have to do it a cell at a time:

foreach my $y (2..6) {
my $range = 'q' . $y;
$sheet->Range($range)->Interior->{ColorIndex} =8;
}

Posted in Programming | Comments Off on perl win32 OLE arcana: 1

Moving references from Zotero to Endnote: Part I

See the updated version of this post

Software to manage research references can be very useful indeed, and I’ve spent a lot of time using it to organize my references. Currently my two main programs are Zotero, an open source project, sponsored by George Mason University, and Endnote, the most widely used commercial program, published by Thomson Reuters.

There are many functions and options available in Endnote that are not available in Zotero, and also vice versa, so I want to be able to move my references back and forth between them. It is still not possible to do this completely, but there are ways to simplify the task.

One of the most annoying problems has been the difficulty of correctly importing pdf file links from Zotero references into Endnote references. Both programs allow you to put links to pdf files into your references, but there is a catch. When I export my Zotero references into .ris export format, I have to choose whether or not to export files. If I choose this, Zotero will physically copy all the linked files to the folder where the .ris export file is saved, copying them as slowly as possible, sometimes taking over half an hour for just a hundred references! What makes this doubly infuriating is that it is completely unnecessary, because I only need the link, not the file. And even after all this, it will still require hand editing to get the links imported into Endnote to conform to my pdf folder structure.

This is an incredibly annoying problem, but it can be easily resolved with just two keystrokes. Go to the “translators” folder of your zotero installation and use a text editor to open the file RIS.js Search for the following line:

att[j].saveFile(att[j].defaultPath);

comment this line out by adding two slashes in front of it:

//att[j].saveFile(att[j].defaultPath);

Now try to export some references. Zotero will still ask whether you want to export files; check the box, and Zotero will write ONLY an .ris file, with a CORRECT link to the location where the pdf files are really stored, eliminating the horribly slow copying, and the error prone hand editing problems that the old method produced. This means Zotero and Endnote can now share the same pdf files and folders, and you can move your references back and forth between the two programs without messing up the links to the files.

Posted in Research methods, Software | Comments Off on Moving references from Zotero to Endnote: Part I

Alice Munro wins Nobel Prize for Literature

Here is the story on BBC.

This was a surprising award; with the possible exception of Isaac Bashevis Singer, this is the first time someone who writes primarily short stories has won the Nobel Prize for literature. Even Singer is debatable; his bibliography lists around 20 novels, its just that a lot of people (like me) have said his short stories are his best work.

But Alice Munro (艾莉絲‧孟若) has written almost nothing but short stories. Her one novel, The Lives of Girls and Women, is basically seven or eight short stories held together by a common narrator and location, and is by no means her most popular or critically acclaimed work. In any case, the Nobel committee’s award specifically cites her as “master of the contemporary short story”, and that’s a description that has never been used before for a Nobel literature laureate.

I predict that this will be a very popular choice, simply because Munro is a very popular writer. She’s my favorite living short story writer, for sure. Unfortunately, the literature translation market being what it is in Taiwan (and China), she is very poorly represented in Chinese at the moment; short story collections are hardly ever translated because they sell so poorly. This is true in English, as Munro has often ruefully observered, and triply true in Taiwan and China. To my knowledge, the only one of Munro’s books available in Chinese is Hateship, Friendship, Courtship, Loveship, Marriage, translated as Ganqing youxi 感情遊戲 by Chang Jang 張讓, and published by China Times Publishing in 2003. Oh, there is also a partial translation of “The Lives of Girls and Women” by Lan Ya-chieh (藍雅婕), done as part of her MA thesis on Munro (Chi Nan University Dept. of Foreign Languages and Literature, 2004); this is currently the only thesis that has been done on Munro in Taiwan.

Posted in Literature, Translation | Comments Off on Alice Munro wins Nobel Prize for Literature

A belated hello to my students for the new semester

Hello to all my students,

It’s the beginning of another really big semester, and I’m late starting, as usual. I’m teaching fewer classes than usual this semester, working on a rather large project, but for the classes I am teaching, I’ve had fun meeting you in the last two weeks. The Moodle software has gone through another version, so I’m still learning the latest kinks, please excuse any delays in postings, etc. If you have any questions, drop me a line via moodle or my school email. And a special hello to the lucky people who won the big lottery and got me as advisor. We’ll get together later this month!

Posted in School | Comments Off on A belated hello to my students for the new semester

The remains of the semester

Another semester is over, with grades in and a summer of writing to look forward to. To my students, congratulations to the many who passed, condolences to the few who didn’t, and remember: tomorrow is another day!

Posted in School | Comments Off on The remains of the semester

Another (*&%&*^%R* Earthquake!

A 6.3 earthquake this afternoon. Supposedly only 5.0 in Puli, but one of the strongest and longest I’ve felt in a long time. Bookshelves down again, *&^%&!@$#!! This time both at home and in my office AGAIN, the second time this semester. Trying to remember how many times I’ve had damn earthquakes knock my bookshelves down since I moved to the Big Rumble; seems like it must be somewhere around a dozen. Jeez.

Posted in Quotidiana | Comments Off on Another (*&%&*^%R* Earthquake!

Ironic twist

In literature classes, one of the most difficult things to explain to Chinese speaking students is the difference between “irony”, “satire”, and “sarcasm.” Apparently distinguishing these is not always easy even for native speakers, but on the Chinese side, virtually every English-Chinese dictionary translates these as one thing: 諷刺. Yet the differences are vast.

This came back to me very sharply when my fiction class this semester read the stories “Gift of the Magi” and “The Diamond Necklace”; my question for the reading response began: “These two stories are both ‘ironic’ as we discussed in class…” One student’s response was 這兩個故事說不上是諷刺。比較像是 surprise ending,就是會覺得解果怎麼會是這樣,滿意外的…鑽石項鍊比較偏向諷刺,但是智者的禮物反而沒有諷刺的感覺,覺得有點可愛,好笑.

Naturally the student gets full credit for not cravenly surrendering her reasoning powers to the teacher, but as I said in my comments on the homework: “I said ironic, not 諷刺.” This is what “failure to communicate” really looks like.

Afterthought: Actually, now I’m wondering whether I got this wrong. Is the Gift of the Magi not ironic? We can at least say that, even though Jim and Della’s gifts to each other were useless in the end, they were not totally in vain. The gifts they chose revealed how much they cared for each other, and Jim, for one, took consolation in this. In “The Diamond Necklace”, however, the revelation of the necklace’s true value at the end destroys whatever consolation Mathilde has found. Does this make it more ironic?

In fact, even “The Diamond Necklace” was not ironic to some students, just silly: “Why didn’t Mathilde just tell Madame Forestier the necklace was lost instead of wasting ten years?” Good point. [That’s sarcastic, guys.]

Posted in Literature, Translation | Comments Off on Ironic twist

Push comes to shove

Have finally thrown up my hands and begun to prepare my home desktop computer for Windows 7, and like all donkeys I’m doing it because of the carrot and the stick. The stick is the fact that our school’s computers, including the ones used as projectors in class, and the laptops I sometimes have to borrow, are now all running Windows 7, and I regularly embarrass myself by trying to figure out how to do things like eject my usb drive, or search the hard disk.

The carrot is that Windows 7 is supposed to provide support for Unicode 3.0, or whatever the latest and greatest is. It’s just too inconvenient without the Unified Canadian Aboriginal Syllabics code block, this is something I really need. Just kidding. What I really want are the CJK Unified Ideographs extensions, which requires Unicode 6.0 or better. Got my fingers crossed on this one.

Posted in Software | Comments Off on Push comes to shove

Fun with Google translate

Excerpt from a recent English Chinese translation homework assignment:

The size of a single sheet of papyrus was not constant in ancient times. For most non-literary documents (letters, accounts, receipts, etc.) a single sheet was sufficient; for longer texts, especially literary ones, sheets were stuck together and made into a roll. Rolls have been found measuring as much as 45 yards long. It was usual to write on only one side. Writing on both sides of the sheets of a papyrus roll is quite rare, probably because the delicate material can be torn so easily.

I regularly check assignments against Google translate and the result this time was especially entertaining:

紙莎草紙的單頁的大小是不恆定在古代。對於大多數非文學文檔(信件,帳目,收據等)在一張紙上就足夠了;對於較長的文本,尤其是文學的,片材粘貼在一起而製成的輥。羅爾斯已發現測量多達45碼長。這是平常只在一側寫。寫在紙莎草卷的紙張的兩面是相當罕見的,可能是因為精緻的材料可以如此輕易地撕開。

I especially like the 45 yard long Rolls Royce.

Posted in Translation | Comments Off on Fun with Google translate

Congratulations to Lydia!

My MA student Lydia Lin successfully completed her thesis defense on Friday (4/26); good job! Now to get those revisions in.

Posted in School | Comments Off on Congratulations to Lydia!