simple way to play sounds every x second in java I have about 20 different sound, and i want it to be played for example every 1 second. every sound just have a duration about 0.7 second. I don't even know how to import mp3 to java either. How can i do this in java?  UPDATE   try  {       in = new FileInputStream(new File("C:\\Users\\Toshiba\\Downloads\\Music\\adios.wav"));        AudioStream as = new AudioStream(in);       AudioPlayer.player.start(as);        Thread.sleep(1*1000);    } catch (Exception e)   {       JOptionPane.showMessageDialog(null, e);   }   i got new problem. i can't stop it once it start
How can I play sound in Java? I want to be able to play sound files in my program. Where should I look?
There was a film from the 80s in which young people can teleport anywhere they can think of.   These guys are recruited to do studies with, maybe by the government or a secret company which wants the take advantage of their abilities.   I saw it on cable TV around 1990-1997.   Any clues? Are the leftovers from making stock good for anything? Having made stock and strained it, can the meat and vegetables boiled up in the stock be used for anything, or should they go in the bin? Session lost when switching from HTTP to HTTPS in PHP When sending the user to a checkout page, they are switched from http://sitename.com to https://sitename.com.  As a result, $_SESSION variables are lost.  The site has a valid SSL certificate which may or may not be of some use. "Its" and "it's" - how to remember? What is a good mnemonic rule that an English learner can use to remember the difference between its (possessive adjective: a team has started its lunch) and it's (verb: it's raining)? Java Round up Any Number Avoiding getting suspended for voting irregularities? Many times when I read threads, I keep on upvoting for the reason being that if someone has put an effort to write a big answer, s/he/it should get some rewards for it.  I recently saw someone getting suspended for voting irregularities.   So, I was wondering if I use the total amount of votes allowed per day, daily, will I be suspended? Infinitely many primes of the type 5 mod 6. Problem: Prove that there are infinitely many primes of the type 5 mod 6.  My professor did the problem and the proof was horribly long. Can someone show me a shorter version of the proof of this problem. I'm trying some things with my shell. This includes the following command:  kill $$  My expectation was that the shell would log me out and terminate itself. But instead the bash persists without change.   Any idea why?  I ran this command on different environments (archlinux, debian). The behavior was always the same. Why does network ad URL from SO to history.SE mention Ask Ubuntu? Today, I was on Stack Overflow when I noticed an interesting ad pointing to history.SE (actual square ad, not just Hot Network Questions).  The link in the ad was:    which resolves to:  https://history.stackexchange.com/questions/23946/what-were-greek-and-roman-sails-made-from?utm_medium=ad&amp;utm_source=http-askubuntu-com-questions-471178-converting-hundreds-of-jpg-to-pdf-using-te&amp;utm_campaign=history.stackexchange.com-promo&amp;utm_content=23946  (link form for conveniece: )  The confusing part os the URL is: utm_source=http-askubuntu-com-questions-471178-converting-hundreds-of-jpg-to-pdf-using-te. The ad is from SO to history.SE, it doesn't have anything to do with Ask Ubuntu, so why does it appear in the URL? Is this a bug?  EDIT: Okay, managed to trigger it again: the page  contains this ad:    The link of the ad is:    which resolves to:  http://opensource.stackexchange.com/questions/1556/how-to-react-to-unhelpful-contributions-to-otherwise-unnoticed-projects?utm_medium=ad&amp;utm_source=http-sharepoint-stackexchange-com-questions-16925-why-am-i-getting-server-erro&amp;utm_campaign=opensource.stackexchange.com-promo&amp;utm_content=1556  incorrectly referencing an unrelated sharepoint.SE question. Why does subsurf modifier cause weird deformation at the end of a cylinder? My problem is simple. I think that the strange deformations on the top are there because there are so many vertices in one face. How do I fix this while maintaining nice topology?  Although I triangulated the top polygon, the problem still persists. Soql query on parents other child object I want to write a soql query , My scenario is as follows. I have three objects objectA,objectB,objectC. objectA is the parent object for both objectB,objectC.   objectA - objectB  (Master-detail relationship) objectA - objectC  (Master-detail relationship)`   ObjectB has two fields:   Start_date__c End_date__c   ObjectC has a field:    Date__c   Now i want to retrieve records with date__c in objectC those were in between start_date__c and end_date__c of objectB. how can i achieve such functionality . Converse to Chinese Remainder Theorem So as seen on this question , we know that if $(n,m) \neq 1$, then $\mathbb{Z} /mn \mathbb{Z} \ncong \mathbb{Z}/n\mathbb{Z} \times \mathbb{Z}/m\mathbb{Z}$, because the right hand side does not have an element of order $nm$.  But take a more general setting. Let $R$ be a commutative ring, and let $A,B$ be ideals in $R$. $A$ and $B$ are said to be comaximal if $A+B=R$. If $A, B$ are comaximal, then we have: $R/AB \cong R/A \times R/B$. In this setup, is the converse true?      If we have $A, B$ ideals in $R$ such that $R/AB \cong R/A \times R/B$, do we always have that $A$ and $B$ are comaximal? What are the main differences between undergraduate, master's, and doctoral theses? When I did my undergraduate thesis, my adviser was expected big on students expecting them working really hard, so it ended up as a reduced master's thesis (most of the reviewers said that it was an overkill for a B.E).  So because of this, I did my master's thesis pretty much in the same way I did my bachelor's thesis; the PhD dissertation was a different story.  What are the principal differences between these three pieces of research? Suppose I am given a morphism of schemes $f: X \longrightarrow Y$ and suppose that for any point $y \in Y$, $\kappa(y)$ denotes the residue field. I would like to show that the fibered product $$X \times_{Y} \text{Spec}(\kappa(y))$$ is homeomorphic to the preimage $f^{-1}(y)$ in the induced topology.  The following is my attempt so far:  The question is obviously affine on the target, so without loss of generality we reduce to the case of a morphism $f: X \longrightarrow \text{Spec }A$. Then we have  $$ f^{-1}(\text{Spec }A) = \bigcup_{i \in I} \text{Spec }B_{i} $$ via morphisms $$ \phi_{i}: A \longrightarrow B_{i}. $$ We can then write, \begin{align*} f^{-1}(\text{Spec } A) \times_{\text{Spec } A}\text{Spec } \kappa(y) &amp;= \bigcup_{i \in I} \left( \text{Spec } B_{i} \times_{\text{Spec }A} \text{Spec }\kappa(y) \right) \\  &amp;= \bigcup_{i \in I} \text{Spec }  \left( B_{i} \otimes_{A} \kappa(y)  \right). \end{align*} Now let $\mathfrak{p}$ be the prime ideal of $A$ corresponding to the point $y \in \text{Spec } A$. Then $\kappa(y) = (A/ \mathfrak{p})_{\mathfrak{p}}$. Then for any of the $B$ (dropping the index for brevity), we have \begin{align*} B\otimes_{A} (A/ \mathfrak{p})_{\mathfrak{p}} &amp;\simeq B \otimes_{A} A / \mathfrak{p} \otimes_{A} A_{\mathfrak{p}} \\ &amp;\simeq B_{\mathfrak{p}} \otimes_{A} A / \mathfrak{p} \\ &amp; \simeq B_{\mathfrak{p}} / \mathfrak{p}B_{\mathfrak{p}} \end{align*}  Now the prime ideals in $B_{\mathfrak{p}} / \mathfrak{p}B_{\mathfrak{p}}$ correspond precisely to the prime ideals of $B_{\mathfrak{p}}$ containing $\mathfrak{p}B_{\mathfrak{p}}$. Further, the prime ideals of $B_{\mathfrak{p}}$ correspond precisely to the prime ideals of $B$ contained in $\phi(\mathfrak{p})B$. That is, we have \begin{align} \text{Spec }B_{\mathfrak{p}} &amp;= \{  \mathfrak{q} \subseteq B :  \phi^{-1}(\mathfrak{q})  \subseteq \mathfrak{p}  \} \\ &amp;=  \{ \mathfrak{q} \subseteq B : f(\mathfrak{\mathfrak{q}}) \subseteq \mathfrak{p}      \}. \end{align} Note that in the very last line we have abused notation slightly: There is not really any notion of being "inside" $\mathfrak{p}$ when it is being treated as a point in the scheme. So really we mean that $f(\mathfrak{q})$ is a point in the scheme whose corresponding prime ideal is a subset of $\mathfrak{p}$. Now as we said above, the prime ideals of $B_{\mathfrak{p}}/\mathfrak{p}B_{\mathfrak{p}}$ are the following $$ \text{Spec }(B_{\mathfrak{p}}/\mathfrak{p}B_{\mathfrak{p}}) = \{ \mathfrak{q} \subseteq B : f(\mathfrak{\mathfrak{q}}) \subseteq \mathfrak{p}      \text{ and } ???  \} $$ This is the point at which I get stuck. Ideally I would like to make some argument from the statement "Now the prime ideals in $B_{\mathfrak{p}}/\mathfrak{p}B_{\mathfrak{p}}$ correspond precisely to the prime ideals of $B_{\mathfrak{p}}$ containing $\mathfrak{p}B_{\mathfrak{p}}$" to conclude that the question marks are the condition $\mathfrak{p} \subseteq f(\mathfrak{q})$. Could someone point me in the right direction as to how to get this condition?   Is the proof up until this point correct? Different sources online seem to do this many different ways, so it's difficult for me to check. $f$ strictly increasing does not imply $f'>0$ We know that a function $f: [a,b] \to \mathbb{R}$ continuous on $[a,b]$ and differentiable on $(a,b)$, and if $f'&gt;0 \mbox{ on} (a,b)$ , f is strictly increasing on $[a,b]$. Is there any counterexample that shows the converse fails?   I have been trying to come up with simple examples but they all involve functions that are discontinuous or has derivative $f'=0$ which does not agree with the hypothesis hmmm How to set page geometry for a single page only? Use of *args and **kwargs SimpleXML: Selecting Elements Which Have A Certain Attribute Value Confused about AMD/Intel When I go to the downloads page to get Ubuntu, it automatically downloads the AMD version, but my computer has no hardware with AMD on it. I only have Intel and Nvidia. Also, when I install this AMD version on my computer, it works (other than the constant random freezing of the computer when I use Ubuntu). I don't really understand why the amd version works on a computer with an intel processor. Clicking leave closed shows the reopen pop-up