11,926 reputation
22247
bio website
location
age
visits member for 3 years, 1 month
seen 5 hours ago

8h
comment How to prepare a non-programmer for product manager position?
a manager doesn't need to know how to do what he is managing, her job is to make sure tasks get distributed and follow up when they don't get finished non of that requires knowing how to program
9h
comment Implementing a priority queue with a circular array
honestly for small N implementation details trump the big O, only way to know is to profile
Jul
8
comment A vector of pointers to different derived classes of the same base class
@Mathsnoob make the functions virtual in the IEnemy base class
Jul
8
comment Why isn't there a next operation on enums?
for exactly the reason you stated, if the programmer wanted a next then he should have provided one
Jul
7
comment How can I perform a logical test to ensure that MY CUSTOM ERROR gets thrown instead of the NumberFormatException?
@Wescrock sorry I expect that all exception classes end in Exception so force of habit after writing throw new
Jul
7
comment How can I perform a logical test to ensure that MY CUSTOM ERROR gets thrown instead of the NumberFormatException?
@Wescrock the error is from trying to convert a String to a double, but it happens before setHourlyPayRate is ever called. and most of the time that can be handled in the UI before even touching the ProductionWorker class
Jul
7
comment game unpublished due to copyright issue
cross posted on gamedev: gamedev.stackexchange.com/questions/79871/…
Jul
7
comment Locking database records
you can use an update with an extra where lock<now() clause to ensure no update happened to the lock field. Then you test how many rows were affected and select another record when it fails.
Jul
7
comment game unpublished due to copyright issue
replace with something else, just cause you found it on the internet doesn't mean it's free to use
Jul
7
comment game unpublished due to copyright issue
just remove the batman references, that is copyrighted material and the other apps are either licensed or no-one has reported them yet
Jul
4
comment Why isn't testing a language a supported feature at the syntax level?
@goldilocks assert is not meant to be for testing but debugging, there's a difference
Jul
4
comment How can I close my Open Source project and what is required from me in order to make it closed source?
you can release the same project under different licenses (for example a free personal use and a paid commercial) that inlcudes a open source licence and a closed source license
Jul
4
comment Is serialization better done in instance methods or static methods
his property implementation didn't change the object in any way, it just passed itself into a formatter and returned the resulting bytes
Jul
3
comment Is it a good idea to return a default value if a field in a query cannot be found?
it depends, sometimes a default is good and sometime a missing field is a serious error
Jul
3
comment What's wrong with this pointer?
"doesn't work at all" how?, also you need to initialize the pointer to point to a proper Bar struct
Jul
2
comment How do I stop characters sent to PuTTY screwing with its title/output?
actually that is the 2 chars in sequence, having just 1 will cause returning back to the start of current line or jump down a line as appropriate. modern text editors know how to handle the lone chars
Jul
2
comment How do I stop characters sent to PuTTY screwing with its title/output?
3 is because \r\n means carriage return (return to beginning of line) followed by newline (move a line down) probably the cause of 2 as well
Jul
2
comment What does “ (int) value & 0x1, (int) value & 0x2, (int) value & 0x4, (int) value & 0x8 means”
@Sjoerd that's why I said "powers of 2"
Jul
1
comment Linking a GPL executable from proprietary .bat script
could the bat work without the FART or can BURP (Big Ugly Replace Program) drop in just as well
Jun
30
comment Is it safe to rely on static analysis to “reproduce” concurrency bugs reliably?
something to add to 4: each resource protected by a lock must be documented that it is protected by the lock and must never be used away from where the lock is acquired