Getting screenshot using PhantomJS in C#
How can I take a screenshot with Selenium WebDriver?
What's wrong with this demonstration?:  $$A \iff 1 = 1^1$$ $$A \implies 1 = 1^\frac{2}{2}$$ $$A \implies 1 = (1^2)^\frac{1}{2}$$ $$A \implies 1 = ((-1)^2)^\frac{1}{2}$$ $$A \implies 1 = (-1)^\frac{2}{2}$$ $$A \implies 1 = (-1)^1 = -1$$  So finaly we get  $$1 = -1$$ Is there a way to override class variables in Java? Probability of false positive key matching two plaintext/ciphertext pairs Given a keyspace of $ 2^{80} $ and plaintext space of $2^{64}$. And two plaintext and ciphertext pairs $(x_1, y_1)$ , $(x_2, y_2)$. Now we have $2^{80}/2^{64} = 2^{16}$ keys that encrypt $x_1$ to $y_1$ and another $2^{16}$ keys that encrypt $x_2$ to $y_2$, with only one key that is supposed to be the target key (correct key). What is the probability that once brute-force identifies a first key ($k_1$) this same key happen by mistake to also encrypt $x_2$ to $y_2$, that is this this key happen to be a False-positive (that is, this key will likely not encrypt $x_3$ correctly). What is the equation used and how is it derived? I have two identical folders, with same structure and contents like this:  folder_1   hello.txt   subfolder     byebye.txt  folder_2   hello.txt   subfolder     byebye.txt   if I compress them as tar.xz formats I get two different archives with two different file sizes (just a few bytes, but they're not identical).  $ cd folder_1 &amp;&amp; tar -Jcf archive.tar.xz * $ cd folder_2 &amp;&amp; tar -Jcf archive.tar.xz *   I get:  folder_1/archive.tar.xz != folder_2/archive.tar.xz   and of course if I md5sum or sha1sum them I'll get two different hashes  And that's my problem... I need to check if a provided archive is identical to the one I have in my storage. I cannot use hashing nor just check file sizes.  Using zip instead of tar.xz works as zip always produces identical achives from identical files. Why is this happening? Is there a way to prevent it? Say I have a cologne bottle of 100 ml that I want to carry in my hand luggage on a plane trip.  100 ml is the limit so it should be fine for the transport regulations (if not, please let me know!).  The problem I always encounter is regarding the storage of the bottle: how to prevent it from leaking?  What I normally do is to put it in a plastic bag, so that the possible loss remains there. It is fine, only that the bottle ends up quite wet.  What would be a better approach? Recently I noticed that many people post .htaccess files here with:  &lt;IfModule mod_rewrite.c&gt;   Sometimes this even appears several times in the file! It obviously checks to see if mod_write is in fact enabled but the statements it protects are necesary to those sites anyway. So if the IfModule fails, the website is broken anyway.  Is there an advantage in having the &lt;IfModule mod_rewrite.c&gt; fail rather than the RewriteRule statements below it?  mod_write now is so essential and ubiquitous that I do not check for it anymore. Might this cause a vulnerability of some kind? Is it possible to print a variable's type in standard C++? For example:  int a = 12; cout &lt;&lt; typeof(a) &lt;&lt; endl;   Expected output:  int Are these gerund sentences grammatically correct? I bought this book titled 2 Hari Taklukan Grammar, written by Edward Rahardian in Bahasa (Indonesian language) and mostly talk about gerund and infinitive. And these are some examples of the gerund sentences that I found.        His mother suggested having lunch before we leave.     I will try studying harder.     The car needs washing.     Your hair needs washing.     My teacher disliked me coming late.        Somehow those words sound unnatural for me because I've never heard those in daily conversations. As a learner, I only get exposed with English by watching TV series and any other entertainment resources.  So in my thought, they sound more natural like this:        His mother suggested to have lunch before we leave.     I will try to study harder.     The car needs to be washed.     Your hair needs to be washed.     My teacher disliked me to come late.       Are those sentences in the first group grammatically correct? And, is it normal for one to say them in normal/daily conversations? How to manage and restore a modern iPhone or iDevice on ubuntu with iTunes This question—how to install iTunes on ubuntu—has been asked many times before on this site, but the answers are all outdated and involve Wine or some other tool that no longer works for the most recent version of iTunes. Put simply, I need to regularly back up and occasionally restore the firmware on an iPhone 6.   I cannot:   dual boot Windows—for some reason installing one OS makes the other unbootable &amp; after days of headache &amp; dozens of reinstalls I’ve decided to just leave Ubuntu be &amp; not try to preserve Windows. Plus “just use Windows” is not really a solution on an Ubuntu forum. use libimobiledevice-dev. libimobiledevice-dev doesn’t let you manage iOS updates or sync music anymore. Buy another phone. This one should be obvious but for some reason some asshat always comments “too bad lmao shouldntve bought an iphone ;P”. Proving an inequality by induction, how to figure out intermediate inductive steps? I'm working on proving the following statement using induction:  $$ \sum_{r=1}^n \frac{1}{r^2} \le \frac{2n}{n+1} $$  Fair enough. I'll start with the basis step:  Basis Step: (n=1) $$ \sum_{r=1}^n \frac{1}{r^2} \le \frac{2n}{n+1} $$ $$ \frac{1}{1^2} \le \frac{2}{1+1} $$ $$ 1 \le 1  \checkmark  $$  Inductive Step: $$ \sum_{r=1}^{n+1} \frac{1}{r^2} \le \frac{2(n+1)}{(n+1)+1} $$ $$ \sum_{r=1}^{n+1} \frac{1}{r^2} \le \frac{2(n+1)}{n+2} $$  My goal is to prove $\forall_{n\ge1} s(n) \implies s(n+1) $ or that this inequality holds true for all $n\ge1$.  I'm not quite sure to go from here on the inductive step. I understand that I need to basically work some clever substitution and manipulation into the problem to end up with: $$ \sum_{r=1}^{n+1} \frac{1}{r^2} \le \frac{2n}{n+1} $$  However, I'm not quite sure what needs to done to obtain this after attempting a few times. I have a list of items   John ID Matt ID John ID Scott ID Matt ID John ID Lucas ID   I want to shove them back into a list like so which also means I want to sort by the highest number of duplicates.   John ID 3 Matt ID 2 Scott ID 1 Lucas ID 1   Let me know how I can do this with LINQ and C#.  Thanks All  EDIT 2 Showing Code:      List&lt;game&gt; inventory = new List&lt;game&gt;();     drinkingforDataContext db = new drinkingforDataContext();     foreach (string item in tbTitle.Text.Split(' '))     {          List&lt;game&gt; getItems = (from dfg in db.drinkingfor_Games                                where dfg.game_Name.Contains(tbTitle.Text)                                select new game                                {                                    gameName = dfg.game_Name,                                    gameID = Boomers.Utilities.Guids.Encoder.EncodeURLs(dfg.uid)                                }).ToList&lt;game&gt;();          for (int i = 0; i &lt; getItems.Count(); i++)         {             inventory.Add(getItems[i]);         }     }      var items = (from xx in inventory                  group xx by xx into g                  let count = g.Count()                  orderby count descending                  select new                     {                         Count = count,                         gameName = g.Key.gameName,                         gameID = g.Key.gameID                     });      lvRelatedGames.DataSource = items;     lvRelatedGames.DataBind();   This query displays these results:   1 hello world times 1 hello world times 1 Hello World. 1 hello world times 1 hello world times 1 hello world times 1 Hello World. 1 hello world times   It gives me the count and name, but it doesn't give me the ID of the game....  It should display:   6 hello world times   234234 2 Hello World.  23432432 Can any linear transformation be represented by a matrix? Use $\cal L$ to denote a linear transformation on some vector space. We know any matrix $\bf{A}$ can be viewed as a linear transformation by defining $\cal L:= \cal L(\bf{v})= Av$ where $\bf{v}$ is a vector. I am curious is any linear transformation can be represented by a matrix? If so, why? If not, can anyone help provide a counterexample?  In particular, projection of vectors onto a vector $\bf{b}$ is a linear transformation defined by ${\cal L(\bf{v})}=({\mathbf{v}} \cdot \frac{{\mathbf{b}}}{{|{\mathbf{b}}|}})\frac{{\mathbf{b}}}{{|{\mathbf{b}}|}}$. Can this linear transformation be represented by a matrix?  Thank you! When I visit a site I haven't visited (while logged in) for a while, I see:  Welcome back! If you found this question useful, don't forget to vote both the question and the answers up.  That's often intended behavior. But today I visited  and was shown that banner even though the question and all its answers are locked. Voting arrows aren't even shown on any of the posts on that page. I believe that banner should be disabled on pages where there is no post that can be voted on by anyone. Prove the existence of an analytic function Let $\Delta=\{z\in \mathbb C: |z| &lt; 1\}$. Let $f: \Delta \rightarrow \mathbb C$ be a one-to-one analytic function fixing the origin. Prove that there is a one-to-one analytic function $g: \Delta \rightarrow \mathbb C$ such that $[g(z)]^2=f(z^2)$. Further, show that such a function is odd.  The only idea which comes to my mind is the following (not sure whether it is the right direction though). Let $h: \Delta \rightarrow \Delta \rightarrow \mathbb C,\ z\mapsto z^2\mapsto f(z^2)$. Note that $h'(0)=0,\ h''(z)=2f'(z^2)+4z^3f''(z^2)$; since $f$ is one-to-one and analytic, its derivative never vanishes, so $h''(0)\ne 0$. So $h$ is an analytic function of $\Delta$ with a zero of order two at the origin. Then there is an analytic function $g$ defined in an open disc about the origin with a simple zero at the origin such that $[g(z)]^2=f(z^2)$.   This is the only thing I came up with, but it seems to be a little bit irrelevant since I don't see any way of extending this $g$ to the whole $\Delta$, and also the injectivity and oddness of such a $g$ are unclear. Why doesn't logging out of Stack Overflow log me out of Gmail? Why does logging in to Stack Overflow keep me signed in to my Gmail email after logging out and regardless of the Stay signed in checkbox?  Steps to reproduce:   Browse to  and confirm you are logged out Browse to  and confirm you are logged out Click login Click Google Enter Email/Password and confirm Stay signed in is unchecked Click Sign in Click logout (up top) Click Logout (down below) Browse to  and confirm you are still logged in Click Sign out &lt;- Shouldn't clicking Logout on Stack Overflow be doing the same thing as this? Browse to  and confirm you are logged out     Answers are making sense but my frustration is that clicking Logout (twice) on StackOverflow essentially does nothing. If I proceed to click login and Gmail I am immediately authenticated because I still have an active Gmail cookie. In order to effectively logout I need to click Logout twice on Stack Overflow and then manually browse to  and Sign out. What is the correct way of installing BOINC software? Contour method to show that $\int_0^\infty\frac{x-\sin x}{x^3} \, dx=\frac\pi4$ Show that $$\int_{0}^{\infty} \frac{x - \sin(x)}{x^3} \, dx = \frac{\pi}{4}$$   My attempt is as follows: Let $$f(z) = \frac{z - i e^{iz}}{z^3}$$ and consider the contour on $[\epsilon, R]$ followed by a semicircular arc in the counter clockwise direction, then on $[-R, -\epsilon]$, then the semicircular clockwise contour avoiding the origin. We have, then, that  $$0 = \int_{\Gamma} f(z) dz = \int_{[\epsilon, R]} f(t) dt + \int_{C_R}f(Re^{it})Rie^{it}dt + \int_{[-R, -\epsilon]}f(t)dt + \int_{C_{\epsilon}}f(\epsilon e^{-it})\epsilon i e^{-it} dt$$  Then the first and third integrals ( $I_1$ and $I_3$) combine so that  $$I_1 + I_3 = 2\int_{\epsilon}^R \frac{t - \sin{t}}{t^3}\,dt$$  Further,   $$|I_{C_R}| \leq \int_0^\pi \left|\frac{Re^{it} - ie^{-R\sin{t}}e^{iRcos{t}}}{R^2 e^{2it}} \right|dt \rightarrow 0 \text{ as } R\rightarrow \infty$$  (I've omitted the details, it isn't too bad to bound)  However, I'm having trouble computing the limit  $$\lim_{\epsilon \rightarrow 0}\int_{C_{\epsilon}} f(\epsilon e^{-it})\epsilon i e^{-it} dt$$  No matter which way I look at it, it seems like this limit does not exist. Perhaps I'm seeing something wrong or have I chosen a bad $f(z)$? Best way to find a point on a circle closest to a given point Given a point (pX, pY) and a circle with a known center (cX,cY) and radius (r), what is the shortest amount of code you can come up with to find the point on the circle closest to (pX, pY) ?  I've got some code kind of working but it involves converting the circle to an equation of the form (x - cX)^2 + (y - cY)^2 = r^2 (where r is radius) and using the equation of the line from point (pX, pY) to (cX, cY) to create a quadratic equation to be solved.  Once I iron out the bugs it'll do, but it seems such an inelegant solution. This seems to be a chicken-egg problem. The most common task using sudo is installing and removing software.  sudo apt-get purge &lt;appname&gt;   But sudo itself can be removed.  sudo apt-get purge sudo # Do not run this command on production computers!   This is where the fun comes  ubuntu@ubuntu:~$ sudo bash: /usr/bin/sudo: No such file or directory   Although it's obvious that no person in his right mind will purge sudo (other than me), someone can be fooled to run this command (not directly, in its hex mode, or whatever it's called) or a person could SSH in disguised as tech guru and do the mess.  So is there a way of reinstalling sudo? When I try to set the default combo for switching to different language layouts in my keyboard from Shift+Super+Space to Alt+Shift I can't.  I used to have this combo since Ubuntu 14 and even before that when I used to have Windows. Now for some stupid reason it does not allow (actually nothing happens its not like I get an error or the combo is used elsewhere). How could I bypass this bug?