RIP nVidia GeForce 6200, PoS@256mb

Well, to make a long story shorter..

Whent to join TG#1 to kill some stress but it was full, supper was soon so I switched to TG#3 instead and went to join Duke for a round.

Before the round started I had to getup and do some thing and ma moved my chair out so she could get to the printer so I had to wait. By the time I got to sit back down my computer had already had the monitor blip and the PC restart — from running SWAT4:TSS to showing the BIOS start screen… if there was any error message before that I didn’t get a chance to see it.

On each restart that followed the monitor was all funky and kept blipping on and off as if the signal wasn’t working.

Instantly my brains thinking monitor, monitor cable, graphics card, fans, and motherboard for possible problems. Hooked up the monitor I got from the Library for a few bucks, same effect. Opened the case, blew the crap out of it with a can of air. Yanked all of the PCI family cards out, Audigy 4, TV Tuner, GeForce 6200 e.t.c and gave them a go. Cut my finger trying to get the graphics card out of it’s PCI-Ex16 slot, freaking plastic lever was to buried to see which way it angled.

Unscrewed the main (looked 90mm) fan from the case but the power connector was to short to pull it clean for cleaning… Couldn’t get that unplugged so I pulled out the (E)IDE cable connecting the DVD-ROM’s and one of the 512MB RAM DIMMs and still couldn’t get the flib’n thing out.. So I ended up cleaning it with a paper towel half over the PSU, half over the mother board : Needless to say I didn’t even want to mess with the issue of getting to the CPU.

Managed to get that screwed back in and then I had to pull the main power off the motherboard to get the RAM slot back in (the slots are right under the worst tangle of power cabling!). The inside of the PC was dusty but not that bad, most of it was just on the fan blades and the front side vents (veeerrrryyyy bad) but still cleaner then Ma’s Dell and that things been running forever without a cleaning, like once in 7+ years.

Booted her back up and still no luck although the main fan was running a heck of a lot better the temp was still normalD. I noticed though that my motherboard had a port for a monitor on it with a cover. I remember there was a note taped on it when I first set up the computer < 2 years ago.
Interestingly while the monitor was displaying screwy when plugged intot he Geforce 6200, maybe even some kind of pixel array during the computers startup. It was perfectly fine when in the BIOS setup, maybe because it would have to be used at a really low level dunno. Set the BIOS Video configuration from AUTO to Integrated, restarted and changed ports.

Using the onboard 128MB Intel GMA it works… RVS works fine to but RvS will work with just about any thing made after the stone age if it supports the right features.. With how over-optimized RvS is you could probably run it on a Cuisinart without trouble : SWAT4:TSS on the other hand is quite sensitive to ATI/nVidia drivers and essentially resulted in an impossible to kill application.

All of the other computers here use AGP so Ic an’t even test the card or a different card in the slot, so I hope it’s the GeForce 6200 and not part of the Motherboard..

So it looks like I have to either give up on S4 or buy a new Gfx card.. I know I’ve often thought about upgrading if finances allowed but this does not make me happy. Data failure is cheap, use backups but when the hardware goes nuts what do you do?

Upgrade to GeForce 8400GS and it’s fixed… Guess it was the GeForce 6200 going bad :

randomly sorting lists

Was hashing out a very quick program to take a list of maps from a file and to replace the ones in the config file with those but sorted into a fairly random pattern.

Then I realized that I have no bloody idea how to randomly sort, ehh unsort a list of strings.

My notes scribbled in file:

##################################################
# Randomize the contents of a list -- algorithmic ideas
#
# input; list of N items to be randomized
# storage: table T to hold previously generated random numbers
#
# loop until done where each item in list is sorted into new list
# generate random number R between 0 and N
# store N in a table T if not already done so then
# if N is not in table T
# new list[R] = current item in loop
# else if N is in table continue to next iteration
#
# List will probably have to be a temporary to be generated from input list
#
# result expected: loop once per each item in the input list creating
#

That is the best I can think of when you consider the number of distractions:

birds screeching
mother shouting (at me, dog, and bird)
dozen pans falling
going AFK every X minutes
walking out in the cold to check the car cover
sorting pans back onto shelf
et alii

Is it a wonder I *usually* don’t touch an ounce of code until I am THE ONLY MORON AWAKE in this house ? I think not !

rf.c revisited

Got bored, so I revisited an old program I wrote like last year. One of the very first ones I set out to write in C in fact. I admit there is no practical need for this program haha. The only reason I wrote it is that I found it some one annoying that the cat program was made to concatenate files and print them to stdout. But is all so often just used to print out a lone file when less -F does the same thing. For the fun of it I basically added the ability to mimic the head and tail commands with an implicit number of lines to print (e.g. like head -n / tail -n ) while still keeping to the basic function of outputing a lone file, later I made it handle multiple files just for fun.

I was remembering today the sfalloc() macro I had defined early on. Some thing like

#define sfalloc( _type, _ptr ) 
(_type *)malloc( sizeof(_ptr) )

The main point of it was to ensure I wrote sizeof(foo) instead of sizeof(int) or some thing. And to get it to compile with a C++ compiler. I was thinking about making a new version of it for one of my header files that would use the cast only if __cplusplus was defined or better yet the new operator instead for use in code I would want to be compatible with both C and C++ but why bother for such a small program? Althouhg it would be a good spot to test it out in if I did hehe. Besides MSVC++ is a pain in the ass any way for compiling C99 code (imho).

My favorite non standard extensions to the C standard library on BSD and GNU systems is deffo err(), errx(), warn(), warnx(), and related routines in err.h namely because they are major time savers imho. Since a unix like system is assumed unistd is included and getopt(3) used for parsing argv rather then doing it manually.

I didn’t use the various linked list macros provided by BSD boxes because I wanted to avoid them, in case I ever decided to build the app on Windows or DOS. It also was the first time I ever used a linked list in a C program so I wanted to give it a go hehe. I’m really glad I did to because it was a really good excuse to learn how to use the GNU Debugger at the time 😉

One of the changes I made today was ensuring it would compile fine without assuming a C99 environment, I also ran it by gcc42 with -std=c89 -ansi and -pedantic-errors in the hopes of catching any thing I might’ve visually missed.

the ‘final’ version of the old program

/*-
* Copyright (C) 2007
* [my name ]. All rights reserved.
*
* permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/


#if __STDC_VERSION__ >= 199901L
/* inline functions were added in C99 */
#else
#define inline /* protect me */
#endif

#define MALLOC_FAILED "Unable to initialize memory at __LINE__ n"

/* magic number for debugging read_bottom() and clean_up() */
#define NOMEM ((struct lnpos *)0xDEADBEEF)

#include <err.h>
#include <errno.h>
#include <limits.h>
#include <locale.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

/* For storing end of line characters */
typedef struct lnpos {
long eol;
struct lnpos *next;
struct lnpos *prev;
} LNPOS;


static inline FILE *open_file( char * );
static inline void read_all( FILE *, int );
static void read_top( FILE *, int );
static void read_bottom( FILE *, int );
static inline void clean_up( LNPOS * );
static inline void be_verbose( char * );
static inline void usage( void );


static const char *this_progname;


/*
* rf - read file to standard out v2.0 -- see changes.log for details
*/
int
main( int argc, char *argv[] ) {

char *errp;
int b_flag = 0, s_flag = 0, t_flag = 0, v_flag = 0;
int ch, f, lncnt = 0;
FILE *fp;


setlocale( LC_ALL, "" );
this_progname = argv[0];

while ( (ch = getopt( argc, argv, "b:st:v" )) != -1 ) {
switch ( ch ) {
case 'b':
/* Mimic tail(1) -n */
b_flag++;
lncnt = strtol( optarg, &errp, 10 );
if ( *errp || lncnt <= 0 ) {
errx( EXIT_FAILURE,
"Improper line count -- %sn", optarg );
}
break;
case 's':
/* Suppress -v when given multiple files. */
s_flag++;
v_flag = 0;
break;
case 't':
/* Mimic head(1) -n */
t_flag++;
lncnt = strtol( optarg, &errp, 10 );
if ( *errp || lncnt <= 0 ) {
errx( EXIT_FAILURE,
"Improper line count -- %sn", optarg );
}
break;
case 'v':
/* Append file names -- be_verbose() */
v_flag++;
break;
case '?':
default:
usage();
/* NOTREACHED */
}
}
argc -= optind;
argv += optind;

if ( argc < 1 ) {
usage();
}

/* Handle multiple files */
for ( f = 0; f < argc; f++ ) {
fp = open_file( argv[f] );

if ( (!t_flag) && (!b_flag) ) {
read_all( fp, lncnt );
} else if ( t_flag ) {
read_top( fp, lncnt );
} else if ( b_flag ) {
read_bottom( fp, lncnt );
} else {
usage();
/* NOTREACHED */
}

if ( (v_flag != 0) || (argc > 1) ) {
/* Don't suppress if not set */
if ( s_flag == 0 ) {
be_verbose( argv[f] );
v_flag++;
} else {
v_flag = 0;
}
}

fclose( fp );
}

return EXIT_SUCCESS;
}


/* Simple fopen wrapper to keep the if...else if...else blockage from getting
* ugly. Since doing other wise would defeat the purpose of it in this program.
* open_file() halts the program if fopen failed.
*/
static inline FILE *
open_file( char *arg ) {

FILE *fto;

fto = fopen( arg, "r" );
if ( fto == NULL ) {
errx( EXIT_FAILURE, "File can not be opened or"
" does not exist -- %sn", arg );
}

return fto;
}


/*
* print out an open file to standard output
*/
static inline void
read_all( FILE *fp, int lncnt ) {

while ( (lncnt = fgetc( fp )) != EOF ) {
printf( "%c", lncnt );
}
}

/*
* Read n lines from the top of the file.
*/
static void
read_top( FILE *fp, int lncnt ) {

int c = 0;
int f = 0;

while ( (c < lncnt) && (f != EOF ) ) {
f = fgetc( fp );
printf( "%c", f );
if ( f == 'n') {
c++;
}
}
}


/*
* Read n lines from the bottom of the file
*/
static void
read_bottom( FILE *fp, int lncnt ) {

int fin = 0, i;
long int eolnum = 0;
long int where;
struct lnpos *cur = NULL;
struct lnpos *root = NULL;
struct lnpos *last = NULL;

/* initiate the linked list */

root = malloc( sizeof(root) );
root->eol=0;
if ( root == NULL ) {
err( EXIT_FAILURE, MALLOC_FAILED );
}
root->next = NOMEM;
root->prev = NOMEM;
cur = root;

cur->next = malloc( sizeof(cur->next) );
cur->next->eol = 0;
if ( cur->next == NULL ) {
err( EXIT_FAILURE, MALLOC_FAILED );
}
cur->next->prev = cur;
cur->next->next = NOMEM;
cur = cur->next;


/*
* read the file, count every end of line and store them in a new
* member of our linked list.
*/
while ( (fin = fgetc( fp )) != EOF ) {
if ( fin == 'n' ) {
eolnum++;
cur->eol = ftell( fp );
cur->next = malloc( sizeof(cur->next) );
cur->next->eol = 0;
if ( cur->next == NULL ) {
err( EXIT_FAILURE, MALLOC_FAILED );
}
cur->next->prev = cur;
cur->next->next = NOMEM;
cur = cur->next;
}
}

/* double check last nodes prev is up to date before marking the end */

cur->next = malloc( sizeof(cur->next) );
cur->next->eol = 0;
if ( cur->next == NULL ) {
err( EXIT_FAILURE, MALLOC_FAILED );
}
cur->next->prev = cur;
cur->next->next = NOMEM;
cur = cur->next;
last = cur;

/* print out the rest of file from the given offset. */
for ( i = 0; i < lncnt; ) {
if ( cur->prev != NOMEM ) {
if ( cur->eol ) {
i++;
}
cur = cur->prev;
}
}


where = fseek( fp, cur->eol, SEEK_SET );
if ( where != 0 ) {
err( EXIT_FAILURE, "Could not seek through the filen" );
}
read_all( fp, lncnt );
clean_up( root );

}

static inline void
clean_up( LNPOS *root ) {

/* Free linked lists memory */
struct lnpos *cur = root;
while ( cur->next != NOMEM ) {
cur = cur->next;
if ( cur->prev != NOMEM ) {
free( cur->prev );
cur->prev = NOMEM;
}
}
free( cur ); /* free the end node */
}

static inline void
be_verbose( char *fname ) {

printf( "n==> %s <==n", fname );
}

static inline void
usage( void ) {

fprintf( stderr, "usage: %s [-t count | -b count] "
"[-v] [file ...]n", this_progname );
exit( EXIT_FAILURE );
}

The simple makefile compiles it:

gcc -Wall -Wpointer-arith -Wcast-qual -Wcast-align -Wconversion
-Waggregate-return -Wstrict-prototypes -Wmissing-prototypes
-Wmissing-declarations -Wredundant-decls -Winline -Wnested-externs
-std=c99 -march=i686

and Makefile.optimize adds the -fforce-mem -fforce-addr -finline-functions -fstrength-reduce -floop-optimize -O3 options for when testing is done, program works fine. FreeBSD’s lint implementation also doesn’t spew any serious messages.

GCC42

I was installing a program last night on my laptop that needed several GNUStep stuff, so I found out the hardway that it needed GCC v4.2.x’s Objective C compiler…

It took maybe 3 1/2 to 4++ hours to build lang/gcc42 but I suppose it’s a good thing. I always wanted to give it a test drive and it seems to have included the Fortran and Java (gcj) compilers with it.

The only good things I can say is one of my C programs built fine with the C Compiler (/usr/local/bin/gcc42) and I got to thumb through the source code in /usr/ports/lang/work/gcc-*/ while I waited. The parts I saw were quite well documented to and a pleasure to read.

One nice thing I suppose, a successful build of a compiler collection is probably a good stress-test for my laptops hardware :

Never trust the cable guy

I can understand wanting to get done in a hurry especially in the morning as much as the next worker but come on man.

Finally found reason to fire up the ol’VCR tonight after we had the cable set up in here like last week.

The mook only unplugged my cable from the VCR<->TV connection and put in the one from the setup box. Without even being so kind as to route the cabling properly so all systems would work.

Geeze, I ain’t no Telecom Engineer or nothing but I know how to hook up a bloody TV system with cable and video systems !!!

Mxing a code squishy

Well, last night I got an alpha grade (imho) release set up on source forge and today I got it posted on forums.pcbsd.org.

It is some what ahead and behind schedule in the same regard, I originally planned to release a mock-up (non functional but ‘looks’) around the new year. Instead I’ve taken a few weeks to push on a head to some thing that actually works.

I had also road mapped a beta with a few more features then are currently ready to be released between Jan 2008 and June 2008 but it’s more likely that I’ll hit a 1.0 by June… hehe. So I’m both behind and ahead of my time goals. Software Schedules are not really some thing I believe in setting in stone, so much as setting a point on the calendar some where between when I expect to be done by and when I think it should be done by.

Since making use of SVN was not in my original plans I do have a bit to consider now.

I want to continue coding so I can keep the pace of development going. But I need to consider the chances of bugs being found in any one that actually tries the snapshot I released. And I do not want to muck with merging branches later if that happens… The stuff I released is not complete but it should be fairly stable, or I wouldn’t have let it hit SVN >_>.

What I am thinking is to limit my self to continuing things in the trunk that need to be done without effecting the released code much. Which is copied to the tags directory so it’s saved in SVN. Then after about a weak or so, go back to un-restrained work. So I can deal with things like redoing the NPM_DisplayDialog the way I would like to redo it.

Before I am willing to bump status to Beta, I want to have NPM able to update the ports tree (portsnap/cvsup/csup) and configure ports. I tested the config gui awhile back before taking the code to sourceforge but I never got it fully working. I need to figure out just how I am going to get a connection between checkboxes and options that I can parse back out of the GUI.

I should also make it look for stored configurations rather then just in the makefile.[0]. Those two things are really what I am interested in coding feature wise. I also want to remove the dependancy on psearch because it really is a simple app and we might get a slight performance boost.

I also want to fix the translation systems up a bit, work on another prototype of the NPM_MainWindow user interface style and do some concept art for NPM’s configuration dialog. I don’t expect a GUI way of changing NPM’s settings to be released until RC status though.

NPM test 1, phase 1 results

I was a little disatisified with the phase 0 results. What I had done was checkout a copy of the sources onto the test machine end removed the diagnostic messages of echoing the command and arguments to be run in the background. A few oversites later namely a missing equals sign and the lack of –verbose switches (as can be seen in the video’s uninstall segment) I basically got it working but not quite happy with it.

Sat down tonight after watching a movie and set to work on getting her working smoothly out of the source tree. After that was done and with a little poking at portupgrade later…. I ran a group of live tests to check for the ‘it actually works’ factor with the core things and got no show stoppers. The only bad things I can say is I don’t care much for the port{upgrade,install} output dots and the occasional lag in updating the QTextEdit widget but it’s probably no slower then doing it from my shell.

here is a copy of the last commit message from editing source code:

CODE PASSES FOLLOWING TEST CASES:

update package listing (right listview)
view pkg_info for selected package (xevil)
remove selected package (xevil)
search ports tree (for xevil)
install port (xevil)

xevil was selected because it is one of the ports I have installed that is a suitable test case (small, fast/easy to install/deinstall) and one of the time wasters I have setup that I can live without if I frag it on there install.

I’m going to upgrade the development status on source forge to Alpha shortly and tomorrow I hope to have a file release ready op, Most of what remains is logistics really, before the Alpha Release the following needs to be compelete:

0/ make demo video (I would write the script now if it was a quarter after 4am’ish) — couldn’t get mic working, just as well with my house…

1/ mini faq thingy uploaded to website and update the sites download page

2/ readme file generated with basic testing instructions blah blah — also included a template for a desktop icon.

3/ update trunk/src/const.py NPM_VERSION – probably will get bumped to “0.48.Xa” ore “0.48.Xpre” and clean up some of the comments

4/ read SVN handbook on tagging and branching and put it to work – I want the alpha release split off the trunk.

5/ get file release prepared — done and done!

6/ forum post typed up for forums.pcbsd.org – done

7/ get my ass back to coding — what I should be doing lots of hehe.

Hooooooaaaaahhhhhhhhhhhhh !!! Now if I can get audio working in XVidCap and enough silence to do it with my crappy mic, this gonna be a nice start.

Sadly most of this is gonna have to wait until after dark…

fucking family already has given me a headache and it’s only 1617 local..

Rush Hour

Today we got cable hooked back up on the bed room sets. Caught Rush Hour on, so finally some thing good on but it was also about the only dang thing on TV !!! A few months without cable and I ain’t been missing much haha!

War, huh, yeah
What is it good for
Absolutely nothing
Uh-huh
War, huh, yeah
What is it good for
Absolutely nothing
Say it again, y’all

War, huh, good God
What is it good for
Absolutely nothing
Listen to me

Ohhh, war, I despise
Because it means destruction
Of innocent lives

War means tears
To thousands of mothers eyes
When their sons go to fight
And lose their lives

I said, war, huh
Good God, y’all
What is it good for
Absolutely nothing
Say it again

War, whoa, Lord
What is it good for
Absolutely nothing
Listen to me

War, it ain’t nothing
But a heartbreaker
War, friend only to the undertaker
Ooooh, war
It’s an enemy to all mankind
The point of war blows my mind
War has caused unrest
Within the younger generation
Induction then destruction
Who wants to die
Aaaaah, war-huh
Good God y’all
What is it good for
Absolutely nothing
Say it, say it, say it
War, huh
What is it good for
Absolutely nothing
Listen to me

War, huh, yeah
What is it good for
Absolutely nothing
Uh-huh
War, huh, yeah
What is it good for
Absolutely nothing
Say it again y’all
War, huh, good God
What is it good for
Absolutely nothing
Listen to me

War, it ain’t nothing but a heartbreaker
War, it’s got one friend
That’s the undertaker
Ooooh, war, has shattered
Many a young mans dreams
Made him disabled, bitter and mean
Life is much to short and precious
To spend fighting wars these days
War can’t give life
It can only take it away

Ooooh, war, huh
Good God y’all
What is it good for
Absolutely nothing
Say it again

War, whoa, Lord
What is it good for
Absolutely nothing
Listen to me

War, it ain’t nothing but a heartbreaker
War, friend only to the undertaker
Peace, love and understanding
Tell me, is there no place for them today
They say we must fight to keep our freedom
But Lord knows there’s got to be a better way

Ooooooh, war, huh
Good God y’all
What is it good for
You tell me
Say it, say it, say it, say it

War, huh
Good God y’all
What is it good for
Stand up and shout it
Nothing

— Edwin Starr, War

Test 1, Phase 0

booted my test machine

set up for video taping

svn’d a copy of npm source

edited source to prepare for test

began test.

Not 100% what I wanted but this is the first live test of install and deinstall operations.

Video Sample

I tested doing a portinstall of xgalaga, confirmed it ran, and then removed it. The pkg_delete operations output left a little bit to be desired! But hey, it did work…

I want to prep a script and get the code ready for a small battery of live tests under real world conditions. Once the code is suitably able to pass an acceptible amount of the tests… Alpha release.

Before I video the next one through I want to have a properly written out and planned script to follow for the video. I also really would like to try and get my Mic working (not tested yet) so I could use voice over and some background music wouldn’t hurt if it didn’t add more then a few megabytes to the out file.

Currently tests will take the first priority and continuing feature implementation will take secondary until the Alpha release is ready op.

I want to triple check but I think I’ll be able to host the video on the website for download and I can probably upload it to YouTube. Using rapidshare for this one was just to make it available (temporarily). The final one made for the alpha release will be much better.

My main concern though is getting NPM ready hehe.