Archive | ramblings 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.

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.

Non-breaking en rule (en dash) in Microsoft Word… not really.

Say you’ve got a number range. The proper way to format that is with an en rule (en dash), so it looks something like ‘4­–5’ whereas a hyphen would look like ‘4-5’. Now, you probably don’t want the number range to break across lines. That’s fine with a hyphen, since Ctrl-Shift-Hyphen gives a non-breaking hyphen (in Word). But you don’t want a hyphen you want an en rule. One option is to put in a non-breaking hyphen then make it twice as wide.

  • Highlight the non-breaking hyphen (and the hyphen alone, not any trailing/leading characters or spaces).
  • Right click on the hyphen and select the ‘Font…’ menu, then ‘Advanced’ (rule #1 in Microsoft products: Just about anything worth doing is considered ‘Advanced’).
  • Change the number in the ‘Scale’ box to be about 200%.
  • Exit from the menus.
  • Type an en rule in your document, alongside the stretched hyphen. (Ctrl-Keypad Minus.)
  • Compare.
  • Swear.
  • Use it anyway since it’s the most reasonable alternative. You may want to adjust the height; but will this highly manual fix work if font is then changed? No.
  • Watch while Word mysteriously moves the instruction to widen the characters to random places in the document so you end up with double width text in unexpected places.
  • Swear.
  • Learn LaTeX where all you need to type is \mbox{4–5}.
Dialog box in Microsoft Word for changing character size, position and spacing.

Stretch out the hyphen (or anything else) using the ‘Scale’ box. Gives fixed selections but can type in other values. Something between 175% and 225% usually works. Note: Can also be used to adjust the position if need be.

I have tried putting text in boxes, but the baseline is not maintained – it sits high. Character positions can be adjusted down, but then Word boxes clip the contents. Perhaps there is a better solution? I tried making it an equation, or using a minus character, but neither was really satisfactory. I’d like to hear about a better answer because, sadly, using LaTeX is not always viable.

Non-bresaking en rule in Word; results of stretching a hyphen.

Non-breaking en rule in Word; results of stretching a hyphen.

My Word.

A fool’s guide to installing a new hard drive in my Linux box.

(1) First I bought a new drive. Nothing fancy, Seagate 2 TB 3.5″ HD. I want extra data space, not a boot disk. I just want to mount it as a multimedia repository. Audacity generates a lot of GB.

(2) Second, I found an empty bay in my tower case and slotted the drive in and fastened it in with all four screws.

Sideways pointless picture of the inside the my PC case.

Sideways pointless picture of the inside the my PC case.

(3) Ran a SATA cable from the drive to an empty plug on the motherboard, and connected power to the new drive.

(4) Disconnected all external storage and booted up, and noticed that the drive showed up in the boot output. (Disconnected external storage to make identifying the correct disk easier when creating partitions.)

(5) I know that my existing HD is sda. Ran gparted. (Applications -> System -> Administration -> Gnome partition editor in the Debian menu structure).

(6) Waited while gparted found the partitions on all the attached disks.

(7) Identified new disk as sdb. Good.

(8) Created partition table: I chose gpt, but msdos works usually too. Device -> Create Partition Table -> select type.

<tt>gparted</tt>. A screen shot too fill up space.

gparted. A screen shot to fill up space.

(9) Right click on its entry in the partition editor window. Selected ‘New’ and added details as preferred. I like ext4, used the whole disk, and gave it a label different from any other disks. It had to be Primary since it is the only partition on the disk.

(10) Clicked ‘Add’, then ‘Apply’. Closed the dialogue when successfully completed. The partition editor took a few seconds and found the new partition.

(11) Okay. Now, to get it to mount on boot. The modern way uses a sort of ‘universal ID’ for the drive — UUID are four letters that come to mind. I just used the fact that the partition is called sdb1.

(12) Created a mount point in my file tree.

Whatever.

Whatever.

$ cd
$ mkdir Music

I was not acting as root at this point — because this is my desktop machine and my data. I am treating it as part of /home/myusername, not creating a drive for everyone to see.

(13) Then edited /etc/fstab. This has to be done as root

$ sudo vim /etc/fstab

This is the added text in /etc/fstab.

#New 2TB GB drive as ~/Music
/dev/sdb1 /home/myusername/Music ext4 rw,user,exec,auto,errors=remount-ro 0 2

(14) Then gave the machine a reboot and saw what happened…

(15) Use the ‘disk free space’ command to see if I can see the new disk.

$ df -h

Here is the output for the new disk…

Filesystem Size Used Avail Use% Mounted on

/dev/sdb1 1.8T 196M 1.7T 1% /home/myusername/Music

OK!

(16) Need to do a test… Can I write to it? Test:

$ touch /home/myusername/Music/testfile

No! Because when mounted Music is owned by root, not by me.

(17) So…

$ sudo chown myusername /home/myusername/Music/ 

$ touch /home/myusername/Music/testfile

Success… (Note, this may not be the cleverest way to do all this, it only works.)

(18) Now reboot and see if I can still write to it…

(19) Yep. OK, now put the sides back on the tower and copy the back-up to the new data space… Yep, that works.

And awayyyy…….

Tapes, cassettes, whatever, ripping to mp3.

OK, so ‘ripping’ cassettes using my old AKAI in the shed. Same method works for vinyl.

Verify the below with a run-through.

(1) Get the two ended 3.5mm plug audio cable, one end into stereo output, other into mic input of netbook.
(2) run audacity (2.0.6) and record…
(3) Massively overloads the input, huge distortion
(4) Mic gain inside audacity is greyed out, says ‘use system mixer’
(5) Playing a tape while recording in audacity and fiddling with System → Control Centre → Sound (on MATE). Reduce mic amplification. (Volume control on my stereo is flaky.)
(6) Does affect the loudness. Dropped it back so that it touched the edges of the scale now and again but not repeatedly.
(7) Playback…Sounds ok.
(8) Record output of tape player.
(9) Find where tracks start in Audacity window. Place cursor there and type ‘Ctrl-B’ and type track name. I use the form ‘XX Title’ where XX is 01, 02, 03… (makes for better sorting of filenames).
(10) Highlight whole thing and Go File → Edit Metadata and set the album and artist name.
(11) Use the noise removal under the Effects menu.
(12) File → Export Multiple, choose your file locations and types and away you go.

Notes: I found I got weird buzzing noise in the captured audio stream when my netbook fan turned on, so it worked a lot better on cold days (!).

Noise reduction can affect the ‘feel’ of the result (can kill the high end frequencies a bit) – do a test and undo if desired,

Check settings like balance, equalisation and Dolby on the tape player. Because the input to Audacity is coming from the earphone jack, these things will affect the result.

If the Audacity display is maxing out a lot, the sound will be clipped and distorted. Reduce either input mic gain on the computer or just turn down the volume on the stereo; it is worth starting the recording, looking at the display, adjusting the volume until it touches the maximum now and again but not a lot, then (just leave Audacity recording) rewind the tape and play it at the new volume level. The bit of experimental crap at the start can be snipped off later.

It is best to give the file a name before you start, say /home/username/audacity/projectname.aup. On a Linux system if you don’t it will be written to some tmp folder somewhere (/tmp, /etc/tmp or something), and it can get very big. If you have a root partition with not a lot of free space on it, it can get filled right up (Audacity can generate GB of stuff, especially if you go off and forget it is capturing the audio). When / runs out of space, Linux can behave a little oddly… Don’t let that happen. Set an alarm or something.

Tapes can be highly variable. Wow, hiss, all kinds of issues. A good tape in a good deck gives very worthwhile results. Much the same process can be used to grab audio from vinyl, of course.

Vinyl.

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.

Horrible errors on my Linux box.

Horrible errors on my Linux box. When trying to boot up. I mean, eventually it did boot, but this was not good:

Feb 27 15:17:00 lauequad kernel: [21057.921922] ata2.00: cmd 25/00:08:00:08:c3/00:00:16:00:00/e0 tag 0 dma 4096 in
Feb 27 15:17:00 lauequad kernel: [21057.921923]          res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x14 (ATA bus error)
Feb 27 15:17:00 lauequad kernel: [21057.921924] ata2.00: status: { DRDY }
Feb 27 15:17:00 lauequad kernel: [21057.921932] ata2.00: hard resetting link
Feb 27 15:17:01 lauequad kernel: [21058.643829] ata2.01: hard resetting link
Feb 27 15:17:01 lauequad /USR/SBIN/CRON[6290]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Feb 27 15:17:01 lauequad kernel: [21059.118482] ata2.00: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
Feb 27 15:17:01 lauequad kernel: [21059.118493] ata2.01: SATA link down (SStatus 0 SControl 300)
Feb 27 15:17:01 lauequad kernel: [21059.226065] ata2.00: configured for UDMA/33
Feb 27 15:17:01 lauequad kernel: [21059.250462] ata2.00: device reported invalid CHS sector 0
Feb 27 15:17:01 lauequad kernel: [21059.250466] ata2: EH complete
Feb 27 15:17:32 lauequad kernel: [21089.830651] ata2: lost interrupt (Status 0x50)
Feb 27 15:17:32 lauequad kernel: [21089.830669] ata2.00: exception Emask 0x52 SAct 0x0 SErr 0x58d0c02 action 0xe frozen
Feb 27 15:17:32 lauequad kernel: [21089.830672] ata2.00: SError: { RecovComm Proto HostInt PHYRdyChg CommWake 10B8B LinkSeq TrStaTrns DevExch }
Feb 27 15:17:32 lauequad kernel: [21089.830674] ata2.00: failed command: READ DMA EXT
Feb 27 15:17:32 lauequad kernel: [21089.830677] ata2.00: cmd 25/00:08:00:08:c3/00:00:16:00:00/e0 tag 0 dma 4096 in
Feb 27 15:17:32 lauequad kernel: [21089.830678]          res 40/00:00:00:4f:c2/00:00:00:00:00/00 Emask 0x56 (ATA bus error)
Feb 27 15:17:32 lauequad kernel: [21089.830679] ata2.00: status: { DRDY }

Except they were all nicely coloured and arranged by vim’s syntax highlighting.

/var/log/syslog

This was in the file /var/log/syslog

Freakin’ scary. I thought one of my hard drives was on the way out. Fortunately it’s not my main drive, the one that houses / and /home, but it’s the second drive which mounts at /home/username/Music.

So, I thought maybe the drive was on the way out. My back ups were up to date, but I noticed that when I want to have a look in ~/Music, there were some files that were corrupt. On boot the messages included one telling me to run fsck on /dev/sdb1 (the Music partition) and then dropping me into a shell, and then fsck told me it could not fix the drive…

Hmm…

Double-checked my backups were current, then unmounted the partition and used gparted to reformat it freshly as ext4. Started to copy the files across from the backup.

Stopped. Could not access the drive.

Hmm…

Remembered an old POST OF MY OWN.

SATA cable plugs sure do wiggle in their sockets. A lot more than old IDE ribbon cables.

Powered down. Removed power cable. Opened case. Noted which SATA cables went from which socket on the motherboard to which drive. Removed them all, blew some dry air into the plugs and cable ends. Replaced the cables and gave them a good wiggle, then left them, making sure they were not getting tugged out or sideways by tension but were square in the sockets. This involved rerouting some cables so they were more comfortable, and tying a bunch of unused power plugs up out of the way.

Reboot. No error messages. Mount back up drive. Copy 240+ GB of backups onto blank drive. All faultless. Seems to work perfectly.

Take home message: SATA cables are fussy and can cause problems that might look like something worse.

Something worse.

Is it better to go off-line when teaching?

Students, just like most of us including me, are too distractible, especially younger ones lacking self discipline, and by younger I mean first year university, not genuinely young. These days we put the content and the tutorial questions on the Learning Management System (LMS, really just a website) and we tell them to use the LMS to access the questions and the supporting materials and such. Once upon a time they’d just get a bunch of photocopies (‘photostats’) or before that roneos (mimeographs) or just “copy this down off the board.” I’m not pining for the past, I’m trying to work out how we can combine the best of then and now.

What happened then was we’d come to class having not looked at anything beforehand, we’d copy down a bunch of questions or question numbers off the blackboard (it wasn’t a whiteboard) like ‘Ch 8 Q 12-18’) then we’d have the book open in front of us and we’d whisper to each other while we were supposed to be working out the answers. Hmm.

What happens now is this:

They come to class having not looked at anything beforehand (just like in the old days), because the know they can access it when they get there (we knew we’d be given it when we got there, back in the day, so no difference there). But, and this is different now, they then spend ten minutes getting onto the university network and getting distracted by Facebook or whatever and don’t download the questions until the tutorial is half over. Then they get out their notebook (or tablet and stylus) and read the question and… check their messages. Then they show the guy sitting next to them a cat video. Then they laugh and eat some Skittles (fine, fine, that is not the internet’s fault), then they look at Pinterest or for all I know Tinder, and then I ask them how they’re going and they mumble and we’re over half way through now and they have written down a few bits of data pertaining to the first question and that’s it.

Okay, maybe I’m overstating, but I have seen it happen that way. I’m not just fighting any innate apathy or disinterest (or depression or sense of futility) to get them to do the work, I am fighting the single most interesting thing the human race has ever constructed — a world wide distraction machine that has everything on it and available at the touch of a screen.

At best, even when they are doing some physics or mathematics, their attention is divided — they are always ready to pounce on an alert from whatever bit of social media they use, so their brain is never really thinking about the questions we give them to (we hope) help them learn.

Now, in the past when you copied a question off the board, it went in your eyes, through your brain and out your fingers onto the paper. I’m not sure that’s much better than not engaging with it at all, but it can’t be worse. You could only really talk to the people either side of you, just as students can now, so there were by definition fewer distractions because now there are all the ones I had as a student plus smart phones, so at the very least students now have more distractions. Do they deal with them better than I used to? Valid question. Maybe these days they have extra information, extra connectivity, and the ability to use that without being consumed by it.

I’m not sure.

I started thinking about this post while I stood there watching students flick away from Snapchat (or whatever it was) and back to the LMS whenever they saw me coming. A few were able to use the ‘net to find useful information, or a website with some helpful content, and that’s good because a working scientist or problem solver (engineer, IT, whatever) does just that, calling on the info around them as well as what they know. But those students were a small minority.

I recall thinking how I would really, really like to given them all a paper copy of the questions or, better, ask them to bring their own copies (then at least they would have looked at it to the extent of downloading and printing it off and getting it from the printer with their own actual physical fingers before they got there — does that count as ‘engagement’?), and then use just their notebook, their bog basic calculator and their textbook (they still exist, they do!) to tackle the problems.

I don’t say the web is useless. It is great for communication, for extra activities and resources. They can use the web to access the material easily and flexibly when they are not in my class. I use it to distribute videos to buttress the material, to direct them to external resources, though Britney Spears’ Guide to Semiconductor Physics is getting a little behind the zeitgeist now… The WWW ought to be great for collaboration, for ready access to what the students have not internalised. For simulations, for VR, for virtual laboratories, for Skype visits to major laboratories, for feedback, for interaction, for… the sky is the limit.

But not if you can’t sit still long enough to actually do it.

We’ve tried to engage the students to make them want to be there. I mean, that should solve everything. And there’s always a few who do want to be there and  that’s great, they learn almost regardless of what the teachers do. But some students are in the class because they have been told to be there, because the subject is a prerequisite for what the really want, because they thought they would like it and now it’s too late to drop out without recording a fail, whatever. By giving them the option to more easily be mentally elsewhere when they have not developed the self-discipline to choose to do what needs to be done, I’m not sure we’re helping. I wonder if more distraction-free classroom time would have its benefits as part of a broader suite of learning opportunities? Some of the environments would use all the tech at our disposal, and some would just have the student and their brain and the stuff to be tackled.

I just want the best of both worlds; is that too much to ask?

 

Old fart, I am.