Hi guys recently I got stuck with PHP preg_match_all(). I'm really bad on REGEXP, I had to find:  var nx = (100000 + x) * 23452;   with preg_match_all(), I do this:  preg_match_all('/var nx = (100000 + x) * (.*);/', $html, $token); return $token[1][0];   I want output like this on my array:  23452   Please anyone help me, with explanation will be appreciate. Thanks.
I am tired of always trying to guess, if I should escape special characters like '()[]{}|' etc. when using many implementations of regexps.  It is different with, for example, Python, sed, grep, awk, Perl, rename, Apache, find and so on. Is there any rule set which tells when I should, and when I should not, escape special characters? Does it depend on the regexp type, like PCRE, POSIX or extended regexps?
How to prove $B-A \succeq 0 \Leftrightarrow$ ellipsoid $x^TBx \leq 1$ contains $x^TAx \leq 1$? Assume $A \in \textbf{S}^n_{++}$, an ellipsoid centered at the origin given by $$\mathcal{E}_A = \{x\mid x^TA^{-1}x \leq 1\}$$ Then we have $\mathcal{E}_A \subseteq \mathcal{E}_B $ if and only if $B-A \succeq 0$. This is the proposition in the Boyd &amp; Vandenberghe's  (pages 45-46). The authors gave only the result, without proof. How to prove it? How do I parse command line arguments in Bash? Application always show in the third position in Ubuntu 16.04 After I update my ubutu to 16.04, I got a problem with Unity launcher. Whenever I open an application which is not listed in launcher, it will take the third position instead of last position. Has anyone the same problem? I want to prove that if we have a commutative integral domain $D$ with field of fractions $F\neq D$ then $F$ is not finitely generated as a $D$-module. (In this question it may be the case that $1\not\in D$.)    My original plan was to localize at a maximal ideal and then use Nakayama's lemma but as we don't have a $1$ our localization may not be local (in fact we need not have maximal ideals).  So I'm a bit lost as to where to go?  Thanks for any help. GUI to CLI command translator Is there any application (or sequence of commands) for this function: seeing the result of the actions, while using a GUI interface, being automatically translated into a Terminal (or similar CLI environment) on the same machine.  I saw this in action long years ago in VBA for Applications (for example the Macros in Excel). I wonder if there is same function in Linux. How to evaluate the limit $\lim_{x\to 0} \frac{1-\cos(4x)}{\sin^2(7x)}$ Mobile chat "you have been suspended" notification is too ambiguous Earlier today, I was suspended from chat due to an inappropriate message (I totally deserved it, but that's not the point). I looked at my phone, and this is all that it told me:    ...which confused me because chat was still moving as normal. I didn't realize that I had been suspended until I checked on my computer to see what the heck was going on.  To me, "This room is read-only" sounds like some sort of database lockup or something related specifically to the room, not the user. It doesn't give any feedback to indicate that the room will be "read-only" for 30 minutes, and doesn't mention that all other rooms are also "read-only". Even a message saying just "You have been suspended from chat" would be more helpful. I have a simple shutdown script which i want to run as root  shutdown -h +30; echo "succesfull";   I have followed these answer, to make my script root.  first I run this command  sudo chown root.root $HOME/test/test.sh sudo chmod 4755 $HOME/test/test.sh   and then made changes in sudoers  sudo visudo   added this command after this line %sudo   ALL=(ALL:ALL) ALL  eka ALL=(ALL) NOPASSWD: $HOME/test/test.sh   But when i executed my script its showing this error  shutdown: Need to be root succesfull Modern ice-age/plans for weapon hidden in genome apt vs apt-get error code Strange thing I have here, when apt is locked by something. Respectively, the error codes don't match up. apt update seems to always return success 0, whereas apt-get update returns a proper error code.  vlastimil@vb-nb-mint ~/Development/bash $ sudo apt-get update Reading package lists... Done E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/  vlastimil@vb-nb-mint ~/Development/bash $ echo $? 100  vlastimil@vb-nb-mint ~/Development/bash $ sudo apt update Reading package lists... Done E: Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable) E: Unable to lock directory /var/lib/apt/lists/  vlastimil@vb-nb-mint ~/Development/bash $ echo $? 0   apt's location:  vlastimil@vb-nb-mint ~/Development/bash $ which apt /usr/local/bin/apt   apt's version:  vlastimil@vb-nb-mint ~/Development/bash $ apt-show-versions apt apt:amd64/xenial-updates 1.2.12~ubuntu16.04.1 uptodate   I originally wanted to use apt for the manual upgrade script, but this changes the situation. Does someone understand error codes and such in order to help me with this? How can I remove launcher drive icons? Do you think that "was going to be" or "would be" could be used as past tense of will?     I thought this book was going to be your choice.        I thought this book would be your choice.   Do these two sentences basically mean the same thing or are they slightly different? On Ubuntu 18.04, I have connected my laptop to an external display and I am able to set the external display as primary and external display only mode. But when I turn on my laptop or log out from my session the display login screen is displayed only on my(internal) laptop screen. But once I login the display switches to external only and my laptop screen turns off as expected. Is there a way I can make the login screen appear only on the external screen on bootup or on logout as in 16.04? Also the login screen does not follow my cursor as in 16.04. How do I allow non-root access to /ttyUSB0? Since I updated from Ubuntu 10.04 (Lucid Lynx) to Ubuntu 12.04 (Precise Pangolin), I am unable to access the device connected in /ttyUSB0 if I don't have root access.  To be more specific, I use a USB-to-serial com port converter to access and configure Cisco equipment with software called . It happens that, since I upgraded to 12.04, PuTTY only sees the connected device when I run it as gksudo putty. If not, it says "unable to connect to port /ttyUSB0".  I have managed to change the permissions via chmod 666, and it works, but if I disconnect the USB device and reconnect, it goes back to root only. How do I permanently allow non-root access? I have a clue it might be via  rules, but I have no idea how to do it.  Obs.: Manufacturer and drivers are "PROLIFIC" I am trying to connect to a Linode (running Ubuntu 12.04 LTS) from my local machine (also running Ubuntu 12.04 LTS)  I have created a private and public key on my local machine and copied my public key to my Linode's authorized_keys file.  However, whenever I try to ssh to my Linode I get the error message Permission denied (publickey).    It's not a problem with how ssh is set up on my Linode because I can ssh to it from my Windows machine using key authentication.    In my .ssh directory on my local Ubuntu machine, I have my id_rsa and id_rsa.pub files.  Do I need to create an authorized_keys file on my local machine?    EDIT:  This is what I get when I run ssh -vvv -i id_rsa [youruser]@[yourLinode]:  debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering RSA public key: id_rsa debug3: send_pubkey_test debug2: we sent a publickey packet, wait for reply debug1: Authentications that can continue: publickey debug2: we did not send a packet, disable method debug1: No more authentication methods to try. Permission denied (publickey). Invalid group name: Group names must begin with a word character I received the following exception when I was using the Regex class with the regular expression: (?'named a'asdf)  System.ArgumentException: parsing \"(?'named a'asdf)\" - Invalid group name: Group names must begin with a word character.   What is the problem with my regular expression? Can cited works hold grammatical positions in sentences? Though I read this style quite often, I was recently told unambiguously by a reviewer that I was NOT supposed to use citations "as if they are objects in a sentence."  The following sentence is an example of what the reviewer considered unacceptable:       We analyzed the data using the Wilmerding method, guided by [12].   The references section might include the following:      [12] Smith, D., Marshawn, J., &amp; Devenshaw, A. 2011. Techniques and   Procedures for Applying the Wilmerding Method.  Prince Publications,   Inc, New York, NY.   The Wilmerding method1 is not a step-by-step algorithm that can be precisely followed as if by a machine, and thus [12] does not provide a step-by-step algorithmic description but rather guidance for using  the method. [12] is a relatively slim but authoritative textbook about how to use the Wilmerding method.  Within this question, for the purpose of discussion, I have intentionally put [12] in grammatical positions where it's an important element of the sentence and the sentence would make less sense without the reference.  Sometimes that seems to be the most efficient way to communicate the intended message.  Is using a reference as a grammatical sentence element like this OK?   Why might this not be considered acceptable?   Should I be rewording those sentences?  Is it enough of a violation to be worth passing the note on to authors of papers I review?   I considered posting this on  but it seems more specific to academia than general English usage, and the comment came from a content reviewer rather than a copy editor.   is related but it seems to be more about when to put authors names' in vs. outside of the parentheses in an APA-like style.   The numbered citation style (as opposed to following APA, for example) is required by the venue.  1: Fictionalized for the purpose of this discussion I think I'm being the victim of a bug here. Sometimes while I'm working (I still don't know why), my network traffic goes up to 200 KB/s and stays that way, even tough I'm not doing anything internet-related.   This sometimes happens to me with the CPU usage. When it does, I just run a top command to find out which process is responsible and then kill it. Problem is: I have no way of knowing which process is responsible for my high network usage. Both the resource monitor and the top command only tell me my total network usage, neither of them tells me process specific network info.  I've found questions here about monitoring total bandwidth usage, but, as I mentioned, that's not what I need. Is there another command I can use to find out which process is getting out of hand?  The command iftop gives results that disagree entirely with the information reported by System Monitor. While the latter claims there's high network traffic, the former claims there's barely 1 KB/s.  I've already tried killing all the obvious ones (Firefox, update-manager, Pidgin, etc) with no luck. So far, restarting the machine is the only way I found of getting rid of the issue. Is there a simple way to convert C++ enum to string? Proving the identity functions is continuous iff $\tau_1\supseteq\tau_2$ Exercise: Let $\tau_1$ and $\tau_2$ be two topological spaces on a  set $X$. Then $\tau_1$ is said to be a finer topology than $\tau_2$ if $\tau_1\supseteq\tau_2$. Prove the identity function $f:(X,\tau_1)\to (X,\tau_2)$ is continuous if and only if $\tau_1$ is a finer topology than $\tau_2$.  Attempted proof: Let $A\in\tau_1$. If $f$ is continuous then $\exists B\in\tau_2$ such $f(A)\subset B\implies A\subset B$ for any $A\in\tau_1$ such that all open sets of $\tau_1$ are open sets of $\tau_2$ hence $\tau_1\supseteq \tau_2$. If $\tau_1$ is a finer topology than $\tau_2$, for any $B\in\tau_2\implies B\in\tau_1$ which implies that $f^{-1}(B)=B$, then $B\in\tau_1$ which proves $f$ to be continuous. Questions: Is my proof right? If not. What is wrong? What are alternatives? Thanks in advance!