Saturday, February 26, 2005

Bike Bits.. Literally

So, I mostly stripped my bike right down the other day, Washed it between frozen sleet showers this morning and stripped it full this arvo.

Now my once pride and joy is a colleciton if bits.. Frame, cranks, fork, rims, headhset, handle bars..

Dont you love reverse locking threaded bolts with EXTRA locktight applied?

(pedals/cranks are self tightening under normal use, so are reverse threaded. It would be no good to turn the cranks over as you ride and unscrew your pedals....)…

Anyway, after much drama, a block of wood + hammer, the cranks are off the bottom brack and the pedals are free of the crank…

My only drawback right now is the bottom ring of the headset is pressed onto the fork stem… and I want to sell the headset with the frame, so… somehow need to get that off the fork.. grrr.. its not easy…

I’m not even gonna think about trying to remove the bottom bracket..

Tomorow I will need to degrease/de-gunk my shifters and remove the cabling sticking out of the shifters.. whoop. Then I can have a bike-bits extravaganza on ebay.

The only thing I am keeping/taking to America is my rims and my hydrolic discs (expensive Hope M4’s with 185mm discs)…

Posted by Stu on 02/26 at 06:46 PM Permalink to this post.
Filed Under : Mountain Biking
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Sunday, February 20, 2005

Brrrr

Brrrrr check it out yo! Its about an inch to two inches deep.

image

image

image

Posted by Stu on 02/20 at 08:56 AM Permalink to this post.
Filed Under : Life
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Saturday, February 19, 2005

Food

Its 11pm at night and I have a hankering for a toasted fried egg sandwhich… mmmm…

Posted by Stu on 02/19 at 12:02 AM Permalink to this post.
Filed Under : Life
Comments are closed Commented on by (1) people. Read those Comments Here

Linked To by (0) blogs. Get a Trackbacks link here

Thursday, February 17, 2005

Singers and Songwriters….

Australias three greatest singer/songwriters;

Mick Thomas
Paul Kelly
Archie Roach

Posted by Stu on 02/17 at 04:21 PM Permalink to this post.
Filed Under : Life
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Tuesday, February 08, 2005

Of Roguelikes

So been working a lot on SRL lately.. Things are progressing nicely…

Some bugs in the day/night cycle have been fixed, more shops added or fixed up.
Random dungeon generating is working fine. Scripted dungeons are working fine…

Now to add the guards in basic monster code to the town, then I can gen monsters in the dungeons and mazes… and we should be mostly there to a workable game…

Posted by Stu on 02/08 at 10:54 AM Permalink to this post.
Filed Under : Development
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Monday, February 07, 2005

Gorrillas in the mist #2

I forgot, this is what we hiked up for the first bit

This is Roseburry Topping in mist, fog, cloud, smog and haze.

image

Posted by Stu on 02/07 at 10:11 AM Permalink to this post.
Filed Under : Camping / Hiking
Comments are closed There are no comments on this entry.
Linked To by (0) blogs. Get a Trackbacks link here

Sunday, February 06, 2005

Gorillas in the mist

Went hiking with darryl today, he drove up last night from Porstmouth so today we were out hiking. We did about 7-8 miles, from Great Ayton up to Roseburry Topping, over to Captain Cooks Monumount and back down to Great Ayton.

Later we drove over to Whitby for fresh fish and chips. I had cod that was as long as my arm, while my mate had breaded scampi.

What a great day. The trails were uber muddy, and I had mud from shoes to knees…

Even Che has been to Great Ayton
image

Me
image

Darryl
image

We did part of the Cleveland Way
image

Posted by Stu on 02/06 at 11:55 PM Permalink to this post.
Filed Under : Camping / Hiking
Comments are closed Commented on by (3) people. Read those Comments Here

Linked To by (0) blogs. Get a Trackbacks link here

Friday, February 04, 2005

Ruby : Firebird / Interbase

Heres a diff patch against the interbase release
(rather than my own tree)

ruby-interbase-0.7

the md5 of the patch;
f28ce2f32e436f2f276b3bbb09f8a6a6 patch-01.diff

This will add the Interbase::ServiceManager stuff that I have done sofar…
For this to work, untar the ruby-interbase-0.7.tar.gz source tree
then cp -R it to ruby-interbase

then apply the patch

--- ruby-interbase-0.07/interbase.c    2004-11-03 19:01:52.000000000 +0000
+++ ruby-interbase/interbase.c    2005-02-04 17:49:02.000000000 +0000
@@ -45,+45,@@
 static 
VALUE rb_cIBcursor;
 static 
VALUE rb_cIBblob;
 static 
VALUE rb_eIBerror;
+static 
VALUE cFBServiceManager;
 
 static 
long isc_status[20];    /* status vector */
 
static char isc_info_stmt[] { isc_info_sql_stmt_type };
@@ -
54,+55,24 @@
     
isc_tpb_concurrency,    isc_tpb_nowait
 }
;
 
+
#define RESPBUF    512
+struct fb__sm_attach
+{
+    /* probably only need svc_handle in here but
+       its easier on memory alloc if the service
+       manager funcs get called often, to not allocate
+       chunks of memory each time.. lets leave the baggage
+       with the servicemanager class */
+
+    
// our flag...
+    int                attached;
+        
+    
isc_svc_handle    *svc_handle;
+    
ISC_USHORT        spblen;
+    
char            spb_buff[128];
+
};
+
+
 
/* structs */
 
 /* DB handle and TR parameter block list structure */
@@ -112,+131,614 @@
 
#define    FREE(p)        if (p)    { free(p); p = 0; }
 #define    SETNULL(p)    if (p && strlen(p) == 0)    { p = 0; }
 
+charconvert_r2c(VALUE s);
+
void sm_detach(struct fb__sm_attach *data);
+
charsm_get_string_msg(VALUE thisISC_USHORT msg);
+
charsm_start_service(VALUE thisISC_USHORT msg);
+
void throw_error(char *msg);
+
+
charconvert_r2c(VALUE s)
+
{
+    VALUE str;
+    
char *x;
+    
+    
// convert to string
+    str StringValue(s);
+    
Check_Type(strT_STRING);
+    
+    
// copy string...
+    RSTRING(str)->ptr;
+    
+    if(
== NULL)
+        return 
x;
+    
+    return 
strdup(x);
+
}
+
+
+
// garbage collector free routine.
+void rsm__free(void *p)
+
{
+    struct fb__sm_attach *data;
+
+    
data p;
+    
+    
// p is our datablock of the servicemanager
+    if(data->attached == 1)
+    
{
+        sm_detach(data);
+    
}
+    
+    
free(p);
+
}
+
+
VALUE rsm__init(VALUE this)
+
{
+    struct    fb__sm_attach *data;
+    
VALUE obj;
+    
+    
data = (struct fb__sm_attach*)calloc(1sizeof(struct fb__sm_attach));
+    
//assert(data != NULL);
+    if(data == NULLthrow_error("Could not create object");
+
+    
// bind this to 'this' or self. 
+    obj Data_Wrap_Struct(this0rsm__freedata);
+    
+    return 
obj;
+
}
+
+
VALUE rsm_init(VALUE this)
+
{
+    // do nothing initializer...
+    return this;
+
}
+
+
void throw_error(char *msg)
+
{
+    rb_raise(rb_eIBerrormsg);
+
}
+
+
VALUE rsm_attach(VALUE thisVALUE hostnameVALUE usernameVALUE password)
+
{
+    ISC_STATUS        status[20];
+    
char            svc_name[32];
+    
char            *spb;
+    
char            *x;
+
+    
struct    fb__sm_attach *data;
+    
char     *r_hostname;
+    
char     *r_username;
+    
char     *r_password;
+    
+    
// get our data out of our object
+    Data_Get_Struct(thisstruct fb__sm_attachdata);
+    if(
data == NULLthrow_error("Invalid memory block.");
+    
+    
r_hostname convert_r2c(hostname);
+    
r_username convert_r2c(username);
+    
r_password convert_r2c(password);
+
+    if(
r_hostname == NULLthrow_error("hostname required");
+    if(
r_username == NULLthrow_error("username required");
+    if(
r_password == NULLthrow_error("password required, even if blank");
+
+    
spb data->spb_buff;
+    
+    *
spb++ = isc_spb_version;
+    *
spb++ = isc_spb_current_version;
+    
+    *
spb++ = isc_spb_user_name;
+    *
spb++ = strlen(r_username);
+    
+    for(
x=r_username; *x;)    
+        *
spb++ = *x++;
+    
+    *
spb++ = isc_spb_password;
+    *
spb++ = strlen(r_password);
+    
+    for(
x=r_password; *x;)
+        *
spb++ = *x++;
+
+    
strncpy(svc_namer_hostnamestrlen(r_hostname)+1);
+    
strncat(svc_name":service_mgr"strlen(":service_mgr")+1); /* tcpip */
+
+    
//data->spblen = spb - data->spb_buff;
+    data->spblen 128;    //current allocated spb_buff size
+    data->attached 0;
+    
+    if(
isc_service_attach (status0svc_name, (isc_svc_handle*)&data->svc_handledata->spblen, (char*)&data->spb_buff))
+    
{
+        char        rspbuff[RESPBUF];
+        
ISC_STATUS    *vector status;
+        
+        
isc_interprete(rspbuff, &vector);
+        
throw_error(rspbuff);
+    
}
+    else
+        
data->attached 1;
+
+    
// these are not required after attaching..
+    
+    
// erase password out of memory...
+    memset(r_password'x'strlen(r_password));
+    
+    
// cleanup.
+    free(r_hostname);
+    
free(r_username);
+    
free(r_password);
+
+    return 
INT2NUM((long)data->svc_handle);
+
}
+
+
VALUE rsm_detach(VALUE this)
+
{
+    struct fb__sm_attach *data;
+    
+    
Data_Get_Struct(thisstruct fb__sm_attachdata);
+    if(
data == NULLthrow_error("Invalid memory block.");
+    
+    if(
data->attached == 1)
+    
{
+        sm_detach(data);
+        
data->attached 0;
+    
}
+    else
+    
{
+        throw_error("Not attached to the server.");
+    
}
+    
+    return 
this;
+
}
+
+
/* internal routine that we use in detach and in the memory dealloc routine */
+void sm_detach(struct fb__sm_attach *data)
+
{
+    ISC_STATUS    status[20];
+    
+    
isc_service_detach(status, (isc_svc_handle*)&data->svc_handle);
+
}
+
+
VALUE rsm_restore_db(VALUE thisVALUE db_nameVALUE restore_name)
+
{
+    char         *dbname;
+    
char         *bkname;
+    
struct        fb__sm_attach *data;
+    
ISC_STATUS    status[20];
+    
char        thd_buff[RESPBUF];
+    
char        *thd;
+    
char        *x;
+    
ISC_USHORT    thdlen;
+    
char        *p;
+    
unsigned long     opts;
+    
+    
Data_Get_Struct(thisstruct fb__sm_attachdata);
+    if(
data == NULLthrow_error("Invalid memory block.");
+    
+    if(
data->attached != 1)
+        
throw_error("Must be attached to initiate restore.");
+    
+    
// convert into strings
+    dbname convert_r2c(db_name);
+    
bkname convert_r2c(restore_name);
+    
+    if(
dbname == NULLthrow_error("database name required");
+    if(
bkname == NULLthrow_error("restore database name required");
+    
+    
thd thd_buff;
+    
+    
// mark our function
+    *thd++ = isc_action_svc_restore;
+    
+    
// backup file
+    *thd++ = isc_spb_bkp_file;
+    
ADD_SPB_LENGTH (thdstrlen(bkname));
+    for(
x=bkname; *x;)
+        *
thd++ = *x++;
+    
+    
// set for db name
+    *thd++ = isc_spb_dbname;
+    
ADD_SPB_LENGTH (thdstrlen(dbname));
+    for(
x=dbname; *x; )
+        *
thd++ = *x++;
+        
+    
// gimme verbose output
+    *thd++ = isc_spb_verbose;
+
+    
// replace
+    *thd++ = isc_spb_options;
+    
opts isc_spb_res_replace;
+    
ADD_SPB_NUMERIC(thdopts);
+
+    
// end.
+    thdlen thd thd_buff;
+    
+    if(
isc_service_start(status, (isc_svc_handle*)&data->svc_handleNULLthdlenthd_buff))
+    
{
+        char        rspbuff[RESPBUF];
+        
ISC_STATUS    *vector status;
+        
+        
isc_interprete(rspbuff, &vector);
+        
throw_error(rspbuff);            
+    
}
+    else
+    
{
+        sm_get_string_msg(thisisc_info_svc_line);
+        return 
rb_str_new2(p);
+    
}
+    
+    return 
this;
+
}
+
+
VALUE rsm_backup_db(VALUE thisVALUE db_nameVALUE backup_name)
+
{
+    char         *dbname;
+    
char         *bkname;
+    
struct        fb__sm_attach *data;
+    
ISC_STATUS    status[20];
+    
char        thd_buff[RESPBUF];
+    
char        *thd;
+    
char        *x;
+    
ISC_USHORT    thdlen;
+    
char        *p;
+    
+    
Data_Get_Struct(thisstruct fb__sm_attachdata);
+    if(
data == NULLthrow_error("Invalid memory block.");
+    
+    if(
data->attached != 1)
+        
throw_error("Must be attached to initiate backup.");
+    
+    
// convert into strings
+    dbname convert_r2c(db_name);
+    
bkname convert_r2c(backup_name);
+    
+    if(
dbname == NULLthrow_error("database name required");
+    if(
bkname == NULLthrow_error("backup database name required");
+    
+    
thd thd_buff;
+    
+    
// mark our function
+    *thd++ = isc_action_svc_backup;
+    
+    
// set for db name
+    *thd++ = isc_spb_dbname;
+    
ADD_SPB_LENGTH (thdstrlen(dbname));
+    
+    for(
x=dbname; *x; )
+        *
thd++ = *x++;
+        
+    
// backup file
+    *thd++ = isc_spb_bkp_file;
+    
ADD_SPB_LENGTH (thdstrlen(bkname));
+    for(
x=bkname; *x;)
+        *
thd++ = *x++;
+        
+    
// gimme verbose output
+    *thd++ = isc_spb_verbose;
+
+    
// end.
+    thdlen thd thd_buff;
+    
+    if(
isc_service_start(status, (isc_svc_handle*)&data->svc_handleNULLthdlenthd_buff))
+    
{
+        char        rspbuff[RESPBUF];
+        
ISC_STATUS    *vector status;
+        
+        
isc_interprete(rspbuff, &vector);
+        
throw_error(rspbuff);            
+    
}
+    else
+    
{
+        sm_get_string_msg(thisisc_info_svc_line);
+        return 
rb_str_new2(p);
+    
}
+
+
+    return 
this;
+
}
+
+
VALUE rsm_server_version(VALUE this)
+
{
+    VALUE    str;
+    
char     *x;
+    
+    
sm_get_string_msg(thisisc_info_svc_server_version);
+    
+    
// return string as ruby string.
+    str rb_str_new2(x);
+    
// free our C string
+    free(x);
+
+    return 
str;
+
}
+
+
VALUE rsm_service_implementation(VALUE this)
+
{
+    VALUE    str;
+    
char     *x;
+    
+    
sm_get_string_msg(thisisc_info_svc_implementation);
+    
+    
// return string as ruby string.
+    str rb_str_new2(x);
+    
// free our C string
+    free(x);
+
+    return 
str;
+
}
+
+
//
+//
+VALUE rsm_user_dbpath(VALUE this)
+
{
+    VALUE    str;
+    
char     *x;
+    
+    
sm_get_string_msg(thisisc_info_svc_user_dbpath);
+    
+    
// return string as ruby string.
+    str rb_str_new2(x);
+    
// free our C string
+    free(x);
+
+    return 
str;
+
}
+
+
VALUE rsm_env_message(VALUE this)
+
{
+    VALUE    str;
+    
char     *x;
+    
+    
sm_get_string_msg(thisisc_info_svc_get_env_msg);
+    
+    
// return string as ruby string.
+    str rb_str_new2(x);
+    
// free our C string
+    free(x);
+
+    return 
str;
+
}
+
+
+
VALUE rsm_env_lock(VALUE this)
+
{
+    VALUE    str;
+    
char     *x;
+    
+    
sm_get_string_msg(thisisc_info_svc_get_env_lock);
+    
+    
// return string as ruby string.
+    str rb_str_new2(x);
+    
// free our C string
+    free(x);
+
+    return 
str;
+
}
+
+
VALUE rsm_env(VALUE this)
+
{
+    VALUE    str;
+    
char     *x;
+    
+    
sm_get_string_msg(thisisc_info_svc_get_env);
+    
+    
// return string as ruby string.
+    str rb_str_new2(x);
+    
// free our C string
+    free(x);
+
+    return 
str;
+
}
+
+
+
VALUE rsm_server_log(VALUE this)
+
{
+    VALUE    str;
+    
char     *x;
+    
+    
//x = sm_get_string_msg(this, isc_action_svc_get_ib_log);
+    sm_start_service(thisisc_action_svc_get_ib_log);
+    
+    
// return string as ruby string.
+    str rb_str_new2(x);
+    
// free our C string
+    free(x);
+    
+    return 
str;
+
}
+
+
charsm_start_service(VALUE thisISC_USHORT msg)
+
{
+    struct        fb__sm_attach *data;
+    
ISC_STATUS    status[20];
+    
char        thd_buff[16];
+    
char        *thd;
+    
char        *p;
+    
char        *rspbuff;
+    
+    
Data_Get_Struct(thisstruct fb__sm_attachdata);
+    if(
data == NULLthrow_error("Invalid memory block.");
+    
+    if(
data->attached != 1)
+        
throw_error("Must be attached to the servicemanager to do this.");
+    
+    
thd thd_buff;
+    *
thd++ = msg;
+        
+    if(
isc_service_start(status, (isc_svc_handle*)&data->svc_handleNULL1thd_buff))
+    
{
+        //isc_print_status (status);
+        ISC_STATUS    *vector status;
+        
+        
rspbuff malloc(1024);
+        
+        
isc_interprete(rspbuff, &vector);
+        
throw_error(rspbuff);
+    
}
+    else
+    
{
+        sm_get_string_msg(thisisc_info_svc_line);
+        return 
p;
+    
}
+    
+    return 
NULL;
+
}
+
+
charsm_get_string_msg(VALUE thisISC_USHORT msg)
+
{
+    struct        fb__sm_attach *data;
+    
ISC_STATUS    status[20];
+    
char        thd_buff[16];
+    
char        *thd;
+    
char        *x;
+    
unsigned char *p;
+    
ISC_USHORT     len;
+    
int            buflen;
+    
char        *rspbuff;
+    
+    
char        *retstring, *r2;
+    
unsigned long retlen;
+    
+    
unsigned char    m1m2;
+    
+    
Data_Get_Struct(thisstruct fb__sm_attachdata);
+    if(
data == NULLthrow_error("Invalid memory block.");
+    
+    if(
data->attached != 1)
+        
throw_error("Must be attached to do this.");
+    
+    
buflen 4096;    
+    
rspbuff = (char*)calloc(1buflen);
+    
+    
retstring NULL;
+    
r2 retstring;
+    
retlen 0;
+    
+    while(
1)
+    
{    
+        thd thd_buff;
+        *
thd++ = msg;
+        
+        
memset(rspbuff0x0buflen);
+        
+        if(
isc_service_query(status, (isc_svc_handle*)&data->svc_handleNULL0NULL1thd_buffbuflen-1rspbuff))
+        
{
+            ISC_STATUS    *vector status;
+            
+            
isc_interprete(rspbuff, &vector);
+            
throw_error(rspbuff);
+        
}
+        else
+        
{
+            // point to buffer
+            rspbuff;
+
+            
// skip message ID
+            x++;
+            
+            
// pull string length out
+            len = (ISC_USHORTisc_vax_integer (xsizeof(ISC_USHORT));
+
+            
// skip length count
+            += sizeof(ISC_USHORT);
+            
x;
+            
+            
m1 = *p;
+            switch(*
p)
+            
{
+                case isc_info_truncated:
+                    
buflen += 4096;
+                
+                    
// arbitrary test... could be raised to something huge i guess.
+                    if(buflen > (1024*512))
+                    
{
+                        free(rspbuff);
+                        
throw_error("Buffer grew too large.");
+                    
}
+                    else
+                    
{
+                        free(rspbuff);
+                        
// allocate buffer.
+                        rspbuff = (char*)calloc(1buflen);
+                    
}
+                    break;
+                    
+                case 
isc_info_svc_timeout:
+                    
free(rspbuff);
+                    
throw_error(