Drupal 7 clean URLs

I have today off from work, so I’ve been sitting around at home, messing with Drupal.
I couldn’t quite figure out how to get clean URLs to work, until I stumbled across this article. (See the “post-installation tips” section at the end.) Pretty simple really, and I should have been able to figure it out on my own, if I’d read as far as the RewriteBase section of the main clean URLs article on drupal.org.

I also went a bit nuts at www.packtpub.com today. They are running a special, 5 ebooks for $60, so I bought four Drupal books and one PHP book. I’m building up a bit of a library of ebooks that I’ve bought on sale, mostly from O’Reilly.  I never seem to have time to read them though!

xAMP on the Mac

I’ve been trying to learn a bit about Drupal recently. It looks like we might be getting some Drupal projects at work, so it seemed like a good idea.

To get a working setup for Drupal on my Mac, I wanted to get all the pieces in place — Apache, PHP, and MySQL, basically. Apache is, of course, already there, and I already had that turned on, so no problem.

PHP was already installed, but apparently got turned off during the 10.7 upgrade. All you need to do to turn it on is edit httpd.conf, and uncomment one line, per this SO page.

For MySQL, there’s an installer that works pretty smoothly, per this page. One odd thing I stumbled across at one point is that you usually need to refer to your local server as ‘127.0.0.1’ rather than ‘localhost’. Long story, but something worth noting. Also, if you’re not sure how to set the root password, take a look at this SO page.

I tested to make sure that MySQL was working from PHP using this little test script:

<?php

$db = mysql_connect("127.0.0.1:3306", "root", "password");

if (!$db) {
    die('Could not connect' . mysql_error());
}
    echo 'Connected successfully';
?>

I can’t remember exactly where I found that, but it’s a pretty basic script.

I then got a little ambitious and decided to try to get phpMyAdmin working. I made a couple of simple mistakes here, including not quite understanding that config.inc.php needed to be in the root phpMyAdmin folder and not in the config subfolder.

Also, the warning from phpMyAdmin about mcrypt not being installed was bugging me, so I decided to try and fix that. That turned out to be kind of complicated. I followed these instructions, and they worked, but only on my second try. I must have gotten something wrong on the first try. Also, I found another page with similar instructions, so referencing that may help if anything on the first page seems confusing.

In the end, I think I really should have just gone with MAMP, but of course I was doing this as a learning exercise, so it was valuable to go through all this, even if it took a lot longer than was probably necessary.

And I still don’t have Drupal installed. Maybe tomorrow!

digital comics

I just spend $38 on $76 worth of digital comics from Dark Horse.  I had a 50% off coupon, good even on stuff that was already on sale. I now have nearly all the Hellboy and BPRD comics that came out since i stopped buying them regularly in 2009. Plus the first 16 issues of The Goon, which I’ve wanted to read, but never got around to buying. A little over 50 comics total.  Digital comics never seem worthwhile to me when they’re priced at close to the regular print cover price, but for less than $1 each, they’re not a bad deal.

Steve Jobs – 1985

I recently finished reading a long interview with Steve Jobs that was published in Playboy back in 1985. You can find a text version of it here or read it at Playboy.com here. Some of the stuff in the interview is kind of funny, in retrospect. Some other stuff is a little heartbreaking, for obvious reasons. My favorite part of the interview is when they started talking about the future of computing:

PLAYBOY: What will change?

JOBS: The most compelling reason for most people to buy a computer for the home will be to link it into a nationwide communications network. We’re just in the beginning stages of what will be a truly remarkable breakthrough for most people—as remarkable as the telephone.

PLAYBOY: Specifically, what kind of breakthrough are you talking about?

JOBS: I can only begin to speculate. We see that a lot in our industry: You don’t know exactly what’s going to result, but you know it’s something very big and very good.

PLAYBOY: Then for now, aren’t you asking home-computer buyers to invest $3000 in what is essentially an act of faith?

JOBS: In the future, it won’t be an act of faith. The hard part of what we’re up against now is that people ask you about specifics and you can’t tell them. A hundred years ago, if somebody had asked Alexander Graham Bell, “What are you going to be able to do with a telephone?” he wouldn’t have been able to tell him the ways the telephone would affect the world. He didn’t know that people would use the telephone to call up and find out what movies were playing that night or to order some groceries or call a relative on the other side of the globe. But remember that first the public telegraph was inaugurated, in 1844. It was an amazing breakthrough in communications. You could actually send messages from New York to San Francisco in an afternoon. People talked about putting a telegraph on every desk in America to improve productivity. But it wouldn’t have worked. It required that people learn this whole sequence of strange incantations, Morse code, dots and dashes, to use the telegraph. It took about 40 hours to learn. The majority of people would never learn how to use it. So, fortunately, in the 1870s, Bell filed the patents for the telephone. It performed basically the same function as the telegraph, but people already knew how to use it. Also, the neatest thing about it was that besides allowing you to communicate with just words, it allowed you to sing.

iOS programming

I’m more than half-way through my iOS programming class at NYU. I’ve missed one class due to a flat tire, and I’ve been a bit under the weather during a couple of classes, but I’m definitely getting something out of the class.
I’ve made a Hypotrochoid generator the basis for my previous two homework assignments, so that’s been kind of fun. I didn’t figure out the code for this myself. Rather, I took the C# code found here, and converted it to Objective-C / Cocoa.
All of my homework code is up on my Github page, if anyone wants to look at it for some reason.
And here’s a quick screencast of my app. Not that exciting really, but fun to write.

Dark Horse

I’ve bought a few digital comics via the Comixology iPad app over the last year, but I hadn’t bought any through the Dark Horse app until today. I just bought the new Groo mini-series (which apparently came out in print in 2009), and a Classic Usagi Yojimbo mini-series, which may be a digital-only release. The bundle pricing on these books is pretty reasonable, but you can only buy the bundles through the web site, not the app.
I’ve found myself reading comics on the iPad a lot recently, mostly while I’m on the train. I should really be working my way through the Programming iOS 4 ebook that I started a while ago, but I’ve been finding that my brain isn’t really up for that sometimes.
One interesting comic I’ve been reading via Comixology recently is Vision Machine. The whole three-issue series is completely free. It originally came out just about one year ago, and there was a panel about it at last year’s NYCC, moderated by Andy Ihnatko.

iOS 5

I haven’t updated either my iPhone or iPad to iOS 5 yet, but, as a programmer, I’m happy to see that they’re finally doing automatic reference counting in Objective-C. I’m wondering if the instructor for my NYU iOS class is going to work any iOS 5 stuff into the class or not.  I could see where it would be hard to update class materials on the fly for this stuff, and our classroom iMacs probably still haven’t been updated to the latest version of XCode, but I’m hopeful.

RIP Steve

So sad to hear of Steve Jobs passing tonight. Only 56 years old. I’m starting an iOS dev class at NYU tomorrow night. That first class is going to feel a little weird now. I remember, years ago, being kind of mad at Steve for killing off the Newton, and its OS. It took a while to get from the Newton to where we are now with iOS, the iPhone, iPad, and iPod Touch, but we wouldn’t have gotten here without Steve Jobs. And I have to grudgingly admit that killing the Newton was probably the right decision. Sorry Steve.

iMac


iMac
Originally uploaded by andyhuey

When I agreed to develop a Mac app for a client, I’m not sure why I agreed to make it backward-compatible to OS 10.4. Now I’m stuck testing my app on this crazy thing.

The weird thing about Cocoa development is that there are perfectly innocuous things that work fine on 10.6, but don’t work at all on 10.4. And that don’t throw errors either, so it’s pretty hard to nail them down.

Cocoa project

The Cocoa/Mac project that I’ve been working on is pretty much done. It’s not a really big or complicated program, but I just ran a ‘wc’ on it, and it’s a bit over 1400 lines of code, so it’s not trivial either. I’m betting that, if I was more experienced with Cocoa, it could probably be, maybe, 900 lines instead of 1400, but that’s still a reasonable size. Oh, and if I didn’t have to support OS X 10.4, and could have used the garbage collector and other stuff that only works in 10.5+, I could probably have shaved off another 100 lines of code.

My program is replacing an old program written in FutureBASIC. Looking back at the source code for that, it was a bit over 600 lines of code, all in one file. You can definitely write a shorter program if you don’t have to declare variables, or allocate and release memory for them.

Overall, I had some fun learning a new language and a new framework, and figuring out how to solve problems that would have been trivial for me to solve in .Net/C#. I’d like to learn some more Cocoa stuff now, and maybe try writing an iOS app. I don’t really have a specific idea for an app, but I’ll figure something out.