Wishful Drinking by Carrie Fisher: Spare me the details.

Yeah, it’s really funny. Reads very much like spoken word written down. Words fly by quickly, often ironic or mordant. It’s short, generously leaded, so probably not that many words. It’s like therapy bound into a codex and sold.

The cover of <i>Wishful Drinking</i> by Carrie Fisher.

The cover of Wishful Drinking by Carrie Fisher.

Fortunately, there’s not too much about Starwars, since I am over 12 years old and don’t care about it. It’s kind of sad how large it loomed in her life. It’s often struck me that being an entertainer is a funny sort of thing, from the point of view of fulfilment. Is helping people pass their time away satisfying? I guess the key thing, if you’re the reflective type, would be whether you feel that you’re enriching the viewers’ lives or just helping pass the time until the grave. But what value a laugh or a thrill? People love those movies, probably too much. What’s wrong with giving people something that they just plain really like? Nothing.

The book made me think about people with the same mental issues as Fisher but without the cushion of money or the spotlight of fame. I don’t know what’s worse, but it seems to me she could always afford and find a therapist, so maybe the money and fame might be preferable as a position to inhabit while battling demons. Also, you can write a book about it and people will read it ‘cos they’ve heard of you.

Her story certainly makes a strong case that it would be preferable to win fame after a few years in the real world, rather than spending your whole live in an unmoored bubble.

Funny. Honest. Worth the little time it takes to read it. Probably better on stage, but sadly it’s too late for that now. The self-destructive stories in the book take on a darker tone now that they’ve taken their tithe. Perhaps it’s not as funny as it would have been a little while ago…

 

Sad stories.

Random useful Word stuff

Notes to self.

(http://www.fileformat.info/info/unicode/category/Sm/list.htm)

(‘␣’ means empty space, eg one hit of the space bar; ‘Alt-x’ means hold down ‘Alt’ and press ‘x’. If a space is not marked with the empty space character, it is just used to separate commands and should not be typed.)

in Word, type ␣2212 Alt-x to get a proper minus sign, not an en rule or a hyphen; it sits at the right height and gives the right spacing. The space in front is not always needed, but may be needed to separate the ‘2212’ from the previous characters so Word knows what to apply the ‘Alt-x’ function to. Here are the other ones I find most useful:

Useful Alt-x codes for maths in Word

If in the ‘Advanced find’ dialogue I select ‘Use wildcards’ then the search differentiates between non-breaking spaces and spaces.

Just some stuff.

Other stuff.

 

 

 

 

Search insde Word, PDF, XML and other files—installing and using crgrep

I am an editor in a business that uses Micro$oft products, but I want to be able to use the Linux CLI tools with which I am moderately familiar. In particular, I want to be able to grep Word documents, and that’s a problem because the new Word file format chops the text up and zips it up and hides it away. I googled and read a bit about crgrep (‘common resource grep’). Here is my experience so far.

Downloaded from

https://bitbucket.org/cryanfuse/crgrep

or

https://sourceforge.net/projects/crgrep/

Created a subdirectory c:\Users\username\installs\crgrep and downloaded the zip file into it. Worked in Cygwin, hence the forward slashes and dollar signs in the following. This could also be done through the GUI or in a PowerShell or CMD window. Choice is a wonderful thing.

$ unzip crgrep-1.0.5.zip
$ cd crgrep-1.0.5/
$ vim INSTALL.txt

OK, so it needs java. Does it need the compiler (probably not, but check…). In the crgrep folder, typed:

$ grep -ir javac

Returned no results calling the javac compiler. So it looks like the program needs the runtime but not the development kit (JDK), so that’s good. It’s what you’d expect. Now, I have the wonderful ImageJ installed (works effortlessly in userspace), and it installs the Java runtime environment, JRE. Maybe I can use that.

Now, according to the INSTALL.txt file, the JAVA_HOME variable that crgrep wants points at something like

JAVA_HOME=C:\Program Files\Java\jdk1.8.0_xx

and my grepping told me that java.exe should be in %JAVA_HOME%\bin\java.exe

In Cygwin, my ImageJ tree looks like:

/cygdrive/c/Users/username/installs/ij/ImageJ/jre/bin

Which meant I needed to set JAVA_HOME to be C:\Users\username\installs\ij\ImageJ\jre (Windows-style path) (that is, the variable points the directory with the bin directory inside it, not the bin directory or the binary file itself.)

But first checked the version — needs 1.8.

$ cd ../../ij/ImageJ/jre/bin/

$ ./java.exe -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

OK.

I installed in userspace (work computer, no root/admin access), so I went to my Windows account settings (given the various versions of Windows, I’ll assume a user can find their own account setting page) and (for Win 10; Win 7 is no doubt different) in the ‘Find a Setting’ box I typed ‘env’ for ‘environment variables’, and chose ‘edit the variables for your account’. Note that searching for ‘path’ turns up nothing. It’s a little trick!

Added an entry to the path:

(Path → Edit → New)

c:\Users\username\installs\crgrep\crgrep-1.0.5\bin

and created a new environment variable:

JAVA_HOME=C:\Users\username\installs\ij\ImageJ\jre

And exited everything, esp. the command line window, then opened it again, typed SET in a CMD (‘DOS’) window to see if the new variables were present, then tried the command:

H:>crgrep --help
usage: crgrep [options]  []
crgrep: Common Resource Grep.
 -a,--text               Process binary files or database columns as if
                         they were text
    --color        Alias for 'colour'.
    --colour       Colour-highlight matched text ('always', 'auto'
                         or 'never'). Default colour is red, see USAGE.txt
                         for other colour settings.
 -d,--database           Database grep (disables file search)
 -h,--help               Help
 -i,--ignore-case        Ignore case distinctions in matched text
 -l,--list               List resources which produce a match by name. No
                         content is searched.
 -m,--maven              Include Maven POM file dependencies in search
    --mood    Only include matching content expressing a
                         specific sentiment; values include 'positive',
                         'negative' or 'neutral'. Ignored if -l specified.
                         Requires model data; see INSTALL.txt
    --ocr                Enable OCR text extraction from images; requires
                         tesseract libraries. See INSTALL.txt
 -p,--password      Password required to access a resource,
                         optionally used with -u
 -P,--proxy         Proxy settings for http access, specified as
                         [:]
 -r,--recurse            Recursive search into resources
 -u,--user          User ID or username required to access a resource
 -U,--uri           URI to specify a JDBC database resource
 -V,--version            Print the version number of CRGREP to the
                         standard output stream
    --warn               Display all warnings to standard output
 -X,--extensions    Enable one or more extensions; comma sep. list
                         such as -Xdebug,trace
If  is not specified, or is '-', read from stdin
Please report issues at https://bitbucket.org/cryanfuse/crgrep/issues

OK, promising.

I want it for grepping Word files, so let’s see… yes, it finds ‘data’ in the test file, and outputs a nice clean stream:

H:>crgrep data text.docx
text.docx:T:A key part of his research was the analysis of large
datasets. As part of this he developed a software suite that included
data modelling, reduction and correction techniques, and made of use the
National Computing Infrastructure and other supercomputers. He enjoys
the challenge of analysing and explaining complex data using words and
carefully designed graphics. He likes Linux and the LATEXtypesetting
system.

How about PDF? Converted the Word doc to PDF using the ‘Save as’ dialogue in Word. Then…

H:\>crgrep data text.pdf
text.pdf:1:36:datasets. As part of this he developed a software suite
text.pdf:1:37:that included data modelling, reduction and correction
text.pdf:1:40:challenge of analysing and explaining complex data using

Different output because of how PDF and Word chop up the text, but instances found in both cases. No need to specify a file type or anything. I have not explored the command line options, but I am already finding the program useful — for example, when I want to find multiple instances of multiple expressions (say acronyms or references) in multifile projects.

Kudos.

Just grepping around.

ReactOS on VirtualBox: No need for step-by-step instructions

This is so simple there’s no need for step-by-step instructions, but I kept notes so I might as well post them.

ReactOS 4.5 on VirtualBox 4.3.x on Debian 8.x. Not on VB5.1 because the older versions are what the Debian repo provides.

(1) Installed VirtualBox;

$ apt-get install virtualbox dkms 

Host is 32 bit Debian 8.4 Netbook with 1 GB RAM and 250 GB HD. Low spec! (Atom N550)

(2) http://www.reactos.org/download and downloaded both disk images; starting with iso rather than LiveCD. Apparently should be able to use guest additions from Win 32 bit, 2003-era. Unzipped the images.

(3) Ran VB; selected ‘New’.

(a) Put in details — Name, Windows, 32 bit 2003.



(b) 512 MB RAM (default in this case)

(c) 20 GB HD.

(d) VDI format is fine.

(e) Dynamic is fine.

(4) System. Enabled PAE/NX.

(5) Storage — put the Reactos ISO in the virtual drive.

(6) Boot.

(7) Let install run:

(a) Chose language

(b) Pressed enter a bunch of times. I chose to do a full format not a ‘quick’ one.

(c) Waited… … … … … …

(d) Chose default to put OS in C:\ReactOS

(e) Chose default bootloader installation.

(8) Removed cd rom image from virtual drive. (Devices menu).

(9) Rebooted.

(a) Watched as it interrogated the hardware and installed some devices.

(b) Clicked through setup. Admin password.

(10) Rebooted again.

(11) It wanted to install a driver but could not. Oh well.

(12) Devices menu of VB — inserted guest addtions.

(a) Opened explorer in guest and double clicked on additions x86 exe file in the cdrom directory.

(b) Default install.

(c) Rebooted.

(13) Shared folders…

(a) Created a folder on Linux host. Made sure users had read/write permissions.

(b) In VB manager, added that folder in Share Folders menu. Did not click auto mount.

(c) Booted VM.

(d) Double-clicked ‘My netowrk places’ on the ReactOS desktop and there it was, called \\VBOXSVR\vbshare.

(e) In a terminal, needed to assign the folder a drive letter.

(f) Opened command prompt on guest and typed

C:\ net use x: \\VBOXSVR\vbshare

(g) Typed x:

(h) Typed X:\ notepad textfile.txt.

(i) Typed some crap. yep, it’s there.

(j) Looked for the file on host system. Modified it.

(k) Saw modifications in guest and host. OK, that works.

(l) I’m not going to bother automating it, I’ll just put a readme on the ReactoS desktop.

(14) Done, as far as I can see. Looks pretty good.

Having said that, all the applications I wanted to be able to run can run on wine.

Still, seems to work.

Wine.

CAPS LOCK disable on Windows without admin rights

Lots of sites tell you how to disable/remap CapsLock. But what if you don’t have administrator rights? Most of them tell you to pry off the key. Well, instead, I went to:

https://dropline.net/2009/05/mapping-caps-lock-to-control-without-admin-access/

Here is an extract, which I put here just in case the original site vanishes, as sites sometimes do:

There’s a duplicate of the keyboard mapping registry key under HKEY_CURRENT_USER, which non-administrators can modify, and it appears to behave exactly like the key under HKEY_LOCAL_MACHINE.  So, for anyone in a similar position, here’s the registry key to modify:

HKEY_CURRENT_USER→Keyboard Layout→Scancode Map =
hex:00,00,00,00,00,00,00,00,02,00,00,00,1d,00,3a,00,00,00,00,00

You can download a registry update file here.  Save it to your computer, double-click it to update your registry, then reboot and enjoy your vastly-improved keyboard.

Here is a screengrab of the .reg file:

capslock

Worked a treat on Windows 7, but it did not work on Windows 10.

Hmm…Code for conversion of CapsLock to Shift is:

00,00,00,00,00,00,00,00,02,00,00,00,2a,00,3a,00,00,00,00,00

(http://johnhaller.com/useful-stuff/disable-caps-lock)

Codes explained here:

https://www.experts-exchange.com/articles/2155/Keyboard-Remapping-CAPSLOCK-to-Ctrl-and-Beyond.html

But why it does not work in Windows 10 I don’t know. I did try it on a work desktop machine (that’s why I don’t have admin rights, ‘cos it’s a work machine), so perhaps it downloads registry files on logging in? Does that make any sense?

Right now I don’t care enough to find out, but I’ll look into it at some point in the future.

 

So there.

Another Font for a Very Specific Purpose

I have been reading stuff on my HP200LX palmtop using VR, the Vertical Reader.  It basically turns the LX into a pretty useful book reader — ASCII only.  You have a single column of text, rather like a newspaper column. It’s most excellent. It comes with search, bookmark and various customisation facilities.

However, I found the fonts that came with it just a bit too small. I decided to make one of my own, which is at an old post here, but it went too far the other way and is too wide. So I decided to take that font and narrow it a bit — make a condensed version, in the correct parlance. Thus:

The two fonts are shown below. The comments about the design philosophy in the earlier post remain valid; but the new one is I think just as readable and gets quite a bit more text on the screen.

‘djgtry2.vfn’

Using the font 'djgthin.vfn'.

Using the font ‘djgthin.vfn’.

The new font is available at DSPACE, along with the earlier one. The file to download is DJGTHIN.VFN.zip.

For what it is worth.

Scones using only 2.5 ingedients

This recipe courtesy of Kylie Evans at Biotext. May need to try it a few times to get the knack.

First, preheat oven to about 200oC and line a couple of baking trays with paper.

Work fast.

You will need:

• some volume of self-raising flour (a couple of cups)

• half that volume of thickened cream.

Combine flour and cream in a bowl, mixing with a bread and butter knife until combined. The less mixing the better.

The half an ingredient: If any dry material is left (say as crumbs in the bottom of the bowl) use a little milk just to add liquid. Mixture should not be sticky.

Use your hands to press out the dough into slabs about an inch thick. Use a cutter (about 1.5 inches across) to cut out the scones.

Bake for 10 minutes, maybe 12.

Mmmmm.

Impressions of wine

Wine is a mighty thing. Wine is a project to allow Linux (and Mac OS) users to run Windows programs.  It does not emulate a Windows machine, the way, for example, DOSBox emulates the hardware that DOS runs on or that VirtualBox (VB) does on a much larger and more complex scale.  It is more like an interpreter. The website calls it a ‘compatibility layer’. What that means for us non-experts, is it takes Windows’ instructions, translates them into Unix equivalents, then passes them on. This is a less flexible approach than simulating hardware (it is specific for Windows, for example, where a VM can run any number of operating systems) but it is much faster and allows excellent seamless integration with the Linux environment.

I have used Wine on and off for years, but I am not a regular user. I use VB to run a Windows 7 VM on my main workstation, because I have to work with people who use Microsoft Office and various add-ins like MathType, and at the time when I set the VM up it was probably the best solution.

I’m not so sure now.

I have an old CD of MS Office 97. I recall trying to install it under Wine a few years back, and it was not highly satisfactory. Word threw some funny errors, and I could not type into Excel. But that was a few years back, and I use Debian on my desktop, which is not renowned for using the latest versions of packages.

So I thought I’d try it again.

I have a Netbook running current Debian, which is a lot newer than the ‘old stable’ I have on my workstation. I have a USB CD drive, so I gave it a lash.

Brilliant.

Plugged in the CD drive. It appeared in the file manager. [Caja — I use MATE, which I think is a great example of a FOSS project. Dissatisfaction with where the Gnome desktop was going (when it switched from Gnome 2 to Gnome 3) prompted people to get together to continue to refine Gnome 2. The result is a desktop environment which is very congenial for us slightly older users who first saw a GUI in the 1990s and reacted violently when Microsoft introduced the ribbon, for example. Now users can choose between Gnome and MATE, and everyone has more options.] I then opened a terminal and went to the CDROM subdirectory (in this case, at /media/cdrom) and ran:

/media/cdrom $ wine autorun.exe

or whatever the installation program was called. Wine opened it like a native Linux application, installed the program (the psuedo-Windows hard drive is hidden away in .wine/drive_c of the user’s home directory).

It appeared in the ‘Other’ menu under the MATE Applications menu. So did a bunch of other stuff; it seemed to generate menu entries for all sorts of Windows executables that I did not want to use.

But that’s OK. Installed and ran Mozo, the MATE menu editor, and turned off all the entries I didn’t want, and moved Word and Excel to the Office category, and bingo I have Word and Excel (97, admittedly) running like native applications, almost no effort required.

Found an old zip file of Rietica1.7.7 (32 bit) on my hard drive; that installed perfectly as well. The Rietica website only hosts the new 64 bit version; I’ve not tried that.

 

Don’t know if I’ll even use Word and Excel, but the jump in the quality of the experience compared to Wine a few years ago shows how it’s a vibrant, massively useful project. A great solution.

 

Older tech.

Journal self-archiving policies

One of the most-viewed pages here (it’s all relative; still not very many hits really) is the list of dodgy publishers. It’s a drop in the ocean, but it gets a few hits. Something else I’d like to bring all into one place, even though it’s been done elsewhere, is to summarise self-archiving polices. I’ll focus on the journals I’ve published in, preparatory to putting together a web archive of all my papers that I am allowed to self-archive (on my website and maybe on ResearchGate). It’s really just a resource for me, but I might as well make it public.

Some journals are open access; you don’t need to self-archive those, but usually you can.

Some allow you to archive a proper reprint, processed and edited by the journal — like the IUCr, as shown below.

Some suggest you archive the ‘author’s final version’ but don’t want you to put up anything with the journal’s imprimatur.

Some say ‘mine mine mine’ and don’t let you host it at all. I hope to make this clear.

The page lives at https://darrengoossens.wordpress.com/journal-self-archiving-policies, and so far has exactly one (1) entry, the good old IUCr, which has a very enlightened policy. They allow self-archiving as long as you use the official e-reprint, rather than just the downloaded PDF, and they request that you provide a link to the journal. Seems very reasonable. The official e-reprint is easy to recognise; it has a distinctive front page with some official words on it, something like this (colours may vary):

Front page of IUCr reprint, showing it is dfferent from download from journal.

Note the box with the notice near the bottom of the page.

 

I think their policy is very reasonable because the IUCr has a very professional publication and editorial team who need to be paid and ought to be paid. Subscriptions are part of the mix, yet they allow authors to house their own work and to distribute copies to colleagues freely. It seems a very sensible mix.

More updates as they come to hand.