I wrote a few short programs to test simple file I/O using standard FILE pointers, and the C++ abstraction. Each program reads a large file from stdin, breaks it down into words, and writes it to a file.
#wc Database-HOWTO.txt
13313 63905 472980 Database-HOWTO.txt
So.. it's a pretty big file. Both programs were compiled under pgcc-2.91.66, with -O6 -mpentium and the binaries were stripped.
Here's the code: (hope this looks ok.. please excuse the complete lack of formatting.. html is a tricky medium with a limited subset of tags!)
That depends on the speed of your machine. It can be done in 15 minutes.
The trick is, do a minimal install on a small partition. That way you don't have to format the whole drive. Given a fast system (disks, cdrom, etc.. scsi might actually hurt you here because of how long it takes them to boot up the interface) it can be done.
QT2 is released. KDE2 uses it. KDE2 only looks more like GNOME because GNOME looks like GTK which uses gradient widgets and such if you want to. (such as in the kde2 screenshots.) Plus, KDE2 has C++ going for it.
pays for stuff like this?
With their new ActiveLearning(TM) program starting shortly, this will not be a problem!
X.F.C.
/me runs away
(The X Foundation Classes)
:)
This is one of the [many] things we learned not to do from the fine documentary Jurassic Park.
This is a known bug. It's called using the wav writer plugin instead of the OSS/ESD/ALSA plugin for playing files.
:)
You think I'm joking. Look in the xmms bug database.
I think their solution was "Don't use the wav-writer plugin as your output plugin."
Best of Luck!
Doesn't Sun make money mostly on selling their hardware?
I wrote a few short programs to test simple file I/O using standard FILE pointers, and the C++ abstraction. Each program reads a large file from stdin, breaks it down into words, and writes it to a file.
./words.pl
;-)
#wc Database-HOWTO.txt
13313 63905 472980 Database-HOWTO.txt
So.. it's a pretty big file. Both programs were compiled under pgcc-2.91.66, with -O6 -mpentium and the binaries were stripped.
Here's the code: (hope this looks ok.. please excuse the complete lack of formatting.. html is a tricky medium with a limited subset of tags!)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main( int argc, char *argv[] )
{
string szinput;
ofstream write;
write.open( "output_cpp.txt", ios::out );
while( cin >> szinput )
write
write.close();
return 0;
}
#include <stdio.h>
#include <string.h>
int main( int argc, char *argv[] )
{
FILE *write;
char buffer[4096];
char *ptr;
write = fopen( "output_c.txt", "w" );
while( fgets( buffer, 4096, stdin ))
{
ptr = strtok( buffer, "\n " );
while( ptr )
{
fputs( ptr, write );
fputs( "\n", write );
ptr = strtok( NULL, "\n " );
}
}
fclose( write );
return 0;
}
...the results...
Juggernaut:~/test/source> time words_c
0.080u 0.020s 0:00.11 90.9% 0+0k 0+0io 200pf+0w
Juggernaut:~/test/source> time words_cpp
0.370u 0.140s 0:00.50 102.0% 0+0k 0+0io 145pf+0w
Don't ask me how I got 102.0% cpu. I just cut and paste. It is an overclocked celeron, so that might have something to do with it.
Anyway.. C is obviously much faster at this. However.. the C++ code is much easier to understand.
Of course, the perl code for this is very simple, short and easy to understand:
open( OUTFILE, "> output_perl.txt" );
while( <> )
{
foreach $word( split )
{
print OUTFILE "$word\n";
}
}
Juggernaut:~/test/source> time
1.080u 0.020s 0:01.35 81.4% 0+0k 0+0io 402pf+0w
At a cost!
I have a /lib/libc.so.5.3.12 and a /lib/libc.so.6 and they're completely incompatabile?
What nonesense!
metric and english units!
;-)
Sorry, it had to be said!
Then you should be $1000 richer right now.
All you need are slackware boot/root disks. then mount the partition and reset the password to nothing.
That depends on the speed of your machine. It can be done in 15 minutes.
The trick is, do a minimal install on a small partition. That way you don't have to format the whole drive. Given a fast system (disks, cdrom, etc.. scsi might actually hurt you here because of how long it takes them to boot up the interface) it can be done.
Well, you have to do an awful lot in those five minutes to seriously break the system. (not including rm -rf / and the like..)
Sometimes when you think back to the silly things you did when you were first learning.. :)
My advice is to install it and play with it till you seriously break it. Then you have a pretty good idea of how it works.
the Symbol palm pilot has RF built in. (I don't think it's released yet)
I don't know if the Symbol Palm Pilot based on the palm III has it or not. I know it has a scanner (duh) built in.
Heh.. I got my 3c905B for $40.00.
Go e-bay!
;-)
QT2 is released.
KDE2 uses it.
KDE2 only looks more like GNOME because GNOME looks like GTK which uses gradient widgets and such if you want to. (such as in the kde2 screenshots.)
Plus, KDE2 has C++ going for it.