AKMA's Random Thoughts

June 27, 2003

Last Day of School

After more contact hours than in an ordinary class’s semester, today will bring to a close the preaching seminar on which I’ve been working. It’s a good bunch of preachers, and we’ve had some exciting discussions, but I will deeply relish the opportunity to sleep late tomorrow morning. Oooooh, yeah.

When I’m done with teaching and Si’s fulfilled his many social obligations, we’ll meet on Michigan Avenue for the opening of the new Apple Store (I’d link to Si, but he’s packing and moving to a new location). We had been talking about going to a Cubs game, but we reasoned that the Cubs play 81 home games a year, but the Apple Store Grand Opening comes only once. Plus, OK Go (a band that Si likes, whom assures me, earnestly, has improved since I saw them) will be playing, and they’re giving away 1000 T-shirts and 20 iSights. I’ll be the one staggering around with bags, duffel bags, under my eyes and a good-looking teenage man-boy steering me.

Posted by AKMA at June 27, 2003 06:48 AM | TrackBack
Comments

I can sympathize with the matching luggage under your lower lids-- I think mine resemble steamer trunks at this point.

Giving up a Cub game would be a hard choice for me to make, but I'll be looking forward to your Grand Opening iReport.

(BTW, sorry about the above, empty post; in my befogged state, my pinky hit the enter key instead of the shift.)

Posted by: Jane Ellen at June 27, 2003 07:19 PM

Hey, saw you there in line, went around a second time when Anne got there, but the line was yet longer. When we came back an hour plus later the line was still interminable, but you seemed to have made it in.

Looked like a good time, we're going to go again when there's more chance of getting a good look around.

Posted by: Eric Sinclair at June 27, 2003 08:32 PM

Hey, Eric, I thought I saw you — but I was straining my eyes to spot anyone from the blogging circle.

It was a blast, but it would have been better if (a) there had been something to drink (I was parched, and hungry too, for that matter) and (b) we had actually won an iSight. Ah, well.

Posted by: AKMA at June 27, 2003 10:40 PM

This will allow us to use a few functions we didn't have access to before. These lines are still a mystery for now, but we'll explain them soon. Now we'll start working within the main function, where favoriteNumber is declared and used. The first thing we need to do is change how we declare the variable. Instead of

Posted by: Ninion at January 13, 2004 01:25 AM

For this program, it was a bit of overkill. It's a lot of overkill, actually. There's usually no need to store integers in the Heap, unless you're making a whole lot of them. But even in this simpler form, it gives us a little bit more flexibility than we had before, in that we can create and destroy variables as we need, without having to worry about the Stack. It also demonstrates a new variable type, the pointer, which you will use extensively throughout your programming. And it is a pattern that is ubiquitous in Cocoa, so it is a pattern you will need to understand, even though Cocoa makes it much more transparent than it is here.

Posted by: Lucretia at January 13, 2004 01:25 AM

This variable is then used in various lines of code, holding values given it by variable assignments along the way. In the course of its life, a variable can hold any number of variables and be used in any number of different ways. This flexibility is built on the precept we just learned: a variable is really just a block of bits, and those bits can hold whatever data the program needs to remember. They can hold enough data to remember an integer from as low as -2,147,483,647 up to 2,147,483,647 (one less than plus or minus 2^31). They can remember one character of writing. They can keep a decimal number with a huge amount of precision and a giant range. They can hold a time accurate to the second in a range of centuries. A few bits is not to be scoffed at.

Posted by: Augustus at January 13, 2004 01:26 AM

Note the new asterisks whenever we reference favoriteNumber, except for that new line right before the return.

Posted by: Joshua at January 13, 2004 12:05 PM

When the machine compiles your code, however, it does a little bit of translation. At run time, the computer sees nothing but 1s and 0s, which is all the computer ever sees: a continuous string of binary numbers that it can interpret in various ways.

Posted by: Matilda at January 13, 2004 12:05 PM

Let's take a moment to reexamine that. What we've done here is create two variables. The first variable is in the Heap, and we're storing data in it. That's the obvious one. But the second variable is a pointer to the first one, and it exists on the Stack. This variable is the one that's really called favoriteNumber, and it's the one we're working with. It is important to remember that there are now two parts to our simple variable, one of which exists in each world. This kind of division is common is C, but omnipresent in Cocoa. When you start making objects, Cocoa makes them all in the Heap because the Stack isn't big enough to hold them. In Cocoa, you deal with objects through pointers everywhere and are actually forbidden from dealing with them directly.

Posted by: Joan at January 13, 2004 12:06 PM