Friday, June 29, 2012

Remapping the Macbook keyboard for Windows


So I've been super impressed with how well the MacBook Air manages to run Windows and Mac OS simultaneously using Parallel, much better than my MacBook Pro, both seem to run effortlessly even for graphic intensive applications. But took a while to figure out how to remap the keyboards. So here, mostly for my memory in case I need to do it again

First I needed PC Keyboard Hack which is only necessary to remap Caps Locks. But that's important for me since I have adapted the Unix convention of using that for Ctrl. If you don't care about that you can bypass this first step.

First I disabled caps locks, under the keyboard options.

Then used pckeyboardhack to (mac osx allows some limited remapping functionality of caps locks, but their version creates some delay issues)

remap Caps lock to Control_r

This solves the remapping problem for Windows, but for Mac OS, I'd want Caps Locks to be Command rather than Control, (e.g. copy and paste in windows is ctrl-C, ctrl-V, but it is command-C and command-V in macOS).

So then I installed keyremapformacbook with the following options selected


Command l to option l (only in virtual machine)
Option l to command l only in virtual machine

So that Command L acts as Alt in the virtual machine (otherwise the default Parallels mapping has the location of Alt and Win reversed)

Command r to home
Option r to end

Since home and end are not on the keyboard, and using Fn is annoying especially when I use shift or ctrl with home or end.

Command arrow and command delete work differently in Mac-OS. Option Arrow and Option Delete have the same functionality so:

command delete to option delete
command arrow to option_l arrow

To fix Caps Locks for within MacOS, I want the following option which for some reason is not a default option.

control_r to command_r (except in virtual machine)

Fortunately, Keyboard Remap offer an extensive XML language that lets you create your own re-mappings.
<?xml version="1.0"?>
<root>
 <item>
    <name>Control_R to Command_R (except in virtual machine, RDC)</name>
    <identifier>private.ctrlrtocmdrexceptvirtualmacine</identifier>
    <not>VIRTUALMACHINE</not>
    <not>REMOTEDESKTOPCONNECTION</not>
    <autogen>--KeyToKey-- KeyCode::CONTROL_R, KeyCode::COMMAND_R</autogen>
  </item>
</root>
Finally, to make up for the missing Page Up and Page Down keys, I used Sharpkeys in Windows to Remap F11 and F12. F11 and F12 seem to key in MacOS to remap universally, but I use Ctrl-Page Up and Ctrl Page Down to much in Chrome, so I added the application shortcut Ctrl-F11 and Ctrl-F12 in MacOS to select Next and Previous Tab within Chrome. It still frustrates me that unlike Windows, where every menu item is accessible by keyboard, MacOS is just the opposite, it at least allows nice flexibility in creating keyboard shortcuts. I lastly remapped Option/Alt F, to select the menu bar as well.

Thursday, June 28, 2012

Government shouldn't pick winners: lessons from Solyndra

Cleaning out my inbox I was reminded of this NY Times article about Solyndra, the solar panel company that got on the order of a $billion in loan guarantees that went bankrupt. One of the guiding principles of our policy proposals when I was at the White House was that government shouldn't be picking winners, which makes government loan guarantee programs a bad form of government policy. Politicians like loan guarantees because if all goes well they appear to be "free" but of course they are only free if company doesn't go bankrupt. If the company does go bankrupt, then the government is out half a billion dollars (by point of comparison, adjusted for inflation, the Manhattan Project only cost around $4 billion). In the end, we reluctantly did endorse the loan guarantee in the 2007 Energy Act, because we were convinced that maybe there was a capital market failure in the financing of large energy products, but only with a lot of reluctance because we never fully believed that the capital market failures existed. Now it seems perfectly reasonable that companies like Solyndra couldn't borrow money from the markets, not because of a market failure but because it was a bad investment.

Wednesday, June 27, 2012

My thoughts on Finance

Economics Nobel Prize winner, the psychologist Danny Kahneman had a nice piece in the New York Times not too long ago that describes well his take on the evidence arguing that traders and fund managers on Wall St. don't do any better than a monkey throwing darts. His argument is a little bit blunt, and I think as a psychologist he doesn't care about some of the niceties economists care about when debating the efficient market hypothesis, but I largely agree. Though sometimes I think the only reason I agree is to make myself feel better about not stick to finance.

Monday, June 04, 2012

Medicine Reconsidered

Came across three articles today on the perils of conventional medical thinking which often is based on convention rather than solid evidence, and the few papers that exist often show only correlations not causations. Notably:
1) there's nothing wrong with salt, in fact the recommended levels of salt can be dangerously low (well Alton Brown convinced me of that)
2) we don't need annual physicals (I actually learned that in college when I got laughed at for inquiring about physicals at the health center)
3) the majority of medical studies are wrong (I've actually been following Ioannidas' work for a while now)

Sunday, June 03, 2012

Activist Mischief: Pink Slime

Who wants to eat Pink Slime? The ammonia treated meat scraps the beef industry sells as a cheaper alternative to ground beef. Activists led by Jamie Oliver (who I generally like) have made the pink slime name stick and now it is being eliminated from school lunches nation wide. The thing is not only is Pink Slime cheaper, it is healthier (it contains less fat than ground beef and the ammonia kills bacteria), and tastes better at least according to this informal NY Times taste test

A good case study for my class on the powers and perils of activist politics where choices are driven based on the wisdom of crowds sometimes for the better but sometimes for the worse. (Also kudos to whoever coined the term pink slime for making it stick.)

Amazon Contextual Product Ads