What is the most efficient way to check if item exists in Arraylist?
Most efficient way to see if an ArrayList contains an object in Java
My friend recently received a new digital drawing tablet (Wacom Intuos Pro). Among other features, there is a hole that resembles a charm hole found on mobile phones:    Other parts of the package (e.g. pen) do not have such holes, so it isn't possible to attach them using a band. What is the purpose of this hole? Is it just for attaching various charms and such? Expected number of games played in a game with 'win by two' rule. Calvin and Hobbes play a match consisting of a series of games, where Calvin has probability p of winning each game (independently). They play with a “win by two”” rule: the first player to win two games more than his opponent wins the match. What is the expected number of games played? My attempt: I use Markov chains. Let $S$ denote that starting state, $W$ and $L$ denote the states where Calvin and Hobbes win respectively. Then, I have $$\mu_S = 1+ p\mu_W+q\mu_L $$ $$\mu_W = 1+ q\mu_S $$ $$\mu_L = 1+ p\mu_S $$ where $\mu_j$ denote the expected number of games from state $j$. Solving the system, I get the solution $\mu_S = \frac{2}{1-2pq}$ which I think is correct. I however would like to know how to approach it with geometric distribution instead of Markov chains. I read one solution where the number of games is given as $1+\text{Geom}(p^2+q^2)$ but I do not understand it. My understanding is that for the game to stop, the required probability is $p^2 + q^2$ since this is the probability that either Calvin or Hobbes win two games in a row. How to use this information in a Geometric random variable? Thanks. Butterknife appears twice in the OSS attribution list of the Android app (v1.0.85). Based on the links, the second one should be JMustache. This has been a old live-action movie from Asia, most likely Japan. I've seen it some time in the late 80's and I think it's been black/white only.  Earth is invaded by UFOs (small and round, like flying balls), coming from Mars.  Japan (I think) built some kind of super spaceship, initially hidden within some secret port in some kind of island/mountain.  The spaceship looks similar to a classic battleship, but with an added drill below the front.  In the movie's finale it's revealed that this is some kind of   super weapon/bomb that has to be manually piloted by someone. When launched it starts rotating and flies (formed like a bullet but with the drill/corkscrew head).   To defend Earth, the ship is sent on a mission to Venus, where the UFOs seem to originate. I don't remember the specific reason or conclusion here.  The ship starts underwater or launches from the mountain on the island, then taking off and fighting UFOs while leaving Earth's atmosphere. H2G2 — Teleportation Also Results in Time Travel? When asking about , people sometimes refer to the strict aliasing rule. What are they talking about? In many countries an application for a PhD position includes a written research proposal, so my questions is what are some advises/strategies to come up with a good topic/idea for a PhD research proposal and how can one assess the quality/fruitfulness of an idea? As an undergraduate student one just doesn't have the experience to foresee which ideas might have promising research results and which probably won't have. (And I doubt that potential supervisors have the time to comment on every idea of every potential applicant in cases where it is possible to establish some kind of contact before the actual application.) How do I check the integrity of a storage medium (hard disk or flash drive)? How can I block all ports except some? I am trying to use iptables but I am clueless in understanding the documentation even so that I've locked myself out of my server twice already whilst trying to implement it.  These are the simple rules that I want to implement:   Allow ports 80, 6667 and 6697 to everyone Allow port 22 to just my IP for example 10.10.10.10   Please can someone help me implement these simple rules, without locking myself out? i am finding nowhere a solution I am running UBUNTU 12.04 and using GNOME desktop, which I installed additionally. Logging into classic GNOME I see the following:     WHAT is this "earth globe" icon coming from?Seems to be named "starter". It is configured to open a website, from my bookmarks. WHY is it not showing the TIME?   Using dconf-editor I had no luck in answering the above questions.  Any idea? A few months ago I was introduced to the new  type and was glad 's flaws with regard to time zones were finally taken care of.  However, I was left wondering if there were any overhead or problems that could occur from using this new type.  I work on a multi-locale web application. Does anyone know of anything that could sway me from just using it for all my date/time work? Is there a window for abuse here?  Reference: I first heard this phrase in an episode of Family Guy, and they're typically fans of referencing older shows and movies, especially from the 80s. So I'd assumed it was a fairly commonly known thing.  Then I came across it in a friend's novel. The novel is in a Southern American, older time setting, which is about where I'd expect to find examples of it.  Then I had a look online and couldn't find examples of the phrase or it's origin.  Is there such a phrase and origin? Or is this just a coincidence with people choosing something that sounds equally old-timey? When I install Selenium I get the following error:  Shubham@Shubham-To-be-filled-by-O-E-M:~$ sudo apt-get update     Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [107 kB]     Hit:2 https://repo.skype.com/deb stable InRelease                            Hit:3 http://in.archive.ubuntu.com/ubuntu xenial InRelease                          Get:4 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]     Get:5 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]       Fetched 323 kB in 8s (38.6 kB/s)                                                    Reading package lists... Done     Shubham@Shubham-To-be-filled-by-O-E-M:~$ sudo pip install selenium     Traceback (most recent call last):       File "/usr/bin/pip", line 9, in &lt;module&gt;         from pip import main     ImportError: cannot import name main   How should I proceed? Question is :  For a differentiable function $f:\mathbb{R} \rightarrow \mathbb{R}$ what does $\lim_{x\rightarrow +\infty} f'(x)=1$ imply?  Options:    $f$ is bounded $f$ is increasing $f$ is unbounded $f'$ is bounded   I could not find counter examples but then, I strongly feel $\lim_{x\rightarrow +\infty} f'(x)=1$ would just imply that $f'(x)$ is bounded.  I do not have much idea why would other three are false.  I would be thankful if someone can suggest me some hints.  Thank You. Using apostrophes correctly I've read a great article about the . But there are still some points that are unclear.  Why do we say...   school project but not school's project? car service but not car's service or even cars' service (plural form)? apostrophe usage but not apostrophe's usage or apostrophes' usage? Is there a name based virtual host SSH reverse proxy? I've grown quite fond of HTTP reverse proxies in our development environment and found the DNS based virtual host reverse proxy quite useful. Having only one port (and the standard one) open on the firewall makes it much easier for management.  I'd like to find something similar to do SSH connections but haven't had much luck. I'd prefer not to simply use SSH tunneling since that requires opening port ranges other than the standard. Is there anything out there that can do this?  Could HAProxy do this? What does bookmarking a question mean? How do you bookmark a question? Do users get updates on their bookmarked questions? Are my bookmarks publicly visible? How do you see your own bookmarks? How do you see other users' bookmarks? How do you see which users have bookmarked a particular question? What impact does the bookmark system have on the voting system? Can I &quot;un-bookmark&quot; a question? Can I search within my bookmarks? "the better" vs "the best" of two players Javascript add leading zeroes to date Add custom command in the open with dialog? In earlier versions of Ubuntu (10.10-) there was an option in the "open with" tab in the properties window, to add a custom command to open a file. However, this is no longer the case in Ubuntu 11.10. Is there any way that I can add these file type associations with a command of my choice rather than the applications detected by the system.