600 reputation
37
bio website heeris.id.au
location
age
visits member for 3 years, 11 months
seen yesterday

Oct
28
comment Does assigning NULL in a GC'ed Environment have similar effects to using free()?
Ah, I think I read it before the edit where you explicitly mentioned {}, so it didn't click. Yes, I think it'd be neater all round :)
Oct
28
comment Does assigning NULL in a GC'ed Environment have similar effects to using free()?
I don't know much C#, but why not just isolate any processing of the monster data in some other scope (most likely a function call)? If you can set it to NULL, that must mean you don't need it after that point; any intermediate variables could be returned from a function. That should sidestep the whole problem.
Aug
29
comment What is the logic behind the use of different arrows (-> <-) in Haskell?
I think the <- in comprehensions is meant to resemble (meaning "element of") not .
Aug
29
comment Why doesn't Python have a “flatten” function for lists?
@Izkata - that is a question about flattening a list of lists, not a list of arbitrarily nested lists.
Aug
24
comment Why doesn't Python have a “flatten” function for lists?
@Giorgio - I think the general argument against it is that it's a little bit magic. I mean, imagine if you introduce a bug into your code that inadvertently changes the structure of your data. flatten will still work, but produce completely the wrong results. Functions that expect a certain data structure (a) partially document your data structures, and (b) fail when they should. There's also the edge cases... How should it work on lists containing generators, which could be infinite? What about lists containing strings?
Aug
24
comment Why doesn't Python have a “flatten” function for lists?
flattening arrays is such a common thing to do — is it? Really? When?
Aug
23
comment Why does void in C mean not void?
@Axarydax The ability (and, for older Java versions, requirement) to cast I think is the issue here.
Aug
6
comment Where are C variables declared
"modern compilers have eliminated that requirement" ...if your code has to build under Visual Studio, "modern" only means "2013 or newer" :P
May
8
comment Writing in C for Performance?
@congusbongus Good to know; I haven't used 2013 yet.
May
7
comment Writing in C for Performance?
The newest MSVC supports is actually C89.
May
3
comment If null is bad, why do modern languages implement it?
@MartinJames "It ALWAYS generates an AV/segfault and so gets fixed" - no, no it doesn't.
Mar
7
awarded  Nice Answer
Feb
20
comment Scrum for Embedded system devices
What do you do if (a) adding SPI handling code is quite complex (ie. around as many points as you could handle in a sprint, maybe even more), and (b) there are several user stories that require SPI handling code?
Feb
3
comment Python - 'if foo in dict' vs 'try: dict[foo]'
@Stick - glad to hear it :) I like that advice, I've never heard it before.
Jan
27
comment Python - 'if foo in dict' vs 'try: dict[foo]'
@Stick - you do: data = myDict.get(a_key, default), and either do_work will do the right thing when given default (eg. None) or you do if data: do_work(data). Only one lookup needed in either case. (It might be if data is not None: ..., in either case, it's still only one lookup and then your own logic can take over.)
Jan
24
comment Python - 'if foo in dict' vs 'try: dict[foo]'
@whatsisname - I thought of adding that to my answer, but TBH if you have race hazards like that, you have much bigger problems that EAFP vs LBYL :P
Jan
23
revised Python - 'if foo in dict' vs 'try: dict[foo]'
added 151 characters in body
Jan
23
comment Python - 'if foo in dict' vs 'try: dict[foo]'
"From a pragmatic point of view, throwing/catching is much slower then checking if the key is in table" — no it isn't. Not necessarily, anyway. Last I checked, the most common Python implementations do the try/catch version faster.
Jan
23
answered Python - 'if foo in dict' vs 'try: dict[foo]'
Jan
9
comment What is meant by “Now you have two problems”?
Some people, when trying to explain something, think "I know, I'll use a Jamie Zawinski quote." Now they have two things to explain.