extract words between pattern
extract value between two search patterns on same line
I have a document divided into \part \chapter \section and \subsection. I have 3 parts and in each part I reset all the counters.  I want that, when I do a crossref to something that is in the 1st part, chapter 3 and section 5, that LaTeX prints something like I-3.5, but  I don't want that in the tableofcontents part that LaTeX prints the part number. For example, what I want is:     Part I      chapter 1 section 1.1 section 1.2      chapter 2   AND NOT     chapter I-1 section I-1.1 section I-1.2      chapter I-2   The command that I've tried   \renewcommand{\thechapter}{\thepart-\arabic{chapter}} \renewcommand{\thesection}{\thechapter.\arabic{section}}   does exactly what I've said  Can anyone help me? So Black Holes Actually Merge! In 1/5th of a Second - How? I've read a lot of conflicting answers in these forums. However, today saw the awesome announcement of gravitational waves. Two black holes merged:   Not only that, they merged FAST. In 1/5th of a second revolving around each other 250 times a second. The entire event was quicker than a heartbeat. Moreover, we observed this happening as distant outsiders. So now we can say for sure:   Objects approaching the event horizon DO NOT appear to slow down Black holes CAN merge in a finite (and quick) amount of time And all this is wrt a frame of reference far, far away   To quote the NYTimes article:  One of them was 36 times as massive as the sun, the other 29. As they approached the end, at half the speed of light, they were circling each other 250 times a second.  And then the ringing stopped as the two holes coalesced into a single black hole, a trapdoor in space with the equivalent mass of 62 suns. All in a fifth of a second, Earth time.  However, everything I've read so far has let me to believe that an outside observer should never be able to measure the collision happening in a finite time. So what exactly is happening here? I must have read at lest 5 different versions of this so far everywhere in these forums over the past several years. Why use a dedicated light meter instead of the one built into the camera? Symmetric encryption construction (meet-in-the-middle attack) This is a question I had from an exercise session.  First we do DES in CBC encryption mode using a key $K_1$ and $IV_1 = O^n$. Then we do DES in ECB decryption mode using $K_1$. And then DES in CBC decryption mode with a secret $IV_2$ and key $K_2$.  Is this construction safe against meet-in-the-middle attack?  Wouldn't the first two operations negate themselves because $C_1$ would decrypt into $P_1$? How to find a Java Memory Leak How do you find a memory leak in Java (using, for example, JHat)? I have tried to load the heap dump up in JHat to take a basic look. However, I do not understand how I am supposed to be able to find the root reference () or whatever it is called. Basically, I can tell that there are several hundred megabytes of hash table entries ([java.util.HashMap$Entry or something like that), but maps are used all over the place... Is there some way to search for large maps, or perhaps find general roots of large object trees?  [Edit] Ok, I've read the answers so far but let's just say I am a cheap bastard (meaning I am more interested in learning how to use JHat than to pay for JProfiler). Also, JHat is always available since it is part of the JDK. Unless of course there is no way with JHat but brute force, but I can't believe that can be the case.  Also, I do not think I will be able to actually modify (adding logging of all map sizes) and run it for long enough for me to notice the leak. Degrees of freedom in theoretical sample variance (for use in F-distribution) My question is essentially simple: suppose we have a sequence of heads and tails with an apparent chance of getting heads $\hat{p} = 0.5$.      h h t h t t t h t t h ...   How do we tell if this sample was drawn from a binomial distribution with this $\hat{p}$ or if it comes from a combination of different distributions which produces the same average? (e.g. $p = 0.25$ or $p = 0.75$)  Here's what I was thinking of doing:   We chop the sequence into subsections of length $n$, for example $n=5$, and calculate $\hat{p}$ in every such window: {h h t h t}, {t t h t t}, {h ...}0.6, 0.2, ... We then calculate the standard deviation in these $\hat{p}$ values: $\sigma_{ex}=\sqrt{\frac{\sum_{i=1}^M{(\hat{p}_i - \hat{\mu})^2}}{M}}$, where $\hat{\mu}$ is the average $\hat{p}$ and $M$ is the total number of windows of size $n$ we can make.  We calculate the standard deviation in $\hat{p}$ based on a binomial distribution, $\sigma_{th}=\sqrt{\frac{\hat{p}(1-\hat{p})}{n}}$.   Now comes the problem: how to determine if these two values are the same? After a lot of research, I decided to try using an F-ratio test and plugging the result into an f-distribution.  F-ratio: $F = \frac{\sigma_{ex}^2}{\sigma_{th}^2}$ (only valid for normal-distributions :S)  And then an f-distribution to get to a p-value we can check against. However, for the f-distribution I need to know the degrees of freedom in the nominator and denominator. And therein lies my problem: what are the degrees of freedom for the variance calculated from theory? (In the experimental case I think it is M)  If you have this answer or any suggestions on how to solve this problem differently, I would love to hear about it! I am an operator (OP) on my friends Realm. Today I tried to play and noticed that no commands would work for me, or anyone else granted OP. They only worked for the owner of said realm.   He has de-oped us and re-oped us with no cure to the problem. What's causing this?   Also another problem that when he tries to reload the realm it fails every single time, any options that would fix this problem? So I've started playing Gathering Storm, built a bunch of coal plants and now Global Warming is out of control mainly because of me. I've been trying to remove these power plants, but I haven't found any option to sell/destroy or even replace these buildings.  Is there seriously no way to do this? build argument lists containing whitespace Finding out which app is using the webcam Yesterday I was working on my laptop. Suddenly I noticed that the indicator light of the webcam was on, despite the fact that I wasn't making a video call or using the webcam in any other way at the moment.  It freaked me out.  It freaked me out that some unknown application on my computer was using my webcam without my permission, and possibly sending that video stream to god knows where on the Internet.  In the end, it turned out to be Skype which was in the process of crashing. (Despite me making no calls at the time.) So that story ended well.  But next time I see the webcam indicator light, I want to be ready. I want to be able to know exactly which app is using the webcam so I could destroy it.  Does anyone know how I can find out which app is using the webcam?  (I'm on Windows XP.) Best way to get last identity inserted in a table How to know whether Lagrange multipliers gives maximum or minimum? In my flagging summary under the statistics, there is 1 flag listed as "disputed".  This is the first time I've ever seen a disputed flag in my summary, so I'm just curious, what is a disputed flag? How would you even dispute a flag? Is this the same as voting a flag as invalid? Windows 8.1 64-bit: High memory usage I have 8GB of memory on a 64 bit windows 8.1 machine, and windows is telling me I'm using 91% of my memory, yet its simultaneously telling me I'm only using 3GB.  I literally just restarted my machine a few minutes ago because it was being incredibly rediculously slow. I'm currently only running chrome (with a ton of tabs, but doesn't add up to anywhere near 7.5GB). What could be going on here?   Here's a bunch of my current info       I took a look at this:  but I wasn's able to use xperf and the rest didn't lead me to a solution.  UPDATE - RamMap:   UPDATE 2: I checked Resource Monitor at Wouter's suggestion and found an "Image" called lxdecoms.exe with over 6GB of Commt (KB). I tried killing the process, but while it lowered my Commit Charge, it didn't affect "Used Physical Memory". So I restarted hoping to capture it again in full, but its not back yet and yet the problem persists.  I should note that I do have a Centos virtual box virtual machine running on my machine, not sure if that has any weird memory impacts that aren't reflected in the numbers in these tools.   I got xperf working, so here's my resource monitor and a wpa analysis of my xperf output (from xperf -on ReferenceSet -BufferSize 1024 -MaxFile 512 -FileMode Circular  &amp;&amp; timeout 5 &amp;&amp; xperf -d MemUsage.etl):     What is N/A that's taking up 2.7GB of memory? My VM? I have a Dell XPS 12 running Ubuntu 13.10 and it doesn't appear to find it's wireless.  I have tried the suggestions  but they made no difference  peter@xps:/lib/firmware$ ls -l /lib/firmware/iwlwifi-7260-7.ucode  -rw-r--r-- 1 root root 682892 Aug  4 12:50 /lib/firmware/iwlwifi-7260-7.ucode peter@xps:/lib/firmware$ sudo lshw -c network   *-network UNCLAIMED             description: Network controller        product: Wireless 7260        vendor: Intel Corporation        physical id: 0        bus info: pci@0000:06:00.0        version: 63        width: 64 bits        clock: 33MHz        capabilities: pm msi pciexpress cap_list        configuration: latency=0        resources: memory:f7c00000-f7c01fff  peter@xps:~/backports-3.10-2$ grep IWL7260_UCODE_API_MAX drivers/net/wireless/iwlwifi/iwl-7000.c  #define IWL7260_UCODE_API_MAX   7     .ucode_api_max = IWL7260_UCODE_API_MAX,         \ peter@xps:~/backports-3.10-2$ dmesg | grep iwl peter@xps:~/backports-3.10-2$ iwconfig lo        no wireless extensions.  peter@xps:~$ find / -name *7260-6* peter@xps:~$ find / -name *7260-7* /lib/firmware/iwlwifi-7260-7.ucode   peter@xps:~$ dmesg | grep -i -A 20 intel [ 1318.013278] Intel(R) Wireless WiFi driver for Linux, in-tree:d [ 1318.013281] Copyright(c) 2003-2013 Intel Corporation [ 1318.015154] cfg80211: World regulatory domain updated: [ 1318.015157] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) [ 1318.015159] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 1318.015161] cfg80211:   (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 1318.015162] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm) [ 1318.015164] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm) [ 1318.015165] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)     What I have found is that it appears to be loading an old version of the firmware but I don't know how or why  peter@xps:/lib/firmware$ modinfo iwlwifi | grep 7260 firmware:       iwlwifi-7260-6.ucode peter@xps:/lib/firmware$ ls *7260-6* ls: cannot access *7260-6*: No such file or directory   Any suggestions of how to get this setup very welcome. where does lspci gather its information from? In  I found "[The   latest   version    of   this   document   ". There I says: "… lspci is a synonym for cat /proc/pci".  Which isn't the case here, on a Crunchbang 10 system (Debian based). No such directory. I do get the basic idea and, as far as I  know, the content of proc is (mainly) created during runtime. (Wrong?). This made me curious:  Question: Where does lspci gather it's information from? And where is this documented? (Where did I miss something?)  &nbsp; Another difference I found: In kernel.org's documentation, under "Table 1-5: Kernel info in /proc"      pci &nbsp;&nbsp;&nbsp; Deprecated info of PCI bus (new way -> /proc/bus/pci/, decoupled by `lspci) Prove that there exists at least one $x_0\in\mathbb{R}$, such that $f(x_0)+f''(x_0)=0$ Let $f:\mathbb{R}\to\mathbb{R}$ be a function, two times   differentiable with $\left|f(x)\right|\leq1,\forall x\in\mathbb{R}$   and $f^2(0)+\left(f'(0)\right)^2=4$. Prove that there exists at least   one $x_0\in\mathbb{R}$, such that $f(x_0)+f''(x_0)=0$.   I have tried the usual Rolle method by $e^x$, but didn't go far... Any help available? find a $\int_{x}^{g(x)} f(t)\,dt = 1$ POSTFIX main.cf permission denied So all wizards get an invitation to Hogwarts at 11... How do they know whom to invite?  If a wizard is Muggle-born, then nobody would know about their existence.  Or do they register some weird magical stuff being done by them before 11?