Word of the month - "Marvellous".

Here we go! Another salubrious, grammatically painful and hopefully "different enough to maintain your interest" ramble around Stu's current thoughts and state of being. Eh?

Anyway, on we go.

If you aimlessly stumbled across this page through some freak association in some marvellous internet search engine, click the "Back" button now - yes that's it, the one at the top of the page. Bye and good luck with whatever it was you were trying to find.

If you aimlessly stumbled across this page through some freak association in some marvellous internet search engine and you "lurve" D.O.S. boxes, yes that's PeeCee to you,then you need to be over there. That field there next to the field with the cows in it. Yes, that's it, the one with the woolly four legged things in it. Bye. And don't come back until you've seen the error of your ways - Baaah!

If, however, you happen to be a cool, intelligent, sophisticated and at least semi- conscious Mac Programmer or even better a Mac PF Programmer, then I know you've come here because your project is going slowly, you've got problems and you've decided to take a break and see if there's anything new for you. Maybe something interesting, funny, witty - something you might learn? Hopefully the answer will be yes. Sufficed to say, I wrote this because I was having a hard time and needed a break - a bit of relaxing fun.

So this time, I've interspersed the ramblings with some humour, culled mainly from CompuServe's forums. Grab a cup of whatever it is you drink, relax and read on...


This was posted on a CompuServe forum way back in Oct 96 - I thought it'd make an interesting start to this StuChat (well, it put me on the floor).


Subject: There's a right way and a wrong way to replace fuses...

The following article was taken from the Arkansas Democrat Gazette, July 25, 1996:

Two Local Men Injured in Freak Truck Accident Cotton Patch, Ark.

Two local men were seriously injured when their pick-up truck left the road and struck a tree near Cotton Patch on State Highway 38 early Monday morning. Woodruff County deputy Dovey Snyder reported the accident shortly after midnight Monday.

Thurston Poole, 33, of Des Arc and Billy Ray Wallis, 38, of Little Rock are listed in serious condition at Baptist Medical Center.

The accident occurred as the two men were returning to Des Arc after a frog gigging trip. On an overcast Sunday night, Poole's pick-up truck headlights malfunctioned. The two men concluded that the headlight fuse on the older model truck had burned out. As a replacement fuse was not available, Wallis noticed that the .22 calibre bullet from his pistol fit perfectly into the fuse box next to the steering wheel column. Upon inserting the bullet,the headlights again began to operate properly and the two men proceeded on east-bound toward the White River bridge.

After travelling approximately twenty miles and just before crossing the river, the bullet apparently overheated, discharged and struck Poole in the right testicle. The vehicle swerved sharply to the right exiting the pavement and striking a tree. Poole suffered only minor cuts and abrasions from the accident, but will require surgery to repair the other wound. Wallis sustained a broken clavicle and was treated and released.

"Thank God we weren't on that bridge when Thurston shot his nuts off or we might both be dead" stated Wallis. "I've been a trooper for ten years in this part of the world, but this is a first for me. I can't believe that those two would admit how this accident happened", said Snyder.

Upon being notified of the wreck, Lavinia, Poole's wife asked how many frogs the boys had caught and did anyone get them from the truck.

Ok, pick yourself up from the floor - there's more later.


Ferreting

Why, you may ask, am I posting humour? Well, I'm sure you know what it's like. You've just emerged from seven solid days of hard core programming. You know, the "don't try this at home kids" variety. Totally worn out, but happy that it works. I don't really know how it all works YET, but I'll read the notes tomorrow type of thing.

Anyway, that type of work (which admittedly doesn't have to happen very often with most projects) puts you out of touch with reality. It's tiring and gets tedious towards the end. When you do finally verify the operation correctly you want a break.

So here I am, taking a break. I reckon I got about two hours before catatonicism sets in, and I know I have work tomorrow (working for somebody else is MUCH easier), so I spent some time on CompuServe in the fun forums. What a great place - so much humour. I DL'd a 300k digest and just spent the last hour reading it. Marvellous.

Anyhow (that's not a word surely), what I'm going to do now is plug CompuServe. Bad move you think? Why should I plug what is basically a sloth like dinosaur of a system (but getting faster)?

OK, occasionally on the Fantasm list we see messages like "I want to write a program that does <insert any kind of processing you feel like>. Where do I get info on this subject?". People, ourselves included, go out of their way to post likely sources of information. The only problem is that it is rare to get a definitive "This is where you want to be" reply because the people posting replies have no (or little) experience of what the original "postee" is asking for.

Part of the job of authoring any project is accumulating research material for any mechanical processes your project needs to carry out. Searching, sorting, list maintenance etc. Fine. Generally there's truck loads of information about general techniques floating about (avoid the undergrad papers like the plague! You'll find thousands of these pop up if you use a search engine.).

Then you may need much harder to obtain proprietary information; a classic example is Apple's object container formats! Under these circumstances you have two choices; either pay the licensing fees OR ferret about a bit.

There's absolutely nothing wrong with "ferreting". Most information, even proprietary information is generally held electronically for all to see _somewhere_.

This is where the big dinosaurus type systems become 'specially handy - CompuServe's is a God send. Example - last year we desperately needed detailed information on <insert anything you feel fits the context>. I spent three _solid_ days searching the internet, most of JANET (UEA is good), all the search engines - you name it, I went there.

Zero squared result.

Then in a flash of inspiration (read desperation) I went to CompuServe's "file finders" (don't laugh!). In an instant I had all I needed. Stunned would be an understatement. Hence I love CompuServe. At least fifty percent of the time it comes up trumps and when it does, it's worth it's weight in gold. Who needs social engineering when you have systems like that! Marvellous.


Ok, here's another humour item plucked from the same source...

"Plucking unwanted nose hair is time-consuming work. A cigarette lighter and

a small tolerance for pain can accomplish the same goal and save hours. Its

a good idea to keep a bucket of water handy when using this method."


 

Stack popping

This is a fairly obvious piece about stack popping. Easy to do in assembler.
Old hands and "coderz" please pass this section by...

Consider the situation:
Your main loop calls a subroutine. At the end of this routine it calls another, which calls another, which calls another etc. Finally it gets to the end of the last subroutine (the leaf routine if you like) and the program flow now dictates that n stack clear up and return instructions are executed to get back to the main loop.
There is no more processing, just returns as all the program is now doing is crawling it's way back up to the top level.

You don't really want to waste time just executing "non productive" code that is serially cleaning up the stack and returning back up through the calling chain. You can calculate how much stack space has been used, add that onto the stack pointer to get at the original return address (to your top level - main loop or whatever) and simply return to that address thus saving quite a few instructions and clock cycles.

You can also use this method to recover from errors, or anywhere you need to get back up the chain quickly.

A word of warning though. If you ever forget you've done this it's a major disaster just waiting to happen. Generally you add on a fixed constant in the leaf routine (because it's quick and painless both in terms of clock cycles and precious programmer effort). Now, if for some reason you've extended the calling chain and haven't adjusted the constant you either:

End up returning to "data" and die in a fairly ungraceful way
or
You jump somewhere back up the calling the chain, which again gets to the leaf routine, which branches back up the calling chain....Eventually you run out of stack and your Mac crashes with a code 28 and "es" is likely to fail. Even more ungraceful and certainly not marvellous.

Of course a hardened PPC assembly language programmer wouldn't be using a stack anyway, would they?


These tickled me...

Study Finds Sex, Pregnancy Link
Cornell Daily Sun, December 7, 1995

Larger Kangaroos Leap Farther, Researchers Find
The Los Angeles Times, November 2

'Light' Meals are Lower in Fat, Calories
Huntington Herald-Dispatch, November 30

Alcohol Ads Promote Drinking
The Hartford Courant, November 18

Malls Try to Attract Shoppers
The Baltimore Sun, October 22

Official: Only Rain Will Cure Drought
The Herald-News, Westpost, Massachusetts

Teenage Girls Often Have Babies Fathered by Men
The Sunday Oregonian, September 24

Low Wages Said Key to Poverty
Newsday, July 11

Man Shoots Neighbor With Machete
The Miami Herald, July 3

Dirty-Air Cities Far Deadlier Than Clean Ones, Study Shows
The New York Times, March 10

Man Run Over by Freight Train Dies
The Los Angeles Times, March 2

Scientists See Quakes in L.A. Future
The Oregonian, January 28

Wachtler Tells Graduates That Life in Jail is Demeaning
The Buffalo News, February 26

Prosecution Paints O.J. as a Wife-Killer
Fort Lauderdale Sun-Sentinel, January 25

Economist Uses Theory to Explain Economy
Collinsville Herald-Journal, February 8

Bible Church's Focus is the Bible
Saint Augustine Record, Florida, December 3, 1994

Clinton Pledges Restraint in Use of Nuclear Weapons
Cedar Rapids Gazette, April 6

Lack of Brains Hinders Research
The Columbus Dispatch, April 16


Macintosh, the next O.S. and Pentiums.

One thing that cropped up on the list server this month was "what's all this talk about Apple and Pentiums?". So, your ever faithful scribe decides on a little research and guess what - Apple are definitely going to support the Pentium with <insert favourite musicalish code name here> AND Apple are really, honestly not going to support the Pentium with <insert previous substitution phrase again>. Typical.

Here's some quotes:

"In addition, Tevanian said current NeXT customers should migrate to either PowerPC or Intel versions of Rhapsody." - Macweek 7th Feb 1997.

"Rhapsody as a complete operating system is PowerPC-only," Gable said. Furthermore, he said, Apple has no plans to sell Intel hardware. "Our view is that the world has too many of those already," Gable said." - same article.

Thus from these two quotes I read it as "Yes Rhapsody will be available on D.O.S.boxes, but the "Blue Box" will only be available on PowerPC and Apple have no plans to produce D.O.S. boxes themselves".

Now I am a natural born cynic. I would suggest that Apple could make a fortune out of selling Apple branded high end D.O.S. boxes, and I'm sure Apple are also aware of that. If they wanted to make a fast buck they could. And it's not as if they don't have the necessary physical and fiscal resources to pull it off either.

Thus, one must admire Apple's balls for not selling out. Remember this is the company that has pulled off one of the worlds greatest computing feats - that of switching a whole architecture over to a new processor with virtually no problems. I admire two pieces of programming - first the original Elite(tm) game on the 6502 BBC micro, secondly the 68lc040 (20ish) emulator we all know and love. I genuinely admire Apple - always have done and always will. When we had ST's, we dreamed of Macs. I think of a Mac as being the glorification of "cutting edge" and I really don't know how Apple can produce them so cheaply - maybe they shouldn't. To me, it means "The Best" - to quote

Guy Kawasaki:

          "If Apple made cars, it would be the E series from Mercedes.
          It looks different from everything else.
          Some people hate it. Some people love it.
          The BMW 5 series, by contrast, looks like a Honda Accord
          so the press loves it.
          :-)
          You can't get an E series without a wait because of the backlog.
          But the wait is worth it.
          It doesn't cost any more than other high-end mid sized cars, but everyone 
          assumes a Mercedes costs more.
          Of course Mercedes also don't break down, and there's higher resale so 
          over the course of owning the car, it's actually cheaper. But the press 
          only cares about the price on the sticker out the door.
          And, incidentally, Mercedes only has .5% market share, so the press 
          thinks Mercedes will die."

So, yes, I really love my Mac and I don't like anything else. I do feel that making the world aware of this fact is counter productive - it makes it look as if we're on the defensive about something.

Thinking objectively. Is the Mac really as good as we like to think?

Well, I pretty much know a Mac inside out, upside down and any way you can turn it. I know the hardware, I know the software, I know the manufacturer, I know the market. Taking all that into account and knowing what's missing (protected memory - NOT preemptive-20-year-old-technological-lets-waste-time-n-thousands-of-times-a-second-whether-you-want-to-or-not-multitasking) yes, it's a good box. If it wasn't "up there" why would most of the worlds magazine ('specially those hypocritical *expletive deleted and replaced with "journalists"* slagging Macs off in PC mags) and news content be produced on one?

Whoa - getting warmed up now :-)

From a developer's point of view I'd much rather be a small fish in a small pond rather than the same small fish in an ocean of...well you know what.

Apple estimates over 50 million users, so if you realistically shift that right one bit that's still a rather large "small pond".

The way I see it - If, as Apple states, it can get Rhapsody out fairly quickly and simultaneously, and just as importantly, get the major killer apps - Quark, Photoshop - ported, then the future is bright.

A final word on this one can come from the "Boss" - Mr. Amelio, Sir.
"Nineteen-ninety seven will be a year in which we ship the hottest products in the history of the company," speaking after the Annual Shareholders Meeting and referring to "Hooper" the new PowerBook to be released in two weeks time at Macworld Japan.


Time for more humour...This is rather a long one, but a goody.

A middle-aged businessman took a young woman half his age as his wife.

The fantasy of having a young woman in his bed soon became a nightmare when he found that he could not last long enough to satisfy his young bride.

His wife, as understanding as she was exciting, told him that all was well even if he was quick to get out of the saddle.

Determined to satisfy this sweet young thing, the man visited the doctor to get some advice.

"Doctor, I can't seem to hold back for very long when I make love to my young wife and I can't satisfy her. What can I do?"

The doctor smiled, patted him on the shoulder, and said in a professional manner, "Try a bit of self-stimulation before having intercourse with your wife and you'll find that you'll last longer and ultimately satisfy her."

"Okay, Doctor. If you think that will help."

Later that afternoon, his young bride called him at work to let him know that she would be attacking him at the front door when he arrived home.

"Be prepared, my darling. I'm going to ravish you," she cooed over the phone. Undaunted, the man decided to follow the doctor's advice.

But where? In the office? The Xerox room? What if someone walked in on him? He got in his truck and began the journey home. Soon he decided he would find a spot on the road to pull over, climb underneath the truck and pretend to be inspecting the rear axle, and do the deed there. a moment later, he pulled over, crawled beneath the truck, closed his eyes tightly, fantasized about his young wife, and began his "therapy".

A few minutes later, just as he was about to complete his therapy session, he felt someone tugging on his pants leg. Keeping his eyes tightly shut to avoid ruining the fantasy he was enjoying, he said, "Yes?"
"Sir, I'm with the Police Department. Could you tell me what you are doing, please?" said the officer."
"Yes, officer, I'm inspecting my truck's rear axle," he replied confidently.
"Well, why don't you check the brakes while you're down there. Your truck rolled down the hill a few minutes ago."


Panic

A funny thing happened this morning. I like to work from "hard copies". I like scribbling on notes. So I print a lot of stuff out. This morning, I told Eddie to print some notes. Printer switched on, shuddered into life (as Stylewriters do), made the usual clicking noises then an alert popped onto the screen saying the Mac could find no printers! Panic. I mean - that's a serious error right? It doesn't happen - but it had. The error said "Try checking the connections".

I thought there can't possibly be anything wrong with the connections, so I'll restack the paper (I was in serious flap mode). Same error. OK, physically unplug printer from the mains. Count to twenty, plug printer back in and try again - same error.

By now I am thinking it's time to go to the bank, get some money and buy a new printer.

Switch Mac off. Make Coffee (as you do when completely flummoxed). Switch Mac on. Same error. Only this time I read the error message "Check cables". Ok, check cables - remove, insert. Try again...and it prints fine.

Now that's a great error message! I mean - that error just oozes confidence. The point I'm trying to make is that Macs don't go wrong, and when they do, you get an error explicitly stating what to do. I know I'm over simplifying this - but it impressed me senseless. I guess the thing that confused me was that the printer powered up, so I naturally thought there can't be anything wrong with the cables, else it wouldn't have got the "Good morning" message. Live and learn.

 

Endispiece

Development is going good. We completed phase 1 tested a few weeks back, which was just a sanity check for the project manager. It went OK. Since then it's coming on nicely. What I particularly like about it is that it's rather a large project. In large projects you get to do things that you wouldn't do in small projects. What am I talking about?

Well, once you commit to a large project, you know roughly that time isn't an issue, so you can put in "niceties" that are not strictly necessary to the operation, but do make life easier and more interesting for the user.

A long time ago, I used to write text based adventure games. The aim there was to keep the user involved by creating well placed "interest keepers" and by making as much as possible "possible". People simply like interacting with their environment. They also like their environment to work with them - if at all possible, to pre-empt and sort out any possible problems before they happen. To try to anticipate what will happen and provide possible contingency scenarios.

This of course is not the program anticipating, but the author of the program making sure that stupid little things don't get in the way. The only problem with this, from an authors point of view, is that it may take three solid days work just to get something to happen that the user doesn't even notice because it's automatically taken for granted! But hey, that's what it's all about isn't it? And I know about it because I slaved over it for three days, so I'm happy too.

Well, that's it. My two hours are up. The matches are breaking.

Till the next time,

Code on!



Send mail to Stu



Back to Stu's Page Top Level

Back to Lightsoft Home Page