I’ve been interested in Haskell for a couple of months now, but teaching at Portland Code School has been keeping me busy enough that I haven’t had the time to give it more than a cursory glance. Over the week of Labor Day, we gave the students some extra time off, so I took that time as a chance to finally delve into it some more and start going through the exercises and materials from a well-reviewed course from UPenn that I found. One of the earlier exercises is to solve the Towers of Hanoi in Haskell. Before I get into my solution, though:
What is Haskell?
It’s a strongly-typed, lazy, purely functional programming language. The syntax of Haskell is like nothing I’ve ever worked with before, Continue reading
There are a bunch of tutorials on Sinatra and Slim around, but I didn’t find too much about using them and a Ruby app all at once, so I did a lot of experimenting to see what would work. Now that I’ve got that more or less squared away, it seems like a good time to pass that info along.
I was doing some coding down at Portland Code School recently, and a classmate wandered by and paused when he saw my screen. “Is that Vim?” he asked. “What plugins are you using to make it look like that?” The screen he was looking at was much like this one:
This is actually all plain vanilla Vim–I’ve got a couple of plugins that add a little functionality (tpope’s Surround, Unimpaired, and Repeat are about it)–but nothing that changes the display of Vim at all. I’ve thought about picking up NerdTree because I’ve heard about it a lot, but I’m still feeling like a new-enough Vim convert that I don’t want to start using anything too far from the basic functionality of Vim, just because there’s so much to learn in the basic program that so many people don’t know about–which brings us back to my classmate and his question about my screen setup.
I’ve been learning my way around Backbone quite a bit lately. It’s definitely a powerful library that can do some pretty cool things—enable you to change the layout of the page without having to make a server call, for example. Like most cool and powerful libraries, though, it can be difficult to wrap your head around. Backbone makes use of three central concepts: Models, Collections, and Views. One mistake I made when first getting into Backbone was thinking of these as analogous to list items, the list itself, and different layouts for the list. That’s not exactly right though—we’ll go into why not and what these things do after the jump.
Yesterday I detailed the code we’ll be using on our Portland Code School group project to interact with the server and the database. Today we’ll look at the libraries we’ll be using on the client side to make everything work smoothly. Client-side code is becoming more and more important as sites try to improve load times and minimize the work that the server has to do, so this is definitely great stuff to learn about.
Recently I’ve seen the subject of QR codes in ebooks come up a few times. Now, I love QR codes—I have them on my business cards, and we print them on the backs of any promotional material we give out. They’re super handy. Putting QR codes in ebooks, though, is infuriating. Why’s that? I’ll tell you why…
I’ve had a strange problem crop up a few times recently when working on a couple of projects—Node projects each time, but I don’t know if that’s particularly relevant. Occasionally I’ll run jshint on file or just try to run it with node, and I’ll get an error like the following:
SyntaxError: Unexpected token }
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
I got really excited the other day when I stumbled across the Pentadactyl extension for Firefox. It tries to do exactly the sort of thing I’d love to see done: it brings Vim-style movement to the Internet. It’s a very well-done extension—it does its job very well indeed. The problem is, the job is a really hard one, and may just not be doable at all. Basic navigation is fine; you can and up and down pages, and across tabs, and even or to highlight all the links on a page and add shortcut numbers to make it easy to follow links.