I need some help with sed. I have tried to look for information to do this but I couldn't find any specific and people hardly provide an explanation of the provided solution so this makes difficult to understand how sed works.  Basically I have files with the following format:  NAME_DIGITS_ddd-11s-21a-ds_DIGITS_DIGITS.xml   I want to copy the first DIGITS (e.g 00004574), which is the string between the first and second underscores.  Any idea of how to do this?  Considering that the first digits could be 0 what can I do to delete them?  I would appreciate any example for these two cases and an explanation would be really welcome too.  I have achieved the opposite: delete the characters between first and second underscores with: sed s/_[^_]*_/_/ but cannot see how to do what I really need.
To all the 'sed' doctors out there:  How can you get 'sed' to extract a regular expression it has matched in a  line?   In other words words, I want just the string corresponding to the regular  expression with all the non-matching characters from the containing line stripped away.  I tried using the back-reference feature like below  regular expression to be isolated           gets `inserted`                here                     |                v    sed -n 's/.*\( \).*/\1/p    this works for some expressions like   sed -n 's/.*\(CONFIG_[a-zA-Z0-9_]*\).*/\1/p    which neatly extracts all macro names starting with 'CONFIG_ ....' ( found in some '*.h' file ) and prints them all out line by line             CONFIG_AT91_GPIO           CONFIG_DRIVER_AT91EMAC                    .                    .              CONFIG_USB_ATMEL           CONFIG_USB_OHCI_NEW                    .                  e.t.c.    BUT the above breaks down for something like    sed -n 's/.*\([0-9][0-9]*\).*/\1/p    this always returns single digits like                    7                  9                  .                  .                    6   rather than extracting a contiguous number field such as.                 8908078               89670890                    .                  .                    .                23019                     .                e.t.c.     P.S.: I would be grateful to feedback on how this is achieved in 'sed'.        I know how to do this with 'grep' and 'awk'       I would like to find out if my - albeit limited - understanding of        'sed' has holes in it and if there is way to do this in 'sed' which I       have simply overlooked.
Expressing an opinion: to me or for me? Which one should be used?      To me, it makes no difference, but I'm not really sure why.   vs     For me, it makes no difference, but I'm not really sure why. How to secure database passwords in PHP? When a PHP application makes a database connection it of course generally needs to pass a login and password. If I'm using a single, minimum-permission login for my application, then the PHP needs to know that login and password somewhere. What is the best way to secure that password? It seems like just writing it in the PHP code isn't a good idea. I want to advance in the ranks of Senator Lavigny-Duval. How can I get merit points? I know I can participate in expansion goals, but is there a better way than that? What is the name of the problem where lines appear in a photo where there should just be a smooth gradient? "Use Option as Meta key" with ability to type the # symbol I am using Terminal version 2.5, where I have two requirements:  I need to be able to type the Meta key. I need to be able to type the # character, too (Option+3 for the UK keyboard layout)  How can I satisfy both of these? By default, (2) is satisfied, but (1) is not. I can then turn on &quot;Use Option as Meta key&quot;, which satisfies (1), but breaks requirement (2). How can I have both? (It shouldn't be so hard for me to just be able to type.) Edit: what I'm looking for, for example, might be a way to just &quot;Use Option as Meta key&quot; for the left/right Option key, or a way to override the &quot;Use Option as Meta key&quot; for the sole exception of the # character. The new ask page is now live on the network! I did not know that you could find an answer for that. However, I can only use Excel so far to do it.  How to calculate 3.6! by hand? "Install VMware Tools" greyed out after installing ubuntu 15.04 on vmware player 7.1 "Install VMware Tools" greyed out after installing Ubuntu 15.04 on VMware Player 7.1. I tried checking "No proxy" instead of default "Windows proxy settings" at "File->Preferences->Software updates-> Connection Settings". This did not work either. Is there a way to install VMware Tools? Pageblocktable to be rendered as table in PDF I have a VF code below where I am trying to display the related list of an object using  and  command. I am rendering this page as PDF , doing that in my PDF I am unable to see the content in a tabular format. How can I make the content appear in a table?      &lt;apex:pageBlockSection columns="1" title="TECHNICAL ASSESSMENT"&gt;          &lt;apex:repeat value="{!interviewSkillReviews}" var="interview"&gt;              &lt;table border="1" cellpadding="6"&gt;                 &lt;apex:pageblockTable value="{!interview.Skill_review__r}" var="skillreview"&gt;                      &lt;apex:column headerValue="Skill Name"&gt;                                                         &lt;apex:outputText value="{!skillreview.Skill__r.Name}"/&gt;                     &lt;/apex:column&gt;                 &lt;apex:column headerValue="Recommended Level"&gt;                     &lt;apex:outputText value="{!skillreview.Level__r.Name}"/&gt;                 &lt;/apex:column&gt;                  &lt;apex:column headerValue="Rating"&gt;                     &lt;apex:outputField value="{!skillreview.RatingCopy__c}" rendered="{!NOT(interviewerMode)}" /&gt;                     &lt;apex:selectList value="{!rating}" multiselect="false" size="1" rendered="{!interviewerMode}"&gt;                         &lt;apex:selectOption itemValue="1" itemLabel="1"/&gt;                         &lt;apex:selectOption itemValue="2" itemLabel="2"/&gt;                         &lt;apex:selectOption itemValue="3" itemLabel="3"/&gt;                         &lt;apex:selectOption itemValue="4" itemLabel="4"/&gt;                         &lt;apex:selectOption itemValue="5" itemLabel="5"/&gt;                     &lt;/apex:selectList&gt;                 &lt;/apex:column&gt;                  &lt;apex:column headerValue="Rating Level Description"&gt;                     &lt;apex:outputText value="{!skillreview.Skill_Level_Description__c}"/&gt;                 &lt;/apex:column&gt;               &lt;/apex:pageblockTable&gt;         &lt;/table&gt;      &lt;/apex:repeat&gt; &lt;/apex:pageBlockSection&gt;   I tried using &lt;table&gt; command of HTML but I just get a border around the pageblocktable.    Example of table look and feel: How to convince stakeholders to invest in proper UX? I'm working on a web app with a team of 5, including me. One database administrator, one project manager, two programmers and me the front-end designer. This project is an internal reporting system.  Anyways, I've struggling a little bit with my team, the DBA and two programmers seem to control our meetings with what Data we are going to pull and the best way to work it into an object model.  And then look to me to design some pretty interface.  Truth is, we've never measured the objectives of this application and what strategy will best meet them from a front-end design/UX standpoint. We've done no wire frames, no planning of content, no planning of pages, no conversations on specific interface components, nothing like that. It seems my team is content with designing and building the entire UX/UI based on a couple of ideas we've spit-balled in meetings.  Forgive me if this sounds too much like a gripe, but I'm at a loss. How do I get my team to understand, we can't just throw the front-end together based on back-end data and the interface HAS to be well planned out and organized? I am having a problem computing the pearson correlation coefficient of data sets with possibly zero standard deviation (i.e. all data has the same value).  Suppose that I have the following two data sets:  float x[] = {2, 2, 2, 3, 2}; float y[] = {2, 2, 2, 2, 2};   The correlation coefficient "r", would be computed using the following equation:  float r = covariance(x, y) / (std_dev(x) * std_dev(y));   However, because all data in data set "y" has the same value, the standard deviation std_dev(y) would be zero and "r" would be undefined.  Is there any solution for this problem? Or should I use other methods to measure data relationship in this case? How to access a SQL Server database from other computer connected to the same workgroup? Where did Harry's parents get all of their money from? So, at the beginning of Harry Potter, Harry is found to have a large vault of gold at Gringotts. Where did all of that money come from? What did James (I assume it came from him, as Lily was muggle-born, and they were both young) do to get all of that cash? Make program first read from pipe, then from keyboard Inequality : $\sum_{k=1}^n x_k\cdot \sum_{k=1}^n \frac{1}{x_k} \geq n^2$ I have to show the inequality of $$\left(\sum_{i=1}^n x_i\right)*\left(\sum_{i=1}^n \frac{1}{x_i}\right) \geq n^2.$$For $x_1, ... x_n \in \mathbb{R_{&gt;0}}$ and $ n \geq 1$. I wanted to show this inequality by induction. The basis is clear, but I am not sure how to do the inductive step. Can someone help me with that? Sort and count number of occurrence of lines $n$-th digit in the sequence of natural numbers What's the $n$-th digit in the sequence $S$ of numbers formed by the natural numbers, i.e.,  $n$-th digit in the sequence 1 2 3 4 5 6 7 8 9 10 11 12... ? For example 11th digit in the sequence is 0. Trying to manually sign android package with jarsigner.exe and install with adb.exe How does a sarlacc gain any energy if it keeps victims alive for a thousand years? When eaten by a sarlacc, according to C-3PO,     In his belly, you will find a new definition of pain and suffering, as you are slowly digested over a thousand years.   I imagine that keeping a victim alive for a thousand years takes much more energy than is available to the sarlacc from the body of the victim.  Thus, keeping victims alive for so long would seem to be a net loss of energy for the sarlacc.  Is there a canon answer to resolve this conundrum?  Did the sarlacc have another energy source (for example, ability to harvest sunlight)? I am presenting a paper at a computer science conference.  The paper I submitted to the conference mentioned future work that would significantly enhance the utility of the method.  This work was work that was always planned to be part of the same "project" as the work in the paper, indeed the conference paper is presented as a part way step towards doing X, and the future work is what takes it all the way.  The extension was quite involved (and not quite complete when I submitted the paper for review). They day before I left for the conference that work was "completed", in that a journal article about it was submitted for review.  Now when I present at the conference, in the conclusion I want to mention the future work&nbsp;&ndash; at least to the extent that it was described in the conference paper. Should I go into more detail? Should I even mention that "This work is now complete, and is under review for publication"?