864 reputation
29
bio website
location Romania
age 31
visits member for 2 years, 7 months
seen May 9 at 12:16

AI enthusiast


Sep
24
awarded  Autobiographer
May
3
awarded  Yearling
Sep
17
awarded  Revival
May
3
awarded  Yearling
Jun
17
comment Sorting Algorithm : output
@Aaditya: I... really don't see how. You need to calculate Si and Pi, and do that sum, but I think that's the point of the problem. Do you want us to solve your problem?
Jun
17
revised Sorting Algorithm : output
just making it more obvious
Jun
17
answered Sorting Algorithm : output
Jun
16
comment How to store multiple requirements with OR and AND?
+1 for ASTs. Also, take a look at FOPL (en.wikipedia.org/wiki/First-order_logic) and implementations thereof, because it looks like you also need quantifiers.
Jun
16
answered Where does Microsoft currently stand on dynamic languages?
Jun
14
awarded  Nice Answer
Jun
13
comment Should I add an “Abstract” prefix to my abstract classes?
+1 for "Base" and "Impl" suffixes. They make a structural point (an abstract class will be the base for something).
Jun
13
comment Is there a point to writing in C or C++ instead of C# without knowing specifically what would make a program faster?
I see. Well, that's the problem when you have both deterministic (D) and non-deterministic/garbage collected (ND) disposal, you have to flag one of them somehow - but that doesn't mean that it's not scope-bound resource management (or RAII). C# has implicit ND, explicit (with using) D disposal, C++/CLI has implicit D (for the unmanaged stuff, they're having problems with RAII and IDisposable), explicit (^ types) ND, vanilla C++ has implicit D disposal, and a big empty void where ND should be. It's a question of taste, and my taste says give me GC/ND for "manual" RAII any time.
Jun
13
comment Is there a point to writing in C or C++ instead of C# without knowing specifically what would make a program faster?
Please clarify why the "using" block is not RAII, and/or what you mean by "it does not have the built in fail-safe of popping off the stack" - you left me in the dark here. Note that "using" will guarantee deterministic disposal if the block is exited normally, or with an exception.
Jun
13
answered Is there a point to writing in C or C++ instead of C# without knowing specifically what would make a program faster?
Jun
13
comment Should functions of a C library always expect a string's length?
@Charles E. Grant: See comment above about StringCbCat and StringCbCatN in Strsafe.h. If you just have a char* and no length, then indeed you have no real choice but to use the str* functions, but the point is to carry-the-length-around, thus it becomes an option between str* and strn* functions of which the latter are preferred.
Jun
12
revised Should functions of a C library always expect a string's length?
added a few examples from everyone's childhood.
Jun
12
comment Should functions of a C library always expect a string's length?
Yes. Strings are immutable on both the JVM/Dalvik and the .NET CLR at the platform level, as well as in many other languages. I would go so far and speculate that native world can't quite do this yet (the C++11 standard) because of a) legacy (you don't really gain that much by having just part of your strings immutable) and b) you really need a GC and a string table to make this work, the scoped allocators in C++11 can't quite cut it.
Jun
12
comment Should functions of a C library always expect a string's length?
True, but the point is they still carry the length around - the function guarantees that it will not overrun if the input is not NULL-terminated. They need to manage a lot of old LPSTRs flying around somehow - that's why they also guarantee (unlike the buffer manipulation functions) that they NULL-terminate your output string, even if the output is in danger of overflowing.
Jun
12
awarded  Commentator
Jun
12
comment Should functions of a C library always expect a string's length?
Again, good point, but StringCbCat is there for legacy, StringCbCatN is the real thing, just like strncat is preferred over strcat (if they would give you just StringCbCatN and all you have is a LPSTR coming from some legacy code, you would have to call it along with a strlen-like function, which is unnecessary, because it doesn't save you any pain at all if you do have the conditions for an overflow). Always carry your string length (or at the very least the length of the allocated buffer holding the string) around.