Reputation
3,529
Top tag
Next privilege 5,000 Rep.
Approve tag wiki edits
Badges
3 10 23
Newest
 Civic Duty
Impact
~109k people reached

Mar
11
comment Laissez faire memory management
Memory leaks in long running processes are mainly a problem is the leaks accumulate. Your examples might well be due to the runtime not bothering to run the GC because the program terminates before the GC triggers, whereas for a long running process the GC would eventually trigger.
Mar
11
comment Why have private fields, isn't protected enough?
Derived classes are part of the outer world.
Mar
10
comment Why can't the Synchronizer Token Pattern be circumvented?
@WannabeCoder The browser won't allow you to access the response to that cross-site request. (except under certain, hopefully harmless, circumstances)
Mar
10
comment Avoiding hangs when calling a native API
Create a second process that does the native interop. Talk to it via IPC. Shoot it, if it hangs.
Mar
10
comment Restricted randomization of a binary vector
Do you require that each possible output gets chosen with the same probability? Or are biases acceptable?
Mar
4
awarded  Civic Duty
Mar
4
comment Is returning a json object instead an array via REST good or bad style?
Both arrays and objects/dictionaries are fine. Choose the one that fits your data best.
Mar
4
revised Is returning a json object instead an array via REST good or bad style?
added 33 characters in body; edited title
Mar
3
comment What do we call “ip and port”?
You could call it an endpoint.
Mar
3
comment How do you use duck typing in javascript without always checking for properties and methods?
@RossPatterson The OPs problem is with dynamic typing, not with duck typing. TypeScript and Go are both duck typed, yet avoid the OP's problem. The problem with duck typing is a different one, namely that you can have members which pass the duck test but don't fulfill the contract you expect.
Mar
3
comment What happens when a software that is open source without any license is later licensed with gpl version 3?
How can it be open source if it has no license? if you have no license you are not even allowed to use or change it.
Mar
3
comment What are modern develop-deploy-test techniques for non-interpreted languages?
If you don't run your build server locally, uploading 100 MB from the build server to the web server shouldn't take more than a few seconds.
Mar
2
comment How to structure huge conditional statement?
@MichaelT I'd produce both the prefix and the regex programmatically from the original pattern (which might either be a regex or a simpler language). I'd use some kind of dictionary for the prefix and a flat list for the regex+action. In the first version I'd start with a simple linear search through a list, only adding the prefix dictionary as an optimization later on.
Mar
2
comment How to structure huge conditional statement?
Of course naive dictionary lookup wouldn't be compatible with place holders. I'd probably use a dictionary fixed prefixes and pattern matching/regexes to disambiguate if necessary.
Feb
29
comment How do ORMs order commands to prevent constraint violations?
If you use transactions you can tell the database to only check constraints when committing the transaction. (Called deferred foreign key constraints in SQLite. Not sure if that terminology is universal)
Feb
26
comment Is defining only one method against S in S.O.L.I.D
I don't see any commands in your example. You only have side-effect free functions, i.e. queries.
Feb
26
comment How to find the closest vector to a given vector?
If the dimension is low, you can partition the space, e.g. using some kind of quad-tree in the 2D case.
Feb
24
comment What is the meaning of changing state of the program?
A convention like that might make sense in a language without support for properties, where you could use size() as the getter of the size.
Feb
24
comment Converting our B2B application to SaaS need architecture advice
Another variant is using the second design, but creating filtered views for each client.
Feb
24
comment Converting our B2B application to SaaS need architecture advice
The first approach has another advantage: You can scale out to multiple servers without changing the design, as long as no tenant needs to be split across multiple servers.