Obtaining unique lines with matching strings I have a JSON like text file of records with duplicate ids that look like:  {"ID":"93" , "ST":[42,77,51]} {"ID":"21" , "ST":[43,4]} {"ID":"94" , "ST":[65,11,4]} {"ID":"93" , "ST":[42,77,51,29,63]} {"ID":"73" , "ST":[21,20]} {"ID":"94" , "ST":[65,11,4]} {"ID":"77" , "ST":[87]}   I am trying to filter the duplicates and always keep the first occurrence of such a match. The field ST could be the same but also different for the records with the same id.  The output would look like:  {"ID":"93" , "ST":[42,77,51]} {"ID":"21" , "ST":[43,4]} {"ID":"94" , "ST":[65,11,4]} {"ID":"73" , "ST":[21,20]} {"ID":"77" , "ST":[87]}   A similar question has already been asked , but for this case the data file being edited was a comma separated file. Here we are dealing with a JSON data and the goal will be to find the lines that have the same id values(may be a regex match) and keep the latest one. Anyone has an idea how to tackle that with awk, sed or pure command line tools?
Remove entire row in a file if first column is repeated I have a file containing two columns and 10 million rows. The first column contains many repeated values, but there is a distinct value in column 2. I want to remove the repeated rows and want to keep only one using awk. Note: the file is sorted with values in column 1. For example:    1.123 -4.0 2.234 -3.5 2.234 -3.1 2.234 -2.0 4.432 0.0 5.123 +0.2 8.654 +0.5 8.654 +0.8 8.654 +0.9 . . . .   Expected output  1.123 -4.0 2.234 -3.5 4.432 0.0 5.123 +0.2 8.654 +0.5 . . . .
Recovering broken or deleted NTFS partitions Repeated ANOVA unbalanced data I did experiment on one group of rats, the group was tested during 8 days, this is the first stage. The same group was also tested again but this time the test phase was 7 days. I tried to do my analysis using ANOVA repeated measures but I had a problem with the days.. I want to know the difference in the 2 tests but the days are not the same number. I don't know how to handle it. If there is any way to do the analysis using repeated measures ANOVA.   I tried to use repeated measure anova within subjects effect. My first factor will be test with 2 levels (test 1 &amp; 2),second factor is day with the level of ?? Here is the problem! if I write 8 there will be extra day in test 2 and the analysis cant carry!! How do I add a new, valid tag when I don't have enough reputation? I'd like to post a question on StackOverflow, but I think I should be able to tag it with    . Poor me, there is no  tag; There is  and , I'm certainly not sure this is the right thing to do, so figure I'll start here.  Edit Question located here: New Google SEO benefit with SSL - with only a few sections in SSL, or always on? What harm can be done with a copy of one's passport? How to prove $\bar{m}$ is a zero divisor in $\mathbb{Z}_n$ if and only if $m,n$ are not coprime Usually I don't mind about LaTeX's compilation speed, because a paper of less than 20 pages is compiled rather fast.  However, I am working on a large document - A report with more than 80 pages.  Compilation times are starting to slow me down.  I saw the couple of answers here on this topic, but most of my graphics are external and I don't use Tikz.  As a matter of fact, I'm not sure what's slowing the compilation down, other than the amount of text and required layout.   What's your best speeding-tex-up trick, other than externalizing graphics and pre-compiling the preamble? How can I know what's slowing TeX down? I am working with a basic  which is a popular modal used on many sites. I noticed that the default template comes with both a close button on the bottom, as well as an x on the top, these two buttons essentially having the same purpose. Are the two redundant and the close button completely unnecessary and just taking up extra space? Or, is having multiple usage options more user friendly?   To make this even more fun, suppose I throw in a Save button:   Is it now clearer that if you don't press save and just press the x, your changes will be canceled, or is there now more of a need for a cancel button for users who are scared that a mistake will become permanent? Update: To clarify for those who feel this question is similar to  - That question is asking if a clickable background is sufficient to close a popup. I'm using buttons and it is just a matter of how many buttons to use. (I do also have a clickable overlay and ESC key enabled, but that is irrelevant to my question) On my Toshiba Encore 8 Tablet I noticed that the CPU usage is very high. In Taskmgr / ProcessExplorer, I can see that OneDriveSetup.exe is hogging 1 CPU cores heavily for hours.    How an I solve this hang and finish the OneDrive Update? In the bash terminal I can hit Control+Z to suspend any running process... then I can type fg to resume the process.  Is it possible to suspend a process if I only have it's PID? And if so, what command should I use?  I'm looking for something like:  suspend-process $PID_OF_PROCESS   and then to resume it with  resume-process $PID_OF_PROCESS Why doesn't backpropagation work when you initialize the weights the same value? Why doesn't backpropagation work when you initialize all the weight the same value (say 0.5), but works fine when given random numbers?   Shouldn't the algorithm calculate the error and work from there, despite the fact that the weights are initially the same? Fancy chapter headings Why are the two versions of Chromium and VLC available in Ubuntu software of different sizes? How to efficiently count the number of keys/properties of an object in JavaScript? What's the fastest way to count the number of keys/properties of an object?  It it possible to do this without iterating over the object?  i.e. without doing  var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) count++;   (Firefox did provide a magic __count__ property, but this was removed somewhere around version 4.) Why does Sass change the format of my colors? Check if email exist php Is it true that $\lfloor\sqrt{n}+\sqrt{n+1}+\sqrt{n+2} \rfloor=\lfloor\sqrt{9n+7}\rfloor$? I know it's true that  $$\lfloor\sqrt{n}+\sqrt{n+1} \rfloor=\lfloor\sqrt{4n+1}\rfloor,\forall n\in \mathbb N. \tag 1$$ Is it true that  $$\left[\sqrt{n}+\sqrt{n+1}+\sqrt{n+2} \right ]=\left[\sqrt{9n+7}\right], \tag 2$$ $$\left[\sqrt{n} +\sqrt{n+1}+\sqrt{n+2}+\sqrt{n+3}\right ]=\left[\sqrt{16n+20}\right], \tag 3$$ $$\left[\sqrt{n} +\sqrt{n+1}+\sqrt{n+2}+\sqrt{n+3}+\sqrt{n+4}\right ]=\left[\sqrt{25n+49}\right], \tag 4$$ for all $n\in \mathbb N$? I have checked $(2),(3),(4)$ through $10^6.$   (I think $(4)$ maybe has counter-examples, but I cannot find it.) My webcam just came on "out of the blue" find the number of injections/surjections I've been banging my head on this problem for some time now, and could really use help. Bear in mind I'm not very good at this sort of thing and am struggling to get by in class.  Problem:     Given $ \alpha : A \to B       \;\;\;\;\;   |A|=p \;\;\;\;|B|=q $      Find:         Number of Injections: $A \to B$   Number of Surjections: $ A \to B$    Prove that ∃ a bijection $A \to B$       $\Rightarrow$ p = q   find number of bijections: $A \to B$         I apologize for dropping such a big problem on you all, but I just can't get anywhere with this. Help?  EDIT: These answers are really helpful and I believe I've got down the number of Injections, but  we haven't gone through permutations or combinatorics in class so my understanding of it is really hamstrung. I'm unclear on the Stirling theorem as discussed here: , specifically the part where inclusion-exclusion comes into play. I'm not sure how to apply that, since right now I'm letting p = 4 and q = 3, so I don't know where inclusion-exclusion would be used (if at all!) since I don't know how elements would be missing. How to assign values to a MATLAB matrix on the diagonal?