I currently have a document (), where I define the paper size and one sided design as class options. I use the KOMA-Script class scrbook.   in A4 format for printing on usual printers at university and watching at the screen in A5 format for professional printing (well, it was not printed so far, but I would like to try this)   At the moment, I have a TODO list what to change when I switch from A4 toA5:  * In `GeoTopo.tex`...   * ... replace `a4paper` by `a5paper`,   * ... replace `oneside` by `twoside` and   * ... replace `\usepackage[...]{hyperref}` by `\usepackage{nohyperref}` * In `titlepage.tex`: replace `10cm` by `4cm`   Is there any (La)TeX solution so that I would only have one thing to get these different configurations?  I think it might look like this:  \newcommand{\CompileConfiguration}{A4} ... \if\CompileConfiguration==A4     \usepackage[...]{hyperref} \else     \usepackage{nohyperref} \fi   My thirst thought was to make it dependent on the paper size. But I have no idea how the condition would look like in this case.   An even better solution would define a variable even before \documentclass. But I have never seen anything before \documentclass except nag, so I doubt this is possible. Especially, even for the example above, I don't know the details. Is it == for comparison or =?   I have seen  \ifundefined \ifnum \ifodd \ifdim \iftrue \iffalse \ifx   so maybe there is no string comparison. But I don't know what other type \CompileConfiguration has (or how I could define it e.g. as a boolean)
I would like to be able to set a flag at the beginning of the main flag (say output) that tells if I want to produce a paper document or an electronic document.   Then I should check this flag to define or not empty pages, hypperref, oneside or twosides, etc.  How could I do that ?
Difference in output between SAS's proc genmod and R's glm I'm trying to replicate a model fitted in SAS in R but the fit I'm getting gives me slightly different coefficients and standard errors.  Data:  testdata &lt;- data.frame(matrix(c("f","Test", 1.75,   16, 0,  16, 0,  1,  1, "m",    "Test", 1.75,   15, 1,  16, 6.25,   1,  0, "f",    "Test", 2.75,   4,  12, 16, 75, 1,  1, "m",    "Test", 2.75,   9,  6,  15, 40, 1,  0, "f",    "WHO",  1.75,   15, 1,  16, 6.25,   0,  1, "m",    "WHO",  1.75,   14, 2,  16, 12.5,   0,  0, "f",    "WHO",  2.75,   2,  13, 15, 86.6667,    0,  1, "m",    "WHO",  2.75,   3,  13, 16, 81.25,  0,  0 ), ncol=9, byrow=TRUE)) names(testdata) &lt;- c("sex", "vaccine", "dose", "not_p", "para", "n", "pct",                       "vacnum", "sexno")   SAS:  proc genmod data=model_data; class sex; model para/n  = dose sex vacnum    /dist=bin    link=logit   type3; run;  Analysis Of Maximum Likelihood Parameter Estimates  Parameter   DF Estimate Std Error Wald 95% Conf Lim Wald Chi-Square Pr &gt; ChiSq  Intercept   1 -9.4020   1.6220    -12.5810  -6.2230  33.60           &lt;.0001  dose        1  3.9208   0.6460      2.6546   5.1870  36.83           &lt;.0001  sex f       1  0.5574   0.5184     -0.4587   1.5735   1.16           0.2823  sex m       0  0.0000   0.0000      0.0000   0.0000    .              .  vacnum      1 -1.3221   0.5483     -2.3967  -0.2475   5.81           0.0159  Scale       0  1.0000   0.0000      1.0000   1.0000        R:  testdata$sexno &lt;- as.factor(testdata$sexno)     a &lt;- contr.treatment(2, base = 1, contrasts = TRUE)  contrasts(testdata$sexno) &lt;- a  fitreduced &lt;- glm(para/n ~ dose + as.factor(sex) + vacnum,                    family=quasibinomial(link="logit"), data=testdata)  coef(summary(fitreduced))                    Estimate Std. Error   t value    Pr(&gt;|t|) (Intercept)     -9.4013750  1.7613982 -5.337450 0.005935450 dose             3.9173794  0.7001133  5.595351 0.005007179 as.factor(sex)1  0.5704671  0.5568436  1.024466 0.363525300 vacnum          -1.3336100  0.5887552 -2.265135 0.086189704   I believe I have the right contrasts to give me a type III SS but there is a small discrepency in values, have a missed something here? How to get the day, year, hours, min Individually from date format "yyyy-MM-dd'T'HH:mm:ss.SSSZ"? How many ways can you divide $9$ students into three unlabeled teams where one team contains $4$ people, one contains $3$ people and the last contains $2$ people? Unlabeled, meaning that groups with abc = bca = cba, etc  I understand how to do this if the teams are labeled:  $$\frac{9!}{4!3!2!}$$  But there is a term missing in the denominator when the teams are unlabeled and I'm having difficulty understanding how to calculate how many ways the teams can be organized.  There are $3!$ ways to organize the same first group of $3$, $4!$ ways to organize the same second group of $4$ and $2!$ ways to organize the last group of $2$. Why wouldn't you multiply $3!4!2!$ in the denominator?   For instance:  (ABC, DEFG) = (ABC, DEGF)  = (ABC, DFEG) = (ACB, DFGE), etc Will cases with front USB port support USB 3.0? Proving an infinite number of primes of the form 6n+1 The proofs given on other sites weren't that clear and used different methods that I have yet to learn.    Prove that there are an infinite number of primes of the form 6n+1.  The hint that was given was: Let p = p1, p2, ..., pk + 1, where p1 = 2, p2 = 3,...pk are the first k primes.  Show that p is prime.  (p1 means p sub 1, p2 means p sub 2, and pk is p sub k.  Wasn't sure how to write it on this.)    Can someone explain this hint on how they came about of p1 = 2, p2=3, etc, and prove this please?    Also, how would the proof change if the form changed?  ("Prove that there are infinite number of primes of the form....") When should a verb be followed by a gerund instead of an infinitive? Some verbs are followed by ing, e.g. I enjoy swimming. We can't say I enjoy to swim. Likewise, some verbs are followed by to, e.g. I decided to make a plan.   Which particular verbs are followed by ing and to? Can you please provide a list for that?  Moreover, which verbs can be followed by both without having the meaning changed? Book recommendation for Atomic & Molecular physics What are some interesting books for a sophomore undergrad about Atomic &amp; Molecular Physics? Achieving Super or Subscript graticule labels in QGIS Composer windows? It is quite common for paper topographic maps to label the map graticule with ordinate values in a mixture of superscript and standard digits, eg. ⁴123⁰⁰⁰ to emphasise the significant digits.  The QGIS Map composer allows graticules (termed grids) to be drawn on the map, and the ordinate labels to be customised, but does not recognise HTML tags such as &lt;sup&gt;.  Is there any other way to achieve this effect? How do you pull first 100 characters of a string in PHP I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing.    Is there a function that can do this easily?  For example:  $string1 = "I am looking for a way to pull the first 100 characters from a string variable to put in another variable for printing."; $string2 = 100charfunction($string1); print $string2   To get:  I am looking for a way to pull the first 100 characters from a string vari Why doesn't `sudo cd /var/named` work? I don't always answer myself, but when I do, I fail to ask a good question Sometimes I'll encounter problems while coding, or sometimes out of simple interest for a question, I'll google for an answer, and most of the time I find that answer is here on stackoverflow.com.   If I can't find an answer, or if it's not enough to satisfy my curiosity, sometimes I expend my own effort to solve those questions. And after I've solved it, I'm happy to make my contribution to the community, and I post them as the Q&amp;A style posts. For example:     It seems relatively easier to ask a question if I didn't already have a solution, and I can put what I have so far in the question body, such as:     The problem to me is, if I have my own solution to my own question, then most of what I have so far becomes part of the solution. It's likely I have failed in making my contribution by asking a question to which I have an answer, for example:     So I'm wondering if there are some guidelines or good practices for Q&amp;A style posts?   How do I do it better? Why is "chmod -R 777 /" destructive? This is a  about File Permission and Why 777 is "destructive".   I'm not asking how to fix this problem, as there are a ton of references of that already on Server Fault (reinstall OS). Why does it do anything destructive at all?  If you've ever ran this command you pretty much immediately destroy your operating system. I'm not clear why removing restrictions has any impact on existing processes. For example, if I don't have read access to something and after a quick mistype in the terminal suddenly I now have access well... why does that cause Linux to break? If $f \colon [a,b] \rightarrow \mathbb{R}$, then show that there exists $c \in [a,b]$ such that $\int_a^c f = \int_c^b f$ If $f \colon [a,b]\rightarrow \mathbb{R}$, then show that there exists $c \in [a,b]$ such that $c \in [a,b]$ such that $\int_a^c f = \int_c^b f$.  I think that I have to proceed with the Mean Value Theorem of Integrals... Rules for the usage of "me" VS. "myself"? What are general guidelines for the use of "me" and "myself"?     Did I describe me or did I describe Maria?   OR     Did I describe myself or did I describe Maria? Teenage girl in life-sustaining valley on poisoned Earth visited by another survivor Use filecontents environment to write a binary file In  of mine, I was trying to show how to embed an audio file into the pdf with the multimedia package. The resulting MWE does not stand on its own because it requires an example audio file.  I guess my first question is, does TeXLive include any example audio files? The second, and potentially less uninteresting question is, can I use the filecontents environment, or some other environment, to create a binary file?  \documentclass{article} \usepackage{graphicx} \usepackage[implicit=false]{hyperref} \usepackage{multimedia}  % What goes in here to produce a usable wav file. Happy to use a different environment. \begin{filecontents}{\jobname.wav} \end{filecontents}  \begin{document} \sound[inlinesound]{\includegraphics{example-image}}{\jobname.wav} \end{document} Why does my pilot light keep going out? My furnace pilot light keeps going out so I changed the thermocouple. Now the furnace will come on and heat up to the degree set on my thermostat, then the pilot light will go out and the furnace will not come back on.    Could the thermostat be bad and cause the pilot light to go out? I want to make sure all of the data in my plugins/themes is handled securely  before entering the database and before being output to the browser. My problem is that there are situations where the API handles the sanitization for you -- like when saving post meta fields -- and others where the plugin/theme author is wholly responsible for doing it -- like when saving custom settings.  For the scope of this question, I'm not concerned about validating data at the domain level -- e.g., checking that an Age field on a form is between 0 and 120, or that an e-mail address is valid. I'm only concerned about security -- e.g., escaping SQL queries to avoid SQL injection when saving to the database, or sanitizing data that's output to HTML templates to avoid XSS.  For output sanitization, I know that you always need to use functions like esc_html() and esc_attr() when echo'ing variables into HTML templates. But, what about when using ? Do they all sanitize the output already? If so, for which context (general HTML, tag attributes, etc)? Some functions have variants for different contexts (like the_title_attribute(), but most don't.  For input sanitization, I know that I need to use $wpdb-&gt;prepare() when making manual queries, but what about when using the Settings API to create a plugin settings page, or saving post meta fields for a custom post type?  Right now I've just been digging through Core and reading tutorials every time I use a function to find out if it sanitizes or not, but that's error-prone and time consuming. I'm hoping to find some kind of comprehensive list of all the possible situations and whether or not the API handles it. e.g.,  API validates/sanitizes   Saving post meta with update_postmeta() Saving user meta with update_user_meta() Outputting a post title - use the contextually appropriate variant of the_title() etc   You have to manually validate/sanitize   Saving plugin options with the Settings API. Pass a callback as the 3rd parameter of register_setting(). Direct database queries: Wrap the query in $wpdb-&gt;prepare(). Outputting variables in HTML. Use esc_attr(), esc_html(), etc etc   I'd also be interested to understand why the API provides it in certain situations, but not others. I'm assuming it has something to do with the unknown nature of the data, but would love to hear a thorough explanation. prove that $24 \mid a(a^2-1)$ If $a$ is an odd integer, prove that $24 \mid a(a^2-1)$.  I proved in my class that $a^2=8k+1$ for some $k$, provided $a$ was odd.  So $$a(a^2-1)=(2k-1)(8k+1-1)=8k(2k-1)$$ but I can't pull a $24$ out of it. Reading/writing an INI file Is there any class in the .NET framework that can read/write standard .ini files:  [Section] &lt;keyname&gt;=&lt;value&gt; ...   Delphi has the TIniFile component and I want to know if there is anything similar for C#?