detect duplicate character in string
How do I compare strings in Java?
Let $\{a_n\}$ be an unbounded, strictly increasing sequence of positive real numbers and let $x_k=\frac{a_{k+1}-a_{k}}{a_{k+1}}$. Which of the following statements is/are correct? (CSIR NET December 2014)         For all $n\geq m, \sum\limits^{n}_{k=m}x_k&gt;1-\bf{\frac{a_m}{a_n}}$   There exist $n\geq m, \sum\limits^{n}_{k=m}x_k&gt;\frac{1}{2}$      My attempt:  Analysing question in light of $a_k=k\implies x_k=\frac{k+1-k}{k+1}=\frac1{k+1}$, I feel both are correct, I doubt if  I can generalise the result in light of this one example.   Any way to prove that this true for general case?    Note: Please do not confuse  with my question. The first two options are different, I've marked the difference in bold. How to find the sum of the sequence $\frac{1}{1+1^2+1^4} +\frac{2}{1+2^2+2^4} +\frac{3}{1+3^2+3^4}+.....$ Problem :   How to find the sum of the sequence $\frac{1}{1+1^2+1^4} +\frac{2}{1+2^2+2^4} +\frac{3}{1+3^2+3^4}+.....$  I am unable to find out how to proceed in this problem.. this is a problem of arithmetic progression... Please suggest how to proceed...Thanks.. How to format a USB or external drive? Using Ubuntu 11.10, how do I format an external or USB drive? I don't find an option to 'format' when I right click. In the new version, the drives don't come up on the desktop, but instead come on the Launcher. How to stack three relations I'm using Ubuntu and I'm trying to connect to another machine in a different network using remote desktop.   In Windows7 I have made the following in order to activate remote desktop:   I've gone to computer -> properties -> remote settings I've selected the option: "Allow connections from computers running any version of Remote Desktop I've opened "Windows Firewall with Advanced Security" In inbound rules I've enabled the rules for remote desktop (public and domain)   I have also installed Remmina in the Ubuntu machine.  For configuring it I did the following steps:   Selected the RDP protocol In the server input I have written the Windows machine public IP. In username / password I have typed my login credentials (the same as my Windows admin account)   But when I try to connect I get this error message:  "Unable to connect to RDP server 89.130.251.160"  If I ping my Windows7 machine, I have a correct response.  Any suggestions? The Earth is spinning, so why don't we jump and land on a different location? I know there are similar questions on StackExchange but I think it is different and detailed.  The earth is spinning 465 meters/second so why don't we jump and land on a different location?  I googled about this question and I got some answers:   When we jump, we (and the atmosphere itself) also spin along with the earth so we don't land at a different location. (But why we are also spinning along with earth ?) The earth is so big and we are very small relative to earth so the tiny jump won't make any difference.   But according to answer 1, We are also spinning with the earth. But the question is, "why are we also spinning along with earth" ??  Regarding the answer 2, it won't make any difference but logically it doesn't make sense or I just don't understand it.  Here is the followup question,   "When we jump why don't we thrown out of earth due to centrifugal force of the spinning earth ??"  Please provide some detailed answer to these questions. With logic if possible.   This phenomenon is not possible I know, but even if it exists, then traveling will be so easy, we just have to hang on space (with help of helicopter etc.. ) and we can travel the whole world in 24 hours :D In my lecture, the lecturer said:      Let $K$ be the key generation algorithm. Given a security parameter represented in unary, $1^k$, $K(1^k)$ will output a keypair $(pk; sk)$, known as the public key and the private (or secret) key, respectively.    My question is: When I want to implement the cryptosystem, how should I represent this $1^k$?  When I implement the key generation procedure, do I literally require callers to pass me a string of $k$ one-bits that the procedure will never use?  And, if so, why is it there in the first place? Will the silhouette formula change depending on the distance metric? I am using Silhouette width to compute the best value for k in k-means. As I am performing document clustering, I am calculating the values of a and b as follows in Python:  a = distance(data[index], centroids[clusters[index]], metric=metric, p=p) b = min([distance(data[index], c) for i,c in enumerate(centroids) if i != currentindex]) score = float(b - a) / max(a, b) if max(a, b) &gt; 0 else 0.0   The original formula from the  is the following:    I am using a cosine similarity measure to compute the distances and was wondering if this formula needs to be changed or it can be left as is. In the above snippet of code, the function distance computes the cosine similarity metric. What is meant by "obfuscate by pretending"? I came accross the following sentence:  "Politicians obfuscate by pretending that the world would be the same if it weren't for the Cold War."  What is the meaning of obfuscate by pretending and how does it relate to the rest of the sentence?  The way I understood it: politicans are aware that the world would not be the same if it weren't for the Cold War, but are (due to unknown or suspected reasons) not willing to admit this and therefore pretend otherwise. Question on operator: // N Did Sidious know the secret of cheating death? In Star Wars: Revenge of the Sith, Chancellor Palpatine tells Anakin the tale of Darth Plagueis the Wise. He told Anakin that if he joined the dark side he could save the people he loved from death by extending their midichlorian count, just as Darth Plagueis had done (obviously more subtly than that).  When Anakin asked what had happened to Plagueis, Palpatine says:      Unfortunately, he taught his apprentice everything he knew. Then his apprentice...killed him in his sleep.   It is revealed (not in the movie) that it was Palpatine himself that was Plagueis' apprentice  After Anakin and Palpatine kill Mace Windu, Palpatine says,     To cheat death is a power only one has achieved, but if we work together I know we can discover the secret.   This implies that Palpatine doesn't already know the secrets but if Plagueis taught him "everything he knew" then surely he would have.  So did Sidious know the entire time or was "everything he knew" an exaggeration?  Just to be clear when I say "cheat death" I only mean extending someone's midichlorian count, not "transfer essence" or anything else like that. How to check iOS version? Are all multiplicative functions additive? Greek Text (babel) and English Code Text (listings): Problem I use the babel package in order to write in greek with font "kerkis".  I want to add code in english ("courier new" font) to my latex document but I get some difficulties.  Can anybody help me, please. Thank you in advance.  \documentclass[12pt]{article} \usepackage[english,greek]{babel} \usepackage[utf8x]{inputenc} \usepackage{graphicx} \usepackage{fancybox} \usepackage{verbatim} \usepackage{courier} \usepackage{kerkis} \usepackage{float} \usepackage{geometry} \usepackage{fancyhdr} \usepackage{titlesec} \usepackage{tocloft} \usepackage{hyperref} \usepackage{afterpage} \usepackage{color}    \usepackage{listings}  \renewcommand{\lstlistingname}{Κώδικας}  \lstset{  %matlab   backgroundcolor=\color{white},     basicstyle=\normalsize,    % COURIER NEW?        commentstyle=\color{green},    % comment style   escapeinside={\%*}{*)},           extendedchars=true,               frame=single,                              keywordstyle=\color{blue},       % keyword style   numbers=left,                     numbersep=5pt,                     numberstyle=\normalsize\color{black},    rulecolor=\color{black},           stepnumber=1,                      stringstyle=\color{magenta},     % string style }   \begin{document}  \selectlanguage{greek} Ελληνικά: \textlatin{this word means greek}  \selectlanguage{english} Now I write in english  \selectlanguage{greek} Ελληνικά  %\selectlanguage{english}???  \begin{lstlisting}[caption = \textlatin{example1.m}] { % Entropy E = 0; for i = 1:J     if p(i) ~= 0         E = E + p(i)*log2(1/p(i));     end end } \end{lstlisting}  \end{document} Try to do something vs. Try doing something Is there any differences between      Try to do   And     Try doing   Thank you in advence. CDF of absolute value of difference in random variables Why are bias nodes used in neural networks?  How many you should use?  In which layers you should use them: all hidden layers and the output layer? How to execute a script just by double clicking like .EXE files in Windows? How can I make a bash script executable by double clicking just like .exe files in Windows? I tried , but there are two consequences:   the terminal twinkles, disappears, and nothing is done. you must specify to run in terminal in order to work.   I have a script that installs tomcat on an offline PC, including all dependencies of tomcat in the script. I need to make the script work on double clicking like windows since most who use the script will not be familiar with Ubuntu.  Forget the above explanation. I want to make a script that can be run by double-clicking on it, without using the terminal. Anybody knows how? When can we find holomorphic bijections between annuli? What is the meaning of this sentence - "Were it not for the bodies there on the ground, it would have appeared to be a normal day at the oasis."? Possible Duplicate:          What is the meaning of this sentence - "Were it not for the bodies there on the ground, it would have appeared to be a normal day at the oasis."?  Does it mean something like this - If the bodies were not there on the ground, it would have appeared to be a normal day at the oasis.  Can anyone also explain the structure of this sentence and example of some similar sentences?