Got following String:  I want to get everything behind param2=. First thought was substr, but it never gives me all behind param2=. No matter how I use it, it always returns  (last char missing). I red the  for this, but still no success with this.  I already tried:  $url = 'http://example.de/?param=1&amp;param2=http://example2.com/';  $piece = substr($url, strpos($url, 'param2=') + 7 ,count($url)); //+7 cause of param2= should not be included =&gt; h  $piece = substr($url, strpos($url, 'param2=') + 7 , -count($url)); =&gt; http://example2.com  $piece = substr($url, strpos($url, 'param2=') + 7 , +count($url)); =&gt; h  $piece = substr($url, strpos($url, 'param2=') + 7 , -(count($url)+1)); =&gt; http://example2.co  $piece = substr($url, strpos($url, 'param2=') + 7 , -(count($url)-1)); =&gt;        (empty)  $piece = substr($url, strpos($url, 'param2=') + 7 , -1); =&gt; http://example2.com  $piece = substr($url, strpos($url, 'param2=') + 7 , -0); =&gt;        (empty)   So I never get the last char, maybe you know what I am doing wrong.
I need to build a function which parses the domain from a URL.  So, with   http://google.com/dhasjkdas/sadsdds/sdda/sdads.html   or  http://www.google.com/dhasjkdas/sadsdds/sdda/sdads.html  it should return google.com  with   http://google.co.uk/dhasjkdas/sadsdds/sdda/sdads.html  it should return google.co.uk.
prints out a lot of very detailed protocol statistics like number of TCP reset messages received or number of ICMP "echo request" messages sent or number of packets dropped because of a missing route.  When in Linux netstat is considered deprecated at nowadays, then is there an alternative?  Statistics provided by ss -s are superficial compared to the ones provided by netstat. Google Chrome will take up my memory to the point where it causes my computer to freeze to a near halt. What can I do to prevent this? It gets so horrible that I can not even switch to TTY1 to force a reboot. I have to hard reset, and I lose work.  Ideally, I would like to be able to use the chrome browser on Ubuntu without having to keep reminding myself to close tabs.   Are there any extensions for Chrome, or tools for Ubuntu that can help prevent me going past the point where Ubuntu eats up all the RAM and becomes incapacitated? I recently installed Ubuntu 17.10, and when I tried to set my keyboard layout to change with alt+shift, I hit a . There is  which works, but then it creates an unwanted behaviour on Firefox (perhaps other programs as well).   After setting alt+shift through gnome-tweak-tool as the combination to change language, whenever this combination is pressed within Firefox, it triggers a toggle that Firefox uses to show/hide the Menu Bar (with File/Edit/View etc.), and 'focus' is taken away from wherever the cursor was.   It's very frustrating, because one has to go and click again at the cursor.  The only solution I found was to permanently enable Menu Bar in Firefox because then alt doesn't do anything and I can use it to change languages. But I don't want to have Menu Bar on top always.  I hope you can understand what I'm trying to explain.  Any thoughts? How can I reset all the bind keys in my Bash? I bound some keys by mistake, and they don't work any more, such as HOME, END, UP, DOWN, LEFT, RIGHT.  Is there a way to reset all the bound keys to their original state? How do you calculate the probability density function of the maximum of a sample of IID uniform random variables? Given the random variable  $$Y = \max(X_1, X_2, \ldots, X_n)$$  where $X_i$ are IID uniform variables, how do I calculate the PDF of $Y$? Selenium + FF : How to fix error, Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms? Prove that $G$ is abelian iff $\varphi(g) = g^2$ is a homomorphism I'm working on the following problem:     Let $G$ be a group. Prove that $G$ is abelian if and only if   $\varphi(g) = g^2$ is a homomorphism.   My solution: First assume that $G$ is an abelian group and let $g, h \in G$. Observe that $\varphi(gh) = (gh)^2 = (gh)(gh) = g^2h^2 = \varphi(g)\varphi(h)$. Thus, $\varphi$ is a homomorphism.  I'm having trouble completing the proof in the reverse direction. Assume that $\varphi$ is a homomorphism. We then know that $\varphi(gh) = \varphi(g)\varphi(h)$ and $\varphi(hg) = \varphi(h)\varphi(g)$. However, I don't see a way to use this to show that $gh = hg$.  Could anyone lend a helping hand? I have the following file:  ---------- 1 Steve Steve 341 2017-12-21 01:51 myFile.txt   I switched the user to root in the terminal, and I have noticed the following behaviors:   I can read this file and write to it. I can't execute this file. If I set the x bit in the user permissions (---x------) or the group permissions (------x---) or the others permissions (---------x) of the file, then I would be able to execute this file.   Can anyone explain to me or point me to a tutorial that explains all of the rules that apply when the root user is dealing with files and directories? Why am I getting black photos when I use the Manual feature on my DSLR? What is the difference in meaning among these sentences? Walking is good exercise. Walking is a good exercise. Walking is a good form of exercise.     I'd like to know the difference in meaning among these sentences. Thanks a lot. I need help finding the set of continuous functions $f : \Bbb R \to \Bbb R$ such that for all $x \in \Bbb R$, the following integral converges:  $$\int_0^1 \frac {f(x+t) - f(x)} {t^2} \ \mathrm dt$$  I think it might be the set of constant functions but i havent been able to prove it :(   I was thinking that you can use the stone weiestrass theorem considering the set of continuous functions on a closed  interval(non trivial) ,and a subset which contains the set of continuous functions whose integral above diverges in some point in that interval along with  with the set of constant functions. So in order to solve the problem i need only to prove that if two functions do not meet the condition of the problem then their product does not as well .  I hope you can provide some insight and thank you . Why does triply periodic univariate function not exist? A univariate function $f$ is periodic with period $p_1,\ldots,p_k$ if   $$f(z) = f(z + \sum_{i=1}^k n_i \cdot p_i)$$   for all complex $z$ and integers $n_i$. Elliptic function is an example of doubly periodic function.  that a triply periodic univariate function cannot exist, but why? Can't we follow the construction of elliptic functions that uses Schwarz-Christoffel formula to map upper-plane onto a triangle, and use the reflection principle to create a lattice which corresponds to three periods?     Which step fails to hold when we mimic the construction of an elliptic function to create a triply period meromorphic univariate function?   Sorry if the question is stupid. I do not have an access to the original proof that a triply periodic function cannot exist, either. So references are welcome! Problem from Herstein on group theory What application launchers are available for Ubuntu? Winter Bash 2019 bugs with the "glasses with a number on top" hat and the "Philanthropist" hat Live USB for installation does not boot, black error screen followed by visual artifacts on a purple screen I'm trying to install Ubuntu 18.04 desktop with Rufus on a computer with the following specs:  CPU: AMD Ryzen 5 2600 MOBO: ASUS Prime B450M-A/CSM RAM: G-Skill Ripjaws DDR4 F4-2400C15D-16GVB GPU: Nvidia GeForce GTX750 PSU: Apexgaming AG-650M SSHD: Seagate Firecuda Compute mATX: Rosewill SCM-01  Basically it boots from the USB (FAT32) and brings up a black error screen with words and numbers. Then it transitions to the purple splash screen with &quot;ubuntu&quot; and 5 dots, however the screen shows various visual glitches depending on which USB port I plug into. When trying to boot the computer, it boots to a black screen with the following error message: ACPI Error: Needed [Integer/String/Buffer], found [Region]    that shows what I mean. PHP code is not being executed, instead code shows on the page Does anyone know the general strategy for summing a series of the form:  $$\sum_{n=1}^{\infty} \frac{1}{n^2 + a^2},$$  where $a$ is a positive integer?  Any hints or ideas would be great! Limit of the geometric sequence $\{r^n\}$, with $|r| < 1$, is $0$? Prove that the $\lim_{n\to \infty} r^n = 0$ for $|r|\lt 1$.   I can't think of a sequence to compare this to that'll work.  L'Hopital's rule doesn't apply.  I know there's some simple way of doing this, but it just isn't coming to me. :( How to implement a progress bar using the MVVM pattern