stability

ArrayList.Sort should be a stable sort with an IComparer but is not?

|▌冷眼眸甩不掉的悲伤 提交于 2020-08-06 11:41:07
问题 A stable sort is a sort that maintains the relative ordering of elements with the same value. The docs on ArrayList.Sort say that when an IComparer is provided the sort is stable: If comparer is set to null, this method performs a comparison sort (also called an unstable sort); that is, if two elements are equal, their order might not be preserved. In contrast, a stable sort preserves the order of elements that are equal. To perform a stable sort, you must implement a custom IComparer

Stability of .NET serialization across different framework versions

∥☆過路亽.° 提交于 2020-01-10 03:52:25
问题 A project I'm working on requires serializing a data structure before shutting down and restores its state from this serialized data when it start up again. Last year, we were building for .NET 1.1, and ran into a tricky issue where our code ran on .NET 2.0 a customer upgraded with some software that somehow set 1.1 as default our code ran on .NET 1.1 and was unable to deserialize its stored state This particular issue was "resolved" by barring that particular software upgrade, and shouldn't

Smart Garbage Collection?

眉间皱痕 提交于 2019-12-31 02:15:08
问题 You can garbage collect in Java simply by calling System.gc() but sometimes this "stalls" the application. Is it a bad idea to garbage collect like this and avoid stalls: new Thread(new Runnable() { public void run() { System.gc(); } }).start(); Or might this lead to even more problems? 回答1: Yes, most times it is a very bad idea to call System.gc(). There are exceptions but they are few and it is mostly better to spend the time making sure you are not doing things that hurt performance in a

Hard evidence that Linux is more stable than windows? [closed]

牧云@^-^@ 提交于 2019-12-25 02:22:47
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 years ago . I am trying to convince management to switch from SQL Server, to MySQL on Linux. This is very much a windows house, and management seems very wary of using Linux. Can anyone provide hard facts showing Linux is more stable, higher performance than windows for running a DB server? And any other advantages? Also,

What are the things you would like improved in the Ruby language?

社会主义新天地 提交于 2019-12-20 09:53:45
问题 What are the things you wish Ruby (and more generally the Ruby community) would improve? I read somewhere that Ruby is the love-child of Smalltalk and LISP, with Miss Perl as the Nanny. I have a lot of respect for Ruby's parents, but I'm not sure I like the influence Miss Perl had on the child. Specifically, I don't like the predefined variables: I need a cheat sheet to know what they mean. You could say "just don't use them". Well, I don't... but other people do. And when I download a plugin

Should I avoid using net/http/httptest in production code?

瘦欲@ 提交于 2019-12-12 22:34:25
问题 I like the ability to present a buffered net/http.ResponseWriter as a net/http.Response in some situations which net/http/httptest.ResponseRecorder would give me, but the package name makes me a bit concerned about using it in production code. I understand that it’s intended to be used primarily for testing, but am unsure if I am asking for trouble using it in production code. Am I tempting fate? 回答1: You should not use this code in production. No matter what you are attempting to achieve.

How to limit ArangoDB RAM usage inside of a docker container?

拈花ヽ惹草 提交于 2019-12-12 18:34:43
问题 We use ArangoDB 3.3.14 (Community Edition) with MMFiles storage engine for a relatively large data set (a bit over 30 GB when you back it up). We run it inside of a docker container using ECS. Our host VM has 64 GB of RAM and we have dedicated 55 GBs exclusively for ArangoDB container (we set a hard limit for that container to 55 GBs). When ArangoDB is just started and have all the collections loaded into the RAM it would take about 45 GBs, so we have about 10 GBs of free RAM to be used for

Directed Acyclic Graph with multi-parent nodes

余生长醉 提交于 2019-12-12 09:21:33
问题 Given: A directed acyclic graph with weighted edges, where a node can have multiple parents. Problem: For each child of root node, find a minimum-cost(sum of weights) path from such a child to some leaf which can be reached. A node can only be present in one such min-cost paths. Example graph: In the above graph, for node 2, all the available paths are: 2 -> 5 2 -> 1 -> 9 -> 6 2 -> 1 -> 10 -> 6 Among which 2 -> 1 -> 10 -> 6 has minimum cost of 3.5 Similarly, for node 4, all the available

How many nested tags in HTML can you have before it crashes a browser?

♀尐吖头ヾ 提交于 2019-12-12 04:28:58
问题 I had a thought earlier today regarding nested HTML tags and how browsers render them: <html xmlns="http://www.w3.org/1999/xhtml" {or whichever html version} xml:lang="en" lang="en"> <head> </head> <body> let n = 1 <div> recurse div n times until maximum (browser fails) </div> </body> </html> what will n be when the browser cannot handle any more recursion? I would think this would be different for each browser, and different also for mobile apps. Is there a web standard, such as the maximum

Http-Conduit frequent connection failures

白昼怎懂夜的黑 提交于 2019-12-06 20:07:45
问题 I am writing application which will download some files by HTTP. Up to some point I was using following code snippet to download page body: import network.HTTP simpleHTTP (getRequest "http://www.haskell.org/") >>= getResponseBody It was working fine but it could not establish connection by HTTPS protocol. So to fix this I have switched to HTTP-Conduit and now I am using following code: simpleHttp' :: Manager -> String -> IO (C.Response LBS.ByteString) simpleHttp' manager url = do request <-