Say I have an image tag such as this:  &lt;img src="smiley.gif" alt="Smiley face" height="42" width="42"&gt;   I know I can get the src by using myImageEl.src.  However, how do I get the type of the src (.gif in this case)?  Basically, my end goal is to pass the file type to window.URL.createObjectUrl()  let src = imageEl.src; let srcType = src.type; // Here I need to get the type let videoFile = new Blob([src], {type: srcType}); let videoSrc = window.URL.createObjectURL(videoFile);
See code:   var file1 = "50.xsl"; var file2 = "30.doc"; getFileExtension(file1); //returns xsl getFileExtension(file2); //returns doc  function getFileExtension(filename) {     /*TODO*/ }
Why should the interface for a Java class be preferred? would report a violation for:  ArrayList&lt;Object&gt; list = new ArrayList&lt;Object&gt;();   The violation was "Avoid using implementation types like 'ArrayList'; use the interface instead".  The following line would correct the violation:  List&lt;Object&gt; list = new ArrayList&lt;Object&gt;();   Why should the latter with List be used instead of ArrayList? What is the difference between 'su -' , 'sudo bash' and 'sudo sh'? I would like to know what is the difference between    su - sudo bash sudo sh   I cannot login as root while doing su - because I do not have the root password - I mean I have my user password with which I can sudo "command"  but this password does not work for su - I can log in as root with sudo bash with my user password and I can login while doing sudo sh but then I get a command prompt in this form # Thought Experiment - Poking a stick across a Black Hole's Event Horizon Role of capacitors in amplifier What is the significance of a coupling capacitor in a common-emitter amplifier? What would happen if it is removed? What will be  the effect on AC amplifier gain on removing it? Algebra - Solving for three unknowns. Find all possible solutions of $$2^x + 3^y = z^2.$$    My approach.   First I substituted $x = 0$, and got the solution, then for $y = 0$. And for $x &gt;  0$ and $y &gt; 0$ , I just know the Pythagorean triple and got the solution as $(4,2,5)$ and $(4,2,-5)$. Please help me to solve it properly. Prove that $\lim_{n \to \infty} \int_0^1{nx^nf(x)}dx$ is equal to $f(1)$. Google Sheets Customize View Using Create Custom Menu and Hiding/Showing Specifc Columns Trying to determine a way that I can use a custom menu (.createMenu) with views that will allow me to show / hide specific columns.  I need the capability to pick specific multiple columns and not ranges.  In the example below how can you pick a custom view from the menu (say "Customer Info") that will only show columns A, B, C, and H?  Maybe another view could show "Financial". How to install apps which require a newer version of iOS on a 1st gen. iPad? Is there a word for someone with the same name? If a person shares my name, in Dutch there is the word &quot;naamgenoot&quot;, meaning roughly 'member of the same name'.  John A: Hi, my name is &quot;John&quot;  John B: O, then we're insert solution word here!  Similarly,  'classmate' is 'klasgenoot' in Dutch 'roommate' is 'kamergenoot' in Dutch  I'm pretty sure I cannot call someone with the same name as mine a 'namemate' :)  Edit Because sceptics appear to be frustrated mightily by an apparent lack of research, there was  in chat, with no satisfactory conclusion. /Merriam Webster namesake appears to be linked to intentional name correspondance (being named after someone). There may be a US/UK English divide there.  &quot;I was named after my grandfather. I am his namesake.&quot; -   Also, the introduction seems to hint at much broader meaning:  &quot;Namesake is a term used to characterize a person, place, thing, quality, action, state, or idea that has the same, or a similar, name to another&quot;   Do you know of a better word/phrase to describe this succinctly? I have the below list of files  aro_tty-mIF-45875564pmo_opt aro_tty-mIF-45875664pmo_opt aro_tty-mIF-45875964pmo_opt aro_tty-mIF-45875514pmo_opt aro_tty-mIF-45875524pmo_opt   that I need to rename to  aro_tty-mImpFRA-45875564pmo_opt aro_tty-mImpFRA-45875664pmo_opt aro_tty-mImpFRA-45875964pmo_opt aro_tty-mImpFRA-45875514pmo_opt aro_tty-mImpFRA-45875524pmo_opt Do extension fields always belong to a bigger field? Let $F$ be a field, $E_1$ and $E_2$ are two distinct extension fields of $F$. Is it the case that we can always somehow find a field $G$ that contains both $E_1$ and $E_2$? In other words, could extensions of fields have different 'direction's such that they are incompatible?  Edit: I began to think about this problem while reading a proof. $F$ is a field. $a$ and $b$ are algebraic over $F$. $p(x)$ and $q(x)$ are two polynomials in $F[x]$ of minimum degree that respectively make $a$ and $b$ a zero. The proof claims that there is an extension $K$ of $F$ such that all distinct zeros of $p(x)$ and $q(x)$ lie in $K$. For a single polynomial, I know this kind of field exists because of the existence of splitting field, why it is true for two polynomials? How to tail multiple files using tail -0f in Linux/AIX Are "whores" and "horse" homophones? I’m Spanish but sometimes see TV shows in English.  My question is whether the words horse and whores sound exactly the same, because in many English language TV shows it seems like they are, which really surprises me.   Are they homophones?  I cannot hear any voicing at the end of the word whores to distinguish the two words. What's wrong with this query: INSERT INTO Users( weight, desiredWeight ) VALUES ( 160, 145 ) WHERE id = 1;  It works without the WHERE clause. I've seemed to have forgot my SQL. error in running bash script as root 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 Prove $133\mid \left(11^{n+2}+12^{2n+1}\right)$ Prove $133\mid \left(11^{n+2}+12^{2n+1}\right)$, where $n$ is a non-negative integer.  So, I went about proving this using Fermat's theorem.  So I had $11^{n}\cdot 11^2+(12^2)^n= 0\ (\mod 133)$ then $11^n\cdot 11^2+1728^n=0\ (\mod133)$  and finally $1^n+132^n=0\ (\mod 133)$.  Then I said $133^n=0\ (\mod133)$ because $133$ raised to any power will have a remainder of $0$. Did I apply Fermat's theorem correctly? I'm looking to do a third-party assessment of the false-positive rate of a video classification algorithm. Since I have a lot of video I'm trying to do a power analysis to figure out exactly how much video I need to look through so that it is representative of all the video data at a given confidence interval.  The algorithm flags video sequences that have at least one cat in it, and I'm looking to evaluate the frequency of false positives on a new unlabeled test set. So I have tagged all the video that my algorithm has identified a cat in and now want to sample the tagged video sections and look through them manually to validate my model since looking through all of it would take too long! Note, I'm not looking to refine the model at this point, just assess it.  My null hypothesis is that the FP rate of the sample of video I watch is equal to the FP rate of all the video.   I think I can use this formula to determine the number of video sequences to view:    Here is my question: am I thinking through this formulation correctly? Since my model has a CV false positive rate of ~0.96, I figure I can use that as a reference. Can I use that for the null hypothesis proportion, p0? Or will that be p, the true proportion?    I've been using this online calculator:   I ask because when setting the parameters I have, I'm getting very small sample sizes, like less than 10 sequences to view. That can't be right. This question is related to "The Last Jedi":  The maneuvre that vice admiral Holdo (with the purple hair) uses towards the end of the film seems remarkably effective.   It seems that it would have worked pretty well much earlier. Especially as two other ships were just allowed to run out of fuel and be destroyed.  It seems doing it earlier with different assets would have incurred less losses. Yet nobody seemed to consider it. Any in universe reason why? How to get product recommendations Possible Duplicate:          I have a question of the form "what companies provide service X?"  I checked meta, and apparently such questions are highly discouraged on all Stack Exchange sites. Which is fine, but it obviously raises the meta-question: Where can I ask my question?  (In particular, I know that there are people hanging out on Stack Overflow who have probably needed the same service, so if an answer exists, they possess it...)  Edit: I should perhaps point out that the service I'm looking for is rather specific and slightly obscure. Otherwise, yeah, this would be a 10-second exercise with Google. The extension of smooth function