I have this example script:  &lt;?php     $time = time();     shell_exec('nohup sleep 30 2&gt;/tmp/test &gt;/tmp/test &amp;');     $time2 = time();     echo $time2 - $time; ?&gt;   when I run it for the first time it show immediately 0 , but when I run it for the second time it wait for the sleep command to finish the it shows the 0. what should i do to make it run immediately without waiting for the sleep command ?
I've got a PHP script that needs to invoke a shell script but doesn't care at all about the output. The shell script makes a number of SOAP calls and is slow to complete, so I don't want to slow down the PHP request while it waits for a reply. In fact, the PHP request should be able to exit without terminating the shell process.  I've looked into the various exec(), shell_exec(), pcntl_fork(), etc. functions, but none of them seem to offer exactly what I want. (Or, if they do, it's not clear to me how.) Any suggestions?
I've just made a minor alteration to a file from a TeX package.  I copied it into my local texmf tree and made the change there.  When I tried kpsewhich &lt;filename&gt; to test that it was finding my local version, it returned the original one and not the new one.  In actual fact, the original file was from my local texmf tree already so I renamed the old one something simple.  Now kpsewhich &lt;filename&gt; returned the system version of the file.  To check that the file was there, I tried kpsewhich -all &lt;filename&gt; and got the correct two versions of the file: my modified one and the system one (in that order).  If I try this with another file that I know exists in both places, then kpsewhich &lt;filename&gt; returns my local file.  Here's the various invocations and their results:  ~% kpsewhich pgfsys-pdftex.def /usr/local/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def ~% kpsewhich -all pgfsys-pdftex.def  /Users/stacey/Library/texmf/tex/latex/bzr/pgfsys-pdftex.def /usr/local/texlive/2012/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def ~% kpsewhich tqft.sty               /Users/stacey/Library/texmf/tex/latex/bzr/tqft.sty ~% kpsewhich -all tqft.sty /Users/stacey/Library/texmf/tex/latex/bzr/tqft.sty /usr/local/texlive/2012/texmf-dist/tex/latex/tqft/tqft.sty   Is it something special about the .def extension?  Is there some command that I forgot to run?  Are there some other options to kpsewhich that will help me debug this? In general, what is meant by saying that the fraction $x$ of the variance in an analysis like PCA is explained by the first principal component? Can someone explain this intuitively but also give a precise mathematical definition of what "variance explained" means in terms of principal component analysis (PCA)?  For simple linear regression, the r-squared of best fit line is always described as the proportion of the variance explained, but I am not sure what to make of that either. Is proportion of variance here just the extend of deviation of points from the best fit line? Make links posted by users open in a new window Most of the time when I follow a user's link, I just want to see their site, look it over, then return to answer their question (not leave SO completely and not come back). Could we make the links users post open in a new window please?  EDIT: I originally wanted this implemented because it's what some other sites did, but I now definitely prefer SO's way. If I want to open a new tab, I middle-click/control-click (or whatever); if not, I just click. I'm in control of what happens. Would never want to go back now. Microscopic interpretation of pressure in liquids Why don't self-closing script elements work? I've created main SELECT statement like below. For every row in Base table (base on IDKey I've added columns with values from result of INNER JOIN of few tables.  SELECT   IDKey,    Name,    (select Amount from Table1 INNER JOIN Table2 ... where ID=IDKey) AS AmountTypeX,    (select Amount from Table1 INNER JOIN Table2 ... where ID=IDKey) AS AmountTypeY FROM BaseTable   BaseTable:  IDKey Name  ---------- 1     Ian 2     John 3     Ann ...   INNER JOIN of few tables Table1, Table2... :   ID Amount Type -------------- 1  100    X 1  200    Y 2  300    X 2  400    Y 3  500    X 3  600    Y ...   Result looks like:  IDKey  Name  AmountTypeX  AmountTypeY ------------------------------------- 1      Ian   100          200 2      John  300          400 3      Ann   500          600 ...   Do you have any suggestion how to avoid this nested SELECT statements in the main query at the begining and made this query simpler and more effective ?  I wast thinking about PIVOTING of the INNER JOIN result to look like below (all data for particular ID in one row) and then JOIN with main query but Have no idea how to do this and is it possible.  ID  X   Y ----------- 1   100 200 2   300 400 3   500 600 ... I'm using Ubuntu 13.04 on a Lenovo X220.  Why do I have so many .Xauthority.* files in my home directory? I.e  .Xauthority .Xauthority.0JW6UW .Xauthority.2HWRVW .Xauthority.2TA6VW .Xauthority.49F8VW .Xauthority.4E27UW .Xauthority.7CLTVW .Xauthority.8JGGXW .Xauthority.96SAVW .Xauthority.AOUFVW .Xauthority.ASDOVW .Xauthority.CGVJXW .Xauthority.E0ZSVW .Xauthority.E5VZWW .Xauthority.FE64UW .Xauthority.FIHDWW .Xauthority.HL45VW .Xauthority.HYCCVW .Xauthority.ILUEWW .Xauthority.JXJHVW .Xauthority.K1QJXW .Xauthority.KXSOVW .Xauthority.LEKEVW .Xauthority.M48WVW .Xauthority.M6QTVW .Xauthority.MW6NWW .Xauthority.N57TWW .Xauthority.O5HAWW .Xauthority.OIC5VW .Xauthority.P2RPVW .Xauthority.Q0FRVW .Xauthority.QW01WW .Xauthority.RDW5WW .Xauthority.T0TLWW .Xauthority.TSO4WW .Xauthority.U6R9VW .Xauthority.V3KAWW .Xauthority.W8Z1WW .Xauthority.XDLGVW .Xauthority.XOOHWW.Xauthority.XUICVW  They are all zero bytes except the first, with timestamps all over the place.  What are these, and are they safe to delete? compare two columns of different files and print if it matches I am using Solaris 10 and so grep options involving -f don't work.  I have two pipe-separated files:   file1:  abc|123|BNY|apple| cab|234|cyx|orange| def|kumar|pki|bird|   file 2:   abc|123| kumar|pki| cab|234   I would like to compare the first two columns of file2 with file1 (search through the entire contents of file1 in first two columns) if they match print the matched line of file1. Then search for the second line of file 2 and so on.   Expected Output:  abc|123|BNY|apple| cab|234|cyx|orange|   The files I have are huge, containing about 400,000 lines, so I would like to make the execution fast. If I have a Java source file (*.java) or a class file (*.class), how can I convert it to a .exe file?  I also need an installer for my program. How can I repair grub? (How to get Ubuntu back after installing Windows?) I installed Windows 7, which ate Ubuntu's boot file. When starting up the computer, it now goes straight to Windows, without giving me the option of booting Ubuntu.   How can I get Ubuntu back? If I recall it correctly, this book has two main characters, both male, one of them big and well muscled. During the novel, they found evidence that the current human race descends from ancient Martian astronauts who traveled to Earth in prehistory, causing the extinction of prehistoric Earth humans, (which explains the Missing Link in human evolution).  Later in the novel the big guy travels back in time (no idea of how or why) to Prehistory.  And near the end of the book, the other main character, during an archaeological field research, finds remains of a human being who lived thousand of years ago, a human with large bones, and who holds an item that could not be made in that era (a gold plaque? A metal rod?)  That's all I can remember. I know it is not from the ABC, Asimov, Bradbury or Clarke.  Thanks in advance. Can I shrink the transaction log file on a mirror database? This is a followup question to  about why I couldn't shrink the log file on the principal database.  To make a long story short, I setup database mirroring but forgot to make sure the job that backed up the transaction log was running again, and the transaction log grew to almost 60GB.   Since mirroring was set up, this size increase was duplicated on the mirrored server, and eventually took up all the disk space and made the mirror database unusable.  Per  about transaction log maintenance on a mirror database, you can't back up the log on the mirror, but when asked specifically in  about how to shrink an overgrown log file on a mirror database, a  was left that      One way to do this would be to failover to the mirrored database and   do the shrink there. Thoroughly test this out in a non-production   environment to ensure it has the behavior you want/expect.   This seems to suggest that there might be other ways to shrink the log file on a mirror, and this method might not necessarily be safe to do on a production server.  Is there a way to safely shrink the transaction log file on a database mirror? Can I run an HTTP GET directly in SQL under MySQL? I'd love to do this:  UPDATE table SET blobCol = HTTPGET(urlCol) WHERE whatever LIMIT n;   Is there code available to do this? I known this should be possible as the  include an example of adding a function that does a DNS lookup.  MySQL / windows / Preferably without having to compile stuff, but I can.  (If you haven't heard of anything like this but you would expect that you would have if it did exist, A "proly not" would be nice.)  EDIT: I known this would open a whole can-o-worms re security, however in my cases, the only access to the DB is via the mysql console app. Its is not a world accessible system. It is not a web back end. It is only a local data logging system How does the "tail" command's "-f" parameter work? $ tail -f testfile   the command is supposed to show the latest entries in the specified file, in real-time right? But that's not happening. Please correct me, if what I intend it to do is wrong...  I created a new file "aaa" and added a line of text and closed it. then issued this command (first line):  $ tail -f aaa xxx xxa axx   the last three lines are the contents of the file aaa. Now that the command is still running (since I used -f), I opened the file aaa via the GUI and started adding a few more lines manually. But the terminal doesn't show the new lines added in the file.  What's wrong here? The tail -f command only shows new entries if they are written by system only? (like log files etc) Duplicity Backup Browse What is the definition of a "feature map" (aka "activation map") in a convolutional neural network? Intro Background Within a convolutional neural network, we usually have a general structure / flow that looks like this:  input image (i.e. a 2D vector x)   (1st Convolutional layer (Conv1) starts here...)  convolve a set of filters (w1) along the 2D image (i.e. do the z1 = w1*x + b1 dot product multiplications), where z1 is 3D, and b1 is biases. apply an activation function (e.g. ReLu) to make z1 non-linear (e.g. a1 = ReLu(z1)), where a1 is 3D.   (2nd Convolutional layer  (Conv2) starts here...)  convolve a set of filters along the newly computed activations (i.e. do the z2 = w2*a1 + b2 dot product multiplications), where z2 is 3D, and and b2 is biases. apply an activation function (e.g. ReLu) to make z2 non-linear (e.g. a2 = ReLu(z2)), where a2 is 3D.    The Question The definition of the term &quot;feature map&quot; seems to vary from literature to literature. Concretely:  For the 1st convolutional layer, does &quot;feature map&quot; corresponds to the input vector x, or the output dot product z1, or the output activations a1, or the &quot;process&quot; converting x to a1, or something else? Similarly, for the 2nd convolutional layer, does &quot;feature map&quot; corresponds to the input activations a1, or the output dot product z2, or the output activation a2, or the &quot;process&quot; converting a1 to a2, or something else?  In addition, is it true that the term &quot;feature map&quot; is exactly the same as &quot;activation map&quot;? (or do they actually mean two different thing?)  Additional references: Snippets from :  *The nomenclature is being used loosely here. In particular, I'm using &quot;feature map&quot; to mean not the function computed by the convolutional layer, but rather the activation of the hidden neurons output from the layer. This kind of mild abuse of nomenclature is pretty common in the research literature.   Snippets from :  In this paper we introduce a visualization technique that reveals the input stimuli that excite individual feature maps at any layer in the model. [...] Our approach, by contrast, provides a non-parametric view of invariance, showing which patterns from the training set activate the feature map. [...] a local contrast operation that normalizes the responses across feature maps. [...] To examine a given convnet activation, we set all other activations in the layer to zero and pass the feature maps as input to the attached deconvnet layer. [...] The convnet uses relu non-linearities, which rectify the feature maps thus ensuring the feature maps are always positive. [...] The convnet uses learned filters to convolve the feature maps from the previous layer. [...] Fig. 6, these visualizations are accurate representations of the input pattern that stimulates the given feature map in the model [...] when the parts of the original input image corresponding to the pattern are occluded, we see a distinct drop in activity within the feature map. [...]  Remarks: also introduces the term &quot;feature map&quot; and &quot;rectified feature map&quot; in Fig 1.  Snippets from :  [...] One dangerous pitfall that can be easily noticed with this visualization is that some activation maps may be all zero for many different inputs, which can indicate dead filters, and can be a symptom of high learning rates [...] Typical-looking activations on the first CONV layer (left), and the 5th CONV layer (right) of a trained AlexNet looking at a picture of a cat. Every box shows an activation map corresponding to some filter. Notice that the activations are sparse (most values are zero, in this visualization shown in black) and mostly local.   Snippets from   [...] Every unique location on the input volume produces a number. After sliding the filter over all the locations, you will find out that what you’re left with is a 28 x 28 x 1 array of numbers, which we call an activation map or feature map. set of almost complex structures on $\mathbb R^4$ as two disjoint spheres The set of almost complex structures on $\mathbb R^{2n}$ is given by $$ M_n = \frac{GL(2n,\mathbb R)}{GL(n,\mathbb C)} = \mathcal C_+ \sqcup \mathcal C_-,$$ taking into account that $\det = \pm 1$ gives two disjoint sets.  How do we show that $M_2=S^2 \sqcup S^2$? Moreover, I'm a bit confused by dimensions: how does $\dim_{\mathbb R}M_2=8$ relates with the latter decomposition?  This is exercise 1.2.1 from the book Complex geometry by Huybrechts. How can I find the version of Ubuntu that is installed? How to get apache to send a 404 based on no matching VirtualHost section (based on ServerName) being found? I am rebuilding an old server.  Only one of the five old sites need to go live and all five of the old sites point to the same IP address.  Unfortunately any time a request is made for one of the old sites via their own unique domain names they are passed the pages from the one site that I'm trying to make live.  I would just like the old sites to display a 404 instead of the one site that I'm actually trying to make live.  As an example:   Site 1 (192.168.0.1) [www.first.com] Site 2 (192.168.0.1) [www.second.com] Site 3 (192.168.0.1) [www.third.com]   I want to move site 1 live again.  So I turned on apache on the machine with the IP address of 192.168.0.1, with all of site 1's files in the /var/www directory.  When I browse to 192.168.0.1 or www.first.com I correctly see site 1. When I browse to www.second.com and www.third.com I also receive site 1 which is the problem.  Is there a way I can 404 any request which comes in without www.first.com?  Here is my sites-available:  NameVirtualHost *:80  LogFormat "%h %l %u %t \"%r\" %&gt;s %b" common  &lt;Files ~ "^\.ht"&gt;     Order allow,deny     Deny from all     Satisfy All &lt;/Files&gt;  &lt;Directory /&gt;   Order Deny,Allow   Deny from all   Options None   AllowOverride None   Options None &lt;/Directory&gt;  &lt;Directory /var/www&gt;   Order Allow,Deny   Allow from all &lt;/Directory&gt;  &lt;VirtualHost *:80&gt;         ServerName first.com         ServerAlias www.first.com         DocumentRoot /var/www         ErrorLog /var/log/first.com.err         CustomLog /var/log/first.com.log common &lt;/VirtualHost&gt;  &lt;VirtualHost _default_:*&gt;         ServerName unknown         DocumentRoot /var/www_404 &lt;/VirtualHost&gt; Can the definite article be omitted when referring to a person qualified by a noun?