How to extract lines from source file with reference file, add to the result file? I have a question and cannot figure out.  It is Solaris. the over simplified source &amp; reference files.  s.txt source file:  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user1,cn=users,dc=domain  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user9,cn=users,dc=domain  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user10,cn=users,dc=domain   r.txt reference file:   uniquemember: cn=user9,cn=users,dc=domain  uniquemember: cn=user8,cn=users,dc=domain   I'd want a script for using the reference record uniquemember file to extract the source file's cn=user9's line and 3 lines Above,  add to a result file usermember_  add.ldif:  dn: cn=task,cn=Groups,dc=domain  changetype: modify  add: uniquemember  uniquemember: cn=user9,cn=users,dc=domain
How to run grep and show x number of lines before and after the match grep returns just the line where it matched the regex and often what I want to really see is a few (say 2) lines above and below the matched one. Is there a simple way to achieve it?  EDIT: OS: Ubuntu based Bodhi Linux.  As mentioned in comments, -C does not work in vanilla but its GNU grep in my case.
When induction proofs need a choice function Reading the comment to  the user makes the argument that one can pick a dense subset of a separable vector spaces without relying the axiom of countable choices. Since the comment got a lot of up votes, I guess it's correct, but to me this seems very strange. My rule of thumb was/is the following: We can get by without a choice function if   There is a canonical choice at each iteration. The proof doesn't actually require the iteration process to terminate.   None of these seem to be satisfied in the present case, unless there is a canonical choice for the dense subset, or the set is dense at some finite iteration, so my question is:   When can I tell if an induction arguments relies on the existence of a countable choice function? I noticed an unexpected different line spacing of the titlepage what drives me crazy. The left page is the MWE, the right page without the \\ in front of Name.  \documentclass{scrartcl}  \begin{document}  \centering \Huge \textbf{UUUUUUUU UUUUUUUUU UUUUUUUUUUUUU UUUUUUUUUUUUU} \vspace{\baselineskip}\\ \textbf{UUUUUUUU UUUUUUUUU UUUUUUUUUUUUU UUUUUUUUUUUUU} {\rmfamily\Large \vspace{5\baselineskip}\\Name}  \end{document}     Any idea what causes this? Thanks alot!  Cheers, Stephan I am planning to travel to India (COK airport, Kerala) from United States. I want to take my laptop as well as my tablet (iPad). Am I allowed to take both in my backpack with my documents related my work. I think I am allowed to take only one computer as per the rule. Will the customs consider my iPad as a computer?  What all I can take?   One of my friends took 2 laptops (1 work and 1 personal) and had trouble at the airport.  Also I am planning to take some wristwatches (7 of them, each avg price is 45 $). I read in a website that I can take stuff up to max 35000 INR. Is that true? In that case, how will I manage my stuff? Can I move the Unity launcher? I can’t get used to the new Unity system. I’d like to move the left Unity panel to the bottom of screen (like Windows 7 – more similar is better).  But I can't find a way. Is it possible? Proper capitalization of commonly used acronyms and initialisms I was always under impression, that acronyms ought to be written all caps. However reading  site very often I see some of the common acronyms written as proper names (first cap). For example "Nato" instead of "NATO".   I know that BBC is quite strict in proper English usage, so what would be the reason behind this? Compare 1st column of the 1st file and 2nd column of the 2nd file and matching IANAL et al. is usually the start of answers to [legal] questions on any SE site (e.g. ). You usually end up with personal opinions which sound sensible and the accepted answer is often the one closest to the OP's hopes. But it's probably often not correct. I know the situation can be rather complicated and even differ by location, but it would be really helpful if the SE team were providing official lawyers (indicated maybe by using a § in the username, forbidden for everyone else, just like the mod ♦) to provide some orientation that one could actually rely on beyond much doubt... By conservation of energy, the solid is left in a lower energy state following emission of a photon.  Clearly absorption and emission balance at thermal equilibrium, however, thermodynamic equilibrium is a statement of the mean behaviour of the system, not a statement that the internal energy is constant on arbitrarily short timescales.  The energy has to come from somewhere during emission, and go somewhere during absorption.  Energy in a solid can be stored as kinetic and potential energy of electrons and nuclei, either individually or in collective modes such as phonons and plasmons.  In thermal equilibrium energy will be stored more or less in various forms depending on the temperature and material.  However, even if most of the thermal energy in a particular solid at temperature $T$ is stored in the form of phonons, it could be that phonons primarily interact with light indirectly via electrons, e.g. a phonon excites an electron in a phonon-electron interaction, which can interact with light via the EM field.  Given that light is an EM field, it makes sense to me that it is emitted and absorbed by charged particles.  The electron-photon interaction is probably dominant for visible and ultraviolet light, given that metals are opaque, while semiconductors and insulators are transparent to (visible and UV) light with energy lower than their bandgap. However, once you get into energies in the IR and below, or X-rays and above, other mechanisms apparently take over.  For example, on the high-energy end of the spectrum I've heard that gamma rays can interact directly with nuclear degrees of freedom, which is reasonable considering that gamma rays are emitted during a lot of nuclear reactions.  A review of  might give clues to important light-matter interactions over a broad range of wavelengths.  Whether all of the these processes are involved in blackbody emission is a somewhat different question.  What physical processes mediate energy transfer during blackbody emission, and in which energy ranges are the various processes dominant? How to make crs transformation of a QgsVectorLayer? I need to transform QgsVectorLayers in python from one crs into another crs. By googling I found the following solution (), which works for points only:  crsSrc = QgsCoordinateReferenceSystem(4326)    # WGS 84 crsDest = QgsCoordinateReferenceSystem(32633)  # WGS 84 / UTM zone 33N xform = QgsCoordinateTransform(crsSrc, crsDest) pt1 = xform.transform(QgsPoint(18,5))   Is there a way to make a crs transformation of an entire layer? I'm having some trouble understanding a proof on  on Number Theory and I was wondering if you guys could give me some help. The problem is that I don't understand the last implication on the proof for example 1.1     Example 1.1. Let x and y be integers. Prove that 2x + 3y is divisible by 17 iff 9x + 5y is divisible by 17.      Solution. 17 | (2x + 3y) ⇒ 17 | [13(2x + 3y)], or 17 | (26x + 39y) ⇒ 17 | (9x + 5y)       conversely, 17 | (9x + 5y) ⇒ 17 | [4(9x + 5y)], or 17 | (36x + 20y) ⇒ 17 | (2x + 3y).   My problem is that I don't understand how does 17 | (26x + 39y) imply 17 | (9x + 5y). If you could elaborate on this step I would be most grateful.  I'm sorry if this is an obvious question but I am a beginner and I just can't get it.  Thanks for your help in advance. Recommend a statistics fundamentals book To give you some background, I have a grasp on the basics of statistics and probability theory and even remember touching Bayes theorem at the university data mining course. But being a few years away from the university made my math got extremely rusty (so much for last-minute pre-exam cramming). While I remember various random basic concepts, there are a lot of gaps in my understanding of them.  What would be a good material (a book, a site, or otherwise equally accessible medium) to revise the fundamentals and go beyond basics? I'd like a book that can be actually read as a book (most statistics books are really dry and are close to being reference material, rather than a book). "The pair was ..." or "the pair were ..." No space following macro without argument Prove divisibility law $\,b\mid a,c\,\Rightarrow\, b\mid ka + lc$ for all $k,l\in\Bbb Z$ Rails Previous Sunday in Relation to Any DateTime U.K visitor visa with very old criminal conviction - do I disclose it? I have been travelling to the U.K for 25 years at least 8-10 times a year,  receiving 5 year visas, never breaking the stay period, with no problem. I've gone through immigration with no problem till my last time in London. I was stopped for eight hours and questioned about a run with the law while I was in college. This was in the US, I was around 20, it was for a credit card use. I received a conditional discharge / probation conviction which was discharged one year later. It was stupid, I was young and in college, more than 28 years ago.  After being questioned about the issue in the US, I was allowed in. They were very polite and professional.  I was also asked if I ever changed my name: I did not change it, but one letter was added in the middle of my first and last names around 20 years ago as our names are translated from Arabic to English and before the digital biometric passports, hand written passports some times varied. It was a common thing at the time.  Now I am applying for my new 5 year visas and I intend to answer truthfully  about previous conviction (previously I answered no because my conviction was spent and I expunged my record.) I want to answer yes and explain it. Is that the right thing to do?  Should I answer yes to the question about having a different name even though it was something as simple as spelling Bryan instead of Brian or Teresa and Theresa -- not really changing it and never thought of it as a change.  I have an impeccable credit rating in the Uk and the last 28 years have never received a moving violation or ever had a run in with the law.  I made one mistake when I was very young but I am  very worried about how to go ahead. I believe honesty is the best approach, is it? Is "gift" accepted as a verb? I have always argued adamantly, as long as the issue has been around, that gift should never be used as a verb. However, someone whose English knowledge I quite respect disagrees.  I’ve done some searching and I haven’t found a consensus; should gifting be shunned? Does there exist a function $f: \mathbb{R} \to \mathbb{R}$ having the following properties?   $f(x) = 0$ for all $x \le 0$. $f(x) = 1$ for all $x \ge 1$. For $0 &lt; x &lt; 1$, $f$ is strictly increasing. $f$ is everywhere $C^\infty$. The sequence of $L^\infty$ norms $\langle \left\lVert f \right\rVert_\infty, \left\lVert f' \right\rVert_\infty, \left\lVert f'' \right\rVert_\infty, \dots \rangle$ is bounded.   If we impose only the first four conditions, there is : for $0 &lt; x &lt; 1$, define $f(x)$ by $$ f(x) = \frac{e^{-1/x}}{e^{-1/x} + e^{-1/(1-x)}} = \frac{1}{1 + e^{1/x - 1/(1-x)}} $$ However, the derivatives of this function appear to grow quite rapidly. (I'm not sure how to verify this, but it seems at least exponential to me.)  If such a function does not exist, what is the smallest order of asymptotic growth that the sequence $\langle \left\lVert f \right\rVert_\infty, \left\lVert f' \right\rVert_\infty, \left\lVert f'' \right\rVert_\infty, \dots \rangle$ can have? I'd like to colorize a cell based on its contents. 0 = red, 100 = green, and linearly interpolated between.  function LinInt(x){       var ss = SpreadsheetApp.getActiveSheet();   var cell = ss.getActiveRange();   var hue;   hue = (x/100)*120;    var color = HSVtoRGB(hue, 40, 100);   cell.setBackground(color);    return x;     }     function HSVtoRGB(h, s, v) {     var r, g, b, i, f, p, q, t;     if (h &amp;&amp; s === undefined &amp;&amp; v === undefined) {         s = h.s, v = h.v, h = h.h;     }     i = Math.floor(h * 6);     f = h * 6 - i;     p = v * (1 - s);     q = v * (1 - f * s);     t = v * (1 - (1 - f) * s);     switch (i % 6) {         case 0: r = v, g = t, b = p; break;         case 1: r = q, g = v, b = p; break;         case 2: r = p, g = v, b = t; break;         case 3: r = p, g = q, b = v; break;         case 4: r = t, g = p, b = v; break;         case 5: r = v, g = p, b = q; break;     }   return '#'+((b | g &lt;&lt; 8 | r &lt;&lt; 16) / 0x1000000).toString(16).substring(2); }   When I do this I get an error saying that I am not allowed to call setBackground. I assume this is because I'm not allowed to change the color of one cell from another because I'm screwing up getting the current cell that the function is running in.  How do I get the cell that the function is running in so that I can call setBackground() on it?  For example, I'd like to type =LinInt(50) into cell A1 and have A1 be yellow and have the number 50 in it. Then when I type =LinInt(100) into cell A2 it is green and has the number 100 in it. How do I update Custom Label's value using apex? Which one would be a better option metadata api or tooling api? Please provide example I'am working on post deployment automation process in salesforce. I am stuck on how should I update values in custom labels which needs tobe updated manually after a sandbox refresh.