Archive for November, 2011

html2mht.pl and dir2html.pl

November 26, 2011

I have been working on 2 piece of perl scripts that convert a whole directory / a whole bunch of (inter-connected) .html files into a single page .mht file.

You can get the source code at html2mht.pl and dir2html.pl.

Here’s a small weird thing (aka, bug) I found out about .mht file, ancher does not work in .mht.

More specifically, for e.g., IE does not work when a index.html in a .mht contains a link pointing to chap1.html#sec1, which are also in the same .mht file.

Weird enough, firefox with the unmht plugin works fine with the above situation.

For the html2mht.pl, I must thank the html2mht project on sourceforge.

Advertisements

beagrep under win32

November 26, 2011

I have ported beagrep under win32.

I have not made it fit into the configure/make/make install 3-step thing yet, but am very close to that. I will probably do it when I need to do it on another PC…

git clone git://github.com/baohaojun/beagrep.git -b windows

Using dvp under Win32

November 26, 2011

In a previous blog I posted, I mentioned I was using dvp under Win32 with a custom AutoHotKey (AHK) script I wrote. Now I have abandoned that script. For 2 reasons:

  • It does not work on some programs/input boxes, not sure why, but google suggests maybe because they are run in SYSTEM account…
  • It fails to translate key presses occasionally. This is because the low level KeyboardHook/SendInput Win32 mechanism it employs is a half-baked buggy system itself.

Now I have switched to the kbddvp.dll provided by dvp creator Roland Kaufmann, and also solved the Chinese IME problem, turns out I only need to point the “Layout File” of my IME to “kbddvp.dll” in the registry:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\E0350804]
"Ime File"="ywbhj35.dll"
"Layout File"="kbddvp.dll"
"Layout Text"="Chinese (Simplified) - YWB35"

There comes another problem through: cygwin-x does not work with my new solution. In fact, cygwin-x has nothing to do with Win32 keyboard layout/IME. Xwindows has its own keyboard layout mechanism. Sadly, dvp is not part of cygwin-x yet.

But I can live with that, since the 2 most fundamental GUI programs I use, terminal emulator and emacs, both I can do without X. I use mintty and emacs-nt, both of which are not X programs.