Using Emacs 46 Auto Yasnippets

The other day I discovered auto-yasnippet, another great package by Oleh Krehel or abo-abo.

It looks like it's going to be a great way to solve a particular problem that come up now and again.

There are plenty of times when I want to create a number of similar but slightly different blocks of text. The example on the project site is:

count_of_red = get_total("red");
count_of_blue = get_total("blue");
count_of_green = get_total("green");

You could use multiple cursors, a macro, or other methods to put in the common text but you still have to deal with the parts of each line that are unique, the red, green, and blue.

You could use a yasnippet but it's unlikely that you'll have a snippet for every occasion. This is where auto-yasnippet comes in. You would write the first line but add a tilda as a placeholder:

count_of~red = get_total("~red")

and then invoke aya-create. This will get rid of the tildas and create the auto-snippet. Then when you run aya-expand it will put in the snippet with the tilda locations as placeholders.

Very cool.

Check out the video:

Sigcse2018 Making theory more acccesible

Next up from SIGCSE 2018 is John MacCormick's session on Strategies for Baing the CS Theory Course on Non-decision Problems

MacCormicks's stance is that CS theory is tough the first time around and using non-decision problems is a viable approach to make theory more accessible to beginners. As MacCormick said in his paper:

… a decision problem may ask the yes/no question, "Does this graph have a Hamilton cycle?" The corresponding non-decision problem is, "Please give me a Hamilton cycle of this graph if it has one."

This leads to writing programs to explore concepts in CS theory rather than just living in the world of proof.

MacCormick goes on to say that:

For this audience, the key advantage of non-decision problems is that they are more realistic: they match the previous programming and algorithms experience of undergraduates more closely.

I love the idea. Writing a program can make an abstract problem more concrete and can lead to better understanding for those of us who are less math inclined.

My next thought was that this shouldn't just be a change implemented in theory courses. Some of these ideas should move down to more introductory CS classes. Not the hardcore stuff but light introductions to the topics so that we can layer the learning. If we introduce some of these concepts in CS 1 classes then when they get to the theory class it won't be the students first rodeo.

I've had success with this when teaching recursion early. I've also done it with other concepts. When we teach the Towers of Hanoi, yes, it's a nice recursion problem but really it's to get the students thinking about run time and a bit of proof. likewise, when we do a maze solver in NetLogo we're alluding to dynamic programming, search, and path finding.

I don't have too much more to say on this topic right now. I'm not enough of a theory guy to sensibly design these experiences. The good news is that MacCormick has written an soon to be released book on the subject. I signed up for a reviewer copy at SIGCSE and look forward to receiving a copy. Once I do I hope to be able to find some gems that I can work into CS 1 experiences.

Using Emacs 45 - Company or Autocomplete

This is a good time to be an Emacs user. In addition to all of the great packages and tools being developed there seem to be more people regularly blogging and making videos about Emacs than ever before.

Planet Emacsen aggregates a ton of Emcas blogs and Emacs Legend Sacha Chua posts what's going on in emacs every week on her blog.

on the video front, uncle dave has recently joined the ranks of emacs video producers. sometimes we'll cover the same topic. dave made a video on swiper the other week and i made one a year ago. the other week we both made videos on mpd almost on the same day but dave focussed on emms and i focussed on simple-mpc. i think this is great because it gives different perspectives.

today, i watched dave's video on company mode for auto completion. I've always used autocomplete mode. I thought it would be a good time for me to see how the other half lived.

You can find my configurations up on GitHub ( The master branch is using autocomplete and the company-test branch for company. I've also pulled out the relevant code and am placing it down under the video.

Here's what I've found so far:

Company config (so far):

(use-package company
:ensure t
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 3)
(global-company-mode t))

(use-package company-irony
:ensure t
(add-to-list 'company-backends 'company-irony))

(use-package irony
:ensure t
(add-hook 'c++-mode-hook 'irony-mode)
(add-hook 'c-mode-hook 'irony-mode)
(add-hook 'irony-mode-hook 'irony-cdb-autosetup-compile-options))

(use-package irony-eldoc
:ensure t
(add-hook 'irony-mode-hook #'irony-eldoc))

(use-package company-jedi
    :ensure t
    (add-hook 'python-mode-hook 'jedi:setup))

(defun my/python-mode-hook ()
  (add-to-list 'company-backends 'company-jedi))

(add-hook 'python-mode-hook 'my/python-mode-hook)

Autocomplete config

(use-package auto-complete
:ensure t
  (global-auto-complete-mode t)

(setq py-python-command "python3")
(setq python-shell-interpreter "python3")

  (use-package jedi
    :ensure t
    (add-hook 'python-mode-hook 'jedi:setup)
    (add-hook 'python-mode-hook 'jedi:ac-setup))

How my views on education research were shaped

After reading a couple of comments on my last post where I talked a bit about practitioners vs researchers I thought I'd expand and expound a bit.

While there are education researchers that I very much respect, overall, I'm skeptical of education research. Note that I'm not talking specifically about CS Ed research but rather education research in general.

Let's go back to the beginning. I entered teaching from industry. Goldman Sachs to be specific. I started in a shortage area - math and barely had the credentials to do so. The transcript evaluator at the DOE counted my Algorithms and Numerical Methods courses as Math courses to get me over the credit hump.

I had zero ed courses under my belt and was thrown into the fire. Fortunately, I landed in a school, Seward Park High School, with a very supportive faculty. I wouldn't have survived my first year without Mike G, Bruce B, Jonathan G, and many others.

Then, I had to start taking education credits to make my license permanent. Some classes were taught by professors some by adjuncts. The adjuncts were invariably experienced teachers and the professors were research faculty. In many classes, I had to read the latest research.

I found that what "the research" told us to do was contrary to what some of the best teachers did in practice. I kept hearing about the "right" way to teach but it frequently didn't jive with reality. When the true way worked, circumstances were right and the technique aligned with the teacher's natural tendencies. When it didn't, why not? Many reasons.

  • lack of prep time.
  • too many students (per class, per day, per term)
  • different populations than the one researched
  • factors the researcher didn't include (and there are tons of them)
  • teachers with different personalities and skill sets

and each of the above points opens up to scores of specifics.

This theme continued throughout my career. I'd ask teachers in other subject areas about the current state of the art research. What was the current trends in their fields. Generally the best teachers would summarize what was going on and then either say that it didn't work for them or that if it did, they didn't take it seriously because in five or ten years "the research" would tell them to do something different and then they would all of a sudden be bad teachers.

This was another point. The right way to do it has changed over and over during my career.

Then there's the reproducibility problem. Apparently it's pretty bad in education research. I mentioned in my earlier post that when a researched does it once on a small group it's research but when a teacher did it over and over it's an anecdote.

When I was young I would listen to a master teacher tell me about how he set up some experience - the one I'm remembering now is an experiential / discovery lesson on triangle geometry. He'd talk about all the hard work that went into prepping his class for this type of lesson as well as the prep time for the lesson itself. He told me how he did it four years ago and it was great but then the year after it fell flat and how he changed it for the next year. How it worked in third period but not seventh and why he thought it played out the way it did. That's a lot more reproduction than most 'research' actually gets and this is what a master teacher does all the time.

Finally, I got tired of hearing how to do it by people who don't actually have to. If you're going to talk the talk, you should walk the walk. As a side, this problem is really bad with "thought leaders."

All this sounds like I'm really down on education research or at least the overarching system. I probably am but there are many education researchers doing great work and I respect them immensely.

They know they don't have a magic bullet:

This is what I tried with this population at this time and this is what happened. You might want to try it or a variation on it.

That's a far cry from "here's how to teach"

The researchers who acknowledge that their experience as college researchers or even teaching faculty are different from a k12 teacher and that no matter how hard they try to work out all the variables they can only ever account for a tiny fraction of them.

The key is that they're adding another drop into the bucket of knowledge. Over time it adds up. I have great respect for everyone doing this.

These researchers have to keep prodding us teachers to re-evaluate our practice and then either take or incorporate the research or reject it after determining if it would be good or not for our population. At the same time, it's up to practitioners to keep pushing back against magic bullet research and the one true way.

We all have a role to play in this game.

Sigcse2018 - Code Tracing

Next up from SIGCSE is An Explicit Strategy to Scaffold Novice Program Tracing by Benjamin Xie, Greg Nelson and Andy Ko, presented by Benjamin Xie.

The core of Xie's presentation was that tracing through code is a good thing and that spending a short amount of time teaching code tracing can lead to improved student outcomes.

The idea is simple. Walk through the code as though you were the computer running your program. Xie suggested that students frequently struggle with code tracing. They have a hard time keeping track of variables, they try to work entirely in their head and being novices, they don't have any good way of representing overall program state. Personally, I also think there's a resistance these days to doing thing by hand. Xie noted that students can trace through their programs using online tools such as debuggers with steppers but doing so is a passive process. The student just clicks next over and over again. They aren't actively engaged in the code tracing.

That last point is a very important one. That passive clicking through a stepper seems similar to me to students ignoring compiler warnings or students using robust auto completion or snippets which I believe retards their learning of fundamental constructs.

Xie shared a simple directed strategy to enable students to "embody the computer:"

  1. Read question: Understand what you are being asked to do. At the end of the problem instructions, write a check mark.
  2. Find where the program begins executing. At the start of that line, draw an arrow.
  3. Execute each line according to the rules of Java.
    1. From the syntax, determine the rule for each part of the line.
    2. Follow the rules.
    3. Update memory table(s).
    4. Find the code for the next part.
    5. Repeat until the program terminates.

When tracing through the code, a participant creates a memory table with each method call…

In additionn to the strategy, Xie produced a simple paper handout on which students could write down variable values and easily organize and store the computers state as they traced through a program.

Xie noted that just a few minutes of instruction to give the kids a concrete method of code tracing can provide big postitive returns.

The presentation was terrific and all true and I'm sure of tremendous value to anyone in the audience not familiar with code tracing but it was also the presentation that led me to compose this tweet:

While Xie's presentation was terrific, code tracing and teachers showing explicit code tracing strategies to kids is nothing new. I remember being taught about this back in the 80s. We called it a "desk check" back then. While it's true that maybe this was explicitly taught because we were using punch cards and our programs were run overnight, it was also taught to me by math teachers with very limited CS knowledge. It's also a practice that appears to be pretty common among High School CS teachers even when their content knowledge is spotty. We also frequently employ things like state diagrams, cons cell diagrams, and other techniques to capture state and assist in program tracing.

This seemed to me to be a great example of something that in my experience is a not uncommon technique for high school CS teachers but maybe isn't used as widely at the college level (?).

The other thing this made me think about was the divide between practitioners and researchers. I think everyone knows which camp I'm in. Andy Ko, Benji Xie's advisor and co-author mentioned this in his SIGCSE summary. When I read the actual paper, it notes that they basically worked with 24 students and looked at the results. So, that's research. On the other hand, when I share a takeaway from looking at my 150 kids a year whom I met five days a week and look at this over decades, it's just an anecdote. Hmmmm.

One other side point is that in Andy's summary he notes his perception that SIGCSE is largely a teacher's conference as opposed to other conferences he goes to which he says are more researcher's conferences. I've only been to two SIGCSE's but my teacher friends tell me that they feel that SIGCSE is more of a researcher's conference and CSTA is more of a teacher's conference. I guess it's all a matter of perspective and frame of reference. Also possibly because I think of teacher as K12 teachers as teachers and professors as profressors be they research or teaching faculty.

Finally ,given all of this, was the talk and paper of value? Tremendously so. I don't think it's a new technique and I think it's fairly well disseminated in the K12 space but that said, it's a good technique and it will be new to some. It's also hard to get students these days to meticulously do anything on paper and sharing a successful practice is always of great value. Finally, it left me thinking about extending online environments such as Thonny to support restricted code tracing where the students would have to enter the state of all changed variables in a given line before the stepper would move to the next one.

I very much enjoyed this SIGCSE session. You can read the paper linked at the top if you have access to the ACM Digital Library. If not, you can read Benji Xi's medium post here.

Using Emacs 44 - An org-mode workflow for application processing

One of my titles at Hunter College is Director of the Daedalus CS Honors program. It's something like a Hunter specific, CS specific version of the CUNY Macaulay Honors program.

Hunter gives all its students the ability to get a great computer science education at a fraction of the cost of a private institution and if you're a Daedalus scholar you also get a scholarship, a laptop, special classes (with me :-) ), activities and more. Just the other day we visited Samsung Next accelerator and earlier in the year we made our annual visit to Catskills Conf, arguably my favorite event of the year.

When deciding on which students to recommend for acceptance, I try to glean as much information as I can about each applicant. When I feel there's not enough information, I've been known to reach out to recommenders and other sources for more. But first I go through the applications. For each student, I'm provided with a pdf file with a bunch of data and also an entry in an internal Hunter online form with even more.

For the first cohort, this wasn't a big deal. I hadn't even started at Hunter when the applications closed so there was no outreach. Everything was after the fact so there were very few students to evaluate.

Last year, I was able to do some outreach and we had around 60 or so applications for a little over 20 spots.

This year, there are well over 100 applicants (and we're looking to grow the program by a large number of students). All of a sudden, it wasn't so easy to navigate all the pdf files.

Emacs to the rescue. Using a combination of org-mod, pdf-tools, and org-pdfview I've come up with a workflow that I very much like.

Take a look and let me know what you think:

Sigcse2018 Bootstrapworld on Creativity in CS classes

I really didn't know what to expect at the Creativity, Customization, and Ownership: Game Design in Bootstrap: Algebra session. I've been a big fan of Bootstrep for years and looking at the authors, Emmanuel Schanzer's been a freind forever. I've never met Shriram Krishnamurthi in person but am looking forward to it. We've traded emails and blog comments. I'd like to consider him a friend and I certainly respect him and his work even though we frequently disagree around the edges. The third author and presenter, Kathi Fisler was new to me.

The Bootstrap program is embedded in algebra classes. In it, students use Racket (nee scheme) to reinforce math skills while building computer science skills. The big student project is a graphical game.

When designing the project, students are asked to decide on and find four resources:

  1. The background image
  2. The player image
  3. The target image
  4. The enemy image

Students are given a short amount of time to decide on and find these four images. I think it was about ten minutes and that's it. That's all the "creativity" in the assignment. After that, all the students are essentially creating the same game with different skins.

This design makes sense. You can't have students going all over the place. Constraining the assignment in this way allows teachers who might now be strong in computer science to guide the kids through the program to completion.

At the time I was thinking: I really like all of this but is it really open ended creativity and discovery with respect to math or computer science? As it turned out, Fisler addressed this point at the end of the talk in a way that made me vary happy.

Fisler went on to describe the rest of the student experience and then went on to talk about the statistics they gathered.

One big takeaway was that while all the students were essentially writing the same game varying only the graphical elements, this encouraged students to create very different themes. They also created rich stories around their games. The project might not have been "creative" with respect to the CS or Math directions but it was certainly creative in other important areas. The other takeaway was that survey's indicated all sorts of positives from the program as a whole so the project didn't seem to have suffered by having the students essentially write the same program. Participants were proud of their work, they felt their games were different from their peers and in general the experience was good.

During questions, someone asked about adding a fifth element - a projectile or missile. It turns out that at one point the program had a projectile component but that led to the vast majority of projects to be themed in very similar ways. Even though not the same, it reminded me to something Randy Pausch said in his Last Lecture:

You make whatever you want. Two rules: no shooting violence and no pornography. Not because I’m opposed to those in particular, but you know, that’s been done with VR, right? [laughter] And you’d be amazed how many 19-year-old boys are completely out of ideas when you take those off the table.

At the very end, Fisler addressed my questions about creativity and discovery. She posed these questions of her own: "Do we overstate the case for creativity?" and "Is pure constructivism a win?"

I've ranted on contructivism before. It can be great but a constructivist lesson takes a knowledgeable educator and a lot of time, preparation, and effort. It's a big ask for, say, a high school teacher who's already taking home hours of work every evening. Too often I've seen the following "contructivist" model instead:

  • Take an isntructor that doesn't know their craft, the content, or niether.
  • Let the kids play with stuff.
  • Show off the couple of autodidacts that figure it out as success stories.

I'll rant more about this "model" with respect to the new buzz word "lead learner" at some point in the future.

On the creativity side, it's important but there are also times for the instructor to lead and for guidelines to be followed. We want to foster creativity but that doesn't mean that it's 100% creativity 100% of the time. Education is like life, a balance. The Bootstrap program had to constrain the CS and math learning but allowed for creativity in other areas. It's smart and it's a win.

I still want to meet Shriram in person one day and now also Kathi Fisler. I didn't know what to expect walking in but I left the talk reminded of why I'm such a fan of Emmanuel, his team, and their work.

Sigcse2018 - Malloc Lab

I wasn't going to go to this session. I started out in a panel on integrating social good into CS Ed. With the panel not meeting my expectations I moved over to my second choice - the system programming sessions where I saw Implementing Malloc: Students and Systems Programming, a paper presented by Brian Railing of CMU.

I really liked both the paper and the talk.

CMU computer science students all take a systems course that uses Computer Systems: A Programmer's Perspective. It's a great book. I read through the first edition years ago and felt it was great resource not only in a systems course but also for self study. One of the labs has the students implement their own memory allocation calls, or malloc for us old time C wonks.

There were a number of self perceived deficiencies with the assignment such as encouraging bad programming style by modeling less than ideal practices but the biggest deficiency as that students could game the assignment. Students could do very well on the assignment by exploiting knowledge of the assignment rather than by writing a full and correct malloc implementation. One example is that students were able to figure out that no allocation would be more than 100MB so they really didn't have to deal with 64 bit pointers. They could use smaller offsets thus simplifying the assignment. The assignment became more about figuring out how to get it through the grader and less about learning memory management. I'm sure I'm overstating it but that's the idea.

Railing explained all of the deficiencies and then how they changed the assignment to address them.

At the end of the day, the assignment had fewer loopholes to game so students had to really write the malloc library and presumably learn about memory management.

They also added an intermediate deliverable so students couldn't leave everything for the last minute.

Near the end of the talk, Railing discussed results where he pointed out that students final exam scores didn't change but they did better on the malloc questions. It wasn't clear if the overall scores didn't change, meaning that the students did better on the malloc questions but worse somewhere else or if they did similarly to past students on the other sections and in addition they scored better on the malloc questions. I'm not sold on the final exam questions being the best way to evaluate learning but it is an easy data point.

I loved the presentation and paper and I love what Railing is doing but my big takeaway was…

Well, Duh…

  • students aren't doing as they should
  • teacher realizes students are gaming assignment
  • teacher reworks assignment
  • students do better

Teachers do this all the time. Of course when we do it, it's not "research." This was a recurring theme for me at SIGCSE2018 and I tweeted it. While it's true that K12 teachers can learn a lot about CS content from higher ed, people in higher ed can learn a lot about teaching from teachers.

What Railing presented was terrific and important as changing assignments like this will now be considered by people who haven't thought about this before but this is second nature to a teacher. Of course I'm talking about a good teacher, not one who blindly follows scripted lessons.

I don't mean this as a slight to professors. They're hired and promoted based on research so much of their job involves another skill set. I know many professors who care very much about teaching but they might only teach one or two classes a semester that meets once or twice a week while a typical high school teacher meets 150 students a day five days a week over five different classes a day. Much more of an opportunity for deliberate practice.

This presents a huge challenge. How can professors who are hired and promoted as researchers be given the time and ability to develop as teachers? What about adjuncts or Teaching Assistants? I'd imagine it's even harder for them. I know that colleges have lines for teaching faculty but from what I can see, those instructors are usually super overloaded with classes and students so that doesn't solve the problem. Even if you do have teaching faculty that have the time to develop their craft, how do you get those teaching chops over to the research faculty?

After the session, I was talking about this with Mark Stehlik, Assistant Dean at CMU's School of Computer Science. Mark was telling me about CMU's efforts to develop teaching faculty across the disciplines. I was happy to hear about the efforts CMU was taking but it sounds like they have the same challenges with respect to pedagogy as everyone else. If it's a challenge for CMU with all their resources, what does that mean for the rest of us?

Still, it was encouraging to go to a number of sessions where it was clear that professors - both teaching and research faculty are serious about the craft of teaching and conferences like SIGCSE can bring them together with those of us who don't have the chops as researchers but do so as teachers.


I just got back from SIGCSE2018 - the big annual conference on computer science education. Although I've been in this racket for decades, this was only my second SIGCSE and once again I had a blast.

As with most conferences, a highlight was the "hallway track" where I got to spend time with friends and colleagues from all over the country. I also got to check off a few names from the "people I've been following online and want to meet in person" list. There are a few more on the list but it's getting smaller.

The theme was CS For All but the range of topics covered was both wide and deep.

For me, I left thinking about a few themes:

  • College faculty can learn a lot from K12 teachers in terms of pedagogy and teaching.
  • So can "thought leaders," policy makers, and big companies.
  • Colleges face a huge challenge in both developing pedagogues and transfering pedagogical knowledge over to researchers.
  • Can you do both CS4All and have quality CS teachers in the short term (I doubt it)?
  • Researchers vs Practitioners and the value of listening to one or the other.
  • Nifty assignments are frequently regular assignments reskinned with graphics.

There were a few sessions that dissapointed me but most of the ones I attende were terrific. I thought I'd blog about some of them in detail over the next few weeks.

Here are the sessions I'm planning on writing about:

I might talk about a few other sessions as well.

Overall it was a great conference. I look forward to sharing my experiences with all of you in the coming posts.

Using Emacs 43 - Music with MPD

I like to listen to music at work. Sometimes I just stream from YouTube, Soundcloud, Spotify or some other online source but if you're a person of a certain age, like me, you probably have quite an mp3 collection. All those CDs that have been ripped not to mention some converted vinyl.

I used to use the Music Player Daemon or MPD back in the day. It would run in the background and you could connect to it using lots of clients.

When I was running Ubuntu and Mint Linux, I had some trouble setting up MPD but the process is much smoother using Manjaro which is Arch based and I'm currently enjoying.

Here's a video on how I set up MPD and also use Emacs to control it.

Coincidentally, on the same day I recorded this, Uncle Dave put up a similar video. Dave also sets up MPD on an Arch based linux but he uses EMMS for his player. I ultimately end up with Simple-MPC with briefs stops at the built in MPC mode and Mingus along the way.


Enter your email address:

Delivered by FeedBurner

Google Analytics Alternative