Upcoming Classes

RSS Feeds

Categories

Archive

Site search

Cocoa Programming for Mac OS X 3rd Edition

My editor at Addison-Wesley wrote me today. He says that 6000 copies of “Cocoa Programming for Mac OS X, 3rd Edition” are on trucks. I think the 3rd edition is pretty good; it adds two chapters on Core Data, and chapters on the garbage collector, Core Animation, Web Services, NSTask, and NSViewController. A lot of little things were tidied up.

Buy the book now.

One important note: The most recent betas of Xcode have started using XIB files instead of NIB files by default. XIB files are readable XML representations of the stuff that is usually in an NIB file. At compile time, the XIB is converted into an NIB. As you go through the book, you can ignore the difference between the two file types.

Here is a tarball of the solutions to the exercises, not the challenges.

PagePacker 1.3

Some small fixes — some users complained that the top and bottom margins were too large, so I’ve made the call: All modern printers can print to within one third of an inch of the edge of the paper. I had a bug where I was mutating a collection while iterating over it — 10.5 is much more uptight about such things. Also, the template pages had no calendars for 2008 or 2009.

Download The Application

Download The Source

Lessons from the Trenches at Acts As Conference

Note: this is a re-blog from the The Napkin.

For those who missed my talk at the most excellent Acts As Conference put on by the good folks at Rails For All in Orlando, Florida—here’s the cheat sheet.

My talk was on the lessons learned from teaching the Ruby on Rails Bootcamp and various on-site Trainings over the past year and a half. Here are the 4 key things you need to do to be a successful trainer:

Define Your Purpose – Come up with a clear, specific, desired outcome. Are you attempting to teach the basics, or promote mastery? A quick how-to, or a detailed guide to a particular way of development? A clear purpose helps your audience hit the ground running. An unorganized braindump can leave your students frustrated when they go at it alone.

Know Your Audience – You’ve got to understand everything you can about your audience. This means not only their current level of knowledge, but their past experiences, and even their goals. Ask questions before and during your training to understand everything you can about them. This will help immensely with the next tip.

Give Relevant Examples – Cater your examples to the domain that your audience knows. If you are teaching a bunch of journalists, use concepts from the publishing world. Never use foo, bar, or any other made up word in any example. If you don’t know, guess, and if your audience corrects you on the concept, you now have attentive listeners, contributing to your solution!

Teach How to Learn – Show, don’t tell. Stress how to find out why something works the way it does. Give plenty of examples, and help your audience figure out concepts. Give them the resources to continue learning and to find out more. Show them how you figured it out, or where you went to learn.

I’m sure there are plenty more tips, but I’ve found these 4 to be extremely valuable to me in coming up with valuable lessons and ways of teaching. Thanks to everyone who came up to me afterward to ask questions and share feedback about teaching!

BigShow

At Big Nerd Ranch, we follow a pretty minimal style for our slides. It is important to us, however, that our slide shows go in and out of subversion easily. Also, it is important that we can easily generate a book from a collection of slide shows. As such, we have written our own replacement for PowerPoint.

BigShow is for playing the slide shows — not for creating them. The slide shows are created in a text editor. The disk image has both the application and an example show. Download the application and an example show.

Directions: Press “f” to go full-screen. Press ESC to exit full-screen.

The application is open-sourced. Download the source code.

PagePacker Open-Sourced

I am celebrating the arrival of Mac OS X 10.5 by making the source code to PagePacker available. Here is the compiled application.

Don’t know what PagePacker is? Check this posting.

Overheard from the first two days of Ruby on Rails Bootcamp

The following quotes were heard during the first two days at the Big Nerd Ranch Ruby on Rails Bootcamp, here in Wiesbaden, Germany. They could have been said during the super-intensive course or during the hands-on building of a fully working sample application. Or maybe during the wine-tasting….

“Today has probably saved me about 2 to 3 weeks worth of work….”

“They watched as a wild boar jumped across the river, 3 times, back and forth, and then they knew. This was the spot!”

“has_many :through [the ActiveRecord construct for creating a join table] has actually been problematic for many Rails developers, because they can’t rely on the conventions to name it for them. They actually have to think of a name for the table! gasp!”

“There are only two things I hate in this world. Those who are intolerant of others, and the Dutch.” [someone poorly quoting Austin Powers Goldmember]

“Ich wiess nicht! No se!” [I don’t know!]

“Actually, you see all this code? Well, you don’t even need to write any of it. If you use the Rails conventions, you get all this for free.”

“Sure, I’ll have another tasting of the Kloster Eberbach Reisling Kabinett Trocken.”

“If Ruby on Rails and your Database had a little instant messenger chat, it might go a little something like this….”

Cocoa and OpenBase

I am speaking this week at the OpenBase Summit 2007. I am doing a short introduction to Cocoa. Most of the people in the audience are OpenBase users and a large number use the LightSpeed Point-of-Sale system. (LightSpeed stores its data in OpenBase.)

So, I wrote an example that uses the LightSpeed data in an OpenBase database. You can download the source. There is a README.txt in the tarball.

If you don’t have LightSpeed, this probably isn’t that interesting to you.

Let me mention that OpenBase is a lovely database. I started using it in 1994, and I’ve had nothing but good experiences. If you are coming to the OpenBase Summit, please say hey. I’ll be the one in the cowboy hat.

Reviews of Django Bootcamp

Juan Pablo Claude recently taught the Big Nerd Ranch’s new “Django Bootcamp” at the offices of the Atlanta Journal-Constitution. The engineers in the class created a a blog of their experience.

What is Django? Django is to Python, as Rails is to Ruby.

We will be offering the class in Atlanta the week of Sept 10. We expect this to be a very popular course, so sign up soon.

A Scooter Nerd’s Top 10

While zipping around town on this beautiful spring day, I noticed that nearly all of the cars were occupied by exactly one person. Why, I wondered, isn’t everyone roaring about on a motorscooter like me? A scooter gets great gas mileage, is a hoot to ride, and I haven’t died on mine even once.

Perhaps, I thought, they don’t know what gear will make the scooter a truly effective replacement for their cars. I’m a programmer, so I had to deal with problems like “How do I carry my 17″ laptop?” For nerds who are considering the move, here is how I roll:
Read more »

Big Nerd Ranch on Marketplace

Public radio’s Marketplace is a very thoughtful radio show that reaches 8 million people on 330 radio stations nationwide. This evening they did a great piece about Big Nerd Ranch.

Here is the MP3 for those of you who want to listen to it in the car. We occupy the last three minutes of the half-hour show.

I want to send a big thank you to Phil Graitcer, the producer who did the story. I think he did a tremendous job representing our vision while keeping the story from getting tedious and pedantic.

Using the Django newforms Library

The original Django tools for creating HTML forms and validating user supplied data (forms, manipulators, and validators) are currently being replaced by the newforms library, which is expected to be completed for version 1.0. The newforms library will be a nice change to Django, as it is much more elegant and easier to use than the oldforms library. Unfortunately, the inclusion of the newforms library will be backwards incompatible, so the development team is going to include both libraries in Django 1.0 to ease the transition, and then completely drop oldforms from the framework in later versions.

Thus, current Django developers are encouraged to embrace the newforms library as soon as possible, and new developers are discouraged from spending time learning the oldforms API altogether. This all sounds great, except that the newforms documentation is far from complete at this time. This article’s goal is to give you enough information so that you can get started using the library now.

If you want to learn all about Django, I’ll be teaching the Django Bootcamp at Big Nerd Ranch, April 2 - 6.

Read more »

PagePacker 1.1: A4, AppleScriptable, little fixes

When I released PagePacker a week ago, I thought it might be handy for a few people. (See the original post if you don’t know what I am talking about) Now that thousands of people (literally) have downloaded it and given me feedback, I’m quickly getting out a new version with:

  • Support for A4 paper (see the Preferences panel)
  • AppleScriptability (with a lot of help from Matt Neuburg)
  • You can now move, copy, and clear pages after you drop them
  • The catalog appears larger
  • You can use the up/down arrows to move through the catalog

I’m interested in how people are using PagePacker. If you have created a clever PDF for use in PagePacker or if you create an AppleScript that does something cool with PagePacker, I’d love to see it.

Download PagePacker 1.1

PagePacker makes pocket-sized books

I often wander around without a computer, so I needed a nice easy way to print important bits into little books of information that I could carry around in my pocket. Chad Adams figured out a brilliant technique of cutting and folding pieces of paper into little books and called it PocketMod. The technique was brilliant, but the software was a little awkward. So I, knowing a little about Cocoa, hacked together PagePacker.
Read more »

Big Nerd Ranch Burns

For much of the history of computers, technical training has received very little attention. I started Big Nerd Ranch because I thought it could be taken to another level — expert instructors, relevant materials, great settings. I’m very proud of what we do: we have become the technical training company for people who hate technical training. But for the last five years, I have been looking over my shoulder for something terrible to happen. Well, it did.

On Thanksgiving, I gave thanks for the 16 students who had signed up for the Cocoa class that was going to happen in one week. That night, the lodge we rent for our classes burned to the ground with all our equipment inside.

Read more »

Bonzo Framework

When I spoke at the Student Session at WWDC, I announced that I was taking submissions for a framework of reusable Cocoa classes, and that I would give the best entry a free seat in a Big Nerd Ranch class. I was expecting a flood of submissions, but only received five. I’d like to thank Drew Hamlin, Christoph Angerer, Nate Roberts, Daniel Beatty, and Trevor Johns for their submissions. I am pleased to announce that Christoph Angerer has won the contest for his BNZTransactionalNotificationCenter.

For now, I have made the submissions available as a tarball. Or you can browse the source code.

If you have a class or a set of classes you would like to submit before I check this into Google Code, please send it along. I’d like to have a better idea of what this will eventually look like before I create a directory structure for the project. You can email your submission to bonzo at bignerdranch com.

If you do send me code, I need some stuff from you:

  • The reusable code. Please prefix any class names, function names, or global variable names with “BNZ”.
  • Unit tests and/or a sample application
  • Documentation. In particular, the declaration of each public method should have headerdoc-compatible comments. A nice README.txt would also be good.
  • Unlimited rights to use your code. When you email the code the following words. “I give Aaron Hillegass the right to do anything he wants with the attached source code. I swear that I produced this code without stealing anyone else’s intellectual property.”

Experiments with Python, PyObjC, and Cocoa

As a consultant, I am working on a piece of software for an engineering firm. The engineers would like an easy way to write plugins for the application. I thought to myself, “Myself, perhaps the plugins could be written using Python.” So, I downloaded the latest version of PyObjC and installed it. This posting is to share the three examples that I wrote in my exploration.

Read more »

Configuring WebDAV for cross-platform file sharing

Web-based Distributed Authoring and Versioning (WebDAV) is an often-overlooked protocol that can provide cross-platform file sharing with minimal client-side configuration. This article explains how to configure WebDAV servers on Windows with IIS, on Mac OS X and Linux with Apache, and how to connect using built-in WebDAV clients on all three OSes.

Looking for greater interoperability in your network? Come to the Mixed Networks Bootcamp (April 24 - 28) to learn how to expertly integrate and manage a mixed OS network.

Read more »

Simple Debugging in PEAR::DB

One of the most important (and least loved) activities in a programmer’s life is debugging code. When debugging PHP, there are several strategies, ranging from strategic use of print_r to elaborate systems that send debugging information to specific debug tables in a database.

In this article, we look at a simple tip for finding errors in SQL code when using PEAR::DB.

If you would like to learn more about PHP PEAR modules, DB is just one of the modules covered in depth in the PHP 5 Bootcamp.

Read more »

Updated Palettes/Frameworks chapter for “Cocoa Programming for Mac OS X”

With recent versions of Xcode, the palettes exercise in Cocoa Programing for Mac OS X has become unusable. These days, when you create a palette project, Xcode creates a palette target and a framework target. Thus, the palette chapter has become a palette/framework chapter.

Here is the updated chapter.

Special thanks to the students at the Cocoa Bootcamp in Rome. As the guinea pigs, they caught several errors and typos.

Uploading Files with PHP

Content management is a nearly universal challenge when discussing any data-driven web site. As a developer, you can create your own system or use any one of a number of sophisticated open-source or third-party packages. Many times, however, you have a simple concept in mind and you want to create your own — especially if you have very specific needs that existing solutions cannot easily accommodate. At some point, you are going to want to let users upload files. Sometimes reluctantly, but it will happen. PHP 5 handles this need very well.

In this article, we look at a simple strategy for allowing users to upload images to your web site.

If you would like to learn more about file uploads and content management, these are just some of the topics covered in depth in the PHP 5 Bootcamp (Next offering Jan 30 - Feb 3).

Read more »