Category Archives: Computers

Mac OS X and Windows

Deep Learning & Unintended Algorithm Bias

This was a 5 minute talk on deep learning for the very excellent @chesterdevs. Like others talking about deep learning, I took visuals and the face-learning example from the landmark 2012 paper, Quoc Le/Google/Andrew Ng paper, “Building High-level Features Using Large Scale Unsupervised Learning.”

Only afterwards did I notice that the subset of images which their system show as “most like a face” from their test set were 90% male and 90% white, as is the prototypical face that the machine outputs.

And so we have a neat demonstration of unintended algorithm bias: their input was 10 million randomly-chosen youtube videos; the output was white and male. I bet they didn’t expect that.

A salutary reminder that—as the hard-working statistician will tell you—“random selection” does not mean “unbiased”.

AutoHotKey script for they who, being Mac Users and also equipped with an Apple keyboard, yet still they work at a Windows desktop

Surprising how much time you can spend on these little niggles…

  • Irritated that Windows doesn’t have an ellipsis key?
  • Wondering how to do printscreen from your apple keyboard?
  • Really really fed up with swapping between Cut‘n’Paste is “⌘-C,⌘-V” and Cut‘n’Paste is “Ctrl-c-Ctrl-v”?

Help is at hand.

AutoHotKey

When I first came across I was a bit unsure about using AutoHotKey. But I have seen the light. It is the bee’s knees. It is open source, widely used for years, free, small footprint and is the ultimate customise-all-the-things tool for Windows. It is a combined scripting tool & Keyboard/Mouse hotkey manager.

My AutoHotKey for a Mac User with an Apple keyboard on Windows Script

https://gist.github.com/chrisfcarroll/dddf32fea1f29e75f564

There you are. It’s all you need. That, and a few hours to customise it yourself. Then a few more hours to… oh, never mind.

Disclaimer

When I said that AHK is the bee’s knees, I didn’t say that the language isn’t arcane, unintuitive and bearing signs of organic growth over a decade or more…

The Panama Pepers: a longtail SEO example

A Flemish friend commented recently on facebook that after all the news items about the ‘Panama pepers’ there were still no hits for it in search engines. (For those of you not previously acquainted with the Flemish talent for multi-lingual puns, I should explain that ‘peper’ in Dutch as pronounced as the English ‘paper’ but means pepper. He went on to mention a secret recipe for Norwegian salmon with Panamanian peppers).

And it was true! There were no hits on all the interwebs for Panama pepers.

Which brings us to the subject of longtail SEO. By writing pages on specific, not-widely-popular terms, websites attract to their site the small number of visitors who are interested in the topics to which they think searching those terms will lead them. Except: ‘small’, when your potential audience is The World may mean hundreds of thousands of visitors. Not so small after all.

Although Pepers is not an english word, by writing an article on the subject, and especially by discussing the Panama papers & Panama pepers (not to mention associated recipes), I thereby expect to rise to search engine page 1, if not hit #1, for the term.
We’ll see how it goes…

Update after 4 months

www.google.be/#q=panama+pepers now produces thousands of hits. This page made it to the first page, but only just. Clearly I need still lack a recipe or two for Panamanian peppers.

De Panama Pepers: een voorbeeld van SEO longtail.

Een Vlaamse vriend merkte onlangs op facebook dat na al het nieuws over de ‘Panama pepers’ waren er nog geen treffers voor die termijn in de zoekmachines. (Voor degenen onder u die niet eerder kennisgemaakt hebben met de Vlaamse talent voor multi-lingual woordspelingen, moet je weten dat ‘peper’ wordt in het Nederlands net zo uitgesproken als het Engels ‘papers’. Hij merkte verder een geheim recept voor Noorse zalm met Panamese pepers).

En het was ook zo! Er waren geen hits op de interwebs voor ‘Panama pepers’

Wat brengt ons op ons onderwerp: longtail SEO. Door het schrijven van pagina’s over specifieke, niet-alom-populaire termen, trekken websites het kleine aantal bezoekers aan die interesse hebben voor de betrokkene onderwerpen. Alhoewel: ‘klein’, wanneer uw potentiële publiek de wereld is, kan honderdduizenden bezoekers betekenen. Niet zo klein, dus.

Hoewel ‘Pepers’ geen Engels is, wordt door het schrijven van een artikel over het onderwerp, en in het bijzonder door het bespreken van de Panama papieren & Panama pepers (en de bijbehorende recepten), verwacht ik uiteindelijk eerste plaats te nemen in zoekmachine rankings.

We zien wel hoe het gaat …

MacBook Pro clamshell mode with the lid open

Or rather: how can I disable the built-in display and carry on working on an external monitor without having the laptop overheat and whine like an aeroplane because the lid is down?

OS X users have spilt a lot of pixels on this and I too was frustrated because my shiny new 34″ screen made the laptop screen redundant; but keeping the lid shut often made the fan turn on.

SwitchResX came to my rescue, not for the first time. It has a daemon option with a menubar icon for turning displays on/off & for switching the resolution.

I got SwitchResX originally because my monitor does picture-by-picture display of 2 computers plugged in to it at once; which is only truly cool if said computers have a screen resolution option for half-a-screen. Which SwitchResX solves by allowing custom resolutions. So I’ve become a fan: it works simply and reliably and solves my problems.

I only recently came across this dance http://osxdaily.com/2012/06/15/yet-another-way-to-turn-off-internal-lcd-display-of-macbook-pro-with-lid-open/ which I haven’t yet tried. I know other attempts to ‘trick’ the screen off failed after Mavericks

Apple MacOS UK Keyboard Layout for Windows & the Command key for Control

If like me, you swap between Mac and PC you’ll have been irritated by everso slightly different keyboard layouts. So here’s my Apple Extended UK Keyboard Layout for Windows Installer.

When I wrote it I was using one of these:
Apple Pro Keyboard
But since the Apple full-size layout hasn’t actually changed since then, I still use it for my aluminium keyboard.

Swapping between Mac and Windows

In addition – even if using a PC keyboard – a Mac-PC swapper will undoubtedly suffer repeated Cmd and Ctrl shortcut confusion: You want to type Cmd-X for cut and suddenly the Win-X menu comes up instead.

My preferred solution for this is an AutoHotkey script, partly because after using Autohotkey for a few weeks I realised it was an utterly brilliant, all-singing, all-dancing customise-your-Windows-in-every-way tool, with an all-but-zero footprint.
My script is https://gist.github.com/chrisfcarroll/dddf32fea1f29e75f564, which also has shortcut keys for arranging windows on a big screen.

The other reason I use autohotkey is that it enables a cherry-picking approach to swapping or duplicating Cmd-key/Ctrl-key shortcuts, which I find works much much better than doing a straight Cmd<=>Ctrl key swap. I got this approach from the keyboard layout used by Parallels on the Mac, which simply duplicated common shortcuts such as Ctrl-X, Ctrl-V to the Cmd-key. If you swap regularly between Mac & PC, this approach works well.

Inverting Mouse Scroll Direction

Since about the time that iPhone launched, OS X scroll direction, both mouse and keyboard, has used the metaphor of “push the document up to move it up the window” rather than the previous “push the scroll bar up to move the document down the window.” Windows has stayed firmly on the scrollbar metaphor.
Oddly enough, Microsoft mice come with a Windows driver that let you reverse scroll direction via the UI. For other mice, you can FlipFlopScrollWheel. Oddly, this is not per-user but per mouse/usb port combination, which means if you plug the same mouse into a different port it’s scrolls in the opposite direction.

Back to the Keyboard

If you do want a more complete Cmd<=>Ctrl key swap, then you do it with Randy’s SharpKeys.

Warning! You can’t swap keys around with it so do just this: map Left-Windows key to Left-Control. The right windows key will then still open the Windows menu and do all the Windows-Key stuff that it should do, such as Windows-L for Lock screen/Switch User:

Sharp Keys: Map just the left Windows key to Control key

If you want other keyboards than Apple UK, download the Microsoft Keyboard Layout Creator to tweak your layout.