how to get repeated elements from ruby array?
How to find and return a duplicate value in array
subideals of an ideal If $R$ is a ring, J is an ideal in $R$, and $I$ is an ideal of $J$ (with $J$ considered as a ring), does it follow that $I$ is an ideal of $R$?  That is, is $I$ necessarily closed under multiplication by elements of $R$?  Surely $I$ is closed under multiplication by elements of $J$ (since $I$ is an ideal of $J$).  The "obvious" approach to proof fails so quickly that it must be false, that "an ideal of an ideal is not necessarily an ideal of the big ring".  Please provide a counterexample.  (Or a proof?) Is there a way to block a list of specific apps on macOS?  I have looked up solutions such as Cisdem, but there are some holes in the way it works that I don't like.   Unless you also block Activity Monitor, Terminal, and System Preferences, you can simply quit the Cisdem process or create a new user to get around it. You have to block Activity Monitor, Terminal, and System Preferences to make it work well.   I want to block an app from running or even being installed on my Mac. The app can be installed via the App Store and the web. Not sure how to go about this. Enabling Parental Controls won't work as Administrator privileges are needed.   The specific app I want to block is Apple Configurator.  Any ideas? Does the limit $\lim _{x\to 0} \frac 1x \int_0^x \left|\cos \frac 1t \right| dt$ exists? Does the limit $\lim _{x\to 0} \frac 1x \int_0^x \left|\cos \frac 1t \right| dt$ exists ? If it does then what is the value ?   I don't think even L'Hospital's rule can be applied . Please help . Thanks in advance In January, some additional whitespace  below h1, h2 and h3 headings,  more whitespace below the headers than above them.  Could we have the whitespace above the headings be more than the whitespace below them?  I find some posts a bit hard to read, like the current rendering on the left:   &nbsp; &nbsp; &nbsp; Taking advantage of one-time pad key reuse? Suppose Alice wants to send encryptions (under a one-time pad) of $m_1$ and $m_2$ to Bob over a public channel.  Alice and Bob have a shared key $k$; however, both messages are the same length as the key $k$.  Since Alice is extraordinary lazy (and doesn't know about stream ciphers), she decides to just reuse the key.  Alice sends ciphertexts $c_1 = m_1 \oplus k$ and $c_2 = m_2 \oplus k$ to Bob through a public channel.  Unfortunately, Eve intercepts both of these ciphertexts and calculates $c_1 \oplus c_2 = m_1 \oplus m_2$.     What can Eve do with $m_1 \oplus m_2$?     Intuitively, it makes sense that Alice and Bob would not want $m_1 \oplus m_2$ to fall into Eve's hands, but how exactly should Eve continue with her attack? A new version of Ubuntu has been released. I still can't find it on ubuntu.com. Where can it be downloaded from, or is it the only way to install it using update-manager to upgrade an existing installation? Related to : The question specifies morphs, but I wondered if this was true for Manifest as well? As Manifest is not an ability on the card, does  prevent it from being turned face up for its mana cost? Every finite set contains its supremum: proof improvement. Every finite subset of $\mathbb R$ contains its supremum (and its infimum)   Proof Let $A=\{a_1,...,a_n\}$ be a finite subset of $\mathbb{R}$. Since it is non-empty and it is bounded ($\max A$ is an upper bound), it has supremum, that is $\exists \sup A$ and by definition $\forall a \in A \;\, a \leq \sup A$. Let's suppose that $\sup A  \not\in A$ then, since $\max A \in A$ we have that $\max A &lt; \sup A$. But considering that $\mathbb Q$ is dense in $\mathbb R$ we can conclude that $\exists r \in \mathbb Q$ s.t. $\max A &lt; r &lt; \sup A$, but this is absurd since $r$ is an upper bound of $A$ and it is lower than the supremum. Necessarily, $\sup A\in A$.  Is there anything wrong? Is there any way to prove this without using density of $\mathbb Q$ or another property? Thanks in advance. I would like to add in QGIS real time weather data.  I found this  and this  and I tried to follow the example, but without any success.  I've added a WMS weather data layer for precipitation to the QGIS map, as follows:  First, the parameters for the service:  service = 'crs=EPSG:900913&amp;dpiMode=7&amp;featureCount=10&amp;format=image/png&amp;layers=precipitation&amp;styles=&amp;url=http://wms.openweathermap.org/service'   Next, create the raster layer, specifying WMS as the type:  rlayer = QgsRasterLayer(service, "precip", "wms")   Finally, add the precipitation layer to the map:  QgsMapLayerRegistry.instance().addMapLayers([rlayer])   the example didn't show any error in the code and no data was added to the weather layer either, I'm not sure why? Filling triangle doesn't seem to work with PGF/TikZ I was wondering if anyone had any clue on why my triangles are not filled in red within the following piece of code:  \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc,3d}  \usepackage[active, pdftex, tightpage]{preview} \PreviewEnvironment[{[]}]{tikzpicture} \newcounter{number}  \begin{document} \begin{tikzpicture}[x  = {(-0.5cm,-0.5cm)},                     y  = {(0.9659cm,-0.25882cm)},                     z  = {(0cm,1cm)}] \begin{scope}[canvas is yx plane at z=0] \foreach \x / \y / \label in {1 / 0.4 / 1, 0.9 / 0.4 / 0, 1 / 0.5 / 1, 0.7 / 0.3 / 0, 0.8 / 0.4 / 0, 0.9 / 0.5 / 0, 1 / 0.6 / 1, 0.7 / 0.4 / 0, 0.4 / 0.4 / 0, 0.6 / 0.4 / 0, 0.5 / 0.4 / 0, 0.8 / 0.5 / 0, 0.9 / 0.6 / 0, 1 / 0.7 / 1, 0.7 / 0.5 / 0, 0.5 / 0.5 / 0, 0.4 / 0.5 / 0, 0.6 / 0.5 / 0, 0.8 / 0.6 / 0, 0.9 / 0.7 / 0, 1 / 0.8 / 1, 0.7 / 0.6 / 0, 0.6 / 0.6 / 0, 0.5 / 0.6 / 0} { \addtocounter{number}{1} \pgfmathparse{\value{number}}\let\k\pgfmathresult \draw (8 * \x, 8 * \y) node[inner sep=0, outer sep = -0.1pt,color=black,fill,circle] (node-\k) {}; };  \foreach \x / \y / \z / \trash in { 4/5/8/0, 9/11/16/0, 9/16/17/0, 11/10/18/0, 11/18/16/0, 10/8/15/0, 10/15/18/0, 8/5/12/0, 8/12/15/0, 5/2/6/0, 5/6/12/0, 2/1/3/0, 2/3/6/0, 17/16/24/0, 16/18/23/0, 16/23/24/0, 18/15/22/0, 18/22/23/0, 15/12/19/0, 15/19/22/0, 12/6/13/0, 12/13/19/0, 6/3/7/0} { \draw[fill=red]  (node-\x) --  (node-\y) --  (node-\z) -- cycle; } \end{scope} \end{tikzpicture} \end{document}) Man is sitting in his room and gets contradictory advice from two men from the future Objects not rotating or scaling in viewport Rotating a gyroscope's output values into an earth-relative reference frame For whatever reason, I seem to have gotten myself twisted into quite a confusion on how to process data from my 3 axis gyro and 3 axis accelerometer to get gyro rotation values related to the earth's reference frame. i.e. Given my accelerometer measures gravity (we assume it's stable) along the sensors (x,y,z) reference frame, how do I adjust the values of my gyro, measured along the sensors same (x,y,z) reference frame such that I am actually measuring the rotating about the Earth's frame x (North), y (West), and z (downwards) direction?  I just can't seem to wrap my head around the use of the rotation matrix. Do I simply employ a 3d rotation matrix, and multiply the vector, \$[gyro_x, gyro_y, gyro_z]^T\$, by a rotation matrix, R? I then assume the rotation angles, are somehow derived from the filtered accelerometer outputs, but I'm having trouble deciding on what those should be.  I have yet to find a concise reference on how to move the rotation and acceleration values from the sensor reference frame into the earth global reference frame. Perhaps someone can help? Thanks How can I start up an application with a pre-defined window size and position? I'm wondering is there any way to achieve the affect of the Ctrl-Alt-Keypad shortcuts in Unity using terminal commands instead? I want a command that sets a gui window to half the size of the screen, either left or right aligned.  By way of background, I'm writing a script that runs after log in. It uses Zenity to ask whether or not I want to open my development environment (GVim and IPython side-by-side). I have been trying to achieve two equal-sized windows for these programmes by using set lines= columns= in my .gvimrc and c.IPythonWidget.width = and c.IPythonWidget.height = in my ipython_qtconsole_config.py. However, there are problems associated with this approach. Consider the question :    The large number of down-votes displays as 199 rather than a score of -199.  This is clearly unintentional (and unfortunate for questions that possess such voting!), but can this be&nbsp;corrected? How do I use dependency injection on \Drupal::moduleHandler() to a Controller? I am using the following line in a controller class.      \Drupal::moduleHandler()-&gt;alter('mymodule_myfunction', $plugin_items);   Pareview.sh is giving me this error message.     \Drupal calls should be avoided in classes, use dependency injection instead.   How should I accomplish this? Do I need to create a constructor, create a method, or a service? If so, what code should the service need? I found an example on  for a case where a service already exists. I am trying to write an if statement to test whether there are any files matching a certain pattern. If there is a text file in a directory it should run a given script.  My code currently:  if [ -f /*.txt ]; then ./script fi   Please give some ideas; I only want to run the script if there is a .txt in the directory. We had a quiz in class today where we had to break the ciphertext with the key given, but not the algorithm. Suffice to say that I wasn't able to decrypt it within the allotted time of 12 mins and will probably get a 0% score on the quiz.  So, I was just wondering if there are some kind of standard techniques that are followed when decrypting a simple substitution ciphertext. Can you use Skyrim Legendary Edition mods on the normal edition? I just figured out I had Skyrim in my Steam games. It's the 32-bit non-Legendary Edition Skyrim without any DLCs. Can I still use Legendary Edition mods on it? How to interpret Vgs(th) min/max in a MOSFET datasheet? This is a screenshot of IRF9640 MOSFET datasheet. Will you please tell me, what is meant by max and min value of Vgs threshold voltage. Also what they mean by test condition.  Whether the max and min values are only applicable for specified test condition? What will be the threshold voltage for a switching circuit and how the range varies?  My doubt is, for p channel mosfet to turn on Vgs &lt; Vgs(th). For IRF9640 in what volt it will turn on -3 or -5? When i used in my application Vs is 6v and Vg is 3v hence Vgs=-3v but it won't turned on, Why? It turned on when Vgs=-3.3v.  If we consider -2v as threshold, it should turn on when Vgs=-3v. Why they given a range for threshold voltage. Whether we have to test each mosfet to know their threshold. What i am pointing is that, if we have two IRF9640, will Vgs(th) is differ from each other?