How you know it's late at night:
- you're reading the glibc manual and you think you see an entry on strfry
- you test it out and find it exists
- you post it here
How you know it's late at night:
- you're reading the glibc manual and you think you see an entry on strfry
- you test it out and find it exists
- you post it here
OK, what kind of drugs were they on when they created strfry()?
That has to be one of the most useless functions I've ever seen.
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
I love the GNU "easter egg" error messages.
— Macro: int ED
The experienced user will know what is wrong.
— Macro: int EGREGIOUS
You did what?
— Macro: int EIEIO
Go home and have a glass of warm, dairy-fresh milk.
— Macro: int EGRATUITOUS
This error code has no purpose.
Consider this post signed
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Useless crap like this has no business being in professional software like gcc.
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010
Out of humor on a Sunday night? It's going to be a long week.
And I don't think we can blame gcc for what people do with it.
If by "professional" you mean completely joyless and devoid of humour, and with all possible humanity bleached out, well -- have fun at work today, you really shouldn't be using this unprofessional crap. I am sure there are plenty of sterile, labotomized alternatives around to choose from.
RMS has acknowledged a fondness for puns, nb.
Last edited by MK27; 04-12-2010 at 05:06 AM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Ahhh, come on cpjust. Humour is fairly important in life... And, really, strfry might even be useful for those too lazy to actually code their own shuffle algorithm. And memfrob... Well, okay, that IS completely useless.
I think, however, that all hello world tutorials should be changed into this:
It may print hello world every once in a very long while.Code:#define _GNU_SOURCE #include <stdio.h> #include <string.h> int main() { char hello[] = "Hdellloorw!, "; strfry(hello); printf("%s\n", hello); }
hmm... since strfry() relies on rand(), if it does not use srand(), then we could figure out a particular seed for a particular implementation of strfry() that causes that hello world tutorial to print "Hello, world!" and then augment that example program with this suitable srand() call.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Pretty sure it uses srand(time(NULL)) since if you run EVOex's code twice in rapid succession you get the same result, otherwise it varies.
So all you need to do is figure out the next second that will produce "Hello, world!" on your RNG. We could announce them like eclipses:
Next concurrance of the EVOex theorem on May 3rd at 5:25:26 AM GMT! (Intel P4 only)
That is, if cpjust does not report anyone for wasting time with this silliness. Then we get sent to the forth circle of hell, which is partially reserved for people exhibiting unprofessional behavior, and/or joking around.
Last edited by MK27; 04-12-2010 at 06:02 AM.
C programming resources:
GNU C Function and Macro Index -- glibc reference manual
The C Book -- nice online learner guide
Current ISO draft standard
CCAN -- new CPAN like open source library repository
3 (different) GNU debugger tutorials: #1 -- #2 -- #3
cpwiki -- our wiki on sourceforge
Hmmm it uses its own random number generator:
http://www.google.com/codesearch/p?h...fry.c&q=strfry
It seeds with the time XOR'ed with the PID...
But I can build something for this... Let me see...
LOL @ MK27
Last edited by EVOEx; 04-12-2010 at 07:51 AM.
1. It doesn't matter how it started, gcc IS professional software. Almost everyone on UNIX uses it these days.
2. There are plenty of other sources of humor out there.
3. Adding useless functions to gcc makes its code & executables a bit larger than they need to be as well as the man pages.
4. If I'm looking through a list of available functions to use, I don't feel like wasting my time running into crap like this and saying "hey, I wonder what this does?" Then waste time looking at the man page. I get paid to work, not waste time; so when I do waste time, I'd rather waste it doing something I like.
"I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008
"the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010