Is it possible with Javascript to get the DOM element surrounding my script tag?  Example:  &lt;div&gt;     &lt;script&gt;         // get the DOM element of the surrounding &lt;div&gt; tag here     &lt;/script&gt; &lt;/div&gt;   I won't/can't use id's or something similar on the div, because they would have to be randomly generated to be unique. I'm looking for a clean approach. There could be any number of these DIV's with Javascript inside.
How can I reference the script element that loaded the javascript that is currently running?  Here's the situation. I have a "master" script being loaded high in the page, first thing under the HEAD tag.  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt;   There is a script in "scripts.js" which needs to be able to do on-demand loading of other scripts. The normal method doesn't quite work for me because I need to add new scripts without referencing the HEAD tag, because the HEAD element hasn't finished rendering:  document.getElementsByTagName('head')[0].appendChild(v);   What I want to do is reference the script element that loaded the current script so that I can then append my new dynamically loaded script tags into the DOM after it.  &lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt; loaded by scripts.js--&gt;&lt;script type="text/javascript" src="new_script1.js"&gt;&lt;/script&gt; loaded by scripts.js --&gt;&lt;script type="text/javascript" src="new_script2.js"&gt;&lt;/script&gt;
What do potential postdoc advisers seek in research statement letters? I am putting together my application for a postdoctoral position in theoretical condensed matter physics. The position is not a fellowship and is a regular postdoc position. If you have gone through the process of applying for such positions a number of times, or, even better, if you have reviewed such research statement letters, what are the main points that are sought/you seek in such letters? Specifically, should I put more emphasize on my PhD research to demonstrate my "depth of knowledge" on projects I have worked on (past research), or dwell more on things that I want/am capable to do (future research)? Give the "some of your recent flags have been declined" banner some room The "some of your recent flags have been declined" message recently got a banner, which makes it stand out  more (which is nice) but it touches the 'Flag' button, which is less nice. Can it have some margin at the bottom (and perhaps less padding?)    Tested in the latest Safari and Firefox on macOS Catalina. How can I create an executable JAR with dependencies using Maven? I want to package my project in a single executable JAR for distribution.  How can I make a Maven project package all dependency JARs into my output JAR? I am simply adding user in 'Monitored Users' in Debug Logs. But User is not getting added. If you have a glass of water, say, three quarters full and you pour it at an angle of say, $45^{\circ}$ with respect to the the table, the water comes out of the glass and goes directly down towards the floor.  However, when the glass is more full, or even three quarters full and the 'angle of pouring' is far less with respect the table, when the water comes out of the glass, rather than going straight down it kind of stays stuck to the glass and travels down the outside of it.  Why does this happen? (I'm sure many of you have observed it yourself by accident and ended up making a mess). Searching for a string on multiple zip files According to my logic,  $$\large\sqrt{x^2} = x^{2\times \frac{1}{2}} = x = x^{\frac{1}{2}\times 2}={(\sqrt{x})}^2$$  But when I look at the graphs of these guys, they're totally different.  Edit: Complex answers are okay, if you know what I mean. What overwrites /etc/resolv.conf on every boot? I was given the files for a mini linux, that boots directly into firefox. It works for all it should be doing, only that I do not get an internet connection.  We have 3 DNS servers in the network, which all work. I can ping them, too. But when trying to ping google.de or wget google.de I get a bad address error.  nslookup google.de works for some reason.  I tracked the issue down to my resolv.conf on the booted system not having the same contents as the resolv.conf that I put into the .iso file.  I tried understanding all the factors that go into creating and modifying resolv.conf. I'm not quite sure I got it all, but I definitely didn't find my solution there.  So as a last ditch effort, I tried making the resolv.conf file immutable using   :~# chattr +i /etc/resolv.conf   When rebuilding and booting again to my surprise my file was renamed to resolv.conf~ and in its place was the same standard file that has been haunting me.   The file contents make me believe it gets the information from the network itself. When starting the .iso in Virtualbox without internet access, my file is being kept as it is.  I tried changing /etc/dhcp/dhclient.conf to not get the information from the net, by deleting domain-name-server and domain-name-search from the request part of the file.  Didn't work unfortunately.  I don't have the NetworkManager installed. The iso is based on Ubuntu 14.04.  There is probably vital information missing. I'm happy to provide it.  UPDATE:  I think I found the file that clears resolv.conf.  It seems to be /usr/share/udhcpc/default.script  #!/bin/sh  # udhcpc script edited by Tim Riker &lt;Tim@Rikers.org&gt;  [ -z "$1" ] &amp;&amp; echo "Error: should be called from udhcpc" &amp;&amp; exit 1  RESOLV_CONF="/etc/resolv.conf" [ - n "$broadcast" ] &amp;&amp; BROADCAST="broadcast $broadcast" [ -n "$subnet" ] &amp;&amp; NETMASK="netmask $subnet"  case "$1" in     deconfig)         /bin/ifconfig $interface 0.0.0.0         for i in /etc/ipdown.d/*; do             [ -e $i ] &amp;&amp; . $i $interface         done         ;;      renew|bound)         /bin/ifconfig $interface $ip $BROADCAST $NETMASK          if [ -n "$router" ] ; then             echo "deleting routers"             while route del default gw 0.0.0.0 dev $interface ; do                 :             done              metric=0             for i in $router ; do                 route add default gw $i dev $interface metric $((metric++))             done         fi          echo -n &gt; $RESOLV_CONF # Start ----------------           [ -n "$domain" ] &amp;&amp; echo search $domain &gt;&gt; $RESOLV_CONF         for i in $dns ; do             echo adding dns $i             echo nameserver $i &gt;&gt; $RESOLV_CONF         done         for i in /etc/ipup.d/*; do             [ -e $i ] &amp;&amp; . $i $interface $ip $dns          done # End ------------------         ;; esac  exit 0   It's part of the udhcpc program. A tiny dhcp client, that is part of busybox  Will investigate further.    UPDATE2 AND SOLUTION:  I commented the part out (#Start to #End), that seemingly overwrites the /etc/resolv.conf file and sure enough. That was the culprit. So an obscure script caused all this trouble.  I changed the question to reflect, what actually needed to be known to solve my problem, so it would be easier to find for people with the same problem and so I could accept an answer.  Thanks for the help here in figuring things out. number of distinct solution of Integral equation Total number of distinct $0\leq x\leq 1$ for which $\displaystyle \int_{0}^{x}\frac{t^2}{1+t^4}dt = 2x-1$   $\bf{My\; Try::}$ Given $\displaystyle \underbrace{\int_{0}^{x}\frac{t^2}{1+t^4}dt}_{\geq 0} = 2x-1\;,$ Where $0\leq x\leq 1$  So we get $\displaystyle x\geq \frac{1}{2}\;\;\;,$ Now  $\displaystyle \frac{d}{dx}\left\{\int_{0}^{x}\frac{t^2}{1+t^4}dt\right\} =\frac{d}{dx}(2x-1)$  So $$\frac{x^2}{1+x^4}=2\Rightarrow \underbrace{x^2+\frac{1}{x^2}}_{\geq 2} = \frac{1}{2}$$  So no real values of $x$  Is my solution is Right, If not then how can i solve it some short way, Thanks "Most importantly" or "more importantly"? Which of the following two sentences is more correct?   "A picture says a thousand words, more importantly in a fraction of a second"    OR   "A picture says a thousand words, most importantly in a fraction of a second"   Nothing important, just my own quotes! Do also suggest, if I can put it in a better way to express what I want to. On sites with new responsive theme, word wrap on long titles breaks in the middle of a word Not sure if the title is specific enough, so here we go:  I crashed my Windows pc, and now I want to install Ubuntu on that computer. I'm currently using my Mac, as it is the only operable computer I have left. I have downloaded the .iso. I guess my question is; How do I go about installing Ubuntu on my crashed computer from the external harddrive? I've used Ubuntu before, but I used to install it from a CD-rom. I tried reading the instructions, but couldn't really understand them. Please help  Edit: As Tom mentioned, I only want to install Ubuntu on the (formerly) Windows machine.  Anyways, thanks for the quick responses, I think I've got it from here. Cheers The Frobenius Coin Problem I am trying to make a pirate ship and am trying to attach rope to the sails. my rope is made using a path, and soft body physics. I can not find a way to attach my rope to the sail. and I can not use pinned vertices because this is not a cloth modifier. I have a skyscraper building but I only want the glass in the texture to be glossy.  How would I accomplish this?    Ok, I have done a test and here are the results.  Here is the original:   here is an adjusted image Is it possible to import css stylesheets into a html page using Javascript? If so, how can it be done?  P.S the javascript will be hosted on my site, but I want users to be able to put in the &lt;head&gt; tag of their website, and it should be able to import a css file hosted on my server into the current web page. (both the css file and the javascript file will be hosted on my server). I would like to replace the search submit button with a Font Awesome character like the Magnifier (Search Icon) character, and put Search the site inside the search box.  How can I achieve something like this? Show that $e^{-\beta} = \frac{1}{\sqrt{\pi}} \int_{0}^{\infty} \frac{e^{-u}}{\sqrt{u}} e^{-\beta^2 / 4u} du$. Show that $e^{-\beta} = \frac{1}{\sqrt{\pi}} \int_{0}^{\infty} \frac{e^{-u}}{\sqrt{u}} e^{-\beta^2 / 4u} du$.  I'm not really sure of how I should proceed to show this, and it's pretty un-intuitive as well.  I've managed to manipulate the RHS into  $$\frac{e^{4\beta}}{\sqrt{\pi}} \int_0^\infty \frac{1}{\sqrt{u}} e^{-(\beta+2u)^2/4u} du$$ which now vaguely resembles a Gaussian. However, substituting $v = \beta + 2u$ in in order to to get something like $e^{-x^2}$ doesn't particularly help. I got $$ \frac{e^{4\beta}}{\sqrt{2\pi}} \int_0^\infty \frac{1}{\sqrt{v - \beta}} e^{-v^2/2(v-\beta)} dv. $$  I'm really unsure of how I should proceed; any help would be appreciated. Multivariate differentiability verification I have tried an attempt on the following:  Let $F:U\in \Bbb{R}^n\to \Bbb{R}$ and $f:\Bbb{R}\to \Bbb{R}$ where $f$ is an even function. Now $F(\mathbf{x})=f(|\mathbf{x}|)$, where $|\ . |$ is the Euclidean norm. Given $f$ is $C^r$, I have to show that $F$ is $C^r$.  My attempt was to argument by induction. I showed that $F$ is $C^1$, basically using univariate chain rule on $\frac{\partial f\left(\sqrt{x_1^2+\dots+x_n^2}\right)}{\partial x_1}$ and arguing that it would be continuous using the fact that $f$ is $C^r$. Since the argument works for all $x_i$, it establishes first-differntiability for $F$ and continuity of the operator $DF(\mathbf{x})$. Then I moved on to show $F$ is $C^r$ assuming $F$ is $C^{r-1}$ and $f$ is $C^r$. Now what I did was partially differentiate:  $$ {\partial \over \partial x_2} \left[\frac{\partial ^{k-1}f}{\partial x_1^{k-1}}\right] = \underbrace{{\partial \over \partial |\mathbf{x}|} \left[\frac{\partial ^{k-1}f}{\partial x_1^{k-1}}\right]}_{(1)} . \underbrace{{\partial |\mathbf{x}| \over \partial x_2}}_{(2)} $$  My argument runs as follows: this partial derivative is continuous since $f$ is $C^r$ and hence $(1)$ is continuous. Continuity of $(2)$ is establishd in a similar manner, since $\sqrt{\mathbf{x}}$ is $C^r$ if $\mathbf{x} \neq \mathbf{0}$. Then the product would be continuous. I am uneasy on multivariate arguments and dont know if my approach is completely off track. I didnt use the even function property, so I am sure I might me missing something. Any hints and references would be welcome. Thanks! I had installed VirtualBox but it started giving me problems. So I uninstalled it using:-  sudo apt-get remove virtualbox-\* sudo apt-get purge virtualbox-\*   But when I reinstalled VirtualBox it again resumed to previous settings and started giving same problems. How can i completely remove VirtualBox from my laptop and then reinstall it such that it wont give same problem again?