13,821 reputation
13358
bio website
location
age
visits member for 4 years, 4 months
seen 1 hour ago

1d
comment I have a Computer Science degree but I don't feel like I know how to program
Related: I'm graduating with a Computer Science degree but I don't feel like I know how to program
2d
comment Should I modify an algorithm I coded for my employer if I remember the code perfectly and want to reuse?
Deliberately introduce changes that improve code clarity. I'm only half-joking. Virtually everything can be made clearer and doing so puts you in a win/win situation.
Mar
26
comment Where can I find an easy summary of best Python programming practises?
From the "backstory", it seems your team mates need more than a poster can provide.
Mar
20
comment How come the computer doesn't have to read the entire table when the column is indexed?
@gnat That is a rather different breed of index, for (sub)text search, while this is an ordinary data base index on the exact value of some column. The concept is related, but the algorithms and data structures are very different.
Mar
17
comment When is it a good idea to force garbage collection?
@Doval I was also including soft real time, video games are the real time systems I know most about. On a graphic-intense game, the heap will be in the gigabytes and a GC of any significant chunk of that may cause noticeable stutter. Doesn't cost lives or anything, but it's a pretty major defect for a game.
Mar
17
comment When is it a good idea to force garbage collection?
@Doval If you're under a real time constraint and the GC doesn't provide matching guarantees, you're between a rock and a hard place. It might reduce undesired pauses vs. doing nothing, but from what I've heard it's "easier" to avoid allocating in the normal course of operation.
Mar
17
comment Why did programming languages start using = for assignment?
@RobertHarvey We're talking about mathematical writing, not C programming. COME FROM: I concede that it's not as clear cut as I put it before, but since mathematical prose is based on conventions and there is no specification that can be lawyer'd to permit "let 4 = x", no, said statement is not just as valid as "let x = 4". At the very least, it confuses readers and hence fails the primary purpose of the prose.
Mar
17
comment Why did programming languages start using = for assignment?
@COMEFROM "Let 4 = x" is about as unnatural as the INTERCAL statement from which you take your user name. When "x" has never been mentioned before, "Let x = {something}" or "Let x be a {widget}" introduces a variable in addition to specifying its value and this puts the variable first by convention. That's precisely because, at least in terms of intuition, this is a different thing from just stating "the value equals ...".
Mar
17
comment Is this a race condition?
You're both wrong. Has neither of you ever heard of transactions?
Mar
16
comment Do enums create brittle interfaces?
Adding a new enum variant breaks code using that enum. Adding a new operation to an enum is quite self-contained on the other hand, as all cases that need to be handled are right there (contrast this with interfaces and superclasses, where adding a non-default method is a serious breaking change). It depends on the kind of changes that are really necessary.
Mar
16
comment Security scheme that prevents duplicate message attacks
@Dusan Don't overestimate big companies. Anyway, if it's not your protocol, how can you modify it to prevent replay attacks? (Plus, if it doesn't already, that further decreases my confidence in its quality.)
Mar
16
comment Security scheme that prevents duplicate message attacks
Let's give OP the benefit of the doubt and parse "more stateless" as "needing far less state". There are certainly defenses against replay attacks that only need a tiny number of bits per connection (e.g. TLS apparently includes a MAC built from a sequence number among other things). The real question is why you're implementing custom crypto. What is the nature of this communication and why can't you use a ready-made, peer-reviewed protocol for it?
Mar
15
comment Using $timeout to normalize response time of a webservice call (Best practice question)
You have an XY problem. You should be asking how to make the loading screen look better (not flicker).
Mar
15
comment Using $timeout to normalize response time of a webservice call (Best practice question)
Why would you ever want to increase latency? Decreasing spikes by speeding up the things that take long, sure, but deliberately wasting time and resources to make things take longer for those you could serve more quickly? That's not even fair scheduling, if anything waiting some more makes the slow calls even (marginally) slower.
Mar
13
comment Is serialization strategy part of an abi?
@DavidCowden Which part specifically do you want a reference for? That inputs and output files can be part of an API? That serialization formats are usually documented? That they are expected to remain compatible? Anything else?
Mar
13
comment Is serialization strategy part of an abi?
@h.j.k. Those libraries document their formats, yes, but applications that either use those or roll their own custom format (binary or more often JSON/XML/etc.) frequently don't.
Mar
12
comment Why isn't the addremove recommended by default in Mercurial?
@ShashankSawant Tough place to be in. You should certainly throw out files that have no reason to be tracked so the future looks brighter, but the history would still be a mess. If you care about repo size and a clean history, you could create a new repository and replay a cleaned-up version of history (same commits at the same date/time, omitting pointless files), but automating this is beyond my expertise and doing it manually is probably too much work and too error-prone. Maybe ask a new question?
Mar
7
comment Interview Question - Adding Method to interface that has been implemented by thousands of class
What? Why? A class with a thousand subclasses is much more questionable. Some interfaces, like Iterable, Comparable, Collection, or Runnable are simply very general and apply to a lot of otherwise unrelated classes.
Mar
4
comment Origin of naming generic types as T?
I think the convention is also strong in some lineages that couldn't have been influenced by Pascal/Delphi/C#, such as and C++ and Java.
Mar
3
comment Is a 'least significant bit' used anywhere practically today?
As far as I know, "least significant bit" is merely a name for the bit in a word with the smallest positional value. I am not aware of any "format" or encoding that goes by that name. Are you perhaps confusing this with the terms big endian and little endian?