So I'm trying my hand at creating some packages (on , because my Surface can't run TeX1), and have run into a rather fascinating problem. My packages just won't load; they complain about \ifnum instead. Here's a minimal test case:  test.sty  \NeedsTeXFormat{LaTeX2e}[1994-06-01] \ProvidesPackage{test}[2014-08-04 Hello, World!] \endinput   main.tex  \documentclass{article} \title{LaTeX Testing} \usepackage{test}  \begin{document} Hello, World! \end{document}   Compile error  Missing = inserted for \ifnum. &lt;to be read again&gt;                     - l.4    And I'm thinking, when did \ifnum come into this?! (The error occurs on the 'token' after \usepackage, whether that's a newline or a \show or whatever else.) There's plenty on the internet about \ifnum errors, but nothing on just after \usepackage. I have no idea where to even start debugging this, and my options are rather limited due to being stuck with an online service... Some help?    1 Surface RT is a pain sometimes. I do have a proper machine, with LaTeX on it; however, it's not quite as portable, and therefore isn't on hand at the moment.
There is some conflict or error I don't understand. I can skip it and nothing visible happens. The output is okay and everything seems to be fine. Still I would like to get rid of the error message. If I run the following minimal example:   \documentclass[]{scrbook}  \usepackage[applemac, grafiken]{tahbiblatex} \usepackage[ngerman]{babel}   \begin{document}  Testing äüöaüä.  \end{document}   I get the error message:      ! Missing = inserted for \ifnum. &lt;to be read again&gt;                     , l.4 \usepackage                [ngerman]{babel} ?  ! Missing number, treated as zero. &lt;to be read again&gt;                     , l.4 \usepackage                [ngerman]{babel}   Here is my .sty file:  \NeedsTeXFormat{LaTeX2e}\relax \ProvidesPackage{tahbiblatex}[2012, by tah modified by sm]  \RequirePackage{ifthen}  \DeclareOption{latin1}{\PassOptionsToPackage{\CurrentOption}{inputenc}} \DeclareOption{applemac}{\PassOptionsToPackage{\CurrentOption}{inputenc}} \DeclareOption{cp850}{\PassOptionsToPackage{\CurrentOption}{inputenc}} \DeclareOption{utf8}{\PassOptionsToPackage{\CurrentOption}{inputenc}}  \DeclareOption{dvi}{% \newif\ifpdf \ifx\pdfoutput\undefined     \pdffalse \else     \pdfoutput=0     \pdftrue \fi}  \newcounter{Grafiken}\setcounter{Grafiken}{0} \DeclareOption{grafiken}{\setcounter{Grafiken}{1}}  \newcounter{Randausgleich}\setcounter{Randausgleich}{0} \DeclareOption{randausgleich}{\setcounter{Randausgleich}{1}}  \newcounter{Tabellen}\setcounter{Tabellen}{0} \DeclareOption{tabellen}{\setcounter{Tabellen}{1}}  \newcounter{Sync}\setcounter{Sync}{0} \DeclareOption{sync}{\setcounter{Sync}{1}}  \ProcessOptions  \RequirePackage{fixltx2e} \RequirePackage{inputenc} \RequirePackage[T1]{fontenc} \RequirePackage[T1]{url} \RequirePackage{setspace} %\RequirePackage[german]{varioref} \RequirePackage{textcomp}  \newcommand{\urlangabe}[2]{% $\langle$\url{#1}$\rangle$ -- Zugriff am #2}  \def\hierlockern {\begingroup \def\par{\endgraf\endgroup}%   \tolerance 1414%   \hbadness 1414%   \emergencystretch 1.5em%   \hfuzz 0.3pt%   \vfuzz \hfuzz%   \raggedbottom% }  \newcommand{\alleslockern}{%   \tolerance 1414%   \hbadness 1414%   \emergencystretch 1.5em%   \hfuzz 0.3pt%   \vfuzz \hfuzz%   \raggedbottom% } \ifthenelse{\value{Grafiken}=1}   {   \ifx\pdfoutput\undefined \newcount\pdfoutput \fi   \ifcase\pdfoutput       \RequirePackage[dvips]{graphicx}       \DeclareGraphicsExtensions{.eps}       \typeout{Paket tah Meldung: Die Option `grafiken' fuer DVI wurde gewaehlt.}% \else     \RequirePackage[pdftex]{graphicx}     \DeclareGraphicsExtensions{.jpg,.tif,.png,.pdf}     \typeout{Paket tah Meldung: Die Option `grafiken' fuer PDF wurde gewaehlt.}%   \fi}   {}  \ifthenelse{\value{Sync}=1}   {     \ifx\pdfoutput\undefined \newcount\pdfoutput \fi     \ifcase\pdfoutput     \RequirePackage{srcltx}     \typeout{Paket tah Meldung: Die Option `sync' fuer DVI wurde gewaehlt.}%     \else     \RequirePackage{pdfsync}     \typeout{Paket tah Meldung: Die Option `sync' fuer PDF wurde gewaehlt.}%     \fi }   {}   \ifthenelse{\value{Randausgleich}=1}   {\typeout{Paket tah Meldung: Die Option `randausgleich' wurde gewaehlt.}%   \RequirePackage[activate]{pdfcprot}}   {}  \ifthenelse{\value{Tabellen}=1}   {\typeout{Paket tah Meldung: Die Option `tabellen' wurde gewaehlt.}%   \RequirePackage{tabularx}   \RequirePackage{ragged2e}   \RequirePackage{dcolumn}   \RequirePackage{booktabs}   \newcolumntype{L}{&gt;{\RaggedRight\hspace{0pt}\arraybackslash}l}   \newcolumntype{Y}{&gt;{\RaggedRight\hspace{0pt}\arraybackslash}X}   \newcolumntype{d}[1]{&gt;{\DC@{.}{,}{#1}}l&lt;{\DC@end}}   }   {}    \endinput   I also don't really need all the features. So it would be nice to reduce it to minimal features, which are needed..
Zlib-compatible compression streams? Ok, I have to admit, I don't really delve too deep into the semantics of the spatial operators list below, I'm more of a user, I write software to drive the SQL most of the time and don't really think about it too much.  However, I have a situation where a spatial operation I'm doing is going dog slow, on a table that has great indexes on and has never caused a problem before now.  As a result, I'm trying to figure out which of the following is my best bet to use, that will give me the best performance, however, sometimes I find my searches don't return anything when I know they should, and sometimes return stuff when they shouldn't.  SO I'm reaching out, to ask if some one can give me the actual definition, such as criteria to match, fully within enclosing geometry, or within outer ring etc etc of each of the following operations:  Equals(Geom1, Geom2):int Disjoint(Geom1, Geom2):int Touches(Geom1, Geom2):int Within(Geom1, Geom2):int Overlaps(Geom1, Geom2):int Crosses(Geom1, Geom2):int Intersects(Geom1, Geom2):int Contains(Geom1, Geom2):int Relate(Geom1, Geom2):int   If you can give a concrete example of when they will and will not match too, that would be great.  For reference, I'm searching on a table of Linestrings, using a rectangular polygon, rotated to be pointing in the direction of travel (It's part of a traffic managment app)  For further reference, here is a sample of the SQL the app generates to perform a search:  SELECT recordID,AsBinary(geometry) AS geometry,Distance(GeomFromText('POINT(-1.84101 54.85078)',4326), geometry) AS distanceFromGps FROM linegrid WHERE Intersects(GeomFromText('POLYGON ((-1.8413149820810311 54.850782468607292, -1.8409507853094111 54.850952257034713, -1.8408279009723911 54.850864894077496, -1.8411920982612455 54.850695105650068, -1.8413149820810311 54.850782468607292))'), geometry)   You can see in this example I'm using intersects trying the others as mentioned doesn't quite give the results I expect, hence why I'm asking the question.  Please note, I'm not particularly bothered about actual faster/other ways of doing this at the moment, BUT if you do happen to spot a better way do feel free to shout up :-)  For now all I'm mostly trying to understand is the differences between each of the operations.  As for doing it faster/better I intend to open a different question for that at a later date.  For more reference, the Spatial engine this is working against is Spatilite 2.3.0, and I can't upgrade it due to the devices it's running on not having a more up to date build for it (Windows CE)    I'm going to choose mintix'es answer here as that provided a super easy to understand grid and description of all the various operations, which answered my question.  I'm still faced with getting performance on the routines up, but I do now have a few strategies to try on that one, I may still seek advice here from the group with regards to that.  @Vince deserves some credit too, as that white paper is definitely the definitive answer, but it's also quite challenging to read (I had to read through it several times) , for anyone wanting the real I am on these operations The Clementini paper is the way to go, if you need an easy to understand overview while developing solutions however, the FME link should be open in another browser tab. Focal length of an ellipse and related results Proof of properties of injective and surjective functions. I'd like to see if these proofs are correct/have them critiqued.     Let $g: A \to B$ and $f: B \to C$ be functions.  Then:   (a) If $g$ and $f$ are one-to-one, then $f \circ g$ is one-to-one.   (b) If $g$ and $f$ are onto, then $f \circ g$ is onto.   (c) If $f \circ g$ is one-to-one, then $f$ is one-to-one?   (d) If $f \circ g$ is one-to-one, then $g$ is one-to-one?   (e) If $f \circ g$ is onto, then $f$ is onto?   (f) If $f \circ g$ is onto, then $g$ is onto?     (a)  Let $a,b \in A$.  If $(f \circ g)(a)=(f \circ g)(b)$, then $f(g(a))=f(g(b))$.  Since $f$ is one-to-one, we know that $g(a)=g(b)$.  And, since $g$ is one-to-one is must be that $a=b$.  Hence $f \circ g$ is one-to-one.    (b) Since $f$ is surjective we know that for all $c \in C$ there is a $b\in B$ such that $f(b)=c$.  Since $g$ is surjective, there is a $a \in A$ such that $g(a)=b$.  Hence, for all $c \in C$ there is an $a \in A$ such that $(f \circ g)(a)=f(g(a))=f(b)=c$.    (c)  This is false.  Let $A=\{1\}$, $B=\{1,2\}$, and $C=\{1\}$. Define $g(1)=1$ and $f(1)=f(2)=1$. Then $f \circ g$ is injective, but $f$ is not injective.    (d)  This is true.  Let $a,b \in A$ where $a \neq b$.  If $(f\circ g)(a)\neq(f\circ g)(b)$, then $f(g(a))\neq f(g(b))$.  Hence $g(a) \neq g(b)$.  (e)  Since $f \circ g$ is surjective, then for every $ c \in C$ there is an $a \in A$ such that $f(g(a))=c$.   Let $b = g(a)$.  Then $b \in B$ and $f(b)=g(f(a))=c$.  Thus $f(b)=c$.  Hence $f$ is surjective.  (f)  Using the same set up as part (c), we have that $g$ is not surjective since there is nothing in $A$ such that $g$ will go to 1. Mean or sum of gradients for weight updates in SGD I have a featureclass in an Esri file geodatabase. When I edit the features using the editor in ArcMap, and I delete most of my features and keeping only the ones in the middle, the zoom to layer command doesn't work as expected. Instead of zooming to the extent of the features remaining in the feature class, the extent will be the former one (containing all deleted features). When reviewing the extent values in the properties dialog for the feature class, I can clearly see the old values. So the edit session doesn't seem to alter the full extent values.  Is there a way to recalculate these values?  I am pretty sure that this problem should occur to everyone editing features in ArcMap... Why won't my computer go to sleep automatically? Windows 8 is set to sleep after 30 mins, and it used to work, but recently it's started refusing to sleep. (I can still manually ask it to go to sleep without any issue.)    I was having issues a while ago, but it was with my network adapter. That's since been disabled, so it's definitely not that:    I've checked to see what devices are able to wake up my machine, but it only appears to be my mouse:    Which is odd, because I haven't recently changed my mouse, and more confusing still: The monitor does go to sleep just fine. If it was actually the mouse keeping my system awake, I'm pretty sure the monitor wouldn't go to sleep.  I've checked my Wake Timers, and nothing:    I've also checked my existing requests...  UPDATE: I found something. What to do with it, I don't know...    Note: Even when /requests says that there's "NONE" under every category, my machine still won't sleep(!).    In short: How can I tell what's preventing my computer from Sleeping?    UPDATE: Ok, so I now have a few more pieces of the puzzle. I came back to my computer and it was ASLEEP! Lawks! It seems that the only times it doesn't sleep is if VLC Player is open, even if a video isn't actually playing.  UPDATE UPDATE: Ok, so it won't sleep sometimes when VLC Player ISN'T running, either. Bah! I just installed Ubuntu 14.04 on a Dell laptop with 1.7Ghz Pentium M and 1Gbyte memory.  Graphics are Intel® 852GM/855GM x86/MMX/SSE2, OS type is 32bit.  The whole system is VERY slow. When I launch the applications manager, for example, I need to wait in order to see the letters I typed appear!  It is as if the CPU was overloaded and no memory available, but I only have Firefox running.  How can I make the system run smoother? It used to have Windows XP installed and it worked fine. Ordinal dependent variable with continuous independent variables Can anyone explain how Windows effectively limits the CPU?  Last time I tried some tricks to let my laptop not overheat, so I tried limiting the CPU to 70%.   As for my suprise it stopped my laptop from overheating - even when launching CPU intensive applications which caused my laptop to overheat and shut down, didn't overheat my laptop anymore!  I looked at task manager but the "CPU intensive" application still uses ~95% of CPU and the windows task manager shows a total of 100% CPU usage.  I have limited the CPU usage here ("plugged in" option was on 70% [both min and max] when testing the CPU intensive application):    How does Windows do this magic?   I see 100% CPU usage yet my CPU does not overheat. And I do not see any performance differences.  Does Windows limit the CPU speed? Like, if I have a 2.4 GHz processor, on 70% it will only have 1.68 GHz when limited? How is this possible (changing the CPU speed)? I thought you can only underclock when in BIOS?  If not, how does Windows accomplish this if not by changing the speed?    Side question: If it's about the speed, is there a way to set the CPU max state to 200% ? Find $\lim_{n \to \infty} \left[\frac{(n+1)^{n + 1}}{n^n} - \frac{n^{n}}{(n-1)^{n-1}} \right]$ (a question asked at trivia) My friend's trivia league had this math question:  $$\lim_{n \to \infty} \left[\frac{(n+1)^{n + 1}}{n^n} - \frac{n^{n}}{(n-1)^{n-1}} \right]$$  After computing a few values, one could guess the answer is $e$ = 2.718...But how can we prove that is the limit?  Someone offered up a hand-wavy proof like this:  \begin{align} \lim_{n \to \infty} \left[\frac{(n+1)^{n + 1}}{n^n} - \frac{n^{n}}{(n-1)^{n-1}} \right] &amp; = \lim_{n \to \infty} \left[\frac{(n+1)(n+1)^{n}}{n^n} - \frac{n \cdot n^{n-1}}{(n-1)^{n-1}} \right] \\ &amp;= \lim_{n \to \infty} \left[(n+1)\frac{(n+1)^{n}}{n^n} - n\frac{n^{n-1}}{(n-1)^{n-1}} \right] \\ &amp;= \lim_{n \to \infty} \left[(n+1)\left(1 + \frac{1}{n} \right)^n - n\left(\frac{n - 1 + 1}{n-1} \right)^{{n-1}} \right] \\ &amp;= \lim_{n \to \infty} \left[(n+1)\left(1 + \frac{1}{n} \right)^n - n\left(1 + \frac{1}{n-1} \right)^{n-1} \right] \\ &amp;= \lim_{n \to \infty} \left[(n+1)e - n \cdot e \right] \\ &amp;= \lim_{n \to \infty} e \\ &amp;= e \end{align}  The part about substituting $e$ is hand-wavy since technically this is an indeterminate form of $\infty - \infty$. And using $e$ as as upper bound did not lead me to an easy proof either.  Is there a way to rigorously prove the limit? I tried a few approaches: (a) sandwiching the limit--I could prove $e$ was a lower bound, but I could not find a suitable upper bound converging to $e$, (b) using L'Hopital's rule with no luck, (c) using the mean value theorem--but that also got complicated.  So this is a pretty tough problem to ask at trivia! Is there a way to prove this limit formally?  Sources  Trivia question:   Thread on trivia:   Hand-wavy proof:   Idea for mean value theorem: I'm studying for actuarial exams, but I always pick up mathematics books because I like to challenge myself and try to learn new branches.  Recently I've bought Topology by D. Kahn and am finding it difficult.  Here is a problem that I think I'm am answering sufficiently but any help would be great if I am off.  If $d$ is a metric on a set $S$, show that  $$d_1(x,y)=\frac{d(x,y)}{1+d(x,y)}$$ is a metric on $S$.  The conditions for being a metric are $d(X,Y)\ge{0}, d(X,Y)=0$ iff $X=Y$, $d(X,Y)=d(Y,X)$, and $d(X,Y)\le{d(X,Z)+d(Z,Y)}$.  Thus, we simply go axiom by axiom.  1)  Since both $d(x,y)\ge{0}$ and $1+d(x,y)\ge{0},$ it is clear that $d_1(x,y)\ge{0}$.  (Is this a sufficient analysis?) 2) $d_1(x,x)=\frac{d(x,x)}{1+d(x,x)}=\frac{0}{1+0}=0$. 3) $d_1(x,y)=\frac{d(x,y)}{1+d(x,y)}=\frac{d(y,x)}{1+d(y,x)}=d_1(y,x).$ 4) $d_1(x,y)=\frac{d(x,y)}{1+d(x,y)}\le{\frac{d(x,z)+d(z,y)}{1+d(x,z)+d(z,y)}}=\frac{d(x,z)}{1+d(x,z)+d(z,y)}+\frac{d(z,y)}{1+d(x,z)+d(z,y)}\lt\frac{d(x,z)}{1+d(x,z)}+\frac{d(z,y)}{1+d(z,y)}=d_1(x,z)+d_1(z,y).$  However, #4 is strictly less, not less than or equal to, according to my analysis, so where did I go wrong? Where is it preferred to place the answer to duplicate questions? Proving $|P(A\cap B)-P(A)P(B)|\leq \frac{1}4$ Let $A$ and $B$ be two events of a probability space. Prove that  $\displaystyle|P(A\cap B)-P(A)P(B)|\leq \frac{1}4$   I think it's a very challenging problem, and I've made no progress so far ...  Can someone give me a hint ? Detection of the Electric Charge of a Black Hole Apparently, there are $\frac{(2n)!}{2^nn!}$ ways to break $2n$ people into partnerships. Why?   An explanation reads that there are $2n!$ ways to line people up. If we just pair adjacent people in the line up, we would have overcounted. So we must divide by $2^n n!$.  My question is why do we divide by $2^n n!$ specifically to adjust for overcounting?  Furthermore, this problem can apparently be solved by taking a skip factorial of odd values:  $(2n-1)(2n-3)(2n-5) ... (5)(3)(1)$  Why is that so? What does this skip factorial have to do with the problem? How do we play multiplayer minecraft on iPads? We have two iPads, and both of them have Minecraft PE. My son wants to connect the two and play with me. I have absolutely no idea what I am doing here, so I do not know how to do this.   One game says "Broadcast to LAN", and the other one says "Local Server Multiplayer". I have switched both to on.   What do I need to do to be able to play joined? We are both on the same WiFi. Category of Grp is not a subcategory of Set Can the union axiom be weakened? Let $A\in M_{n\times n}(\Bbb R)$ so that $I\notin span(A,A^2,...,A^n)$. Prove that $\det(A)=0$.