"Depends on how you capture your variables. If you capture them by reference ([&]) and they go out of scope, the references will be invalid, just like normal references.": Why is this allowed in the first place then? — Giorgio16 mins ago
@jalf There is not a great deal of alternative. Returning passed objects back to a pool is one, though it's been argued that this is just a special case of multiple heaps :(
it's just describing the intended difference which is difficult, because virtually the only interface difference is in performance, which you can't exactly Standardise.
Dear Legnica I am William Togla,personal represantative to Late Mr.Jan Legnica, a national of your country, and the chief executive officer of Jan Construction Company here in Benin Republic West Africa.
Anyone here has coded a Bluetooth application? I need to know, do you self-create the UUID for a secure/inscure connection between two Bluetooth devices?
@R.MartinhoFernandes I think it's a little too shared_ptr specific- the same arguments, essentially, apply to any smart pointer, although slightly more to shared_ptr because of the nasty copy but free move.
@CatPlusPlus Emirically, the performance of my server improved by some 30% after I incorporated an array of object pools of varying sizes for buffering. The buffers were quite large, (4k, 8k, 16k.. up to 256k).
As I explain in my Stack Overflow post, when you want to share ownership, passing by value is better. It has the advantage of declaring that ownership is shared directly in the interface, and I think it has no significant disadvantages
@R.MartinhoFernandes Without thinking about this too much, ^ isn't there a (marginal) use case where you'd want to work with forward declared types. Nah, forget it. Brainfart. The contained type is a pointer anyway. Sry to bother
@DeadMG Oh and I don't think it's too formal. I think, however, that the introduction could be reduced (by a large factor). The guy knows who you are. I'd just say why you think it relevant to him, then invite him to read that answer.
If a bit verbose, I think the whole story is pretty clear. That is important. The gamble here is, will Scott take the time to read his mail? If he does, he'll not have to worry about interpreting fuzzy claims: it's all right there. Nice.
@Xeo I'd say it is wrong. I remember reading the specs of lambda as a set of transformations to a local type with certain operator() and stuff. Of course, compilers needn't actually do all that (as-if rule) but the semantics should be predictable with that model, no?
@Xeo precisely. And members would be less local than params, which leads to the expectation that the parameter would be used, instead of the captured reference
I think that a good logger should always provide a near constant execution time in any circumstance, which is problematic when threads might have to wait for mutexes to be released. However, in practice, unless numerous threads are logging, the operations are fast enough that there is no significant delay.
@DeadMG It has all the tools needed in System.String and System.Char and System.Encoding.* and System.Globalization.* and ... actually, the damn things are spread all over the place and named terribly and yeah, it's fucking annoying. But it even has grapheme cluster iteration in one of those namespaces with a terrible name.
@DeadMG If memory serves, .NET started out around the same time they'd realized Windows needed to convert from UCS-2 to UTF-16, so it was probably never actually UCS-2, but they also lacked any real experience with UTF-16 at the time, so a fair amount of it (especially the older parts) probably look/feel a lot like UCS-2 anyway.
System.Globalization.StringInfo.GetTextElementEnumerator is really crappy: it gives an enumerator, not an enumerable, meaning it cannot be used directly in foreach.
@sehe Honest truth. Their APIs in general will let you do nearly anything you need -- but doing it is often extremely clumsy. This is a decided contrast to Apple (for one obvious example) where doing what they think you should is easy, and doing anything else is (essentially) impossible.
@R.MartinhoFernandes There was virtually no requirement stated in the Q. In fact, my answer was completely overblown and must indicate I was bored at the time
Your answer does not suffer from that issue. It uses the enumerator in the ctor.
If you pass null to the single function iterators, they will return successfully.
And then, when you start iterating, bam NRE.
It should be a function that tests the argument for null, and then delegates to the function that does the actual iteration. Like all standard LINQ operators are. Fail fast.
Option Mnemonics: tar xzvf = Xtract Ze Vucking Files [said in thick German accent]
@R.MartinhoFernandes workerwrapper.com <-- succeeds at seriously confounding my sleepdeprived mind
@R.MartinhoFernandes yeah. tar is fine by me. ln - well I know the few options I care about. But I do always doublecheck the result when I symlink a directory to replace an existing symlink (I think that's ln -sfvd source/ target
Electronic sports (eSports) comprises the competitive play of video games. Other terms include competitive gaming, professional gaming, e-sport, and cybersport. The most common video game genres associated with electronic sports are real-time strategy (RTS), fighting, first-person shooter (FPS), massively-multiplayer online (MMOG), and racing. Games are played competitively at amateur, semi-professional and professional levels, and some games have organized competition in the form of leagues and tournaments. Events such as Major League Gaming (MLG), Global Starcraft II League (GSL), World...
@sehe Simpler than they make it sound. You have a wrapper that's devoted to nothing but checking arguments, and a worker that does the work, but is only ever invoked if the wrapper says the arguments are all right.
@R.MartinhoFernandes That's an important part. I think haskell.org/haskellwiki/Worker_wrapper clearly implies that the wrapper could do more than argument checking (it can also inject starting state; I use this often for algorithm functions)
@skaffman and that link clearly confirms we're talking about micro optimizations here ("generates smaller bytecode and might help the jit"). Yet we are talking about code that uses synchronization primitives that may block. I'm willing to bet a profiler would not confirm a net win here. (Premature Optimization) — sehe30 secs ago
@R.MartinhoFernandes It can't because there might be a race on the lock field? The field isn't final (I think java doesn't have that for instance fields... ICBWT)
@R.MartinhoFernandes That looked like possibly sloppy wording to me. Anyways:
As of Java 5, one particular use of the final keyword is a very important and often overlooked weapon in your concurrency armoury Thread-safety with the Java final keyword
^ final fields may have been impopular for VM compatibility reasons
When the sentence "The spirit is willing, but the flesh is weak" (дух бодр, плоть же немощна, an allusion to Mark 14:38) was translated into Russian and then back to English, the result was "The vodka is good, but the meat is rotten" (спирт, конечно, готов, но мясо протухло)
A potential way to get more information: attach a debugger and break on thread termination. Depending on how your thread is being terminated, this might not work.
Download Debugging Tools for Windows if you don't already have it
Run windbg.exe, attach to your process
Break into windbg, type sx...
On Sat, Jan 22, 2011 at 04:55, Rémi Forax <forax@...> wrote: No, making the local final doesn't trigger any optimization. javac doesn't do any optimization and in the bytecode there is no way to say this local variable is final.