Search found 1649 matches

by avansc
Wed Apr 06, 2011 1:39 pm
Forum: Game Development
Topic: Are Game Developers 15 Years Behind?
Replies: 24
Views: 5807

Re: Are Game Developers 15 Years Behind?

Okay. Maybe I'm doing it wrong.

But I suggest you go read some articles, it's not like its just me chiming this idea.
by avansc
Tue Apr 05, 2011 10:55 pm
Forum: Game Development
Topic: Are Game Developers 15 Years Behind?
Replies: 24
Views: 5807

Re: Are Game Developers 15 Years Behind?

Unit testing is for the most part useless. Can't tell you how many times you change a bit of code only to make all your unit testes useless. If changing a tiny bit of your code makes all your tests break, you're doing it wrong. It means you have a huge amount of redundancy in your tests. Why are yo...
by avansc
Tue Apr 05, 2011 9:48 am
Forum: Game Development
Topic: Are Game Developers 15 Years Behind?
Replies: 24
Views: 5807

Re: Are Game Developers 15 Years Behind?

Unit testing is for the most part useless. Can't tell you how many times you change a bit of code only to make all your unit testes useless.
by avansc
Mon Apr 04, 2011 7:09 pm
Forum: Programming Discussion
Topic: C code to strip a file's extension from a filename
Replies: 13
Views: 1731

Re: C code to strip a file's extension from a filename

bnpph wrote: Anyway, it's all personal preference, so do whatever you like.
avansc wrote: Anyways, this is hardly important enough to worry about it, to each his own.
- paraphrased
by avansc
Mon Apr 04, 2011 4:04 pm
Forum: Programming Discussion
Topic: C code to strip a file's extension from a filename
Replies: 13
Views: 1731

Re: C code to strip a file's extension from a filename

stdup is not ISO C and I don't agree with it. All of string.h's functions are designed where they pass a destination pointer. They also require your destination is large enough to store the result. If you want to do what you're doing, it would make more sense to create a new type (FILENAME) as type...
by avansc
Sun Apr 03, 2011 9:50 pm
Forum: Programming Discussion
Topic: C code to strip a file's extension from a filename
Replies: 13
Views: 1731

Re: C code to strip a file's extension from a filename

char *stripExt(char* destination, const char *file) { int len = strchr(file,'.') - file; strncpy(destination, file, len); return destination; } (might have errors - didn't test) This is much better way. This function will work with any type of allocated memory, and is much less likely to have memor...
by avansc
Sun Apr 03, 2011 4:19 pm
Forum: Programming Discussion
Topic: C code to strip a file's extension from a filename
Replies: 13
Views: 1731

Re: C code to strip a file's extension from a filename

Don't put calloc in functions like that. Have it pass a pointer and store the created string into it. Also, the fastest method would be to just return the length of filename without extension, and then use that instead of returning a new string. You could replace it with null char if you want to. e...
by avansc
Sat Apr 02, 2011 7:48 pm
Forum: General/Off-Topic
Topic: Antivirus recommendations
Replies: 23
Views: 4709

Re: Antivirus recommendations

JaxDragon wrote:Microsoft security essentials 2011. Honestly, unless you go on shady websites a lot, its all you need.

I agree. Its very good.
by avansc
Sat Apr 02, 2011 7:25 pm
Forum: Programming Discussion
Topic: C code to strip a file's extension from a filename
Replies: 13
Views: 1731

Re: C code to strip the file's extension from the filename

Well just to chime in. you can go all silly and write it in all different ways. something like char *stripExt(const char *file) { int len = strchr(file,'.') - file; char *ret = (char*)calloc(sizeof(char), len+1); memcpy(ret, file, len); return ret; } 1000000 calls takes 88.194000 ms as apposed to lo...
by avansc
Sat Apr 02, 2011 4:06 pm
Forum: Programming Discussion
Topic: C code to strip a file's extension from a filename
Replies: 13
Views: 1731

Re: C code to strip the file's extension from the filename

not to steal your thunder, but I realized some optimization could be made, and came up with this: const char* getFileExtension(const char* filename) { const char* tmp=strchr(filename,'.'),*ret = NULL; while(tmp) { ret = tmp; tmp = strchr(tmp+1,'.'); } return ret?ret+1:NULL; } then if you wanted a s...
by avansc
Sat Apr 02, 2011 1:03 pm
Forum: Programming Discussion
Topic: Programming Languages
Replies: 2
Views: 867

Re: Programming Languages

Pity about Pascal/Delphi, procedural goodness.
by avansc
Fri Mar 25, 2011 9:04 am
Forum: General/Off-Topic
Topic: Virus - please read
Replies: 7
Views: 1827

Re: Virus - please read

Web wrote:Had to format dads computer, it wouldnt go past the loading screen, he couldnt get into windows.
Did you try safemode?
by avansc
Fri Mar 25, 2011 8:29 am
Forum: General/Off-Topic
Topic: Virus - please read
Replies: 7
Views: 1827

Re: Virus - please read

I actually fixed this 2 days ago on a clients machine. you need to start the taskmanager as soon as you log in, and kill any weird looking processes. the culprit in my case was something like 80292811211.exe search for that, delete is, look for it in the registry, should be under something like run ...
by avansc
Fri Mar 25, 2011 7:52 am
Forum: Current Events and Science/Technology
Topic: God's Wife Edited Out Of The Bible?
Replies: 11
Views: 2560

Re: God's Wife Edited Out Of The Bible?

Im no expert on the matter, but i thought lilith was jewish and mesopotamian mythology. And lets assume that she was Adams first wife, does this give more or less credence to some kind of god? On a side note, if you are interested in this kinda thing in a scientific context, there is a rather intere...
by avansc
Thu Mar 24, 2011 6:49 pm
Forum: Current Events and Science/Technology
Topic: God's Wife Edited Out Of The Bible?
Replies: 11
Views: 2560

Re: God's Wife Edited Out Of The Bible?

I really dont see how 2000+ year old garbage has anything to do with current events or science/technology, in all honesty, spam bots about golf have more relevant posts.