I have seen solutions of splitting a file with respect to pattern matching and line matching but what I want is the following.  The scenario is, let's say I have a file file1  -   A.B|100|20 A.B|101|20 A.X|101|30 A.X|1000|20 B.Y|1|1   Now I want to split this file into 3 different files just based on the first column where the 1st file would be all the lines containing A.B in the first column, the 2nd file should have all the lines with A.X and so on.  If the first column changes in  any way, there should be a new file created for those lines. Is there any way of doing it with bash  or awk?  Since there is no way of actually knowing before hand what the first column value is, I wasn't able to use any feature like split or cut. Thanks for the help in advance!
We will generate a csv file with below values  yp1234,577,1,3 yp5678,577,3,5 yp9012,132,8,9   I need to extract data and create files based on second column. If it's 577 then the whole line has to be extracted and placed in a separate file. I mean I need a file having lines with second column as 577 alone and another file with second column as 132 alone  I tried using IF but didn't work
Show $4x^2+6x+3$ is a unit in $\mathbb{Z}_8[x]$ (inverting unit + nilpotent) Show that $4x^2+6x+3$ is a unit in $\mathbb{Z}_8[x]$.  Once you have found the inverse like , the verification is trivial. But how do you come up with such an inverse. Do I just try with general polynomials of all degrees and see what restrictions RHS = $1$ imposes on the coefficients until I get lucky? Also is there a general method to show an element in a ring is a unit? Global and local variables in R Should I use #define, enum or const? In a C++ project I'm working on, I have a flag kind of value which can have four values. Those four flags can be combined. Flags describe the records in database and can be:   new record deleted record modified record existing record   Now, for each record I wish to keep this attribute, so I could use an enum:  enum { xNew, xDeleted, xModified, xExisting }   However, in other places in code, I need to select which records are to be visible to the user, so I'd like to be able to pass that as a single parameter, like:   showRecords(xNew | xDeleted);   So, it seems I have three possible appoaches:  #define X_NEW      0x01 #define X_DELETED  0x02 #define X_MODIFIED 0x04 #define X_EXISTING 0x08   or  typedef enum { xNew = 1, xDeleted, xModified = 4, xExisting = 8 } RecordType;   or   namespace RecordType {     static const uint8 xNew = 1;     static const uint8 xDeleted = 2;     static const uint8 xModified = 4;     static const uint8 xExisting = 8; }   Space requirements are important (byte vs int) but not crucial. With defines I lose type safety, and with enum I lose some space (integers) and probably have to cast when I want to do a bitwise operation. With const I think I also lose type safety since a random uint8 could get in by mistake.  Is there some other cleaner way?  If not, what would you use and why?  P.S. The rest of the code is rather clean modern C++ without #defines, and I have used namespaces and templates in few spaces, so those aren't out of question either. Tikz, Tree without overlaps I am trying to include a figure into LaTeX from a paper originally created using MS Word. I have already converted all the text/equations into LaTeX but I can't figure out how to get the figures over without re-drawing them using LaTeX code (which I do not want to do). The image is a plain box (like a tabular) one row by 7 columns with numbers inside each cell. Then I inserted arrows of varying length above and below the box (several short ones and one much longer).    I am trying to use the  package with the \includegraphics command.   I copied the figure (box and arrows) from my original article into a blank Word doc. The figure only takes up the first 4 or 5 lines of the blank document. I then selected/highlighted the image and printed the selection using 'PDFCreator'. This allowed me to save the image as a .eps file. I then copied and pasted the eps file into the folder where all my .tex files are saved.  When I compile the document using pdftexify there is a blank space where the image should be. In the console I get the following message when I compile the document:  [27] &lt;Fig3-eps-converted-to.pdf, id =105, 391.4625pt x 74.2774pt&gt; &lt;use Fig3-eps-converted-to.pdf&gt; Overfull \hbox 1.46153pt too wide) in paragraph at lines 511--516 []   My code looks like this:  \documentclass[12pt]{article}  \usepackage{graphicx} \usepackage{epstopdf} \begin{document}  %Text  \includegraphics{fig3.eps}  %text  \end{document}   I have read the sections on graphics in 'LaTeX: A Document Preparation System' and 'The Not So Short Introduction to LaTeX2e' but I still can't figure this out. Should I maybe use a PNG image since it is a pretty basic figure? Any advice on how to properly transfer images from a word doc to .eps format and/or how to get those .eps files into LaTeX properly would be a huge help. Suppress SSL warnings I just installed Ubuntu 12.10 (amd64), and want to install a recent version of MySQL 5.6.  If possible, I would like to install (not upgrade) it the "Debian Way' (i.e., using apt-get or dpkg). Tensor product of a module with an ideal is isomorphic to their standard product This is my first question in /photography. I'm a very amateur photographer, doing things wrong and by eye with lots of trial-and-error all the time.  I currently own a reflex Nikon D70 my uncle gave us after he bought a better one. It has some nice settings, and he bought a a Nikkor 28-80mm F/3.5-5.6 zoom lens for it. It behaves nicely, but it's getting old (it has those old cartridges before SD cards existed) and every new charge takes longer than the last.  I'm planning to upgrade to a better camera, and there are some neat offers on a nearby superstore (MediaMarkt), this one catching my eye:  Sony DSC-H400 63x, Sensor Super HAD 1/2/3 CCD 20.1MP -> for less than 300€ taxes included  I don't have any type of extra information aside from that, all I can get from the official site is clinical data from other cameras that I suspect it's not 100% accurate, and there's no photography expert on the store to ask.  The common things I use my D70 for are: taking pictures of scenery (castles, towns, forests, waves hitting rocks, etc...), nearby (&lt;5m) persons and objects, and well, things where I want to save a memory in digital format, not for professional purposes at all.  Being that my objective is to have a decent, good-zooming (superzoom looks awesome), amateur (but with manual settings) camera, is this Sony a good replacement? Will I miss any features? Is there any better, similarly-priced alternative you know of?  Basically, I want to know whether I will get better quality photos than I currently do, given the examples, with any averagely-priced bridge camera similar to that Sony, and if it's worth it.  examples of current camera results  Full zoom-out of town at night, bad quality I know; notice the pink blur at the left.    Maximum zoom on that pink blur from almost the same spot:    Daylight, cloudy, modified with Adobe Lightroom, scenery:    Same day, same beach, different settings:    Same day, same beach, rocks: Most efficient way of booking academic supervision appointments I'm wondering if there's a more efficient method of booking an academic supervision appointment. The method I experienced was a schedule on the professor's door, first-come-first-serve.   How do we employ technology that is the most efficient (reduces scheduling time, permitting all students to view sign ups)? Prove that a product of two complex numbers has zero imaginary part This is my homework, which reads as follows: Let $z_1, z_2$ be complex numbers.  Prove that when $z_1z_2 \neq -1$ and $|z_1| = |z_2| = 1$, then the imaginary part of $$ \frac{z_1 + z_2}{1 + z_1z_2} $$ is zero.  I've tried to approach this in several ways, but whichever one I try, at some point the expression gets too large and doesn't simplify (at least I cannot find a way to simplify it).  The way I tried to approach this problem is to:   Set $z_1 = a+bi$, $z_2 = c+di$, then $z_1+z_2=(a+c)+(b+d)i$, and in polar form, $\sqrt{(a + c)^2 + (b + d)^2}\times (\cos\theta + i\sin\theta)$, $\tan \theta = \frac{b+d}{a+c}$. Find $\tan \phi$, where $\phi$ is the angle of $\frac{1}{1 + z_1z_2}$. Substitute into $\tan(\theta + \phi) = \frac{\tan(\theta)+\tan(\phi)}{1-\tan(\theta)\tan(\phi)} = 0$.   The problem is $\tan(\phi)$ is a huge expression, and I cannot get it to simplify, so I cannot also show that the last formula is actually true.  Since this is a homework, and we are expected to do this with pan and paper (not even a calculator...), I don't believe we are to do this many calculations by hand.  Hence, there must be some "trick" to get this to simplify, or a completely different approach.  Would you care to give me a hint? How to model an entity type that can have different sets of attributes? Proving the determinant of a tridiagonal matrix with $-1, 2, -1$ on diagonal. Let $A_n$ denote an $n \times n$ tridiagonal matrix.  $$A_n=\begin{pmatrix}2 &amp; -1 &amp; &amp; &amp; 0 \\ -1 &amp; 2 &amp; -1 &amp; &amp; \\ &amp; \ddots &amp; \ddots &amp; \ddots &amp; \\ &amp; &amp; -1 &amp; 2 &amp; -1 \\ 0 &amp; &amp; &amp; -1 &amp; 2 \end{pmatrix} \quad\text{for }n \ge 2$$  Set $D_n = \det(A_n)$  Prove that $D_n = 2D_{n-1} - D_{n-2}$ for $n \ge 4$. Check if element found in array c++ Problem 1.1.5 from Hatcher's I want your advice on my solution of this problem.  problem  Show that for a space $X$, the following three are equivalent:  (a) Every map $S^1 \rightarrow X$ is homotopic to a constant map, with image a point.  (b) Every map $S^1 \rightarrow X$ extends to a map $D^2 \rightarrow X$.  (c) $\pi_1(X,x_0)=0$ $\forall x_0 \in X$.  my solution  $(c) \rightarrow (a)$: Take a map $f:S^1\rightarrow X$, and the constant loop at $x_0$ (which from (c) we know there's only this loop), and take the linear homotopy connecting $f$ and $x_0$.  $(b)\rightarrow (c)$: I am not sure if this is right, but I want somehow to induce some isomorphism from $\pi_1(D^2,y_0)$ to $\pi_1(X,x_0)$ in which case we'll get the required result. So I argued that we take as a map the extension of a map $S^1\rightarrow X$ to a map $D^2\rightarrow X$, but I don't see how to argue that the last map is homeomorphism, any advice?  $(a) \rightarrow (b)$: I am given $f:S^1\rightarrow X$, and it's homotopic to some point $x_0$, so I thought to extend $f$ on the whole ball, by defining the map: $g(x)= f(x)$ if $|x|=1$ and $g(x)=x_0$ if $|x|&lt;1$.  Is any of what I typed right, what do I need to amend?  Thanks. Extreme learning machine: what's it all about? I've been thinking about, implementing and using the Extreme Learning Machine (ELM) paradigm for more than a year now, and the longer I do, the more I doubt that it is really a good thing. My opinion, however, seems to be in contrast with scientific community where -- when using citations and new publications as a measure -- it seems to be a hot topic.  The ELM has been introduced by  around 2003. The underlying idea is rather simple: start with a 2-layer artificial neural network and randomly assign the coefficients in the first layer. This, one transforms the non-linear optimization problem which is usually handled via backpropagation into a simple linear regression problem. More detailed, for $\mathbf x \in \mathbb R^D$, the model is  $$ f(\mathbf x) = \sum_{i=1}^{N_\text{hidden}} w_i  \, \sigma\left(v_{i0} + \sum_{k=1}^{D} v_{ik} x_k \right)\,.$$  Now, only the $w_i$ are adjusted (in order to minimize squared-error-loss), whereas the $v_{ik}$'s are all chosen randomly. As a compensation for the loss in degrees-of-freedom, the usual suggestion is to use a rather large number of hidden nodes (i.e. free parameters $w_i$).  From another perspective (not the one usually promoted in the literature, which comes from the neural network side), the whole procedure is simply linear regression, but one where you choose your basis functions $\phi$ randomly, for example  $$ \phi_i(\mathbf x) = \sigma\left(v_{i0} + \sum_{k=1}^{D} v_{ik} x_k \right)\,.$$  (Many other choices beside the sigmoid are possible for the random functions. For instance, the same principle has also been applied using radial basis functions.)  From this viewpoint, the whole method becomes almost too simplistic, and this is also the point where I start to doubt that the method is really a good one (... whereas its scientific marketing certainly is). So, here are my questions:   The idea to raster the input space using random basis functions is, in my opinion, good for low dimensions. In high dimensions, I think it is just not possible to find a good choice using random selection with a reasonable number of basisfunctions. Therefore, does the ELM degrade in high-dimensions (due to the curse of dimensionality)? Do you know of experimental results supporting/contradicting this opinion? In the linked paper there is only one 27-dimensional regression data set (PYRIM) where the method performs similar to SVMs (whereas I would rather like to see a comparison to a backpropagation ANN) More generally, I would like to here your comments about the ELM method. Should outdated answers be voted down? On Stack Overflow, there are many questions that relate to currently-developing technologies such as HTML5 and CSS3. The accepted answers to these questions may become outdated, and better answers may appear. However, because the answers are accepted, it is likely that they will continue to be upvoted by users reading the answers, and the OP will likely not notice that a better, more up-to-date answer may exist.  Should these outdated answers be voted down? If not, what should we do with them? I noticed that some Indian languages (eg : Kannada) are not supported in Ubuntu 16.04.  See this screenshot:    Even with file names :    This was not happening in earlier Ubuntu editions. How can I enable kannada in Ubuntu 16.04? How to automatically fetch missing dependencies when installing software from .deb? I'm trying to install  on my Ubuntu box (11.04). The website has a Ubuntu .deb available for download (for 10.10 and 10.04 so I chose 10.10).   However,   sudo dpkg -i mysql-workbench-gpl-5.2.34-1ubu1010-amd64.deb   yields:  (Reading database ... 194069 files and directories currently installed.) Preparing to replace mysql-workbench-gpl 5.2.34-1ubu1010 (using mysql-workbench-gpl-5.2.34-1ubu1010-amd64.deb) ... Unpacking replacement mysql-workbench-gpl ... dpkg: dependency problems prevent configuration of mysql-workbench-gpl:  mysql-workbench-gpl depends on libctemplate0; however:   Package libctemplate0 is not installed.  mysql-workbench-gpl depends on libpython2.6 (&gt;= 2.6); however:   Package libpython2.6 is not installed.  mysql-workbench-gpl depends on libzip1 (&gt;= 0.8); however:   Package libzip1 is not installed.  mysql-workbench-gpl depends on python-paramiko; however:   Package python-paramiko is not installed.  mysql-workbench-gpl depends on python-pysqlite2; however:   Package python-pysqlite2 is not installed. dpkg: error processing mysql-workbench-gpl (--install):  dependency problems - leaving unconfigured Processing triggers for bamfdaemon ... Rebuilding /usr/share/applications/bamf.index... Processing triggers for desktop-file-utils ... Processing triggers for python-gmenu ... Rebuilding /usr/share/applications/desktop.en_US.utf8.cache... Processing triggers for python-support ... Errors were encountered while processing:  mysql-workbench-gpl   My question is, is there a way to tell dpkg to automatically fetch missing dependencies, or do I need to manually apt-get install missing packages like libctemplate0 and  libpython2.6?   (Or alternatively, is there some other way to get MySQL Workbench easily up &amp; running?) How to show that every Boolean ring is commutative?