Why python use indentation for defining block for conditional statement?
Why does Python pep-8 strongly recommend spaces over tabs for indentation?
How to check type of variable in Java? How can I change GNOME Shell theme? I've installed the GNOME Shell in Ubuntu 12.04 and I want to change the "Shell Theme", But it doesn't allow me to do that.  The alert says something like: "The GNOME-Shell extension is not activated", and I want to install it with the console, But it returns me an error.  How can I solve this problem? Ctrl+Alt+← can usually be set to restart X, however I can't find the option to allow this (it is disabled by default).  I have looked in System-&gt;Preferences-&gt;Keyboard and System-&gt;Preferences-&gt;Keyboard Shortcuts but I can't find an option to enable it.  Where can I change this setting? K-Means clustering for mixed numeric and categorical data My data set contains a number of numeric attributes and one categorical. Say, NumericAttr1, NumericAttr2, ..., NumericAttrN, CategoricalAttr, where CategoricalAttr takes one of three possible values: CategoricalAttrValue1, CategoricalAttrValue2 or CategoricalAttrValue3. I'm using default . It works with numeric data only. So my question: is it correct to split the categorical attribute CategoricalAttr into three numeric (binary) variables, like IsCategoricalAttrValue1, IsCategoricalAttrValue2, IsCategoricalAttrValue3 ? Search [tag1] OR [tag2] Is there a way to search questions that are tagged with either tag1 or tag2?  Actually, I would like the general filter,      ([tag1] AND [tag2], ...) OR ([tag3]   AND [tag4], ...) OR ...   And even     [tag1] AND ([tag2] OR [tag3])   I need that because I'm looking for interesting questions and I have to search for each tag separately. How to execute .sh file on Windows? When I am trying to execute a file(name.sh) in the command line by the command  ./name.sh  , I am getting the error that:     "." is not recognized as an internal   or external command, operable or batch   file   please help me execute the .sh file How can Finder empty Trash more quickly than "rm -rf /Volumes/Foo/.Trashes/501/*"? The "Trash" of a 16-GB usb2 flash drive had 3.4-GB of data. I emptied it as such:     $ cd /Volumes/FooDrive/.Trashes/501   $ rm -rf *   This took over 5-seconds. That seemed pretty long. So, as a test I just decided to empty the Trash of all of my drives via Finder. Other drives: 2-TB usb3 500-GB usb2 16-GB usb2 250-GB ssd  I measured the size of the Trash as such:       $ du -ch /Volumes/WhateverDrive/.Trashes   There was 15-GB in the Trash of the 500-GB drive, and 5-GB in the Trash of my other 16-GB flash drive. I didn't measure the other drives.  Finder appeared to take much less than 5-seconds to empty the Trash for all those drives.   Does Finder really empty the Trash so much more quickly than /bin/rm? How?   Does Finder just make the "clicking sound" (signaling the trash is empty) before the Trash on all the drives is really empty? How to show that the spherical metric satisfies the triangle inequality? For $x,y\in \mathbb R^n$ define  $$d(x,y)={\|x-y\| \over \sqrt{1+\|x\|^2} \sqrt{1+\|y\|^2}}$$ Here $\|x\|$ is the euclidean norm of a vector. How to prove that $d$ (the spherical metric) is indeed a metric?     Progress so far:    $d(x,y)\ge 0$ is obvious. $d(x,y) =0 \iff \|x-y\|=0 \iff x=y$, so the positivity holds. $d(x,y) = d(y,x)$ is clear from the formula, so symmetry holds.    But I am having difficulties with the triangle inequality. Writing it out in coordinates leads to a complicated inequality with square roots all over the place in denominators. Is there a better way? When should I publish in interdisciplinary versus subject-specific scientific journals? Most science research is published in subject-specific journals, of which there are many. However, there are a relatively small number of interdisciplinary journals, some of which are the most highly cited of all journals (Nature, Science); others have impact factors comparable to subject-specific journals (e.g., PLOS ONE, J. R. Soc. Interface, etc.).  If we discount arguments around open science and similar business model arguments (which could favor journals like PLOS ONE), and assume that the purpose of publishing is simply to get your research read (and cited) by the largest "relevant audience", when should one publish in an interdisciplinary journal versus a subject-specific journal (assuming they have comparable impact factors)? (Are there any papers out there that compare the fate of publications [or their authors!] in the two different types of journal?)  Thanks in advance. How was Thor able to dent Captain America's Shield? I was reading about Adamantium on the      Proto-Adamantium   This is the original Adamantium created by Dr. MacLain. Proto-Adamantium is the official name for the metal that makes up Captain America's Shield. It has never been recreated and is the absolute most invulnerable item in all of existence.    This lead me to read about      The true shield was once slightly dented by an enraged Odinforce empowered Thor, using Mjolnir, but he later reconciled and pounded out the small dent.    Was the dent caused by Odinforce or Thor's Hammer? Is Mjolnir or Captain America's Shield "the absolute most invulnerable item in all of existence"? Encrypting a key with the same key, for instance using AES I am new to crypto and trying to understand if it would be insecure to use a cipher such as AES to encrypt a key with the same key. If it is insecure, then why would it be insecure?  Basically, something like this:  encrypt(key, key)   What happens when both key and message are the same (128 bits)?  The obvious question would be why would I want to do that. If I have a secure channel to send the key, why encrypt it? My question is more for understanding. I'm reading page number 4 here. In particular the section where it deals with the case $p=\infty$, that is , showing that $L^{\infty}$ is complete.    Two questions:  1) Why is the convergence uniform? where it says "for $x \in N^{c}$ , $f_{n}$ is a Cauchy sequence of complex numbers. Thus $f_{n} \rightarrow f$ uniformly. Clearly we have pointwise convergence but why is it uniform?  2) I don't see why $||f_{n} - f||_{\infty} \rightarrow 0$. Can you please explain this step?  Thanks.  (3/2015) Edit: The original link appears to be broken.  seems to provide a similar (maybe even identical) proof to the one the OP talks about with slight notational differences. I've got about a billion rows of data in a table with a name and an integer in the range 1-288.  For a given name, every int is unique, and not every possible integer in the range is present--so there are gaps.  This query generates an example case:  --what I have: SELECT * FROM ( VALUES ('foo', 2),               ('foo', 3),               ('foo', 4),               ('foo', 10),               ('foo', 11),               ('foo', 13),               ('bar', 1),               ('bar', 2),               ('bar', 3)      ) AS baz ("name", "int")   I'd like to generate a lookup table with a row for each name and sequence of contiguous integers.  Each such row would contain:  name   --  the value of the name column start  --  the first integer in the contiguous sequence end    --  the final value in the contiguous sequence span   --  end - start + 1  This query generates example output for the above example:  --what I need: SELECT *  FROM ( VALUES ('foo', 2, 4, 3),               ('foo', 10, 11, 2),               ('foo', 13, 13, 1),               ('bar', 1, 3, 3)      ) AS contiguous_ranges ("name", "start", "end", span)   Because I have so many rows, more efficient is better.  That said, I only have to run this query once, so it isn't an absolute requirement.  Thanks in advance!  Edit:  I should add that PL/pgSQL solutions are welcome (please explain any Fancy Tricks--I'm still new to PL/pgSQL). 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. Programmatically obtain the phone number of the Android phone $p_1p_2...p_n +1$ is not square for $p_k = k$'th prime How to import a .sid Raster File in QGIS 2.6.0 On Linux Mint 17 I need some help importing MrSID Raster files in QGIS. I am running 2.6.0 on Linux Mint 17. After an internet search I have found a couple of resources that are perhaps outdated. The most promising is found here :    However when I attempted to follow the instructions my terminal and I could not find the file "libgdal-mrsid-src" on either the stable or unstable Ubuntu GIS repos. Has anyone had success or could lead me in the right direction? Pattern in Isomorphisms between $\mathbb Z_m \times \mathbb Z_n$ and $\mathbb Z_{mn}$ In general, the group $\mathbb Z_{mn}$ under addition $\bmod mn$ is isomorphic to the direct product $\mathbb Z_m \times \mathbb Z_n$ if and only if $\gcd(m,n)=1.$ This is easy to see since $\mathbb Z_{mn}$ is generated by the element $(1,1)$, and if $\gcd(m,n)=1$, then this will only be zero if it is multiplied by itself $mn$ times (resulting in the cyclic group).   However I'm interested in constructing an isomorphism between the two groups as an explicit expression. I've been playing around a bit with some examples, one of which is the function $\phi : \mathbb Z_2 \times \mathbb Z_3 \to \mathbb Z_6$ where $\phi(a,b) = 3a + 4b \pmod 6$, which gives us the desired isomorphism. I'm interested here in the relationship between the integers $2$, $3$, and the coefficients $3, 4$ of $a$ and $b$. After playing around in Wolfram|Mathematica, I managed to obtain the following isomorphisms $\phi_{m,n} : \mathbb Z_m \times \mathbb Z_n \to \mathbb Z_{mn}$ for coprime $m,n$ in $\{1, 2, \dots, 10\}$.   First of all, the following results seem to hold in general.  $$\phi_{1, n}(a, b) = a + b \qquad \text{for all $n$}$$  $$\phi_{m, 1}(a, b) = a + b \qquad \text{for all $m$}$$  $$\phi_{2, n}(a, b) = na + (n + 1)b \qquad \text{for all $n$}$$ $$\phi_{m, n}(a, b) = K a + L b \iff \phi_{n,m}(a, b) = L a + K b \qquad \text{for all $m, n$}$$  Beyond this point, I could not spot a general pattern. The isomorphisms I obtained are:  $$\phi_{3, 4}(a, b) = 4a + 9b$$ $$\phi_{3, 5}(a, b) = 10a + 6b$$ $$\phi_{3, 7}(a, b) = 7a + 15b$$ $$\phi_{3, 8}(a, b) = 16a + 9b$$ $$\phi_{3, 10}(a, b) = 10a + 21b$$ $$\phi_{4, 5}(a, b) = 5a + 16b$$ $$\phi_{4, 7}(a, b) = 21a + 8b$$ $$\phi_{4, 9}(a, b) = 9a + 28b$$ $$\phi_{5, 6}(a, b) = 6a + 25b$$ $$\phi_{5, 7}(a, b) = 21a + 15b$$ $$\phi_{5, 8}(a, b) = 16a + 25b$$ $$\phi_{5, 9}(a, b) = 36a + 10b$$ $$\phi_{6, 7}(a, b) = 7a + 36b$$ $$\phi_{7, 8}(a, b) = 8a + 49b$$ $$\phi_{7, 9}(a, b) = 36a + 28b$$ $$\phi_{7, 10}(a, b) = 50a + 21b$$ $$\phi_{8, 9}(a, b) = 9a + 64b$$ $$\phi_{9, 10}(a, b) = 10a + 81b$$ If you want to try and generate a few yourself, here is the Mathematica function I implemented. I'm sure it can be optimised, but for the first 10 coprime integers it sufficed.  isomorphism[{m_, n_}] :=       Module[{x = Null},       For[i = 1, i &lt; m*n,           i++, (If[#[[2]] == Table[i, {i, 0, m*n - 1}],           x = ToString[#[[1]][[1]]] &lt;&gt; "a+" &lt;&gt; ToString[#[[1]][[2]]] &lt;&gt;          "b"; Break[]] &amp;) /@       Table[{{i, j},       Mod[i #[[1]] + j #[[2]], m*n] &amp; /@       Table[{Mod[i, m], Mod[i, n]}, {i, 0, m*n - 1}]}, {i, 1,      m*n}, {j, 1, m*n}][[i]]]; x];   I'd appreciate if anyone can help me find the pattern to determine $\phi_{m, n}$ in general. Trying to remember a book about a human male travelling to alien planet How to get Scilab 6.0.1 working on Ubuntu 18.04 LTS? I have installed clean Ubuntu MATE 18.04 LTS and installed Scilab from repository here with    sudo apt-get update sudo apt-get install scilab   After installation I tried to launch it from GUI (Applications → Other → Scilab) - it does not start. Then I tried to launch it from terminal with scilab command. Terminal output is as follows:  $ scilab /usr/bin/scilab-bin: error while loading shared libraries: libjava.so: cannot open shared object file: No such file or directory   so it can't find Java. I reported  about this problem.  I checked existence of libjava.so:  $ dpkg -S libjava.so   openjdk-11-jre-headless:amd64: /usr/lib/jvm/java-11-openjdk-amd64/lib/libjava.so   so it is in place.  What should I do to get Scilab 6.0.1 working on Ubuntu 18.04 LTS?