Archive | minor aside RSS for this section

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.

Advertisements

Add LibreCaslon (to name one) and Computer Modern (to name two) to Word

Not much really.

Now, if you do not have admin rights it is more interesting:

  • Right click.
  • Swear.
  • Go to https://portableapps.com/download
  • When asked, select ‘Local — install for current user’ or similar.
  • Finish installing.
  • Use the Explorer to go to: C:\Users\username\PortableApps\PortableApps.com\Data (‘username’ is the login name of the user installing the software).
  • Create a ‘Fonts’ folder in there.
  • Put the OTF files into this folder.
  • Start the Portable Apps Platform (if no shortcut/menu entry is available, go to C:\Users\username\PortableApps\PortableApps.com and run PortableAppsPlatform.exe). If it was started during installation, stop it and restart it.
  • Open Word, say, and LibreCaslon now appears in the fonts menu.
  • Close the Portable Apps Platform and it will not be accessible, though Word might still list it.
  • Add any other fonts you like this way, but they’ll only be available while the Portable Apps Platform is running, and you’ll need to stop it and restart it to make them appear. On the other hand, installation/removal is really simple; to uninstall, turn off the platform and remove from the Fonts folder!

Lots of other great applications (LibreOffice, gnumeric, GIMP, all that) are available through the Portable Apps Platform.

lc_list

Oh, Computer Modern is at https://www.fontsquirrel.com/fonts/computer-modern and https://www.ctan.org/tex-archive/fonts/cm-unicode/fonts/otf.

 

Meh.

Extra ultra super glue.

Just a useful trick. Some people use the word ‘hack’ for stuff like this, but I … don’t.

However, I will say that I have found that super glue, by which I mean cyanoacrylate glue, is lousy for fixing the plastic that most kids’ toys are made from. However, some companies now sell a double-pack for fixing that kind of stuff — it’s sometimes called ‘Toy Fix Glue‘ or similar.

You can buy it, but it costs a premium, and what is in the pack is a felt-tip marker filled with MEK or something very similar, and a tube of what smells a lot like super glue. Now, you’ll pay something like $10 for this tube of super glue and a few ml of this primer. It works, though.

But, instead, I prefer to pay like $2.50 for a multi-pack of no-name super glue and then go to the plumbing section and get a container of primer for joining PVC pipes for about $6. Now, this primer can be coloured, so it’s a good idea to get the transparent, colourless one.

I use a paint brush, like a cheap watercolour brush, to pain the primer onto both surfaces to be joined. Then I let it evaporate off, and apply the glue to one surface and then hold the surfaces together firmly for as long as possible.

This fixes plastics that super glue won’t normally bond, as well as ceramics — I’ve glued up teacups that have then been used for years, though I don’t put them through the dishwasher. Probably could, but don’t.

Warnings:

Use in a well-ventilated area!

Some plastics will be softened by the primer, so avoid applying more than necessary, and if it is a really valuable/valued item, maybe ‘do a test in an inconspicuous area’, as they say.

Super glue is dangerous and must be kept away from skin, eyes and any other body parts, whether your own or those of other people.

Keep out of reach of children, and don’t let them touch the glue either.

 

Glue, ink, whatever.

World ‘World Day’ Day — you know it makes sense.

Every day seems to be World Something Day. Today is World Meteorological Day. Tomorrow will be something else, and the day after something else again. And those are just the UN sanctioned ones.

I think we need to have a day to honour all the people that get together and organise topic-based days. It takes a lot of coordination and determination to make sure that everything finds its right place. You don’t want World Dog Day and World Cat Day occurring at once, or you’ll just have lots of trouble in lots of parks around the world. You probably don’t want World Chocolate Day and World Diabetes Day to coincide. Or International Women’s Collaboration Brew Day to clash with Alcohol Awareness Month.

So, when should we schedule World World Day Day, a day organised in honour of all those people who spend their time organising days in honour of people? Somewhere near Administrative Professionals’ Day, perhaps.

Organising an event like that would be a good use of someone’s time. Maybe we could have a day to celebrate them.

 

Fleas and so on.

 

Word madness: Can’t save, won’t save. ‘A file error has occurred’

Word's useless error message. Notice the 'Was this information helpful'. What do you think?

Word’s useless error message. Notice the ‘Was this information helpful’. What do you think?

 

Got this error, and they had the temerity to ask me if it was helpful. Pricks. Anyway. Could not save to new name. Could not save to external media. Could not save elsewhere on C:. In short, could not save.

No.

No.

One bit of advice I have read is to wait till Word does an autosave, then kill Word using task manager. Then when Word is restarted it will give an option to rescue the file. Sounds dangerous to me. Waited but save did not come.

First thing I did was print to PDF with all track changes and everything visible so I would at least have a record of what the file looked like.

Then created a new blank file. Tested that it could be saved. Yes. And in the same folder as the original file. (I knew that should be OK since I printed to PDF into the same folder).

Went to file I wanted to rescue, with track changes visible and all comments visible. Ctrl-A, Ctrl-C
Went to new empty doc and pasted. Got text and comments but not the track changes information. Well, that is still useful as a backup.

Save.

Now, it should be possible to make a copy with track changes information.

https://word.tips.net/T001783_Pasting_Text_with_Track_Changes.html

Another handy way to copy the text is to use the spike. Word users are so familiar with using the Clipboard to cut, copy, and paste information that we often forget about the spike. This is an area of Word that acts like a secondary Clipboard, with some significant differences. (You can learn more about the spike in other issues of WordTips or in Word’s online Help.) To use the spike to copy and paste text with Track Changes markings intact, follow these steps:

  1. In the source document, select the text you want to copy.
  2. Press Ctrl+F3. The text is cut from the document and placed on the spike. (If you wanted to copy, not cut, then immediately press Ctrl+Z to undo the cut. The selected text still remains on the spike.)
  3. In the target document, place the insertion point where you want the text inserted.
  4. Make sure that Track Changes is turned off in the target document.
  5. Press Shift+Ctrl+F3 to clear the spike and insert the spike’s text into your document.

So I went to source document ant hit Ctrl-A, then Ctrl-F3.

Opened blank with same template, track changes turned off (it is by default I think).

Shift-Ctrl-F3

But does not save! The problems have come with it!

So that does not help.

Now, if I turn off track changes and accept all changes, I can save the document – so it is a bug somewhere in Word’s track changes code.
If the problem occurs again, can try the spike method with the different aspects of track changes turned on and off, to narrow it down.

So no satisfactory solution discovered. I do not know what change I put in that caused the issue, and it has never occurred before. So… I dunno. The above ideas are just partial solutions.

 

Solutions to problems nobody asks about.

Update and Shutdown; sudo, halt, stuff like that.

So I sometimes run the script stop.sh to shut down my Debian machine (it lives in ~/bin).

$ stop.sh
[sudo] password for username:

It asks me for my root password then does an update to get the new file version information, then an upgrade and then halts the machine. It’s a one-liner:

cat stop.sh
#!/bin/bash
sudo apt-get update  && sudo apt-get -y upgrade && sudo shutdown -h now

Now, what’s bad about this?

  1. Well, sudo ‘remembers’ that I’ve typed my password for (by default) five (or is it fifteen?) minutes, so if the early steps (update, for example) take a long time, the latter ones won’t work.
  2. Also, if my intent is to let it update and shut down without me, I’ll be walking away from a machine in which root access is available for that five (or is it fifteen?) minutes, so I probably want to lock the screen before I go. Not a big deal if it’s a home machine or you can lock the office, and probably not a big deal anyway unless you deal with sensitive information (or work with untrustworthy people…).
  3. The -y flag tells apt-get to say ‘yes’ to any queries the installer might ask. Could be a problem if I have a non-standard install or specific needs.
  4. I don’t see any information that the installer might give me, and I don’t find out if it worked till I come back and boot up.
  5. Some packages give information screens and ask the user to input a choice or acknowledge some information. They can mean it does not complete the task and so does not shut down.

The apt-get man page says:

-y, --yes, --assume-yes
           Automatic yes to prompts; assume "yes" as answer to all prompts and run
           non-interactively. If an undesirable situation, such as changing a held
           package, trying to install a unauthenticated package or removing an
           essential package occurs then apt-get will abort. Configuration Item:
           APT::Get::Assume-Yes.

So that should be borne in mind too.

Still, I use it anyway.

 

Lazy.

Guidelines Derived from Watching the Australian Cricket Team get Pummelled in Tasmania by South Africa in 2016

Should have put this out earlier; it’s already dated. On the other hand, I think some of it has turned out more or less correct. Some.


Based on listening closely to what has been coming out of the Australian ‘camp’ during their recent run of failures, I have arrived at four rules for selecting and running an Australian cricket team.

Rule 1: Choose players who at least look like they care. It’s not enough to pull a sad face or look angry when something goes wrong. Maybe if they pretend hard enough it will become true!

Rule 2: Forget supposed talent and look at results. Talent is as talent does not as it looks like it ought to be capable of. Australian selectors have a history of being seduced by players who look the part but perform marginally, and not playing those who are ‘unfashionable’ despite being better performing. How did Mark Waugh get to play over 100 tests?

Rule 3: ‘Stick with my natural game’ is code for ‘I don’t want to have to think very hard’ or possibly ‘I don’t really give a shit’. They are professionals who need to adapt to the conditions and match situation. If they cannot do that they are not good enough to be out there. Judge players on how they perform when things are tough, not when they are easy.

Rule 4: Any system with Greg Chappell (currently Cricket Australia’s National Talent Manager, whatever that means) involved fails. (This is not so much based on recent results as on watching the trail of destruction Chappell leaves whenever he is tasked with ‘managing’ anything. The words ‘piss-up’ and ‘brewery’ come to mind.)

 

Cricket, what’s that, an insect?

Getting lp, lpq and lpstat to work…

I want to be able to use lp and print from command line, not just from gui. My Linux box (Debian, running FLWM as window manager), prints fine from applications with print dialogues, for example LibreOffice or evince, but I want to be able to use lp, a2ps, maybe print from xFig, and these all use the lp command line interface, and that is not set up.

I know I can go ($ is command line prompt)

$ lpadmin -d [printer-name]

but what is ‘printer-name’? I have a couple of printers attached by USB, not network.

It’s actually very simple.

$ lpstat -a

FUJI_XEROX_DocuPrint_CP305_d accepting requests since Wed 02 Nov 2016 13:26:34 AEDT
HL5340D accepting requests since Wed 14 Dec 2016 17:33:54 AEDT
Stylus-TX100 accepting requests since Tue 13 Dec 2016 20:19:20 AEDT

$ lpadmin -d HL5340D

Bingo.

nu and vee, I and l — design of physics books and modern fads for fonts

Rant.

As someone working in a technical field, I often feel like designers do not really appreciate the subtleties of notation and how to make it clear. In the title of this post, ‘I and l’ is upper case ‘eye’ and lower case ‘el’. Not that you can tell.

For example, because so many symbols are used, formulas can often contain symbols which might be mistaken for each other. The classic example is…ilb1

and here is the same formula using some sans serif fonts, using Microsoft Word…

ilb2

Now, this is not to criticise these fonts. They are just not designed for this job. It is the chooser of the font who is being a wee bit silly if these fonts are used in a mathematical document. An even trickier example is…

nuv

which I have produced in LaTeX, and the nu and vee are well-differentiated, but that is because the font was designed by someone (Knuth) with the express purpose of laying out mathematics.

If I was able to give advice to anyone out there designing a text with mathematics in it, it would be to look at the two letter/symbol pairs I have shown here, and make sure they can be told apart. If not, the font choice is a poor one and needs to be changed. And what is fashionable at the moment is irrelevant beside the need for clarity and the fight against ambiguity and lack of precision.

 

Rant over.

My Fortran rotating star and cost of screen output.

Ignore this post.

Got a Fortran program that does some numerical work and I just have it outputting a single character (‘-‘) to the screen each cycle, so I know it’s ticking along. It looks like this, sort of:

--------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------> done
Whoa! Exciting.

Whoa! Exciting. This was made using gifsicle.

But I thought that was ugly, so I’ve got something much nicer now. You know how in some text-based programs the fact that it has not completely locked up is shown by having little rotating bar, made just by printing |, /, -, and \ in the same place one after the other? Well, this is one way to do it in Fortran (note, just a snippet, not a working program):

! declare array 'star()'

       character,dimension(1) :: star(4)     

       star(1) = '|'
       star(2) = '/'
       star(3) = '-'
       star(4) = '\'

!.
!.
!other code...
!.
!.

       do iloop=1,nloop
          write(6,'(a,a)',advance='no')achar(8),star(mod(iloop,4)+1)
!.
!.
!content of loop...
!.
!.
       end do

So all that this does is write an ‘achar(8)’ character to make the output backspace, use “advance=’no'” to avoid adding a line return, and use ‘mod’ to run through the four characters in the array over and over again.

‘achar(13)’ also works but only if you want to return to the beginning of the line and overwrite everything.

While thinking about this, I wondered: The loop is fairly big (searches some big arrays, does some calculations, works out an energy in a Monte Carlo simulation, that sort of thing) and so since this starry thing is the only screen output, I was wondering — how much does it cost in runtime?

using Gfortran, with -O2 optimisation. With and without the above ‘write’ statement, times are:

With:

 $ time ./Dom2016G_tests < inputsG 

real	2m50.757s
user	1m57.032s
sys	0m1.616s

Without:

real	2m49.191s
user	1m56.895s
sys	0m1.587s

So there we have it, a time cost (looking at the ‘user’ time) of less than 0.2s, and only about 0.1%. So I think I’ll keep it. It looks nice.

Oh, and making the animated gif: I made four little bitmaps by screen grabs from LibreOffice, all the same size, and called them a1.gif, a2.gif a3.gif and a4.gif. Then just this command line (I put loopcount in to stop it after a finite number of loops. –loop and it goes forever…):

gifsicle --loopcount=100 -d 30  a?.gif > star.gif

a2
a4a3
a1

 

 

 

 

 

Rubbish.