I am working with a an array of 5 character strings. And joining the items into one large string. x is the array and looks like this:  val x : System.String [] =   [|"W0SPFR"; "1BUDJY"; "1L1RJV"; "ITBPFA"; "QVUS7N"; "CJ6ZMQ"; "V3HUQ5";     "694L4U"; "8RYWPF"; "YGWS8U"; "3KEKA9"; "1C9L6Q"; "OXCGSF"; "GF0CUQ";     "YR41AF"; "4D4U0G"; "1U94T1"; "VUVJI0"; "CTYQL3"; "310XVU"; ...|]   My initial attempt was this:  let y = x |&gt; Array.reduce (fun  x y -&gt; x+"-"+y)  Unfortunately this turned out to be slow, even for moderately sized arrays (10,000 elements). I'm looking to scale this up to millions.    Real: 00:00:00.483, CPU: 00:00:00.577, GC gen0: 167, gen1: 6, gen2: 5  My second attempt was better:  open System.Text    let buf = new System.Text.StringBuilder() let z = x |&gt; Array.fold (fun (buf:StringBuilder) x -&gt; buf.Append(x+"-")) buf |&gt; string z.[0..(z |&gt; Seq.length)-2] = y   Question1:    Is StringBuilder the fastest way to build this large string? I'm also open to parallelizing it.    Question2:   Because I use fold in the second attempt, a - is being joined to the last item, hence I'm getiing rid of it with z.[0..(z |&gt; Seq.length)-2]. Is there a more elegant way?
In a  about formatting a double[][] to CSV format,  that using StringBuilder would be faster than String.Join. Is this true?
QGIS - export a project with dependencies Why shouldn't I care what model/make/year my bicycle is? How To Reduce Noise In Cycles Render I've used git clone to make a local copy of a GitHub repository containing a  I'd like to use. The local copy contains all of the source for the program; but as a newbie to Ubuntu, I've no idea of what tools or steps are involved in compiling and installing the driver.   I'd really appreciate if anyone could provide a step-by-step guide? What is $\Delta t$ in the time-energy uncertainty principle? In non-relativistic QM, the $\Delta E$ in the time-energy uncertainty principle is the limiting standard deviation of the set of energy measurements of $n$ identically prepared systems as $n$ goes to infinity. What does the $\Delta t$ mean, since $t$ is not even an observable? Why don't planets have Circular orbits? This might be a completely wrong question, but this is bothering me since many days ago. Given the mass (Sun) curves the space around it, gravitation is the result of such curved space (Correct me if I am wrong, source: A Documentary film). Given any point on a circle with center same as center of the mass, curvature in the space should be equal (Intuition).   Planets rotate around the Sun because of the curve in the space they should follow a circular path and the distance between planet and Sun should be at a distance.  Given the fact that earth has a elliptical orbit around the sun, and the distance between Earth and Sun varies according to position of the earth. Why do we have a elliptical orbit not a circular orbit. prove $\frac {ab}{a+b} \geq \sum ^n_{i=1} \frac{a_ib_i}{a_i+b_i}$ How to add a user to sudoers file? I have an account named as Chankey (local user). I had to use some commands like viewing the shadow file etc. I tried it using sudo command     sudo vim /etc/shadow   It said:      Chankey is not in the sudoers file. This incident will be reported.   How can I add this user Chankey to the sudoers file? Run a command that is shadowed by an alias Let's say I have the following alias in bash - alias ls='ls --color=auto' - and I want to call ordinary ls without options. Is the only way to do that is to unalias, do the command and then alias again? Or there is some nifty trick or workaround? I'm looking to download and install the latest version of Ubuntu to replace the current version of Windows I had pre-installed on my machine when bought it.   I have some really neat features on the machine that I really am hoping will still work when I move over to Ubuntu.  Can someone please confirm if the below will still work and, if not, how I can get them to work:   The USB ports on my machine The ethernet or Network work port on the machine The HDMI output on the machine and finally, the built in webcam   Thanks Sam I recently came across the paper . The author raised a few common misconceptions regarding hypothesis testing and p-values, about which I have two specific questions:   The p-value is technically $P({\rm observation}|H_{0})$, which, as pointed out by the paper, generally does not tell us anything about $P(H_{0}|{\rm observation})$, unless we happen to know the marginal distributions, which is rarely the case in "everyday" hypothesis testing. When we obtain a small p-value and "reject the null hypothesis," what exactly is the probabilistic statement that we are making, since we cannot say anything about $P(H_{0}|{\rm observation})$? The second question relates to a particular statement from page 6(652) of the paper:      Since the p-value, or range of p-values indicated by stars, is not set a priori, it is not the long-run probability of making a Type I error but is typically treated as such.   Can anyone help to explain what is meant by this statement? Regarding the `book`, `report`, and `article` document classes: what are the main differences? Number of surjections from $\{1,...,m\}$ to $\{1,...,n\}$ WARNING: Setting property 'source' to 'org.eclipse.jst.jee.server:appname' did not find a matching property Proving an integral equation. Number of publications needed to get into a computer science PhD program? I've looked at the resumes of the type of candidates that get into computer science PhD programs at the top few universities (e.g. Stanford, MIT etc.) and a lot of them seem to have multiple publications (2-4) done during their undergraduate years. Is this representative of the entire pool? Or is this just a self-selected group that puts their resumes online.  I currently have one first-author workshop paper (5 pages), and I wonder how this might affect my chances at entry into these top universities. I am trying to adapt an existing code to a 64 bit machine. The main problem is that in one function, the previous coder uses a void* argument that is converted into suitable type in the function itself. A short example:  void function(MESSAGE_ID id, void* param) {     if(id == FOO) {         int real_param = (int)param;         // ...     } }   Of course, on a 64 bit machine, I get the error:  error: cast from 'void*' to 'int' loses precision   I would like to correct this so that it still works on a 32 bit machine and as cleanly as possible. Any idea ? Why does Ubuntu 14.04 LTS use a non-LTS kernel version? I only recently became aware that LTS wasn't just an Ubuntu thing - there's LTS kernel versions too. Yet the kernel version used (3.13) in Ubuntu 14.04 LTS is not an LTS kernel version. Is it considered unimportant whether or not a kernel version is LTS? Genitive case or attributive noun Is there any rule for when it is better to use genitive case or noun as adjective? I'm not sure if there is any difference in meaning in this example:     The department of accounting       The accounting department   Can I also use both forms in situations like:     The restaurants of Paris / The Paris restaurants      The room window / The window of the room When I read about , I see that they should appear as solution to prevent  and  but when I actually try to write a code which would use Lightning promises it still doesn't look like synchronous code, it still resembles both pyramid of doom and callback hell.  main: function(component, helper) {     helper.promise1(component, helper).then(         $A.getCallback(function(record) {             return helper.promise2(component, helper, record).then(                 $A.getCallback(function(){                     console.log("Success");                     helper.showToastMessage(component, "Great Success!!!!")                 }),                  $A.getCallback(function(errorMessage){                     console.log("Rejected by second promise2");                     helper.showToastMessage(component, "Failure " + errorMessage);                 })              )         }),          $A.getCallback(function(errors){             console.log("Rejected by first promise1");             let message = errors &amp;&amp; Array.isArray(errors) &amp;&amp; errors.length &gt; 0 ? errors[0].message :'Unknown error';             helper.showToastMessage(component, "Failure " + message);         })      ) }   Is that possible to refactor this code to look more like synchronous code and without callback hell or pyramid of doom?