I have a set of markdown files to be passed to jekyll project , need to find the encoding format of them i.e UTF-8 with BOM or UTF-8 without BOM or ANSI using a program or a API .   if i pass the location of the files , the files have to be listed,read and the encoding should be produced as result .  Is there any Code or API for it ?   i have already tried the sr.CurrentEncoding for stream reader as mentioned in  but the result varies with the result from a notepad++ result .  in notepad++ , the file encoding is shown as utf-8 , but from the program , the result is ANSII .   but i should get same result from both ways , so where the problem has occurred?
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.
Does going outside the range of the spell or breaking line of sight between the caster and target break concentration or otherwise affect control over the spell?  For example, a Heat Metal spell has a range of 60 ft. If I cast the Heat Metal spell on a an armored foe, and that foe runs outside the range of the spell (60 ft), or around the corner, does that break concentration and end the spell? Heat Metal also allows you to use a bonus action to cause the 2d8 of damage — would exercising that option be prevented by being out of range or line of sight? Is it possible to search by posts that contain an image? Sometimes when going back through e.g. my previous answers to find some information, I know the question I am looking for contains an image, and I know the language tag, but I'm a little hazy on the other parameters.    Is there a search option to restrict results to only those posts that contain an image? Akin to filtering email to show only those with attachments I guess.  I see that with  you can filter by user, votes, answer count or whether a question has an accepted answer, or has been closed or migrated. But not images? Say I am logged into a remote system, how can I know what it's running? On most modern Linuxes (Linuces?), you have the lsb_release command:  $ lsb_release -ic     Distributor ID: LinuxMint Codename:       debian   Which as far as I can tell just gives the same info as /etc/lsb-release. What if that file is not present? I seem to recall that the lsb_release command is relatively new so what if I have to get the OS of an older system?  In any case, lsb stands for Linux Standard Base so I am assuming it won't work on non-Linux Unices. As far as I know, there is no way of getting this information from uname so how can I get this on systems that do not use lsb_release? Universal Chord Theorem Let $f \in C[0,1]$ and $f(0)=f(1)$.   How do we prove $\exists a \in [0,1/2]$ such that $f(a)=f(a+1/2)$?  In fact, for every positive integer $n$, there is some $a$, such that $f(a) = f(a+\frac{1}{n})$.  For any other non-zero real $r$ (i.e not of the form $\frac{1}{n}$), there is a continuous function $f \in C[0,1]$, such that $f(0) = f(1)$ and $f(a) \neq f(a+r)$ for any $a$.  This is called the Universal Chord Theorem and is due to Paul Levy.  Note: the accepted answer answers only the first question, so please read the other answers too, and also this answer by Arturo to a different question:     This is being repurposed in an effort to cut down on duplicates, see here: .  and here: . Does the war have an ending in Planetside 2? As enemy bases are captured, they just seem to respawn right in the middle of friendly captured territory. This is looking like a perpetual cycle, and none of the three teams ever gets closer than to the very edge of winning the whole continent, only to lose lots of territory again.  So is this by design? Is Planetside 2 eternally to be at war, with no winner ever? I was hoping it would be more like a 'match'. I admit that both are almost the same thing, but there is at least the closure of winning/losing sides this way. Show that the conditional statement is a tautology without using a truth table I have been attempting to use identities to get to the answer but I am unable to get anywhere. Here is the equation I am trying to prove tautological without using truth tables:  $[(p\rightarrow q) \land (q \rightarrow r)] \rightarrow (p \rightarrow r )$  And here is my attempt at using identities to work my way up. (a link to a page with a table of logical equivalence identities: )  $\lnot [(p \rightarrow q) \land (q \rightarrow r)] \lor (p \rightarrow r)$  $\lnot [(\lnot p \lor q) \land (q \rightarrow r)] \lor (p \rightarrow r)$  $[\lnot (\lnot p \lor q) \land \lnot (q \rightarrow r)] \lor (p \rightarrow r)$  $[(p\land \lnot q) \land (q \land \lnot r)] \lor (p \rightarrow r)$  I don't know where to go from there. C++ 11 Thread initialization with member functions compiling error Using awk to sum the values of a column, based on the values of another column DIY.Blogoverflow.com is redirecting to stackexchange.com/blogs I seem to be the unlucky recipient of a 302 redirect from the blogoverflow site, and was asked by Grace Note to upload the issue here. While trying to access the DIY blog site, I'm getting bounced over to the generic SE blog page. I've tried resolving this by changing DNS servers, clearing my browser cache, and trying a different browser. Others going to the same site aren't experiencing the issue, but I'm at a loss for what's different on my system that would cause this. Here's the wget output of the redirect:  --2014-02-18 14:59:28--  http://diy.blogoverflow.com/ Resolving diy.blogoverflow.com (diy.blogoverflow.com)... 67.228.172.87 Connecting to diy.blogoverflow.com (diy.blogoverflow.com)|67.228.172.87|:80... c onnected. HTTP request sent, awaiting response...    HTTP/1.1 302 Found   Date: Tue, 18 Feb 2014 19:59:28 GMT   Server: Apache   X-Powered-By: PHP/5.4.22   Location: http://stackexchange.com/blogs   Content-Length: 1001   Connection: close   Content-Type: text/html; charset=UTF-8 Location: http://stackexchange.com/blogs [following] --2014-02-18 14:59:28--  http://stackexchange.com/blogs Resolving stackexchange.com (stackexchange.com)... 198.252.206.140 Connecting to stackexchange.com (stackexchange.com)|198.252.206.140|:80... conne cted. HTTP request sent, awaiting response...    HTTP/1.1 200 OK   Cache-Control: private   Content-Type: text/html; charset=utf-8   X-Frame-Options: SAMEORIGIN   Date: Tue, 18 Feb 2014 19:59:28 GMT   Content-Length: 16775 Length: 16775 (16K) [text/html] Saving to: ‘index.html.1’       0K .......... ......                                     100% 1.04M=0.02s BJT as a switch: what am I doing wrong? Let $n&gt;0$ and assume that $\chi^{(n)} \in \mathrm{Irr}(G)$ for every $\chi \in \mathrm{Irr}(G)$. Show that $G = H \times A$, where $A$ is abelian and $(|H|, n) = 1$.  $\chi^{(n)}$ is defined by $\chi^{(n)}(g) = \chi(g^n)$. $\mathrm{Irr}(G)$ is the set of all irreducible characters of $G$.  Here are the hints in the book:   Let $d = (|G|,n)$. Show that it is no loss to assume that $(|G|/d,n) = 1$. Let $A = \bigcap_{\chi \in \mathrm{Irr}(G)} \mathrm{ker} \chi^{(n)}$. Show that $A = \{g \in G | g^n=1\}$ and $|A| = d$. Let $H = \bigcap \{\mathrm{ker} \chi | \chi \in \mathrm{Irr}(G), \chi^{(n)} = 1_G\}$. Show $|G : H| = d$.   Hint 1 and 2 are easy, and it is easy to deduce the result from the hints. As for hint 3, I have proven that $\{ g \in G | (o(g), n) = 1 \} \subseteq H$, and that $|G : H| \mid d$. And I am stuck here.  Can anyone help me? More often that I like to admit I look for a file that contains some strings.  Currently I do:  grep -rl string1 | xargs grep -l string2 | xargs grep -l string3   Is there a tool that does this prettier?  This greps for string1 or string2 or string3.   grep -rl -e string1 -e string2 -e string3   I want files that contain string1 and string2 and string3 but not necessarily on the same line.  Maybe one of the modern greps (ag/ack/rg/sift) can do this? $\operatorname{rank}(T^3) + \operatorname{rank}(T) \geq 2\operatorname{rank}(T^2)$ for finite-dimensional $V$ Consider a finite-dimensional vector space $V$ over the field $\mathbb{F}$ with a linear operator $T.$ Prove that we have $\operatorname{rank}(T^3) + \operatorname{rank}(T) \geq 2 \operatorname{rank}(T^2).$   First, let us assume that $\dim_{\mathbb{F}}(V) = n.$ Our immediate observations include that $T^3(V) \subseteq T^2(V) \subseteq T(V)$ so that $\operatorname{rank}(T^3) \leq \operatorname{rank}(T^2) \leq \operatorname{rank}(T)$ and $\operatorname{rank}(T^3) \geq \operatorname{rank}(T) + \operatorname{rank}(T^2) - n$ by Sylvester's Rank Inequality. Can we do some manipulations with what we have to get the desired inequality, or do we require something else? Topological/Geometrical justification for $\text{CFT}_2$ being special It is known as a fact that conformal maps on $\mathbb{R}^n \rightarrow \mathbb{R}^n$ for $n&gt;2$ are rotations, dilations, translations, and special transformations while conformal maps for $n=2$ are from a much wider class of maps, holomorphic/antiholomorphic maps. I was wondering to know if there is any topological or geometrical description for this.   To show what I mean, consider this example: in $\mathbb{R}^n$ for $n&gt;2$ interchanging particles can only change the wave function to itself or its minus. It is related to the fundamental group of $\mathbb{R}^n-x_0$ ($x_0$ is a point in $\mathbb{R}^n$ and $\pi_1(\mathbb{R}^n-\{x_0\})=e$ for $n&gt;2$) but this is not true for $n=2$.   I want to know whether exists any topological invariant or just any geometrical explanation that is related to the fact that I mentioned about conformal maps on $\mathbb{R}^n$. Is it possible to change your single-player skin? In Minecraft, is it possible to customize your skin in single-player mode (not just in multiplayer)? How? Cartographic techniques for symbolizing routing data echo text after curl command on same line #!/bin/bash echo "$(curl -s -I https://google.com|grep Server)" abc   returns:  abcer: gws   and bash -x shows:    ++ grep Server ++ curl -s -I https://google.com ' abco 'Server: gws  abcer: gws   but    echo abc "$(curl -s -I https://google.com|grep Server)"`    returns  abc Server: gws   In other words, if I add text AFTER the curl command, it gets mangled, but it's ok if I add it before curl. What is happening? I cannot figure it out. What exactly are the spikes, or peaks and valleys, caused by in pictures such as these    Wikipedia states that "From the point of view of magnetic energy, peaks and valleys are energetically favorable", but I'm not exactly sure what that means, or how it works. Why isn't the fluid just happy being attracted to the magnet in a semi-sphere shape? Could it be that it gains a magnetic charge, so it attempts to repel itself at the same time? Just pulling at straws here. How does Edo Tensei Madara get back his Rinnegan? Madara gave his Rinnegan to Nagato. But after Kabuto brings him back using Edo Tensei, he still has the Rinnegan. How is this possible? Is there a way to open a raster that is stored in ESRI V10.0 Geodatabase in QGIS V2.4?    I can open the vector layer, but there does not seems to be a way to open a raster.