Currently posts in category page arranged by last added, this is the code, please how to make it random   if (is_category()) {         $categories = array(get_query_var('cat'));         $subcats = get_categories(array('child_of' => get_query_var('cat')));         if ($subcats) {             foreach ($subcats as $subcat) {                 array_push($categories, $subcat->cat_ID);             }         }          if (of_get_option('show_repins') != 'disable') {                         $args = array(                 'category__in' => $categories,                 'paged' => $paged             );         } else {             $args = array(                 'category__in' => $categories,                 'paged' => $paged,                 'meta_query' => array(                     'relation' => 'OR',                     array(                         'key' => '_Original Post ID',                         'compare' => 'NOT EXISTS'                     ),                     array(                         'key' => '_Original Post ID',                         'value' => 'deleted'                     )                 )             );           }         query_posts($args);      }


Removing intercept from GLM for multiple factorial predictors only works for first factor in model

I am running a binomial logistic regression with a logit link function in R. My response is factorial [0/1] and I have two multilevel factorial predictors - let's call them $a$ and $b$ where $a$ has 4 factor levels  $(a_1,a_2,a_3,a_4)$ and $b$ has 9 factor levels $(b_1,b_2,\dotsc,b_9)$. Therefore:  mod <- glm(y ~ a + b, family = binomial(logit), data=pretend) summary(mod)   The model output would then show all the information about the model as well as the coefficients.  There is a factor level for both a and b missing (a1 and b1) from the summary output. I understand that it is constrained in the "intercept" of the model. I have read that if I want to remove the intercept term and see the estimates for those factor levels I can just add -1 to the model formula, i.e.:  mod2 <- glm(y ~ a + b - 1, family=binomial(logit), data=pretend) summary(mod2)   In the new model (mod2) the intercept term is then gone and variable a's factor-level a1 is given amongst the list of coefficients. But, variable b's factor-level b1 is still missing and given that there is no intercept term anymore, how can I interpret the odds-ratio for that factor level then?  Could someone please explain to me how to get the coefficient for b1 too and why this is happening?


Are continuous functions monotonic for very small ranges?

So I am wondering, if we have a continuous function $f : A \to B$, does a range $[x, x + h]$ exist for each $x\in A$ , $h = h(x)>0$ so that $f$ is monotonic in that range?


I think this is just something I've grown used to but can't remember any proof.  When differentiating and integrating with trigonometric functions, we require angles to be taken in radians. Why does it work then and only then?


Seeking Singapore postal districts boundaries?

Does anyone know where to get GIS data for Singapore postal boundaries?  I need a shape or KML file which I can then overlay onto google maps to show a neighbourhood break down of Singapore.


Keccak padding implementation, and bit ordering

I am trying to implement Keccak in Java for my school work. And I am getting stuck in two places:   On the  the padding is shown as      P = M || 0x01 || 0x00 || … || 0x00   P = P xor (0x00 || … || 0x00 || 0x80)   However on the  section 1.1.2 they mention the variable rate padding as 10*1.   The way I read it, to prepare message for absorption phase, you cut your message into pieces of size r (bit rate). To get message length multiple of r you would append or concatenate the message with just, (for simplicity I am considering just bytes) in case just 1 byte padding required it will be 0x81. And if more than one byte required then it would be 0x80...0x01. So my padding implementation would be something like      P = M || 0x80...01    Where am I reading the specification in wrong way?  How is the placement of the bits in the state? I mean if I have a message of say 2 bits, then my bit goes to state position S[0][0][0], but then where should I place the next bit in the same row that is S[0][1][0] or in the same lane that is S[0][0][1]. I would have assumed to go with placing the bit in next cell in the row, and then when you are finished with bits from one slice, then you again start with [0][0] position in next slice. But the way most of the functions are defined with respect to slices, makes me think, it could be other way around. I am unable to find in specification, where they clearly mention this.   Please just point me to places in specification which can resolve my confusion. Thanks.


How do I set a user environment variable? (permanently, not session)

This is irritating me. I seen several suggestions (all using different files and syntax) and none of them worked.  How do I set an environment variable for a specific user? I am on debian squeeze. What is the exact syntax I should put in the file to make ABC = "123"?


I want to fill   \documentclass[12pt]{standalone} \usepackage{pgf,tikz} \usetikzlibrary{arrows} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm] \clip(-2.3,-2.3) rectangle (2.3,2.3); \draw [rotate around={0.:(0.,0.)},color=black,fill=gray,fill opacity=0.5] (0.,0.) ellipse (1.5 cm and 2.cm); \draw [rotate around={0.:(0.,0.)},color=black,fill=white] (0.,0.) ellipse (1.cm and 1.3cm); \end{tikzpicture}\end{document}      How can I fill complement of two sets A and B knowing that A is subset of B with venndiagram?


When my file format is FFmpeg video and encoding is MPEG 4 The default windows video player shows me an error message Here's the error message:- This file isn’t playable. That might be because the file type is unsupported, the file extension is incorrect, or the file is corrupt.  I am attaching the screenshot of my render settings in Blender and the error .


Has user testing found that the "three horizontal bars" for main menu on mobile is commonly understood?

"Three horizontal lines" aka "hamburger icon" seems to be becoming a convention for the "main menu" button, especially on mobile sites:    Has anyone done any user testing of this convention, or got any A/B testing results? (i.e. is there an increase in bounce rate compared to using the word "Menu"?)  I did some quick user testing with wireframes featuring this icon for the main menu. 3 out of 6 people got it and used it. The others did not.  One person in particular had a lot of trouble "getting back to the top" (i.e. restarting their navigation from the top level of the site) as they didn't know about the convention, or that the logo would link to the home page.  I guess it will be different for different demographics - users of Facebook on mobile probably know it.  Anyone got any findings they can share?


Differenciability of $F(x) = \int_{0}^{v(x)} f(t)dt$

Let $f, \ u, \ v: \mathbb{R} \to \mathbb{R}$ with $f$ continuous, $u$ and $v$ differentiable.  (1) Let $F(x) = \int_{0}^{v(x)} f(t)dt$, prove that $F$ is differentiable and calculate $F'(x)$.  (2) Now let $F(x) = \int_{u(x)}^{v(x)} f(t)dt$ and prove again that $F$ is differentiable and calculate $F'(x)$.  I tried to prove it using the fundamental theorem of calculus. In this way, i got:  As f is continuous, so F is derivable and its derivative is $F'(x) = f(v(x))$. This way i didn't use that u is differentiable (a bit weird i guess). Am i right? I either tried to use this method in second item, but again it falls into the same problem.


Neither Nancy nor Loma remembered to bring _______ camera ]  Her Their Them Neither  In this questions option C "their" was given correct answer but I need an explanation to it as I read the rule that the pair "Neither + nor" agrees with the nearest subject.


Many users, one address each: Users address? Users addresses? User addresses?

In the context of writing a technical document, I need to refer to a data structure that contains a list of addresses, in fact one address for each user in the system. Should I call this data structure  "users address" (this stresses the fact that each user has a single address, but it is probably wrong according to the rule that ),  "users addresses" (feels wrong: it seems that each user may have more than one address), or  "user addresses" (feels wrong as well: this suggest that these addresses are all related to a single user, who happens to have multiple addresses)?   Edit: Please note that this list cannot be named "user address" because that is the name of used by variables that momentarily hold one of the pieces of data contained in the list. For those who speak pseudo code: for user_address in users_addresses {     do_something_with(user_address) }


My password which are documented is saying invalid

My Gmail account keeps not taking my email password that I had written down they are having to be reset about everyday down email the next day it says invalid password. What is going on? It's happening to most of my accounts. I don't have time for this and besides this is so so a mess.  Please let me know what to do?


Proving divisibility by 7 using modular arithmetic

Prove that $2222^{5555} + 5555^{2222}=0 \pmod{7}$.   I'm not getting how to start away with this problem. I know that modular arithmetic should be used. Please give me some hints on how to solve this question. I don't expect complete answers as I would like to try it out myself.


Relative pronoun "that" with "the only" in the antecedent

I heard "That" should be used after superlative adjectives and other determiners like all, same, any, none, nothing, only, everything little, much and no.  But in this sentence     Those who wish to raise the dignity of human life should try to give   civilization that star, to equip the world with the only vision which   can save it from ill will and the crazy competitions which lead   thereto.   In this sentence, I think we should use the relative pronoun 'that' instead of 'which'.  Is 'the sentence above' grammatically incorrect?


I'm still a bit new to blender and I've just finished my very first Spaceship model. Once I finished my model, I started SELECTING CERTAIN FACES and assigning them to a CERTAIN MATERIALS that I created in blender. Now since I like the final look of my Materials added to certain faces of the model, how do I save them? I want to be able to save them as a texture (if possible), so when I send this model to someone or sell it, it'll have the diffuse, and AO textures with it. Also when I save these materials to be a texture, will they go to those assigned faces that I selected before?   Thanks


Do I need to sand my new pressure-treated deck before staining it?

I just got a deck built and pre treated wood was used. Do I need to sand it before I stain it? I live in San Antonio, Texas


How to save screenshots as JPG automatically?

I want to make all screenshots I take jpeg automatically -- not png. I am using Ubuntu 12.04.


How to set up Ubuntu PC as bluetooth headset to attend calls

I am trying to use a Bluetooth headset on an Ubuntu PC. I am able to connect phone to pc via BT. I can stream music to PC. But cannot hear call audio. I have checked in Android phone logs, and BT sco link is established. But when making a call or virtual call (play audio through sco path in Android phone) the audio is not audible in PC headset. SCO packets are NOT appearing in btmon logs either. Anyone successfully done this?  version- ubuntu 16.04 Installed- bluez, ofono, pulseaudio pactl sink: Name- bluez_sink.22_22_8E_DE_B9_2B,             Name: alsa_output.pci-0000_00_1b.0.iec958-stereo pactl source: Name-bluez_sink.22_22_8E_DE_B9_2B.monitor               Name: alsa_input.pci-0000_00_1b.0.analog-stereo


How can the ball reach the wall when it always has to travel halfway?

If I throw a ball at the wall, when it has travelled halfway, it still has half the distance to travel. As it continues, the fraction left to travel continues i.e. one quarter to go, one eighth to go, one sixteenth to go, etc. since the denominator of the distance continues to double... I am thinking mathematicaly speaking, the ball never reaches the wall.


WHY our time would run slow if we move with the speed close or  equal to the speed of light, and is that time dilation restricted to only just '' time' ' or it affects our biological time also (does it stops or  slows down our ageing process) ??


Extra space showing up after the "follow" button on answers

There seems to be an extra space showing up after the "follow" button - in between "follow" and "flag" (or "delete") on answers. This is happening both on sites where I have delete vote privileges and sites where I do not.  For instance, from Interpersonal.SE (where I can vote to delete answers):    ...and with a delete vote, where it is still showing up:    And also on Puzzling.SE, where I cannot vote to delete answers:    This doesn't appear to be happening on questions, only answers.


Where to get stock samsung galaxy images?

in particular I am looking at Samsung Galaxy S3 factory image. Samsung download site was useless.


how to proof formula for general addition rule of three events

can somebody please help to prove the formula for general additional rule of three events?  $$P(A \cup B \cup C)=P(A)+P(B)+P(C)-P(A\cap B)-P(A\cap C)-P(B\cap C)+P(A\cap B\cap C)$$


How Do I Change the Application Mapped to Open in Terminal?

I have appended Open in Terminal to my right-click context menu which by default, opens up a terminal window at the selected location. I would like to replace the default terminal window with Terminator.   This is linux, I know it's achievable so I'd rather ask, How is this achieved?


Minimum value of $\frac{x^2+y^2}{x+y}+\frac{y^2+z^2}{y+z}+\frac{z^2+x^2}{z+x}$

If $x,y,z>0$ and $x+y+z=60$. Then minimum value of $\displaystyle \frac{x^2+y^2}{x+y}+\frac{y^2+z^2}{y+z}+\frac{z^2+x^2}{z+x}$   Try: $$\frac{(x+y)^2-2xy}{x+y}+\frac{(y+z)^2-2yz}{y+z}+\frac{(z+x)^2-2zx}{z+x}$$  So $$2(x+y+z)-2\bigg[\frac{xy}{x+y}+\frac{yz}{y+z}+\frac{zx}{z+x}\bigg]$$  Now Using arithmetic geometric inequality  $x+y\geq 2\sqrt{xy}$ and $y+z\geq 2\sqrt{yz}$ and $z+x\geq 2\sqrt{zx}$  Could some help me how to solve further, Thanks


Why is my model see through when I render?

When I render my 3D motion Tracked Scene It is See Through and I can see an outline. Please tell me why this is happening. It would be greatly apprieciated.


Wiring assistance for dryer from 4 prong to 3 prong

Just moved into a new apartment so I had to change my dryer plug.  However, after countless tutorials and videos I am a little confused with the current set-up. Is it right that the green(ground) and the white (neutral) are directly on top of one another? I see the ground screw to the left but nothing is on there...  So my question is when I install my 3 prong how will I ground it? Do I need to buy a ground wire and somehow attach it to the ground screw?  Tried to attach a picture but wouldn't let me because I did not have 10 rep.


Need help in figuring out what is wrong with basic multithreaded code in Java (multiple producers - one consumer)

I get tons of meaningless (for me) exception when run this code. Not sure where I could make a mistake... Basically I want my producer to puts alpha chars in the buffer and consumers to  get them from a buffer and print. I just started to learn multithreading and I have no idea what could be the potential problem in this code. I tried to implement in-class example. I really apologize if it is a dumb question...  public class Driver {     public static void main(String[] args) {         new Consumer("Consumer1");         new Consumer("Consumer2");         new Consumer("Consumer3");         new Producer("Producer1");     }    } public class Producer implements Runnable{      private Buffer buf = null;      public Producer(String name){         buf = Buffer.getInstance();         new Thread(this, name).start();     }      public void run(){         char character = 'A';          for(; character < 'Z'; character ++){             buf.put(character);             System.out.println("Producer " + Thread.currentThread().getName() + " puts " + character);         }          Consumer.done = true;     } } public class Buffer {      private static Buffer instance = null;     private boolean full = false;     private boolean empty = true;      private char[] arr;     private int i;      private Buffer(){         arr = new char[26];         i = 0;     }      public static synchronized Buffer getInstance(){         if(instance != null){             instance = new Buffer();         }         return instance;     }      public synchronized void put(char c){         while(full){             try{                 wait();             }catch(Exception e){}         }          arr[i++] = c;         empty = false;         if(i == 25){             full = true;             notifyAll();         }else{             full = false;         }     }      public synchronized char get(){         while(empty){             try{                 wait();             }catch(Exception e){}         }          if(--i == 0){             empty = true;         }else{             notifyAll();         }         full = false;         return arr[i];     }  }  public class Consumer implements Runnable{      private Buffer buf = null;     public static boolean done = false;      public Consumer(String name){         buf = Buffer.getInstance();         new Thread(this, name).start();     }      public void run(){               while(!done){             System.out.println("Producer " + Thread.currentThread().getName() + " gets " + buf.get());         }     } }    Exception in thread "Consumer2" Exception in thread "Consumer3" Exception in thread "Consumer1" Exception in thread "Producer1" java.lang.NullPointerException     at Producer_consumer.Consumer.run(Consumer.java:15)     at java.lang.Thread.run(Thread.java:745) java.lang.NullPointerException     at Producer_consumer.Consumer.run(Consumer.java:15)     at java.lang.Thread.run(Thread.java:745) java.lang.NullPointerException     at Producer_consumer.Producer.run(Producer.java:16)     at java.lang.Thread.run(Thread.java:745) java.lang.NullPointerException     at Producer_consumer.Consumer.run(Consumer.java:15)     at java.lang.Thread.run(Thread.java:745)


Bijection between an open and a closed interval

Recently, I answered to this problem:     Given $a<b\in \mathbb{R}$, find explicitly a bijection $f(x)$ from   $]a,b[$ to $[a,b]$.   using an "iterative construction" (see below the rule).  My question is: is it possible to solve the problem finding a less exotic function?  I mean: I know such a bijection cannot be monotone, nor globally continuous; but my $f(x)$ has a lot of jumps... Hence, can one do without so many discontinuities?    W.l.o.g. assume $a=-1$ and $b=1$ (the general case can be handled by translation and rescaling). Let:  (1) $X_0:=]-1,-\frac{1}{2}] \cup [\frac{1}{2} ,1[$, and  (2) $f_0(x):=\begin{cases}     -x-\frac{3}{2} &\text{, if } -1<x\leq -\frac{1}{2} \\ -x+\frac{3}{2} &\text{,     if } \frac{1}{2}\leq     x<1\\ 0 &\text{, otherwise} \end{cases}$,  so that the graph of $f_0(x)$ is made of two segments (parallel to the line $y=x$) and one segment laying on the $x$ axis; then define by induction:  (3) $X_{n+1}:=\frac{1}{2} X_n$, and  (4) $f_{n+1}(x):= \frac{1}{2} f_n(2 x)$  for $n\in \mathbb{N}$ (hence $X_n=\frac{1}{2^n} X_0$ and $f_n=\frac{1}{2^n} f_0(2^n x)$).  Then the function $f:]-1,1[\to \mathbb{R}$:  (5) $f(x):=\sum_{n=0}^{+\infty} f_n(x)$  is a bijection from $]-1,1[$ to $[-1,1]$.  Proof: i. First of all, note that $\{ X_n\}_{n\in \mathbb{N}}$ is a pairwise disjoint covering of $]-1,1[\setminus \{ 0\}$. Moreover the range of each $f_n(x)$ is $f_n(]-1,1[)=[-\frac{1}{2^n}, -\frac{1}{2^{n+1}}[\cup \{ 0\} \cup ]\frac{1}{2^{n+1}}, \frac{1}{2^n}]$.  ii. Let $x\in ]-1,1[$. If $x=0$, then $f(x)=0$ by (5). If $x\neq 0$, then there exists only one $\nu\in \mathbb{N}$ s.t. $x\in X_\nu$, hence $f(x)=f_\nu (x)$. Therefore $f(x)$ is well defined.  iii. By i and ii, $f(x)\lesseqgtr 0$ for $x\lesseqgtr 0$ and the range of $f(x)$ is:  $f(]-1,1[)=\bigcup_{n\in \mathbb{N}} f(]-1,1[) =[-1,1]$,  therefore $f(x)$ is surjective.  iv. On the other hand, if $x\neq y \in ]-1,1[$, then: if there exists $\nu \in \mathbb{N}$ s.t. $x,y\in X_\nu$, then $f(x)=f_\nu (x)\neq f_\nu (y)=f(y)$ (for $f_\nu (x)$ restrited to $X_\nu$ is injective); if $x\in X_\nu$ and $y\in X_\mu$, then $f(x)=f_\nu (x)\neq f_\mu(y)=f(y)$ (for the restriction of $f_\nu (x)$ to $X_\nu$ and of $f_\mu(x)$ to $X_\mu$ have disjoint ranges); finally if $x=0\neq y$, then $f(x)=0\neq f(y)$ (because of ii). Therefore $f(x)$ is injective, hence a bijection between $]-1,1[$ and $[-1,1]$. $\square$


I always use the internal oscillator that pics have as I have never found the need to run anything at higher frequency than 8 MHz (which is the fastest the pics I use tend to be able to go). Are there any reasons, beyond going above 8 MHz, that mean I should use an external oscillator? It just seems like one more thing to go wrong to me but I'd be interested to hear what others do.


Looking at R2-D2, I can't think of any robots I've seen in science fiction that vaguely resemble R2D2's design.  What was the inspiration for the design of R2-D2?


pgfplots input axis settings from an external file

I want to plot multiple figures with the same settings, but different content. I would then like to be able to change the settings in all plots at the same time. To achieve this, I'd like to store the settings in their own file, so when it changes, the plots will all change! Say I wan't to plot $\sin(x)$ and $\cos(x)$ (here only $\sin(x)$ is shown) I could then store my xlabel in the file with the settings, and the ylabel in the file making the figure.  It would then looks like the following:  settings.tex:  xlabel={$x$},    main.tex for the $\sin(x)$ plot, change every "sin" to "cos" and it would be the cos file:  \documentclass[border=5pt,tikz]{standalone} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{tikz} \usepackage{pgfplots} \begin{document} \begin{tikzpicture}     \begin{axis}[             \input{settings.tex}             ylabel={$y=\sin(x)$}         ]         \addplot gnuplot[id=sin]{sin(x)};      \end{axis} \end{tikzpicture} \end{document}   This however stuns LaTeX, and will not compile. If I move the xlabel to the main file, I get what I want:    The above is very much an MWE. I would offcourse like to use tens of settings across a multitude of figures, making it very tiresome to update the settings in every plot.


Choosing coordinate system to use in South Africa?

What are the principal datums and projections used in South Africa including the names of geodetic datums and their projections?


Is time affected by the gravitational force?  If so, what might be the effect on time at the centre or near centre of earth ?


Integration by parts yields divergent integral

$$I = \int_0^1\dfrac{t \ln t}{\sqrt{1-t^2}}\mathrm{dt}$$   Attempt:   Let $t = \sin x$  $\implies dt = \cos x dx$  $\implies I = \displaystyle \int_0^{\pi/2} \dfrac{\sin x \ln (\sin x) \cos x dx}{\cos x}$  $\implies  I = -\ln (\sin x) \cos x|_{0}^{\pi/2}   + \displaystyle\int_0^{\pi/2}\dfrac{\cos^2 x}{\sin x} dx$  The second integral can be "evaluated"  using $\cos^2 x = 1- \sin^2 x$. But unfortunately, there are finally two divergent integrals.   $\implies  I = -\ln (\sin x) \cos x|_{0}^{\pi/2}   + \displaystyle\int_0^{\pi/2}\csc  x dx$ + $\displaystyle\int_0^{\pi/2}\sin x dx$  How do I handle this?


$X_n\leq Y_n$ implies $\liminf X_n \leq \liminf Y_n$ and $\limsup X_n \leq \limsup Y_n$

Can anyone prove this question? I tried but I didn't get any I idea, so I hope someone can solve it.     Let $X_n\leq Y_n$ for each $n\in \Bbb N$. Show that $\liminf X_n \leq \liminf Y_n$ and $\limsup X_n \leq \limsup Y_n$.   Please prove this question - thanks.  The definition I have:     Let $X_n$ be a sequence in real number and let $$E=\{x\in \Bbb R^\sharp:(X_{n_k}) \rightarrow x \text{ for some subsequence }(X_{n_k})\text{ of }(X_n)\}$$ for all $n \in \Bbb N$ and $k$ from $1$ to $\infty$. Then by definition $\lim\sup X_n = \sup E$ and $\lim\inf X_n = \inf E$.


Unix command that immediately returns a particular return code?

Is there a standard Unix command that does something similar to my example below  $ <cmd here> 56 $ echo Return code was $? Return code was 56 $   <cmd here> should be something that can be fork-execed and leaves 56 as the exit code when the process exits. The exit and return shell builtins are unsuitable for what I'm looking for because they affect the invoking shell itself by exiting out of it. <some cmd> should be something that I can execute in non-shell contexts - e.g., invoking from a Python script with subprocess.  E.g., /usr/bin/false always exits immediately with return code 1, but I'd like to control exactly what that return code is. I could achieve the same results by writing my own wrapper script  $ cat my-wrapper-script.sh # i.e., <some cmd> = ./my-wrapper-script.sh #!/usr/bin/bash exit $1 $ ./my-wrapper-script.sh 56 $ echo $? 56   but I'm hoping there happens to exist a standard Unix command that can do this for me.


How do you make NTFS file system with the cluster size of 512? Using only the command line?


I'm trying to figure out how to determine somebody's age in the form of years/months/days. For example, if I was born on 8/1/2014 and today is 9/15/2015 I would be  1 year, 1 month and 15 days old.   I know you can use DateDiff() to determine the difference in Days; but, I'm not sure how to convert that number into years/months/days. Any help is much appreciated.  Thanks everyone!


If $X$ has a $U[-1, 3]$ distribution and $Y = X^2$, find the probability density function of $Y$ .

The continuous random variable $X$ has a $\text{Uniform}[-1, 3]$ distribution and let $Y = X^2$ .  Find the probability density function of $ Y$.    My attempt.  I know that it has to be between $0 < y < 1$. So $F(Y = y) = P(Y \leq y) = P(X^2 \leq y) = P(-\sqrt{y} \leq X \leq \sqrt{y}) = \frac{2\sqrt{y}}{3+1} = \frac{\sqrt{y}}{2}$  I'm not sure how to go forward from this


Prove that for any piecewise smooth curve it is possible to find the parametrisation $\phi$ that is consistent with its length, ie.  length of a curve segment between $\phi(a)$ and $\phi(b)$ is equal to $|b-a|$.  It seems intuitive, but I don't have any idea how can I show this in the formal way.


list-comprehension throws a RuntimeError

Why does this code work well and does not throw exceptions? def myzip(*args):     iters = [iter(arg) for arg in args]     try:         while True:             yield tuple([next(it) for it in iters])     except StopIteration:         return   for x, y, z in myzip([1, 2], [3, 4], [5, 6]):     print(x, y, z)  But if this line yield tuple([next(it) for it in iters])  replace by yield tuple(next(it) for it in iters)  then everything stops working and throws a RuntimeError?


Let's pretend that all digits of pi are known and arbitrarily long sequences of digits are trivial to get. Further, some mathematician proves that there are no patterns in pi. We could create a stream cipher by grabbing a piece of pi as long as our plaintext and combining the two with some function (such as XOR or modulus addition.) The key would be the starting position in pi.  Would this be equivalent (in terms of security) to a one-time pad? To what sort of attacks would it be vulnerable?


write value of inputfield into database, error message if value = '

On my page here: , you can create a tutorial. If the tutorial author = ', the php code wont write the value's of the field's into the database. I checked the table of the database again and its 100% correct (varchar & 20 characters for the author). I collect all value's of the inputfield's with jquery and use Ajax to send it to my php code (that works too). Here is the code of the php page:     <?php  $step_counter = 1;  $tutorial_id = null;  print_r($_POST);  if(isset($_POST['input_tutorialtitle_name']) && isset($_POST['input_tutorialauthor_name']) && isset($_POST['input_tutorialdescription_name'])){      $title_value = $_POST['input_tutorialtitle_name'];   $author_value = $_POST['input_tutorialauthor_name'];   $description_value = $_POST['input_tutorialdescription_name'];    $insert = "INSERT INTO tutorial (tutorial_steps, tutorial_author, tutorial_title, tutorial_introduction) VALUES ('1', '$author_value', '$title_value', '$description_value')";   $insert_into_tutorial = mysqli_query($db, $insert);   if(!($insert_into_tutorial)){    print_r("Fehler beim eintragen des Tutorial's.");   }   else{          $tutorial_id = mysqli_insert_id($db);        }  }   $hit = true;   while($hit == true){      $input_title_name = "input_title_name" . $step_counter;   $input_description_name = "input_description_name" . $step_counter;   $input_image_name = "input_image_name" . $step_counter;    if(isset($_POST[$input_title_name]) && isset($_POST[$input_description_name])){     $input_title_value = $_POST[$input_title_name];    $input_description_value = $_POST[$input_description_name];     $input_image_width = 0;    $input_image_height = 0;    $input_image_value = 0;     if(isset($_POST[$input_image_name])){     $input_image_value = $_POST[$input_image_name];     list($width, $height) = getimagesize($input_image_value);      $input_image_height = $height;     $input_image_width = $width;    }     $insert = "INSERT INTO tutorial_step (tutorial_id, tutorial_step_number, tutorial_step_title, tutorial_step_image_name, tutorial_step_image_height, tutorial_step_image_width, tutorial_step_description) VALUES ('$tutorial_id', '$step_counter', '$input_title_value', '$input_image_value', '$input_image_height', '$input_image_width', '$input_description_value')";    $insert_into_tutorial_step = mysqli_query($db, $insert);    if(!($insert_into_tutorial_step)){     print_r("Fehler beim eintrages des Schrittes.");    }        $step_counter = $step_counter + 1;    $hit = true;   }   else{    $hit = false;   }  } ?>     And here is the image of the error (i used Firebug (if you try it too, you can see the entered value's)).     (line 14)  As example, I enter this value's:    , no error & php wrote it into the database table.


What is a good P value for statistical significance when conducting a Wilcoxon Rank Sum test?

Is a P value of 0.4 statistically significant for a Wilcoxon Rank Sum test?


Bibliography in LaTeX: Spaces between words

I'm writing the bibliography. LaTeX don't write it well. I don't know why. I have tried the tow methods: \begin{thebibliography} and using BiBTeX. The result is the same.  The result is longer spaces between some words.      Anybody can help me? Thanks!


I am Indian passport holder travelling to Port of Spain. Routing is Mumbai to Amsterdam via Abu Dhabi on Etihad. In Amsterdam, my connection time is 20 hours before the KLM flight to Curaçao; from Curaçao to Port of Spain is on Suriname Airways. All together, I have three separate tickets on three airlines.   I don't have a visa for any country. I will get a visa on arrival at Port of Spain (Trinidad).  Q.1 : Will Etihad allow me to board at Mumbai Airport?  Q.2 : Indian passport holders don't need a transit visa at Schiphol Airport, but is 20 hours transit time okay as long as I stay in the airport?  Q.3 : Do I require transit visa for Curaçao? My connecting flight is 6 hours  before the flight to Port of Spain.  This will be round trip ...  Yes ....i will have checked bag of 23kg ~ 1pc


How well does T-Mobile's (US) Simple Choice plan work when in Europe?

I'm about to travel from the USA to Europe. I have a GSM phone and I use T-Mobile's Simple Choice plan. This plan is . So far all I have is T-Mobile's marketing spin on it, and of course they tell me that everything is fantastic. I'm wondering how well this works in practice.  I mainly want to use the phone for data access, but I'm also interested in how well texting and calls to/from home will work out.  Has anyone here tried taking a phone with this plan from the USA to Europe? How did it go?  Update: In response to a question in the comments, I'm interested in answers relating to the UK and France. As for partner networks, I don't know, and that's part of the problem. I don't know which network(s) T-Mobile's Simple Choice plan works with. Some Googling suggests that it's  in the UK and that in France it might be , but I'm by no means certain about either of those.


How to rename multiple files into one name

I would like to rename these files;  2000.jpg B001.jpg  9002.jpg D006.jpg   to these names below   ICON000.jpg  ICON001.jpg  ICON002.jpg  ICON006.jpg   respectively.


Prove that $\sum _{n=-\infty }^{\infty } e^{-n^2 \pi x}=\frac{1}{\sqrt{x}}\sum _{n=-\infty }^{\infty } e^{-\frac{n^2 \pi }{x}}$

In Wikipedia's proof of Riemann's functional equation for the zeta function (, and click "Show Proof"), I find the assertion that $$\sum _{n=-\infty }^{\infty } e^{-n^2 \pi x} = \frac{1}{\sqrt{x}}\sum _{n=-\infty }^{\infty } e^{-\frac{n^2 \pi }{x}}$$ I can't work out how this works. Is it to do with Jacobi theta functions? Mathematica (which seems to use Jacobi's original notation) simplifies the expression on the left hand side above to the Jacobi elliptic theta function (Wikipedia , plus the 'Auxiliary Functions' section that follows) $$ \begin{aligned} \sum _{n=-\infty }^{\infty } e^{-n^2 \pi x} &= \vartheta_{3}(0,e^{-\pi  x}) \\&= \vartheta_{00}(0,e^{-\pi  x}) \\&= \vartheta(0,e^{-\pi  x}) \end{aligned} $$ Wikipedia defines $$\vartheta(z;\tau) := \sum _{n=-\infty }^{\infty } e^{\pi i n^2 \tau+2 \pi i n z}$$ But setting $z = 0$ and $\tau = e^{-\pi  x}$ then gives $$\vartheta(0,e^{-\pi  x}) = \sum _{n=-\infty }^{\infty } e^{\pi i n^2 e^{-\pi  x}}$$ which is clearly not equivalent to the original expression. I suspect that this may have something to do with nomes, which Wikipedia mentions but I cannot get my head around. So, my two questions are:  How do I prove the original equivalence? What am I doing wrong in relation to the Jacobi theta function?


String addition in Java showing unexpected behavior

I have this code in Java :      String s0="ab";     String s1="bc";     String s2="abbc";     String s3="ab"+"bc";     String s=s0+s1;   When i try to compare s & s2 using if(s==s2), it returns false, But on comparing s2 & s3 using, if (s2==s3) returns true. Why is the output not same in both the cases?


Is it possible to dual boot two OS's at the same time?  For example: I'm currently dual booting Ubuntu 11.04 and Windows 7. Ubuntu is running on a single 500gb HDD, Windows 7 is running on 1TB RAID 1 mirror. To switch between the two OS's, a reboot is required. Is it possible to switch between the two OS's without a reboot?  NOTE: I'm fully aware of the capabilities of VirtualBox and VMWare Player - I use both. Please don't answer "Use Virtualization!"  EDIT: If this is not possible can you share why it's not possible? To me, it doesn't seem like it would be that difficult. Keep in mind that my vision is unencumbered by knowledge!


I'm going try Ubuntu (coming from Windows 10)

My main goal for trying Ubuntu is to try to run some games. I've been having problems in Win10 with all games crashing to desktop after random periods of time. I've put all of my hardware through various stress tests with no errors. I've reinstalled windows, done clean boots etc., But it's still happening. So, my theory is, if I can get a game to run satisfactorily in Linux, with no crashes, then there must be something wrong with Windows. In which case, if I can get enough of my favourite games to run, I might never have to use Windows again. So, my question is...will I run into any issues with drivers or compatibility for the following hardware?: AMD Ryzen 5 3600 CPU; X570 chipset motherboard; G.Skill Trident Z RGB (4 x 8GB); Nvidia RTX 3070; Windows 10 installed on 1st M.2 NVME; Ubuntu to be installed on 2nd M.2 NVME; Games and other programmes installed on various SATA SSDs and HDDs.


Without using calculus determine the MLE of $(\theta_1,\theta_2)$

If $(x_1,\cdots,x_n)$ is a sample from a $\mathcal{U}(\theta_1,\theta_2)$ (uniform) distribution with $$\Omega=\{(\theta_1,\theta_2)\in\mathbb{R}^2:\theta_1<\theta_2\}$$ determine the MLE of $(\theta_1,\theta_2)$ without using calculus. OK, I know that, $$f(x|(\theta_1,\theta_2))=\frac{1}{(\theta_2-\theta_1)}$$ and $$L(\theta_1,\theta_2)=\prod_{i=1}^n\frac{1}{(\theta_2-\theta_1)}=\frac{1}{(\theta_2-\theta_1)^n}$$ Now I need to maximize the $\theta_2$ and minimize the $\theta_1$ values in order to miximize the likelihood. I know how to find those value using LL (Log likelihood function) and partial derivatives. But how to find them without calculus? I have no idea where to start.


How do I move a Composer-managed site to a new server?

I have a Drupal 8 site on an Ubuntu 18.04 server and want to move my site to a new server with Ubuntu 20.04. With Drupal 7 I did these steps Create a set of keys (on the new server) : $ sudo ssh-keygen -t rsa -b 4096 -C root@www-example-com $ sudo cat /root/.ssh/id_rsa.pub  Add the public key (on the old server) : $ sudo nano /root/.ssh/authorized_keys  Export the database (on the old server) : mysqldump -u root -p www_example_com > /var/www/www-example-com/share/www-example-com_$(date +%F).sql  Repatriate the site file (on the new server) : $ sudo scp -r -p root@xxx.xx.xxx.xx:/var/www/www-example-com/ /var/www/www-example-com/  Import the database (on the new server) : mysql -u root -p www_example_com < /var/www/www-example-com/share/www-example-com_2020-08-10.sql  That's all, with these intructions, the Drupal 7 site works. The problem Now with Drupal 8 there is Composer with a new folder and file tree present in the var directories and in home. How to move a Drupal 8 site to a new server ?


Can a thrown magic pebble be a target to the enlarge spell?  For that matter, can anything from an arrow to a hurled table become enlarged while in mid-air and if so how would you suggest fantasy physics would work on this? The enlarge spell states that the target doubles in all sizes but the weight is times eight.  Would the (stone, for example) maintain its velocity and hit the target with 8x its weight?  We all know that F = m*a. How would you suggest to handle this DMG wise? As always thanks in advance my fellow Dungeoneers.


Why can't I use Stack Exchange if I'm under 13 years old, or if I'm under 16 years old and from the EU?

I was just reading the , and noticed something:  You must be at least 13 years old to access or use the Network or Services, including without limitation to complete a Stack Overflow account registration. By accessing or using the Services or the Network in any manner, you represent and warrant that you are at least 13 years of age. If you are under 13 years old, you may not, under any circumstances or for any reason, access or use the Services or Network in any manner, and may not provide any personal information to or on the Services or Network (including, for example, a name, address, telephone number or email address). If you are located within the European Union, you must be at least 16 years old to access or use the Network or Services, including without limitation to complete a Stack Overflow Account Registration.  I signed up for Stack Overflow when I was around 11 or 12 and I did provide my email address. Are you saying that my use of Stack Overflow was not legal? I'm 16 now (so I'm in the clear), but that just seems a little harsh. Is that possibly related to the age limit for accepting a binding contract/agreement (although I thought that was 18 in the U.S.)? Is there a way for users under the age of 13, or for users from the European Union who are under the age of 16, to use the site legally?


Solution to simultaneous polynomial equations.

Given any $\beta \in R$, do there exist integers $k,l,m$, and a real number $x$ such that:  $l=4x^{3}m+6x^{2}m^{2}+4xm^{3}-2xm$,  as well as  $x^{4}-x^{2}=k+\beta$ ?


I'd like to know whether flame retardant epoxy resins, the FR-4 brominated type for instance, are used in the outer molding for integrated circuits or whether it's just a plain epoxy resin. Additionally, if anyone can direct me to any literature or textbooks that rigorously cover materials of construction for circuit boards I would greatly appreciate it!


Equilateral triangle with vertices whose coordinates on the Cartesian plane are integers. Does such a triangle exist?

Can you build an equilateral triangle on a Cartesian plane whose vertices only have integer values as their coordinates?  Looking at the simplest example, i.e. a triangle with vertices (0,0), (1,0) and (0,1), this doesn't look possible as there is a square root involved, but can you build one such triangle at all?


Consider the Hilbert space $H=l^2 $over $\mathbb C$ .If $x\in l^2$,then $\displaystyle{ \sum_{i=1}^\infty}|x_k|^2<\infty$.If $x,y\in l^2$, the inner product is defined by $$\langle x,y\rangle=\displaystyle\sum_{k=1}^{\infty}x_k\bar y_k$$.  Let $T:l^2\to l^2$ is defined by  $T(x_1,x_2...)=(x_1,\frac{x_2}{2},\frac{x_3}{3}....)$.   Is T self- adjoint and unitary ?  My thought:  I am not sure which criteria's  are necessary to show self-adjointness.I know T is self adjoint if $T=T^\star$  Again I found $\langle T(x),y\rangle=\langle (x_1,\frac{x_2}{2},\frac{x_3}{3}....), (y_1,y_2...)\rangle= \displaystyle{ \sum_{k=1}^\infty}\frac{x_k}{k}.\bar y_k$, I can't further proceed.  For unitary, $TT^\star=T^\star T=I$.  Please someone explain and give a brief idea how to solve this types of problems.  Thanks.


What are the tradeoffs involved in taking a postdoc at a top university versus an assistant professorship at a non-top university?

When it comes to getting a tenure-track position where one has both a lot of resources and academic freedom to do what one wants to do (so having a tenure-track position in a top university might be more useful because one may get more resources at a top university).   Or in short, when one wants to maximize one's chances of becoming a "top scientist".  There are obviously numerous factors, and "rank/prestige" should not be considered as a factor in itself. That said, the period after one gets a PhD is an extremely important time for building up connections, and those are easier to get at a top university.


Is there a way to in either Mac programs or third-party programs to click 2 keys repeatedly until I stop it?

Automated key presser is perfect but it doesn't work on mac. Lets say I want to press T and K alternating indefinitely until I stop it. How do I do that?


If $E(X|Y) = E(X)$ then $E(XY)=E(X)E(Y)$.  I was attempting the discrete case. I was trying to show that $E(X|Y)E(Y)=E(XY)$. But I could not proceed much beyond the definition of expectations. Rather I feel that this equality may not always hold. I have failed to find any counter-example for $X$ and $Y$ either.


How to vertically center a table on the page?

I read the documentation but there is no table parameter for center position. Only htbpH.  This is a problem because some of my tables are randomly at the top of the page, and others in the center. It makes reading them annoying.


MacBook shut down at 20% battery with no warning?

My 2013 13" MacBook Retina (OS X 10.10.3, Yosemite) shuts down when I have about 20 minutes of battery left. Not sleep, full shut down. It does this with no warning at all.   I seem to remember earlier Mac laptops giving me a low battery warning at around 20% and then putting the machine to sleep (hibernation?) when it gets real low... but never a full shut down.   Does my battery need to be recalibrated? Does the system inaccurately think it has some juice left? Worth mentioning, when I plug it back in and boot it back up, it claims to be at about 15%.     Update: I've done the recalibration thing a couple of times now, but still no difference in performance. What's frustrating is that I never get the low battery warning and the machine doesn't sleep; it shuts down. I've done tons of Googling around and everything I find says exactly what  suggests . The one weird thing that I found on  is this:      "If your portable Mac has a built-in battery, you don’t need to   calibrate the battery."   Can't say I've ever heard that before.


When you want to tell someone that you understand something, you might say, "I get/got/'ve got it." But Q) Do we say "I've gotten it" or "I have it" in place of the above? I ask this because, in "I get it", clearly, the main verb is "to get", and here, it means "to understand" (), definition #7, but what about the rest? I mean, what is the main verb in "I've got it" or simply "I got it"? Is it "to get", as above, or is it "to have", as in "I have/'ve got/got a car?" (I know that "I got a car" is informal English, and mainly used in the US)


every planar graph can be expressed as a union of five edge-disjoint forests

How can I prove that every planar graph can be expressed as a union of (maximum) five edge-disjoint forests?  Only thing I can think about is going somehow like the $5$ color theorem but I get stuck in the middle. Or with induction, but still something doesn't fit. Can you help?


SEO - Updated Site title and meta description, how long until changes take place on google

I am using the Yoast plugin to help with the SEO of my site. I just set everything up and am wondering how long it takes for google to update the information. As you can probably tell already the only knowledge I have is basic CSS.  What I am mainly concerned about is getting my homepage listed with the correct SEO title and meta description. Currently, my homepage is listed but not with the updated SEO title or meta description.  Thanks for the help.


Please help me relate two different definitions of the stress-energy tensor

Sometimes the stress-energy tensor $T_1^{\mu\nu}$ is defined as $$T_1^{\mu\nu}=\frac{\partial \mathcal{L}}{\partial(\partial_\mu\phi)}(\partial^\nu\phi)-\eta^{\mu\nu}\mathcal{L}$$ which for translational symmetries of spacetime satisfies $\partial_\mu T_1^{\mu\nu}=0.$ It is not always symmetric. In general relativity, stress-energy tensor is defined as $$T_2^{\mu\nu}=\frac{\delta S}{\delta g_{\mu\nu}}$$ where $S=\int d^4x\sqrt{-g}\mathcal{L}(\phi,\partial_\mu\phi)$ is the action of the theory. It is always symmetric because the metric tensor $g_{\mu\nu}$ is always symmetric.   Can we say that the second definition is more general? If so, can we derive the $T_1^{\mu\nu}$ starting from the second expression $T_2^{\mu\nu}$ in the flat spacetime limit?   Please keep the discussion elementary.


If I'm using  and I have  on the field, and I deal combat damage to a player with Yidris. Will using Thran Temporal Gateway's ability allow Yidris' s ability to trigger, because Thran Temporal Gateway doesn't use the text cast?


Let's start form two versions of Dichotomy paradox     Version 1: Anyone can't walk though any distance without walk though half of it and so on.   solution 0 (?) ... which is false I think, that's not what the statement talking about  For any distance d we have   d/4 + d/8 + ... + d/(2^n)+... = d/2   That we can walk though half of d  Therefore we can walk though any distance d  solution 1  Let f : T -> V be a function with domain time(T) and codomain velocity(V)  Suppose we started from 0  For any distance d that we want to walk though have:  Exists 0,c_0 in T if we take integral from 0 to c_0 on f(x) it equal to d  Alse exists 0,c_1 in T s.t. take integral from 0 to c_1 on f(x) have d/2^1  ...(Keep doing this to n)  Alse exists 0,c_n in T s.t. take integral from 0 to c_n on f(x) have d/2^n  ...(Keep doing this to infinite that as n->inf, c_n=d/2^n=0)  That will have, exists 0 in T s.t. take integral from 0 to 0 on f(x) have 0  In another word ... Zeno states that in order to move any distance d, what we have to do first is just walk though 0 infinite many times, but infinite many 0 distance add together will still be 0.  But is this just the wrong way to do limit.  Or is there something else I missed     Zeno's arrow paradox: ...(the mistake is similar to Version 1 of Dichotomy paradox)        Version 2: Even anyone can walk though half of any distance, he still have to walk though the half of the rest and so on.    solution 1 (Calculus--James Stewart pg.6 The sum of a series)  For any distance d we have  d/2 + d/4 + ... + d/(2^n)+... = d   Suppose we can indeed walk though all of those sumed distances in a finite time  That implies that we can walk though any distance d    solution 2  Let f : T -> D be a function with domain time(T) and codomain distance(D)  For any people who walk with constant velocity v  If it's the case that range(f)=[0,d), for some d in R  It's either time being defined differently or space being defined differently  For example we define Zeno's time as the following:  Let c,t be some real number then  Zeno's time(T) = t iff Normal time = (L-(1/c)^t)/v where c > 1   Have f(t) = (L-(1/c)^t)  That with finite Zeno's time no one can reach d.  Similarly we can also construct a Zeno's space s.t. range(f)=[0,d)  Basicly, this solution want to say: paradoxes caused by using different definitions.     Achilles and the tortoise: ... (This is similar to second version of Dichotomy paradox)     In both versions, I think solution 1s are fine, are they correct?  And please tell me if you know where I can find some formal proof in calculus which shows the mistakes of Zeno's paradoxes  Any help or suggestion would be appreciated.


Trailer wheel: Axle connected on one side only

Most wheels have an axle that needs to be connected to a frame from both sides. What are wheels called that only need to be connected from one side?    I'm looking to buy wheels like this and for that I need to know what they are called.


Most of Shadowrun settings center on Seattle and the Western Seaboard.  Are there any, perhaps unofficial or older, sources for how other megatropolises such as Manhattan and FDC developed after the Awakening?  Major corps, notable gangs and movements, anything?


Permutations of the word "arrangement" with restrictions (counting)

How many permutations are there in the word "arrangement" that have exactly two of the following consecutive letters in them: aa,ee,rr,nn? For example: "aarrngement"


Is it correct to say the following as an indirect question?  Can you tell me where did you buy it?  or should it be  Can you tell me where you bought it?


When I choose a new ordinance, how soon does it go into effect?

Does anyone know the details of the ordinance system? If I have one ordinance going, and cancel it to put a different one into effect, does the change happen immediately? The next day?


How to remove the save confirmation prompt?

New Blender user here. I have been trying to remove the confirmation prompts when saving for more than half an hour and it is driving me mad.  What I want is to simply have Blender save the file without raising a fuss or anything when I press Ctrl+S. When I click on "Save" in the "File" menu in the top-left bar, it does that, but when I press the button combination, the confirmation prompt rears its ugly self.  I opened the "User Preferences" window and unchecked all the "Check Existing" boxes related to all the Save commands in the Window sub-category. At best, Ctrl+S brings up the "Save As" window and demands the file's destination path. At worst, it does absolutely nothing whatsoever.  Is there actually a simple way to disable this prompt? Thanks in advance.


Right Clicking Deforms instead of moving points?

New to blender,  I just made a simple model, but now when I try to change the mesh, the entire mesh stays together and is moved as well as deforming. For example, attempting to shape a cube by grabbing one vertex no longer pulls that vertex, but moves the entire cube in that direction, and subtly deforms it. I don't have this problem when I 'load factory settings' but every time I load this particular project the problem persists.   After some googling, it seems like it is acting like I'm deforming a shape key, but I haven't learned much about those yet, and it doesn't look like the mesh even has a basis shape key yet. Does anyone know how to get back to normal editing? And maybe what I accidentally pushed to cause this in the first place?


How to change computer name so terminal displays it in OS X?

I have a Mac Server 3.1.2, w/ system 10.9.4 that is not being used as DNS Server. Windows Server 2012 is DNS & DHCP server. On the Mac, Terminal cannot ping hostname of mac, however, it does identify itself with it's hostname so I'm concluding this mismatch is the cause of my issues.  Anyone have a suggestion?


IMAGE from Google Drive in Google Sheets

I have the following image on a cell in my Google Sheets:  https://drive.google.com/open?id=1C9KL2vEhnZOVdCe2qUG5MZomw3jpvCiX   When I use the formula =IMAGE(A1), the cell with the image stays white...  Any idea how to make it work?  PS. A1 is where the text with the URL is included.


I have a method that accepts a generic TViewModel class like so:  Page GetPage<TViewModel>() where TViewModel : class, IViewModelBase;   In my class I get the type of the item that the user selected (from a navigation list) like so:  var viewModel = item.TargetType;   This type will always be a view model that inherits from IViewModelBase   When I call this next line I need to be able to pass in the viewModel type. Im trying to do   var page = Navigator.GetPage<viewModel>();   But I get the following error:      viewModel is a variable but is being used like a type.   Is there anyway I can pass the viewModel type to the GetPage Method?  If not the only way I can see to do this is to have a switch statement that checks the viewModel type name and hard code the correct TViewModel into the GetPage call.  For example something like this:  switch (viewModel.Name) {     case "TaskViewModel":             page = Navigator.GetPage<TaskViewModel>();        break;     case "TaskEditViewModel":             page = Navigator.GetPage<TaskEditViewModel>();        break; }   I tried the solution that this was marked as a duplicate for and that answer does not apply to mine. I get the error      Object does not match target type   The attempted code looks like this:  MethodInfo method = typeof(Navigator).GetMethod("GetPage"); MethodInfo generic = method.MakeGenericMethod(viewModel); generic.Invoke(this, null);


When I set a spawnpoint using commands for me or another player, I keep spawning at that exact point, with an exception: when I change it. What I want, though, is to remove it completely and spawn at the world spawn instead.  I've even done research on such a trivial command, but didn't find anything about it's removal.  Is it possible to remove an individual spawn point using commands? If not are there other ways to do it (like modifying the file it is in)?


How to retrieve accepted LinkedIn invitation message

I prematurely accepted a LinkedIn connect invitation. The invitation had contact information, but I can no longer access the message. Is it lost forever? How can I access the message?


How to run a CMD file that is associated with a text editor

The file extension .cmd somehow got associated with Vim on my Windows 7 machine. When I try to run the cmd file, either by double clicking or running it by typing its name into a command prompt, it opens in Vim. I need to actually run this script.  In the right click menu, there's no "Open With..." or "Run" or anything like that.  The file is shared by many people, so I cannot change it's extension or modify it in anyway.  How can I run this file? (I would consider resetting the file associate back to whatever is default to be an acceptable answer).  Edit: Worth nothing that the CMD file I need to run is on a network machine, which is accessed from an .lnk file on my machine.


Is there an easy way to delete untracked git files

From time to time I have untracked files in my git repository and I'd like to delete them.  Is there an easy way to do so using git or bash or even another way?


Disjoint compact subsets of a Hausdorff space are separated by disjoint open neighborhoods

Let $X$ be a Hausdorff space and let $A,B\subseteq X$ two compact subspaces which don't intersect. Show exist $U,V\subseteq X$ open which don't intersect s.t $A\subseteq U,B\subseteq V$.   I thought taking $A\ni a\neq b\in B$ and since $X$ is Hausdorff, $$\exists S_{a,i}\in N(a),S_{b,j}\in N(b):S_{a,i}\cap S_{b,j}=\emptyset$$ and taking $S_a=\bigcap_{a\in A,i\in I}S_{a,i},S_b=\bigcap_{b\in B,j\in J}S_b$ as my $U$ and $V$.  The only problem is I don't use the compactness. What am I missing? Is my solution correct?


Why was this question asking for a library recommendation closed as not constructive?

This  was closed as not constructive, with a comment "SO is not your research assistant".   As a long-time lurker starting to get more active on SO, I'm curious, in order to better learn the community standards, why this question was closed. Unless I'm completely remembering wrong, I've seen many questions asking for help finding or picking an appropriate library.  (Note this was NOT my question and I'm NOT arguing it should not have been closed.)


Random Forest mtry Spit-to-Split Variable Sampling Procedure

Thanks to several online resources, including , I am clear that - within Random Forests - mtry represents the number of variables randomly sampled without replacement at each split of a tree.  What I am not clear on is if sampled without replacement means that a variable that was sampled for the first split, but passed on because another another randomly sampled variable provided greater outcome homogeneity, could be sampled again for the second split of the tree.  Here is a simple example:   I have a binary classification problem. My dataset has 8 predictor variables: V1, V2, V3, V4,  V5, V6, V7, V8 I've set up my model where mtry = 3 For the first split of the first tree, the three randomly selected variables to test are V2, V4, V7 and the algorithm has determined that V4 provides the maximum homogeneity of the three variables.   I understand that V4 is not an option for the randomly sampled variables of the second splits (2) because it is already being used for the first split.  My question is: Are V2 and V7 available to be randomly sampled again in both of the second splits along with the variables that were not sampled in the first split? i.e., are the variables available for sampling in both of the second splits V1, V2, V3, V5, V6, V7, V8?


How to handle high specific minor edits?

A user seems to have zeroed in on a single spelling error shown .    Since most of the edits are not rejected, my questions is, Am I wrong to see it as minor edits?  If not, is there anything I could do besides rejecting?


I've been playing Agar for some time now, and lately I've noticed there was a new XP system in Agar. Since then I've been wondering what variables chance the XP gained. I've tried googling it, but with no luck.  I'm looking for how the XP system works in these game modes:   FFA Teams Experimental


I have a file. I'd like to echo out the full path to it in the terminal.   Which command would?


How can I parse a string and split it into two parts at a special character with javascript?

How can I take a string and split it at a special character into two new variables (and remove the special chars) with javascript?  For example take:  var X = Peggy Sue - Teacher   and turn it into:  varnew1 = Peggy Sue  varnew2 = Teacher   I guess it should also include a condition... if the string has a "-" then do this.


If directory is empty do this, If directory is not empty do that

So far I've got this. Is there a more efficient way?  if ls -1 $HOME/path/to/folder/* >/dev/null 2>&1 then         echo Directory is not empty. else         echo Directory is empty. fi


I'm aware that shared objects under Linux use "so numbers", namely that different versions of a shared object are given different extensions, for example:   example.so.1 example.so.2   I understand the idea is to have two distinct files such that two versions of a library can exist on a system (as opposed to "DLL Hell" on Windows). I'd like to know how this works in practice? Often, I see that example.so is in fact a symbolic link to example.so.2 where .2 is the latest version. How then does an application depending on an older version of example.so identify it correctly? Are there any rules as to what numbers one must use? Or is this simply convention? Is it the case that, unlike in Windows where software binaries are transferred between systems, if a system has a newer version of a shared object it is linked to the older version automatically when compiling from source?  I suspect this is related to ldconfig but I'm not sure how.


I use Vim to edit text files on Linux. Commonly I connect to remote Linux machines using PuTTY from Windows.  I use GNU Screen commonly as well.  When using Vim inside Screen I am unable to use the Page Up key because Screen interprets it as a command to start copy mode.    I would like to use Page Up for its regular up-paging functionality.  How can I configure Screen to do this?


Is there anyway that I can set up my profile in stackoverflow so when ever someone asks a question about jQuery, I will receive the question in my email so I can answer it?. Its easy rather than logging in and checking everytime.


Define a bijection between $Z^{X \cup Y}$ and $Z^X \times Z^Y$, where $X, Y \in \mathcal{P}(\Omega) $ and $X \cap Y = \emptyset$  I was given the following task to prove. I know that we need a map $h : Z^{X \cup Y} \ \to Z^X \times Z^Y$ Firstly, we have to define a function $h(f)$ and the show that is both injective and surjective. However, I can't define it. I know that LHS should be $h(f)(x)(y)$. Is it correct ? What should be RHS?


find -path doesn't match files unless extension is specified

One of the big reasons why find makes things awesome  if I do this:  find -path *ncf   or this:  find -path ncf*   I get no results, but if I do this:  find -path *ncf.js   I get a matching file. Why is that? Is it a peculiarity of find, or something more grandiose? Does anyone have the home address of the guy who wrote find?


How is a VHDL variable synthesized by synthesis tools

I know two ways in which a VHDL variable is synthesized by synthesis tool:   Variable synthesized as Combinational logic Variable synthesized as a Latch unintentionally (when an uninitialized variable is assigned to a signal or another variable)   What are the other ways in which a VHDL variable can be synthesized ? (Example: can it be interpreted as a FF ? )


How can run native executables compiled for ARM on unrooted Android devices?

Following  tutorial I have compiled a Hello World! ARM binary from C source using gcc. I want to run this program on my unrooted Android phone but I can't figure out an easy way to do it.  What I've tried:   Copying hello to /sdcard and trying to run it from there. This doesn't work because the internal storage is mounted with the noexec flag. Copying hello to /data/local/ using cp hello /data/local/ or cat hello > /data/local/hello as . This also doesn't work and I get a "permission denied" error. Installing a terminal emulator program such as  and using the Termux app to copy hello from /sdcard/hello to /data/data/com.termux/files/home, running chmod +x hello and then running ./hello from the Termux home directory within the Termux app. This works but is not a feasible solution.   Is there a better/easier way to run native ELF executables on an unrooted Android phone directly through ADB and doesn't involve installing any apps?


Graph functions & color area under curves

Could anyone help me with the attached images below as far as coding the axis's and shading the area? I'm new to anything graphing in LaTeX and would love to have some guidance.


Require v8 only contrib module with v9 patch

Given I have Drupal 9 composer installation with composer-patches plugin and given a contrib module with a stable v8 release, but no v9 release (not even dev branch) and given that contrib module has a working v9 patch in the issue queue  is there any method to install that module + patch in composer? Even if I manually add both, the package and patch, to my composer.json, I still can't require or update this module with composer due conflicting versions. I really want to avoid duplicating /contrib code into my project's /custom codebase. My current workaround is:  forking that module to my own, private git repo applying patch there creating a new composer.json in my private git, and changing the package vendor to my custom_private_vendor adding my private git as VCS repo in the D9 project's composer.json and then composer require custom_private_vendor/contrib_module  This fulfills my goal of not duplicating the contrib module in my project's custom codebase, but every time I do this I feel the urge to wash my dirty hands. Is there something more elegant like composer require drupal/contrib_module --apply-patch-first or can I somehow target drupal.org's git with a specific patch included?


Is it safe to remove snapd from ubuntu server?

I have a 18.04.3 server set up running an OpenVPN server. This machine has fairly limited RAM since it is running on a virtual host with other servers. This machine is soley dedicated to VPN and is an important service for my work.  I noticed lots of snapd processes taking up much of the RAM. Is it safe to uninstall (or event just stop the processes) snapd to gain back this precious resource?


My wireless/WiFi connection does not work. What information is needed to diagnose the issue?

Your situation   You have successfully installed Ubuntu.  You have just downloaded and booted Ubuntu live media.  The latest LTS (see also ) or latest non-LTS release are preferred. See the list of  that are currently supported.) You upgraded your Ubuntu installation to the latest release that the software updater offered you. WiFi worked before, but not now on the new release. You  to new hardware.   Your problem   The wireless of your laptop or desktop is not working. You tried switching the wireless switch off and on and you tried rebooting several times, but you don't see any WiFi access points. You can see your wireless access point, but you cannot establish a connection. You want to analyze the problem, but you don't know where to start or what information you can provide.   This question and answer was written to give people the wireless script that will provide the information needed in most cases to diagnose their wireless issue's.   Related questions


How to find chat history for Skype for Linux beta

Before with the old client, the chats are stored in the .skype directory, but I am not sure how to find the chat history in the new skype for linux beta.


How to block a range or list of phone numbers

I get spam calls that begin with the same 6 digits as my own number. It's always a different number so I cant individually block them. Is there a way to block a whole list or a range of numbers?  The app Hiya tells me that these numbers are "spoofed" but does nothing to block them. I do not want my phone to ring. I do not care about false positives. I don't mind if a few legitimate calls get blocked along the way.


Change disk ssd. How check which SATA version is supported?

I hava Lenovo g580 laptop. I want to change disk to SSD drive, but I'm not sure if my laptop support SATA 3 (6Gbps).  I write following output:  dmesg | grep SATA [    3.190743] ahci 0000:00:1f.2: AHCI 0001.0300 32 slots 6 ports 6 Gbps 0x5 impl SATA mode [    3.199450] ata1: SATA max UDMA/133 abar m2048@0xd3617000 port 0xd3617100 irq 43 [    3.199455] ata3: SATA max UDMA/133 abar m2048@0xd3617000 port 0xd3617200 irq 43 [    3.518365] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [    3.857921] ata3: SATA link up 1.5 Gbps (SStatus 113 SControl 300)   Is that means I Can use SSD disk in SATAa 6Gbps mode?


Does Stack Overflow organize community-wide meetups?  Like I'm mostly part of . So is there any kind of yearly meetup events? Where and when? How is it announced?  The same for other sites as well.


Is it safe to eat ice cream that was left in a refrigerator overnight?

A pint of dairy ice cream was accidentally left in the refrigerator overnight. It was then placed back in the freezer. Is there any risk in eating it now?


Determining IF & WHERE a line intersects with a 2D plane (in 3D space)

The following problem I'm working on is for one of my favorite past-times: game development.  Problem: We're in 3D space. I'm trying to determine if a line between two vectors in said space is passing through a circle; the latter of which consists of: center vector, radius, yaw & pitch. In order to determine that, my aim is to convert the circle to a plane which can either be infinite or just have the diameter of the circle for all it's sides. Should the line between the two vectors in fact pass through that plane, I am left with the simple task of determining whether that intersection point is within the radius of the circle, in which case I can return either true or false.  What's already working: I have my circles set up and the general framework is there. The circles are appearing/rendered in the 3D space exactly as specified, great!  What was already tried: Copied some github gist codes and tried to make them work for my purposes. I kinda worked, sometimes at least. Unfortunately due to the nature of how the code was written, I had no idea what it was doing and just scrapped all of that. Researched the topic a lot, too. But due to me not really understanding the language people speak when talking about line/plane intersections, I could have read the answer without recognizing it as such.  Question: I'm stuck at line intersections. No idea where to go and how it works logically! So, where do I go from here and how can one comprehend all of this?  Note: I'm working with Java, but I'm not looking for spoon-fed code. It's a logical issue I'm trying to get past. If explained well enough, I will make the code work with trial and error!


how to represent number bigger than long in c

I want a variable to represent the number 600851475143 in C but this value is larger than the maximum value of long i.e 2147483647.What data type should I use?


This is a followup question to egreg's answer to  The answer runs into a problem if an index topic occurs in more than one page range. The following MWE, based on egreg's answer:  \begin{filecontents*}{subjind.ist} delim_0 ", \\checkrange{" delim_t "}" \end{filecontents*}  \documentclass{book} \usepackage{xparse} \usepackage{imakeidx}  \makeindex[title=Subject Index,options=-s subjind]  \ExplSyntaxOn \NewDocumentCommand{\checkrange}{>{\SplitArgument{1}{--}}m}  {   \formatrange#1  } \NewDocumentCommand{\formatrange}{mm}  {   \IfNoValueTF { #2 }    { % no --, it's not a range     #1    }    { % it's a range     \egreg_range:nn { #1 } { #2 }    }  }  \bool_new:N \l__egreg_range_compare_bool  \cs_new_protected:Nn \egreg_range:nn  {   % print the start number   #1--   \int_compare:nNnTF { \str_count:n { #1 } } = { \str_count:n { #2 } }    {% same number of digits, remove equal ones at the start     \__egreg_range_compare:nn { #1 } { #2 }    }    {% different number of digits, print both     #2    }  } \cs_new_protected:Nn \__egreg_range_compare:nn  {   \bool_set_true:N \l__egreg_range_compare_bool   % do a loop on the digits in the first number   \int_step_inline:nn { \str_count:n { #1 } }    {     \bool_if:NTF \l__egreg_range_compare_bool      {       % if the digits coincide, print nothing       \str_if_eq:eeF { \str_item:nn { #1 } { ##1 } } { \str_item:nn { #2 } { ##1 } }        {         \str_item:nn { #2 } { ##1 }         % at the first differing digit, don't compare any longer         \bool_set_false:N \l__egreg_range_compare_bool        }      }      { \str_item:nn { #2 } { ##1 } }    }  } \ExplSyntaxOff  \begin{document} \setcounter{page}{95}\index{Topic0|(}Text\newpage \setcounter{page}{101}\index{Topic0|)}Text\newpage \setcounter{page}{124}\index{Topic1|(}\index{Topic2|(}Text\newpage \setcounter{page}{126}\index{Topic1|)}Text\newpage \setcounter{page}{134}\index{Topic2|)}Text\newpage \setcounter{page}{141}\index{Topic0}Text\newpage \index{Topic0}Text\newpage \index{Topic0}Text \printindex \end{document}   yields the following error message:  ! LaTeX3 Error: Too many '--' tokens when trying to split argument.  For immediate help type H <return>.  ...                                                l.3   \item Topic0, \checkrange{95--101, 141--143}   Entering non-stop yields the following output:    which omits "-3" from the second index entry of Topic0. The question is how to get around this.  Edit following up on egreg's ingenious solution.  I don't know if I should ask a new follow up question, so I'm posing it first here in this edit.  egreg's solution doesn't seem to handle index sub-topics.  If one adds the following 4 lines  \setcounter{page}{135}\index{Topic0!sub0|(}Text\newpage \setcounter{page}{136}\index{Topic0!sub0!subsub0|(}Text\newpage \setcounter{page}{139}\index{Topic0!sub0!subsub0|)}Text\newpage \setcounter{page}{140}\index{Topic0!sub0|)}Text\newpage   after  \setcounter{page}{134}\index{Topic2|)}Text\newpage   in the solution, one gets the following errors:  Output written in mwe.ind. Transcript written in mwe.ilg.  (mwe.ind ! Extra }, or forgotten \endgroup. l.4     \subitem sub0, 135--140}  ? r OK, entering \nonstopmode... ! Extra }, or forgotten \endgroup. l.5       \subsubitem subsub0, 136--139}  ) [145] (mwe.aux) )   and this output:    Alas I don't understand egreg's code well enough to make the required changes.


Is modern encryption needlessly complicated?

RSA, DES, AES, etc., all use (relatively) complicated mathematics to encrypt some message with some key. For each of these methods, there have been several documented vulnerabilities found over the years. Some even believe that there is a vulnerability in AES known only to the NSA.  On the other hand, the one-time pad is not only ridiculously simple, but also has been shown to be impossible to crack (if used appropriately).  Say you have some message to be encrypted with length n. Simply generate a random string with length m where m is at least as large as n, and perform modular addition of the random string onto the message.  As long as the random string is generated with a high-enough-quality random number generator, and as long as the same one-time pad isn't reused, it should be impossible to crack.  If this is true, all we would need to perfect are fast, cryptographically secure deterministic random number generators. Use the key as a starting seed for the RNG and you have a powerful uncrackable encryption scheme which is simple to understand and implement.  Blum-Blum-Shub is a fast, cryptographically secure PRNG, and there are others too.  I have written a C++ program which uses two 2048-bit primes (which match the necessary criteria) for Blum-Blum-Shub and uses a password which the user enters - converted into a starting seed - to run byte-wise modular addition. The process is fast, deterministic, and if the literature I have read is correct then it should be very secure.  So why is so much time and effort invested in coming up with convoluted encryption cyphers when mathematics shows that the simplest is often the best?


sci-fi book where a meteorite gives 3 different kinds of telepathic powers to people who then vie for control

3 groups of telepaths each with different powers.  They received their powers from a meteorite.  One group is the strongest and are kind of in control.  Another group wants to gain control.  One group, I believe the strongest, have telepathic battles to determine the strength of one another conjuring up swords, walls, etc. in their minds. It was written by a lawyer.  Could have been written in the ‘80s, or earlier.


Book involving a young boy who fights with nunchaku for reality show entertainment

I read this somewhere in the late 80s to early 90s as a hardback book in Ashland, KY. The main character is a boy, but severely jaded. He fights with plastic nunchaku (he makes a point at some point that plastic provides a satisfying impact without causing as much lasting injury) as part of a reality show, filmed on hovering cameras that surround him. Odd detail, his hair was individually laminated so that, with an electrical charge, it stood in a cloud of spikes. One of his best friends is a scientist who delights in hedonism and social experimentation (I remember one of his chemical formulas turned out to be off by a few molecules and resulted in an orgy). His friend, at one point, was dressed as a plague victim, complete with fake  (I remember because this book introduced me to the word). Sex was referred to as "linking" with the penis sometimes referred to as one's "link".  Somehow, the main character winds up on a deserted island with the female love interest, who might have been some sort of reporter. He sustains an injury (a head injury, I think?) and I remember when he wakes up, she proudly says she took the maggots out of the wound whereupon he informs her that they're bioengineered to help him heal. He recovers some of them. I think they cannibalize one of his cameras for parts (I want to say that this was where we get the reveal that his nunchaku had a holdout weapon built into them essentially allowing each rod to act as a one-shot shotgun) and somehow wind up meeting up with an old man who's some sort of famous philosopher or economist. I remember there was an anecdote calling back to a classic piece of literature where this man found he could not look at an item without subconsciously calculating its value. The man was in exile, I think, although I don't remember if it was self-imposed or imposed upon him.  I don't remember exactly how it ends. The scientist friend (I think killed off in the same incident that resulted in the wound in the second paragraph) was involved in something hinky involving his drugs and the government. The main character matured (I want to say that he'd had puberty artificially prevented, and the accident resulted in him being off of his meds long enough to hit puberty) and becomes a man with all of the responsibilities involved. And I think he did wind up with the girl.  I remember this book was one of my favorites as a kid, but I can't quite recall the name. I keep wanting to say that the author is , but I can't find anything he's written that matches up.


How do you vote on a comment to a question or answer? I am not seeing any vote button by any comments.  Is it a privilege that you have to earn by having enough reputation? I only have 16 reputation, so, if it is, I don't think I have it.


Prevent abstract environment to reset pagenumbering

I use  \documentclass[12pt, a4paper]{report} for my thesis. I have three parts, each with an abstract. Whenever I put an abstract, the page numbering resets to 1. I would like to continue with the numbering it had before placing the abstract.  Minimum working example:  \documentclass[12pt, a4paper]{report}  \begin{document} \title{title} \maketitle \tableofcontents  \chapter*{Introduction} \addcontentsline{toc}{part}{Introduction}   Introduccion  \part{Part 1} \begin{abstract} abstract \end{abstract}  Part1  \part{part 2} \begin{abstract} abstract \end{abstract}  Part2  \part{3} \begin{abstract} abstract \end{abstract}   \end{document}


Is there any connection between theta series and physics?

I have heared that there is connection between number theory and physics. I specially ask that:          Can anyone give a concrete example which shows this connection?   I want to see an example which is related to (integral) quadratic forms or theta series.          Let $f$ to be a quadratic form; i.e a homogeneous polynomial of degree two (in any number of variables), for example $4x_1^2 + 3x_1x_2 + 5x_1x_3 - 8x_3^2$. Also let's assume that all of the co-efficeints of $f$ are integral.    Now let's fix a  (integral) quadratic form $f$ in $m$ variables, and let $n$ varies in $\mathbb{N}$; let's define:   $$  N(n)  :=  N(f,n)  =  N\big(f(x_1, ..., x_m),n\big)  =  \#  \{(x_1, ..., x_m) \in \mathbb{Z}^m : f(x_1, ..., x_m)=n \}  ;  $$ note that $N(n)$ is the number of integral solutions to the equation $f=n$; now by a  associated to the quadratic form $f$ we mean the following:   $$  \Theta(q)  :=  \Theta_f(q)  =  \sum_{n\in \mathbb{N}_0}N(n)q^n  =\sum_{(x_1, ..., x_m) \in \mathbb{Z}^m}q^{f(x_1, ..., x_m)}  ;  $$   also if we assume that $q=e^{2\pi i z}$;  then there is theorem which states that $\Theta_f(q)$ is a modular form in $z$.      I have asked my question  again.


I want to sync music to ipod 4g device, without the use of itunes in ubuntu 10.04, I used to do this with gtkpod until gtkpod stopped supporting fourth generation ipods.  I tried to setup itunes with wine, but in vain. Is there any other open source software which can help me with this ? I do not want to instal windows for this.


How to classify and cluster this time series data

I have post already the question few months ago about my project that I'm starting to work on. This post can be see here:    Now, I know this is based around multivariate time series analysis and tasks are to classify and cluster the data. I have gathered some materials (e-books, tutorials etc.) on this but still can't see a more detailed picture of how even I should start. Here's the tutorial that looks like it might be helpful but the thing is my data looks differently and I'm not really sure if this can be applied to my work.    So basically, my questions are:  How I can start on some very basic analysis? How to read data so it any meaning for me. Any tips and advises will be much appreciated! Note: I'm just the beginner in data science.


Link doesn't work after insert row in tablesorter

I have a problem with tablesorter. I delete rows without any problem, BUT when that row is a one that have been recently added, it doesn't work. I've been trying to solve this problem, but I can't.  This is my JS function:  $(function () {         $('table').tablesorter({ theme: 'blue', widthFixed: true, widgets: ["zebra", "filter"] });          $('#addbtn').click(function () {             var idCliente = $("#Cliente").find('option:selected').val();             var cliente = $("#Cliente").find('option:selected').text();             var idConcepto = $("#Concepto").find('option:selected').val();             var concepto = $("#Concepto").find('option:selected').text();             var idSeccion = $("#Seccion").find('option:selected').val();             var seccion = $("#Seccion").find('option:selected').text();             var idMes = $("#Mes").find('option:selected').val();             var mes = $("#Mes").find('option:selected').text();             var pesos = $("#pesos").val() == "" ? "0" : $("#pesos").val();             var dolares = $("#dolares").val() == "" ? "0" : $("#dolares").val();             if (!validarCarga(idCliente, idConcepto, idSeccion, idMes, pesos, dolares))                 return false;              $.ajax({                 url: '@Url.Action("Add")',                 type: 'POST',                 dataType: 'json',                 data: { idCliente: idCliente, idConcepto: idConcepto, idSeccion: idSeccion, idMes: idMes, pesos: pesos, dolares: dolares },                 success: function (resultado) {                     if (resultado != "") {                         var idPresu = resultado;                         var row = '
 	' + idCliente + '	' + cliente + '	' + seccion + '	' + concepto + '	' + mes + '	' + pesos + '	' + dolares + '
',                         $row = $(row);                         $('table').find('tbody').append($row);                         $('table').trigger('update');                     } else {                         alert(resultado);                     }                 }             });         });  $('img.remove').click(function () {         var c = confirm("Desea eliminar el presupuesto?");         if (c === false)             return false;         var $row = $(this);         var idPresupuesto = $(this).attr("Value");         $.ajax({             url: '@Url.Action("Delete")',             type: 'POST',             dataType: 'json',             data: { idPresupuesto: idPresupuesto },             success: function (resultado) {                 if (resultado === "OK") {                     var t = $('table');                     t.trigger('disable.pager');                     $row.closest('tr').remove();                     t.trigger('enable.pager');                 } else {                     alert(resultado);                 }             }         });     });     $('table').trigger("updateAll", true); });   This is how it looks like...


When they say that the universe cooled after the big bang, where did the heat go?

Layman here,  Stumbling through some physics stack posts and started reading the Wikipedia for the . In it, it states     The very earliest universe was so hot, or energetic, that initially no   matter particles existed or could exist except perhaps fleetingly, and   the forces we see around us today were believed to be merged into one   unified force. Space-time itself expanded during an inflationary epoch   due to the immensity of the energies involved. Gradually the immense   energies cooled – still to a temperature inconceivably hot compared to   any we see around us now, but sufficiently to allow forces to   gradually undergo symmetry breaking, a kind of repeated condensation   from one status quo to another, leading finally to the separation of   the strong force from the electroweak force and the first particles.   Where is the "immense energy" going to when it is "cooled"? Is there now no "immense energy"?


How could Lt. Hicox fluently speak German and then give himself away by using the wrong gesture?

In Inglorious Basterds, Lt. Hicox is an English officer who speaks German fluently yet with a mild accent. Speaking a language fluently requires a lot of practice with native speakers and so spending a lot of time with them. So I'd expect that he should know German culture well enough to not order "three glasses" with a wrong gesture (which was the key to the failure of his covert operation).  How is it possible that he speaks German fluently (and so had exposure to native German speakers) and then gives himself away by using the wrong gesture?


A cell phone company talking about the dangers of texting — irony or not?

There was a presentation at our school about texting and driving. It was held by AT&T, a cell phone company. Would it be considered ironic that a cell phone company is talking about the dangers of texting and driving?  If so, which type of irony is this?


How to center an image on another image in HTML

How can I position  the 02.png   to the center  of the 01.png? For 1 layer.


When there is no space in comparison, it outputs wrong. I'd like to know why. #!/bin/bash  VAR2=2  if [[ $VAR2 = 1 ]]; then     echo "10a: \$VAR2 is 1." else     echo "10b: It's not 1." fi  if [[ $VAR2=1 ]]; then     echo "11a: \$VAR2 is 1." else     echo "11b: It's not 1." fi  This outputs: 10b: It's not 1. 11a: $VAR2 is 1.


I have process id 1234. This process contains thread id 1235. When I use ls -l /proc I see only the pid (1234) but when I open the thread status file using cat /proc/1235/status I can see data. Why is that? Can I access with C code directly with tid? /proc/1235/mem without knowing the process id?


Internet speed getting slower over time on MBP

Recently I've noticed that internet speeds on my MBP 2018 (Mojave 10.14.4) are decreasing with time. For example, after a day it will go from 100 MB to 60 MB and it will continue to decrease. The plot below shows download speeds sampled every 15 minutes over the course of ~3 days.    A few things:   This is not my ISP, since it works perfectly on other devices.  After restarting the computer, it goes back to the maximum speed and countdown starts again. It is both for wi-fi and ethernet. Logging out and back in doesn't fix the issue. There is no software that runs in the background and utilizes that bandwidth. Network diagnostics don't show anything. Trying iperf between Mac and PC over Ethernet and WiFi, gives same low numbers as on Mac. Speedtest on PC is OK. Running Speedtest from Parallels Ubuntu VM also yields low download speeds. For Ethernet, I am using Belkin HD dock.   Would appreciate any help or guidelines on how to debug this issue.


I am working on a digital voltmeter circuit using ICL7107 IC. Having trouble powering it up. There is a -5 V supply to pin 26. I used a 7805 regulator for +5V supply but wondering how to supply the -5V. a) Can I use the output of 7805 to somehow convert to negative? b) is there an IC for this?( my max current rating is 3.34Amps).  Note: I tried using 7905 with 7805 but no use the 7805IC goes burning hot. As soon as I removed the connections between two it behaved properly(only7805). Please suggest some idea to achieve this.


What is a word for someone whose emotions are not hurt easily? I'm looking for something more specific than 'robust' and 'stable'.


Is the Converse of the Cayley-Hamilton Theorem true or not?

I was thinking about taking the Cayley-Hamilton Theorem in the opposite direction. Does this hold : If for $F\in$ End$(V)$ $\exists P\in K[t]$ such that $P(F)=0$ then  $P$ is the characteristic polynomial of $F$ ?  If not could you give a counterexample?


I came across the following exercise on asymptotic behavior of integrals: $$I(a) = \int_0^\infty\frac{\cos x}{x^a} \, dx, \text{ where } a\to0^+.$$ I have tried integrating by parts or replacing $\cos x$ with the first summands of its Taylor series, but I end up with something equal to infinity (independent of $a$ and that is not what we want).  I just thought about the substitution $x \leftrightarrow\frac{1}{1+x^2}$ and I get the  following result:  $$I(a) = \frac{\cos(1/2)}{2^{2-a}} + \int_0^1\frac{2x^3 \cos\left(\frac{1}{1+x^2}\right)}{(1+x^2)^{3-a}} \, dx - \int_0^1 \frac{2x^3\sin\left(\frac{1}{1+x^2}\right)}{(1+x^2)^{2-2a}}\,dx$$ If I could prove that the last summands are $o(I(a))$ then it would be OK, but I think, in general my strategy won't work. Apparently this is supposed to be an easy exercise, but I can't come up with anything right now.


Number of points in the fibre and the degree of field extension

Let $X,Y$ be varieties over $\mathbb{C}$, $k(X), K(Y)$ be function fields of $X, Y$. Suppose $\pi: X \to Y$ is a dominant,  $\textit{injective}\ $ morphism, why the degree of the function field extension $[K(X) : K(Y)] =1$?  If $\phi : X \to  Y$ is a finite morphism, then the fibre is finite, and by semicontinuity theorem, let $n$ be the number of the points in the generic fibre, then I feel one should similarly have $[K(X) : K(Y)] =n$. But I don't know how to show that. Any suggestions or reference on this question?  $\textbf{Edit}$: I really want the morphism $\phi$ to be a morphism between locally finite type and finite morphism. To be precise, for any affine open set $U=\rm{Spec}(B) \subset Y$, there is an affine open over of $\pi^{-1}(U)$, such that each $\rm{Spec}(A_i)$ in this cover has the property $A_i$ is a finitely generated $B-$module. I don't know the corresponding definition of this sort of morphism, or is it just a finite morpism?


Why is velocity of the mass $v/ \cos θ $? Why not $2v \cos θ$?

If we call the velocity of the mass $u$, then we can say: $u \cos θ = v$ and hence $u= \frac v{\cos θ}$. But why can't we write  $v \cos θ= u$ and add the contribution from both of the strings: $u= \frac{2v}{\cos θ}$ ? Why is it only $u= \frac v{\cos θ}$? Please note that it is not a homework based  question. I just want someone to solve the doubt arising in my mind.


A senior developer on my team tells me that writing SQL commands like this is safe "because it's parameterized", but I don't see how

I'm writing some CRUD functions for media associated with certain products. To delete many records, I've been told to write the query as follows:  dataContext.ExecuteCommand("DELETE FROM ProductMedia WHERE ProductId = {0}", productId);   He says this is safe from SQL injection because it's 'parameterized'. I don't agree, but I also don't know a better way.  How do you protect from SQL injection when writing commands in this way?


This questions has already been asked a million times, but nothing solved my issue so far.  Situation   I'm using Blender 2.72b.  I'm not using nodes, just the plain old vanilla settings. But apparently I messed them up somehow. I'm using the Mirror modifier. I'm completely new to blender (and 3D modelling in general) and use it for a couple of days now. I deleted the cube and made this model from scratch (no import).   In texture view everything looks fine:   In material view (and after rendering) everything is black:   Attempts to solve   I have a light source. I have a camera. I have no ceiling. I have a material. I have a texture. Shadows are activated. I tried using nodes and my output was well connected - no change, still black, so I stopped using nodes again (I had no idea what I was doing anyway). I checked out many solutions posted on the web.   As my last attempt, I opened the vanilla start-up file again. Everything works fine with the cube. So I compared the material und texture settings step by step. It all seems the same. This topic is so extraordinary complex and I'm so bloody inexperienced that I'm stuck at this point.


How to incorporate QGIS custom widgets into plugin?

Developing a plugin with Qt Designer for QGIS 2.14.1-Essen on Windows 7 and having trouble inserting the QgsCollapsibleGroupBox widget. I receive the following error:     ImportError: No module named qgscollapsiblegroupbox   I put from qgis.gui import QgsCollapsibleGroupBox into my main.py file but it still doesn't recognise it. Only post I found which mentioned this error is  but not exactly sure how to install this qgis_customwidgets.py file.   I would like this plugin to be transferred to other computers but would like to avoid having to install this file each time (if it is indeed required).  Is there another way to use this type of widget or perhaps a method to save the qgis_customwidgets.py into my plugin directory and just call the module?


Does anyone now how to add a group layer with Python in ArcGIS Desktop 10?  I can use arcpy.mapping.AddLayer but surely this is only for an actual layer as opposed to a group layer.  so far I have this  import arcpy mxd = arcpy.mapping.MapDocument("CURRENT") df = arcpy.mapping.listdataframes(mxd, "layers")[0] arcpy.mapping.AddLayer


From the Faraway Tree     They showed him the bed he was to sleep on.   And     Dick peered in at his window and saw the big owl asleep on a bed.   Considering this answer what context should I understand by the above sentence?


I ran into some problems installing a package with apt. The terminal hung up during an install and I saw no other choice but to close the terminal. The problem, however, is that I can't seem to solve the issues that this has caused.   As is typical, I get:  E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?   This gets me nowhere and I'm locked out until I run sudo dpkg --configure -a. Makes sense. However, this process spits the following out and then hangs on the last line:  Setting up virtualbox-dkms (5.2.10-dfsg-6) ... Removing old virtualbox-5.2.10 DKMS files...  -------- Uninstall Beginning -------- Module:  virtualbox Version: 5.2.10 Kernel:  4.15.0-23-generic (x86_64) -------------------------------------  Status: This module version was INACTIVE for this kernel. depmod...  DKMS: uninstall completed.  ------------------------------ Deleting module version: 5.2.10 completely from the DKMS tree. ------------------------------ Done. Loading new virtualbox-5.2.10 DKMS files... Building for 4.15.0-23-generic Building initial module for 4.15.0-23-generic   A typical solution I've read is that you need to fix the broken packages. When I try to fix the broken packages (sudo apt install -f), the system also hangs on the same line, although the output is different:  Reading package lists... Done Building dependency tree        Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 3 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up virtualbox-dkms (5.2.10-dfsg-6) ... Removing old virtualbox-5.2.1  0 DKMS files...  ------------------------------ Deleting module version: 5.2.10 completely from the DKMS tree. ------------------------------ Done. Loading new virtualbox-5.2.10 DKMS files... Building for 4.15.0-23-generic Building initial module for 4.15.0-23-generic   I am unable to get out of it unless I kill the process. This I do by checking what is currently running related to apt (ps aux |grep apt), and then I kill the relevant processes with sudo kill -9 process_number_here.  If I try to run things after that, it tells me I still need to reconfigure dpkg.  I tried looking around for more solutions to dpkg and all I really see is the nuclear option:  sudo rm /var/lib/dpkg/lock sudo rm /var/cache/apt/archives/lock sudo rm /var/lib/apt/lists/lock   I also delete the files in /var/lib/dpkg/updates because when I did some digging one of the files inside had the exact same text as the above long output... but I fully admit to being out of my league here and I don't know what to do.   Taking a look at the error messages, I recognize that it hangs on building something related to the kernel. But I have no idea where to even start solving that. Any help is appreciated. My system is ubuntu 18.04


What's needed for a complete backup system?

For my new server, I want to setup a proper backup solution. I've found a great setup that will do twice-daily incremental backups via Dropbox. I plan on backing up my various databases, the webroot directory, the /etc directory/repository, and /var/log.   What else do I need to know to do a proper backup, and what is the standard setup here to ensure you can quickly restore from a backup in the case of a system failure?  I'm thinking of using Puppet, as it describes how the system should be. My restore procedure would look like this:   Install Puppet Run my puppet config Restore my backups from Dropbox (Should I create a script to do this? Probably)   This should also let me create a clone of my production server for use in dev environments, correct? Am I missing anything of importance?