SHA-2 attempts for a loop Say I am hashing hashes (taking the hash of a previous hash) for an endless amount of time.  How many times would it take, on average, to fall into a loop when using SHA-2 (more specifically SHA-256 and SHA-512), like such:  original text = z (can be any string) hash z = b hash b = c hash c = d  ...  hash n = b (restarting loop)   or more literally,  original text = "test" SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" SHA-256 of "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08" = "7b3d979ca8330a94fa7e9e1b466d8b99e0bcdea1ec90596c0dcc8d7ef6b4300c"  ...  SHA-256 of n = SHA-256 of "test" = "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"   How many attempts, on average, would this take?
Cycles in SHA-256 Let's say I start with a particular 256 bit value. Call this $v$. I then hash that value, and get another 256 bit value. Call this $\text{SHA256}(v)$. I take this value and get another 256 bit value. Call this $\text{SHA256}^2(v)$. More generally, let's call the result of hashing $v$ repeatedly $n$ times $\text{SHA256}^n(v)$.  Now my question is, how big will $n$ be, such that $\text{SHA256}^n(v) = v$?  It would seem to me, that if it's a giant sort of permutation, $n$ would have to be $2^{256}$, is that correct? Is that provable, or is there any information on this? (Just curiosity, really.)  Another question I had was, do all 256 bit strings have unique SHA256 values, and is there a way to show that? (Or, stated differently, can it be shown that there are no SHA-256 collisions in the language of all "256 bit strings"?)
Can an abstract class have a constructor?  If so, how can it be used and for what purposes? Indefinite article and people's names Sometimes, on the internet, particularly in online games, I see people using the  indefinite article before someone's name: "I see a Joey" or "I hug a Polly". I know some of these people and I'm positive that they are from English-speaking countries, which means it is not a mistake, they do it intentionally.  I was always taught that articles are not used in front of people's names. Maybe it is some sort of slang? What does it mean, when the indefinite article is put in front of someone's name?  Edit: There is a group of people standing somewhere. And somebody, named Joey, appears. They all know Joey. And someone in this group says "I see a Joey". So it is used when someone sees his or her friend. But I don't understand why they use the indefinite article here. Shimano Deore front derailleur occasionally sticking I have a question about my front derailleur sticking occasionally.  I've had this bike for a 1.7 years and have ridden it through 2 winters.  It has only been after this last winter that my front derailleur has been sticking on occasion where it's like grit has jammed in somewhere (which I'm sure it is the case).  When I'm on the fly I just knock it with my heel and it will downshift and I can push the shifter hard enough to go back up when I need to.  The first time I decided to overhaul both the front and back ones.  Took them apart, cleaned/degreased, regreased the two back cogs, and used WD-40 professional silicone on the rest of the parts as to not attract more dirt.  Then after about a month it got stuck again, and I couldn't see anything that could be jamming it (while it was still stiff as heck).  Didn't take it apart this time just used a tooth brush and silicone again and it's fine at the moment.  I'm assuming it may be that since that the roads have been grittier/dirtier from the winter with some recent rain and slush that it may just be normal.  I haven't been on the trails yet this year so I know it's not that.  Is this normal, has some kind of bur that I can't see come up and is catching grit?  EDIT:  I should also note that this is a hardtail mtb that I use for trails and winter commuting (a lot of salt and grit on the roads). python list in sql query as parameter I have a python list, say l  l = [1,5,8]   I want to write a sql query to get the data for all the elements of the list, say  select name from students where id = |IN THE LIST l|   How do I accomplish this? What does protection from [quality] do? Example 1) Let's say I have some random creature with protection from white, and my opponent plays , a white card with the effect "Destroy all creatures." Can my creature with protection from white be destroyed by a white card that isn't actually targeting it specifically?  Example 2) I was playing a match with a friend where I had  on the field against his 3 zombies. Is he able to declare his zombies as blockers even though Elite Inquisitor has "protection" from zombies?  If he can declare them as blockers, does protection mean that no damage is dealt by the zombies to  Elite Inquisitor? Let $r$ be the smallest positive integer such that $a^r \equiv 1 \bmod{n}$. Prove $r \mid \phi(n)$. Let $a \in \mathbb {Z}$, $n &gt; 1$ a natural number with $\gcd(a, n) = 1$, and let $r$ be the smallest positive integer such that $a^r \equiv 1 \bmod{n}$. Prove that $r \mid \phi(n)$.  Euler's generalization of Fermat's Little Theorem: If $n \in \mathbb {N}$ and $m \in \mathbb{Z}$ such that $\gcd(m, n) = 1$, then $m^{\phi(n)} \equiv 1\bmod(n)$.  By Euler's generalization I would have $a^{\phi(n)} \equiv 1\bmod{n}$.  Then I could say $a^r \equiv a^{\phi(n)} \equiv 1 \bmod{n}$. At this point I can see that $r$ clearly must be some multiple of $\phi(n)$.  If I want to show that $r \mid \phi(n)$, then I can show that $\phi(n) = rk$, for some $k \in \mathbb {Z}$.  However, I am a bit stuck about how to make this last step showing that  $\phi(n) = rk$, where $k \in \mathbb {Z}$. Auto mount a disk drive in ubuntu 14.04 LTS (Bookmark directory not found) I'm using ubuntu 14.04 LTS. When I start my pc and click on any bookmark from the file manager it shows this error:   Unable to find the requested file. Please check the spelling and try again. Unhandled error message: Error when getting information for file '/media/angel/DOC/edu': No such file or directory   But when I open DOC drive and again clink on the same bookmark it works properly. Can anybody tell me why is this happening and how to solve this issue?   Edit: Output of lsblk is following: (ubuntu is installed in sda5)  NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 119.2G  0 disk  ├─sda1   8:1    0  91.3G  0 part  ├─sda2   8:2    0     1K  0 part  ├─sda5   8:5    0  24.1G  0 part / └─sda6   8:6    0   3.8G  0 part [SWAP] sdb      8:16   0 465.8G  0 disk  ├─sdb1   8:17   0  93.2G  0 part  ├─sdb2   8:18   0     1K  0 part  ├─sdb5   8:21   0  93.2G  0 part  ├─sdb6   8:22   0  89.3G  0 part  ├─sdb7   8:23   0  93.2G  0 part  ├─sdb8   8:24   0  93.2G  0 part  └─sdb9   8:25   0   3.8G  0 part  sr0     11:0    1  1024M  0 rom     After opening the disk drive the output of lsblk is bellow:   NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT sda      8:0    0 119.2G  0 disk  ├─sda1   8:1    0  91.3G  0 part  ├─sda2   8:2    0     1K  0 part  ├─sda5   8:5    0  24.1G  0 part / └─sda6   8:6    0   3.8G  0 part [SWAP] sdb      8:16   0 465.8G  0 disk  ├─sdb1   8:17   0  93.2G  0 part  ├─sdb2   8:18   0     1K  0 part  ├─sdb5   8:21   0  93.2G  0 part  ├─sdb6   8:22   0  89.3G  0 part /media/angel/DOC ├─sdb7   8:23   0  93.2G  0 part  ├─sdb8   8:24   0  93.2G  0 part  └─sdb9   8:25   0   3.8G  0 part  sr0     11:0    1  1024M  0 rom   The output of sudo blkid gives the following information about sdb6:  /dev/sdb6: LABEL="DOC" UUID="04280A22280A12FA" TYPE="ntfs" Integral $\int_{1}^{2011} \frac{\sqrt{x}}{\sqrt{2012 - x} + \sqrt{x}}dx$ Evaluate:  $$\int_{1}^{2011} \frac{\sqrt{x}}{\sqrt{2012 - x} + \sqrt{x}}dx$$  Using real methods only.  I am not sure what to do.  I tried finding a power series, which was too ugly.  I just need some hints, not an answer to do this integral, this is from the MIT Integration bee 2012. How can I use a variable in the replacement side of the Perl substitution operator? I would like to do the following: $find = &quot;start (.*) end&quot;; $replace = &quot;foo \1 bar&quot;;  $var = &quot;start middle end&quot;; $var =~ s/$find/$replace/;  I would expect $var to contain &quot;foo middle bar&quot;, but it does not work. Neither does: $replace = 'foo \1 bar';  Somehow I am missing something regarding the escaping. Creating Ellipse in WGS84, but with metric parameters I have the function  --Ellipse(x,y,rx,ry,rotation,#of segments in 1/4 of ellipse) SELECT ST_Translate( ST_Rotate( ST_Scale( ST_Buffer(ST_Point(0,0), 0.5, $6), $3, $4), $5), $1, $2)   I have points in WGS84 (x,y), radiuses in meters (rx, ry), rotation angle in degrees. And I need a new WGS84 geometry as a result.  As you can see I can't call this function without conversions between WGS84 and some metric SRID. But my points aren't in a definite region. So a SRID which is optimal for one point, throws an error for another point during conversion.  Is there a common way to get an optimal metric projection (SRID) for a WGS84 point? Or at least to use some rough, but world-wide universal metric projection? Or maybe there's a trick for this case? What suggestions should I make when reviewing a poorly written paper? Since I need a break from the reviewing...  Often in my field I review papers from researchers in Asia (reviews are not double blind) which are poorly written. By poorly written, I don't mean that the prose is not pleasing to the eye, that there are problems with how the writing flows, or that there are innocuous typos or spelling mistakes. Instead, the grammar used by the authors differs seriously from normal English, and often produces significant changes in the meaning of sentences.  Usually such papers are ultimately readable, but one has to go back and re-read sentences or paragraphs several times to infer the meaning (and this is with strong knowledge of the research area!), so I generally won't reject a paper solely for this reason. However, I would feel remiss in my duties as a reviewer if I didn't instruct the authors to improve this aspect of the paper. I'd like to provide helpful advice for the authors without just giving them a laundry list of the errors.   Typically I highlight a few places where I had significant trouble understanding what they actually meant to say, and suggest seeking a professional editor before publication.   Are these reasonable things to suggest?   What other suggestions can I make? "All I need (is/are) cigarettes and alcohol": which one is correct? In one of Oasis's songs — Cigarettes and Alcohol — there are two sentences that make me confused:     All I found was cigarettes and alcohol   ...and...     All I need is cigarettes and alcohol   Why would is and was be correct in these sentences instead of are and were, since they're referring to more than one thing? Restore Python installation to default plus apt package dependencies Expected value of the number of flips until the first head Suppose we flip a coin until we see a head. What is the expected value of the number of flips we will take?  I am pretty new to expected value, so I tried to evaluate it by multiplying the probability of each scenario with the number of flips it took to get there (like taking the arithmetic mean). This didn't work though, because of the infinite possibilities. I'm really confused, and if someone were to provide an answer, I would really appreciate it if they could go into detail. Why is my dual-core CPU recognized as a quad-core one? My processor is an . As you can see, it's 2 cores and 4 threads.  Although, both Ubuntu 11.04 and Windows 7 seem to think it's a quad-core CPU:      Why is this? Is it because there are 2 threads per core, dividing the CPU in 4 processing units? Controlling the value of 'this' in a jQuery event I have created a 'control' using jQuery and used jQuery.extend to assist in making it as OO as possible.  During the initialisation of my control I wire up various click events like so  jQuery('#available input',              this.controlDiv).bind('click', this, this.availableCategoryClick);   Notice that I am pasing 'this' as the data argument in the bind method. I do this so that I can get at data attached to the control instance rather from the element that fires the click event.   This works perfectly, however i suspect there is a better way  Having used Prototype in the past, I remember a bind syntax that allowed you to control what the value of 'this' was in the event.  What is the jQuery way? White lines between objects in render I am kind of new to the whole animation aspect and in fact still in high school.  I am trying to make a Minecraft character rig and I want to make some 3D hair. I did not know how to quite make it so I kind of when just did something pretty simple. It isn't the greatest in any means, but any how the point is every time I render it white lines show up between objects or joined objects. I don't know how to fix this and would like help (a picture is posted below of the problem). How do you declare an interface in C++? How do I get %LocalAppData% in c#? How long was Luke Skywalker's training with Yoda?