My command is:  tac some_directory/*.pre | grep -im1 "vdr" | cut -c129-140     Output is:    1.710577E-03     I want the output to be:    1.71   How can I achieve this in the shell command?
Using echo "20+5" literally produces the text "20+5".  What command can I use to get the numeric sum, 25 in this case?  Also, what's the easiest way to do it just using bash for floating point? For example, echo $((3224/3807.0)) prints 0 :(.  I am looking for answers using either the basic command shell ('command line') itself or through using languages that are available from the command line.
Testing for coefficients significance in Lasso logistic regression [A similar question was asked  with no answers] I have fit a logistic regression model with L1 regularization (Lasso logistic regression) and I would like to test the fitted coefficients for significance and get their p-values. I know Wald's tests (for instance) are an option to test the significance of individual coefficients in full regression without regularization, but with Lasso I think further problems arise which do not allow to apply the usual Wald formulas. For instance, the variance estimates neded for the test do not follow the usual expressions. The original Lasso paper:  suggests a bootstrap-based procedure to estimate the coefficients variance, which (again, I think) may be needed for the tests (section 2.5, last paragraph of page 272 and beginning of 273):  One approach is via the bootstrap: either $t$ can be fixed or we may optimize over $t$ for each bootstrap sample. Fixing $t$ is analogous to selecting the best subset (of features) and then using the least squares standard error for that subset  What I understand is: fit a Lasso regression repeatedly to the whole dataset until we find the optimal value for the regularization parameter (this is not part of the bootstrap), and then use only the features selected by the Lasso to fit OLS regressions to subsamples of the data and apply the usual formulas to compute the variances from each of those regressions. (And then what should I do with all those variances of each coefficient to get the final variance estimate of each coefficient?) Furthermore, is it correct to use the usual significance tests (for instance Wald's test which makes use of the estimated betas and variances) with the Lasso estimates of the coefficients and the bootstrap-estimated variances? I am fairly sure it is not, but any help (use a different test, use a more straightforward approach, whaterever...) is more than welcome. According to the answers  I suspect inference and p-values just cannot be obtained. In my case, p-values are an external requirement (although the use of L1 regularization was my choice). Thanks a lot EDIT What if I fit an OLS logistic regression using only the variables selected by a previous run of the Lasso logistic regression? Apparently (see ),  There's no need to run the model again after doing cross-validation (you just get the coefficients from the output of cv.glmnet), and in fact if you fit the new logistic regression model without penalisation then you're defeating the purpose of using lasso  But what if I do this with the sole purpose of being able to compute p-values while keeping the number of variables low? Is it a very dirty approach? :-) TZInfo::DataSourceNotFound error starting Rails v4.1.0 server on Windows Where do Orc babies come from? I've not seen/read any female Orcs mentioned in the movies or in the books. In one of the movies, an Uruk-hai is momentarily shown emerging from a giant, grown-Orc sized flesh packet. So are they created with spells, or do they follow the Standard Reproductive Model. I have an unused copy of Mass Effect 2 Collector's Edition bought via Amazon.com in the US, including a special code for Inferno Armour (also unused).  Will it work fine if I install and start playing the game in the UK? Does geographical location matter?  Thanks! How should I parse user input in a text adventure game? Parsing user commands in a text adventure is a spectrum from 's simple "go north" to some mind-bogglingly clever ones in .  I seem to remember reading nice how-tos in computer magazines back in the 80s, but now I find almost nothing on the 'net except a .  How would you do it?    Update: I went with the simplest approach possible in . Why isn't my Minecraft LAN server working? Orthographic Camera Zooming In XNA I am using a spritebatch to render a board. I have created a camera class which can provide me a view and projection matrix. Currently I am supplying the view matrix to my sprite batch when I call begin.  I can get the view matrix to correctly move everything around and do some zooming in and out. My problem is that I want to zoom in on a specific point (for now the center of the screen) but currently zooming just zooms in on the coordinate 0,0.   Here is how I am constructing the view matrix;          _ViewMatrix =             Matrix.CreateTranslation(                 new Vector3(                     (-_Position.X + _Width * _Zoom / 2),                     (-_Position.Y + _Height * _Zoom / 2),                     0) ) *             Matrix.CreateScale(new Vector3(_Zoom, _Zoom, 1));   How could this be altered to make it scale correctly relative to the given point. Later I will probably want to zoom to the mouse position, but if someone has a simple example I'm sure I can work out how to adapt it. What are bitwise shift (bit-shift) operators and how do they work? I've been attempting to learn C in my spare time, and other languages (C#, Java, etc.) have the same concept (and often the same operators) ...   What I'm wondering is, at a core level, what does bit-shifting (&lt;&lt;, &gt;&gt;, &gt;&gt;&gt;) do, what problems can it help solve, and what gotchas lurk around the bend? In other words, an absolute beginner's guide to bit shifting in all its goodness. Scientists have found mammoth blood, and are planning to   How does one go from having its blood to a full blown living mammoth? Is it possible?    Why does it matter if the blood is frozen or not? Suppose one found dinosaur blood, could one clone a dinsosaur (as in say 'Jurassic Park')? Proof of convergence of sequences Problem: Show that if $x_n\to 5$ then $\dfrac{x_n +1}{\sqrt{x_n -1}} \to 3$.  So I know $|x-5|&lt;\epsilon$ and I need to show that $\left|\dfrac{x_n +1}{\sqrt{x_n -1}} -3\right| &lt; \epsilon$.  I tried applying the triangle inequality (and a bit of algebra) to get $$\left|\frac{x_n +1}{\sqrt{x_n -1}} -3\right| \leq |x_n -5| \left |\frac{1}{\sqrt{x_n -1}}\right| + \left|\frac{6}{\sqrt{x_n-1}} -3\right|.$$  From this I know that $|x_n -5| &lt;\epsilon$ and can show that $\left |\dfrac{1}{\sqrt{x_n -1}}\right|&lt;1$. So my only problem is the second part of the sum. I have no idea what to do with it to get everything to be less than $\epsilon$. Can I travel in UK before switching to a study visa? As I read in general visitor visa Terms &amp; Condition, I would only be granted to stay up to 6 months in UK. However I am planning to apply for General Student Visa to further my studies. Would it be possible for me to enter UK as visitor for first 6 months/less before I apply for student visa in the same year if I want to travel and study on the same year? How to write zero in the unary numeral system In the decimal system: $...-3, -2, -1, 0, 1, 2, 3...$ In the binary system: $...-11, -10, -1, 0, 1, 10, 11...$ In the unary system: $-111, -11, -1, \text{ ??? }, 1, 11, 111...$   I was only able to find a related question but none with an answer so far: What training do doctors/Healers receive above their school education?   A fresh Hogwarts graduate does not seem to have all the skills required to be a Healer, so s/he would need to be learning those skills somehow/someplace. So how/where do they get those skills?  Also, there is one instance of a doctor being praised for inventing a healing spell. Is there any research system, like funding, trials etc or any other source of innovation? When to use LinkedList over ArrayList in Java? I've always been one to simply use:  List&lt;String&gt; names = new ArrayList&lt;&gt;();   I use the interface as the type name for portability, so that when I ask questions such as these I can rework my code.    When should  be used over  and vice-versa? Is there a feasible way to take a one year break from a IT job and work as a crew member on a big ship? How can one go about this? I am a recreational sailor and know intermediate sailing, coastal navigation, radio handling and all that stuff. I think this could be the experience of a life time. Where should  I look? I imagine getting it would be hard since obviously this is a lucrative job. Is it possible to duplicate eyes? This question contains spoilers for anime viewers and early manga viewers.      When Nagato was revived with Edo Tensei, he had Madara's eyes. When Madara was revived, he had his original eyes too (Rinnegan, much like Nagato).   Is this exploitable? Can I repeat this cycle of transplant and revive to duplicate strong eyes? How does that work really? How to exceed left margin with longtable I'm trying to make a longtable that is wider than the textwidth at a certain moment. I've tried different things always ending up with a different problem:  First possibility: If I use the adjustwidth environment the longtabu does not align correctly. The left margin stays fixed and the right margin gets out of the page. This in contrast, if I do the exact same thing to make a tabu (instead of longtabu), it works perfectly. I think using the adjustwidth is the best way to go, but I can't manage to get it working.  Second possibility: I've found a solution using the fullwidth package. That package does the trick on small longtables, but freezes when I'm trying to do it on my big longtable. The command \setlength\LTleft{-2cm} didn't work as well.  The final option I tried was to use geometry. But that changes the margin of the whole page thus making a page break which I'm not interested in. The code I used for this was  \newgeometry{left=1.2cm} \begin{longtable} long table stuff \end{longtable} \restoregeometry   Here's an example of what I want contra what I get  \documentclass[a4paper]{article} \usepackage{longtable} \usepackage{chngpage} \usepackage{lipsum} \usepackage{tabu}  \begin{document} \section{This is the original textwidth.} \lipsum[1]  \section{This is the width I need for my longtabu} \begin{adjustwidth}{-1in}{-1in} \begin{tabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{tabu} \end{adjustwidth}  \section{This is what happens} \begin{adjustwidth}{-1in}{-1in} \begin{longtabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{longtabu} \end{adjustwidth}  \end{document} Do you get Hex Warrior's Cha bonus with a two-handed Pact Weapon? Hex Warrior says:     you can touch one weapon with which you are proficient and that lacks the two-handed quality. When you attack with that weapon you can use your Charisma for attack and damage rolls.   later the ability says:     This benefit extends to every weapon conjured with the Pact of Blades feature, no matter the type.   (emphasis mine)  Does this allow me to use my charisma with 2 handed weapons(provided it is my Pact Weapon and my Hex Warrior Blade)?  This question is not the same as . That one is asking how many weapons, I'm asking if type means 2 handed or something else(Slashing or Ranged for examples). Solving $f(x+y) = f(x)f(y)f(xy)$ biblatex: \parencite in note field prints spurious ; with authoryear-icomp style