Confusion about how many votes are needed to undelete a post
Mouseover tooltip for delete count is wrong
What is a “protected” or "highly active" question? How can I detect the encoding/codepage of a text file In our application, we receive text files (.txt, .csv, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the files where created in a different/unknown codepage.  Is there a way to (automatically) detect the codepage of a text file?   The detectEncodingFromByteOrderMarks, on the StreamReader constructor, works for UTF8  and other unicode marked files, but I'm looking for a way to detect code pages, like ibm850, windows1252.     Thanks for your answers, this is what I've done.  The files we receive are from end-users, they do not have a clue about codepages. The receivers are also end-users, by now this is what they know about codepages: Codepages exist, and are annoying.  Solution:    Open the received file in Notepad, look at a garbled piece of text. If somebody is called François or something, with your human intelligence you can guess this. I've created a small app that the user can use to open the file with, and enter a text that user knows it will appear in the file, when the correct codepage is used.  Loop through all codepages, and display the ones that give a solution with the user provided text.  If more as one codepage pops up, ask the user to specify more text. Optional argument after splat argument Suppose $f(x)$ is an irreducible polynomial over $\mathbb Z$ of degree $n$. Is it always the case that there exist distinct $x_1,\ldots,x_{2n+1}\in \mathbb Z$ such that $f(x_1),\ldots,f(x_{2n+1})$ are all prime?  So far I've tested a few irreducible polynomials using mathematica, and this has held. The motivation is to use this as a test for irreducibility, as if $f(x)$ is not irreducible then it takes on at most $2n$ prime values, as either factor takes on $1$ or $-1$ at most $2n$ times. (I'd also be interested in learning if this bound can be improved).  This could potentially be expended to other rings of integers, i.e. $\mathbb Z[i]$, but in that case the minimal number of primes needed to certify that $f(x)$ is irreducible would increase as more units appear. In other words, how to prove:  For all real constants $a$ and $b$ such that $a &gt; 1$, $$\lim_{n\to\infty}\frac{n^b}{a^n} = 0$$  I know the definition of limit but I feel that it's not enough to prove this theorem. On the websites, whenever the OP comments on an answer, or on his question, his name is highlighted. This is a handy feature because you can easily tell whether the comment is from the OP or not.   But on the Android mobile app (don't know about iOS),  this feature is not there. Can we have it please!? How do I pass a string into subprocess.Popen (using the stdin argument)? How can I solve this quantum mechanical "paradox"? Let a (free) particle move in $[0,a]$ with cyclic boundary condition $\psi(0)=\psi(a)$. The solution of the Schrödinger-equation can be put in the form of a plane wave. In this state the standard deviation of momentum is $0$, but $\sigma_x$ must be finite. So we find that $\sigma_x\sigma_p=0$. Is something wrong with the uncertainty principle? Expectation of the Maximum of iid Gumbel Variables I keep reading in economics journals about a particular result used in random utility models. One version of the result is: if $\epsilon_i \sim_{iid}, $ Gumbel($\mu, 1), \forall i$, then:   $$E[\max_i(\delta_i + \epsilon_i)] = \mu + \gamma + \ln\left(\sum_i \exp\left\{\delta_i \right\} \right),  $$  where $\gamma \approx 0.52277$ is the Euler-Mascheroni constant.  I've checked that this makes sense using R, and it does.  The CDF for the Gumbel$(\mu, 1)$ distribution is:  $$G(\epsilon_i) = \exp(-\exp(-(\epsilon_i - \mu)))$$  I'm trying to find a proof of this and I've had no success.  I've tried to prove it myself but I can't get past a particular step.   Can anyone point me to a proof of this?  If not, maybe I can post my attempted proof up to where I get stuck. I have put together a map using the British OS Strategi data set which is pretty densely detailed. It is surveyed at 1:250,000 and so contains roads down to track level, rivers, villages, railway lines - you name it. There's a lot of data.  When I try and export an image version of the map (at about 1m x 1m), I always get an 'Exception: bad allocation' error. This happens when I try to export as a raster image or PDF. I have tried printing to a PDF generator (CutePDF) but the same thing happens. The print spooler shows the file size at 1.6Gb.  I am running QGIS on a dual core 2ghz Windows 8 system with 4Gb of RAM. Is it just a case of the file being too big? Is there anything I can do? Or is there an alternative, free GIS package that would do a similar job? Content type permission to specific users How do I set content permission so that specific content types become visible/usable to the admin user only, while other content types may be visible by other user roles?  After I added new content types, I checked the rebuild permissions.   Content access is working fine but the problem seems to be the fact that the enw content types aren't made visible / accessible to the other roles... How to access java-classes in the default-package? I'm working now together with others in a grails project. I have to write some Java-classes. But I need access to an searchable object created with groovy. It seems, that this object has to be placed in the default-package.   My question is: Is there a way to access this object in the default-package from a Java-class in a named package? I started reading "The Mathematics of nonlinear Programming - AL peressini" recently.  Theorem : Suppose that $f(x) , f'(x) ,f''(x)$ exist on the closed interval $[a,b]$. If $x^* ,x $ are two different points of $[a,b]$ , then there exists a point $z$ strictly between $x^*$ and $x$ such that   $$f(x)=f(x^*)+f'(x^*)(x-x^*)+\frac{f''(z)}{2}(x-x^*)^2$$  I tried to prove this theorem using The Fundamental theorem of calculus. But I can not stop it at the second derivative . Do I have to use mean value theorem ? or is there a simple proof for this ? stl::multimap - how do i get groups of data? Multimap essentially has groups of data sorted by the key. I want a method by which I could access these individual groups and get their aggregate values. For example, in a std::multimap&lt; string, int &gt; I store   {"Group1", 1},  {"Group1", 2},  {"Group1", 3},   {"Group2", 10},  {"Group2", 11},  {"Group2", 12}   Having stored these values, I should be able to iterate this multimap and get the aggregate values of each "group". Problem is there aren't any functions defined in STL to access MultiMaps in such a way. I could use lower_bound, upper_bound to manually iterate the multimap and total the group's contents, but I am hoping there could be better ways already defined in STL ? Can anyone propose a solution as to how I could get the aggregate values for a group in the above example. build argument lists containing whitespace In bash one can escape arguments that contain whitespace.  foo "a string"   This also works for arguments to a command or function:  bar() {     foo "$@" }  bar "a string"   So far so good, but what if I want to manipulate the arguments before calling foo?  This does not work:  bar() {     for arg in "$@"     do         args="$args \"prefix $arg\""     done      # Everything looks good ...     echo $args      # ... but it isn't.     foo $args      # foo "$args" would just be silly }  bar a b c   So how do you build argument lists when the arguments contain whitespace? I've looked at the demo of Beeline reader and would like to test it out on a physical version of my books, which are done in LaTeX. I'm wondering if it would even be possible.   Beeline reader takes online test a puts a slight gradient on the letters for a single line of text. On the next line it reverses the direction of the gradient. The idea being that it helps tracking text and improves speed of reading.  Any hints or suggestions as to how to do this in LaTeX?  What follows is an example taken from General trigger bulkification - best practices A general question asked from time to time on stack exchange is question of trigger bulkification.  Therefore I have 2 questions:   Which best practices are you using? What is the best way to handle updates of more than 200 records? (In case of more than 200 records the trigger is executed more than once.) $x^y+y^x>1$ for all $(x, y)\in \mathbb{R_+^2}$ Prove that $x^y+y^x&gt;1$ for all $(x, y)\in \mathbb{R_+^2}$. Story about last 2 men on Earth. One very evil, and the other very ethical I'm at a loss with “Dungeons and Dragons.” How does one play it, anyway? I'm no gamer at all, so this could be like a very silly, basic question for you guys. The thing is that I always read about "Dungeons and Dragons" game (not the video game, but the normal game to play with friends that are actually gathered together). And I would like to know how to play it.  I've read that it is a book (or several ones, which is more confusing for me to understand), but I've read somewhere that it can be played as a normal "table" game, with a board, and pieces, and somewhat weird dice (or sets of dice).  Is it like a normal game, where you pull the stuff out of a box and start to play?  I don't know if any of you watch the show "The Big Bang Theory", but I think they have played the game in a recent episode, and it looks just like a regular game.  I've Googled it for more information, but I haven't found anything as basic as I need, because I've never played a role game (except in a video game).  I just want to learn how to play, so I can get my friends into it to play it each time we get together.