Jan
21
comment Is address 0000000C a special address?
@LorenPechtel: Which is exactly what his answer you're commenting on suggested in the first place. I just can't get over how much more often I see crashes with 0000000C compared to 00000008.
Jan
21
comment Is address 0000000C a special address?
I've also noticed that 0000000C is way more common than 00000008, but none of the answers seem to address that at all :/
Jan
20
comment Is address 0000000C a special address?
@ElderBug: en.wikipedia.org/wiki/Page_%28computer_memory%29#Huge_pages Pages are normally 4Kib, but can also be 4MiB or 2Mib on x86 and x64 respectively, or any of 8 KiB, 64 KiB, 256 KiB, 1 MiB, 4 MiB, 16 MiB, 256 MiB for Itanium. msdn.microsoft.com/en-us/library/windows/desktop/…
Jan
2
comment Is there a conventional way to combine file path strings?
@BartvanIngenSchenau: in windows, a path that starts with a slash is a relative path, and is relative to CWD. en.wikipedia.org/wiki/…
Jan
2
comment Is there a conventional way to combine file path strings?
en.wikipedia.org/wiki/… "the Windows system API accepts slash, and thus all the above Unix examples should work. But many applications on Windows interpret a slash for other purposes or treat it as an invalid character, and thus require you to enter backslash — notably the cmd.exe shell (often called the "terminal" as it typically runs in a terminal window)."
Jan
2
comment Is there a conventional way to combine file path strings?
C++ has Boost::Filesystem, and C# has System.IO.Path
Dec
23
comment Why is *declaration* of data and functions necessary in C language, when the definition is written at the end of the source code?
@user31782: The compiler must know the type of the variable in order to generate the correct assembly for the processor. When the compiler finds the implicit Func_i(), it immediately generates and saves code for the processor to jump to another location, then to receive some integer, and then continue. When the compiler later finds the Func_i definition, it makes sure the signatures match, and if they do, it places the assembly for Func_i() at that address, and tells it to return some integer. When you run the program, the processor then follows those instructions with the value 3.
Nov
24
comment Function guaranteed to never return the same value twice
I think the assumption that the code will only be used for less than five hundred years is a valid assumption. If you simply return increasing values in 64bit storage, you're fine for quite a while. At 1 call per us, in 584555 years.
Nov
8
comment Is it good practice to rely on headers being included transitively?
@Dunk I think you misunderstood the problem. With either of his suggestions that shouldn't happen.
Oct
10
comment How can IO cause side effects in Functional Programming?
If one distinguishes between reading the first character from stdin vs reading the next character from stdin, then it's no different from reading from an array or list, and is totally cachable.
Oct
10
comment How can IO cause side effects in Functional Programming?
What about input?
Aug
29
comment Are a class's methods stored only once in memory?
@delnan: I checked, in places where I thought I was duplicating methods, lua was smart enough to use references. I stand corrected. (hooray for sane languages!)
Aug
28
comment Are a class's methods stored only once in memory?
@delnan: Lua makes it easy to accidentally give each instance it's own copy of the type's methods.
Aug
28
comment Why don't compilers inline everything?
Do inline functions improve performance?
Aug
26
comment Multithreading: am I doing it wrong?
OP says API can only play one note at a time
Aug
23
comment Why does void in C mean not void?
Also note that Java and C# do have the same concept, they simply call it Object in one case to disambiguate.
Aug
11
comment How can a statically typed language support duck typing?
@Snowman: Iterator requires a lot more than that, namely operator*...
Jun
26
comment Why is the finalize method included in Java?
With #2 sounds like the native peer is a native resource that requires a safety net and should have a termination method, and thus shouldn't be a separate point.
Jun
11
comment Maintaining Two Separate Software Versions From the Same Codebase in Version Control
modern Windows is designed this way, all versions have all the same code, and have features unlocked depending on the license key in use.
May
28
awarded  Informed