I am using index.php for my home page, and I am using single.php for my single post page. In my functions.php how can I determine if I am in index.php or single.php?
Is There Any Way to get the template Name By full URL for example  If the full url is  www.example.com/hello-world   I need a function that return the template name (page.php)  I know that WordPress matches every url with regular expression to determine the query and decide which template to include.  That's exactly what I need, a built in or (custom made) function that takes the URL and returns back the corresponding template
Bash File Unable to locate package when new line is added When building a bash file to execute I keep getting an error after adding a new line. I have tried moving some lines around or removing some of the packages but it will results in the same error. In the file if I was to remove 3 and 4 it there will no longer be an error.   E: Unable to locate package &lt;package&gt;   The bash file looks like this   #!/usr/bin/env bash sudo apt update &amp;&amp; sudo apt install -y python3-pip build-essential python3-dev python3-setuptools gcc sshpass sudo apt-get install apt-transport-https lsb-release software-properties-common dirmngr sudo apt-get update   The output with the error  Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                   Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease                                             Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]         Get:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                       Fetched 252 kB in 1s (189 kB/s)     Reading package lists... Done Building dependency tree        Reading state information... Done All packages are up to date. Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package sshpass Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package dirmngr Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]                                                   Hit:3 http://archive.ubuntu.com/ubuntu bionic InRelease                                             Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]         Get:5 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                       Fetched 252 kB in 1s (209 kB/s)     Reading package lists... Done “Unable to Connect to World” Minecraft PE 1.16.201 So my brother and I have been playing Minecraft together on our iPads for years now, but in September I got a new iPad Pro 3rd Generation and I’ve been having issues with Minecraft ever since. Every time we have tried to join each other’s worlds we get the message “Unable to connect to world”. Recently after the update on December 16th, it worked for about a week without having any issues, but now it has gone back to not letting us connect to the worlds. Both of us are able to connect to other people’s worlds, but not each other’s, we’ve tried many things to fix this but so far nothing has worked. If you have any ideas for what we should do please let me know, thank you so much! How widely accepted are Euros in Hungary and how bad is the exchange rate practiced by shops/hotels? The official currency of Hungary is the Forint but so far everything I have looked for prices online, such as trains, buses and taxis, are quoted in Euros and Forints. Hotel reservation asked that I pay in Euros at the hotel. Considering that I will only spend a few days in Budapest, are Forints necessary? Or can I pay for transport, admissions and food in Euros? In such a case, how is the conversion rate set? I'm travelling to country X. I want to install an application which isn't available in my country, but is available in country X; but I prefer to download and install it in advance, while the data connection is still cheap.  Unfortunately, the Play Stores does not allow me to install this app. Is there any way to circumvent this limitation? I installed an alpha or beta, am I up to date with the final release if I keep upgrading? I installed an Ubuntu alpha or beta and have been keeping it up to date.   So, Should I presume that my system has automatically updated to the next alpha or beta, and will be running the official release when it's finished? Divisibility by 7 rule, and Congruence Arithmetic Laws I have the following image    that was created with this code:  \documentclass[varwidth=true, border=2pt]{standalone} \usepackage{tikz} \usepackage{tkz-euclide}  \begin{document} \usetkzobj{all} \begin{tikzpicture}     \tkzSetUpPoint[shape=circle,size=10,color=black,fill=black]     \tkzSetUpLine[line width=1]     \tkzDefPoints{0/0/A, 3/0/B', 2/2/C, 4/4/C'}     \tkzDefLine[parallel=through C](B',C') \tkzGetPoint{Phelper}     \tkzInterLL(A,B')(C,Phelper) \tkzGetPoint{B}     \tkzDrawLine[add=0 and 0.2](A,B')     \tkzDrawLine[add=0 and 0.2](A,C')     \tkzDrawSegment(B',C')      \node at ($(A)+(-0.1,-0.2)$)  {$A$};     \node at ($(B')+(0.2,-0.2)$)  {$B'$};     \node at ($(C')+(0,0.4)$)  {$C'$};     \node at ($(B)+(0.2,-0.2)$)  {$B$};     \node at ($(C)+(0.28,0.5)$)  {$C$};     \tkzDrawPolygon[ultra thick,color=blue,fill=blue!20](A,B',C')      \tkzDrawPolygon[line width=0.3pt,color=red,fill=red!20](A,B,C)      \tkzDrawPoints(A,B',C',B,C)     \tkzLabelSegment[below,red](A,B){$c$}     \tkzLabelSegment[left,red](A,C){$b$}     \tkzLabelSegment[right,red](B,C){$a$}     \tkzLabelSegment[below,blue,pos=0.8](A,B'){$c'$}     \tkzLabelSegment[left,blue,pos=0.8](A,C'){$b'$}     \tkzLabelSegment[right,blue](B',C'){$a'$} \end{tikzpicture} \end{document}   As you might notice, the space above C' is bigger than necessary. This is because of Phelper. I need Phelper for the construction, but it should not influence the image size in any way. I've tried to get Phelper closer to C, but that seems not to be possible.  How can I stop defined (but not visible) points from influencing image size?  Please note: I wrap code like this in a figure. So images like the one above are only a part of the whole document. So working with standalone does not solve my problem. Will Ubuntu get patched against Meltdown and Spectre? The following is a canonical post that attempts to cover a broad number of Meltdown and Spectre questions.  It is being maintained by Thomas Ward who is in contact with the Security and Kernel teams on this matter for other reasons as well.   I recently read about the  vulnerabilities.  I was wondering, will Ubuntu be patching against the vulnerabilities?  And is there an ETA on a fix? Compactness of $\operatorname{Spec}(A)$ In an exercise in Atiyah-Macdonald it asks to prove that the prime spectrum $\operatorname{Spec}(A)$ of a commutative ring $A$ as a topological space $X$ (with the Zariski Topology) is compact.   Now because the basic open sets $X_f = \{\mathfrak{p} \in \operatorname{Spec} (A) : \{f\} \not\subseteq \mathfrak{p} \}$ form a basis for the Zariski Topology it suffices to consider the case when   $$X = \bigcup_{i \in I} X_{f_i}$$   where $I$ is some index set. Then taking the complement on both sides we get that   $$\emptyset = \bigcap_{i \in I} X_{f_i}^c$$  so there is no prime ideal $\mathfrak{p}$ of $A$ such that all the $f_i$'s are in $\mathfrak{p}$. Now from here I am able to show that the ideal generated by the $f_i$'s is the whole ring as follows. Since there is no prime ideal $\mathfrak{p}$ such that all the $f_i \in \mathfrak{p}$, it is clear that there is no $\mathfrak{p}$ such that $(f_i) \subseteq \mathfrak{p}$ for all $i \in I.$ Taking a sum over all the $i$ then gives $$\sum_{i \in I} (f_i) = (1).$$  Now here's the problem:          How do I show from here that there is an equation of the form $1 = \sum_{i \in J} f_ig_i,$ where $g_i \in A$ and $J$ some finite subset of $I$?       This part has been giving me a headache. I am not sure if the finiteness bit has to do with algebra, topology or the fact that we are dealing with prime ideals.  This is not a homework problem but rather for self-study.  $\textbf{Edit:}$ I have posted my answer below after the discussion with Dylan and Pierre. Why is a geometric progression called so? Just curious about why geometric progression is called so. Is it related to geometry? Why can't the Polynomial Ring be a Field? I'm currently studying Polynomial Rings, but I can't figure out why they are Rings, not Fields. In the definition of a Field, a Set builds a Commutative Group with Addition and Multiplication. This implies an inverse multiple for every Element in the Set.   The book doesn't elaborate on this, however. I don't understand why a Polynomial Ring couldn't have an inverse multiplicative for every element (at least in the Whole numbers, and it's already given that it has a neutral element). Could somebody please explain why this can't be so? What's the fastest connection speed / shortest elapsed time using Migration Assistant? When using Migration Assistant to move users, files, and folders from an old Mac to a new one, you have a few different choices, depending on the Macs involved. Presuming that both Macs have appropriate ports, which ports should be used in a real-world situation? Please do not provide quotations of theoretical port speeds; I'm looking for real-world experiences as to what will get the job done faster.  Port choices:   FireWire 400 in target disk mode FireWire 400 to 800 in target disk mode FireWire 800 in target disk mode 100 Megabit Ethernet to Gigabit Ethernet in the OS Gigabit Ethernet to Gigabit Ethernet in the OS Thunderbolt cable in target disk mode Prove $ \sin x + \frac{ \sin3x }{3} + ... + \frac{ \sin((2n-1)x) }{2n-1} >0 $ Prove that for $ 0&lt;x&lt; \pi $, $$ \quad S_n(x) = \sin x + \frac{ \sin3x }{3} + ... + \frac{ \sin((2n-1)x) }{2n-1} &gt;0 \quad \forall n = 1,2,... $$  Having trouble with this problem. This is an olympiad-style question, so an answer that doesn't use calculus or analysis would be preferred. A possible approach is induction, but for this we need to find a function in terms of $n$ and $x$ so that we can actually use the inductive step. If anyone has any ideas they would be appreciated.  If you really want to go down the calculus route (at this point I don't mind), then $ S_n' (x) = \cos x + \cos 3x + ... +\cos((2n-1)x) $ , which you can find a closed form for, but I don't know how useful that is. Prove that free modules are projective Incubated but not hatched egg I got the message "oh" and it showed my egg. Before I could do anything the server went down. When I got back on my egg was gone. Is there anything I can do to retrieve my incubated but not hatched egg? In the 10 k tools,  is described as if I had approved it:    However, the review item itself (correctly) displays that I rejected this edit:    Going by   , this should be fixed, but it isn’t.  This could be solved by replacing approved by to reviewed by in the list or making an explicit list, who approved and rejected an edit (which is probably more complicated). Let $\kappa, \lambda,\theta$ be infinite cardinals of $M$ where $M$ is a transitive model of ZFC. Let $\mathcal{P}=Fn(\kappa\times \omega,2)$ (finite functions from $\kappa\times \omega$ to 2) and G is a (M,P)-generic set. I want to show $(\lambda^\theta)^{M[G]}=(max(\kappa,\lambda)^\theta)^M$. One direction is easy $(\lambda^\theta)^M \leq (\lambda^\theta)^{M[G]}$ and $(\kappa^\theta)^M\leq (\kappa^\theta)^{M[G]}\leq ((2^\omega)^\theta)^{M[G]}=(2^\theta)^{M[G]}\leq (\lambda^\theta)^{M[G]}$ where $(\kappa \leq 2^\omega)^{M[G]}$ is by the forcing construction. But now I am not quite sure how to get the other direction. Any thoughts? I know someone who just got an Atrix 4G and previously had an iPhone 3GS. I was asked how he could move his contacts from the iPhone/iTunes onto the Android device. I have never owned an iPhone and have had limited interaction with them. Does anyone know the simplest method of getting iPhone contacts onto an Android device? Reverse Cauchy Schwarz for integrals Let $f,g$ be two continuous positive functions over $[a,b]$ Let $m_1$ and $M_1$ be the minimum and maximum of $f$ Let $m_2$ and $M_2$ be the minimum and maximum of $g$ Prove that $$\sqrt{\int_a^bf^2 \int_a^b g^2}\leq \frac{1}{2}\left(\sqrt{\frac{M_1M_2}{m_1m_2}}+\sqrt{\frac{m_1m_2}{M_1M_2}}\right)\int_a^bfg$$  I can't make any significant progress on this one... Thanks for any hint. Calling delete on variable allocated on the stack