Where is Darran?

i’m somewhere around here

Breakfast, Pack up, Internet time, Took Some Pictures of The Jailhouse, Booked a Ride to Kaikoura, Bummed a Ride to the Bus stop, Japanese Lunch, Library, Internet Cafe, Late Arrival, Super Quiet Night – Kaikoura, New Zealand (Day 33) (September 18, 2009)

Filed under: Status — Darran at 9:32 pm on Friday, January 28, 2011

Today Mikey and I split up in different directions. Mikey was keen on exploring Christchurch and heading south and I was keen on heading north. Think I had a standard breakfast of a banana, an orange, and some instant coffee. Afterwards, I found a bus ticket headed north to Kaikoura. Could have taken the Kiwi bus, but it was headed out the next day and I didn’t feel like burning another day in Christchurch. It’s a great city, but the road was starting to get to me. Mikey gave me a ride to the bus stop and I dropped my bags off and then headed to the library for some free internet. The library ended up closing, so I grabbed some food at a restaurant next to Base Hostel and then headed to the internet cafe next door to upload some pics to Facebook. Eventually, it was time to take the bus to Kaikoura. I was on my own again and feeling a little roughed up for some reason. We got in late and the bus driver dropped me off on the corner. I walked the rest of the way to the YHA in Kaikoura. It was late and the kitchen was closed so I think I had some bread with peanut butter and some other snacks and then hit the sack. Tomorrow I would catch another bus headed even farther north.

Tour Progression:


View New Zealand 2009 in a larger map

Breakfast, Pack up, 3 Hour Session at Hanmer Springs, Groceries, Lunch, Drive to Christchurch, Check-in to Jailhouse Accommodation, Laundry, Chinese Takeaway, Internet Time, Relaxed Night – Christchurch, New Zealand (Day 32) (September 17, 2009)

Filed under: Status — Darran at 11:27 am on Saturday, January 15, 2011

It was a cold night, but we stayed warm inside the minivan. Mikey had a series of blankets and I had a sleeping bag. I reckon it was pretty foul, but you can’t tell after you’ve been in it so long. We got a breakfast in and packed the van. The Top 10 Holiday Park in Hanmer Springs is pretty nice. It has everything you need. After packing up we made our way to Hanmer Springs. Unfortunately, there is no alcohol allowed. Regardless, I poured a few brews into a large water bottle and we made our way inside. Hanmer Springs is pretty much a water park made out of hot tubs. There are pools of all different temperatures and sizes and people are just chilling out.

mikey getting some r&r after summiting Mt. Fyffe

P9170823

yours truly enjoying one of the hottest tubs

P9170826

There’s only so much time you can spend chilling in a hot tub. It was low season and there wasn’t really anyone to chat up. Mikey and I left after having thoroughly enjoyed the springs. Next, we hit up a small grocery store and picked up some sandwich items and snacks for the road. We got into Christchurch in the evening. We took the long way in and had a little tour of Christchurch while trying to find the hostel. Christchurch is one of my most favorite places. It is absolutely brilliant. In hindsight I probably should have tried to find work there instead of making my way back up to Auckland. The first time I was in Christchurch I stayed at Base. This time we stayed at Jailhouse Accodomodation. The hostel is a renovated prison and is one of the coolest places I’ve ever stayed. Mikey and I had a quiet night catching up on laundry, internet, and having take out Chinese food for dinner. Check out some pics of the hostel below.

P9180827

P9180828

P9180830

P9180832

P9180839

Working print_it.c for Sam’s Teach Yourself C Programming in 21 days

Filed under: How To — Darran at 7:14 pm on Saturday, January 8, 2011

It’ s always awesome being blessed with incorrect code snippets in beginner programming books. Luckily, I have enough sexy house music to work through anything (thank you radio 1!). If you’re looking for a working print_it.c example, look no further!

much thanks to: http://www.programmersheaven.com/mb/beginnercpp/367391/367391/newbie-programming-error/ – There are bunch of sites with code for print_it.c and programmersheaven.com was the only one that had working code.

code:

/* print_it.c-- This program prints a listing with line numbers! */
#include <stdlib.h>
#include <stdio.h>
void do_heading(char *filename);
int line = 0, page = 0;
int main( int argv, char *argc[] )
{
char buffer[256];
FILE *fp;
if( argv < 2)
{
fprintf(stderr, "\nProper Usage is: ");
fprintf(stderr, "\n\nprint_it filename.ext\n" );
return(1);
}
if (( fp = fopen( argc[1], "r" )) == NULL )
{
fprintf( stderr, "Error opening file, %s!", argc[1]);
return(1);
}
page = 0;
line = 1;
do_heading( argc[1]);
while( fgets( buffer, 256, fp ) != NULL )
{
if( line % 55 == 0 )
do_heading( argc[1] );
fprintf( stdout, "%4d:\t%s", line++, buffer );
}
fprintf( stdout, "\f" );
fclose(fp);
return 0;
}
void do_heading( char *filename )
{
page++;
if ( page > 1)
fprintf( stdout, "\f" );
fprintf( stdout, "Page: %d, %s\n\n", page, filename );
}
/* print_it.c-- This program prints a listing with line numbers! */#include <stdlib.h>#include <stdio.h>
void do_heading(char *filename);
int line = 0, page = 0;
int main( int argv, char *argc[] ){char buffer[256];FILE *fp;
if( argv < 2){fprintf(stderr, "\nProper Usage is: ");fprintf(stderr, "\n\nprint_it filename.ext\n" );return(1);}
if (( fp = fopen( argc[1], "r" )) == NULL ){fprintf( stderr, "Error opening file, %s!", argc[1]);return(1);}
page = 0;line = 1;do_heading( argc[1]);
while( fgets( buffer, 256, fp ) != NULL ){if( line % 55 == 0 )do_heading( argc[1] );
fprintf( stdout, "%4d:\t%s", line++, buffer );}
fprintf( stdout, "\f" );fclose(fp);return 0;}
void do_heading( char *filename ){page++;
if ( page > 1)fprintf( stdout, "\f" );
fprintf( stdout, "Page: %d, %s\n\n", page, filename );}

now all that’s left is:

gcc print_it.c -o print

./print print_it.c