All posts by Rian

How-to: Pin Eclipse to the Windows 7 taskbar

Before you begin, close any and all instances of Eclipse.

The Eclipse IDE for Java doesn’t come with an installer like most Windows packages do; it’s a zip file containing the program and the libraries it needs to run. As a result of this, and the fact that it’s written in Java, it has some non-standard behavior characteristics on its edges. One of them is the inability to pin the program to the taskbar like you can with most Windows programs. Another is the fact that when you tap the Windows key and type “eclipse”, eclipse.exe often doesn’t show up. (It might if you put it someplace besides %ProgramFiles% or %ProgramFiles(x86)%, I haven’t tested.)

No Eclipse in Windows search

I use the Windows 7 taskbar heavily, because I like being able to launch programs using Win+[number]. My desktop and laptop are configured identically, so Win+1 always opens Chrome, Win+5 is always iTunes. If you launch eclipse using Windows explorer, and then you try to “pin” the program to the taskbar, you discover that you can’t:

Can't pin Eclipse to taskbar

Well there’s a workaround. Buried in this bug report, you’ll discover that if you edit your environment variables, you’ll be able to pin eclipse to the taskbar. (You’ll need to be logged in as an Administrator):

Edit system environment variables

Edit Windows path variable Java

Add the path to the JRE to what’s currently there, followed by a semicolon. In my case, that would be:

C:\Program Files\Java\jre6\bin;

While you’re editing environment variables, it might not hurt to put in the path to the JDK, so if you ever decide to do Java development outside Eclipse, you don’t need to resort to setting the path by hand every time you launch the CLI. For me that’s “C:\Program Files\Java\jdk1.6.0_22\bin;” but it will change as newer versions of Java are released. If you do this, make sure you put the JDK path after the JRE path. For non-development purposes, you’ll generally want to be using the latest version of the JRE.

My new path looks like this:

C:\Program Files\Java\jre6\bin;C:\Program Files\Java\jdk1.6.0_22\bin;C:\Program Files\Common Files\Microsoft Shared\Windows Live;[etc]

Click OK, and launch Eclipse from explorer as you normally would. You should now be able to pin Eclipse to the taskbar, giving it a home among the rest of your permanently docked programs. Doing it this way means you won’t see two icons when Eclipse is open, which is what happens if you drag eclipse.exe to the taskbar without editing the system path.

Pin Eclipse to Windows taskbar

Gives you:

Eclipsed docked in the taskbar

3 ways to make the CLI (cmd.exe) more friendly

By default, cmd.exe isn’t especially friendly for most tasks, including basic things like copying and pasting text. Displaying long paths while still allowing you to see the commands you’re typing is even worse. Here are a few ways you can make the Windows shell less awful to work in.

Quick and easy stuff

First, the point-and-click options. Right click the bar, go down to Properties. Set the colors and font to whatever floats your boat. On the Options tab, and enable QuickEdit and Insert modes; this allows you to left click highlight/copy text, and right click to paste into the CLI window. (There’s a reason this isn’t enabled by default.)

On the Layout tab, increase the Screen Buffer Size to something more useful. Mine’s set to a height of 1000. If you want the CLI window to be larger or smaller, you can do that, too.

Getting fancier

By default, my fingers type ls when I want the contents of a directory. When I’m in bash, I generally have ls aliased to ls -l, which is pretty close to the standard Windows dir command, so I’ve edited my registry to do this every time cmd.exe is launched (download .reg 258 bytes):

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor]
"AutoRun"="doskey ls=dir"

(You can also do this is HKEY_CURRENT_USER, if you’d prefer this to be a per-user setting.)

If you don’t have permission to edit your registry, or don’t want to, or would rather come up with a script-y way of doing things, the command is “doskey ls=dir”, so you can type this into the CLI whenever you want, or write a script to do this another way. You can also add in other commands, if you find your fingers typing grep instead of findstr, for example.

Icing on the cake

This next piece is, in my opinion, the single most useful thing you can do to make the shell friendlier, aside from enabling Insert and QuickEdit. Using the prompt command, you can alter the appearance of your shell prompt. For example, to get a Unix-like prompt, you can do this:

prompt=$p$_%username%@%computername%:

To get a Terminal.app style prompt, you can do this:

prompt=$p$_[%username%@%computername%]$$$s

As I’m the only user on this machine, and I’m really only interested in my current working directory, I go with a simpler:

prompt=$p$g$_$$$s

which gets me a prompt that looks like this:

My cmd prompt

Play around with the prompt command until you find a setting that you like. (Type “prompt” with no arguments to go back to the Windows default if you make a mistake.) Once you’ve found a setting you like, you can make the change permanent by editing your environment variables.

Tap the Windows key, type “environment variables”, and select “Edit the System Environment Variables”. (You’ll need to be logged in as an Administrator.)

edit system environment variables

Then do the following, entering your prompt options without the equals sign. Click OK and you’re finished!

Set prompt environment variable

The final results of the above look like this:

Final results

Making Word less awful for technical writers

Yesterday Carol Saller, the senior editor of the Chicago Manual of Style, had a post on taming some of Word’s infuriating features. There are some good suggestions there, but I thought I would offer another tip which may be helpful for technical writers, and others who work with a lot of non-standard language: turning off spelling and grammar checking on specific user-defined Styles.

(While I’m going to show you a quick and dirty method of solving this problem in an existing document, you may want to follow the same steps to modify your document template(s).)

Most of my technical writing is for the software industry, which means I work with code examples quite a bit. The idea of checking the spelling and grammar of Python code is a little ridiculous. Have a look; it’s gross:

before monospace font Style

It’s easy to get rid of all this ugly red and green by quickly defining a new Style. Selecting the code or text that you’d like to change, and then create a new Quick Style:

Save Selection as a New Quick Style

Give your Style a name–I’m calling mine “Code”–and then click “Modify”. You can make whatever changes you like there, then head down to “Format” and click Language:

MS Word Format Language

Tick the “Do not check spelling or grammar” checkbox:

Don't check spelling or grammar

Voila! Happy code example. In the Ribbon, you’ll see that the text has been set to the new Code Style:

Happy code 1

If you have other text in your document that needs to be changed to this new Style, find some, then on the Home tab on the Ribbon, go all the way over to Editing -> Select -> Select Text with Similar Formatting, and then apply the new Style to all of the selected text in the document.

Select Text with Similar Formatting

The result is this:

Happy code 2

College is broken

I watched College, Inc. the other day, a documentary about the rise of for-profit colleges. Everyone with an internet connection has no doubt seen their advertisements all over the place: UoP, DeVry, etc. Even some medical schools that have opened recently are for-profit, and for-profit pharmacy schools have existed for a while.

Education as byproduct

Being for-profit doesn’t necessarily make a school “bad”. I was a little annoyed with the PBS interviewer who kept asking whether education should be a business. Education is and always will be a business. Just ask any student who’s taken money out in student loans to pay for school. Ironically, I suspect that for-profit institutions probably have incentives that are more closely aligned with the majority of students’ motivations than their non-profit counterparts. Broadly speaking, students seem to fall into two basic categories: those who are there to learn stuff, and those that are there for the “college experience” which may or may not include learning something. By and large, the students that for-profit institutions attract are those that fall into the “want to learn stuff” category, because they don’t have a lot of amenities that contribute to a traditional college experience.

As a result, colleges and universities engage in quite a bit of activity that has very little educational merit. Building $40MM gymnasiums adds little value to a student’s education, but it does add to an institution’s “sex appeal”. That means it’s fluff. It’s not just athletic complexes and fancy dorms, though. Look at the job postings at these institutions:

How many of these positions directly contribute to a student’s education the way that excellent classroom instruction and strong ties to the public and private sector would? Not many. Instead, most of these job postings piggyback on education itself, increasing overhead, and contributing very little to the success of its customers. In this respect, institutions are more interested in the furtherance of their own legacy and building their brand than they are in educating students. Now I’m not suggesting that these positions are worthless to students; there will always be some overhead in any organization, but the sheer vastness of this overhead in higher education is what’s staggering. Institutions that are directly funded through taxes* have less of this, just like high schools would never have this kind of overhead, simply because the budget doesn’t afford it.

This inefficiency supports a lot of salaries. Luckily for them, demand for education at these institutions is relatively inelastic, so there’s very little incentive to change organizational behavior.

Overbuilding and under-using

The traditional two-semester school year is broken, too. 3.5 months of school twice a year, for four years? That’s dumb. We don’t live in an agrarian society any longer. Change to a trimester or quarter system and go to school year-round. You could even build-in a mandatory co-op program so students can make money in their industry while still being students. One quarter or trimester would be co-op, and the rest of the year would be traditional didactic education. Even with co-op, students could finish in 3 or 3.5 years instead of 4, and be better rounded for it. Perhaps even less if some other changes are made. (Read on.)

Classrooms go unused for 5 months out of the year, limited summer class offerings notwithstanding. Schools’ capital isn’t being utilized efficiently. On top of this, there’s quite a lot of IT infrastructure on your traditional college campus that doesn’t need to exist anymore. General purpose computer labs aren’t necessary for most majors, because computing is now commoditized. Most students have laptops and/or desktops. (Engineering is probably the main exception here, as licensing for engineering software packages is prohibitively expensive for all but the richest students.)

For everyone else, academic discounts exist. Steeply discounted versions of Office Ultimate ($60) and Windows 7 ($65), are available so the argument that students can’t afford Office doesn’t really hold much water. Switch to an open-access wireless network, and you’ve suddenly eliminated quite a lot of physical overhead.

Wealth and ideas are created when smart, motivated people interact with one another. Universities are havens for this kind of interaction. In computer science, for example, getting rid of the computers doesn’t mean you get rid of the student interaction. A school could continue to foster it by making space available that only CS students have access to by taking the computers out of the computer lab but leaving the tables and chairs. Besides, when you break your own stuff, you have to fix it, which is itself a learning experience…

For everyone else, the same principle works, too: get rid of the computers but leave the tables and chairs.

Education vs instruction

Education isn’t the same as instruction. It’s dumb to think that making an engineering student take 10 liberal arts classes makes him “well-rounded”. This is the difference between education and instruction. Instruction is what happens when a student sits in a classroom. Education is the gradual process of acquiring and assimilating knowledge.

Conflating the two is dangerous and ignorant.

For this reason, I think that changing the US model of higher ed to be more like the British model makes a lot of sense. Let college students study what they want within their field. Don’t make them take a bunch of classes that they care nothing about. They’re not going to learn anything in them, and they waste time, money, and attention. Ensure that they can write — and if they can’t, fail them — and set them loose on their CS classes, EE classes, or History classes. The rest is unimportant.

Educated people will learn the other stuff just by being attentive, observant participants in life. And those that won’t learn this information on their own certainly won’t retain it as a result of sitting through some class they hated.

Oh, and let students test out of any class without needing to take an AP exam. If you think one test isn’t enough, then there’s something wrong with your testing methodology, not the student.

Teacher quality transparency

I don’t think a professor’s degree matters. Whether they have a Master’s or a PhD is irrelevant. The only things that matter are that they:

  1. Understand the material
  2. Can effectively communicate the material to students

In this respect, I think sites like Rate My Professors are absolutely brilliant. Throughout my time as an undergrad, whenever possible, I checked the site to scope out who I would try to take, and who I’d avoid. I used to build small dossiers on potential professors based on RMP comments and ratings, and build my curriculum from there, inasmuch as this was possible.

Unfortunately, a lot of professors (and institutions) dislike RMP. You see, RMP brings transparency to an otherwise opaque — and unimportant from the school’s perspective — part of the educational process: teacher quality. RMP isn’t perfect; there’s a lot of crap on there written by idiots for idiots (business opportunity!), but there’s also a lot of quality there if you look closely enough. If RMP built in a meta-review tool like Amazon has, it would suddenly become a lot more useful.

The last semester I was in school, one of my professors told students considering graduate school to check Rate My Professors first, and avoid any program where the professors got consistently bad ratings. I thought this was wonderfully enlightened of him, and of course he was one of the best profs I ever had.

Final thoughts

Y Combinator exists to mass produce successful startup companies. I don’t see why higher education can’t be rebuilt to mass produce effective people. I think the for-profit education sector has a lot to teach the non-profit sector with respect to leveraging the Internet and using capital efficiently. Most students don’t go to school with the goal of being an academic. They go to school because society expects it of them (degree inflation) and/or they want to learn something so they can have a cool job and make money.

In this respect, I’d like to put forward some modest reform proposals:

  1. Have classes year ’round
  2. Let students test out of any class in the curriculum
  3. Get rid of mandatory, off-topic courses
  4. Get rid of unnecessary computer labs
  5. Offer all courses that can be reasonably be offered online, online
  6. Make co-op mandatory, and based on ability as measured by progress through the program (see #2)
  7. Reward teaching excellence rather than research excellence

This might mean a talented CS student finishes his degree in a year. This might mean an English student never sets foot in a classroom. These things are okay. They should be embraced.

 

* All institutions are funded through taxes, even for-profit schools, albeit indirectly. Most student loan programs are government funded or subsidized, which means they’re paid for by taxes.

Stimulus efficiency in a post-industrial economy

As we move into the middle portion of 2010, we’re hitting the fattest part of the ARRA stimulus allocations. While there was a lot of pre-passage wrangling on both sides of the aisle about efficiency and multipliers, there hasn’t been much talk about the stimulus money’s effect on unemployment in recent months. Not since the unemployment rate has been trending in a positive direction. That means it’s a great time to examine stimulus.

Recovery.gov lists 682,779 jobs as “created” or “saved” as a result of the stimulus package. ARRA started doling out money on Feb 17, 2009, and through March 31, 2010, $205.3bn has been laid out. This means that $205.3bn has puchased 682,779 jobs, at a cost of $300,686 per job.

That’s pretty horrible. Apparently it’s not quite as straightforward as this, though, thanks to some fancy hand-waving that magically brings this number down to ~$160,000 through methods that I’ve yet to see explained. Regardless of what you believe, it’s really expensive for Uncle Sam to create jobs using good old fashioned Keynesian stimulus.

Capital intensity

The neoclassical production function is y = (K,L); that is, output is a function of capital (K) and labor (L). Modern macroeconomics throws a lot more into this function to account for other factors, but using the older capital-labor tradeoff is good enough to illustrate my point. In general, there is a tradeoff between capital and labor. You could hire 1,000 men to shovel the streets in the winter, or you could hire one guy with a plow, and the guy with the plow will do more in less time. This is why nations tend towards industrialization.

The United States is a post-industrial economy. Watch a documentary on the Hoover Dam and look closely at the sheer number of men at work. In today’s economy, a large percentage of these men would be replaced with machinery designed to do a specific job.

That means that money is being spent on capital instead of labor because stimulus money is allocated for specific tasks — not to employ workers, which is merely a fringe benefit — and then these tasks are completed by either the public or private sector (or both) using whatever mix of capital and labor is appropriate for the job.

Capital flight

Capital has to come from somewhere. In terms of traditional stimulus spending on infrastructure, you’re mostly dealing with heavy equipment manufacturers, the majority of which are located overseas. In some cases they’re headquartered elsewhere, and in some cases, their manufacturing is located elsewhere. Sometimes both. When one or both of these conditions is met, profit, jobs, or both are shipped across borders into other nations. In this respect, stimulus money is being used to create or sustain jobs in other countries.

It is possible to mandate that firms using government money buy from American corporations — the Fly America Act is an example — but this isn’t possible or desirable in all cases. American heavy equipment manufacturers don’t make all of the machinery necessary to complete some of the larger infrastructure projects that are on the table.

Job destruction and obsolescence

Another problem with stimulus spending is that quite a bit of the funding is to improve efficiency, particularly in sectors like health care. Unfortunately, “improving efficiency” usually means shifting away from labor. In a sector like health care, capital takes the form of computers and software. Primarily the latter. Automating billing, cutting back on administrative personnel, decreasing overhead, getting rid of physical records. These are the things that software is great at; it is a substitute for labor.

Software is a unique example, too. Not only does it destroy jobs in the short run, but it doesn’t create new jobs very quickly, except in the software-based industries themselves, because it’s a virtual good: all you need is a computer, an Internet server, and the intellectual capital required to make it. This breaks the normal supply-demand models in some interesting ways, because supply is functionally unlimited, but price doesn’t go to zero, even after a firm’s fixed costs have been covered. This leads to some very high profit margins.

History is littered with examples of capital displacing entire workforces. Textile manufacture during the Industrial Revolution is the most prominent example in modern history, with huge numbers of people losing their jobs thanks to the electric loom. The upside is that because of this creative destruction, whole new industries are born, and more jobs are created than were destroyed.

This doesn’t lessen the pain in the short term, however. While the labor market can and does adjust for this creative destruction, this obsolescence is occurring so quickly that many of these displaced workers are unable to acquire the skills necessary to find new kinds of employment in the new economy that’s being created. In times past, the technological increase was on the order of 3% per generation (pre-Industrial Revolution), but now stands at about 3% per year. The rapidity of this kind of change is difficult for the labor market to absorb. This is one of the causes of a jobless recovery: technology increases wealth (GDP) without using more workers to get the job done thanks to software advances and other capital-based technologies.

Conclusions

If the goal is mass job creation as quickly as possible, then the government should employ fiscal stimulus as inefficiently as it can. Employ workers where the private sector would use machinery. Employ dozens of people with slide rules instead of one physicist with a computer. Build roads by hand instead of using machinery. In short, pretend we’re a pre-industrial civilization instead of a post-industrial one. This will get you the biggest bang for your buck in terms of rapid, low-cost employment. The work isn’t desirable, and people will jump ship back to the private sector when it starts creating jobs as a result of people spending their money.

In this case, inefficiency props up the labor market in the short term.

The downside to this is that it doesn’t create jobs in the long-term growth sectors like technology, health care, and education, which are physically and intellectually capital intensive. It does, however, get a lot of people employed very quickly.

The death penalty in civilized society

Today, Bob Herbert in the New York Times had a piece on Cameron Todd Willingham, a man executed by lethal injection for the arson murder of his children. Analysis published on August 17, 2009 by Dr Craig Beyler concluded:

in the end, the only (basis) for the determination of arson … is the burn patterns on the floor of the children’s bedroom, the hallway and the porch interpreted as accelerant spill. None of these determinations have any basis in modern fire science.

and

the state fire marshal who investigated the case and testified against Willingham “seems to be wholly without any realistic understanding of fires.” He said the marshal’s approach seemed to lack “rational reasoning” and he likened it to the practices “of mystics or psychics.”

These are some pretty damning statements.

Now, I am against the death penalty, though I wasn’t always, and I posted the article on Facebook as a textbook example of why I believe the death penalty should be abolished. It garnered a few comments, one of which I want to address in a more comprehensive way.

So let’s spend millions of dollars keeping inmates locked up for life, build new prisons, take care of their health problems, etc rather than run the very slim risk that there may be a mistake?

All eliminating the death penalty does is guarantee that people who commit lesser offenses such as manslaughter and rape will be released after the minimum required sentence (or less) due to overcrowding.

I’ve heard this, and similar arguments many times over the years. In the past, I’ve even said similar things myself. However, these arguments are spurious.

  1. It is more expensive to execute a prisoner than it is to lock one up for life. “Fixing the appeals process” is incompatible with lowering that cost, because the marginal cost of holding one more prisoner is quite low, and the appeals process is necessarily time- and labor-intensive. (More below.)
  2. The people who are likely to be released from prison in a real, honest-to-God prison reform are nonviolent criminals. (Drug users and the like) Of the 2.2 million prisoners, 1 million of them are non-violent.

That report, by the way, is from 1999… ten years ago. Many of these nonviolent offenders are in prison for drug-related crimes. Regardless of your opinion of whether or not drugs should be legalized, drug abuse is a medical problem, not a criminal justice problem. As such, it should be dealt with by the healthcare system, not the criminal justice system. Indeed, in any graduate-level mental health program, a significant portion of the curriculum is spent on substance abuse and its treatment. In fact, the federal government itself recognizes this, as it has quite a few openings for substance abuse experts.

There’s plenty of room to improve our criminal justice system from redesigning prisons to reforming the law itself to rethinking how we imprison people instead of just the “why”. Looking back at history offers some lessons as well (long-term imprisonment as a concept is only 200 years old (PPT)). Continuing to execute individuals, and justifying it using counterfactual ideas like “cost savings” doesn’t make sense. If we could reform our criminal justice system to the point where executing one more person made fiscal sense, then we will have made significant headway in criminal justice policy in general. And I would go so far as to argue if we ever get to that point, we won’t need to execute people at all because there won’t be any crimes committed that justify execution.

But of course, we’re nowhere near that point, so it’d be purely a game of “what-if”.

Some numbers:

  • 3,297 people on death row
  • 2,310,984 total prisoners
  • 0.1% of the prison population is on death row

You’re not going to save the system much (if any) money even if you executed all of these prisoners tomorrow.

Going further, the argument seems to be one of ideology: having an opinion and working backwards to justify it rather than letting the evidence guide one to a logical conclusion — even if it is a conclusion that one would otherwise not prefer. Speaking for myself, I have no problem with the concept of putting someone to death, though I could never do it myself. I’m apathetic about the death penalty as an institution, but what gets me going is the possibility of error. If there is a chance that an innocent person could be put to death, the whys and hows of execution are irrelevant. Life in prison is reversable. Execution is not; ergo we don’t kill people. Moral arguments over the right-ness or wrong-ness of killing someone cease to matter.

There are too many possible points of failure. Arguing that we should lower the costs of execution, by streamlining the appeals process while still doing “due justice” to satisfy some moral compunction reeks of trying to alter the world to conform to what one would prefer rather than making policy based on reality.

I have no patience for this kind of thinking.

Other links of interest:

A little morning reading

I read an article last night by Michael Nielsen entitled “Is scientific publishing about to be disrupted?” It was probably one of the best articles I’ve read in at least a month. This morning I woke up earlier than expected, and I decided to check out the author’s background, and suddenly it made sense that I was impressed with the content. Fortunately (unfortunately?) he linked to a bunch of other stuff he’s written, and I found myself popping open new browser tabs as though I were browsing Wikipedia.

This led to a great deal of copying and pasting. 34, two-column, 10pt, 4×0.5″ margin pages later, I have a whole pile of reading material. (I read offline because my attention span whilst on the computer isn’t what it needs to be for longer, denser pieces.) I’ve worked my way through a great deal of it, and I find myself wishing I had stuck with Computer Science a while longer.

In any event, here’s the list. Enjoy.

The last two aren’t written by Nielsen, but they’re worth reading, especially if you’re interested in open science.

Two of the best undersea exploration videos I have ever seen

I’ve never really been a huge fan of undersea exploration, but I did always find it strange that we deploy so much capital (human, financial, intellectual) exploring space while largely ignoring our oceans.

As a longtime subscriber to the TED talks video podcasts (HD podcast), I fell in love with these two presentations, so I thought I would share them here. What’s striking is their ability to make accessible, and even excite those who aren’t normally fascinated by the ocean. I’ve included the links to the HD versions of the presentations. Right click -> Save As to download them.

 

David Gallo on life in the deep oceans (HD download | TED page)
 

 

Robert Ballard on exploring the oceans (HD download | TED page)
 

In my opinion, TED is one of the coolest organizations out there, and I think it’s brilliant that they’ve decided to open up their catalog to the general public, for free. Hi-Def knowledge spillover for societal win.