Narue 5,707 Bad Cop Team Colleague

>I know one could increase the size of the array, but that's not challenging
Not challenging, but certainly informative when comparing methods. Because quicksort's speed isn't noticeable until the array gets very large, you won't see much difference between sorting methods no matter what kind resolution your timer is. It's best to use an array size that would be realistic for your application and span the timing across multiple calls so that you can get an average time distribution for the algorithm.

And if you're using my quicksort for 1000 items or less, that's what we in the field call "overkill". Try shellsort instead. :D

Narue 5,707 Bad Cop Team Colleague

I would be more worried about creating a button in the first place. No detail == no answer.

Narue 5,707 Bad Cop Team Colleague

>I can't get anything to work on the hybrid version. Can anyone help, provide tips or pointers?
Oddly enough, I posted the full implementation for an optimized quicksort in the code snippets on this site. One of the optimizations is terminating recursion on small subfiles and then calling insertion sort on the "almost" sorted file. An alternative is to use insertion sort during recursion, but that typically has less desirable properties than waiting until after the recursive steps. Because you're testing performance, it couldn't hurt to implement both and see what you get. :)

I also give examples of two other improvements to the basic algorithm, one common and the other not so common because it's rather difficult and not well known.

>to recurse to the point where insertion sort is more optimal than quicksort
This really needs to be tweaked by the implementor, but a cutoff somewhere between 5 and 25 will work nicely in general and that's where you usually find yourself setting it.

Narue 5,707 Bad Cop Team Colleague

>I posted a Calculator (Windows GUI) in the C snippets
Well, my first reaction wasn't "Eew", but there are some interesting constructs (and one that isn't valid C, so I would say it's either C++ or an Lcc extension). All in all, not too bad for a Win32 program. I'd like to see something that doesn't take advantage of the Win32 API so that I can see the quality of pure C that the translator comes up with.

Narue 5,707 Bad Cop Team Colleague

>Well some folks are helpful, others like to complain.
I'm helpful enough to justify a goodly amount of bitching. :)

>BCX is not an interpreter.
My appologies, it's your favorite "translator". But my arguments still stand. Any "translator" will most likely not spit out code worth learning from. But if you want to post the C or C++ code that BCX gives you I'd be happy to review it and insert foot in mouth if it's good.

Narue 5,707 Bad Cop Team Colleague

>Which language would be the best intial language to learn to get the most education as a programmer.
Python is a good start, so is Java.

>BCX is the way to learn it!
Funny, in all my years of programming with C++, this is the first time I've heard about BCX being the best way to learn the language. :rolleyes:

>BCX is written in BCX, just to show you the power!
Are they paying you to advertise for them or something? You have three posts so far and all of them plug BCX. I find it rather irritating that the only answer you have for every question is to use some basic interpreter that you like.

Narue 5,707 Bad Cop Team Colleague

>i guess but couldn't you just take like ten compilers and put em into one program.
Yes, but you would have the same problem if this were some kind of smart supercompiler. The problem is figuring out which language is being used and then calling the proper internal program. The only way that this could be done without serious coding effort on the part of the compiler writer would be to use a compilation switch:

$ sc -lang=C src.c
Compiling C code...

$ sc -lang=Pascal src.pas
Compiling Pascal code

$ sc -lang-Fortran90 src.f90
Compiling Fortran90 code

And so on. Anything else would introduce some form of common comment that specifies which compiler to call or requires the lexical analyzer to figure out from context what kind of language is being used. The former kills portability to other compilers and the latter would be a nightmare. The switch option is a good one, though the effort expended in developing this supercompiler wouldn't be worth the convenience gained by using a switch instead of a different compiler.

Narue 5,707 Bad Cop Team Colleague

>It would just be cool if there was some super compiler.
Yes, it would. But the lexical analyzer would be a bitch to write.

Narue 5,707 Bad Cop Team Colleague

>what is the best compiler
What's the best pizza topping? Try again.

>what is the best compiler out there that you can use for a variety of languages. Like is their a compiler that can compile c++, the basics, java, etc.
Better. No such compiler exists. The closest you will get is a C++ compiler that can also handle C. Try again.

>I am just looking for a good compiler that is free and if possible can compile more than one prog. lang.
Now I know what you're looking for. Here is your best bet.

Narue 5,707 Bad Cop Team Colleague

>Is it possible to open notepad and type some gibberish and save it as a .exe file and run it?
If you want to work out the machine code for your system that would be equivalent for a properly assembled executable, then figure out what combination of keyboard characters will give you that machine code...I suppose it might be possible to do this if Notepad doesn't add anything in the process of saving the file as an executable.