HOWTO disable middle-mouse-paste in Linux

A coworker couldn’t stand the fact that, on his linux computer, when he accidentally clicked the mouse wheel, it would paste text. He offered to buy me lunch if I could turn it off. Here’s how we did it. Run the following command:

> xmodmap -e “pointer = 1 25 3 4 5 6 7 8 9”

To persist this behavior, edit ~/.Xmodmap and add
> pointer = 1 25 3 4 5 6 7 8 9

Next annoyance: My coworker uses Eclipse, and wants to hit the F10 key. GTK (the toolkit underneath Gnome) maps F10 to pop up the application menu. In RHEL/CentOS 4, there’s no good way to fix it. On my Fedora 6 machine, I did the following:

> gconftool-2 –get /desktop/gnome/interface/menubar_accel

I saved off the value of that, which was “F10”. Then I ran this:

> gconftool-2 –type string –set /desktop/gnome/interface/menubar_accel “Ctrl-Shift-M”

It also works to use gconf-editor to edit the key /desktop/gnome/interface/menubar_accel.

Ethics are about business survival

[Business ethics about survival, leaders told](http://www.deseretnews.com/dn/view2/1,4382,660225718,00.html)

> Ethics aren’t important because they help businesses feel good about themselves… [it] is about staying in business.

> “We don’t ask you to do ethics so you can feel warm and soft and squishy,” Jennings said. “We ask you to do ethics because it is an integral part of long-term business survival. This is the thing you have to stay focused on when the pressure hits. This is the antidote,” [said professor and columnist Marianne Jennings]

[Read more](http://www.deseretnews.com/dn/view2/1,4382,660225718,00.html)

Who’s in Control?

Who’s in control of our climate anyway? Could we have prevented Hurricane Katrina? One thing is for certain — we like to feel that we’re in control. We don’t like to admit it when we’re not in control, and we would rather deceive ourselves so that we feel “empowered” — it’s more comfortable that way. The issue of global warming, or climate change as it’s now being called, is one where we’ve been comfortably deceived.

I believe that we, as human beings, have very little control over the climate, and even less scientific understanding about it.

I also believe that we ought to be responsible with our environment. Air quality makes a difference in our lives, as does having enough clean water, electricity, and so on. We have some degree of influence over these things.

The rhetoric surrounding climate change subtly passes off the following assertions as fact:

1. The earth is warming up
2. The warming trend will continue and will have terrible consequences
3. Humans are causing the warming
4. Humans must stop the warming at any cost, and thus prevent terrible consequences

None of these assertions have stood up to scientific scrutiny. Here is what we know:

1. The earth goes through periods of warming and of cooling. Scientists were proclaiming global cooling in 1973, as was the New York Times.
2. Experts have difficulty accurately predicting the weather more than a week in advance. Predictions of long-term catastrophic consequences resulting from global warming are not science — they’re guesses.
3. Scientists aren’t sure of the cause of recent warming trends. They make guesses, and try to disprove those guesses. Some climate scientists believe that solar radiation is the cause of warming.
4. Long-term attempts to change the climate without a solid understanding of the science allows for little more than political and economic opportunism.

Disturbing trends that I see include

* Smearing experts who dare to disagree with official reports about global warming.
* Dishonest rhetorical tactics including the bandwagon fallacy and the big lie.

Several disorganized links follow.

James Wanliss, a space physicist who teaches at Embry-Riddle, showed students
the two films in an honors course titled “The Politics and Science of Fear”
because he said more and more the public is being sold one side of an issue
with many dimensions.

“I fear that attempts are being made to purposefully subvert
the public understanding of the nature of science in order to
achieve political goals,” he wrote in an e-mail. “Science is
not about consensus, and to invoke this raises the hackles of
scientists such as myself. The lure of politics and publicity
is no doubt seductive, but it nevertheless amazes me that so
many scientists have jumped on the bandwagon of consensus
science, apparently forgetting or ignoring the sad history of
consensus science.”

Wanliss argues:

“The atmosphere is incredibly complicated, and we know very
little about it,” he said. “We are studying a system which is
so big . . . we don’t know what all the variables are.”

[Read more…](http://www.news-journalonline.com/NewsJournalOnline/News/Local/newEAST01ENV051207.htm)

Almost as soon as the Kyoto Protocol on global warming came into effect on February 15, Kashmir suffered the highest snowfall in three decades with over 150 killed, and Mumbai recorded the lowest temperature in 40 years. Had temperatures been the highest for decades, newspapers would have declared this was proof of global warming. But whenever temperatures drop, the press keeps quiet.

Glaciers retreating? Not true.

[Read more…](http://timesofindia.indiatimes.com/articleshow/1034077.cms)

Debate over the role of the sun in forcing temperature change is nothing new. Professor Ian Clark of the Department of Earth Sciences, University of Ottawa, wrote on this theme on this page in 2004. The climate models used by the United Nations’ Intergovernmental Panel on Climate Change do not take adequate account of solar activity, Mr. Clark said. “Past and recent climate warming can be explained by changes in solar activity,” he said.

[Read more…](http://www.canada.com/nationalpost/financialpost/story.html?id=9e919563-e44b-4ca2-9706-8af9cf743c95)

It is worth noting that anyone even remotely skeptical of the standard model
of global warming faces an almost insurmountably quixotic task. The view that
human industrial and other economic activity is filling the air with carbon
dioxide and causing the planet’s temperature to rise is taught to nearly all
the nation’s children and has been for years. It continues to be taught all
the way through high school and into college. It is endlessly reported….

The task of the skeptic is made even more difficult by the burgeoning effort
to silence dissent. There have been calls recently to equate global-warming
skeptics with Holocaust deniers and to have them punished as the equivalent of
war criminals.
[1](http://gristmill.grist.org/print/2006/9/19/11408/1106?show_comments=no), [2](http://www.reviewjournal.com/lvrj_home/2007/Feb-25-Sun-2007/opinion/12749419.html)

One of the oft-repeated mantras of the global-warming crowd is that there is
no longer any debate in the scientific community about the threat of global
warming. That is just not true. While there are many scientists who firmly
believe global warming is real and it is a threat, there are many other
scientists who have serious reservations about that judgment.

[Read more…](http://www.jbs.org/node/2879)

Six different Antarctic ice core studies… [found] that the CO2
concentrations lagged behind changes in temperature, rather than led them.

[Read more…](http://wnd.com/news/article.asp?ARTICLE_ID=55646)

In New York’s Newsday, Ellis Hennican describes a three-on-three debate held last week in New York City, in which opponents of the global warming hysteria–including that meddling novelist Michael Crichton, along with distinguished British scientist Phillip Stott and MIT’s Richard Lindzen–took on some of the scare’s defenders. The interesting things about this debate is that the organizers polled the audience before and after the event. The result? The number of people who thought that global warming is a “crisis” dropped from 57% to 42%.

That’s why folks like Al Gore have to keep claiming that there is an iron-clad “consensus” on global warming and that the debate is “over”–because the moment the debate on the scientific merits of global warming is actually allowed to begin, the alarmists start to lose.

[Read more…](http://www.realclearpolitics.com/articles/2007/03/what_al_gore_really_wants.html)

In Monday’s 5-4 majority ruling of the Supreme Court in Massachusetts v. Environmental Protection Agency, the court held that the EPA is obliged to treat every [human-created] substance on earth as a pollutant to be regulated, unless it can demonstrate why that substance is not a pollutant.

In the new environmentalist utopia, all that which is not permitted is forbidden, and we are all guilty until proven innocent.

[Read more…](http://www.realclearpolitics.com/articles/2007/04/guilty_until_proven_innocent.html)

[Global Warming: The Cold, Hard Facts? By Timothy Ball](http://www.canadafreepress.com/2007/global-warming020507.htm)
Global Warming is not due to human contribution of Carbon Dioxide
Monday, February 5, 2007

(Dr. Tim Ball, Chairman of the Natural Resources Stewardship Project, is a Victoria-based environmental consultant and former climatology professor at the University of Winnipeg.)

What I have experienced in my personal life during the last years makes me understand why most people choose not to speak out; job security and fear of reprisals. Even in University, where free speech and challenge to prevailing wisdoms are supposedly encouraged, academics remain silent.

I once received a three page letter that my lawyer defined as libelous, from an academic colleague, saying I had no right to say what I was saying, especially in public lectures. Sadly, my experience is that universities are the most dogmatic and oppressive places in our society. This becomes progressively worse as they receive more and more funding from governments that demand a particular viewpoint.

Another cry in the wilderness is Richard Lindzen’s. He is an atmospheric physicist and a professor of meteorology at MIT, renowned for his research in dynamic meteorology – especially atmospheric waves. He is also a member of the National Academy of Sciences and has held positions at the University of Chicago, Harvard University and MIT. Linzen frequently speaks out against the notion that significant Global Warming is caused by humans. Yet nobody seems to listen.

A blog from Climate Scientists

[http://www.realclimate.org/](http://www.realclimate.org/)

[Environmental Defense](http://www.environmentaldefense.org/page.cfm?tagID=1011)
In my opinion, the site is full of dishonesty. They claim that “There is no debate among scientists about the basic facts of global warming.”

A scientific look at the facts says, in summary, “the large temperature increases predicted by many computer models are unphysical and inconsistent with results obtained by basic measurements. Skepticism is warranted when considering computer-generated projections of global warming that cannot even predict existing observations.”

[Read more…](http://brneurosci.org/co2.html )

It is a highly inconvenient truth that the latest IPCC scientific assessment undermines many of Gore’s most spectacular claims. The IPCC says the worst-case sea-level rise this century would be 23 inches; Gore portrays 20 feet or more in his horror film. Ditto for Gore’s claims about hurricanes and melting ice caps; the new IPCC fails to bolster Gore’s alarmism.

[Read more…](http://www.pacificresearch.org/press/opd/2007/opd_07-03-21sh.html)

The Great Global Warming Swindle is a documentary film by British television producer Martin Durkin that presents claims that oppose the predominant [political] opinion on global warming.

[Read more…](http://en.wikipedia.org/wiki/The_Great_Global_Warming_Swindle)

[http://www.junkscience.com/Greenhouse/](http://www.junkscience.com/Greenhouse/)

[The Skeptical Environmentalist](http://www.lomborg.com/books.htm)

In The Skeptical Environmentalist Bjørn Lomborg challenges widely held beliefs that the global environment is progressively getting worse. Using statistical information from internationally recognized research institutes, Lomborg systematically examines a range of major environmental issues and documents that the global environment has actually improved. He supports his argument with over 2900 footnotes, allowing discerning readers to check his sources.

Lomborg criticizes the way many environmental organizations make selective and misleading use of scientific data to influence decisions about the allocation of limited resources. The Skeptical Environmentalist is a useful corrective to the more alarmist accounts favored by green activists and the media.

[Read more…](http://www.lomborg.com/books.htm)

The tyranny of ‘global warming’
“Skeptics such as myself and Dr. Legates are the voices in the crowd crying out that ‘the emperor has no clothes.’ We do so at great professional risk, and for little or no personal/professional benefit. The response to this skepticism is, at best, to be ostracized by our peers and, at worst, threatened with reprisals that include losing jobs, demotion or lack of advancement in our fields. This brings forth one final point: Why are the global warming proponents so determined to end the debate over global warming? If the evidence in support of the idea is so overwhelming, it should only be a matter of thoughtful debate and time before everyone comes to agreement on it. Yet, skeptics and dissenters are discredited, threatened professionally and encouraged to keep silent on the issue. Throughout history, tyrants and despots have made their first priority the end of debate and the silencing of their critics.”

[Read more…](http://www.worldnetdaily.com/news/article.asp?ARTICLE_ID=54092)

The other ‘green’ in global warming

Dr. Freidrich Seitz, president emeritus of Rockefeller University and former president of the National Academy of Sciences, said:

“I have never witnessed a more disturbing corruption of the peer-review process than the events that led to this IPCC report. Nearly all the changes worked to remove hints of the skepticism with which many scientists regard global warming claims.”

A hundred distinguished scientists, meeting in Leipzig, Germany, released a joint statement July 10, 1996, which said:

“There is still no scientific consensus on the subject of climate change. On the contrary, most scientists now accept the fact that actual observations from earth satellites show no climate warming whatsoever.”

From that point forward, any scientist who dared to offer research results that did not affirm the conclusions of the IPCC has been denied invitations to participate in the IPCC studies, denied funding and/or denigrated publicly by politically motivated scientists and/or the media. Any scientist who dares express skepticism is at once denounced as a pawn for the oil and coal industry.

[Read more…](http://www.worldnetdaily.com/news/article.asp?ARTICLE_ID=54074)

[Global Warming: The Perversion Of Science](http://www.opinionet.com/article.php?id=1486)

[Global warming: Hoax on economy](http://www.theunion.com/apps/pbcs.dll/artikkel?SearchID=73172159860226&Avis=TU&Dato=20040301&Kategori=OPINION&Lopenr=103010111&)

Our research shows fundamental flaws in the “hockey stick graph” used by the Intergovernmental Panel on Climate Change (IPCC) to argue that the 1990s were the warmest decade of the millennium. The original hockey stick study was published by Michael Mann of the University of Virginia and his coauthors Raymond Bradley and Malcolm Hughes. The main error affects a step called principal component analysis (PCA). We showed that the PCA method as used by Mann et al. effectively mines a data set for hockey stick patterns. Even from meaningless random data (red noise), it nearly always produces a hockey stick.

[Read more…](http://www.uoguelph.ca/~rmckitri/research/trc.html)

Wikipedia covers the controversy surrounding Global Warming. I
believe that Wikipedia is a good resource, but that the information available
is biased toward what the popular culture believes (whether it’s correct or
not). The issue of global warming is no exception.

[Read more…](http://en.wikipedia.org/wiki/Global_warming_controversy)

Morse Code Tutor

Here’s a morse code tutor I’ve been using. It works on Windows, Linux, Mac and Dos: [http://c2.com/morse/](http://c2.com/morse/)

SSH File System (sshfs)

I find that using `scp` to repeatedly copy files to a remote host gets tedious. Setting up NFS or Samba is often either not a viable choice, or is more work than seems warranted. Recently, I started using SSHFS, which I highly recommend. It works well because most servers I connect to support SSH, and therefore, my Linux box can use SSHFS to connect to them. Here are instructions for setting it up on Fedora Linux: [http://fedorasolved.org/server-solutions/sshfs/](http://fedorasolved.org/server-solutions/sshfs/)

glibc malloc hooks and TLSF

Recently, I was asked to constrain the memory usage of an application on Linux. Glibc provides hooks for [malloc, free, etc](http://www.gnu.org/software/libc/manual/html_node/Hooks-for-Malloc.html). By the way, the hook functions are responsible to guarantee thread safety — glibc doesn’t do it automatically. I used the malloc hooks in combination with a memory manager that a colleague found: TLSF. There are two implementations:

* [http://tlsf.baisoku.org/](http://tlsf.baisoku.org/) (public domain)
* [http://rtportal.upv.es/rtmalloc/](http://rtportal.upv.es/rtmalloc/) (GPL)

There are benefits and caveats when using a custom memory allocator. TLSF was meant to shine for real-time use, because the overhead of malloc and free are O(1) constant-time operations. On the other hand, TLSF isn’t thread-safe.

mtnwestruby: Meta Notes

Mountain West Ruby Conference: Meta Notes
17 March 2007

Setup. When I arrived, the conference organizers were setting up the auditorium
with power extension cables, network cabling, etc. Having a wired network
connection was very nice, although Wi-Fi was available.

Attendance was better on Friday than on Saturday.

Laptops. I’d estimate that nearly half of attendees had Apple laptops. Nearly
half of the presenters used Apple laptops, and of the remainder, half used
Windows and half used Linux.

Editors. Of the presenters that edited code on-the-fly, one used emacs, one used Textmate and the rest used VIM. None used an IDE.

JRuby or Ruby.NET. It seems like my app would become tied to the platform if I
use the libraries from that platform. This would make it difficult to go from
JRuby to Ruby.NET, or visa-versa. Or difficult to move from JRuby or Ruby.NET to
traditional Ruby.

mtnwestruby: JRuby

Mountain West Ruby Conference: JRuby by Charles Nutter and Ted Enebo
16 March 2007

Most of the developers in the auditorium have been Java programmers, and don’t
want to go back. Charles said that they have a hard time getting the message
out that JRuby isn’t about Java, it’s about Ruby, and they’ve aimed to make
JRuby as compatible as possible with Ruby.

Background: They’ve both been Java developers for the past ten years, and
their goal is to make Ruby a first-class language on the Java platform. They
didn’t start the JRuby project — they adopted it.

Ruby 1.8 Design Issues:

  • Green Threading doesn’t scale across multiple processors/cores. The
    one-size-fits-all scheduler doesn’t fit all platforms where it runs. Although
    Ruby 1.9 will use native threads, there’s much work left to make it work on
    various platforms. Java/JRuby already uses native threading and scales across multiple processors and cores.

  • Partial Unicode support. Ruby 1.9 will have Unicode support, but will bring with it other difficult issues (e.g. what happens when you concatenate two strings, each being in a different encoding?). In JRuby, one can use Java Unicode strings, or the Rails Unicode library.
  • Slower than most other dynamic languages. Makes it difficult to sell to management. It’s a long term perception problem for the language. JRuby will allow compiling to bytecode, which allows HotSpot to do JIT optimization.
  • Garbage collection is simplistic. JRuby uses Java’s best-in-the-world memory management and GC. Scales well to enormous applications and loads, and is battle-tested in deployments worldwide.
  • C language extensions can crash the Ruby runtime, don’t necessarily interact well with garbage collection or with threading. JRuby lets you use Java-based extensions, which aren’t going to crash the VM.

Politically, it’s easier to get JRuby into an organization than Ruby, because
organizations have already accepted and deployed Java. JRuby is just a library for Java.

Most “pure” Ruby code runs on JRuby, and Rails mostly runs on it, although
only 90% of ActiveRecord passes unit tests. It’s easier to write JRuby code
than Java code. Perhaps Java is good for implementing libraries, and JRuby is
good for using those libraries for implementing applications.

JRBuilder/Cheri project by Bil Dortch lets you build Swing apps in JRuby much
more easily than writing Java code. Demo shown. Project is still in development.

NetBeans Ruby support is a one-man developer effort by Tor Norbye. His
progress has been impressive. Demo shown. Code completion, syntax
highlighting, built-in ruby documentations, go-to-declaration, auto-indent,
rename support, built-in interactive ruby shell (irb). By the way, Charles
uses vim, and Ted uses emacs. NetBeans Ruby uses the JRuby AST to do its work.

Speed. Interpreted JRuby is currently generally slower than Ruby 1.8.5, although some things are faster. They’re working on making it faster, and should be able to achieve comparable performance to Ruby 1.8.5. Compiled Ruby (bytecode) runs faster on the JVM than it does on Ruby 1.8.5.

Q: How can you make a JRuby app deployable so that people don’t know it’s a Ruby app or a Java app?
A: Make your ruby app into a jar file, and just double-click it.

Q: How easy or hard is it to deploy JRuby apps to servers?
A: Use Sun’s glassfish deployment framework.

mtnwestruby: Review of a Rails App

mtnwestruby: Review of a Rails App by Marcello and Jamis of 37signals.com
17 March 2007

Almost everyone in the audience has used Rails. A little less than have write Rails apps for a living. I haven’t used Rails, and even if I had, it would be difficult to take notes on this presentation. I recommend viewing the video when it becomes available.

Marcello and Jamis recommend Kent Beck’s book on Smalltalk best practices and how to decide what code belongs where. They also recommend Domain Driven Design.

Why do you prefer the operator ‘&&’ over ‘and’? The use of ‘&&’ leads to fewer bugs. Consider the following code:

  • return foo and bar # will not return what you expect
  • return (foo and bar) # this will work
  • return foo && bar # use ‘&&’ and ‘||’ because they’re more predictable in behavior than ‘and’ and ‘or’

Convention: A bad smell in code is seeing a chain of if..elsif
statements to check for error conditions. In this case, you probably want to
handle error cases with exceptions. For example, in Rails, myobj.save! will
validate data, and raise an exception when there’s a problem, whereas
myobj.save will not raise an exception.