I have a file like this:  user1, 10 user2, 5 user2, 6 user1, 15 user3, 23 user1, 15   I'd like to have totals by column 1 (user1, user2, user3), and make it look like this:  user1, 40 user2, 11 user3, 23   What would be the best way forward? A while loop on the first column and sum up the 2nd column as long as it's the same?
With Unix script, I'd like to add values in column 1 if text in column 2 is the same and print the sum.  I have a file that is:    7 GeneA 2 GeneB 6 GeneC 2 GeneB 9 GeneA   I want the output to look like:   16 GeneA 4  GeneB 6  GeneC   Thanks
Clarifications about Gstreamer I'm a bit confused about what Gstreamer does.   Does it come installed by default with Ubuntu ?  If so which version  is the default for 14.04?  Does it provide hardware accelerated video playback (decoding) ?   If so does it work with VA-API and VDPAU or is it an alternative to those?    Thanks for your help Remove particularly tricky items from context menu I've found various sources of info about removing these annoying things which I never use... but I haven't succeeded in getting rid of the following.    (Avira-related:) - Scan selected files with Avira  (I believe all this is M$ crapware... I presume it's all been lovingly crafted so they're all impossible to remove. You never know, though: some super-uber-uber-geek might just have found a way) - Restore previous versions  - Cut - Copy - Delete  - Rename I've searched for multiple forums for this questions and have seen different answers but so far, nothing have worked yet even from the ones I've seen here.  I want to extract a single file from a tar to a different directory.  I've tried this:  tar xvf file.tar -C /home/dir/ filename   or this:  tar -x filename -f file.tar -C /home/dir   But got these errors respectively:  x filename, 14826 bytes, 29 media blocks. File -C not present in the archive. File /home/dir not present in the archive.   and:  tar: /dev/rmt0: A file or directory in the path name does not exist.   The first extracted the file but in the same directory, not to the folder I wanted. Variable Sized Arrays vs calloc in C On the discussion of dynamic memory here:   The author states:     A memory block like this can effectively be used as a more flexible array. This approach is actually much more common in real-world C programs. It's also more predictable and flexible than a "variable size array"   The type of memory block he is talking about is as such:  const int size = 5; int * array = calloc(size, sizeof(int));   and then using another pointer to iterate over the array:  int * index = array; for (i = 0; i &lt; size; i++) {     *index = 1; // or whatever value     index++; }   My question is how is this method better than a standard variable sized array like this?:  int array[variable];   or dynamic:  char name[] = "Nick";   The author doesn't really shed much light as to why I should prefer the former method to the latter. Or more specifically: How is it more "predictable and flexible"? Determine whether a number is prime How do I determine if a number is prime?  I'm writing a program where a user inputs any integer and from that the program determines whether the number is prime, but how do I go about that? Coefficient growth in the power series $\sum u_n z^n = e^{1/(1-z)}$? What is attached to this spigot and how to remove Proving the identity functions is continuous iff $\tau_1\supseteq\tau_2$ Exercise: Let $\tau_1$ and $\tau_2$ be two topological spaces on a  set $X$. Then $\tau_1$ is said to be a finer topology than $\tau_2$ if $\tau_1\supseteq\tau_2$. Prove the identity function $f:(X,\tau_1)\to (X,\tau_2)$ is continuous if and only if $\tau_1$ is a finer topology than $\tau_2$.  Attempted proof: Let $A\in\tau_1$. If $f$ is continuous then $\exists B\in\tau_2$ such $f(A)\subset B\implies A\subset B$ for any $A\in\tau_1$ such that all open sets of $\tau_1$ are open sets of $\tau_2$ hence $\tau_1\supseteq \tau_2$. If $\tau_1$ is a finer topology than $\tau_2$, for any $B\in\tau_2\implies B\in\tau_1$ which implies that $f^{-1}(B)=B$, then $B\in\tau_1$ which proves $f$ to be continuous. Questions: Is my proof right? If not. What is wrong? What are alternatives? Thanks in advance! I'm trying to delete a folder in Windows 7 and get a perplexing error message: "Could not find this item:  This is no longer located in G:\Graphics.  Verify the item's location and try again.  I can see the folder -- I can find it.  I just can't delete it.    I also get a second error message (sometimes) when I click on the folder: G:\Graphics 2009-11-17 refers to a location that is unavailable...this information might have been moved to a different location.    I'm using Windows 7; this folder is on an external hard drive.  I've emptied the folder (there were items in it); I've scanned that external hard drive for errors.  Trying to rename the folder yields the same enigmatic error message.    Is there a way to delete this folder? What is the ancestral form of language used in the fable that David was studying during the flight? David studies linguistics during the flight to LV-223. We get to listen and read a fable. Is it written in a real language? What is the name of the language? Can the fable be translated?  Approximate quotation:     hjewis jasma hwaelna nahast akwunsez dad'kta, tam ghermha vagam ugenthe How to execute .sh file on Windows? When I am trying to execute a file(name.sh) in the command line by the command  ./name.sh  , I am getting the error that:     "." is not recognized as an internal   or external command, operable or batch   file   please help me execute the .sh file If I was... If I were...   When is it correct to use "If I was" vs. "If I were" in standard English? Why does $\lim_{n \to\infty}a_{n+1} = \lim_{n\to\infty}a_n$? Assume that $\{a_n\}$ is a convergent sequence. How to use the definition of a limit of a sequence to prove that $\lim\limits_{n \to\infty}a_{n+1} = \lim\limits_{n\to\infty}a_n$? Recently the keyboard and trackpad on my 2015 13" MacBook Pro have stopped working. This is the second laptop to do this, the same issue happened about 6 months ago and Apple gave me a new one when they could not figure it out.  The issue usually starts with force touch not working then progresses to the keyboard and trackpad not being recognized at all. Currently the power button works and force touch works but all other keys and the trackpad don't work.  When this happens there are a lot of errors in the console regarding the AppleHSSPIController.  4/21/16 6:56:47.000 AM  kernel[0]   Error: AppleHSSPIDevice::start failed to get device descriptor 4/21/16 6:56:47.000 AM  kernel[0]   Error: AppleHSSPIController::_enumerateDevice Start failed 4/21/16 6:56:47.000 AM  kernel[0]   Error: AppleHSSPIController::_handleEnumerationFailureGated Giving up on device   You can see the full log here: How to concatenate characters in java? How do you concatenate characters in java? Concatenating strings would only require a + between the strings, but concatenating chars using + will change the value of the char into ascii and hence giving a numerical output. I want to do System.out.println(char1+char2+char3... and create a String word like this.  I could do   System.out.print(char1); System.out.print(char2); System.out.print(char3);   But, this will only get me the characters in 1 line. I need it as a string. Any help would be appreciated.  Thanks Number formation from given digits I was asked this question in a recent interview. You are given two digits $0$ and $9$. Using only these two digits you must form the least positive number that is a multiple of a given '$n$' . The value of $n$ will be provided before hand. For example if we are given $n$ as $7$ then the answer will be $9009$ .  I tried using some basic divisibility principles but was not able to come up with a correct solution and code it up. Probably I need some help in number theory What is a Generic Handler in asp.net and its use? I've been using the beta iCloud Photo Library for a week and a bunch of photos got duplicated and I'd like to wipe all the photos out and start over.  I have backups of all the photos and have turned off iPhoto Cloud Library on all iOS devices. When I log into the web app - it still shows dozens of albums and I can delete all the photos, then go to deleted items and then purge them, but the ghost albums are still there messing things up.  I've turned off the library entirely and you can see there is a 30 day waiting period.     If I click on albums, there are pages of them and no delete button anywhere. If I turn on the library on an iOS device, data starts flooding back as if I wanted to recover the photos.  I don't want to recover anything, I want a clean wipe and clean slate.  Currently, there are 7807 photos in the deleted album and no way to mass delete them. I have 31 albums that show up in iCloud and no way to delete them.  Is there some way to accelerate this or must people wait a month for a corrupt library to eventually be purged to start over?  (I have tickets open with AppleCare after  and it's escalated to engineering, but I was informed that it might be a week or two before it gets seen :-( Perhaps someone has a better idea to clear things out or noticed something I've missed.) Enable automatic deletion of old, unanswered, zero-score questions after a year? Related to Meta Super User efforts:  and Meta Server Fault efforts:  We already auto-remove negatively voted unanswered old questions automatically after 30 days, network wide, with no human intervention required. I was thinking we might extend that to remove old, unanswered zero score questions... based on the following criteria:  fewer than (question age in days * 1.5) views 0 score or lower, or 1 score or lower if the original author is deleted no answers 1 comment or fewer asked more than 1 year ago (thus based on creation date, not last activity date, so , or a user editing it, does not give a doomed question 365 more days of zombie &quot;life&quot;)  See the results of this query on:  (10509) |  (787) |  (650) This query has been refined based on the comments, and this is the final version that will roll out tonight. Every site in the network (except metas) will automatically delete old questions that meet this criteria from this point forward. Socket Tester all indicators light up