Reputation
1,802
Top tag
Next privilege 2,000 Rep.
Edit questions and answers
Badges
1 18 25
Newest
 Yearling
Impact
~21k people reached

Apr
19
comment using pthread_cond_broadcast with no mutex or waiting thread?
Then your scenario makes no sense to me, and the answers there already say it's "ok" to broadcast outside a mutex.
Apr
19
comment using pthread_cond_broadcast with no mutex or waiting thread?
stackoverflow.com/questions/4544234/…
Apr
3
awarded  Yearling
Mar
17
comment Is python list comprehension using multi-threading or parallelized in any way by default?
stackoverflow.com/a/5245757/635608
Mar
7
comment How to understand JavaScript's “delete h[key]” and Python's “del h[key]”?
Think about it in terms of method calls, which C doesn't have, so it's not a really good model for languages that do have them. obj.p = 123 as obj.p.setValue(123) and delete obj.p as obj.p.delete(). The type of obj.p is probably some sort of "dictionary key", it's delete method will have the effect of removing itself from its container.
Mar
3
comment What method for storing a text file in memory (c not c++) would allow me to open any format(UTF-8, Binary, etc) and a file of any size?
@Joe: en.wikipedia.org/wiki/Memory_footprint // en.wikipedia.org/wiki/Fingerprint_(computing) - the terms are not interchangeable at all.
Feb
22
comment VMs are not created on the same physical server to balance load?
@AhmedWas: you're not going to get all the answers to all your questions on this huge, ill-defined, moving target that is "cloud" in one question here. Stick to one specific topic.
Feb
22
comment VMs are not created on the same physical server to balance load?
@AhmedWas: you started with a question about IaaS scaling only. Is your question still about IaaS only? If the answer is yes, you need to rephrase it. If not, you changed the scope.
Feb
22
comment VMs are not created on the same physical server to balance load?
@AhmedWas: don't change the scope of your question once it's been answered, that's not polite.
Feb
22
comment Make browser allow secure cookie over http
There's an alpha version of Fiddler for Linux & Mac (based on mono). You can also proxy through Fiddler running on a separate Windows host.
Jan
30
comment Querying Results from End of the table
Ordinary tables do not have an order. There is no "start" or "end", they're just bags of rows.
Jan
25
revised Should we avoid language features that C++ has but Java doesn't to increase maintainability?
Shorten title, capitalization, whitespace, typo fixes
Jan
25
suggested approved edit on Should we avoid language features that C++ has but Java doesn't to increase maintainability?
Jan
11
comment What is the significance of database host name while configuring database?
"does that mean this terminology is confusing?" - no it's not. Looks like an English issue more than anything else. The database host name is the name of the host that has the database. That's all, there's no magic or confusion. "localhost" is just a special name designating the current server.
Dec
27
revised If I need to use a piece of memory throughout the lifespan of my program, is it really necessary to free it right before program termination?
Add a missing verb, and some breathing space.
Dec
27
suggested approved edit on If I need to use a piece of memory throughout the lifespan of my program, is it really necessary to free it right before program termination?
Dec
26
comment Doesn't “always initialize variables” lead to important bugs being hidden?
@Abyx: that doesn't change anything. Either buffer contains valid data or it doesn't. What indicates whether it does or not is bytes_read. In the code you posted, if you don't initialize byes_read you have no way to know if it does or not. So your code is buggy. If you do initialize it, you do know, hence your bug is just calling use regardless.
Dec
26
comment Doesn't “always initialize variables” lead to important bugs being hidden?
@Abyx: even if it's a third party, if it doesn't deal with a buffer starting with \0 it is buggy. If it is documented not to deal with that, your calling code is buggy. If you fix your calling code to check for bytes_read==0 before calling use, then you're back to where you started: your code is buggy if you don't initialize bytes_read, safe if you do. (Usually functions are supposed to fill their out-parameters even in case of an error: not really. Quite often the outputs are either left alone or undefined.)
Dec
26
comment Doesn't “always initialize variables” lead to important bugs being hidden?
Your second bug isn't a bug in the code you posted but a bug in use if it reads more than the first byte of buffer. That bug is unrelated to bytes_read being initialized or not. Another unrelated potential bug is in your design, not passing in the validated length of buffer to use, limiting it to zero-terminated inputs.
Dec
21
comment Using a “strong” type system in the real world, say, for large-scale web-apps?
(Change the language hint in your post form <!-- language: lang-hs --> to <!-- language-all: lang-hs --> and you won't get the problem with the '[list] thingy.)