braindump's posterous

braindump's posterous

braindump  //  Stuff I find all over, placed here so I don't have to remember it myself. My interests are mainly technology, medicine, and politics.

Jan 31 / 11:59am

Mac OS X Terminal: Enable Auto-Completion

Bash_screen

Simply create a .inputrc file in your home directory. In Terminal:

 cd ~
  echo "set completion-ignore-case On" >> .inputrc
  echo "TAB: menu-complete" >> .inputrc

Close and open your Terminal window, and try it out using the <tab> key:

  cd ~
  cd m<TAB><TAB>

You should see the Movie directory after the first <tab>, followed by the Music directory when you type the second <tab> (assuming you have a standard home directory). This also works on commands and variables (but is case sensitive with variables).

Filed under  //  Apple  

Comments (1)

Nov 17 / 8:05pm

Graphing Tool for Climate Data

Climate_graph

This online graphing tool from WoodForTrees.org allows for fairly nice charts comparing datasets related to climate. It has a nice interface, including trend-lines and averaging. The data sets can be removed or added from the chart quite easily.

Note that these data sets are baseline anomalies; i.e. the temperature for each month of the first year of the data set is subtracted from the rest of the years. Because the baseline years are different for each data set, the data sets will be offset from each other slightly, and must be adjusted accordingly. The example graph in the link above includes these offsets.
Filed under  //  environment  

Comments (0)

Sep 21 / 8:12pm

New Python Command Behaviour under Snow Leopard, Mac OS X 10.6

Python_icon

Starting with Snow Leopard, Mac OS X 10.6, the python command in the terminal defaults to Python version 2.6 (Leopard was version 2.5.1). However, you can still get backwards and forwards compatibility by using the python2.5 or python3.0 commands.

To get executable scripts to run in a particular version, they should be prefaced correctly, eg:

#!/usr/bin/env python2.5

Also new is that version 2.6 and 3.0 default to the 64-bit environment.

Check out man python for more information.
Filed under  //  Apple   Python  

Comments (0)

Sep 10 / 9:38pm

The Blu-Link Universal Remote for PS3

I may have found the perfect remote control for me.

Blu-Link Remote

Blue-Link Universal Remote on left replaces up to 6 other remotes, including the PS3

Pros:
  • Works as a PS3 Blu-ray Disc remote
  • Full assortment of buttons ensures complete control
  • Compact size
  • Learns keys for easy remapping or odd devices
Cons:
  • Small button size
  • A few buttons oddly placed

Most of us have an array of remote controls by our side when we watch TV: there's another one for the cable or DVR, your DVD player, and possibly your stereo. Add a PlayStation 3 with its Bluetooth remote, and you have an impossible situation.

Leaving aside the PS3 for now, many people think about getting a Universal Remote to reduce the clutter and confusion. In fact, many devices ship with a remote that can be programmed for other devices. But their biggest flaw is that they don't have enough buttons to handle all the features of the dedicated remotes. Some more expensive models try to get around this with LCD touch screens that can be programmed, but you lose the tactile feedback: you have to look at the remote to operate it. And getting one that also controls your PS3 for Blu-ray Disc playback?

The Blu-Link remote from SMK-Link solves these problems with a learning remote that has 50 buttons laid out in a logical fashion, plus a Bluetooth radio to control your PS3. I purchased the remote directly from the company, and it was shipped that same day. It comes in those darned blister packs with an easy-to-read English-only manual, and a pair of AA batteries.

Setting it up was quite simple: hold down the device key for 3 seconds, then punch in the product code from the manual or from the product website. You may have to try several codes to find the one that has all the functions of your old remote.

I did find some of the keys were in odd places. For example, the Favs key was above the Vol key, instead of the CH key on most remotes. However, this is where the learning feature comes in handy. Hold down the device key for 3 seconds again, then hit the red Rec key to enter learning mode. Press the key you want to change, and point your old remote at the top end of the Blu-Link and press the key you want learned. I never had any problems with this feature. I was also able to program my Apple TV remote into the Aux device this way, something non-learning remotes have trouble with.

Programming the PS3 was similarly simple. You have to pair the remote with your PS3 from the Settings»Accessories»BD Remote on the PS3 XMB (Cross Menu Bar). You'll need a PS3 controller for this step.

In use, the Blu-Link remote worked great. It is smaller than my other remotes, so will be comfortable in smaller hands. The downside is that the buttons are a bit small. If you don't hit them in the center, some also tend to get caught in the down position. This was unusual, though. Another aspect you'll need to get used to is that the central button for players is the Pause button, rather than the Play button on all my other remotes. If this gets really annoying, I can always remap the buttons through the learning function.

A great feature is the volume punch through. You can be on the PS3 or DVR/DVD, but the volume and mute commands will go to your TV by default. This saves you from having to push the TV button first. You can change this to another device, such as a stereo, or turn it off completely. 

I didn't notice any difference in range from my other remotes. The receiver actually seemed to be the differentiator: some devices needed to have the remote pointed directly at it, while others picked up the command with the remote pointed at the ceiling.
Filed under  //  PS3   technology  

Comments (1)

Aug 6 / 6:31pm

Fun Experiment with HTML5 and Audio

Demo: http://9elements.com/io/projects/html5/canvas/
Blog: http://9elements.com/io/?p=153
 
This is an interesting page that shows a bit of creativity with the Canvas and audio tags in HTML5. Swirling dots pulsing to a down-tempo track. What's not to like?
 
You'll need a modern browser such as Firefox 3.5, Safari 4, and the latest betas of Google Chrome and Opera.

There's a bit of cursor interactivity, and if you click, you get a tweet. I'm not sure, but I suspect the pulsing is not to the music itself, but rather to the incoming tweets. Just a guess.

Music by Spokenlounge: http://www.spokenlounge.com/

Filed under  //  computing  

Comments (1)

May 13 / 4:36pm

What Makes Us Happy

Earl Trotting

http://www.theatlantic.com/doc/200906/happiness

The Atlantic has an excellent story by Joshua Wolf Shenk on the findings of a longitudinal study of mental and physical well–being on 268 male Harvard sophomores, beginning in 1937 and continuing on for more that 70 years. Currently under the curation of psychiatrist George Vaillant, the study contains a wealth of information on how these men handled life, and how it turned out for them as a result.

The article itself has many interesting snippets of case studies; some starting off well but ending incongruously badly; a few living charmed lives. Even John F. Kennedy is mentioned as a subject, although his particular file is sealed until 2040.

But the secrets of happiness are rather succinct. Vaillant found these seven factors:
  • Healthy response to adversity
  • Education
  • Stable marriage
  • Not smoking
  • Not abusing alcohol
  • Some exercise
  • Healthy weight
Vaillant found that 50% of those who had five or six of these factors at 50 ended up "happy–well" at age 80. None of those having three or fewer factors were happy–well at 80. Those men were also three times as likely to be dead at 80 as the men with four or more factors.

He also found that cholesterol had little to do with health in old age. And social ease at early age became less significant over time. Physical exercise in college didn't predict physical health later on, but it did predict mental health. And depression took its toll, as 70% of those who were diagnosed with it by age 50 had died or were chronically ill by 63.

Early traits did predict political affiliation, however. The sensitive, cultural and introspective went on to become Democrats, while the pragmatic and organized became Republicans.

The final trait Vaillant found important was social relationships. Their relationships at 47 predicted their late–life adjustment almost as well as the other factors. And 93% of those thriving at 65 were close to a sibling when younger.

Shenk doesn't stop there, of course, and goes on to talk about other studies and positive psychology itself. And finally, into the life of Vaillant himself, and what drove him to shepherd one of the most important long–term psychological studies ever, for over 42 years.
Filed under  //  psychology  

Comments (5)

Apr 13 / 11:10am

Carbon Dioxide Trends: Going Up and Up

Co2_trend_gl2

http://www.esrl.noaa.gov/gmd/ccgg/trends/index.html#global

If you want to keep an eye on how the global CO2 levels are doing, this is probably the place to do it. You can see that the levels are increasing at a greater rate despite a global economic slow–down. I'd be speculating, but if the oceans are not absorbing CO2 as readily and more sequestered CO2 is being released from melting permafrost and deforestation, that might explain some of the increase. If that's the case, then we can expect to see CO2 levels accelerate.

The historical trend can also be seen here:

Co2_data_mlo2

http://www.esrl.noaa.gov/gmd/ccgg/trends/co2_data_mlo.html

Note that the historical chart is from the Mauna Loa Observatory data only, rather than the global mean as above.

Filed under  //  environment  

Comments (1)

Apr 8 / 9:00pm

Novel Photon/Electron State For Efficient Lasers

Blue Lasers

Richard Webb in NewScientist writes about a novel way of creating laser light, developing from an unusual mixture of electrons and photons. This technique could result in better amplifiers for communications, as well as very efficient lasers.

It starts pretty much the same way as normal semiconductor lasers do: a layer of trapped electrons are excited into a higher energy state, which emit photons when they fall back to normal. But the photons released are quickly reflected back to the electrons by polished mirrors about a micrometer away. The reflected photons excite more electrons, and the process begins anew.

The spacing of the mirrors create a resonance, with the photons creating excited electrons and electrons creating photons so quickly that quantum theory predicts that it is impossible to determine in what state is the system. This cloud of photons and electrons is called a polariton, or more specifically, an exciton–polariton, since the electrons are really part of an electron and hole pair (the hole being where the electron left when it became excited) known as an exciton.

In a normal semiconductor laser, the electrons won't occupy the same quantum state without a lot energy put into the system. But polaritons do this easily, requiring much less energy to get going. This energy can be supplied by a voltage, or by photons from an outside source.

Researchers from universities of Sheffield and Southampton, both in the UK, showed in 2000 that laser light shone into such a system could be amplified by close to 100 times, a remarkable feat. But it has proven difficult to reproduce this with materials that work at room temperature. Also difficult is to producing a lasing effect using electrical pumping of the material. Work at the University of Crete in February 2009, however, has resulted in a room–temperature polariton–based LED that is electrically driven. These LEDs could prove to be more efficient than normal LEDs.

Webb's article goes on to describe how these polaritons could also be used as logic circuits themselves, while creating the light needed for rapid communications between components in a computer system. Even further, there is the possibility that they could be used for quantum computers.
Filed under  //  technology  

Comments (0)

Apr 6 / 8:49pm

Canadian Banks Got Lucky

Bank of Canada

http://www2.macleans.ca/2009/04/06/our-so-called-genius-banks/

Andrew Coyne writes in Macleans.ca that there is more to the relative success of Canadian banks than you hear about in the press. While many in the US think that these banks survived by sticking to the deposits and loans business, this is actually untrue—many of the banks bought out brokerages in the 90s. But there are important differences:
  • The “Fathers of Confederation” who put together the governmental structure of Canada decided to give federal charters to banks. As a result, there are now five major national banks with a century or more of experience, a broader base of depositors, and less vulnerability to local economies. In contrast, the US has over 8000 banks, many with very local reach.
  • Being nationally chartered, Canadian banks don't have to wade through the patchwork of regional regulations that afflict the US system. It was often these regulations that motivated the US banks into making creative financial decisions.
  • All aspects of the Canadian financial sector, be it investing, banking, or insurance, are overseen by the same organization: the Office of the Superintendent of Financial Institutions (OSFI). This allows the OSFI to provide a stabilizing hand over the whole industry. The US has a separate organization for each component.
  • The OSFI isn't rule–based, but rather steps in when it sees banks getting out of hand, and nudges them back into safer waters.
  • The OSFI is strictly concerned with minimizing risk, so banks are not pressured to give loans out (by governments anyway) to specific groups. That isn't to say that Canadian banks didn't get caught trying to make money on things like mortgage–backed securities, which cost them $20 billion (CAD) in write–downs.
  • And finally, Canadian banks got caught in a few crises in the early 80s and 90s: Third–world debt, and large real–estate project collapses. These weren't large enough to cause any bank to fail, but they were definitely painful. And they were recent enough that the Canadian banks were still stinging a bit when the party down south started up.

Filed under  //  economy   politics  

Comments (0)