Uninstall Subversive

Although Subversive is the official Eclipse Subversion provider, the plugin itself doesn’t behave very well. In particular, it is impossible to uninstall it (v0.7) using the “Software Updates” dialog. The only option is to delete the jar files yourself (in 2001 I remember hoping that soon, we wouldn’t have to do stuff like this). Here are the files to delete:

(Disclaimer: this worked for me, I make no promises for what it might do to your Eclipse installation)

org.eclipse.team.svn.core_0.7.5.I20081029-1900.jar
org.eclipse.team.svn.help_0.7.5.I20081029-1900.jar
org.eclipse.team.svn.resource.ignore.rules.jdt_0.7.5.I20081029-1900.jar
org.eclipse.team.svn.ui_0.7.5.I20081029-1900.jar
org.eclipse.team.svn_0.7.5.I20081029-1900.jar
org.polarion.eclipse.team.svn.connector.javahl15_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector.javahl_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector.svnkit15_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector.svnkit_2.0.5.I20081024-1200.jar
org.polarion.eclipse.team.svn.connector_2.0.5.I20081024-1200.jar

Finding the real problem

The poster of this thread on the PLT discussion list wondered why Scheme code is so much slower than Python. It was interesting to see how the question was answered because there were at least 3 levels to the problem:

  1. The source code to the solution itself
  2. How the source code worked “under the covers” (it called into C functions)
  3. An implementation in Scheme similar to how Python worked under the covers

Finding an explanation didn’t just involve comparing the code, it required understanding that the Python code actually called into C functions, and then converting the Scheme code into a similar “stateful” style of program. In programming, thinking is required!

Easy FTP mirroring with wget

There are a lot of tools out there for mirroring data, but sometimes you just want to do something very simple: download the latest contents of a FTP directory while leaving what you have already downloaded alone. wget supports a mirror command that provides this exact functionality. Just enter the directory where you would like to store the mirror and execute this command:

wget --mirror [prot]://[username]:[password]@[hostname]/[directory to mirror]

GNU Emacs on Cygwin

While it is possible to run Emacs on Windows, I suspect that Emacs “expects” to be running on UNIX. As such, I’ve decided to perform an experiment and try to do most of my work in Cygwin, including running Emacs. The following is how I did it:
Steps

  1. Create a Windows environment variable named ‘CYGWIN’ with the value ‘tty’
  2. Install Cygwin
  3. Install Cygwin/X
  4. Download-and-install Emacs using the setup.exe (as explained in the documentation linked above), choose the packages ’emacs’ and ’emacs-X11′, and be sure to check the “Bin?” checkbox. If you don’t check “Bin?” it will look like the installer is doing something, but in reality it does nothing (guess how I know that?).
  5. Add this to your .bashrc (see steps below if you want to use Emacs): export DISPLAY=:0.0
  6. Run: source .bashrc
  7. Run: XWin -multiwindow &
  8. Run: xeyes &
  9. Xeyes should pop up. Now try emacs
  10. Run: emacs &
  11. The Emacs welcome screen should appear.

Updating your .bashrc

  1. Open a terminal
  2. Type: emacs -nw .bashrc
  3. Emacs gives you a welcome message. Hit C-l to continue editing.
  4. Go to the bottom of the page
  5. Insert an empty line at the end and type in the text listed above
  6. Hit C-x C-s to save the file
  7. Hit C-x C-c to exit Emacs

References

Addendum: 16/10/08
I removed the unnecessarily complex step re-starting the shell when source’ing would have done just fine.
I wasn’t happy with my explanation for doing this, so I revised it.

HtDP: Problem 9.5.5

In problem 9.5.5, I knew I wasn’t understanding something. I thought that I had followed the recipe, yet I couldn’t solve the problem. That alone was a red flag indicating that I most probably did not follow the recipe!
In this discussion everyone helped me to see what I was missing. The thing was that I was missing something about recursion, the fact that you can figure out what you need to do by combining this thing with the rest of the things.
To specific, the step that I had skipped was literally taking the expected data and using that to determine the combination that needs to occur within the program body. Before, my approach had always been to solve “the whole problem” at once for the recursive step. Following the recipe, you can much more easily see what you are missing.

HtDP: Problem 10.1.9

In problem 10.1.9, I wanted to force a problem to be recursive when it really wasn’t. Matthias and Carl helped me see the difference here in the discussion that followed. Here are some notes:
Matthias:

In HtDP, the word “natural” is a technical word. It means
if your INPUT data definition has a self-reference in the Nth clause for the Kth field then your template has a recursion in the Nth cond clause for the Kth field.
Try this:
An RD is one of:
— ‘doll
— (cons RD empty)
Problem: design a function that counts the number of cons layers around ‘doll.

Carl:

what’s so recursion about it? To be less cryptic, if you read your purpose statement, and apply it to the recursive call, does it make sense? Are you really solving a smaller instance of the same problem, or are you just solving a smaller problem? The former is recursion; the latter is not (and suggests either inlining or a helper function).
For future reference, what I described is a way to tell after the fact whether what you wrote makes sense as recursion, but what Matthias described is the part of the design recipe that tells you whether to use it or not before you even start. Focus on what he said (and what’s in the book) for figuring out how to apply recursion, and you’ll find you can always answer what I asked with “yes”.

Comment Boxes

Originally posted here:

In DrScheme you can comment out code either using semicolons or by using a “box”.
The way that it works is that you:
1. Select the code you want to put in a comment box.
2. Go to the Scheme menu and select Comment Out With a Box.
You may find this particularly useful when you get to the structure template definitions in chapter 6. It makes them much nicer to write, read, and maintain.