Learning F#

I’ve been curious about F# for quite some time, and I recently decided to pick up a few books on it, and see if I could learn it. More generally, I wanted to learn more about functional programming. I thought about learning something like Haskell or Scala, but F# seemed like a good choice. I already know a good bit about the .NET Framework, and the CLR, so I wouldn’t be starting entirely from scratch, and I could stick with tools I already know (Visual Studio).

The three books I picked up are F# for C# Developers, Book of F#, and Programming F# 3.0.I bought them all from as DRM-free e-books from O’Reilly. (This was right before O’Reilly lost the license to sell Microsoft Press books, so the “F# for C#” book would no longer be available from them, if you were looking for it.) I haven’t started the “Programming F#” book yet, so I can’t say anything about it. But I have read a few chapters from each of the other two books.

“F# for C# Developers” is published by Microsoft Press. It’s reasonably well-written, but I haven’t really found it to be particularly engaging or interesting. Of the chapters I’ve read thus far, I’d say that it lives up to its name, in that it is oriented to folks with a good grounding in typical .NET development. I think it would make for a good reference book to keep at my desk, if I was doing some serious F# development at work, and needed to remember the difference between :> and :?>, for instance.

Given that I didn’t feel like I was really learning functional programming from that book, I decided to put it down and start reading “Book of F#”. For my purposes, this is turning out to be a better book. I’ve read the first four chapters so far, and I’m finding that I like the tone of it (including Doctor Who references!), and the general style. I’m finding the example code to be a bit more understandable and interesting than in the other book.

I’ve experimented a bit with re-doing some of the Project Euler problems in F#, as I’ve mentioned before, and I’ve found that to be a good exercise too. Oh, and I’ve solved through to problem 31 there, so I’ve managed to make some overall progress on Project Euler.

Spring Cleaning

I received a letter from my landlord this week notifying me that they would be coming through on Monday and spraying for bugs. The letter said that I should clear off my kitchen counters, and move everything out from the cabinets below the counters, and from under the bathroom sink. I only recall them sending out a notice like this once before, maybe seven or eight years ago. As far as I can tell, we don’t actually have a pest problem, but maybe there’s an issue elsewhere in the building.

Either way, I took this as an opportunity to do some spring cleaning this morning. In addition to throwing out a bunch of random stuff from the kitchen, I also decided to toss out a bunch of old computer books. I threw out maybe 30 or so books. I’ve done this before, and probably blogged about it, so I’m not sure if I’l be saying anything new here. But I wanted to take a break from cleaning and write up a blog post, so here we are.

I haven’t been buying a lot of hard-copy computer books lately, preferring DRM-free e-books instead. At my current job, I have exactly one hard-copy book at my desk. I also have three e-books on my computer that I refer to regularly. At my previous job, I kept maybe a half-dozen hard-copy books on my desk, and a few e-books. At the job before that, I had a whole bookshelf unit, probably six feet tall and three feet wide, full with books (and admittedly a large array of random knick-knacks), most of which I’d bought myself. I left quite a few of them behind when we went out of business, but I took a couple of boxes of them home; most of those went into the recycling dumpster today.

I’ve been buying most of my e-books from O’Reilly. Generally, I wait for them to have a good sale, as they did last week, on the Day Against DRM. Packt had a really good sale too, any book for $10. I ended up buying three books from Packt. They publish such a wide variety of stuff, I found myself with maybe 15 tabs open while I was shopping, looking at all the cool stuff I’d like to learn about. But I know, at this stage in my life, and with the speed that technology changes, that I’m not going to read 15 programming-related books before at least 12 of them are hopelessly out of date. So I settled on buying just three.

I should make a point of checking back in a year, and seeing how many of them I’ve actually read. But, hey, if I don’t read them, I’m only out $10 each and there’s nothing to drag out to the recycling bin!

iBooks on the Mac

I have a few things I want to write up and post today, and, taken together, I think they’re going to make me look like a cranky old man. But that’s ok.

I bought a couple of Microsoft Press ebooks from O’Reilly today, since they’re having a “Farewell MS Press” 60% off sale right now, so I thought I’d snag a couple while they were cheap and still DRM-free. It looks like MS Press is moving to Pearson for distribution, starting April 1. It’s unclear as to whether or not they’ll continue to offer DRM-free ebooks, but (being a pessimistic and cranky old man), I’m guessing no.

So, after downloading them, I wanted to drag them into iTunes so I could read them on my iPad with iBooks. (That’s a lot of iProducts, huh?) Well, I hadn’t done that in a while, so, for some reason, I launched iBooks on my Mac. I don’t think I’d ever actually done that before, as I don’t really read books on the MacBook. It prompted me to import my books from iTunes, so I went ahead and did that. Now I’m cranky.

Having a dedicated app to read books on the Mac seems like a good idea. There’s no particularly good reason books should be kept in iTunes. But, after going through that import process, I’m not entirely happy with the result. iTunes kept books in a nicely-organized folder, with sub-folders by author name, and files named (sensibly) according to the book title. And (of course) if you pulled in a book with bad metadata, you could press Command-I on it in iTunes and edit the metadata.

iBooks, on the other hand, stores all the books in one folder, no sub-folders, with names that appear to be randomly-assigned GUIDs. And there’s no right-clck “View in Finder” option in iBooks, so there’s really no telling which one is which. And there’s no way to edit metadata in iBooks, so if you import a book with bad metadata, it’s quite a task to change it. (There’s some more help with that here.) Or I could switch back to iTunes, but that’s pretty darn complicated.

I’m starting to wonder if I should switch to a third-party reader app (much as I did with podcasts last week) and give up on iTunes. Almost all of the ebooks I want access to on my iPad are DRM-free ones from O’Reilly and Packt. I already have a few apps on my iPad that might do the trick, including GoodReader, the Kindle app, and OverDrive. Maybe I need to pick one that works well with DRM-free epubs or mobi files, and stick with it.

Drupal 7 Development

I’m continuing my somewhat slow attempt to become a Drupal expert. After finishing up a couple of general Drupal books from Packt, I started “Drupal 7 Module Development,” also from Packt. I got up to chapter four, then put it down in frustration. I’ll likely pick it up again, but it’s not an easy book to read straight through, with little prior Drupal dev experience.

So, then I picked up “Pro Drupal 7 for Windows Developers,” and I’m doing much better with that one. I just finished chapter 5, which walks you through the creation of a simple, but non-trivial, module. I found it fairly easy to follow, and a good start. The book is (obviously) written for Windows programmers looking to learn Drupal, specifically ASP.NET developers, so it’s a good fit for me.

There’s still a lot more to learn. Drupal’s API and hook system are fairly complex and extensive. But I think I’m on the right path.

Reading and Music

I’ve been having a bit of a problem at home lately. They play music on Main St. now, for most of the day. They used to just do this around Christmas, but now they’re doing it all the time. They’ve got one set of songs programmed into the thing. It’s all basically soft rock, with a little jazz mixed in. Stevie Nicks, Seal, Sting, Sade, that kind of stuff. Lots of artists whose names begin with “S”, for some reason.

A few weeks ago, on a Monday night, the timer went wonky on it and it kept playing all night. Even with all the windows closed, and earplugs in my ears, I could still hear the music, and really couldn’t sleep at all that night. I (and at least one of my neighbors) called the police, but they didn’t know how to turn it off, or have contact info for anyone who could. (Supposedly, that’s been fixed if this happens again.)

While the music was bothersome before, this incident has reprogrammed my brain so that the mere hint of “Sweetest Taboo” (for example) starts to make me shiver and feel slightly nauseous.

This isn’t much of a bother on weekdays, since I only have to put up with an hour or two of it, between whenever I get home from work, and 8pm, when the timer (hopefully) turns it off. I’m generally watching the previous night’s Stewart and Colbert after work, so that drowns it out.

On weekends, though, I often like to sit around and read during the day, so this is a problem. I need to find some music I can listen to that drowns out the Main St muzak, but doesn’t distract too much from what I’m reading. I’ve been reading Zero History by William Gibson over the last week or so. I’m almost done with it. Yesterday, I used Fugazi’s Instrument soundtrack to down out the muzak. Today, I’m using turntable.fm, specifically the ambient/chillout and coding soundtrack rooms. I’ve discovered that I can get pretty good sound out of my iPhone by putting it in an old dock that I friend gave me a few years ago, and connecting that to my receiver via a mini-stereo to RCA cable, into the “tape” input. Previously, I’d just been connecting it by inserting the cable into the headphone jack, but the dock makes a big difference, for some reason.

I’ve really been digging Turntable.fm lately, by the way. This is one of those things that the internet is great for, but that usually goes wrong after a while. Right now, you can fire up turntable.fm, go into the right room, and there will be a few people with impeccable taste playing great songs for a crowd of maybe 50 or 100 people. No advertisements. No jokers coming in and playing Rick Astley. No spambots coming in and DJ’ing ads for boner pills. I’m not sure why it works, but I’m glad it does.

Also, about Zero History: good book! I’ve found that a number of things in it, sometimes just minor stuff, has sent me off to the internet to do a little research. Node Magazine and the Zero History blog have some good links. I’ve also found myself looking into Saharan guitar music and other odd stuff like that.

Reading

I realized, a few weeks ago, that I hadn’t been reading much of anything this year other than Drupal books. When the Harry Potter series was released in ebook format, I took the opportunity to get them all and download them to my Kindle. I started re-reading them a couple of weeks ago, and I’ve gotten through the first three. The first few are pretty quick reads, and fun. I don’t think I’ve re-read any of them since I first read them, quite some time ago. Knowing how it all ends does bring a bit of a different feel to some things, especially in the first book.

I’m taking a break now, and I just started Zero History by William Gibson.  He’s one of my favorite authors, and has been since Neuromancer came out. I’m really enjoying it, so far. I’ve been reading it slowly and carefully. It’s the kind of book that rewards careful reading, and attention, I think.

Harry Potter ebooks

So Pottermore finally started selling the Harry Potter books in ebook format this week. (And they’re selling the audiobooks too.) I signed up for an account there a couple of days ago, and I just went in and bought the bundle of all seven books.

Some things I like about this:

  1. They offer the books in multiple formats, including DRM-free (but watermarked) ePub.
  2. You can link your Pottermore account to your Amazon account, and push the books right out to your Kindle.
  3. You can download the books multiple times.
  4. The audiobooks are in DRM-free MP3 format.

And some things I don’t:

  1. Their web site forms are screwy. On most fields, you can’t use copy & paste, for some insane reason.
  2. Every time you log in, you need to enter a CAPTCHA. I can understand needing to enter one to create an account, but on every login? Overkill.
  3. It’s easy enough to transfer a book over to your Amazon account, but there’s no (obvious) way to transfer all your books at once. You have to do them one at a time.
  4. Similarly, when downloading the books in ePub format, you need to download them one at a time, and it takes a few seconds to “prepare” the download. I’m guessing that it’s creating a watermarked ePub file on the fly there, but why can’t they just have a background process that does that right after purchase, so the files are ready right away?
  5. For the audiobooks, they show both the US (Jim Dale) and UK (Stephen Fry) versions, and even show a price if you select the UK version, but you can only buy the US version. (I was hopeful that I’d be able to buy the Stephen Fry versions.)

So, a few quibbles, but nothing that bothers me that much. I actually haven’t read any prose fiction at all yet this year, so I think I’m going to sit down with my Kindle and start into the first book. I haven’t re-read any of the Potter books since I first read them, with maybe one exception. I feel a little guilty that I’m going to re-read these relatively easy-to-read “YA” books, when I have plenty of unread “adult” novels lying around, but hey, they’re great books!

45th birthday

Yesterday was my 45th birthday. It was a pretty low-key birthday. I strayed from my diet and had a couple of slices of pizza for dinner, and I allowed myself a buttered roll in the morning, but I didn’t go overboard with anything. I had the idea today to look back on what I might have been doing on and around my birthday, since I started this blog. So here’s a pretty random list of stuff, assembled by looking back at my Blogger archives.

2003

  • I went to Comic-Con that year. (I was making reservations in March. I’m going again this year, after skipping it for a few years.)
  • I was reading Sinfest, which I haven’t been following lately, but is apparently still around (and still funny).

2004

  • I was reading “His Dark Materials“, and listening to Rum Diary.
  • I had just gotten the 90,000 mile service done on my 97 Civic. (I got my 2008 Accord inspected yesterday. It’s got about 45k miles on it.)

2005

  • Windows XP was giving me grief.
  • I was listening to Warren Ellis’ “Superburst Mixtape” podcast. (That’s long gone. He has a new one named SPEKTRMODULE now, which I’ve been listening to recently, and is quite good.)

2006

  • I was watching Samurai Champloo on Cartoon Network. (I have it on Blu-Ray now, but I haven’t gotten around to re-watching it.)

2007

2008

  • I got my first Kindle. I’ve since traded that in for a new one, but I still haven’t read some of the books I loaded onto that first one (and later transferred to the second).

And that’s about where I feel like I should end this. I’m feeling weirder than usual about my birthday this year, for various reasons. But I can’t complain. I’ve been able to spend time with several really good friends over the last couple of weeks, and I think I’ll likely enjoy this coming weekend too, so that’s all I can really ask for.

another Drupal 7 book

I just finished reading Drupal 7 Business Solutions, by Trevor James, a Drupal e-book that I got from Packt. I finished another Drupal e-book, titled simply Drupal 7, by David Mercer, about a month ago. The one I just finished goes over a lot of the same ground as the Mercer book, but I think it was still worth reading. The author uses a web site for a bread bakery as an example throughout the book, adding functionality to the site to demonstrate various features of Drupal. It’s full of functional, quasi-real-world examples. I think it would be very helpful to anyone looking to get a good grounding in Drupal basics.

I mentioned some time ago that I was working on a new documentation site, in Drupal, for the REST API to my company’s product Bullseye. That site is now in production, and you can see it at http://api.bullseyelocations.com/. It’s a simple enough site, but I think it turned out well. I’m using the “book” module to organize the content, the CKEditor module to allow me to easily enter nicely-formatted text, and the GeSHi Filter module to format source code examples.

I’m still not great at the theming stuff, so I just created a fairly simple sub-theme of Bartik for this site. The only really major thing I did with it was to change it to use a Google font (Droid Sans, which is what we’re using on our new marketing site for the product). I think it looks pretty good.

(And yes, I wrote nearly all of this documentation myself. To a large extent, it’s based on the documentation for our old SOAP API, but it’s evolved enough that I think it’s mostly mine now.)