Photo Op

PC-BSD 1.3/FreeBSD 6.1-Release and KDE 3.5.5. The system monitor is Gkrellm2, the console saver is cmatrix and the menu bar has a shredder and network browser applet installed.

Linux or BSD?

Some how it figures, I always have more issues setting up a Linux system then a BSD one… Go figure

Linux supports newer hardware faster

but BSD tends to just detect it.

Heck, if the box in question had a Floppy disk I think I’d install OpenBSD on the thing and go /w the X11 option. But if it won’t dual boot FreeBSD and PC-BSD without hicups I doubt OpenBSD and PC-BSD would be any better….

Bloody hardware !!!

And thinking about early Linux systems, the term ‘Linux/GNU’ probably is more accurate then Linux or GNU/Linux =/

Link fest

http://www.cs.wwc.edu/~aabyan/464/Book/index.html

http://tldp.org/HOWTO/GCC-Frontend-HOWTO-7.html

http://www.linuxjournal.com/article/7884

I’m going out of my fucking mind.

During the day its impossimble to do _any_ thing that requires concintration.

At night I can only work till my mind shuts down due to lack of sleep.

AND THEY DARE COMPLANE ABOUT MY HOME WORK !????????????

Gee

Ether I throw all of you the fuck out of the house for a few hours.

Or life stays as is and I live with torture.

….

Ready to burst here…

While I’m to tired to understand why this writes past the end of the array

#include <assert.h>
#define bounds(_i, _n) (assert( (unsigned) (_i) < (_n) ), (_i) )
....

/*
* fout is what we are appending to and should be open rw as necessary.
* farray is an array of file pointers, "farsize" is the size of the array.
*/
void
concatenate( FILE *fout, FILE *farray[], const unsigned char *farsize) {

int c;
unsigned int fi = 1;
FILE *fin; /* current segment of farray[] to fout. */

while ( (fi < farsize[0])) {
fin = farray[bounds(fi, *farsize)];
fi++;
while ( (c = fgetc(fin )) != EOF ) {
fputc( c, fout );
}
}
}

I’m GOING TO BED. 0832 Zulu time on my clock…. must sleeep sleep….

what is that again?

Jingle All the Way

Got to enjoy a few good movies tonight. The end of ‘The Man’, ‘Jingle All the Way’ – I love a few parts of that movie. Especially the one where he gets in a brawl with the Rain Deer & they go drinking lol.

Ep IV is on, the New Hope is one of my favorite Star Wars movies. And after that is Mr & Mrs Smith. Now thats a sweet flick. And the gun battle at the ends not half bad hehehe.

Well since Windows lacks fgetln() but as far as I can tell the BSD and GNU C Libraries have it.

/* The origenal, basically the same as one of the functions in FreeBSDs head(1) implementation.

static void
read_top( FILE *fp, int lncnt ) {

char *cp;
size_t error, rlen;
while ( lncnt && (cp = fgetln( fp, &rlen )) != NULL ) {
error = fwrite( cp, sizeof(char), rlen, stdout );
if ( error != rlen )
err( 1, "stdout" );
lncnt--;
}
}

/* A new version of read_top that *should* be a bit more standard compilent and simple to read */

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++;
}
}
}

The biggest problem with rf.c is the use of err()/errx(), a nice pair of Macros that expand to a fairly compatible meaning would be nice for portability. *cough* Windows *cough* and I don’t even want to know how groff works on WIN32 if at all….

10 Thou shalt foreswear, renounce, and abjure the vile heresy which claimeth that “All the world’s a VAX”, and have no commerce with the benighted heathens who cling to this barbarous belief, that the days of thy program may be long even though the days of thy current machine be short.
This particular heresy bids fair to be replaced by “All the world’s a Sun” or “All the world’s a 386” (this latter being a particularly revolting invention of Satan), but the words apply to all such without limitation. Beware, in particular, of the subtle and terrible “All the world’s a 32-bit machine”, which is almost true today but shall cease to be so before thy resume grows too much longer.

Ten Commandments of C Programming

This some times reminds me of how I feel about assumtions. Uusally met with me thinking.

“I’m not running Windows, !@#$ you”

“I’m not running Linux, !@#$ you”

“I’m not using MS-DOS, !@#$ off!”

“I’m not working in Visual BASIC or Visual C++, really un-!@#$ you”

“What if I’m not on a 32-Bit system, oh go !@#$ your self”

lol.

Reading

Some good links

http://www-128.ibm.com/developerworks/power/library/pa-ctypes1/index.html

http://www-128.ibm.com/developerworks/power/library/pa-ctypes2/index.html

http://www-128.ibm.com/developerworks/power/library/pa-ctypes3/index.html

http://www-128.ibm.com/developerworks/power/library/pa-ctypes4/index.html

Maybe I’m werid but it is interesting stuff ^_^

1 Thing I’d love to see. Is a simple yet powerful language like Perl/Python/Ruby thats got a C/C++ style compiler like GCC. Like being able to run the C pre-processor on the files before compilation and being able to link the object files together into an executable.

But also, a simple interpreter that implements the standard library and can run single file ‘scripts’ like a Bourne Shell. Yet with the options of being able to ‘link’ to pre-compiled libraries of code to extend itself in order to run the script. That way, people could use the interpreter for use interactive (like irb / python) yet run scripts and not have to have a development environment (compiler and friends) and any precompiled libraries could be distributed with the script.

Like

import math_module
import sockets_module

Compile the app and link it to a math and socket library. Or i f we’re using the interpreter.

foo -l lib1, lib2

or even in the script

#!/usr/bin/foo -L /usr/lib/foo/

Would be kinda cool.

The power, flexibility, and speed of a compiler yet the simplicity of an interpretor. But with keeping the ability to also use various libraries of code with the scripts. One could probably do some preprocessor work to include the library code in the script before using it too and save disk space.

Wouldn’t it be awesome if one could work on a Project in Python instead of C++ and keep a compiled executable. Yet when ya need a little script for some ‘loose ends’ to just go ahead and write a script to do it in the same language as the project ? Hehehehe.

I think D has the ability of doing a script, like #!/path/compiler -run at the top of the file. No clue if its a dual-purpose compiler/interpretor or if it just compiles an executable in temp space and runs it or what.