trying to advance from java to Python with no luck
Iterating each character in a string using Python
Illustrator: how to change the artboard number? How to serve static files in Flask How to fix task manager memory column if it shows lies I was studying a  problem where optical light with a wavelength of 500&nbsp;nm travels through a gas with refractive index $n$.  If we look at the equations for wave motion and index of refraction  $$c=\lambda_0\nu\quad\text{(in vacuum)}$$  $$v = \lambda\nu\quad\text{(in medium)}$$  $$n = c/v$$  we see that, if the frequency is constant, the wavelength decreases in the medium compared to vacuum. Is this a consistent property at all frequencies and for all mediums with refractive index real and greater than 1?  Are there dielectrics which change the frequency (still for n > 1), and is there an example of that? Is there any true inertial reference frame in the universe? Is there any true  in the universe?  Newton's first law states that an object at rest remains at rest, and an object performing uniform motion performs uniform motion, until and unless acted upon by an external force, if viewed from an inertial frame. It is the definition of an inertial frame of reference. And Newton's second law states that the net external force acting on a particle equals its mass times its acceleration. Thus we need to have an inertial frame in order for Newton's 1st and 2nd laws to be applicable.  Scientists claim that Earth is an inertial frame, either the  frame or the  frame.  Why is that? Earth's different parts have different accelerations when it performs rotational motion about its axis. Now you may say that Earth's axis is inertial, but the Earth is also revolving around the Sun. Thus Earth's frame should be non-inertial.  Even supposing that earth's frame is inertial, then it means that rest of the universe is non-inertial, because only a frame that moves with constant velocity with respect to an inertial frame is also an inertial frame and according to various scientific experiments there is no other matter in this universe which satisfies that criterion. Now you may say that earth is an approximate inertial frame, but still, my question is: is there any perfect inertial frame in the universe where Newton's laws are exactly applicable? Why would one limit username format? Many websites when ask you to create a new "username", will limit you in some way, most often like "username should only contain letters and underscores" or something alike.  This results in inability to use my email as username and forces me to come up with new unique string all the time.  What is the rationale behind this?  Why not just let users use their emails, as a simple to remember and always unique?   What is generally wrong with having symbols like *&amp;%$#@ as a part of username? What are the fundamental differences between the mainstream *NIX shells and what scenarios might prompt you to use one over the other?  I understand that some of it probably comes down to user preference but I've only ever used Bash and I'm interested to hear where another shell might be useful. Also, is there an impact on user-written shell scripts when running under one shell or another or is it simply a matter of changing the shell at the top of the file?  My instinct says it's not that easy. Drag and drop not working inside Nautilus on Ubuntu 17.10 I'm having a strange problem on Ubuntu 17.10: when I try to drag and drop something inside Nautilus it simply doesn't work, it doesn't even select the item, it seems like it's ignoring the action... Also, I cannot select things inside nautilus by drawing rectangles with the mouse.  All of these actions work only on the Desktop. Here is a demo:    I'm using the Xorg session with nVidia proprietary drivers. I also noticed that Nautilus seems to hang when I try to copy, paste or cut a file...  EDIT 1: I solved the problem for the slow copy/paste by disabling the clipboard sync plugin of KDEConnect. I also discovered that if I open Nautilus as root, I can drag and drop or select whatever I want... I'm currently in the process of making a custom map and I want to add blocks that can only be placed on a certain colour clay.  This is the command I tried using.  /give @p cobblestone 1 0 {CanPlaceOn:["hardened_stained_clay"],Damage:3}   However, even with this command the cobblestone can be placed on any colour of stained clay. What command can I use for placing only on a certain block? heat weighting: failed to find solution for one or more bones Here is the .  Picture:   It's nothing special but I cant figure out why I get problems rigging this mesh. It would be important and a great Help! Thanks for reading and I know there are a lot of guides answering this question but I tried all and it doesn't seem to work. $\lim_{x \to 0} f(x)=\frac{\tan 3x}{\tan 2x}$ without L'Hospital Can every non-simple group $G$ be written as a semidirect product? When people want to classify a group with certain (small) order, they seem to find a normal subgroup $H$ and a subgroup $K$, and then consider how many distinct $H \rtimes_\varphi K$ are there.  My question is: For any group $G$, does it always exist normal subgroup $H$, subgroup $K$ and $\phi : K \rightarrow Aut(H)$ s.t. $G\cong H \rtimes_\varphi K $?  Sorry if this question is too basic...  Thanks the comment and the answers. Then if the $G$ is not simple, can we have can $G\cong H\rtimes_\varphi K$ for proper subgroup $H$, $K$, with $H$ normal?  EDIT:  If we have a group $G$, that is not simple (then $G$ has at least one normal subgroup), are there always a non-trivial normal subgroup $H$ and a proper subgroup $K$ s.t. $G \cong H \rtimes K$. (Note that if $G$ is simple this is clearly not possible).  But the quaternion group and $Z_4$ given in answers have shown that we cannot always have it. I'm looking for a book that starts with the premise that (once the population size had exceeded a certain number) the future development of mankind (revolutions and wars in so and so many years, colonization of other planets in so and so many years, and so on) could be predicted completely by applied statistics. (IIRC, they used slide rules for those exact predictions, but that is certainly owed to the time the story was written). Next, the predictability was used to take a few tiny measures that would change mankind's fate in a favourable way. After a long time, the predictive system fails(?) because a mutation occurs in some person(s).  And now is the part where I'm not sure if it belongs to this or another story: The mutation results in the ability to "beam" by thinking of a place where one has been before... How much longer will my 10 year old frame last? Why are some applications so hard to find in the Ubuntu Software Centre? Some applications don't pop up in the search even when you type in their name. Take for instance Sushi. When you type in "sushi" into the search box, it fails to throw up the application. Only when you type in "gnome-sushi" does it appear. This is despite the fact that the application has "sushi" by itself in the application description. There are other applications which don't spring to mind right now, but I've discovered before. How do I install Geforce GTX 660 in 13.10 Just bought a Geforce GTX 660 and replaced my Radeon HD 5870 (it finally died after 3 years). I'm having terrible problems getting the video card to work. As I only had command line options so far I've ran:  (purged fglrx*)  then  sudo add-apt-repository ppa:xorg-edgers/ppa sudo apt-get update sudo apt-get install nvidia-331  and then I started getting low graphics mode errors. did some searching on my tablet, and I tried several things but what finally worked better was:   sudo apt-get install bumblebee bumblebee-nvidia  However now that I'm logged into my computer finally, I have no access to terminal, no access to the top bar, and hitting Super Key does nothing, alt-f2 does nothing, and I only can post because I tried running WoW and it had an error and the error report opened a link.   All I can see on my desktop is my wallpaper and desktop icons. I can CTRL+ALT+F1, and navigate to the downloaded official nvidia driver, however that won't run because of x-server, and I can't run it from my desktop.   Can anyone help me? Calculating with Mathematica, one can have $$\int_0^{\pi/2}\frac{\sin^3 t}{\sin^3 t+\cos^3 t}\,\mathrm dt=\frac{\pi}{4}.$$   How can I get this formula by hand? Is there any simpler idea than using $u = \sin t$?     Is there a simple way to calculate $$ \int_0^{\pi/2}\frac{\sin^n t}{\sin^n t+\cos^n t}\,\mathrm dt $$ for $n&gt;3$? Could anyone come up with a reference for this exercise? Standard purpose of favorites I am wondering if my behavior regarding favorites is typical.  More importantly, if it isn't typical, does my behavior conflict with an internal metric designed to reward favorite'd questions?  I mark a question as a favorite for a few reasons:  A -- I find the question/answer(s) remarkable enough that coming back to them time and time again is of benefit to me.  B -- I am waiting to see if a sub-par quality question is going to be revised enough for me to come back and answer it.  Either way, I eventually remove my favorite.  C -- I have answered a question (of any quality) and am wanting to be notified of any competing answers.    Situations B and C are the most common for me and they typically mean I will go back and remove my favorite star later; I don't remove it because the quality of the question degraded, I merely don't want to be notified any longer.  Even stranger, I am often favoriting questions that are rather low-quality (reason B) making me wonder if low-quality posts are being rewarded via some invisible metric because I (at least temporarily) have given it what looks like a stamp of approval akin to an up-vote.    I suppose the feature being called "Favorite" makes me confused because most of the questions I select are not my favorite.  Am I accidentally messing with an invisible metric that is drawing attention to posts when that isn't desired behavior? Given an InputStream called in which contains audio data in a compressed format (such as MP3 or OGG), I wish to create a byte array containing a WAV conversion of the input data. Unfortunately, if you try to do this, JavaSound hands you the following error:  java.io.IOException: stream length not specified   I managed to get it to work by writing the wav to a temporary file, then reading it back in, as shown below:  AudioInputStream source = AudioSystem.getAudioInputStream(new BufferedInputStream(in, 1024)); AudioInputStream pcm = AudioSystem.getAudioInputStream(AudioFormat.Encoding.PCM_SIGNED, source); AudioInputStream ulaw = AudioSystem.getAudioInputStream(AudioFormat.Encoding.ULAW, pcm); File tempFile = File.createTempFile("wav", "tmp"); AudioSystem.write(ulaw, AudioFileFormat.Type.WAVE, tempFile); // The fileToByteArray() method reads the file // into a byte array; omitted for brevity byte[] bytes = fileToByteArray(tempFile); tempFile.delete(); return bytes;   This is obviously less desirable. Is there a better way? Why am I getting authentication errors for packages from an Ubuntu repository? I'm experimenting with VPNs, so I wanted to install pptpd.  john@desktop:~$ sudo apt-get install pptpd [sudo] password for john:  &lt;snip&gt; The following extra packages will be installed:   bcrelay The following NEW packages will be installed:   bcrelay pptpd 0 upgraded, 2 newly installed, 0 to remove and 11 not upgraded. Need to get 90.5 kB of archives. After this operation, 442 kB of additional disk space will be used. Do you want to continue [Y/n]? y   And everything runs fine until I get down to here:  WARNING: The following packages cannot be authenticated!   bcrelay pptpd Install these packages without verification [y/N]? n E: Some packages could not be authenticated   No authentication?  I'm no security expert, but I'm fairly sure that's a bad thing.  So I .  john@desktop:~$ apt-cache policy pptpd pptpd:   Installed: (none)   Candidate: 1.3.4-3ubuntu1   Version table:      1.3.4-3ubuntu1 0         500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages john@desktop:~$ apt-cache policy bcrelay bcrelay:   Installed: (none)   Candidate: 1.3.4-3ubuntu1   Version table:      1.3.4-3ubuntu1 0         500 http://us.archive.ubuntu.com/ubuntu/ natty/main i386 Packages   They're coming from Ubuntu.com and not being properly authenticated?  What's going on here?