adventures in elisp

samer masterson

hiking manhattan

I couldn’t go hiking today because the ticket to the hiking spot was $25 roundtrip. So I decided to “hike” from the bottom of manhattan to the top. I took some pictures. It was actually kind of intensely boring, I’m surprised I made it all the way to the top. The middle of manhattan is all clean and nice, it doesn’t get interesting until you reach harlem. It took me like 4 hours.

My gear: barely enough water (had to buy a bottle on the way up), notebook for writing thoughts, keys, knuth, and rubber bands for self-defense.

Saw some pidgeons at the bottom of manhattan. They’re so cute!

This pidgeon’s name is jeffery.

Started at the bottom…

Cool, cool water :)

Tried to pry this off so I could join the ninja turtles. Down with shredder!

That sign says “the bronx”.

“Those are some good pictures” - eric shoyang. This is my artistic interpretation of the harlem river.

puzzles yay!

I took The Art of Computer Progamming Volume 4, Fascicle 0: Introduction to Combinatorial Algorithms and Boolean Functions home last night to read instead of my usual, the dragon compilers book. AOCP Vol 4 Fas 0 is all about graphs and combinatorial puzzles. The book starts off with Knuth talking enthusiastically about how much he loves combinatorial problems, and the first chapter starts off with a couple of historical combinatorial puzzles. I’m not usually into puzzles, but these were actually so much fun.

Langford pairs

You are given the numbers {1, 1, 2, 2, …, n, n}, and you want to place them in a row so that exactly k numbers occur between the two appearances of each digit k.

When n = 3, there is essentially one way to arrange them: 231213 (and it’s left-right reversal)

What is the solution for n = 4?

Card sudoku

“Take all the aces, kings, queens, and jacks from an ordinary deck of playing cards and arrange them in a square so that each row and each column contains all four values and all four suits.” - Recreations mathematiques et physiques (Paris: 1725, Jacques Ozanam)

I hunger for more puzzles!

daily thingy

Short blog post, my brain is fried. I’ll post additional thoughts another day.

I want to work on things that are:

  1. well defined
  2. interesting
  3. orthogonal to my other projects

I need to learn more algorithms. I feel as if I have a gaping hole in my brain where my knowledge of algorithms should be. So I’ve decided to work on at least one algorithms problem from the Algorithm Design Manual by Steven Skiena. I’ve done well with my daily ritual, so I will incorporate this into the ritual by picking one problem in the morning that I will finish by the end of the day.

Must zzz for now, more details to follow.

tangent about computer science education

Java was my first programming language, and grappling with different semantics for what I thought were similar things, like the difference between reference and primitive types, was a serious hurdle for me. Looking back, and approaching computer science education as something to facilitate the process of building a mental model of computation, I think starting with something low-level like assembly would have been more rewarding and would have given me the building blocks to understand Java. There are lots of people who think that your first lesson in computer science should be in abstraction, but you cannot abstract what you do not understand.

To draw an analogy, look at the language used for mathematical proofs. Before you learn how to write proofs, you’re exposed to how mathematical computation works with the calculus sequence. Then you’re introduced to logic, and then the axioms for, say, calculus, and you build up the definitions from there. Math is a large language built from small pieces, but nobody expects you to understand the large pieces first.

Something like nand2tetris teaches CS the same way math is taught now: you start at the lowest relevant abstractions, logic and circuits, and then build layers of abstraction on top of that foundation.

I also don’t see the point of teaching object-oriented design to students just learning how to program. Though to be fair, I didn’t see the point of OO when I was taught it, and I still don’t see how traditional OO solves any more problems than it creates.

The above analogy with math is a layperson’s view, let me know if you notice anything off about it :)

very tired

In the beginning, God created the earth, and he looked upon it in His cosmic loneliness.

And God said, “Let Us make living creatures out of mud, so the mud can see what We have done.” And God created every living creature that now moveth, and one was man. Mud as man alone could speak. God leaned close as mud as man sat up, looked around, and spoke. Man blinked. “What is the purpose of all this?” he asked politely.

“Everything must have a purpose?” asked God.

“Certainly,” said man.

“Then I leave it to you to think of one for all this,” said God.

And He went away.

Not all of my ideas are good. I thought it would be a good idea to stay up and write a comment engine for my blog because disqus is proprietary. Turns out that was a bad idea… super tired, and not very much progress was made. On the up side, I did have a lot of caffeine.

Funny that my worst blog post comes right after the “write excellent blog posts” talk :) That’s just how it happened. Or, as Bokonon would say, that’s how it was meant to happen.

fasting and the emacs user group

Another week of Hacker School begins tomorrow :) super excited.

We celebrated the beginning of Ramadan together on Saturday. Eating together was a lot of fun, and I felt a sense of togetherness as we gathered for our feast. Mihai made an absolutely amazing salad… I didn’t realize that salad could be less-than-lame, but that salad was probably the best thing I’ve had in my three weeks in New York. We also had rice, beans, and onions. It reminded me of home.

During Ramadan, Muslims are supposed to fast. They are only allowed to eat or drink when the sun is down, which means that you go without food from like 4 am to 8:30 pm. As I am no longer Muslim, I’m not obligated to fast, but I enjoyed fasting last year and want to try it again. Fasting helped me appreciate the food that I ate, and it framed the food as something for sustenance, not something I reach for when I’m bored. You also think about those of us without access to food, which is a humbling. I’m not sure how long I’ll fast, as it can mess with my mood and productivity, but I plan on fasting for at least a week.

When I told Amber about Ramadan, she seemed interested in fasting. She’s going to fast with me, with some slight modifications. Having a fasting buddy is fun, because even though I grew up in a Muslim household, none of the adults really ever seemed interested in fasting.

Also, the Hacker School Emacs User Group (hsEUG? hackerEUG?) begins on Tuesday. I’m super excited about it: we came up with the idea a couple days ago as a way to get the emacsers at Hacker School together to talk about Emacs. We’re modeling it on the Linux User Group I ran at Mason, with one talk a week on a subject that is at least tangentially-related to Emacs. I’m not scared that we can get at least one talk a week, because 1) I could probably give a talk a week on Emacs for all of Hacker School just by myself, 2) from my experience with MasonLUG, finding enough people to talk is usually not hard, and 3) people just want to talk about Emacs, yo. It’s low stress :P I just want to see everyone else’s tricked out Emacs configs!

the first step

“Your mind knows that you are going to Song-do. But you must not tell your body. It must think one hill, one valley, one day at a time. In that ways your spirit will not grow weary before you have even begun to walk. One day, one village. That is how you will go, my friend.”

-Crane-man (A Single Shard by Linda Sue Park)

When I decide to start working on a new project, my favorite thing in the world is thinking about the end result and envisioning how I will feel after I’m done. Getting to the point of actually starting has always been hard for me. There seems to be some sort of mental hurdle I need to jump, and the uncertainties that surround any project often keep me from getting started and working on it at all.

When this happens, I ask myself: what is the easiest first step? Which part of the project can I define and tackle first? Identifying an easy first step is powerful is because completing that step gives you a sense of confidence and momentum that will make climbing the mountain less scary.

For example, I spent a lot of time before I came to Hacker School floundering on my Go compiler project. The weekend before Hacker School began, I spent a lot of time thinking about how to structure my time, but I was scared about my ability to take on the project and I didn’t have a first step in mind. On the first day of Hacker School, I talked with Tom Ballinger and he told me that many people that are interested in compilers start by building an interpreter. I recognized that as an easy first step that was well contained, and working on an interpreter equipped me with the knowledge and confidence I needed to actually start building a compiler.

I have found that, by the end of your first step, the next one is more clear: After I learned what I needed from my interpreter, I dropped it and easily moved on to the lexer, the first part of my Go compiler.

But sometimes the next step isn’t clear. After I finished the lexer, I wasn’t sure how to proceed with writing the part of the compiler, the parser. I knew I needed to write one, but I didn’t know where to start. That’s a sign that you’re uncomfortable with the problem you’re trying to solve, and your next step is to learn and experiment with the problem domain until you’re comfortable moving forward. I read many things, talked with many people, and had many false starts with the parser before I was ready to actually begin working on it.

Having just finished the parser, I’m in another in-between state of learning and experimenting with semantic analysis of my abstract syntax tree. I’ll identify an easy first step soon enough, though!

sim city 2000: playing with fire

Had a chill day today. Played Sim City 2000 a bunch. Five or something airplanes crashed and set my city on fire.








Was disappointed today when I found out that Viva Pinata doesn’t work on Linux ): I just realized that all my favorite games simulate some aspect of real life, but with a fast-forward button so you can watch things grow. Someone should write a game where you manage a programmer’s mood and motivation while they write a parser… it would be like the sims, but with only one sim that represented me.