The following lsblk command print the disk usage in bytes   lsblk -bio KNAME,TYPE,SIZE,MODEL| grep disk    sda   disk  298999349248 AVAGO  sdb   disk 1998998994944 AVAGO  sdc   disk 1998998994944 AVAGO  sdd   disk 1998998994944 AVAGO  sde   disk   98998994944 AVAGO   how to print the disks when disk is greater than 300000000000 , by adding after the pipe awk or perl one-liner or else  expected output:   lsblk -bio KNAME,TYPE,SIZE,MODEL| grep disk | ......  sdb   disk 1998998994944 AVAGO  sdc   disk 1998998994944 AVAGO  sdd   disk 1998998994944 AVAGO
I need to remove every line that has a value of 2 or less in the 8th field (column).   My data looks like this:  12-31   Airport 189 379 41  49.70946503 -124.91377258   2   2880    30.8 01-01   AlberniElementary   165 331 16  49.26100922 -124.80662537   4   5760    26.1 01-09   BamfieldMarine  161 323 23  48.83490372 -125.13572693   2   2875    27.4 01-10   BamfieldMarine  161 323 23  48.83490372 -125.13572693   3   3068    38.6   I understand that using awk I can strip off the values desired and print them to another file, and I understand that sed would edit the current file. In either case, I need to retain the original file.   Note: Please provide thorough explanations with your solutions. It is not suffice to just write the command, please annotate suggestions.   Further note: The data has a header line, so most likely solution will need to      awk 'FNR >1'   I suppose?
Some people have a diamond after their username (e.g. )    What special privileges do diamond moderators have? How can I become a diamond moderator? Who are the diamond moderators?  How many are there?      For more information, see  in the .     Note: not to confuse with certain Stack Exchange employees, for example  members or "community managers", who often have diamonds as well, but are not ordinary moderators. I was writing some Unit tests last week for a piece of code that generated some SQL statements.  I was trying to figure out a regex to match SELECT, INSERT and UPDATE syntax so I could verify that my methods were generating valid SQL, and after 3-4 hours of searching and messing around with various regex editors I gave up.  I managed to get partial matches but because a section in quotes can contain any characters it quickly expands to match the whole statement.  Any help would be appreciated, I'm not very good with regular expressions but I'd like to learn more about them.  By the way it's C# RegEx that I'm after.  Clarification  I don't want to need access to a database as this is part of a Unit test and I don't wan't to have to maintain a database to test my code. which may live longer than the project. What are the requirements for a (beta) site logo? How can I make LightDM the default display manager? I have LightDM installed and can start it with sudo start lightdm. But at boot, GDM is still the default. How can change this so LightDM is loaded automatically at boot instead of GDM? Gradient Boosting for Linear Regression - why does it not work? In "Knots and Primes: An Introduction to Arithmetic Topology", the author uses the following proposition   Let $h: Y \to X$ be a covering. For any path $\gamma : [0,1] \to X$ and any $y \in h^{-1}(x) (x = \gamma(0))$, there exists a unique lift $\hat{\gamma} : [0,1] \to Y$ of $\gamma$ with $\hat{\gamma}(0) = y$. Furthermore, for any homotopy $\gamma_t (t \in [0,1])$ of $\gamma$ with $\gamma_t = \gamma(0)$ and $\gamma_t(1) = \gamma(1)$, there exists a unique lift of $\hat{\gamma_t}$ such that $\hat{\gamma_t}$ is the homotopy of $\hat{\gamma}$ with $\hat{\gamma_t}(0) = \hat{\gamma}(0)$ and $\hat{\gamma_t}(1) = \hat{\gamma}(1)$.  The author then follows with; "In the following, we assume that any covering space is connected. By the preceding proposition, the cardinality of the fiber $h^{-1}(x)$ is independent of $x \in X$."   I am not sure why this results is true. This is my attempt at explaining it to myself. Take two different $x_1, x_2$ and their fibers $h^{-1}(x_1), h^{-1}(x_2)$ such that $y_1 \in h^{-1}(x_1)$ and $y_2 \in h^{-1}(x_2)$. Take two paths $\gamma_1, \gamma_2$ such that $\gamma_1(0) = x_1$ and $\gamma_2(0) = x_2$. Then we get two lifts $\hat{\gamma_1}, \hat{\gamma_2}$ with $\hat{\gamma_1}(0) = y_1$ and $\hat{\gamma_2}(0) = y_2$. Now, since our covering space is connected we can continuously deform $\hat{\gamma_1}$ into $\hat{\gamma_2}$ and conclude that every elements in $h^{-1}(x_1)$ is also in $h^{-1}(x_2)$ and vice versa. I feel that this is wrong but cannot figure out the right way to see this. Any help would be appreciated. I was so excited about the Spring '14  as a way to present data visualizations on a public site, and now it looks like that's not possible.  I created a page that looks basically like the release notes sample:  &lt;apex:page &gt;     &lt;analytics:reportChart reportId="00OW0000000Spru"&gt;&lt;/analytics:reportChart&gt; &lt;/apex:page&gt;   I tested it inside the authenticated environment, where it works fine, then added it to a Site. There, I get the error: To view the report chart, you need both the Run Reports permission and access to the report's folder. But, Run Reports is not a permission I can grant to the Site Guest User.  Anybody have any ideas for a workaround? Or is it not going to be possible to show report charts on a public site? Capturing image from webcam in java? How can I continuously capture images from a webcam?  I want to experiment with object recognition (by maybe using java media framework).   I was thinking of creating two threads  one thread:   Node 1: capture live image Node 2: save image as "1.jpg" Node 3: wait 5 seconds Node 4: repeat...   other thread:   Node 1: wait until image is captured Node 2: using the "1.jpg" get colors from every pixle Node 3: save data in arrays Node 4: repeat... Can I use a card with "Add one mana of any color to your mana pool" in any Elder Dragon Highlander (EDH) deck? I recently tried /, and found it to be a ton of fun.  I've started customizing one of the pre-cons I got, but I'm a little confused by some of the deck-building requirements.  According to the deck-building rules:   A card's color identity is its color plus the color of any mana symbols in the card's rules text. A card's color identity is established before the game begins, and cannot be changed by game effects. Cards in a deck may not have any colors in their identity which are not shared with the commander of the deck. (The identity of each card in the deck must be a subset of the General's)    If I'm using  as my general, my deck's identity is Red, Blue and Green.  I couldn't use  in my deck, because it has a black mana symbol in the rules text.  My question is:  can I add a card to my deck that has the phrase "Add one mana of any color to your mana pool" (such as  or )?  Even though those cards could conceivably add black mana to my mana pool, they don't have a black or white (or any for that matter) mana symbol in their rules text, so they would be valid for inclusion in any deck? Thermistor control of peltier voltage with Arduino (for DSLR chill box project) I am mildly familiar with electronics, mostly from playing around with electronics kits as a kid. That was a long time ago, though, maybe as much as 20 years ago. I am currently working on a cold or "chill" box for my Canon 5D III, so I can keep it's temperature very low, and very consistent, for doing low noise astrophotography.  I have a general design for the box, and I'm using a single 12v 5.8amp peltier (TEC) attached directly to a copper box for cooling. The box is currently insulated with extruded foam board, and the hot plate of the peltier will be cooled with a water cooler from an old computer kit.   I'm getting more ambitious with my project, however. I want thermal regulation, to maintain a consistent temperature, and I'd eventually like to get into two-stage cooling to achieve a Delta-T of closer to -55-60°C relative to ambient (the chill box will be cooling the camera, so the sensor will be warmer, probably by as much as 10°C, than the temperature of the copper plating in the box itself.) I want to have two primary modes:   Rapid cooling mode, operating the peltier at 12v or higher (max voltage is 15.4v) to quickly cool the box down to the target temperature. Regulated maintenance mode, operating the peltier at lower voltages to maintain a consistent temperature, above the maximum potential cooling the peltier can supply (for headroom as the voltage is adjusted in response to small temperature fluctuations).   I'd like to maintain temperature within 2-3°C if possible. I've looked into Arduino (and I've messed with similar things in the past), and it seems perfectly ideal for the task, with one exception: It doesn't seem to handle the kind of current I need top power a single peltier, and certainly not two.   I've done some research on how I might achieve this, but I'm falling up short on my understanding of the electronics involved. I've found a two-relay "shield" for Arduino Uno that can power two devices with up to 8amps each, and up to 30v each. That can be controlled from the Arduino itself. It seems the design of a relay uses a magnetic coil to actuate a switch that allows an independent power source to be used to power components like a motor, solenoid, or in my case a peltier. I haven't found any way of actually regulating the voltage of the relay with the Arduino, however.  So I kept investigating, and I came across some schematics that showed how to use transistors, specific mosfets to be exact, where the base was connected to an Arduino output, and the collector/emitter were connected to the power loop of whatever needed to be powered at a higher voltage (not sure about current here), and this still allowed control of the voltage.   It's been so long since I messed with any of these components, my memory is extremely rough, and I'm not quite connecting how it all works. I'd be happy with some references to complete examples of powering, and controlling the voltage of, high powered devices via an Arduino, but if anyone here can explain how all this works and why, that would be most ideal. I'd rather understand the concepts, so I can reapply them later, than just have a pattern to follow. Every closed subset $E\subseteq \mathbb{R}^n$ is the zero point set of a smooth function In Walter Rudin's Principles of mathematical analysis Exercise 5.21, it is proved that for any closed subset $E\subseteq \mathbb{R}$, there exists a smooth function $f$ on $\mathbb{R}$ such that $E=\{x\in \mathbb{R}\mid f(x)=0\}$.   Since $E^c$ is open in $\mathbb{R}$, $E^c$ is a countable disjoint union of open intervals $(a_i,b_i)$. On an interval $(a,b)$, if we let $f(x)=\exp(\frac{1}{(x-a)(x-b)})$, $x\in(a,b)$; $f(x)=0$, $x\notin(a,b)$, ($f(x)=\exp(\frac{1}{(x-a)})$ or $f(x)=\exp(\frac{1}{(x-b)})$ on $(a,\infty)$ and $(-\infty,b)$ resp.), then $f$ is smooth. Hence we can get a smooth function on $\mathbb{R}$ such that $E$ is the zero point sets of $f$.  (1). How about a closed subset $E$ of $\mathbb{R}^n$? is it true that for any closed subset $E\subseteq \mathbb{R}^n$, there exists a smooth function $f$ on $\mathbb{R}^n$ such that $E=\{x\in \mathbb{R}^n\mid f(x)=0\}$?  An open set in $\mathbb{R}^n$ cannot be written as a disjoint union of countable open balls hence the proof above is not valid. The partition of unity only claims that for an  open set $U$, there exists open $V$ in $U$ such that $\bar V\subseteq U$ and a smooth function $f$ on $\mathbb{R}^n$ such that $supp f\subseteq U$, $f|_V=1$.   (2). The taylor series of $f(x)=\exp(\frac{1}{(x-a)(x-b)})$ does not converge around points $a,b$ hence $f$ is not analytic at $a,b$. Is it true that for any closed subset $E\subseteq \mathbb{R}$, there exists an analytic function $f$ on $\mathbb{R}$ such that $E=\{x\in \mathbb{R}\mid f(x)=0\}$? How do I read an entire file into a std::string in C++? How do I read a file into a std::string, i.e., read the whole file at once?  Text or binary mode should be specified by the caller. The solution should be standard-compliant, portable and efficient. It should not needlessly copy the string's data, and it should avoid reallocations of memory while reading the string.  One way to do this would be to stat the filesize, resize the std::string and fread() into the std::string's const_cast&lt;char*&gt;()'ed data(). This requires the std::string's data to be contiguous which is not required by the standard, but it appears to be the case for all known implementations. What is worse, if the file is read in text mode, the std::string's size may not equal the file's size.  A fully correct, standard-compliant and portable solutions could be constructed using std::ifstream's rdbuf() into a std::ostringstream and from there into a std::string. However, this could copy the string data and/or needlessly reallocate memory.    Are all relevant standard library implementations smart enough to avoid all unnecessary overhead?  Is there another way to do it?  Did I miss some hidden Boost function that already provides the desired functionality?     void slurp(std::string&amp; data, bool is_binary) align vs equation Proving that an integral domain has at most two elements that satisfy the equation $x^2 = 1$. Refer to the "name" of an equation, while a List of Equations is generated using these names What is wrong with defining \bal as \begin{align}? I'm trying to define two commands \bal and \eal instead of inserting \begin{align} and \end{align} in my document, but in the code below, I'll get some errors. What is wrong with it?    \documentclass{article} \usepackage{amsmath} \makeatletter  \newcommand{\bal}{%  \begingroup  \align% \@ifstar{\nonumber}{}%  }  \newcommand{\eal}{\endalign\endgroup} \makeatother \begin{document} \bal* x=y \eal ‎\end{document} Feynman diagram for attractive forces "Delete this answered question?" when the only answer is deleted Looks like there's a small bug in the UI: I posted a question here on meta.SE which ended up being just something dumb I was doing and no use to anyone in the future. At first I posted an answer saying what the dumb thing was, but then I realized that the whole thing had no value, so I deleted the answer, and then deleted the question — whereupon it asked me:  Delete this answered question? We do not recommend deleting questions with answers because doing so deprives future readers of this knowledge. Repeated deletion of answered questions can result in your account being blocked from asking. Are you sure you wish to delete?  (Screenshot below) Probably shouldn't ask (or add to the tally) if the only answers are deleted ones... Can a free particle absorb/emit photons? Imagine you're teaching a first course on quantum mechanics in which your students are well-versed in classical mechanics, but have never seen any quantum before.  How would you motivate the subject and convince your students that in fact classical mechanics cannot explain the real world and that quantum mechanics, given your knowledge of classical mechanics, is the most obvious alternative to try?  If you sit down and think about it, the idea that the state of a system, instead of being specified by the finitely many particles' position and momentum, is now described by an element of some abstract (rigged) Hilbert space and that the observables correspond to self-adjoint operators on the space of states is not at all obvious.  Why should this be the case, or at least, why might we expect this to be the case?   Then there is the issue of measurement which is even more difficult to motivate.  In the usual formulation of quantum mechanics, we assume that, given a state $|\psi \rangle$ and an observable $A$, the probability of measuring a value between $a$ and $a+da$ is given by $|\langle a|\psi \rangle |^2da$ (and furthermore, if $a$ is not an eigenvalue of $A$, then the probability of measuring a value in this interval is $0$).  How would you convince your students that this had to be the case?  I have thought about this question of motivation for a couple of years now, and so far, the only answers I've come up with are incomplete, not entirely satisfactory, and seem to be much more non-trivial than I feel they should be.  So, what do you guys think?  Can you motivate the usual formulation of quantum mechanics using only classical mechanics and minimal appeal to experimental results?  Note that, at some point, you will have to make reference to experiment.  After all, this is the reason why we needed to develop quantum mechanics.  In principle, we could just say "The Born Rule is true because its experimentally verified.", but I find this particularly unsatisfying.  I think we can do better.  Thus, I would ask that when you do invoke the results of an experiment, you do so to only justify fundamental truths, by which I mean something that can not itself just be explained in terms of more theory.  You might say that my conjecture is that the Born Rule is not a fundamental truth in this sense, but can instead be explained by more fundamental theory, which itself is justified via experiment.  Edit:  To clarify, I will try to make use of a much simpler example.  In an ideal gas, if you fix the volume, then the temperature is proportional to pressure.  So we may ask "Why?".  You could say "Well, because experiment.", or alternatively you could say "It is a trivial corollary of the ideal gas law.".  If you choose the latter, you can then ask why that is true.  Once again, you can just say "Because experiment." or you could try to prove it using more fundamental physical truths (using the kinetic theory of gases, for example).  The objective, then, is to come up with the most fundamental physical truths, prove everything else we know in terms of those, and then verify the fundamental physical truths via experiment.  And in this particular case, the objective is to do this with quantum mechanics.