Search found 77 matches

by evildave
Fri Jun 01, 2007 6:28 am UTC
Forum: Coding
Topic: Code width
Replies: 65
Views: 15155

The enum keyword exists in C and works just fine.
by evildave
Wed May 30, 2007 5:42 pm UTC
Forum: Computer Science
Topic: Moore's law
Replies: 65
Views: 25825

Actually, the problem with ARM is that there are a million and one things with ARM chips in them, but relatively few of them are general purpose computers that happen to be at hand for casual development. The best place to find them is in a router that had Linux compiled into an EEPROM, and then you...
by evildave
Mon May 28, 2007 8:12 am UTC
Forum: Coding
Topic: [ Poll ] Infinite loops
Replies: 185
Views: 40696

On the inside of my wedding ring I'm going to get this engraved: while ( true ) together( Bryan & Emily ); Isn't that a bitwise and? Wouldn't (Bryan | Emily) more approximate a union? You might stick with a different language syntax that allowed growth (no parentheses and semico...
by evildave
Mon May 28, 2007 8:02 am UTC
Forum: Coding
Topic: [ Poll ] Infinite loops
Replies: 185
Views: 40696

Day 1... Programmer: "Name the art the tool will use by this convention... and the tool will display the UI for you and you can test it." Day 2... Artist: "The tool doesn't work!" Programmer: "That's not right. Name the art the tool will use by this convention... and the too...
by evildave
Mon May 28, 2007 7:10 am UTC
Forum: Computer Science
Topic: Moore's law
Replies: 65
Views: 25825

Not really. It's been my experience that C code often made faster code than ASM. The problem is, people of mediocre ability jump into the 'deep end' of ASM and can't make a decent algorithm work... so they brute-force it and barely get it to work at all, and then pretend it's an improvement because ...
by evildave
Sun May 27, 2007 6:09 pm UTC
Forum: Coding
Topic: [AutoHotkey] xkcd Extractor: all comics on one page
Replies: 13
Views: 5919

xkcd Browser?
xkcd Spider?
xkcd Bandwidth Hawg?
xkcd Server Stress Test?
by evildave
Sun May 27, 2007 6:07 pm UTC
Forum: Computer Science
Topic: Moore's law
Replies: 65
Views: 25825

"Only" read from and write to files? What do you think printf and scanf are for? Heck, that's what all the computers did before the GUI. People were damned happy to to have a CRT and a keyboard after paper tape and punched cards. Besides, I have written in C for many platforms that didn't ...
by evildave
Sun May 27, 2007 5:44 am UTC
Forum: Computer Science
Topic: Moore's law
Replies: 65
Views: 25825

No, you can do anything with straight C89. You can do anything with straight K&R C, too. You can do anything with ANY computer language that doesn't just plain SUCK. If only the nut-jobs infected with feature-itis would stop tinkering with C and go make up their own languages to fail, instead of...
by evildave
Sun May 27, 2007 4:59 am UTC
Forum: Coding
Topic: Database Thread
Replies: 14
Views: 4919

I just write records to a big file and keep an index on the side.

Works for me and my trivial needs in this department.
by evildave
Sat May 26, 2007 8:41 pm UTC
Forum: Computer Science
Topic: Moore's law
Replies: 65
Views: 25825

Only if they standardize it.
by evildave
Sat May 26, 2007 7:39 pm UTC
Forum: Computer Science
Topic: Moore's law
Replies: 65
Views: 25825

I think there's another corollary effect that comes into play for Moore's Law... (and somebody else has probably already said this and got it famously named after them). Though the hardware doubles in power every 18 months, the productivity of software remains constant. The bloat of new features and...
by evildave
Sat May 26, 2007 3:10 am UTC
Forum: Coding
Topic: A CASE for preprocessors.
Replies: 14
Views: 5390

It's also nice to see someone else who uses 'a pattern' as I do. The variation is nearly indistinguishable from the pattern I used. On the fatter one, I tend to define something right there locally as you do, and pass it in. Saves a '#undef' or ten, is all. It's hard not to get 'emotional' when ever...
by evildave
Sat May 26, 2007 2:27 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

Why bother with any of these parameters: void GetRolls( int* aDice, size_t cDice, int sides ); int TallyRolls( const int* aDice, size_t cDice ); int ShowRolls( const int* aDice, size_t cDice ); Just have global variables that the functions read and write to. I'm aware that you can avoid having to h...
by evildave
Fri May 25, 2007 6:45 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

You'll probably want this one, too. It will tell you more about the distribution of the values, so you can be sure the rolls are reasonably fair. /* * Show us how many times each side got picked * aDice: Array containing dice * cDice: Number of dice to place in array * sides: Count of sides */ void ...
by evildave
Fri May 25, 2007 5:58 am UTC
Forum: Coding
Topic: A CASE for preprocessors.
Replies: 14
Views: 5390

Actually I have coded a few things more or less exactly that way. I shamelessly copied the C++ object model... because I don't need to reinvent the wheel, and I can say "It's just C++ classes in C" when someone asks me, 'WTF?'. Putting the function pointers in the data struct (instead of t...
by evildave
Fri May 25, 2007 5:38 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

A proper C solution. The die-rolling things don't give a tinker's cuss about where the buffer came from and how it was allocated. Nothing makes an error except where you have complete control to deal with it. Contains a verbose and a non-verbose output mode. /* * Dice Roll-O-Matic */ #include <stdio...
by evildave
Fri May 25, 2007 3:03 am UTC
Forum: Coding
Topic: A CASE for preprocessors.
Replies: 14
Views: 5390

For virtual functions, true, sort-of, <nit>but you skipped over vtab</nit>. That's 'hidden for you' in the macros. Exact same hoop C++ needs to jump through for virtual functions. #define MyClass_Cycle(self) ((self)->vtab->Cycle(self)) #define MyClass_Event(self,event) ((self)->vtab->Event(self,even...
by evildave
Fri May 25, 2007 2:49 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

Except we're talking about C, not C++. No exceptions. And there ain't no point to running game rules in multiple threads. Every project I've seen that has done it has been a catastrophe, and every project that recovered from that abyss was because the threading was abandoned. There are just too many...
by evildave
Thu May 24, 2007 4:47 pm UTC
Forum: Coding
Topic: A CASE for preprocessors.
Replies: 14
Views: 5390

Actually, it's 'CPP' for 'C Preprocessor'. http://gcc.gnu.org/onlinedocs/cpp/ See? Some people don't even know that the C preprocessor exists... ;) If I meant 'C++', I would say 'C++', and probably add a few choice four-letter words. Not because C++ is 'hard', but because after 15 years or so of dea...
by evildave
Thu May 24, 2007 3:16 am UTC
Forum: Computer Science
Topic: Programmers: Math nerds or Artists?
Replies: 68
Views: 19326

I can summarize thusly: 1. Everyone appreciates good art. 2. Nobody understands good code. 3. Everyone is a critic. I generally agree with the cited articles about care & feeding of programmers. Realistically, most managers don't understand this, and would resist treating their creative employee...
by evildave
Thu May 24, 2007 1:12 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

Because the case against stuffing the error state into a global was that it was 'not thread safe'.
by evildave
Thu May 24, 2007 1:10 am UTC
Forum: Coding
Topic: A CASE for preprocessors.
Replies: 14
Views: 5390

In the case of the enum example, well, there's no code there to break in a debugger. In the case of the state machine example, all the significant code in the state machine is out in the open. The 'hidden' portions are utterly trivial. In the case of the 'all in one' definition example, it removes s...
by evildave
Wed May 23, 2007 11:31 pm UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

It's ALL about the entertainment. That's a core tenet. Secondly... a multithreaded 'simple dice rolling' program? You gots to be kiddin' me. If your dicey state (rand#, error, etc.) is in a struct with the error, then you'll have one error per set of dice kinds of things. If your dicey state is glob...
by evildave
Wed May 23, 2007 7:31 pm UTC
Forum: Coding
Topic: A CASE for preprocessors.
Replies: 14
Views: 5390

A CASE for preprocessors.

I'm a preprocessor junky. No doubt about it. Some people think it's my worse habit, but I shall evangelize, anyway. I use CPP a lot. I even use it in other languages, like ActionScript. It does very handy things for me. /* Working macros */ #define opEnum(e) e, #define opString(e) #e...
by evildave
Wed May 23, 2007 6:42 pm UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

I agree that there are many ways to skin a cat, but... There is no such thing as an 'optional' error. If you discover that this 'optional' error pointer is being initialized and passed into things on the stack EVERYWHERE, you might consider making it a (gasp!) 'global', or as part of the structured ...
by evildave
Wed May 23, 2007 7:53 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

"Null pointers are sometimes a valid thing to pass into a function. Calling assert when a pointer being null is a valid option is ... well, stupid. " Stupid? Any convention where it CAN be NULL is a crash waiting to happen. You WILL miss obscure cases when the code gets bigger. The code's ...
by evildave
Wed May 23, 2007 1:09 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

Many C runtime libraries have a 'hook' for memory allocation failures (especially C/C++ runtime libraries with '_set_new_handler' handlers). You may as well use that, if it's available. One place to hook covers EVERY possibly memory allocation failure and usually lets you try to free something up to...
by evildave
Wed May 23, 2007 12:51 am UTC
Forum: Coding
Topic: New C project i'm working on
Replies: 42
Views: 11327

Another small thing to keep in mind about rand(). A lot of implementations of rand() vary in a very big way. Under gcc/linux, it is pretty good, and srand isn't even necessary (there's a daemon spinning random numbers all the time). Under Microsoft's compiler, it's still a 16 bit value. In other wor...
by evildave
Sat May 19, 2007 8:37 am UTC
Forum: General
Topic: Do you feel territorial about computers?
Replies: 83
Views: 10813

Lots of people leave their wireless routers 'open', and that's using your computer equipment. I have to stick with the minority. I'm comfortable using anybody's computer, and could care less about my own, as nothing sensitive stays on it. It also helps that I know how to rapidly restore it back to i...
by evildave
Sat May 19, 2007 8:29 am UTC
Forum: Coding
Topic: Does anyone here compete on Topcoder?
Replies: 30
Views: 14931

Well, that would assume somebody's reading this topic who cares. I suppose if somebody were needy enough for validation and couldn't code something more useful than snippets on their own for some reason, it would be a confidence check, like 'Yep, I can still get a boner and stain the curtains from h...
by evildave
Sat May 19, 2007 8:12 am UTC
Forum: Coding
Topic: Best general purpose programming language (expanded)?
Replies: 79
Views: 20206

C. To be precise, C89 (AKA 'Ansi C', the thing that replaced K&R C). And I don't know what got into Microsoft's tiny little heads to redefine the whole original C runtime library to need a leading underscore in the later incarnations of their C compilers and then blame it on "POSIX". J...
by evildave
Fri May 18, 2007 8:45 am UTC
Forum: Coding
Topic: Does anyone here compete on Topcoder?
Replies: 30
Views: 14931

Yes, I've read that comic. I rather liked the conspiracy one about 'snopes' better. "a) TopCoder uses the competition which it states clearly is for writing code for clients to actually get the code for its clients" Physics is for everyone, but always keep in mind that it's all models of r...
by evildave
Thu May 17, 2007 7:14 am UTC
Forum: General
Topic: Technological Naivety
Replies: 159
Views: 22136

Oh, yes. 32MB, even 16MB DIMMs. http://www.google.com/products?q=64MB+DIMMS&btnG=Search+Products There are still those older motherboards out there to be upgraded. After all, it's almost worth the $35 if you can get that Win95 machine to keep going another couple of years. Not everybody is on th...
by evildave
Thu May 17, 2007 12:39 am UTC
Forum: General
Topic: The banana or peanut butter; which is a better atheist nmare
Replies: 59
Views: 7645

The banana, like the horse and dog, is the product of generations of selective breeding. That big, tasty, yellow peeled thing with white flesh is nothing at all like the stunted, unappetizing and unmarketable natural plants it came from, any more than a toy poodle is like a wolf. The banana is in fa...
by evildave
Thu May 17, 2007 12:17 am UTC
Forum: Coding
Topic: Does anyone here compete on Topcoder?
Replies: 30
Views: 14931

There are all kinds of interesting, but academic-looking problems that satisfy a real-world need. There is code in virtually any application that (outside of the context of the application it was written for) will seem 'utterly useless'. Naturally, such a contest would contain a lot of 'filler' prob...
by evildave
Tue May 15, 2007 5:57 pm UTC
Forum: General
Topic: Airbags, are they worth it?
Replies: 16
Views: 3224

Airbags make newer cars thousands of dollars more expensive, so more unsafe rolling wrecks remain on the road longer with worn safety-critical parts ready to fail. Most airbags contain an extremely toxic chemical called 'Sodium Azide', that's as bad as cyanide, and if it gets into a river water it w...
by evildave
Tue May 15, 2007 8:48 am UTC
Forum: General
Topic: Myers-Briggs Psychological Testing
Replies: 270
Views: 109591

I seem to recall it was 'INTJ' the previous two times somebody got me to take it, so I have no particular reason to take it again. Seems lots of people are 'INTJ' or 'INTP' here. I guess that could say something. Or not. I think bulletin boards/forums may represent the 'mindless, repetitive tasks' t...
by evildave
Tue May 15, 2007 8:31 am UTC
Forum: Coding
Topic: Does anyone here compete on Topcoder?
Replies: 30
Views: 14931

Actually, the case is... C) Ken dolls are not anatomically correct. Which has all the significance to me as A or B. If I went on 'Wheel of Fortune', I'd personally hit "Bankrupt" with every spin, but that's just me. I'd still be a 'winner' though with that $1000 consolation prize. Yay. As ...
by evildave
Mon May 14, 2007 6:50 am UTC
Forum: General
Topic: Rant-rant-rant-rant-rant!
Replies: 13
Views: 2356

Well, as a for-instance, the signals around Northern Orlando, FL and Bellevue, WA are particularly bad. If you always mindlessly drive at full speed right up to red lights and slam on your brakes like every other driver, you never notice how bad the lights are. Try modulating your speed so you never...
by evildave
Sun May 13, 2007 6:23 pm UTC
Forum: General
Topic: Rant-rant-rant-rant-rant!
Replies: 13
Views: 2356

Aha!

So I gotta talk like a Kiwi... :)

Go to advanced search