I want to generate two variables with (pseudo-) random numbers with an exact pearson's r. How do I do that? Python and/or R solutions would be nice!  I am able to generate random data that approximates a pre-specified r in python in the following way. I'm not searching for approximations but for data that with an exact pre-specified r, i.e. with r=0.83000 in the example below:  samples = 200 r = 0.83  # Generate pearson correlated data with approximately cor(X, Y) = r import numpy as np data = np.random.multivariate_normal([0, 0], [[1, r], [r, 1]], size=samples) X, Y = data[:,0], data[:,1]  # That's it! Now let's take a look at the actual correlation: import scipy.stats as stats print 'r=', stats.pearsonr(X, Y)[0]   The motivation for knowing r is that I'm testing out (bayesian) statistical models that can infer r from data and they are a lot easier to evaluate when r is well specified.  SOLUTION:  thanks to Greg Snow for pointing out the empirical=TRUE command in mvrnorm (multivariate random normal stuff)! Here's the explicit code:  samples = 200 r = 0.83  library('MASS') data = mvrnorm(n=samples, mu=c(0, 0), Sigma=matrix(c(1, r, r, 1), nrow=2), empirical=TRUE) X = data[, 1]  # standard normal (mu=0, sd=1) Y = data[, 2]  # standard normal (mu=0, sd=1)  cor(X, Y)  # yay! cor(X*0.01 + 42, Y*3 - 1)  # Linear transformations of X and Y won't change r.

For a simulation study I have to generate random variables that show a predefined (population) correlation to an existing variable $Y$.  I looked into the R packages copula and CDVine which can produce random multivariate distributions with a given dependency structure. It is, however, not possible to fix one of the resulting variables to an existing variable.  Any ideas and links to existing functions are appreciated!     Conclusion: Two valid answers came up, with different solutions:   An R  by caracal, which calculates a random variable with an exact (sample) correlation to a predefined variable An R  I found myself, which calculates a random variable with a defined population correlation to a predefined variable     [@ttnphns' addition: I took the liberty to expand the question title from single fixed variable case to arbitrary number of fixed variables; i.e. how to generate a variable having predefined corretation(s) with some fixed, existing variable(s)]


I know that sitting in an asteroid field once you've dealt with the event there can level up the shield skill for a crewmember; they gain XP by restoring shield points, regardless of whether an asteroid or an enemy weapon damaged the shields.  When an asteroid misses me (the ship dodges it), do the crewmembers manning the Pilot & Engines consoles gain XP for their respective roles?

When I've got a station manned, I'm trying to work out what causes my crew to develop in skills. It looks like engines and cockpit crew only upgrade when an attack is dodged, and then get a single skill point. Is this correct, and what causes Shields and Weapons to get an upgrade point?


I am trying to ensure my class gets disposed by implementing IDisposable. However I have found that if I close the console by pressing the X then the dispose method is not called. How can I ensure it is called in this instance?  using System; using System.IO;  namespace Testing {     public class Disposable : IDisposable     {         private StreamWriter output = File.CreateText(@"test.txt");          public Disposable()         {             output.WriteLine("Created!");         }          public void Dispose()         {             output.WriteLine("Disposed!");             output.Dispose();         }     }      static class Program     {         static void Main(string[] args)         {             using (new Disposable())             {                 Console.ReadLine();             }         }     } }   You can test this behaviour with the above. If you execute the program and press any key, the program terminates properly and the file will contain:  Created! Disposed!   However if you execute the program and close the console by pressing the X the file will be empty as the stream does not get disposed and/or flushed.

I have a console application that contains quite a lot of threads.  There are threads that monitor certain conditions and terminate the program if they are true.  This termination can happen at any time.  I need an event that can be triggered when the program is closing so that I can cleanup all of the other threads and close all file handles and connections properly.  I'm not sure if there is one already built into the .NET framework, so I'm asking before I write my own.  I was wondering if there was an event along the lines of:  MyConsoleProgram.OnExit += CleanupBeforeExit;


Do we say "kinder" or "more kind"? I found people saying both things over the internet and got confused. Which is the correct one?

I know the rule for making the comparative and superlative form for two-syllable words ending in y, replace the -y with i and use -er and  -est:    hap.py → happier → (the) happiest ti.dy → tidier → (the) tidiest fun.ny → funnier → (the) funniest  Instead for two-syllable adjectives which do not end in -y, use more and most:    bor.ing → more boring wor.ried → more worried care.ful → more careful tra.gic → more tragic  However, there are inexplicable exceptions: The Free Dictionary says the comparative and superlative form of  is cleverer and cleverest. Yet to my ears     He's more clever than I thought   sounds more formal and correct.  Google produces a total of  for “he is more clever than” and  for the contracted form,  “he's more clever than”. Similarly, Google yields  and  for “he's cleverer than” and “he is cleverer than” respectively, which suggests there is very little to choose between the two comparative forms.  Meanwhile, TFD insists that the comparative and superlative form of  is  simpler and simplest. Google seems to concur and produces  for “it is simpler” compared to only  for “it is more simple”.  The two-syllable adjectives that I am aware of, which have both kinds of comparative and superlative forms are:   clever → cleverer/more clever → cleverest/(the) most clever common → commoner/more common → commonest/(the) most common gentle → gentler/more gentle → gentlest/(the) most gentle humble → humbler/more humble (etc.) hollow → hollower/more hollow  narrow → narrower/more narrow  polite → politer/more polite quiet → quieter/more quiet simple → simpler/more simple stupid → stupider/more stupid subtle → subtler/more subtle   Etymologically speaking, is there any explanation for this?  Is it a recent trend?  It seems to me that the number of two-syllable adjectives that add the suffix -er and -est are increasing.   And finally, is there a trick or rule which I can teach my advanced private students? With younger learners and beginners I teach the “rule” that I mentioned at the beginning—so much simpler! :)    EDIT  December 11, 2019     I shall never ever understand Google's algorithms and how they produce their statistics. In the end, for the sake of clarity, the number of results have been substituted and updated with the number of pages each search produced.


I would like to store reference to variable in some class, and make operations on it inside this class. Operations should modify original variable. In particular following code should print 1 instead of 0.  class Test {     private Long metric;      public Test(Long m) {         this.metric = m;         ++this.metric;     } }  class Ideone {     public static void main (String[] args) throws java.lang.Exception     {         Long metric = 0L;         Test test = new Test(metric);         System.out.println(metric);     } }   How to achieve this behaviour?

I always thought Java uses pass-by-reference. However, I've seen a couple of blog posts (for example, ) that claim that it isn't (the blog post says that Java uses pass-by-value). I don't think I understand the distinction they're making. What is the explanation?


When i pass the char * literal to trim() it seg faults but when I send an array pointer it works why is this not working?  int main(void){     /* If instead I have a char s[100] = "Hi      ";       * it works as intended so why does it not work when i pass this.*/     char *s = "Hi       ";     printf("<%s>\n", s);      trim(s);     printf("<%s>\n", s);  }  /* Trims all white-space off at end of string. */ void trim(char *s){     while (*s != '\0') ++s;      --s;     while (*s == ' ') --s;     *(++s) = '\0'; }

The following code receives seg fault on line 2:  char *str = "string"; str[0] = 'z';  // could be also written as *str = 'z' printf("%s\n", str);   While this works perfectly well:  char str[] = "string"; str[0] = 'z'; printf("%s\n", str);   Tested with MSVC and GCC.


I have the object selected in Object Mode but the Properties Editor is not showing me any settings/options in order to allow me to add textures, modifiers, materials, etc. It's as if nothing is selected yet the object is selected. Switching back and forth between Object and Edit mode makes no difference. Cycles Render is selected. I'm running version 2.79b. I'm thinking its got to be something simple that I'm just overlooking but for the life of me I can't figure out what the problem is.

Whenever I click a tab lets say material I have to press the MMB and drag my mouse to the right or left instead of scrolling normally.


I am trying to understand the difference between int *[5] and int (*)[5]  and my simple code is as below.  int main() {     int a[5] = {10,11,12,13,14};     int *ptr[5];     ptr = &a; }      What is the difference between int *[5] and int (*)[5] in C?

What is the difference between int *a[3] and int (*a)[3]?


I have a web service where I send out bulk email on behalf of customers.  The sending email address is the same for all customers, something like noreply@mycompany.com.  When sending out the email on behalf of a customer, I'd like to specify the name of the customer in the email address.    For example, when I send email for ACME Inc., I'd like the the email address to look like:   ACME Inc. <noreply@mycompany.com>   But I send email on behalf of Globex Corp., I'd like the email address to look like:  Globex Corp. <noreply@mycompany.com>   I know how to do this, but would using different names with the same sending email address raise any flags with spam filters or email blacklist sites?  Email deliverability is very important.

When sending or forwarding emails using a personal or company domain using a  website or email client, how do I prevent the email from being incorrectly marked as spam?


Not work clock! with animate with XeLaTeX  Edit Code:      \documentclass{beamer}     \usepackage{animate,color}     \usepackage[timeinterval=1,font=Helv]{tdclock}      \begin{document}      \begin{frame}     \initclock     \begin{animateinline}[autoplay,loop]{1}     \strut\emph{\textcolor{red}{Remark:}}\newframe[3]     \end{animateinline}     This is test of animate And tdclock packages.     \begin{center}     \alert{Not work clock!}     \\     \tdtime      \\     %\crono \cronohours\pdfcolon\cronominutes\pdfcolon\cronoseconds     \end{center}      \end{frame}      \end{document}   a) Windows 7 operating system b) pdfviewer: Adobe Reader XI versian 11.0.09 c) TexLive 2018  upload

I'm adding a title clock in the foot line of a beamer slide, if I compile it with pdfLaTeX it works fine; while the clock doesn't align in the middle vertically if compiling with XeLaTeX. How can I fix this.  Here is my MWE:  \documentclass[10pt]{beamer} \usepackage[font=Times,timeinterval=1]{tdclock} \usetheme{Madrid} \title{Title} \author{Authors} \institute{Institute} \date[\initclock\tddate\ \ \tdtime]{\today} \begin{document} \frame{\titlepage} \end{document}


Short Story of man wandering who comes across area with strange ground, topography. Meets young woman who is barefoot. He eventually learns she is blind but can move without limitations because her world is designed to allow full functionality for the disabled. The story is forty maybe fifty years old.

I was reading  and it made me suddenly remember another story I read in a book somewhere in the 90s to the early 2000s. Rather than being about a sighted man showing up in a community of the blind, this involved a hearing man (for some reason, I want to say he was either a reporter or an encyclopaedia salesman) showing up in a community for the deaf. They were socially isolated, the result of the government or society trying to eliminate hereditary deafness. I don't remember if the theme was of eugenics or simply that deaf people were kept from meaningfully interacting with society. While there, the protagonist notices that the children (all of whom are deaf) spend time standing in fields, holding hands, and swaying to music he can't hear. He comes to realize that, by being completely isolated from sound, the community hears something more fundamental to the universe, and the story ends with the community using this to move to another world, possibly a higher plane of existence.  One of the odd details that I remember was a member of the community communicating that when they started out, they were preyed upon by men who assumed they would be easy targets due to their deafness, and that they had both trained to defend themselves and also kept a number of guard dogs on the premises.


Source |       SS       df       MS              Number of obs =     300 -------------+------------------------------           F(  5,   294) =16580.50        Model |  1.1499e+10     5  2.2998e+09           Prob > F      =  0.0000     Residual |  40778600.2   294  138702.722           R-squared     =  0.9965 -------------+------------------------------           Adj R-squared =  0.9964        Total |  1.1540e+10   299  38593905.2           Root MSE      =  372.43   Should I be worried about this- does your F statistic size matter?  How do i find out what the p value of my model is - is it the p value attached to _cons in the bottom of my coefficients?  what do i test this F stat against and what warrants significance?


My page has worked perfectly until yesterday without change anything started to not recognize accents and the letter ñ. That happens just with the data from the database (Mysql) and if i refresh the page sometimes works fine and sometimes changes just a few words, not all, and sometimes all words so it's difficult to know why this is happening. I have the meta charset in my html with utf8, the headers HTTP looks fine, i have utf8mb4_spanish_ci in the database and in the tables and i also proved to save my files in UTF-8 with BOM and without it and still doing the same. I also change the charset in all connections with set_charset("utf8") but the problem persists. I don't know what more to do.  Thank you

I'm setting up a new server and want to support UTF-8 fully in my web application. I have tried this in the past on existing servers and always seem to end up having to fall back to ISO-8859-1.  Where exactly do I need to set the encoding/charsets? I'm aware that I need to configure Apache, MySQL, and PHP to do this — is there some standard checklist I can follow, or perhaps troubleshoot where the mismatches occur?  This is for a new Linux server, running MySQL 5, PHP, 5 and Apache 2.


Given $\vec{F}$, $m$, and $\theta$: how can I determine what $\vec{H}$ is?  Note: $\vec{F}$ has only an $x$ component (applied horizontally)   Here is what I've tried:   Which gives me the this: $\cos{\theta}=\frac{\vec{F}}{\vec{H}}$ Solving for $\vec{H}$: $\vec{H}=\frac{\vec{F}}{\cos{\theta}}$ However, this equation is incorrect. The ratios are false and yield a faulty answer. Why is this?  Using a different triangle setup:  This gives me: $\cos{\theta}=\frac{\vec{H}}{\vec{F}}$ Solving for $\vec{H}$: $\vec{H}=\vec{F}\cos{\theta}$ This is the correct equation. But why does the other result not work? It may seem obvious to some, but it doesn't quite come clear to me.  Question: Why can I not relate the vectors in the way I did above?

When solving for the force component ($F$) in the direction of the string, the following triangle is drawn.    (Adapted from )  Giving $F=mg * cos θ$  Why is it drawn that way, and not like this?    Which would instead give:  $F=mg / cos θ$  $ cos θ=mg/F$  $F=mg / cos θ$


I'm trying to decide what to take as a feat for my unarmed monk build. I came across the Dual Wielder feat which says     You master fighting with two weapons, gaining the   following benefits:      • You gain a +1 bonus to AC while you are wielding a   separate melee weapon in each hand.      • You can use two-weapon fighting even when the one-handed   melee weapons you are wielding aren’t light.      • You can draw or stow two one-handed weapons when   you would normally be able to draw or stow only one.   Does the fist count as a weapon in the context of the first bullet?

For the purposes of the fighter Battle Master archetype, whenever a maneuver calls for a "weapon attack" does that include an unarmed strike?


I declared var0, var1, var2, var3 with a for loop. How do I echo the vars inside that for loop? Here's the code.  #!/bin/bash  for i in {0..3} do   export var$i=$i done;   There i defined var0, var1, var2, var3.. how do i access them in a loop?  i tried the following  for i in {0..3} do   echo $var$i   tmpvar=var$i   echo $tmpvar done   but none gave me the values of var0,var1... first echo just printed '0,1,2,3', second echo printed 'var0,var1,var2,var3' what do i do? I want the values..

I'm sure it is relatively simple, I just don't know how to do it.  #!/usr/bin/ksh set `iostat` myvar=6   I want to something like echo ${$myvar} which i want interpreted as ${$myvar} -> ${6} -> value


I couldn't adjust my computer's brightness after I installed Ubuntu 16.04 with its default controller. Then, I downloaded brightness-controller package which is a great tool. It worked. Now I want to add shortcuts to this package's controllers for darkening and whitening. Which commands should I integrate with shortcuts?

Is it possible to adjust desktop monitor brightness like on laptops? Yes all desktop monitors have separate menu for it. But is it possible to change this to something like Winkey+(F1..F12)?    Monitor is connected via VGA or DVI cable.   OS: Ubuntu 14.04 Desktop monitors


I'm using JQuery and AJAX to load replace content in the website (for an HTML based game) instead of switching pages, which would stop music and animations that are playing. However, once the user clicks on a div with the class "d," the script for the div with class "f" no longer works. The same is true if the user clicks .f first; then .d no longer loads in the content anymore. How can I let these both (and many more in the future) work without canceling each other out? Do I need to use a loop? Or an if/else statement?  $(document).ready(function(){     //d     $(".d").click(function(){         $("#content").load("d.htm");     });      //f     $(".f").click(function(){         $("#content").load("f.htm");     }); });

I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.


anyone of you know how to get effect like in these code   public function create(SomeInterface $obj)  {      $class = get_class($obj);      return new class extends $class {         //some magic here      }  }   Obvious that code will not work in PHP. $obj can be an instance of many different classes.  I want to get an instance of class extending the $obj. (It will give me an ability to overload some basic methods)

Is something like the following possible in PHP?  $blah = 'foo1';  class foo2 extends $blah {     //... }  class foo1 {     //... }   This gives an error.  I want to dynamically set $blah so I can extend whatever class I want.  Edit: The reason for wanting to do this because I wanted to use a function out of another class in a related class. In the end it would have been something like:  Final extends foo1 extends foo2 extends foo3 extends foo4 extends parent { ... }   In the end I decided to instantiate the other class within the class and use it. Not the best options because they both you 2 of the same classes, but this won't be used that often, so it will work for now.


I'm cleaning up my MBP and found two Library folders, one of 3.37 Gb and the other 9.75 Gb. Why are there two of them, and more importantly, how can I reduce their sizes?

There are two 'Library' directories in my OS X 10.11 installation, one being /Library/, the other being /System/Library/. What is the difference between different Library folders?


I am trying to write a logic equation with symbols and when I use \equiv everything afterwards is italics and does not allow spacing, even if I go to a new line.   Example:  p \to q \equiv \lnot q \to \lnot p  Output:   p → q ≡ ¬q→¬p  I have attempted to put the \equiv between $ but that also didn't work.  Also if I try to type on the next line it doesn't go to the next line, the only way I can go to the next line is by using \\ and even when I do that the next line is still italicized and there are no spaces.  I am new to LaTeX and stackexchange but can someone please help me out?  Thanks

Some lines in my document are italicized, with no spaces between words, and continue after the edge of the document. The rest of the document is fine. Here is the beginning:  \documentclass[runningheads]{llncs} \usepackage{graphicx} \usepackage{float} \usepackage{tikz} \usetikzlibrary{arrows} \usepackage[explicit]{titlesec} \usepackage{amsmath,amssymb} % define this before the line numbering. \usepackage[width=122mm,left=12mm,paperwidth=146mm,height=193mm,top=12mm,paperheight=217mm]{geometry} \begin{document} \pagestyle{headings}   And then, for example:   \subsection{b)}\\  \\  Given that h(n) is admissible, the algorithm will be optimal for:\\  f(n)=(2-w)[g(n) + w/(2-w)h(n)]  \\  when w/(2-w) \leq 1, that is when w \leq 1 the algorithm is optimal.\\ It        behaves like an A* algorithm following the heuristic:  f(n) = g(n) + w/(2-w) h(n)   And below is the result:    Any help is appreciated!


I keep my credit card lines small for various reasons (reduce possibilty of impulse purchases, minimize my credit footprint etc) but there are times when certain necessary purchases exceed the amount on any one of my credit cards.  Right now I need to buy flight tickets for my family that will cost ~$5k and one of my credit card that has a limit of $3k is running a special promotion of 3% back on certain flight tickets. The upper limit on the amount of purchases for this program is $10k.  Needless to say, I would like to bill the whole $5k to this $3k limit credit card.  Now what I am planning to do is this:   Make a "payment" of $3k to this credit card Since there is almost nothing billed to this credit card, the card will now show a credit balance of $3k Assuming this would translate to a $6k "credit line" ($3k credit limit + $3k credit balance due to the "payment" I made), I should be able to let the $5k in flight tickets go through?   This is a credit card that does not transfer credit balances to my associated bank account (DCU for example does not allow credit balances on their credit card - they transfer the funds to the checking account, but this credit card does not do that)  Alternatively, I could ask for a credit line increase but it took a week last time I asked for it (and this is urgent) and I don't want this increase to be permanent.  Would this work?

I have a credit card with a credit limit of $1000, but I would like to make a purchase of $1500. If I transfer $500 into my credit card account, would that increase my credit limit to $1500?


Most 7805 datasheets specify an input capacitor of 0.33uF or so. This one (the LM340 ) at least specifies that the cap is only required if the regulator is "far" from the power supply filter, without further qualifying what "far" means. 0.33uF is nowhere near low impedance at power line ripple frequencies so we can rule that out.      Edit: the differences are self evident in the title of the question.

How does a cap on a regulator output improve transient response? Is this cap not more appropriately drawn next to the load where it is not being defeated by intervening trace inductance? Or does this output cap serve a different purpose than the typical bypass caps seen on a digital IC power supply pin?        Edit: This has been flagged as a possible duplicate. While the answers may have some overlap, the titles of the three questions I asked are very specifically different questions. This should be evident upon reading the Titles.


For my thesis I want to use a bibliography as well as footnotes for simple links.  To keep the footnote consistent, I want to use \footfullcite and store the information in a reference manager.  The footnote looks like expected, but the reference also appears in the bibliography. Is there a way to remove the bibliography citation if the reference is only cited with \footfullcite

Is there a way to excluded a citation specified in the text by \fullcite{Doe2013} from the bibliography? (I'm using biblatex+biber.)


Suppose $X$ is a space with a one point compactification $f: X\to Y$, where $x_0$ is the point that gets added to $X$, and suppose we have another one point compactification $f': X\to Y'$ where $x_1$ is the point that gets added to $X$.  I think we can define a homeomorphism $g: Y\to Y'$ in the following way: $g(x_0)=x_1, g(x)=f'f^{-1}(x)$ for all other $x$.  Intuitively I'm thinking this should be a homeomorphism (if it's not correct me), but I'm not seeing how to prove it.  I think it's fairly clear that it should be bijective, but how to show continuity (of both it and its inverse) isn't coming to me.  If anyone could give a hint that would be swell.

Say $X^{*}$ represents the one-point compactification of a space $X$ that is locally compact, non-compact, and Hausdorff. Also suppose that $Y$ is compact Hausdorff and $Y-\{p\}$, for a single point $p$, is homeomorphic to $X$. So then would $Y$ be homeomorphic to $X^{*}$? I think it is, but I'm not sure how it can be shown.    My attempt so far: Correct me if I'm wrong, but I started with inclusions $i: X \rightarrow X^{*}$ and $j: Y-\{p\} \rightarrow Y$, along with the homeomorphism $h: X \rightarrow Y-\{p\}$. So we need to find a homeomorphism $g: X^{*} \rightarrow Y$. So I tried using a commutative diagram and so far, I've concluded that $g$ (if it is to exist) would have to be continuous since the continuous image of a compact space is compact (I think this follows from $X^{*}$ being compact), but then one of my inclusions, i.e. $i$, can't possibly be continuous, can it (since $X$ is not compact)? How can this be fixed?


Is graviton a particle? What's your view on this?   Sence physics is the study of matter, it seems to me forced to believe that the gravitational force are particles. There are no particle called magneton to explain the magnetic force. Isn't it because the study of physics need matter to function.

Wikipedia lists the  as a hypothetical particle. I wonder whether graviton is indeed hypothetical or does its existence directly follow from modern physics? Does observation of gravitational waves amount to the discovery of graviton or could there be gravitational waves not composed of gravitons?


Is $2^{|\mathbb{N}|} = |\mathbb{R}|$? If so, how?  I was reading the Wiki page on the , and it says "Moreover, $\mathbb{R}$ has the same number of elements as the power set of $\mathbb{N}$", but I don't see how this is true?  I feel like it has something to do with binary, but I'm not too sure how it works? Do I have to show a map of all reals can be done in binary? I'm just very confused, and any advice would be appreciated!

I have learnt that the cardinality of the power set of the natural numbers is equal to the cardinality of the real numbers. What is the function that gives the one-to-one correspondence between these two sets?  I have also learnt that there exists no set whose cardinality is strictly between the natural numbers and the real numbers. Is there a proof of this or at least some intuitiveness behind it?


For all non vanishing natural numbers prove:  $$\sum_{k=1}^n\frac 1{\sqrt k} \leqslant 2 \sqrt n $$  I tried a proof by recurrence but I can't figure out the solution

I am just starting out learning mathematical induction and I got this homework question to prove with induction but I am not managing. $$\sum_{k=1}^n\frac1{\sqrt k}<2\sqrt n$$ Please help!


I would like an option on Meta communities to reference tags from different sites, similar to the distinction between [tag:] and [meta-tag:].  To keep things standardized, cross-site tags could use the same naming-format as .   [so-tag:java] →  [su-tag:microsoft-excel] →  [gaming-tag:gaming-history] →      Questions where cross-site tags would be helpful

The tag  and meta-tag  syntax generate much nicer looking results than merely surrounding your tag with [square brackets].    However, they only work when you're talking about the site you're on.  On Area51, in Chat, and on Meta sites, this is frequently not the case, leading to attempts at syntax like [[tag:failure]](https://superuser.com/questions/tagged/failure), which produces:    Hmm, must be some subtle syntax thing:   : [tag:failure](https://superuser.com/questions/tagged/failure) []: [[tag:failure](https://superuser.com/questions/tagged/failure)] : [tag:[failure]((https://superuser.com/questions/tagged/failure))] : [tag:failure] : [tag:failure][1] \n\n [1]: https://superuser.com/questions/tagged/failure : [more text is a [tag:failure] too](https://superuser.com/questions/tagged/failure)   I give up!  How can I create a link to a tag on another site with tag markdown?


The new Guest Book seems like a nice idea, but it doesn't appear to be saving any data entered into it. Entered text appears immediately upon submitting the form on the current page via JavaScript, but the data does not seem to be posting anywhere and does not survive a page reload.  There's a new JavaScript object called XMLHttpRequest (now standard with Internet Explorer 5) which might allow us to post the form data asynchronously without the need for reloading the entire page, but I haven't had a chance to experiment with it yet.  Maybe the devs can look into it?

I was trying to test if I was able to automatically send a message through curl by inspecting the network activity on chrome and getting the curl command, but I found out that in spite of messages showing up in the gestbook chat there was no any network activity. Why?


If you don't understand my title just ignore it and read this instead.... so this is my code...     alphabets=["a", "b","c", "d","e","f"]    nums=["one","two"]      for num in nums[:2]:         print(num.title())         print(alphabets[:3])    the output is like this......      one     ['a','b','c']     two     ['d','e','f']   I don't know what to do I already tried tons of different things. All I need is to get all the code in eight lines and I am expecting to get the output something like this...      one     ['a','b','c']     two     ['a','b','c']   the only problemis the second line outputs the same thing "a,b,and c" instead i want like "d,e,and f". Please Help! Thanks in advance!

I have a Python script which takes as input a list of integers, which I need to work with four integers at a time.  Unfortunately, I don't have control of the input, or I'd have it passed in as a list of four-element tuples.  Currently, I'm iterating over it this way: for i in range(0, len(ints), 4):     # dummy op for example code     foo += ints[i] * ints[i + 1] + ints[i + 2] * ints[i + 3]  It looks a lot like "C-think", though, which makes me suspect there's a more pythonic way of dealing with this situation.  The list is discarded after iterating, so it needn't be preserved.  Perhaps something like this would be better? while ints:     foo += ints[0] * ints[1] + ints[2] * ints[3]     ints[0:4] = []  Still doesn't quite "feel" right, though.  :-/ Related question:


If we have $\mathscr{O}(\mathbf{A}^2\backslash\{(0,0)\})=k[x,y]$, now how can we show that $\mathbf{A}^2\backslash\{(0,0)\}$ is not isomorphic to $\mathbf{A}^2$?

Why is the affine space $\mathbb{A}^{2}$ not isomorphic to $\mathbb{A}^{2}$ minus the origin?


The boss for a campaign i am writing right now is a high level spell caster. He will frequently be using the invisibility spell.  The adventurers are all level 3, and none of them have any spells or skills that allow them to specifically locate an invisible object.  Is it possible that they can listen to the verbal part of a spell and locate where he is? I ask this because i notice that 14th Level rogues get the feature 'Blindsense' which allows them to detect any invisible creature within 10 feet of you so long as you can hear them.  Furthermore, by using a sorcery point, and investing it into metamagic, the boss can cast these spells without the verbal component as specified in the Subtle Spell section. If he were to do this, would there then be no way of detecting the boss?  I assume a high survival check would enable them to see footprints moving, but other than that?  Many thanks.

I'm having trouble understanding the mechanics of invisibility, so I'd like to propose a scenario, as an example, which I don't know exactly how to handle as a GM.  Let's say my group is about to fight an Invisible stalker. The creature surprises them and a combat begins. At this point, at the very least the character who got attacked knows the location of the creature, right? It's a melee attack after all.  But what happens if the stalker walks around every round? Do they have to make a Perception check to find out on which square of the board the monster is EVERY round?  I guess what I'm trying to understand is exactly when do the characters have to guess the square where they think the invisible creature is, and when do they just know it.


How to evaluate the definite integral:  $$ \int \limits_0^\infty\frac {\sin^4(x)} {x^4} \operatorname dx $$  Also provide the reference to various theorems to be to used to evaluate it! Thank you.

I need to show that  $$ \int_0^\infty \frac{\sin^4x}{x^4}dx = \frac{\pi}{3} $$  I have already derived the result $\int_0^\infty \frac{\sin^2x}{x^2} = \frac{\pi}{2}$ using complex analysis, a result which I am supposed to start from.  Using a change of variable $ x \mapsto 2x $ :  $$ \int_0^\infty \frac{\sin^2(2x)}{x^2}dx = \pi $$  Now using the identity $\sin^2(2x) = 4\sin^2x - 4\sin^4x $, we obtain  $$ \int_0^\infty \frac{\sin^2x - \sin^4x}{x^2}dx = \frac{\pi}{4} $$ $$ \frac{\pi}{2} - \int_0^\infty \frac{\sin^4x}{x^2}dx = \frac{\pi}{4} $$ $$ \int_0^\infty \frac{\sin^4x}{x^2}dx = \frac{\pi}{4} $$  But I am now at a loss as to how to make $x^4$ appear at the denominator.  Any ideas appreciated.  Important: I must start from $ \int_0^\infty \frac{\sin^2x}{x^2}dx $, and use the change of variable and identity mentioned above


I was reading a comment that was made on SO that sounded strange to me     [That feature] should've better support in [the] next version   My first reaction to this was that it needs to be "should have" but since "should've" is a contraction of "should have" I was wondering if there's a formal English rule about this type of syntax or am I just wrong?

One can contract I have to I've when have is a helping verb, e.g.     I've got an octopus in my pants.   Is contracting the main verb technically incorrect or merely antiquated? My father loves to say,     I've a month-old smoked shoulder I can cook for dinner,   and he sounds like a crazy old man when he does. I would like to know if I can shut him down by informing him that he is incorrect. :)


I have the following system:  $x^{2} + y = 31$  $x + y^{2} = 41$  As I try to solve it via simple substitution, I get into 4-th power equations, which I can simplify to $(x-5)(x^{3}+5x^{2}-37x-184)$ (and I am not sure how to get the cubic here). Is there a simpler way to solve this? There are 4 pairs of answers, I have got one (5 and 6).

A friend asked me if I have a certain algorithm to solve $x^2+y = 31$ and $y^2+x=41$ simultanously. We found the solutions but we didn't find a way to solve both equations.  Any ideas?


I am using Linux system that comes with Windows 10 in developer mode. The problem is that there is internet in cmd but there is no internet in the Linux terminal:    system info: Linux DESKTOP-9IC0VL5 4.4.0-18362-Microsoft #836-Microsoft Mon May 05 16:04:00 PST 2020 x86_64 x86_64 x86_64 GNU/Linux

I tried sudo apt-get update in the new Windows Subsystem for Linux, but I get the following error:    The most relevant parts seem to be the "could not resolve" lines about Ubuntu servers, like:  Could not resolve 'archive.ubuntu.com'


I want to differentiate between the data types "string"&"int", if the input is "int" it will be appended, if not it will ask for correction **no_inputs = 5 l =[] while no_inputs >0:     user_input = int(input("Please enter a number : "))     if isinstance(user_input, int):                 l.append(user_input)         no_inputs -= 1     elif isinstance(user_input, str):         print("Please enter a number only ") print(l)**

In Python, how can I parse a numeric string like "545.2222" to its corresponding float value, 545.2222? Or parse the string "31" to an integer, 31?  I just want to know how to parse a float str to a float, and (separately) an int str to an int.


How much amps (maximum) would be flowing through a 5 meter Cat 5/6 Ethernet cable with 1000Base-T speed (IEEE 802.3ab, 5-PAM coding, so voltage levels vary between +- 2V, 1V, 0V)?

It seems that the voltage over ethernet ranges from 2 to 3 volts. How much current typically runs through the wires? I tried Googling with no success.  I ask this because I'm looking for components that are able to switch on and off an ethernet connection.


Is Ana's immune system actually compromised or was this created as a cover story to hide her? Her job seems pretty high profile as a way to hide someone or is a case of hiding in plain sight?

In Blade Runner 2049, so why is Dr. Ana Stelline in a bubble?  To clarify I'm not asking about her supposed weakness that has her in a bubble.  I mean if she is the key link to both sides issue, then why is she in a bubble.  We basically have two sides opposing each other in this sci-fi.  One side is driven to find the child so that they can make more slaves faster.  The other side so that they can have children and become "more than human" and have freedom.  Both sides have placed huge importance on the child.  One side to protect her, the other to obtain her and dissect her, or whatever, to figure out how this was possible.  I fail to understand how the side that has her in a bubble, making memories, is moving forward with their (the replicants') plan?  She's now 30 years of age and they are no closer to finding out how to have children of their own.  Are they just having sex with each other for 30 years hoping to hit the jackpot again?  Is she just important to them because she's naturally born... I mean they lead us to believe she's more important than that yet, they're not using her in any way to figure it out.  Given, I'm not sure how they could without putting her through some type of distress.  But 30 years now and she's still in there and their whole plan of a rebellion is hanging on the hope of having kids some day..


Basically i am a noob at programming but one of the first exercises we had was we had to use printf() which i found really difficult so i was wondering is there any real advantage to using printf() over print() with concatenation signs.

I haven't had the chance to take any serious low-level programming courses in school. (I know I really should get going on learning the "behind-the-scenes" to be a better programmer.) I appreciate the conveniences of Java, including the ability to stick anything into a System.out.print statement. However, is there any reason why you would want to use System.out.printf instead?   Also, should I avoid print calls like this in "real applications"?  It's probably better to  to print messages to the client's display using some kind of UI function, right?


I need to include a header in condition if it is present and if not i need to make the necessary steps for my code to work   I need to do something like...  // check if the header is present(may be .h files) #include"required_header" { block-1 }  //if the header is not present  { block-2 }   If I use like ....  #ifdef required_header #include<required_header> Block-1 #else Block-2   The above case is redirected to Block-2 always because i have included the header file only inside the condition of ifdef and its never included  Hoping for a method to do it.  Thanks in Advance :}  P.S: I have defined the header but assuming i have not done the work of the required header but i want someone else to write that file and I am not sure if he has written it.  Precisely speaking I want the code replacement way in the place of comments in the first given code.

I have a very large codebase (read: thousands of modules) that has code shared across numerous projects that all run on different operating systems with different C++ compilers. Needless to say, maintaining the build process can be quite a chore.   There are several places in the codebase where it would clean up the code substantially if only there were a way to make the pre-processor ignore certain #includes if the file didn't exist in the current folder. Does anyone know a way to achieve that?  Presently, we use an #ifdef around the #include in the shared file, with a second project-specific file that #defines whether or not the #include exists in the project. This works, but it's ugly. People often forget to properly update the definitions when they add or remove files from the project. I've contemplated writing a pre-build tool to keep this file up to date, but if there's a platform-independent way to do this with the preprocessor I'd much rather do it that way instead. Any ideas?


I have now just one vfat USB stick in travelling but I still need to take backups. I get gzip: stdout: File too large because vfat's limiting files bigger than 4.3 Gb. My backup command  sudo tar czf /media/masi/KINGSTON/backup_home_9.7.2016.tar.gz $HOME/   I need to split the backup to parts. Merge it later if possible.  I could start to do --exclude=/home/masi/books/ etc to limit things but it would be great to get many .jar files for the whole thing.  I do empty the trash of vfat USB stick because GUI does not work for it  rm -rf /media/masi/KINGSTON/.Trash-1000/ \     /media/masi/KINGSTON/.Trashes/ \     /media/masi/KINGSTON/.Spotlight-V100/   I check the filesystem after emptying trash  df -T | grep KINGSTON  Filesystem     1K-blocks   Used Available Use% Mounted on /dev/sdb1        7553040 412240   7140800   6% /media/masi/KINGSTON   I try Law29's proposal. I do    With 4000MB filesizes, since 4200MB not working TODO with bigger USB stick  # http://unix.stackexchange.com/a/61776/16920 sudo tar czf - $HOME | split /    --bytes=4000MB - /media/masi/KINGSTON/backup_home_9.7.2016.tar.gz  I do ls -l /media/masi/KINGSTON/backup_home_9.7.2016.tar.gzaa  -rw-r--r-- 1 masi masi 0 Jul  9 19:49 /media/masi/KINGSTON/backup_home_9.7.2016.tar.gzaa  I do df -i /media/masi/KINGSTON/ after getting an error TODO    But problem now: too big backup size for USB stick.  How can you estimate the size of the tar command?  System: Linux Ubuntu 16.04 64 bit Hardware: Macbook Air 2013-mid USB stick: 8GB, vfat

I need to backup a fairly large directory, but I am limited by the size of individual files. I'd like to essentially create a tar.(gz|bz2) archive which is split into 200MB maximum archives. Clonezilla does something similar to this by splitting image backups named like so:  sda1.backup.tar.gz.aa sda1.backup.tar.gz.ab sda1.backup.tar.gz.ac   Is there a way I can do this in one command? I understand how to use the split command, but I'd like to not have to create one giant archive, then split it into smaller archives, as this would double the disk space I'd need in order to initially create the archive.


When backing up Whatsapp History to iCloud, Whatsapp required nearly the same amount of free space as the total backup. i.e If Whatsapp need to back up 1.8 GB of data to iCloud it will need 1.8GB of free space on the iPhone.  Is there anyway to get around that? I simply dont constantly have 1.8GB of free space.

I have an iPhone 6s, fully updated. Starting from 20 December, whatsapp complains that there is not enough space on the iphone to do a backup to icloud. Before this date, everything worked fine and I don't remember doing anything particular around that time.  The backup dimension is 2.37 Gb with 878 Mb of videos. Currently I have 8.2 Gb of free space on my phone (and 40 Gb on iCloud), but whatsapp complains that I should "free 512 MB of space on the phone to do chat backup".  So, I have two questions:  1 - Why does the backup require any additional space at all? The 2.37Gb are already stored locally inside the whatsapp app; why would I need any additional space for the icloud backup?  2 - Why does it require so much more space? Is there something wrong?


I am using Ubuntu 13.10 and have installed compiz settings manager and cairo dock. The top right corner which gives you option for    about this computer system settings  shutdown  restart  logout and others seems to have a problem   All options are working except shutdown, logout, suspend, restart. Whenever I click on them nothing happens and sometimes this icon disappears from this tray.  How can I fix this?

I recently installed Ubuntu 14.04. Shutdown and logout from the top panel are not working.  They worked fine when installing the OS, but a few days back I installed fglrx drivers for my ATI graphics card. They didn't work and I got low resolution problems and Ubuntu didn't boot. I solved it by removing the fglrx graphic driver from the recovery mode and Ubuntu started to boot and work just fine, at least that's what I thought.  But now the shutdown and logout options in the top panel don't work. I have to logout using ctrl+alt+delete and shutdown with the shutdown option in the top panel (shutdown option works after logging out but not when logged in as a user).  I re-installed Ubuntu 14.04 LTS and shutdown options worked fine but after installing updates they stopped working again. I thought its the graphic driver fglrx installation problem but now i know its not that. I think its a problem with some file that got installed from Ubuntu updates.  Does any one know how to solve it?


I'm trying to export 3D scans from Meshlab to Blender but when importing to Blender the scans lose their colour. I have tried to export as .ply file but still no colour. How do I fix this?


In the diet my dietetician has prescribed me, I have amount of pasta allowed listed for dry (uncooked) pasta.  This is not a problem if I have the foresight to weigh the pasta before boiling, but it is a problem if I buy a dish with ready-made pasta or forget to weigh it before cooking (or just forget how much I had measured, and didn't write down).  Can you give me a rule of thumb / estimate, how much 75g of dry pasta weighs after it's boiled?

How much water will dry semolina pasta absorb when it is properly cooked?  For example, how much water would one pound of farfalle or spaghetti absorb?  I am guessing the shape of the pasta doesn't matter, just the absolute weight.  I am not looking for how much water is required to boil it, nor what temperature is required, just how much should be absorbed.  I like my pasta cooked a minute or so past the box "al dente" stage.  The application is single burner cooking (I only have one available).   I can make the sauce, then add additional water and pasta to cook directly in the sauce, making for only one burner being required, and only a single pot to clean.  I understand the actual amount will require due to the vagaries of how much evaporates, but I expect that to be a minor adjustment.


I have two user accounts and forgot one user's password. I have tried to reset it from the boot menu. After selecting recovery mode I have selected Drop to root shell prompt option but then it asked me to "give the root password for maintenance(or type control-D to continue)" don't know the password and even typing control-D doesn't work   What should I do now??  Please give me a solution

I need to reset my password. I have followed these steps:    However, then I go to "root" or "netroot" recovery options, it tells me:  Give root password for maintenance (or type Control-D to continue)   Clearly, I do not know the root password. If I type CTRL+D, I return to the list of options. From  I read:  Under chapter 'The Other Way':  4. Highlight the line that begins kernel and press 'e' to edit`   But in the grub configuration file I have no line that starts with kernel. Only:  setparams 'Ubuntu...' recordfail set gxfpayload... insmod part_msdos insmod ext2 set root=... search --no-floppy... linux /boot/vmlinuz-2.6.38... initrd /boot/initrd.img-2.6....   Those are all lines in my GRUB. Which line should I edit? Or is there another way to reset my password?


I'm new to Linux and today I'm trying to install AMD Catalyst™ 15.9 Proprietary Linux Graphics Driver for my HD 7650M.   Everything so far is good, but when I try to install XFree86-Mesa-libGL and XFree86-libs in terminal via sudo apt install XFree86-Mesa-libGL XFree86-libs it shows:  Reading package lists... Done Building dependency tree        Reading state information... Done E: Unable to locate package XFree86-Mesa-libGL E: Unable to locate package XFree86-libs   Any ideas how I can install these packages?

I did a clean install of Ubuntu 14.04 but I can't install Catalyst. When I try to install the driver it displays an error that there is no compatible adapter. I tried it with the stable and the beta driver. Any clues?


I was trying to post a solution to , but I got stuck with a \foreach loop which wasn't behaving as I expected it to.  Here's my first attempt:  \documentclass[a4paper]{scrartcl}  \usepackage{tikz,pgfplots,amsmath} \usepackage[T1]{fontenc} \usepackage{lmodern,textcomp,siunitx}  \begin{document}  \begin{center} \begin{tikzpicture}[font=\small] \begin{axis}   [     height=5cm,     width=6cm,     scale only axis=true,     %     xlabel={\(\alpha\) in \si{\degree}},     ylabel={\(\sin{(\alpha)}\)},     %     xtick=\empty,      ytick=\empty,      xticklabels={,,},      yticklabels={,,},      xmajorgrids={false},      ymajorgrids={false}   ]   \addplot+[domain=0:360,              samples=25,              only marks,              mark=-]             {sin(x)};   \foreach \myn in {1,...,25}     {       \pgfmathsetmacro{\myx}{360/(25-1) * (\myn-1)}       \pgfmathsetmacro{\myy}{sin(\myx)}       \draw (axis cs:0,\myy) -- (axis cs:360,\myy);     } \end{axis} \end{tikzpicture} \end{center}  \end{document}   I get an error:  ! Undefined control sequence. <argument> axis cs:0,\myy   l.41 \end{axis}  ?    I wasn't expecting such an error.  Nevertheless, I came up with a clunky work around.  Here's my 2nd attempt which works quite well (though a bit clunky):  \documentclass[a4paper]{scrartcl}  \usepackage{tikz,pgfplots,amsmath} \usepackage[T1]{fontenc} \usepackage{lmodern,textcomp,siunitx}  \makeatletter \def\aedrawline#1{%%   \edef\mycontent{#1}   \expandafter\ae@drawline\mycontent\@nil} \def\ae@drawline#1,#2,#3\@nil{%%   \draw (axis cs:#1,#3) -- (axis cs:#2,#3);   } \makeatother  \begin{document}  \begin{center} \begin{tikzpicture}[font=\small] \begin{axis}   [     height=5cm,     width=6cm,     scale only axis=true,     %     xlabel={\(\alpha\) in \si{\degree}},     ylabel={\(\sin{(\alpha)}\)},     %     xtick=\empty,      ytick=\empty,      xticklabels={,,},      yticklabels={,,},      xmajorgrids={false},      ymajorgrids={false}   ]   \addplot+[domain=0:360,              samples=25,              only marks,              mark=-]             {sin(x)};   \foreach \myn in {1,...,25}     {       \pgfmathsetmacro{\myx}{360/(25-1) * (\myn-1)}       \pgfmathsetmacro{\myy}{sin(\myx)}       \aedrawline{0,                   360,                   \myy}     } \end{axis} \end{tikzpicture} \end{center}  \end{document}   All's good until @Tarass posts  which is very similar in concept to mine but avoids the clunky work around of my attempts:  \documentclass[a4paper]{scrartcl}  \usepackage{tikz,pgfplots,amsmath} \usepackage[T1]{fontenc} \usepackage{lmodern,textcomp,siunitx}  \begin{document}  \begin{center} \begin{tikzpicture}[font=\small] \begin{axis}   [     height=5cm,     width=6cm,     scale only axis=true,     %     xlabel={\(\alpha\) in \si{\degree}},     ylabel={\(\sin{(\alpha)}\)},     %     xtick=\empty,      ytick=\empty,      xticklabels={,,},      yticklabels={,,},      xmajorgrids={false},      ymajorgrids={false},     after end axis/.code={%%       \foreach \myn in {1,...,25}         {           \pgfmathsetmacro{\myx}{360/(25-1) * (\myn-1)}           \pgfmathsetmacro{\myy}{sin(\myx)}           \draw (axis cs:0,\myy) -- (axis cs:360,\myy);         }     }   ]   \addplot+[domain=0:360,              samples=25,              only marks,              mark=-]             {sin(x)}; \end{axis} \end{tikzpicture} \end{center}  \end{document}   Could someone explain what's going on here?  In particular, why it that when the \foreach loop is called within the axis environment it is forgetful and needs instead to be processed from after end axis?

I am trying to mark two inflection points using a foreach loop in a pgfplot, but it isn't working.  \documentclass[tikz]{standalone} \usepackage{pgfplots} \pgfplotsset{compat = 1.10}  \begin{document} \begin{tikzpicture}   \pgfmathsetmacro{\infx}{1/sqrt(2)}   \pgfmathsetmacro{\infy}{exp(-.5)}   \begin{axis}[     xmin = -3,     xmax = 3,     ymin = -0.1,     ymax = 1.05,     domain = -4:4     ]     \addplot[blue, samples = 500, smooth] gnuplot {exp(-x^2)};      \foreach \x/\y in {\infx/\infy, -\infx/\infy}{       \draw[red] (axis cs: \x, \y) circle[radius = .025];     }   \end{axis} \end{tikzpicture} \end{document}   I am being told:  Undefined control sequence.^M <argument> axis cs: \x ^M                        , \y ^M l.34   \end{axis}^M


Problem  Given Banach spaces $X$ and $Y$.  Consider a compact operator $C\in\mathcal{C}(X,Y)$.  Then weak convergence is turned into strong convergence: $$x_n\rightharpoonup x\implies Cx_n\to Cx$$ I'd like to try proving it but would need some hints.  Attempt  Denote the sup-norm by: $$F:\Omega\to E:\quad\|F\|_\Omega:=\sup_{\omega\in\Omega}\|F(\omega)\|_E$$  Weak convergence is preserved under continuous operators: $$\|l(Cx_n-Cx)\|=\|(C'l)(x_n-x)\|\to0$$ By uniform boundedness principle weak convergence implies boundedness: $$x_n\rightharpoonup x:\quad\|l(x)\|_\mathbb{N}<\infty\implies\|x\|_\mathbb{N}<\infty$$ Hence one can exploit compactness of the operator: $$(x_n)_{n\in\mathbb{N}}\text{ bounded}\implies C(x_n)_{n\in\mathbb{N}}\text{ precompact}$$ And one obtains strongly convergent subsequences.  Should I combine these now and how?

I found the following property of compact operators in a proof, and I can't prove it.     Prove that if $T \in \mathcal{L}(E,F)$ is compact, and if $u_n \rightharpoonup u$ (the sequence converges weakly to $u$ in $\sigma(E,E^*)$) then $Tu_n \to Tu$ strongly in $F$.   I was able to prove that $Tu_n$ has a convergent subsequence ($u_n \rightharpoonup u$ implies that $(u_n)$ is bounded in $E$. Then, because $T$ is compact it must follow that $(Tu_n)$ must contain some strong convergent subsequence), but didn't manage to finalize the proof.  Any reference or hints are welcome.


I am using Kile to write latex documents. I want to include .svg picture in my document. After including   \usepackage{svg}    and compiling my document into pdf, I have an error:   "File 'svg.sty' not found. \usepackage "   So I downloaded package svg from ftp.tex.ac.uk but I don't know how to install it. I tried to use package manager, but it didn't see this as a package.  Can someone suggest me how can I do that?

I'm trying to compile a document that only works with an up-to-date distribution, so I'd like to know: how do I update my distribution? Please provide screenshots where appropriate.  List of answers           To keep an eye on what’s going on at CTAN you may subscribe to the  or the RSS feed feed://www.mail-archive.com/ctan-ann@dante.de/maillist.xml


I have an Altera DE2 board that outputs a 50 MHz clock and I'm trying to write a verilog module that can bring it down to 1 Hz. How can I do this?

I have a DE0 board with a 50 Mhz clock that am I trying to to bring down to 100 Hz in Verilog. Could anyone help me with the code to do this?


Once I was able to download apps from Google Play. But later, I disabled Download Manager for two days, then re-enabled it and opened Google Play to download apps but it started showing the following message whenever I tapped download.     Error while retrieving information from server. [RPC:S-7:AEC-0 XXXX-XXXX-XXXXX]     And XXXX marked letters change every time whenever I tap download.   (Click image to enlarge)      I cleared data and cache of Google Play, Google Play Services and Google Services Framework I removed the account and re-added it   But none of them worked.    I uninstalled Google Play updates, Google Play Services and reinstalled them --  didn't work as well.  I flashed my phone. So I got back my phone as new one -- it didn't work either.    I am just fed up now. I did everything as suggested. But none of them works. Please someone make solution to this problem.

Anyone on the Android Jelly Bean OS and not able to buy Apps/Books through wallet? I have just bought the Samsung GalaxyNote 800 and am facing this issue.   The error is (RPC:S-7:AEC-0).   What is the solution?


Why does the rope fly up from the nail against gravity? As shown in the picture, the blue arrow is the nail fixed on the wall, the yellow arrow is the rope, and the green arrow is the iron block. The rope on the right side of the nail moves downward under the action of the iron block, and the rope on the left side of the nail moves upward. At some point, the rope goes up and away from the nail. Why? How to calculate the height away from the nail?

This page has an interesting video of beads 'syphoning' out of a glass beaker:    The host has a few explanations for the effect, but none of them sound plausible to me. The beads are in 'perpetual motion'? 'Shock wave'? What could cause an entire bead chain to syphon out of a beaker like water does out of a syphon? It certainly does not look to me that there was enough initial investment in energy to move the chain as is done. On the other hand, considering that only a small portion of the chain is moving at any one moment in time, the whole system could be considered to be moving very slowly thus meeting the initial energy investment requirement (very low velocity).


I have seen at least one other question where a user has had issues with using Decimals as map keys (his issue was interchangeably using ints vs decimals), but it isn't the same issue I'm having, where Decimal keys appear to be treated as Strings for comparison:  Map<Decimal,String> m = new Map<Decimal,String>(); m.put(3.10,'Decimal key with trailing zero'); List<Decimal> keys = new List<Decimal>(m.keySet()); Decimal d = keys.get(0);  //Both of these statements should be true. If not, at the very least, //      they should both be false System.debug(d+' = 3.1? '+(d == 3.1));//3.10 = 3.1? true System.debug('CONTAINS KEY 3.1? '+m.containsKey(3.1));//CONTAINS KEY 3.1? false  //I can successfully add a Decimal key equivalent to one already in the Collection m.put(3.1,'Equivalent Decimal key without trailing zero'); System.debug('SIZE = '+m.keySet().size());//SIZE = 2  //Again, the Decimal objects are equal Decimal d1 = 3.1; Decimal d2 = 3.10; System.debug('Values are equal? '+(d1 == d2));//Values are equal? true  //But even if I remove the shorter value.... String removeValue = m.remove(3.1); System.debug('removeValue = '+removeValue);//removeValue = Equivalent Decimal key without trailing zero  //...It will not match in the get statement either String res = m.get(d1); System.debug('Res == null? '+(res == null));//Res == null? true   Am I missing something?

I came across some very strange behaviour when working with a Map with Decimal keys today. It seems like the Decimal type can't handle Integer assignments properly, but allows them nonetheless. I've written some example code demonstrating the problem:  Map<Decimal, String> m = new Map<Decimal, String>(); m.put(1234, 'Integer key');  m.put(1234.0, 'Decimal key'); m.put(1234.5, 'Decimal Unique key');  System.debug(m.get(1234));      // => Integer key, why was this not overwritten if 1234 == 1234.0? System.debug(m.get(1234.0));    // => Decimal key System.debug(m.get(1234.5));    // => Decimal Unique key  System.debug(m);        //Order of insertion matters, newest value does not override existing one but is not shown on map printout... for(Decimal d : m.keySet()){     System.debug(d);    //...unless you print it out yourself, because this loop shows all the keys }  //Sanity check System.debug(1234 == 1234.0); //True  //Digging deeper Decimal fake_d = 1234; Decimal real_d = 1234.0; Integer real_i = 1234; //Integer fake_i = 1234.0; //Illegal assignment, typechecking only works one way, it seems  //More sanity checks System.debug(fake_d == real_d); //True (Except when used in a Map, apparently) System.debug(fake_d == real_i); //True  System.debug(m.get(real_i)); // => Integer key System.debug(m.get(fake_d)); // => Integer key, even with fake_d explicitely declared as a Decimal type, it still pretends to be an Integer. System.debug(m.get(real_d)); // => Decimal key   I found this behaviour when I tried to fetch a value from a map using a Decimal sObject field, only to find that the keys I used to populate the Map (coming from a different Decimal field) were interpreted as Integers since they had no real decimal digits.  Maybe using Decimals as Map keys is not supported for some reason? Is it expected behaviour for 1234 and 1234.0 being distinct values in this case or is this an oversight in the Map implementation?


I am working with a Non Profit group who are looking for collect information around urban cycling routes.   They would like to know the routes people take to get from point A to point B.   I thought, "well web maps are great for that!"   Are there any out of the box solutions (ie: Google Maps Engine, CartoDB, MapBox, etc.) that would allow for the creation of a web map where people could enter data (draw their cycling route)?   I know that a web map could be made using things like Leaflet, but the group does not have web mapping or web development capabilities.   Ideally, the web map could be embedded into an online survey, and at the end of the survey, the group could access the drawn routes and download them for analysis in a GIS.   Any thoughts?

I am looking at collecting spatial information from a range of stakeholders to identify opportunities within a landscape.  However, the data that we are collecting are not presently mapped and so we wish to use an interactive method to get this information onto a map.  Which online websites/methods would people recommend for circulating to a non-technical audience to try and get them to map what they know?    Where the emphasis is on ease of use by the stakeholder.


I was looking at how the new top bar looks on every Stack Exchange and I wondered.  Why do the Linux enthusiasts have a different top bar unique of all Stack Exchange websites ?


I have a problem on my code on java, I want to pass the array pin on my thread class and give it's elements at my second array pinakas, which pinakas is private array of the class kk. I want my threads to use pinakas.I have to write pinakas length at first, but i don't know how big it is, because it is as big as pin (user gives pin's length). What should i do??   Hi, this is my code:   `import java.util.Random;   import java.util.Scanner;     class kk extends Thread{     int[] pinakas;     int opt,T1,T2,T3;     int T4[] = new int[3];     Random ar = new Random();`      public kk(int[] pin,int option) {         for(int i=0; i<pin.length;i++) pinakas[i] = pin[i];         opt = option;     }      public void run () {         try {         if (opt==1) {             T1=0;             for(int i=0;i<pinakas.length;i++) T1 += pinakas[i];             System.out.println("thread 1 runned");         }         else if(opt==2) {             T2=0;             for(int i=0;i<pinakas.length;i++) T2 *= pinakas[i];             System.out.println("thread2 runned");         }         else if(opt==3){             System.out.println("thread3 runned");             T3 = ar.nextInt(1000 + 1 -(-1000)) -1000;         }         else {             System.out.println("thread4 runned");             int max=T1;             if(max<T2) max=T2;             if(max<T3) max=T3;             T4[0] = max;             int min=T1;             if(min>T2) min= T2;             if(min>T3) min= T3;             T4[2]= min;             if(max==T1 && min==T2) T4[1]=T3;             if(max==T1 && min==T3) T4[1]=T2;             if(max==T2 && min==T1) T4[1]=T3;             if(max==T2 && min==T3) T4[1]=T1;             if(max==T3 && min==T1) T4[1]=T2;             if(max==T3 && min==T2) T4[1]=T1;         }         }         catch(Exception e) {             System.out.println(e);         }      }    }  public class klasi {      public static void main(String[] args) {         System.out.println("Give me the length of array: ");         Scanner In = new Scanner(System.in);         int p = In.nextInt();         In.close();         int pin[] = new int[p];         Random ar = new Random();         for(int i=0;i<p;i++) pin[i] = ar.nextInt(1000 + 1 - (-1000)) -1000;         Thread t1 = new Thread(new kk(pin,1));          Thread t2 = new Thread(new kk(pin,2));         Thread t3 = new Thread(new kk(pin,3));         Thread t4 = new Thread(new kk(pin,4));          t1.start();         t2.start();         t3.start();         t4.start();     }   }  When i am running it i have two errors, both of them are: java.lang.NullPointerException, when threads 1 and 2 are running.   The only possibility to work is:  int[] pinakas = new int[5];   and user must give the number 5 as the length of array pin.

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


I need to copy any selection from a webpage to the clipboard, it can be on a div, text input, password input, span, etc.  I have the following function that does this for me, but the challenge is have the returned value from the function to be set on the clipboard  const getSelectionText = () => {   let text = "";   let activeDomElement = document.activeElement;   let activeDomElementTagName = activeDomElement ? activeDomElement.tagName.toLowerCase() : null;   if (    (activeDomElementTagName === 'textarea') || (activeDomElementTagName ===  'input' &&   /^(?:text|search|password|tel|url)$/i.test(activeDomElement.type)) && (typeof activeDomElement.selectionStart === "number")  ) {         text = activeDomElement.value.slice(activeDomElement.selectionStart,   activeDomElement.selectionEnd);    } else if (window.getSelection) {      text = window.getSelection().toString();   }   return text; }   Any idea, or links to resources would be helpful, thanks

What is the best way to copy text to the clipboard (multi-browser)? I have tried: function copyToClipboard(text) {     if (window.clipboardData) { // Internet Explorer         window.clipboardData.setData("Text", text);     } else {         unsafeWindow.netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");         const clipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);         clipboardHelper.copyString(text);     } }  But in Internet Explorer it gives a syntax error. In Firefox, it says unsafeWindow is not defined. A nice trick without using :


$f:A \to B$ a homeomorphic mapping from $A$ to $B$  $=> f:A \backslash U\to B \backslash f(U)$ is also homeomorphic, $U \subseteq A$.  Why does this implication hold?

Let $f:X \to Y$ be a homeomorphism between topological spaces $X$ and $Y$. Let $A \subseteq X$ and $B = f(A) \subseteq Y$ (given the subspace topology) and let $g: A \to B$ be the restriction of $f$ given by $g(a) = f(a)$ for $a \in A$.  Showing that $g$ is a homeomorphism.   $g$ injective   Let $g(a_1) = g(a_2)$, $a_1, a_2 \in A$.  $\implies f(a_1) = f(a_2)$  $\implies a_1 = a_2$ as $f$ homeomorphic.   g surjective   Let $y \in B$  $\implies y = f(a)$ for some $a \in A$.  $\implies y = g(a)$ for some $a \in A$.   $g$ continuous   Let $U \subseteq B$ be an open set in $B$.  $f(a) = g(a)$ for all $a \in A => f^{-1}(b) = g^{-1}(b)$ for all $b \in B$.  So $g^{-1}(U) = f^{-1}(U)$ which is open in $A$ as $f$ homeomorphic.   $g^{-1}$ continuous   Let $U \subseteq A$ be an open set in $A$.  $g(U) = f(U)$ which is open in $B$ as $f$ homeomorphic.  So $g$ is homeomorphic.  Is my understanding correct, this seems almost too straightforward so I was wondering have I overlooked something?


I am attempting to Use the SUM() function with an update query and I am getting an error of      Msg 130, Level 15, State 1, Procedure PYES, Line 144   Cannot perform an aggregate function on an expression containing an aggregate or a subquery.   I am not sure how to re-write this in order to achieve my desired result.  Can someone please provide assistance?  ;WITH CTE As (Select pkID,serviceman, jv  FROM OPENQUERY(XXX.XX.XXX.XXX,                 'Select                     jb.pkID As pkID                     ,cm.cn As serviceman                     ,jb.jv As jv                     FROM arica jb                     INNER JOIN serviceman cm                     ON jb.spID = cm.spID                     INNER JOIN salesperson sp                     ON jb.uqID = sp.uqID                     INNER JOIN jointca js                     ON jb.css = js.sid                     INNER JOIN jart jp                     ON jp.pkID = jb.pkID                     WHERE jb.css IN (''R'',''H'',''p'',''S'',''O'',''N'')                     GROUP BY jb.pkID, jb.jv,cm.cn') v WHERE jv > 0) UPDATE t SET INP = SUM(ISNULL(INP,0)+ISNULL(SUM(jv),0)) FROM tertiarydata t INNER JOIN CTE cte ON t.pkID = cte.pkID;   EDIT Thanks to the dupe by @SP_BlitsErik - I modified my code to the below - but that returns multiple entries for the field serviceman I want to only return 1 row for each serviceman listed  ;WITH CTE As (Select pkID,serviceman, jv  FROM OPENQUERY(XXX.XX.XXX.XXX,                 'Select                     jb.pkID As pkID                     ,cm.cn As serviceman                     ,jb.jv As jv                     FROM arica jb                     INNER JOIN serviceman cm                     ON jb.spID = cm.spID                     INNER JOIN salesperson sp                     ON jb.uqID = sp.uqID                     INNER JOIN jointca js                     ON jb.css = js.sid                     INNER JOIN jart jp                     ON jp.pkID = jb.pkID                     WHERE jb.css IN (''R'',''H'',''p'',''S'',''O'',''N'')                     GROUP BY jb.pkID, jb.jv,cm.cn') v WHERE jv > 0) , uCTE as (   select pkID,serviceman, sumJV=sum(jv)     from cte     group by serviceman,pkID ) Select * from uCTE

I am attempting to use SUM() in my SET statement for my UPDATE.  When I try this, I get an error of      Msg 157, Level 15, State 1, Line 234   An aggregate may not appear in the set list of an UPDATE statement.   What should I alter in my CTE so that I can run this update?    ;WITH CTE AS  (Select EC, CN, CID, EntryDate         FROM OPENQUERY(192.55.108.214,'select                                count(es.estimatenumber) As EC                               ,cm.an CN                               ,cm.am CID                               ,es.entrydate EntryDate                               from etalac es                                INNER JOIN bacalac cm                               ON es.CID = cm.am                               GROUP BY cm.an, cm.am, es.entrydate')) UPDATE d2016 SET TotalNumber = SUM(EC) FROM CTE cte INNER JOIN datafor16 d2016 ON cte.CID = ed2016.CID WHERE CAST(entrydate As Date) BETWEEN '01/01/2016' AND '01/22/2016';


If I was comparing something to a scene from a movie, I would structure the sentence like this:  ...like a scene from a Start Wars film.  But what if the title of the movie series started with the word "The" like this:  ...like a scene from a The Purge film.  It seems very improper to see "a" and "The" next to each other, despite "The" being part of a title. I suppose in this specific context, I could drop the article and have it say:  ...like a scene from The Purge.  Although, what if I definitively wanted to reference one film from the franchise The Purge, or any other franchise with "The" in the title?

If a proper noun includes the word "the" and we want to refer to it using the definite article, should "the" appear twice in succession? For example:  "Can you pass me The Who CD?" vs. "can you pass me the The Who CD?"  "The US Government passed The Hague Act" vs. "The US Government passed the The Hague Act?". (this example inspired by a comment to ).  To me the first versions seem incorrect, but the second versions sound very awkward.


I'd love to delete the Snap folder in my home. It takes 97 GB of space. No package manager should be allowed this amount of space in the /home mount point!  How can I safely delete Snap and all its content (without breaking dependencies)?  I am really not interested in hiding or moving the Snap folder. I wish to delete it and remove the package that is responsible for it. Really I was happy enough with aptitude.

I'm not particularly fond of apps cluttering my $HOME directory with their own files or directories. It's rarely a problem, because most apps have the courtesy to hide their data by prefixing it with a dot or conforming to the ~/.config standard. But not snap.  Q1: Have I misunderstood this directory?  Is ~/snap really a directory which I'm supposed to enter and access on a daily basis on a par with ~/downloads, ~/pictures, ~/work, etc?  Q2: In any case: Can I move it e.g. ~/.snap?  I can't find anything like /etc/snap, /etc/default/snap, or ~/.config/snap to tweak things. I tried export SNAP_USER_DATA=$HOME/.snap but it didn't work.


import java.util.Scanner;  public class Checkdate {      private static Scanner mon;      public Checkdate(String x) {         if (x == "feb") {             System.out.println("lol");         }         else {             System.out.println("rofl");         }     }      public static void main(String args[]) {         String g;         mon = new Scanner(System.in);         System.out.println("Enter string");         g = mon.next();         final Checkdate che = new Checkdate(g);     }  }   this is just a simple program..even if i enter feb it shows rofl..i cant figure out whats wrong please help...

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals() instead, and it fixed the bug.  Is == bad? When should it and should it not be used? What's the difference?


I needed to create a list of lists in Python, so I typed the following: my_list = [[1] * 4] * 3  The list looked like this: [[1, 1, 1, 1], [1, 1, 1, 1], [1, 1, 1, 1]]    Then I changed one of the innermost values: my_list[0][0] = 5  Now my list looks like this: [[5, 1, 1, 1], [5, 1, 1, 1], [5, 1, 1, 1]]    which is not what I wanted or expected. Can someone please explain what's going on, and how to get around it?


I struck with this tricky math question     A girl went to a shop and bought a Rs.$200$ show piece. She gave a Rs.$1000$ note to shopkeeper. Shopkeeper didn't have any change so he went outside and took loan of Rs.$800$ from other shop and gave it to the girl. After sometime he realized that the Rs.$1000$ note was fake. So how much the shopkeeper loses?   Rs is Indian currency.  I think that the shopkeeper loses   the show piece price $200$  + he borrowed $800$ + fake note of $1000$ = Rs.$2000$  Am I right?

This is a very simple but confusing puzzle.  A customer buys goods worth $200$ rupees from a shop. The shopkeeper selling these goods makes zero profit from this purchase.  The lady gives him a $1000$ rupee note.  The shopkeeper has no change, so he goes next door to another shopkeeper to get change for the $1000$ rupee note. He keeps $200$ for himself and returns $800$ to the customer.  Later, the second shopkeeper from next door comes back with the $1000$ rupee note with a stamp on it saying "counterfeit" and takes his money back.  How much loss does the first shopkeeper face?


I've just got a new PC running Ubuntu 16.04 and have transferred my work from my laptop running Ubuntu 14.04.  I have an executable jar file called timed_hri.jar.  On my laptop I can go to the directory and type ./timed_hri.jar and it runs. However, on my desktop it doesn't, I need this to run as I have a Python script that relies on using the ./ command on the file.  This is the output when I try it on my PC:  ./timed_hri.jar: line 1: $'PK\003\004': command not found ./timed_hri.jar: line 2: $'\bne\355H': command not found ./timed_hri.jar: line 3: syntax error near unexpected token    `$'NX\252\276!\227\230iP\275餰  \364g\354\002aF\325\\\213G\263\225\3021B\305Q\237\336\337\375\301t\367\315 N?\372\275Z\235\031BB\3452/\231\241\266\377Z'' ./timed_hri.jar: line 3:me�H6�8��META-INF/MANIFEST.MFM��!{��R                                                               ȝƨ�!51��֬�^C�˂�/VZ��{(NX��!��iP�餰�g�aF�\�G���1B�Q�����t��N?��Z�BB�2/����Z'

I know that to execute a file, I use the . command, then the file name with a space between them. But I'm trying to execute a .jar file using the . and it does not work. I went into the properties and marked it as executable and made it run with Java.   Is there a way to execute a file with Java in the Bash Terminal?    I am trying to execute the Minecraft.jar file.


I was referred here from music.stackexchange. Would be grateful if anyone can tell me what type/genre of music this is :-) Starting from minute 02:20:                                That majestic choir voice in the background after the video hits 02:20 is what I'm actually looking for. Where can I find similar songs and what are they called or categorized as?

I'm trying to find the name (type) of music that is played in this video starting at minute 02:20. It's very majestic. It's not orchestral music right? Cause I'm looking for songs that are similar and cannot find a keyword on Google to search for it.


Why is k not getting incremented whereas,i and j are getting incremented in the same expression.And i also want to know what is the output of the program.I am getting the output as -2 3 1 0  #include <stdio.h> void main() {  int i=-3, j=2, m, k=0;  m=++i && ++j || ++k;  printf("%d %d %d %d", i, j, m, k); }

Does the ANSI standard mandate the logical operators to be short-circuited, in either C or C++?  I'm confused for I recall the K&R book saying your code shouldn't depend on these operations being short circuited, for they may not. Could someone please point out where in the standard it's said logic ops are always short-circuited? I'm mostly interested on C++, an answer also for C would be great.  I also remember reading (can't remember where) that evaluation order isn't strictly defined, so your code shouldn't depend or assume functions within an expression would be executed in a specific order: by the end of a statement all referenced functions will have been called, but the compiler has freedom in selecting the most efficient order.  Does the standard indicate the evaluation order of this expression?  if( functionA() && functionB() && functionC() ) cout<<"Hello world";


Is it possible to convert address to coordinate using OpenLayers 3?  I can to it a bad way by taking address and search it in the planet_osm_points table and get osm_id and after that search the osm_id in planet_osm_node table. But this is a bad way. I am pretty sure that OpenLyers3 have to do it, but can't find anything on web.

How can I achieve Geocoding with the JavaScript OpenLayers API, in the same fashion as the Google Maps API?


Can you please shift a little? or Could you please shift a little?   which one of the two is correct?

Possible Duplicate:          I am a little bit confused about asking a question:     Can you please tell me my next work?   or     Could you please tell me my next work?   Which is more correct?


I'm making a short walk animation with a robot I modeled myself, but when I try to render out my work it doesn't show up. I have tried the following solutions  1 Camera icon is disabled in the outliner  2  Render layer not showing in the compositor  3   Render layer does not include scene layer or the objects are in a layer that is not renderable.  4 Scene layer not selected  5  Cycles camera visibility disabled in object settings  6  Cycles material disables visibility to the camera  7  Objects are not within the range set by the camera clipping  8  Using the wrong scene  9  Strips present in the VSE, and the sequencer box is enabled in the post process section  10  Cycles: Exposure setting in the film section set to 0  11  Depth of field not set properly making the whole scene blurry  12  Object blocking the camera view  13  An object has been set as the active camera.  14   There are no lights on the scene or they are on a different layer.     Objects have no faces.  15 The Solidify modifier takes over the object and is disabled in Viewport  16  Duplication type set to 'Group' and no group is selected.  17    Duplication issues (under the Object tab in the properties panel), e.g., duplication type is not 'None', and object has no children, or set to 'Group' and no group is selected.  I have checked all of these options, but none of them are the issue

This is meant to solve this problem once and for all. What is every reason an object isn't showing up in a render or viewport in when using the cycles render engine?


So I have been doing a tutorial  and for some reason when I did the camera rigging part, the screen just goes black. This is when I view what the camera sees. Any tips? This is my project file:  (MediaFire) Trying images now: Out of camera:  In camera:


I have a few questions regarding . How does the concept of wavelets make sense? I don't get how waves can create a new wave, and what is the need to create those waves when they are already present there?   Suppose I have a wavefront. My book says each point on it acts as a source of disturbance and create wavelets, and the common tangent enveloping them is a new wavefront. Now my doubt is: suppose a new wavelet is just created; then this wavelet should immediately create a new wavelet and now this should act again as a source and so on. But in my books and other resources I find only one wavelet from each point on the wavefront expanding till a new wavefront is formed. Why is it so?

Huygens principle states that every point on the wave front acts as a source. If it is true, then why can't a single source (let's say a bulb) illuminate a whole big room? Why is it dark after some distance from the bulb? According to him it should continue to infinite.  Where am I wrong?


It's the number theory problem from Thailand Mathematical Olympiad. That require one to prove that $n!+1$ is composite for infinitely many odd $n$. It's true if $n$ is even from Wilson's theorem directly that $p \text { } \Big|\Big((p-1)!+1\Big)$ but for odd $n$ I have no idea about it. I've tried for prime $p$ of the form $4k+3$ and we'll have that $\left(\dfrac{p-1}{2}\right)!\equiv\pm 1\pmod p$ and maybe there is infinitely many cases that $\left(\dfrac{p-1}{2}\right)!\equiv -1\pmod p$, but I don't know how to prove it and I don't think this is a good way to tackle this problem. I, actually, saw someone's proof before but I didn't pay attention at much and didn't jot down the idea. All in my memory is that he used Bertrand postulate and something in the double factorial like $(n!+1)!+1$. Any help would be really appreciate and thank you in advance.

There is another post pertaining to this question; however, the other post does not address some specifics that concern me in the proof. Proof: Let $n=p-1, p \geq 7$. Then $p|(p-1)!+1$. We will show that $(p-1)!+1=p^n$ has no solutions. Suppose not. Suppose $(p-1)! + 1 = p^n$ has a solution for $p\geq 7$. Then $(p-1)! =p^n-1  = (p-1)(p^{n-1}+\cdots+p+1)$. So $(p-2)!\equiv n (\mod p-1)$. Now suppose that $(p-1)|n$. Then $p-1\leq n$. So $(p-1)!+1<p^{p-1}\leq p^n$. Hence, there are no solutions. It remains to show that $(p-1)|(p-2)!$. But $p-1=2m$ means $2m|(p-2)!$. QED  Questions:  My understanding is that at the start of the proof, Wilson's theorem is used to show that at least one prime divides $n!+1$.  Why do we want to show that $(p-1)!+1=p^n$ has no solutions? The way I see it is that $p^n$ is composite, and we are basically saying that $p^n\nmid (p-1)!+1$, so no composite number divides $n! +1$. But how and where in the proof do we actually show that another prime $q \neq p$ divides $n!+1$?    Thanks in advance.


My problem is whenever I boot the PC Ubuntu is loaded with full brightness... So every time I have to reduce brightness on booting and then start my work... So is there a way to set custom brightness to default so that I don't have to reduce brightness every time... Thanks for help...

On Ubuntu 12.04 LTS on a Dell Vostro 2420 laptop, each time I start Ubuntu, the screen brightness is set to the maximum level, which gives a high glare. (I have recently installed Ubuntu on the laptop, but did not change any default settings related to brightness, IIRC.) I am currently lowering the brightness manually each time after starting, using the System Settings icon on the left of the screen. Looking for a permanent way to set it to a lower value.


Don't know what happened but this happens almost every time I boot. Never happened before a couple days ago and I haven't even done anything.  Computer powers up, GRUB (From fresh Ubuntu 11.04 install) loads, Windows 7 starts booting.  I configured msconfig to show the file it's currently loading when booting (The similar list you see when you boot into Safe Mode) and when it gets to C:\Windows\System32\DRIVERS\CLASSPNP.SYS, it takes a couple more seconds to load than other files if it doesn't hang.  Before the hang, my wireless LAN card is detected and then sound is activated (I can tell 'cause these lights on my laptop change to red when it's mute/disabled and blue when it's not). The hard drive makes the sound it makes when it's loading except the sound's constant (The HDD light's on. Not flashing like it usually does) meani. I can disable the touchpad but the keyboard doesn't work because the numlock light doesn't come on when I press numlock.  OS:     Windows 7 Professional x64 SP1 Laptop: HDX16-1155CA CPU:    Core 2 Duo P7450 2.13 GHz RAM:    4 GB DDR2 HDD:    320 GB Fujitsu something   Also, I've tried sfc /SCANNOW and it said that my system is fine  Never happened before, all I have is the mouse installed  Update: Now it restarts sometimes while loading CLASSPNP.SYS

I'm running Win 7 x86 on a Lenovo Thinkpad Z61m in dual boot mode with Win XP, both OSes are running on separate partitions. I have a faulty battery and if left unplugged my laptop shuts usually down within 10 minutes. Last night, it shut down due to this, but after plugging in AC power and starting back up I'm stuck at the "Starting Windows" screen, I'm unable to boot into safe mode or into recovery mode(XP boots fine).  I believe I had installed some Win 7 updates the same/previous day. From one of the boot options I was able to see that Windows 7 is getting stuck on CLASSPNP.SYS  How can I go about fixing this?  I do have a complete Win 7 Restore CD that I created after setting up my machine, I'm unable to boot into this either.  Please help!


I am looking for a command to display three .png files using xxd, displaying the first two and last two lines of the hexadecimal for each.  I have used the command below to display one file at a time but I am wondering if there is a command that can display all three files together. This is my command so far:  de@Classbox:/mnt/mountpoint/pics$ xxd albert-grumpy-cat.png |head -n2 && tail -n2

I have text file. Task - get first and last line from file after   $ cat file | grep -E "1|2|3|4" | commandtoprint  $ cat file 1 2 3 4 5   Need this without cat output (only 1 and 5).  ~$ cat file | tee >(head -n 1) >(wc -l) 1 2 3 4 5 5 1   Maybe awk and more shorter solution exist...


I need to solve the following function using recurrence,  $$T(n)=9T(n^{1/6})+\log^2(n)$$  I know for a fact that this is done by making a change of variable but can someone tell me how to go about this? Like questions like this in general.

I would like to solve the relation:   $T(n^6) = 9T(n^{\frac{1}{6}}) + \log^2_2(n)$   Now upon searching, I found that such relations can be solved using iteration method and making a substitution, hence I tried substituting $m = \log_2 n$. This gives the relation:  $T(64^m) = 9T(2^{\frac{m}{6}})+m^2$. Am I solving this correctly?? How do I proceed further? Please help, I am not good at this.


I tried to change a SharedPreference that is set up in my MainActivity in my Adapter. So I thought with an instance of the MainActivity I could access and change it from there. When an item is clicked a dialog pops up and then when it is confirmed, the variable shall be stored in the SharedPreference. Unfortunately I get an error in the part where this variable should be edited:     android.content.SharedPreferences$Editor   android.content.SharedPreferences.edit()' on a null object reference   The MainActivity:  public class MainActivity extends AppCompatActivity {      SharedPreferences favE;     int x;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);          favE = MainActivity.this.getSharedPreferences("myFavEName",                 Context.MODE_PRIVATE);         x = favE.getInt("favKey", 0);      }      public int getFavE(){         return x;     } }   My Adapter:  public class RecyclerViewAdapter extends RecyclerView.Adapter<RecyclerViewAdapter.ViewHolder> {      Context context;      List<GetDataAdapter> getDataAdapter;      MainActivity ma = new MainActivity();      @Override     public void onBindViewHolder(ViewHolder holder, final int position) {          GetDataAdapter getDataAdapter1 =  getDataAdapter.get(position);          final int a = getDataAdapter1.getId();          int x = ma.getFavE();          holder.cardView.setOnClickListener(new View.OnClickListener() {             @Override             public void onClick(View v) {                  addDialog(a);                });     }       public void addDialog(final int a) {         Context context = this.context;         LayoutInflater inflater = LayoutInflater.from(this.context);          AlertDialog.Builder builder = new AlertDialog.Builder(context);          builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int id) {              }         });          builder.setPositiveButton("Exit Group", new DialogInterface.OnClickListener() {             public void onClick(DialogInterface dialog, int id) {                           ma.favE.edit().putInt("favKey", 0)                         .apply();             }         });         builder.show();     } }

What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?


While reviewing a question, I could not decide between two options for closure reasons:         Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results.   unclear what you're asking      It was a short question looking for a direct answer and decided on the second one and voted.   But after a few minutes of thinking, I decided first option is suited better. Since closure reason is the key for the question owner to see how he can fix his question, I decided to change closure reason. Since I could not change the closure reason, I tried to retract my closure vote and then re-vote. But after retracting my vote, system do not let me to vote again.  Is there a reason for not enabling re-vote after retraction? Also will not it be better if revoting/changing closure reason is enabled?

Voted to close a question based on "lack of minimal understanding".  Later realized the question was a duplicate.  How to I change vote to mark as duplicate instead?


As in the title. Does the expression a couple of always have to mean exactly two (like a pair of) or can it mean more (things/objects)? I know a couple, at least in one of its meanings, means a pair (like the happy couple) but as an amount specifier does it also always mean exactly two?

What does “a couple” mean to you, and what does “a few” mean to you?  Is there a proper way to use these words?  It was striking to hear that “a couple” meant two (2) to someone.  My reaction was, “how/why do you make a short word longer by adding an extra syllable to just say ‘two?’”  I think Few: 2-3, Couple 4-6, Several 7+.  What are your thoughts?


I purchased some merchandise for a friend who lives in Canada. She wants to pay me for these items. What is the best way for her to do this?

I want to transfer money to an American bank account, but I am in Canada.  What is the cheapest way to do so?   has:    - $700 limit, $4 charge Vanilla wire transfer (My bank requires it be done in person and charges $30 per transaction, limit $3000) Cheque: ($40 fee?)   Any gotcha's (i.e. HIDDEN FEES) and / recommended methods?