python 2.7 regular expression match performance for advice
Is it worth using Python's re.compile?
Why do we need to set swap space as twice big as our physical memory? When we want to setup a linux system, there is a common a suggestion to set the swap space  twice as big as your physical memory. I want to know why do we need this, and how it is this suggestion come to be? Cat 5/6 in same conduit as power: is NM-B required, or is THHN acceptable? Preface: I'd like to avoid the question of whether one should run data and power together; my question is focused on Code compliance.  I'm trying to ensure I interpret Code correctly when running Cat 5/6 cabling and power together in the same conduit.  For starters, I understand that nothing in Code prohibits one from doing this; I'm trying to ensure I understand how to do it properly.  I'm wiring a basement office for power and data, and I'll be running the electrical in EMT.  My plan was to pull THHN for the power rather than pull NM-B, but then 800.133(2) Exception 1 made me scratch my head.  Is my understanding of the Article that if I want to run both data (Cat6) and power in the same conduit, that the power needs to be sheathed (i.e. NM-B).  Is it unacceptable to pull individual THHN conductors and the Cat6 together in the same conduit?     800.133 2) Other Applications. Communications wires and cables shall be separated at least 50 mm (2 in.) from conductors of any electric   light, power, Class 1, non–power-limited fire alarm, or medium-power   network-powered broadband communications circuits.      Exception No. 1: Where either (1) all of the conductors of the   electric light, power, Class 1, non–power-limited fire alarm, and   medium-power network-powered broadband communications circuits are in   a raceway or in metal-sheathed, metal-clad, nonmetallic-sheathed, Type   AC, or Type UF cables, or (2) all of the conductors of communications   circuits are encased in raceway. Show that computation of all such expressions will result in the same element of $X$ I had some NEF files in a folder that I didn't do anything with. When importing them in Lightroom, no previews and a "file unsupported or damaged message" So I tried with Nikons ViewNX, nothing. Even not in DxO or PhotoMechanic.  I had a look with EXIFTool and the corrupt file prints me only this:  ExifTool Version Number         : 8.39 File Name                       : _DSC5559.NEF Directory                       : /Users/tunafish/Desktop File Size                       : 12 MB File Modification Date/Time     : 2010:11:29 12:46:56+01:00 File Permissions                : rwxrwxrwx Error                           : File format error   I saw another question on photo.stack  and tried to copy over the makernotes from a good file (_DSC5556.NEF) with  exiftool -tagsfromfile _DSC5556.NEF -makernotes _DSC5559.NEF   but EXIFTool gives me this error  Error: Not a valid TIFF - _DSC5559.NEF 0 image files updated 1 files weren't updated due to errors   I have uploaded 2 NEF's, with _DSC5559.NEF being the corrupt one here: During my attempt to upgrade my Xubuntu 14.04 installation with  sudo apt-get dist-upgrade   I made the mistake of interrupting the process by closing my laptop, which caused it to suspend to disk. After re-opening, the monitor remained black, so I was forced to reboot the system. I have since discovered many failures of drivers (wlan0 missing, USB memory stick cannot be mounted, USB mouse not recognised, and maybe more undiscovered problems with hardware).   My beginner's attempts to manually repair the single problems could have made it even worse. During the installation of the current distribution I chose to encrypt my whole hard disk. For me at least,  has answers that are not sorted by score:    Is this normal?  I've tried refreshing the page a few times, but the order doesn't change... What does "yield break;" do in C#? I have seen this syntax in MSDN: , but I don't know what it does.  Does anyone know? How to revert to GNOME Classic Desktop? What is the best way to modify a list in a 'foreach' loop? Crontab entry executing every hour Too much space between links in post menu Persistent live drive with a partition for persistence There are some web sites describing  new tools new features in [new versions of] old tools  that can create a persistent live drive from an iso file with Ubuntu 19.10 and the corresponding Ubuntu family flavours.  Why and how does it work? How is it different from earlier methods for persistent live drives? Isn't live the default for a cloned drive? Any thoughts on how one might clear the Android Marketplace search history? For instance, if I recently searched for an android app in the marketplace, the marketplace search maintains a history list of which apps/keywords that I have recently looked for.    Thanks in advance! Why is $5^{n+1}+2\cdot 3^n+1$ a multiple of $8$ for every natural number $n$? Deleted Partition Recovery I was installing ubuntu 12.04 on my system. There were 4 partitions on my system and I selected one of the four partition for the installation and chose the option of resizing the partition. Initially my partition was of size 100+GB and i created another partition out of it of size 15GB (EXT4). Now the moment I changed this partition structure my original partition got lost along with its data and I am left with 50GB partition and 50GB unallocated free space.   Now the data that I have lost is meant a lot to me and I want to recover that data. So is there any way I can recover it? And I haven't checked "format" option while resizing the partition. How to redirect output of a program to a ZIP file? Validity of naively computing the de Broglie wavelength of a macroscopic object Many introductory quantum mechanics textbooks include simple exercises on computing the de Broglie wavelength of macroscopic objects, often contrasting the results with that of a proton, etc.  For instance, this example, taken from a textbook:     Calculate the de Broglie wavelength for      (a) a proton of kinetic energy 70 MeV      (b) a 100 g bullet moving at 900 m/s   The pedagogical motivation behind these questions is obvious: when the de Broglie wavelength is small compared to the size of an object, the wave behaviour of the object is undetectable.  But what is the validity of the actual approach of applying the formula naively? Of course, a 100g bullet is not a fundamental object of 100g but a lattice of some $10^{23}$ atoms bound by the electromagnetic force. But is the naive answer close to the actual one (i.e. within an order of magnitude or two)? How does one even calculate the de Broglie wavelength for a many body system accurately? What is the probability that a shuffled standard deck of 52 cards has no two cards of the same rank together ?  I am unable to get a handle on this problem, and wonder whether there is an analytical solution ? Trigger Setup Wizard at next boot using command-line I am looking for a way to use ADB to trigger Setup Wizard at next boot. I know I can run the following command and get it to pop up. However, I can't figure out what triggers it to start at boot.  adb shell am start -a android.intent.action.MAIN -n com.google.android.setupwizard/.SetupWizardTestActivity   The phone I am currently using is stock and I would like to keep it that way.   I've read the  question: If $\sin \theta+\cos\theta+\tan\theta+\cot\theta+\sec\theta+\csc\theta=7$, then $\sin 2\theta$ is a root of $x^2 -44x +36=0$ My own bonafide attempt. $$ 0&lt;\theta&lt;\pi/2$$   and $$\sin\theta+\cos\theta+\tan\theta+\cot\theta+\sec\theta+\csc\theta=7$$   then show that $\sin 2\theta$ is a root of the equation $$x^2 -44x +36=0$$   I tried to use the above given equation of all the trigonometric ratios, though I ended up with an expression of $\sin\theta\cos\theta$.   But this too is in the form of $\sin\theta$ and $\cos\theta$ which was $\sin\theta\cos\theta=\frac{1}{6-\sin\theta-\cos\theta}$.  When I put that in the quadratic equation, it would again transform into the form of $\sin\theta$ and $\cos\theta$, and hence at last I couldn't prove the thing.  Even hints would work, as I would like to solve the question myself.