Working Through SICP

As I’ve said many times before, I’m a huge fan of The Structure and Interpretation of Computer Programs (SICP), Hal Abelson’s and Jerry Sussman’s seminal work on computer science. It’s a tremendous resource and one that’s available on the Web for free along with a series of lectures by Abelson and Sussman based on the book. It will, I promise you, teach you things you didn’t know and change the way you think about programming.

In the last couple of days, I’ve come across two articles that offer advice on why the SICP journey is worth taking and ways to make the trip easier. The first, WHY AND HOW TO START YOUR SICP TREK by Kai Wu explains what the excitement is about and what well known computer scientists have said about it. Wu explains why the effort required to work through the book is a worthwhile investment and offers some advice on how to proceed.

The second, Learn SICP, Make Friends, provides similar motivation but offers an iPad program that allows you to collaborate with other people working through the text. If working through SICP by yourself seems too daunting, this may be a good alternative.

If you haven’t yet done so, I urge you to take the trek. Be warned, though, it takes some work. The text is well written and easy to read but you really need to work almost all the exercises to get the optimum results. Watching the videos as you read the book is also a good strategy but, again, you really do need to work those exercises.

Posted in Programming | Tagged , , | Leave a comment

Another GnuPG Tutorial

I’ve written many times about GnuPG and other programs that support the OpenPGP standard (the last time here). I really, really wish that everyone would start using it. That would certainly put a crimp in the NSA’s operations.

Over at Digital Era, a site dedicated to discussing tools and methods for protecting our digital privacy, there is a nice tutorial on using GnuPG. The tutorial assumes you’re using Linux but the information is applicable to most Operating systems that support GnuPG. It’s well worth a look if you haven’t yet installed GnuPG or similar system.

Of course, getting Linux users to start using GnuPG is a lot easier than getting your Aunt Millie to start encrypting her email but that’s what’s required to get the NSA and other snoopers out of our email. Nonetheless, it’s a necessary first step: Today email; tomorrow our phones.

Posted in General | Tagged | Leave a comment

Left Turns

Do you avoid left turns when you’re driving? I do. I’ll take different routes to destinations that are across the street from each other to avoid making a left-hand turn against traffic if the destination street has more than light traffic. I do that mostly because I hate getting stuck in traffic waiting to make a turn.

It turns out, though, that it’s the smart strategy and even the green strategy. UPS, who famously uses operations research to plan their routes and other operations, has studied the question and found that avoiding left turns saves time and gas even though it may result in a longer route. One UPS driver estimated that 90% of his turns were right-hand turns and said that UPS really, really hates left-hand turns.

I don’t know about you but I love this kind of thing. It’s geeky and practical at the same time. I especially like results of this sort when they’re counter intuitive as this one is. In any event, if you, too, avoid left-hand turns you no longer need feel silly; it’s the practical thing to do.

Posted in General | Leave a comment

Narrowing to Multiple Regions

One of the joys of writing this blog is the things I learn from the comments. The other day, I wrote about fancy-narrow and that provoked an interesting discussion between Wilfred and Phil. Wilfred compared fancy-narrow to narrow-to-region-indirect. I assumed that narrow-to-region-indirect was a standard command or function that I wasn’t familiar with and put it in my todo queue to investigate. Phil beat me to it and discovered that it was actually a very useful piece of custom code.

The idea is that you clone the current buffer one or more times in such a way that you can narrow to different regions in each of the clones. If the utility of doing this is obscure to you, Zane Ashby has a nice post that gives one use case as well as showing code for a function to do it. As Phil remarks, before he saw that code he used to do the same thing manually.

You might think that you could open a file in a buffer and then split the buffer the appropriate number of times to do this but that doesn’t work because narrowing in one of the buffers narrows in all of them. The trick is to create indirect buffers, which can be narrowed separately. Changes made to the text of any of the indirect buffers is reflected in all the clones and the base buffer so that when you’re finished you can just delete the clones and save the base buffer.

You can find the code to automate this in Ashby’s post or a slightly different version by grayswx in this paste. If you have the need to work in different parts of a buffer at the same time—especially if you want to use different modes in each—this technique (and the function that implements it) could be just what you need.

Posted in Programming | Tagged | Leave a comment

The New Luddites Strike Again

From time to time I take note of some particularly egregious example of stupidity from the new Luddites. The last time was here; see that post for links to the others. Today, we have another example in Judith Shulevitz’s article in the New Republic on how Siri is messing up a whole generation of children.

Shulevitz starts with a vignette about her daughter playing with her iPhone and interacting with Siri. After a while, the daughter gets frustrated with Siri’s inability to hold a full-fledged conversation and tells her she’s fired. That’s not the problem, though. The danger is that Siri will get smarter and be able to hold better conversations. From there it’s a speedy descent into psychobabble. There’s the problem of Siri’s failure to live up to the “maternal expectations” of the child. Then we move onto the possibility that Siri and other modern interactive devices will engender a slave owner mentality in our children.

I won’t bother pointing out the obvious silliness in all this. You should read it and see for yourself. I’ll say it again to these people: If you don’t like the modern world, you’re welcome to ignore it but, please, leave the rest of us alone.

Posted in General | Tagged | Leave a comment

NSA Admits to Warrantless Searches of Americans Phone Calls and Emails

Surprise! It turns out that the NSA was looking at the phone calls and emails of Americans without a warrant after all. According The Guardian, James Clapper sent a letter to Sen. Ron Wyden admiting to the practice. What’s surprising is not that they are doing this—we all assumed they were—it’s that Clapper admitted it.

The problem for Clapper is that he’s been caught lying to Congress on the public record. When he denied collecting information on millions or tens of millions of Americans, Wyden knew he was lying but couldn’t say so because the information was classified. Now Clapper has put the truth on the record.

That should result in his indictment for lying to Congress but of course it won’t. Even if Congress refers the matter to the Justice Department, the DOJ will ignore it just as they did when Congress referred Attorney General Holder for contempt. These people are corrupt and drunk on power. And why not? They obviously have nothing to fear.

Posted in General | Tagged | Leave a comment

Getting Started With the Common Lisp Hyperspec

Jean-Philippe Paradis over at HexstreamSoft has a nice page about getting started with the Common Lisp Hyperspec. If you’re already familiar with the Hyperspec, you’re probably with most of the material. If you’re not, it’s a nice introduction.

One thing that I found really helpful was detailed instructions for installing a local copy of the Hyperspec on your computer. If you often find yourself working off line, that can be a real lifesaver.

Paradis has a lot of Common Lisp material on his site so if you’re there for the Hyperspec introduction, take a look around at some of his other offerings.

Posted in Programming | Tagged , | Leave a comment

Ace-Link

Oleh Krehel has a nifty new package that brings ace-jump-mode functionality to links in help and info buffers. The package, ace-link, makes following links easy by putting letters in front of each link. You follow the link by picking the appropriate letter.

It’s available through MELPA so installing it is easy. The only thing you need to do is initialize the binding (‘o’ by default) by adding

(ace-link-setup-default)

to your .emacs or init.el file. Alternatively, you could set the key map manually and use some other key.

I just loaded ace-link and while I’ve played around with it, I haven’t used it “for real” yet. So far, though, I like it a lot. Just as ace-jump-mode gives you an easy way to jump around in your buffer, ace-link makes it easy to follow links.

Posted in General | Tagged | Leave a comment

SBCL 1.1.17

SBCL 1.1.17 is out. As usual, it built and passed the tests without problems. This months release has a bunch of bug fixes and a couple of enhancements/optimizations. See the NEWS page for details.

And no, despite Rainer Joswig’s April 1st announcement, there is no support for Clojure.

Posted in Programming | Tagged , | Leave a comment

Narrowing the Fancy Way

Bruce Connor has an interesting new package up at GitHub. It’s the fancy-narrow package that, as he puts it, imitates narrow-to-region with more eye candy. At first I hated the idea. Being crotchety and grumpy, I’m inclined to treat “eye-candy” with disdain. After all, didn’t I rail against those who wanted Emacs to be prettier?

After a nice nap, though, I had second thoughts. What fancy-narrow does is identical to narrow-to-region except that instead of blanking the text outside of the narrowed region, it grays it out. The grayed out text is readonly and unreachable. The advantage of fancy-narrow is that the surrounding text is still there for context.

The disadvantage is that the surrounding text is still there. To me, the main reason for using one of the narrowing commands1 is that you see only the text you’re interested in and nothing else is there to distract you. Graying out the other text makes it less intrusive but it’s still there.

I still can’t decide if I like it enough to install but I can see how it might be helpful. What do the rest of you think? Is this something you’d find useful?

Footnotes:

1

As opposed to using it programmatically as a way of making the narrowed region appear as the whole buffer as far some Elisp code is concerned.

Posted in General | Tagged | 5 Comments