Archive for January, 02006

Creating Passionate Users

Friday, January 27th, 02006

If you create software-driven user services (or maybe even just if you're in business - period), reading Creating Passionate Users should be a requirement.

Does a child process get a copy of its parent’s stack?

Tuesday, January 24th, 02006

Today in operating systems class, the following question came up:

Does a Linux child process get a copy of its parent's stack?

I said yes, based on the rationale that child processes couldn't return from nested function calls without copies of their parent's stack.

I built the following experiment to find out what really happens. The results seem to indicate that I was right...

Code (forkexample.c):

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>
	
void foo(void);
void bar(void);
void biz(void);
	
pid_t  child_pid;
	
int main(int argc, char *argv[])
{
  pid_t pid;
  int   child_exit_status;
	
  foo();
  printf("Both parent & child should get here - PID: %d\n", getpid());
	
  if(getpid() == child_pid)
  {
    return 0; /* only the child exits here */
  }
	
  /* block until child returns */
  pid = waitpid(child_pid, &child_exit_status, WNOHANG);
	
  printf("Only parent should be here - PID: %d\n", getpid());
	
  return 0;
}
	
void foo(void)
{
  printf("Entering foo() as PID: %d\n", getpid());
  bar();
  printf("Exiting foo() as PID: %d\n", getpid());
}
	
void bar(void)
{
  printf("Entering bar() as PID: %d\n", getpid());
  biz();
  printf("Exiting bar() as PID: %d\n", getpid());
}
	
void biz(void)
{
  printf("Entering biz() as PID: %d\n", getpid());
  if ((fork() == 0))
  {
    child_pid = getpid();
    printf("I am the child.  PID: %d\n", getpid());
  }
  else
  {
    printf("I am the parent.  PID: %d\n", getpid());
  }
  printf("Exiting biz() as PID: %d\n", getpid());
}

Compile:

gcc -Wall forkexample.c -o forkexample

Run:

$ ./forkexample
Entering foo() as PID: 12084
Entering bar() as PID: 12084
Entering biz() as PID: 12084
I am the child.  PID: 12085
Exiting biz() as PID: 12085
Exiting bar() as PID: 12085
Exiting foo() as PID: 12085
Both parent & child should get here - PID: 12085
I am the parent.  PID: 12084
Exiting biz() as PID: 12084
Exiting bar() as PID: 12084
Exiting foo() as PID: 12084
Both parent & child should get here - PID: 12084
Only parent should be here - PID: 12084

As you can see, the child process successfully rolls back the call stack - way past the function it was forked in. It seems to me that this would be impossible, if it didn't have a copy of its parent's stack.

Commander of the Indian Curry

Monday, January 23rd, 02006

Last night, as TheMFWIC and Nathan can testify, I commanded the Indian curry:

It was probably the single greatest thing I've ever cooked in my life.

South Dakota Magazine

Monday, January 23rd, 02006

If you're interested in South Dakota, South Dakota Magazine has a great blog. Works well as a marketing piece too, 'cause I just couldn't resist subscribing to their magazine.

It also led me to this South Dakota blog aggregator, which can lead you to a lot of other SD content.

Also, the Tour de Kota is looking like a strong possibility for 2006.

Playing with Photo Mosiacs

Sunday, January 22nd, 02006

You know those pictures that are made of of a bunch of smaller pictures? It turns out they're quite easy to make with the right software, and I'm thinking one of these things made with the right collection of personally important photos could make a very nice large scale print. I've some initial exploration with AndreaMosaic (free software) and come up with the following picture of Spenser made up of lots of different pictures from last year's RAGBRAI:

Original Mosaic

Lot's things to experiment with in the future...

Update #1: Beef bites on my style
Update #2: I bite back

A New Shipment of Guyank

Thursday, January 19th, 02006

Yesterday was a joyous day...

Guyank Shipment
The package I had been anticipating for
more than a week arrived

The Guyank shipment is revealed!
...and the precious shipment was revealed

Another case of Guyank unpacked and carefully ensconced on the pantry shelves
...and another case of Guyank was unpacked and
carefully ensconced on my pantry shelves

The Guyank Brand "Original Sweet-HOT Pepper Sauce" is truly the world's greatest hot sauce. I use some of the spicy and savory goodness every day, and you should too.

It receives my very highest recommendation.

First Day of School Tomorrow

Monday, January 16th, 02006

See here for details.

Puzzle #2

Sunday, January 15th, 02006

Getting a little into puzzle #2:

This one is a photo mosaic of a hot air baloon.

Hike up Embudo Canyon to Oso Pass and Back

Sunday, January 15th, 02006

Yesterday I took a strenuous 5 hour hike up Embudo Canyon to Oso Pass and back. It's really an amazing thing to have the opportunity to walk out your front door and then damn near all the way up a significant mountain.

This hike was basically the first half of sandiahiking.com's Embudo, Post Pass, Three Gun Spring Trails, Whitewash Route (map), except I started on foot from my house and hiked along the Open Space north of Rebonito, getting onto the trail ASAP and bypassing the Indian School trail head.

If you look at the map, this is pretty close to the waypoints MENLPK -> INSCPK -> EMB365 -> EMBWP1 -> EMBWP1 -> EMBWP2 -> EMBWP3 -> EMBWP4 -> EMBPOS -> POSTPS -> EMBPOS -> EMBTGS -> OSOPSS (and back).

I found the waypoints provided at sandiahiking.com to be an invaluable aid in navigating from the later part of Embudo trail through the major switchbacks and to the intersection with the Post Pass trail, as I lost the trail a few times. After that point, the trail was very well worn to Three Gun Spring trail and onward to Oso pass.

View of Embudo Canyon at Posts Pass
View of Embudo Canyon and
Albuquerque at Post Pass

View of Sandia South Peak from Post Pass
View of Sandia South Peak from Post Pass
Views of Sandia South Peak from Post Pass

Intersection of Embudo Trail and Three Gun Spring Trail (Waypoint EMBTGS: N 35° 6.206'; W 106° 26.556'; 7,925 ft) Intersection of Embudo Trail and Three Gun Spring Trail (Waypoint EMBTGS: N 35° 6.206'; W 106° 26.556'; 7,925 ft)
Intersection of Embudo Trail and Three Gun Spring Trail
Waypoint EMBTGS: N 35 ° 6.206'; W 106° 26.556'; 7,925 ft

Intersection of Embudo Trail and Three Gun Spring Trail (Waypoint EMBTGS: N 35° 6.206'; W 106° 26.556'; 7,925 ft) Intersection of Embudo Trail and Three Gun Spring Trail (Waypoint EMBTGS: N 35° 6.206'; W 106° 26.556'; 7,925 ft)
Self portraits at EMBTGS

Towards Oso Pass on Three Gun Spring Trail Towards Oso Pass on Three Gun Spring Trail
Towards Oso Pass on Three Gun Spring Trail

Oso Pass (Waypoint OSOPSS	N 35° 7.065'; W 106° 26.596' 8,442 ft) Snow Near Oso Pass
Oso Pass
Waypoint OSOPSS: N 35° 7.065'; W 106° 26.596'; 8,442 ft
Snow Near Oso Pass

All photos from the hike.

The k-raddest part of the hike was that I did it all on foot - no car ride to a trail head. Highly recommended!

Puzzle #1

Tuesday, January 10th, 02006

New hobby - Jigsaw puzzles:

completed jigsaw puzzel #1

Broken Bone Bonanza

Wednesday, January 4th, 02006

As noted by themfwic, the amount of traffic I'm receiving from people sharing their experiences with broken bone trauma is getting a little out of porportion.

Thankfully, I'm well beyond my own injury. As a result, I'm no longer very interested in the topic, but I don't have the heart to disable comments on the related posts either, as this would shutdown a small torrent of potentially valuable activity; it might be helping people, and it's certainly not hurting anyone after all. So, best of luck to all who are suffering from an injury, and welcome to bohnsack.com!

Maybe I need to start another blog at a new domain name and leave this site as a forum dedicated to broken bones?...

Also, All of my broken ankle-releated posts.

It’s a little something called “if balance > 0″

Wednesday, January 4th, 02006

This is the second email I've recieved from UNM warning me that I'll be disenrolled, unless I come up with the scary sum of $0.00. I've paid for next semester in full, but their notification script "isn't featureful enough" to check for a balance before SPAMing me:

   NOTIFICATION of REQUIRED PAYMENT
	
   BOHNSACK, MATTHEW P
	
   This is just a reminder that the "Required Payment" listed below
   must be received in the Bursar's Office by 5:00 P.M. on 01/06/06.  You
   may pay your disenrollment balance and any other charges on your
   student account using I-TEL-UNM for the web at https://itel.unm.edu
   or I-TEL-UNM for the phone at (505) 246-2020.
	
   Due to extremely high volume, we strongly recommend that you pay your
   tuition and fees before the Disenrollment deadline date (Fri, Jan 6th).
	
   Any unpaid intersession tuition charges will be included in your
   disenrollment balance.
	
   Total Charges: $ 0.00
	
   Anticipated Financial Aid or Scholarships: $ 0.00
	
   Required Payment: $ 0.00
	
   The "Total Charges" amount listed above includes charges incurred as
   of 01/03/06.  An increase in the number of registered hours or a
   reduction in "Anticipated Financial Aid" may increase your "Required
   Payment" amount.  Check I-TEL-UNM for new totals.
	
   Payment or payment arrangements (promissory note) must be made
   with the Bursar's office to avoid disenrollment.
	
   ...

(emphasis mine)

Perhaps I'm being too sensitive. Do normal people like receiving this kind of pointless email?