Thanks to the wiki for this. If you run across a file that mixes tabs and spaces (ewww!), set the tab settings the way you want (e.g., ts=4 sts=4 sw=4 et ai) and run
to convert all the tabs to the right number of spaces. This takes tab stops into account, which :%s/^I/ /g won’t.
This replaces what I used to do, which was /^I s<Tab><Esc> followed by a whole lot of n.n.n.n.n.n.n.n. … . One command is much better 🙂 . I’m not even going to try to count the keystroke savings on my current project (pym, a preprocessor written in Python).
This handy file-renaming script at Perl Monks has source code with red “+” marks marking wrapped lines. I pasted it into Vim and wanted to wrap those lines back to the way they should be. After a bit of fiddling, I got:
:g/^+/execute "norm 0x" | .-1,.j!
The `g/^+/’ finds the lines beginning with a “+”. Then the `execute “norm 0x”‘ deletes the “+” (“0” moves to beginning of line; “x” deletes), “|” marks the next command, and `.-1,.j!’ joins (“j”) the current line (“.”) with the previous line (“.-1”) without whitespace (“!”) added between the lines.
I leave it to you whether I have too much time on my hands.
Never had a problem before, but today WMP12 (on Win8.1 Enterprise) wouldn’t recognize my new copy of Music of the Spheres by Mike Oldfield (thanks to B. and N. for an early Christmas!). I could play it just fine on VLC, so I knew it wasn’t the hardware. It’s working now, thanks to this forum post and this Windows Club page.
I ran the WMP troubleshooter using Start | Run with the following command line:
msdt.exe -id WindowsMediaPlayerConfigurationDiagnostic
- I hit “Advanced” and selected “Run as Administrator.” (Not sure if that would have been required, but it’s what I did.) I also cleared “automatically apply fixes” because that’s the kind of person I am!
- I let it do the settings reset it suggested.
- I restarted WMP, and it recognized the disk right away.
I didn’t even have to reboot! How often does that happen? 😉
I got it unstuck by:
- installing the two updates listed here (by Elder Geek); and then
- following the procedure listed on InfoWorld.
Tedious? Yes. Yes, it was. At least I had plenty of time to write my last post while the updates were downloading and installing!
Edit: When stuck at “Preparing to install,” I checked the system tray per RogerSC’s post here and it worked.
As of 2016/11/28: The short version is below. See the linked pages for more details and any updates.
- Manually download the updates noted below.
- Set Windows Update to “Never check for updates.”
- Stop the Windows Update service, and set it to Manual startup. (Use services.msc.)
- Manually install, in this order, rebooting as prompted:
- Install the latest rollup. As of writing, that is KB3172605.
- Change the Windows Update service back to Automatic (Delayed start) and start the service. Reboot.
Tested on Win7 Pro x64.
Technology makes our lives better to the extent we don’t have to think about it. Robert Pirsig makes this point in Zen and the Art of Motorcycle Maintenance, and it’s still true: technology that draws attention to itself has failed (except to a very hard-core audience of which I am probably part 😉 ).
For the last two years, I have been using Google Chrome to view PDFs at work. Dozens a day, usually with at least five open at a time. For the last two years, every time I have rotated the view clockwise or counterclockwise, my page has shifted off-screen and I have had to scroll to get back to it. Has that stopped me from doing my job? No. Has it drawn undue attention to the underlying technology? Yes. Very yes.
I cannot express my delight at finding, after a recent Chrome update, that I wasn’t the only one with this problem — and that it has been fixed! I rotated my PDF and reached for the scrollbar, but then I noticed the underlying technology in a good way: I was still looking at the same page I had been. Now each day is a bit smoother, and my job is a bit easier, because the fix has reduced, rather than increased, my mental workload.
My sincere thanks to everyone involved in pdfium bug 116297. Special thanks to thestig at chromium.org for making the fix! If you read this, thestig, please know you have succeeded.
Note to programmers: sometimes small fixes are big wins. It took thestig two lines of code to save me several minutes of wasted effort per work day, every work day, possibly for the rest of my career. Fix the small things — your users will thank you!
This cool article about how software engineer Thanassis Tsiodras rooted his Android tablet reminded me of some things I’ve been thinking about for a while. We have spent decades learning how to minimize collateral damage in technology. For example, on Thanassis’s tablet, getting shell access wasn’t enough because the SELinux configuration provided another line of defense. Why haven’t we applied what we have learned in the tech space to the wider world?
The US elections are tomorrow. No matter who wins, hundred of millions of people are going to be unhappy. Let’s revisit how we can apply technological structures and design patterns (not technology itself, for once!) to minimize the collateral damage our leaders do.
I write this now so you’ll know it’s not sour grapes. No matter who wins tomorrow, I will be working on this series. Continue reading