How do you prove ${n \choose k}$ is maximum when $k$ is $ \lceil \tfrac n2 \rceil$ or $ \lfloor \tfrac n2\rfloor $?

How do you prove $n \choose k$ is maximum when $k$ is $\lceil n/2 \rceil$ or $\lfloor n/2 \rfloor$?  This  provides a proof of sorts but it is not satisfying. From what I understand, it focuses on product pairings present in $k! (n-k)!$ term which are of the form $i \times (i-1)$. Since these are minimized when $i=n/2$, we get the result. But what about the reasoning for the rest of the terms?


I am new to 'drawing' in LaTeX with pgfplots, tikz, etc. I am trying to plot a Poisson distribution with varying means. Here is what I have tried (based on )  \documentclass{article} \usepackage{pgfplots} \pgfmathdeclarefunction{poiss}{1}{%   \pgfmathparse{(#1^x)*exp(-#1)/(x!)}% } \begin{document} \begin{figure} \begin{tikzpicture} \begin{axis}[every axis plot post/.append style={   mark=none,domain=0:20,samples=20},   axis x line*=bottom,   axis y line*=left,   enlargelimits=upper]   \addplot {poiss(1)};   \addplot {poiss(2)};   \addplot {poiss(3)}; \end{axis} \end{tikzpicture} \end{figure} \end{document}   What happens next is very strange to me; if I plot this with domain=0:20,samples=20, it looks like the following:    However, if I change domain=0:10,samples=10, it looks like the following:    You can see that the higher mean distributions are 'taller' than they should be, depending on the number of samples; the larger the number samples, the more correct the distributions look but obviously a graph going from 0 to 50 on the x-axis with nothing interesting after 10 is no good!  I'm wondering why is this happening, and how can I fix it? Forgive me if it's something painfully obvious. Thanks.


Example for Fourier transform in $C_b^0$

$C_b^0(\mathbb{R})=\{f\in C(\mathbb{R}),\lim\limits_{|x|\to\infty}f(x)=0\}$  So can we construct an function in $C_b^0(\mathbb{R})$ such that it's Fourier transform is not in $L^1(\mathbb{R})$?  What kinds of sufficient property does it have?


Debugging ERROR 000358: Invalid expression from SelectLayerByAttribute?

I'm creating a script tool and using the SelectLayerBy Attribute function (below),   arcpy.SelectLayerByAttribute_management("cities_lyr", "NEW_SELECTION", '"CRIME_INDX" <= 0.02')   However, I keep getting this error - ERROR 000358: Invalid expression.  Can anyone please offer some clarity here.


I have two backup directories (dir1 and 2) on two different (local) HDDs and I want to create one of them. How can I really sync their contents so that both directories will have the same contents?


Getting repository will not be vaild error when running sudo apt update

Just install Ubuntu 18.04, when I run the command sudo apt update, it shows the below error:  sudo apt update Hit:1 http://linux.teamviewer.com/deb stable InRelease Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]     Hit:3 http://sg.archive.ubuntu.com/ubuntu bionic InRelease                      Get:4 http://sg.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]    Get:5 http://sg.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB] Reading package lists... Done       E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 7h 31min 57s). Updates for this repository will not be applied. E: Release file for http://sg.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 7h 32min 53s). Updates for this repository will not be applied. E: Release file for http://sg.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 7h 34min 12s). Updates for this repository will not be applied.   Does any one know what causes this problem and how to resolve it?


Why does the i386 version of software get installed on an x86_64 system?

Why does the i386 version of most software get installed, along with the x86_64 version, on a CentOS 64-bit system?  # yum install php-xml Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Setting up Install Process     Package php-xml-5.3.12-5.el5.art.x86_64 already installed and latest version     Package php-xml-5.3.12-5.el5.art.i386 already installed and latest version     Nothing to do


I'm a systems admin for a company and was thrown into a horribly configured server. In the midst of my refactoring I was adding users to my /etc/sudoers file. I seem to have accidentally removed my server admin account from the sudoers file access.  I know what I did wrong (i accidentally commented out the %admin line) question being, how can I reinstate my server admin access in the file without having to restart anything.   Here's how it looks right now:  ## ## User privilege specification ## root ALL=(ALL) ALL #%admin  ALL=(ALL) ALL %superuser ALL=(ALL) ALL "user1" ALL=(ALL) ALL "user2" ALL=(ALL) ALL   Also note that my users do not have permission for sudo for some reason:  Realtor-Station-3-27:~ user1$ sudo -i  WARNING: Improper use of the sudo command could lead to data loss or the deletion of important system files. Please double-check your typing when using sudo. Type "man sudo" for more information.  To proceed, enter your password, or type Ctrl-C to abort.  Password: user1 is not in the sudoers file.  This incident will be reported. Realtor-Station-3-27:~ user1$


I have two content types: Person and Office with existing content. The Person content type has an entity reference field to Office nodes, which only allows a single reference. I need to change this to allow an unlimited number of Office nodes to be selected.  Drupal 8 prevents changing the cardinality of the field, and it gives the following error message.     There is data for this field in the database. The field settings can no longer be changed.   At first, I thought I needed to write a migration, but they seem to be aimed at bringing data into a Drupal instance. Then, I read about writing  (also ).  I discovered a migrate-plus plugin that adds a couple pages me to export the field storage settings, change the cardinality, and re-import the settings. Given that I'm going from cardinality of 1 to unlimited, I could imagine this change wouldn't destroy data. And my empirical data suggests this is the case. I've now made this change via the migrate-plus screens as well as via configuration export and import and the data is still in the field.  Is this a safe operation, or should I write an update function?


I'm asking about some advice on what to read on the following subjects:  I think that, in order to be able to start thinking or talking about anything, some grand constructs are already present, the nature of which must be examined before everything else. For example, we can articulate sentences with stable meaning, and remember it as the discussion proceeds. How is this possible? I think it is not at all obvious that it should be so. Everything could vanish the next second. How can stable things exist in general, in the material and mental world? How does the evolution of consciousness, if it exists, relate to the above?


How does one prove that $n^2 (n^4 - 1)$ is divisible by 60 for any positive integer $n$? I tried mathematical induction method without success so far.


Why is this argument incorrect for the Envelope Paradox

Consider the envelope paradox problem:     There are two envelopes both of which contain some money. One envelope contains twice the amount of the other (but other than that, you do not know how much is in them). You select one of the envelopes randomly and see the amount of money inside.   You can opt to either keep the money in this envelope, or switch envelopes, which do you choose?   A (false) argument for switching envelopes:     Let the amount of money in the envelope you selected be $X$.   There is a $50\%$ chance that the envelope with more money is selected, and a $50\%$ chance that the envelope with less money is selected.   Therefore, there is a $50\%$ chance that there is $0.5X$ in the other envelope, and a $50\%$ chance that there is $2X$ in the other envelope.   So the expected payout for switching is ${2X + 0.5X\over2} = 1.25X$ which is better than the payout of $X$ for not switching.   Therefore you should switch.   This argument is wrong... where exactly does it fall?


Start Steam in Offline Mode Without an Internet Connection

I need to start Steam in offline mode without first logging in and without having an Internet connection. I know there are already questions like this, but there are no decent answers that I can comprehend. Is there just a simple way to do it?  It's not a duplicate of the other question because that's not my problem. Read both questions fluently. He has possible connection to the Internet, I don't. Also, his question is 4 years out of date.


I defrosted a package of unopened sealed ribs outside for an hour and a half because I was short on time. I did not think it would be a problem, but after reading all the different posts, I am a little concerned. The package was sealed, so are they okay to eat? i rinised them and salted them and they are in the oven...


I tried installing citrix as specified in link below    However, as per the last section of the link, KNOWN ISSUES, I am facing too the same issue, i.e., Citrix APPs windows displayed with empty graphics.  Since, I also login using other OS, I know the the Citrix apps windows which opens up in UBUNTU OS, is correct ( comparing the dimensions of the empty window), however, I am unable to view any graphics. In Plain english, the app window which opens up is empty, transparent and with out any control to display. However, actions like right click double click etc works , but all popup windows within this app is empty too.  I know I can always change to older version, however with older version, I have issues with cursor on the Citrix apps as it keeps on jumping and at times it needs too much patient to work with flickering and jumping mouse all over the screen.  Did someone tried to install Citrix Receiver 13.1 on Ubuntu 14.04 with some tweaks to overcome the empty window issue.


Can't start a virtual machine with VirtualBox

I'm using Ubuntu 17.10. I installed VirtualBox but I have this message when I start it    I executed sudo apt-get install virtualbox-dkms and sudo apt-get install linux-headers-generic, and it says that they were already installed, but that message keeps showing when I run VirtualBox.  I created a virtual machine in VirtualBox, and when I want to start it, I get the following messages     Can someone tell me how can I solve this?


I am trying to compare the performance of boost::multi_array to native dynamically allocated arrays, with the following test program:  #include <windows.h> #define _SCL_SECURE_NO_WARNINGS #define BOOST_DISABLE_ASSERTS  #include <boost/multi_array.hpp>  int main(int argc, char* argv[]) {     const int X_SIZE = 200;     const int Y_SIZE = 200;     const int ITERATIONS = 500;     unsigned int startTime = 0;     unsigned int endTime = 0;      // Create the boost array     typedef boost::multi_array<double, 2> ImageArrayType;     ImageArrayType boostMatrix(boost::extents[X_SIZE][Y_SIZE]);      // Create the native array     double *nativeMatrix = new double [X_SIZE * Y_SIZE];      //------------------Measure boost----------------------------------------------     startTime = ::GetTickCount();     for (int i = 0; i < ITERATIONS; ++i)     {         for (int y = 0; y < Y_SIZE; ++y)         {             for (int x = 0; x < X_SIZE; ++x)             {                 boostMatrix[x][y] = 2.345;             }         }     }     endTime = ::GetTickCount();     printf("[Boost] Elapsed time: %6.3f seconds\n", (endTime - startTime) / 1000.0);      //------------------Measure native-----------------------------------------------     startTime = ::GetTickCount();     for (int i = 0; i < ITERATIONS; ++i)     {         for (int y = 0; y < Y_SIZE; ++y)         {             for (int x = 0; x < X_SIZE; ++x)             {                 nativeMatrix[x + (y * X_SIZE)] = 2.345;             }         }     }     endTime = ::GetTickCount();     printf("[Native]Elapsed time: %6.3f seconds\n", (endTime - startTime) / 1000.0);      return 0; }   I get the following results:  [Boost] Elapsed time: 12.500 seconds [Native]Elapsed time:  0.062 seconds   I can't believe multi_arrays are that much slower. Can anyone spot what I am doing wrong?  I assume caching is not an issue since I am doing writes to memory.  EDIT: This was a debug build. Per Laserallan's suggest I did a release build:  [Boost] Elapsed time:  0.266 seconds [Native]Elapsed time:  0.016 seconds   Much closer. But 16 to 1 still seems to high to me.  Well, no definitive answer, but I'm going to move on and leave my real code with native arrays for now.  Accepting Laserallan's answer because it was the biggest flaw in my test.  Thanks to all.


My laptop is filled with viruses and Windows XP is just becoming impossible to work with.   I've been interested in Ubuntu for a while, so, would I be able to use something like Debian to clear my HDD and OS and then install Ubuntu and start fresh?


How to typeset the limit of a sequence like so?

I want to write this:    I tried with $x_n \to_{n \to 0} 0$ but the $n \to 0$ doesn't go under the right arrow, it goes under but on the right, and I want it under but in the center, as in the picture above.


Online course on theoretical electrodynamics

I'm looking for good online course for an introduction into theoretical electrodynamics. However, it seems that the MIT opencourseware only contains partial lectures for this topic.  Has anyone got a recommendation for me?


Prove that the square root of a positive integer is either an integer or irrational

Is my proof that the square root of a positive integer is either an integer or an irrational number correct?  The proof goes like this:  Suppose an arbitrary number n, where n is non-negative. If $\sqrt{n}$ is an integer, then $\sqrt{n}$ must be rational. Since $\sqrt{n}$ is an integer, we can conclude that n is a square number, that is  for some integer a.  Therefore, if n is a square number, then $\sqrt{n}$ is rational.  Suppose now that n is not a square number, we want to show that the square root of any non-square number is irrational.  We prove by contradiction. That is, we suppose that the square root of any non-square number is rational. So $\sqrt{n} = \frac{a}{b}$, where $a,b \in Z^+, b \neq 0$. We also suppose that $a \neq 0$, otherwise $\frac ab = 0$ , and n will be a square number, which is rational.   Hence $n = \frac {a^2}{b^2}$, so $nb^2 = a^2$.    Suppose $b=1$. Then $\sqrt n = a$ , which shows that n is a square number. So $b \neq 1$. Since $\sqrt n > 1$, then $a>b>1$.  By the unique factorization of integers theorem, every positive integer greater than $1$ can be expressed as the product of its primes.  Therefore, we can write $a$ as a product of primes and for every prime number that exists in $a$, there will be an even number of primes in $a^2$. Similarly, we can express $b$ as a product of primes and for every prime number that exists in $b$, there will be an even number of primes in $b^2$.  However, we can also express $n$ as a product of primes. Since $n$ is not a square number, then there exist at least one prime number that has an odd number of primes.  Therefore, there exists at least one prime in the product of $nb^2$  that has an odd number of primes. Since $nb^2=a^2$ , then this contradicts the fact that there is an even number of primes in $a^2$ since a number can neither be even and odd.  Therefore, this contradicts the fact that $\sqrt n$ is rational. Therefore, $\sqrt n$ must be irrational.  Is this sufficient? Or is there any parts I did not explain well?


How to compute quantile of a mixed distribution?

A mixed distribution where cumulative probability distribution function (CDF) is given by G(x)= (1-p)H(x)+pF(x)  where, p=0.2 (assumed in this case as it ranges from 0-1),  H(x)= 0 when x=0 else 1, and  F(x) is a two-parameter gamma distribution.  How can I get quantiles for y =c(0.2,0.5,1) for a given gamma parameters say shape=3.5 and scale=1.5 ? Note: I triedqgamma(y, shape, rate=scale, lower.tail = TRUE,log.p = FALSE) for gamma distributions only but I am not able to incorporate for the first term in the given CDF.


Step in proof of $\sum_{n=1}^{\infty} \frac{1}{n^4} = \frac{\pi^4}{90}$

How was $\pi^4/90$ calculated here in the answer?   Attempt:  We have that $c_0=\pi^2/3$ and $|c_{\pm k}|^2=4/k^4$ thus $|c_k|^2=|c_{\pm k}+c_0|^2\ ?$  Or what should I put in the $|c_k|^2$ here $\sum_{k=-\infty}^\infty |c_k|^2\ $?  Thanks in advance for your help.  Answer (By Christian Blatter user)  Consider the function $f(t):=t^2\ \ (-\pi\leq t\leq \pi)$, extended to all of ${\mathbb R}$ periodically with period $2\pi$. Developping $f$ into a  Fourier series we get $$t^2 ={\pi^2\over3}+\sum_{k=1}^\infty {4(-1)^k\over k^2}\cos(kt)\qquad(-\pi\leq t\leq \pi).$$ If we put $t:=\pi$ here we easily find $\zeta(2)={\pi^2\over6}$. For $\zeta(4)$ we use Parseval's formula $$\|f\|^2=\sum_{k=-\infty}^\infty |c_k|^2\ .$$ Here  $$\|f\|^2={1\over2\pi}\int_{-\pi}^\pi t^4\>dt={\pi^4\over5}$$ and the $c_k$ are the complex Fourier coefficients of $f$. Therefore $c_0={\pi^2\over3}$ and $|c_{\pm k}|^2={1\over4}a_k^2={4\over k^4}$ $\ (k\geq1)$. Putting it all together gives $\zeta(4)={\pi^4\over 90}$.


Prove that if $x$ is odd then $x^2 -1$ is divisible by $8$.

If $x$ is odd then prove that $x^2-1$ is divisible by $8$.   I start by writing: $x = 2k+1 $  where $k\in\mathbb{N}$.  Then it follows that: $(2k+1)^2 -1 = 4k^2 +4k + 1 -1 $    Therefore: $$\frac{4k^2 +4k}{8} = \frac{k(k+1)}{2}$$  At the end part I can see that for what $k$ is, the number on top is divisible by 2. I was expecting the end result to be a number, not a fraction. Or is it "divisible" from the definition $\text{even} = 2k$ that completes the proof?


How to check the md5sum and sha256sum of a directory (an entire folder)?

In the terminal it's easy to find the md5sum of a single file, but how about for an entire directory? And would the same apply to sha256sum?


i tried to prove that $2^{44} \equiv 1\pmod{89}$. I noticed that by Fermat's little theorem $2^{88} \equiv 2^{44}\cdot 2^{44} \equiv 1\pmod{89}$ which means that $2^{44}$ is the inverse of itself $\rightarrow 2^{44} \equiv 1 \pmod{89}$ or $2^{44}\equiv 88 \pmod{89}$. how can I rule out the second option?


Simple tikz `\draw` -| fails when the points are exchanged, why is that?

Here is the MWE :      \documentclass[border=2pt]{standalone}     \usepackage[utf8]{inputenc}      \usepackage{pgfplots} %pour Tikz et pgfplot     \usetikzlibrary{positioning} % pour le positionnement relatif      \begin{document}     \begin{tikzpicture}[thick]         \node (start) at (0,0) {} ;         \coordinate (top) at (1,1) ;         \coordinate (bottom) at (1,-1) ;         \coordinate (join) at (3,0) ;         \draw (top -| join) -- (join);         %\draw (join) -- ( top -| join );      \end{tikzpicture}     \end{document}   You can check that if you uncomment the last \draw compilation fails. You'll get :   Package pgf Error: No shape named join is known.   And my question is why ? When the line above is the same with the point exchanged  Answer : remove the space join like so :      \draw (join) -- ( top -| join);    and it works...


Can't change txt files to open with anything but WordPad

I want to change txt files to open with a specific .xls  it used to work but for some reason now it won't save anymore when I set the .xls program as the default. It's a serious pain to have to open each txt manually and change it to xls. I want them to just all open with this spreadsheet program instead of WordPad again. I have Windows 10 x64.


Dual Canadian/UK citizen living in Canada. Going to work as a musician in UK for 3 weeks

Which passport do I present to the (Canadian) airline? Canada now insists that Canadian citizens fly with a Canadian passport. Presumably I need to show my UK passport to work legally in the UK. Can I travel on the Canadian passport and show the UK one to the UK Immigration agent, or will that cause confusion and delays?


Is there a way that you can get WMIC to prompt you for a node name each time? I will be running a similar command for different machines on different occasions.  I.e. to get a remote computer model.  I would like to run the WMIC as a BAT file which then prompts for a node name?  wmic /node:"PROMPT computersystem list brief /format:list   Thanks, Shane


Is there a way of reducing the dims of a tensor(numpy array) that has zeros on multiple axis?


I am using ffmpeg to cut out a section of a large file like this: ffmpeg -i input.wmv -ss 60 -t 60 -acodec copy -vcodec copy output.wmv  The -ss part works fine but the -t is ignored. It correctly removes the initial specified seconds specified with -ss but then keeps going to the end of the input with the copy. Is there a way to use ffmpeg to cut off the end of a video without recoding it?


Binomial response and logit link function in GLM (r)

First I'm a little bit confused with the assumptions of a model with binomial response and logit link function. Since it is basically a logistic regression. Today one of my professors told me that I had to prove normality of my residuals, but of what I know the assumptions are:  First, binary logistic regression requires the dependent variable to be binary and ordinal logistic regression requires the dependent variable to be ordinal.  Second, logistic regression requires the observations to be independent of each other.  In other words, the observations should not come from repeated measurements or matched data.  Third, logistic regression requires there to be little or no multicollinearity among the independent variables.  This means that the independent variables should not be too highly correlated with each other.  Also these are the plots I have:     So basically my question is: what assumptions can I prove/not prove with these plots?


Seagate 3TB ST3000DM001 hard shows " Unallocated" after connected via motherboard

I got a 3TB ST3000DM001 Hard. I formatted it using USB interface (SATA to USB3), then I copied my files to it.  Now, when I install the hard into my case using regular motherboard SATA connector it showed "Unallocated". I tried the USB interface again and it showed my files and everything as expected.  How can I fix this?  Note: When I formatted using the USB interface I used "Minitool Partition", and made 1 Logical partition 2794.52GB since I'll use it for storage.


I have the following tex file :  \documentclass[12pt,a4paper,twoside]{report} \usepackage{mathtools} \usepackage{amsmath} \usepackage{amsthm} \usepackage{listings} \usepackage{color} \definecolor{dkgreen}{rgb}{0,0.6,0} \definecolor{gray}{rgb}{0.5,0.5,0.5} \definecolor{mauve}{rgb}{0.58,0,0.82} \lstset{   language=Java,   aboveskip=3mm,   belowskip=3mm,   showstringspaces=false,   columns=flexible,   ={\small\ttfamily},   numbers=none,   numberstyle=\tiny\color{gray},   =\color{blue},   commentstyle=\color{dkgreen},   stringstyle=\color{mauve},   breaklines=true,   breakatwhitespace=true,   tabsize=3 } \begin{document} \begin{lstlisting}[caption={Third median in terms of $\theta$ and $\phi$},label={lst:f4}] p, t= var('p t')  a=(-2*p*t^2-p^2*t)+(2*t*p-p^2)+t+1  b=(p*t^2+2*p^2*t)+(2*t*p-t^2)-p+1  c=(p*t^2-p^2*t)+(t^2+2*t*p+p^2)+t-p #3 sides (a,b,c) in terms of theta and phi expand(2*a^2+2*b^2-c^2) #third median equation, m=1/2*sqrt(2*a^2+2*b^2-c^2)         9*p^4*t^2 + 18*p^3*t^3 + 9*p^2*t^4 + 6*p^4*t + 18*p^3*t^2 - 18*p^2*t^3 -          6*p*t^4 + p^4 - 22*p^3*t + 6*p^2*t^2 - 22*p*t^3 + t^4 + 2*p^3 - 6*p^2*t          + 6*p*t^2 - 2*t^3 - 3*p^2 + 18*p*t - 3*t^2 - 4*p + 4*t + 4 \end{lstlisting}  \end{document}   I want to change the font of the listings to be smaller, probably \tiny. Can anyone guide me how to do it.


So I know that if you increase the voltage across a wire then the current will increase. But an increase in current leads to a increase in heat production though $P=I^2R$, but as the temperature increase the vibrations of the metal ions increase and so the current is more restricted implying the resistance increases. But as the resistance has increased, the heating has increased again and this will go in a cycle leading to infinite resistance and heat production so where am I going wrong?


The icon between settings and lock-screen in Gnome3 is acting abnormally?

Whenever I click on that 'lock' icon, it just freezes my screen for a few moments then everything gets back to normal. I have recently upgraded to Ubuntu 18.04 from 16.04 and I vaguely remember that in 16.04 it used to log me out.


How many subsets does the set $\{1, 2, \dots , n\}$ have that contain no two consecutive integers if $1$ and $n$ also count as consecutive?

How many subsets does the set $\{1, 2, \dots , n\}$ have that contain no two   consecutive integers if 1 and n also count as consecutive?   It looks that the number of such subsets obeys the (Fibonacci-style) formula $$ F(n) = F(n-1)+F(n-2) $$ with $F(0)=1$ and $F(1)=2$, but I wasn't able to prove this conjecture.


Find a real function $f:\mathbb{R}\to\mathbb{R}$ such that $f(f(x)) = -x$?

I've been perusing the internet looking for interesting problems to solve. I found the following problem and have been going at it for the past 30 minutes with no success:     Find a function $f: \mathbb{R} \to \mathbb{R}$ satisfying $f(f(x)) = -x$ for all $x \in \mathbb{R}$.   I am also wondering, can we find $f$ so that is continuous?  I was thinking of letting $f$ be a periodic function, and adding half the period to x each time. I had no success with this, and am now thinking that such a function does not exist.  Source:


Replacing 3-way switch in 4-way circuit with an occupancy switch - not working correctly

I'm trying to replace one of the 3-way switches in a 4-way switch circuit with a 3-way occupancy sensor.  Here's my current wiring for the occupancy sensor:  And here's the current wiring for the other 3-way switch   I haven't touched the 4-way switch.  Before I changed any wiring, the black screw on both 3-way switches was connected to the black wire.  Here is the current behavior of the circuit:  When occupancy sensor is OFF:   4-way switch does not function If the 4-way switch is in the OFF position:   3-way switch does nothing  If the 4-way switch is in the ON position:   3-way switch works, but only if I switch it slowly. If I switch rapidly, it only works every other time the switch changes.    When occupancy sensor is ON:   3-way switch works properly When the 4-way switch is switched, the lights flicker off while the switch is in between positions.   Any thoughts on what I've screwed up with my wiring?


How to read the current terminal content programmatically?

Is there a way to read the current terminal content (visible window, or full buffer, whatever it's easier) programmatically?  I need this because I'm trying to develop a program which, after executing an arbitrary command, works with its output. I stress after - I know pipes are used for this, but the purpose of the program is avoiding that.  A possible solution would be a combination of a programmatic Select all followed by an xsel invocation, although I don't know any way to perform the first operation [in Gnome Terminal].


Is Area51 login broken? I tried to sign up today and this happened:    Unable to log in with your OpenID provider:  An unexpected error occurred while logging in. It's not you, it's us. This is our fault. Detailed information about this error has automatically been recorded and we have been notified.   To clarify, this is happening as soon as I click either the sign up or the log in buttons. I never get asked if I want to log in with OpenID (I don't; I don't even have an OpenID), nor do I have any other way of influencing the outcome.


I'm trying to write a query which will return a boolean value if there exists any user which has this specific role.  For example is there any user hwo's role is 'role1'  This is how far i got   SELECT CASE WHEN EXISTS  (SELECT --'Here i don't know how to select all user's which have a specific role'--    ) GO   And if it's possible to check user's from only one database .


I have a laptop without a numeric keypad on which I'm running Ubuntu 12.04, and I very much enjoy playing roguelike games. Such games tend to require a numpad for movement, targeting, &c., as one is able to operate in the eight cardinal directions. To get around the limitation of not having a numpad, I would like to be able to bind a key combination, for example Shift + Left Arrow to another key, in this case 1; unfortunately, my research so far has only turned up how to bind a key combination to a command. I'm sure there's something blaringly obvious that I'm missing, but as for what it is ... Any help would be greatly appreciated!


In a table how can you disable the padding between tr's and td's? I have tried setting padding to 0.


So I have a lot of partitions on my computer. (came partitioned with the backup and then windows 10 created more). I just installed Linux on my dual boot. I can run both Windows 10 and Linux perfectly. The issues is this though. In order to install from USB I had to boot legacy. Now when I boot legacy I see the grub menu and it has Linux and some Windows 10 restore partitions but not the actual windows 10 os. In order to switch between the two I have to go into bios click boot to UEFI first and then windows. Boot into legacy first boom Linux. Anyone know how to fix this so that Grub shows both.  The grub that I installed was part of the linux install.  I know there are multiple dual boot topics but i haven't seen one mentioning legacy and UEFI and i am not sure if that is what is messing me up.


Scenario: If I had a Custom Profile / Standard Profile, say Sales,and I have 50 Users assigned to the same Profile and had same Permission / Access on a particular object (Could be Standard or Custom Object), if I were to Hide a Field ONLY TO ONE USER, which would be  a better Solution to achieve this WITHOUT EDITING OR TOUCHING THE PROFILE??  Option 1: Create a Custom Profile for this particular User and give CRED access (I know this one isn't a good solution as I got a Thumbs-down from a Technical Architect)  Option 2: Create a Permission Set - Go to the particular Object,say, Accounts, Object Permission Enabled -->Field Permissions-->Remove READ Access - This would make this particular field hidden from the Object to the Profile. Then Assign this Permission to particular User whom I don't want to see this field.  I would go with the 2nd option but I still hear a groan. Where am I going wrong? How would you hide a particular field from ONE User out of 10 Profiles who have the same Access Rights?  What's the best possible solution to hide a Filed from only one User out of 10 Users who have the same Profile.


Proving if $x<y$ then $\sqrt{x} < \sqrt{y}$

I am stuck on this homework problem!  Prove that if $x$ and $y$ are real numbers such that $0<x<y$ , then $\sqrt{x}<\sqrt{y}$.  This is in a chapter involving the least upper bound axiom and the Archimedean Principle, but I cannot figure how to use either of those to prove this!  Any help would be most appreciated!  Thanks


Why does Python ignore my input and skip my if statement?

Python seems to skip my if statement. is_hot = "" true_or_false = input("True or False? ").lower()  if true_or_false == "true":     is_hot == True elif true_or_false == "false":     is_hot == False else:     print("You didn't type true or false")  #The skipped if statement: if is_hot == True:     print("It's a hot day")     print("Drink water.") elif is_hot == False:     print("It's not hot.")  print("Enjoy your day")  The output is just the last print statement.


Lossless mp4 is smaller than sum of frames

Any explanation why a mp4 comprised of png would be smaller than all of it's images? Ultimately, I would like to lower the quality of my renders (png) if they are being butchered during "lossless" encoding. Why wait 2 minutes for each render when they eventually get dissolved to a lower resolution during processing? So what's the target png file size for lossless mp4 files to converge on a sum of their parts? Sorry if this question get's asked a lot.


Grub2 package failed installed on dual boot with windows 10

I have a problem when I installed Ubuntu 18.04 LTS as secondary OS. I used windows 10 before and I want to make dual boot with Ubuntu 18.04 LTS. I already create 30GB free space on the disk and I already make USB boot too. I followed the steps to install Ubuntu and make one partition as swap and one as ext partition. I used "Something else" method in this case. But, when I installed it works well in the first copying and installing but when Grub2 package installed I have some error said like this :     The 'grub-efi-amd64-signed' package failed to install into /target/.   Without the GRUB boot loader, the installed system will not boot".   I used HP laptop with 4GB RAM and I used windows 10 to make free space of partition. I also use rufus to make bootable from USB device.  Anyone please help me to solve this problem. Thanks before.


Hello most helpful humans. I have read endless other threads on this subject, and typed a myriad of commands in terminal, but have caused myself more trouble than benefit it seems.  The problem is Plex, and its ability to find my external drive. Or that was the problem. Now the problem is that I can't seem to update or install anything.  Full error message is:  E: Type 'wget' is not known on line 1 in source list /etc/apt/sources.list.d/plexmediaserver   Please could somebody help me sort this out? I'm afraid I'm not much clued up on how to use Ubuntu properly - my usual approach when problems arise is to search online and copy code/follow instructions that someone else has written, which usually does whatever trick I'm hoping it will. I don't care at this point if I get Plex working (though it would be an added bonus for sure), but being able to update the computer again would be nice.   I realise it would be more helpful if this post had more information, but I'm afraid I need help knowing what to type in to get such information!  Thank you in advance for any help.   EDITS:  john@john-Inspiron-15-3552:~$ cat /etc/apt/sources.list.d/plexmediaserver cat: /etc/apt/sources.list.d/plexmediaserver: No such file or directory    I have read the malformed line thread, but I find it really hard to understand a lot of the time. Not sure if it pertains to my issue or not. Sorry.  john@john-Inspiron-15-3552:~$ cat /etc/apt/sources.list.d/plexmediaserver.list wget -q https://downloads.plex.tv/plex-keys/PlexSign.key -O - | sudo apt-key add - deb https://downloads.plex.tv/repo/deb public main


When was the shellshock (CVE-2014-6271/7169) bug introduced, and what is the patch that fully fixes it?

Some context about the bug:      Bash supports exporting not just shell variables, but also shell   functions to other bash instances, via the process environment to   (indirect) child processes.  Current bash versions use an environment   variable named by the function name, and a function definition   starting with “() {” in the variable value to propagate function   definitions through the environment.  The vulnerability occurs because   bash does not stop after processing the function definition; it   continues to parse and execute shell commands following the function   definition.  For example, an environment variable setting of    VAR=() { ignored; }; /bin/id       will execute /bin/id when the environment is imported into the bash   process.   Source:   When was the bug introduced, and what is the patch that fully fixes it? (See )  What are the vulnerable versions beyond noted in the CVE (initially) (3.{0..2} and 4.{0..3})?  Has the buggy source code been reused in other projects?  Additional information is desirable.    Related:


If $f$ is entire and $|f|\geq 1$, then show $f$ is constant.

I know I'm going to use Liouville's Theorem, but my main question is why is $1/|f(z)|$ entire as well if $f$ is entire? Is this just a basic property: if $f$ is entire, then $1/f$ is entire? Thanks for the help.


How to backup files from black screened iPhone

I dropped my iPhone 6 today; even though there is no noticeable harm on the outside, my phone screen is completely broken. Actually, the phone does not even vibrate when I turn it on. The only reason why I know that it turns on (I think), is that my iTunes say "iTunes could not connect to the iPhone 'my iPhone' ... because the passcode is not entered." I have tried holding home + power button for zillion seconds, and it does not do anything for me. I think the display is really gone.  Although it stinks to have my phone broken, I am more concerned about the data I have inside. I have many text messages with my girl-friend and voice memos that I do not want to lose. I have a program that can obtain these data, but because I cannot unlock the phone with my screen completely gone (I think touch is not working either), I do not know what to do.  Could you please help me?


Matrix multiplication: interpreting and understanding the process

I have just watched the first half of the 3rd lecture of Gilbert Strang on the open course ware with link:    It seems that with a matrix multiplication $AB=C$, that the entries as scalars, are formed from the dot product computations of the rows of $A$ with the columns of $B$. Visual interpretations from mechanics of overlpaing forces come to mind immediately because that is the source for the dot product (inner product).  I see the rows of $C$ as being the dot product of the rows of $B$, with the dot product of a particular row of $A$. Similar to the above and it is easy to see this from the individual entries in the matrix $C$ as to which elements change to give which dot products.  For understanding matrix multiplication there is the geometrical interpretation, that the matrix multiplication is a change in the reference system since matrix $B$ can be seen as a transormation operator for rotation, scalling, reflection and skew. It is easy to see this by constructing example $B$ matrices with these effects on $A$. This decomposition is a strong argument and is strongly convincing of its generality. This interpreation is strong but not smooth because I would find smoother an explanation which would be an interpretation begining from the dot product of vectors and using this to explain the process and the interpretation of the results (one which is a bit easier to see without many examples of the putting numbers in and seeing what comes out which students go through).  I can hope that sticking to dot products throughout the explanation and THEN seeing how these can be seen to produce scalings, rotations, and skewings would be better. But, after some simple graphical examples I saw this doesn't work as the order of the columns in matrix $B$ are important and don't show in the graphical representation.   The best explanation I can find is at . It is convincing but a bit disappointing (explains why this approach preserves the "composition of linear transformations"; thanks @Arturo Magidin). So the question is: Why does matrix multiplication happen as it does, and are there good practical examples to support it? Preferably not via rotations/scalings/skews (thanks @lhf).


How to I check if my camera is working properly?

I have a sony rx100II. I have recently sent it by parcel delivery together with some other items.  When I got the parcel some of the items had physical damages. The camera was inside a box, padded, but I would like to make sure everything is working properly. The other damages were quite significant which means something major must have happened to the parcel.  Is there a systematic way of checking a camera?


Why split the  tag when writing it with document.write()?

Why do some sites (or advertisers that give clients javascript code) employ a technique of splitting the <script> and/or </script> tags up within document.write() calls?  I noticed that Amazon does this as well, for example:  <script type='text/javascript'>   if (typeof window['jQuery'] == 'undefined') document.write('<scr'+'ipt type="text/javascript" src="http://z-ecx.images-amazon.com/images/G/01/javascripts/lib/jquery/jquery-1.2.6.pack._V265113567_.js"></sc'+'ript>'); </script>


I am sorry if this has been asked before.  I read the following in a textbook:     The examples are intentionally simple, so we can focus on the language features.   I thought that     The examples are intentionally simple so that we can focus on the language features.   is correct.  Can someone clarify?


The Maxwell equations are invariant under the transformation  $$A_{\mu} \rightarrow A_{\mu} - \dfrac{1}{e}\partial_{\mu}\alpha(x)$$  where $\alpha(x)$ is a phase transformation varying from point to point. The Maxwell Lagrangian can be coupled to a scalar field Lagrangian by stipulating that the scalar field remains invariant under the local phase transformation, and therefore a covariant derivative needs to be defined in order to properly effect the transformation instead of the ordinary derivative given by  $$D_{\mu} \phi(x) = \partial_{\mu} \phi(x) + ieA_{\mu}(x)\phi(x) $$ with the $A_{\mu}$ transforming again as  $$A_{\mu} \rightarrow A_{\mu} - \dfrac{1}{e}\partial_{\mu}\alpha(x)$$  Thus the combined Lagrangian can be written as a gauge invariant function $$L = L_{Maxwell} + L_{scalar}$$. A similar procedure can be done for the general class of Yang-Mills theories.   Suppose if we take only the Einstein - Hilbert Lagrangian, are there gauge transformations on $g_{\mu\nu}$ which leave the Lagrangian invariant in the similar sense as above? (Also I've heard that coordinate invariance constitutes  some sort of gauge invariance, I'm not sure how, and whether this sort of gauge transformation is the answer to my problem) Can I construct and couple gauge invariant scalar fields like in the above example to the Einstein-Hilbert action? How do I do so?   EDIT : Later I found this  to be particularly useful to understand diffeomorphism invariance.


After installing Ubuntu 13.10 I get this message "the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present"

I've just finished installing Ubuntu 13.10 on my computer.  When I start the computer, after the Ubuntu logo fades away, I see this message:      the disk drive for /dev/mapper/cryptswap1 is not ready yet or not present   Then the login screen appears and when I enter my password I go to my desktop.  Is this normal? Do I need to do something about it?


Run command with specific arguments without password as root for all users

I want to be able to run fdisk -l as any user, without getting the whole fdisk: cannot open /dev/sda: Permission denied message.  I don't see how fdisk -l can be used for malicious purposes.  I have a PHP script, which first checks if the user is logged into my website, and if they are admin.  Then I have an admin control panel, where it shows the output of fdisk -l, however, I am getting the error fdisk: cannot open /dev/sda: Permission denied.  There is no user input, so they can't inject arguments into the command.


What's the best way to duplicate fork() in windows?

How do I implement some logic that will allow me to reproduce on Windows the functionality that I have on Linux with the fork() system call, using Python?  I'm specifically trying to execute a method on the SAPI Com component, while continuing the other logic in the main thread without blocking or waiting.


Will it be possible to revert to Windows 8 after installing Windows 10 (not preview)?

Is there any reason that one could not revert to a previous OS (e.g. from a disk image) after installing the full release of Windows 10? It might be possible for MS to repartition the disk during installation, or to install a new file system that could not be read by the WinPE or Linux restore media.  Has anyone had experience, at least with the preview version, in doing a full restore? This is not exactly what is asked in , Uninstall Windows 10 Tech Preview... the question concerns a full disk restore.


Blender Not Displaying in or id displaying strangely

[Blender 2.90.1 I have multiple images here but seems it will only let me post one at a time. But as you can see Blender will not show any of my materials (this is tutorial I've been working on for a while and it was absolutely fine the last time I opened it some weeks ago. Now it will not show materials or it'll show something that looks TV static It will display darkness in Render Mode or Material preview and will only show the object if I select it. It will only show the outline of it then, can't see it as you can below.  It does not matter if I open a fresh new blender window, the default cube does the same thing.  Is there some new setting I've missed turning on? My video card going bad?  It will display some materials in Cycled Render but same darkness if I switch to Modeling, layout or any other mode.


On the justification of the result of a limit utilizing little-o. (quick question)

Why is it that   $$\lim_{n \rightarrow +\infty} \left( 1 + \frac{\lambda}{n}+ o \left( \frac{1}{n} \right) \right)^n = e^{\lambda}$$  I once remembered the justification for "ignoring" the $o(1/n)$ but can't recall it again.


Why are galaxies flat since it's an unstable configuration in 3d?

I'll probably have to delete this question because someone's already asked it, but what accounts for the stable 2-d structure of spiral galaxies in three dimensional space (assuming random starting vectors)?  The traditional centrifugal force answer doesn't account for the fact that purely Newtonian $n$-body simulations never evolve into flat disks.  Is it actually suggested that there is some non-Newtonian process to account for this?  Or that spinning galaxies throw out stars from the center?  I keep hearing a lot of bullshit.  [Edit: I'm keeping this answer for now as it is spurring some interesting discussion.]


Make the "close" link on bountied questions reject immediately

For bountied questions, make clicking "close" immediately pop up the error message This question has an open bounty and cannot be closed, instead of waiting until the end if the close vote input sequence (which can be quite long)  I have read the "duplicate" questions, but nine seem to directly ask for this change.  Some close options take a while (PK, maybe only a minute, but still) to complete, especially the "Other" option where the closer must type a message (maybe with links etc, so when done well it might not be that quick). Having the error show immediately would save the closer the time and trouble that is currently fruitless.


I went to the Image Editor.  Selected this file name.  Clicked the folder icon.  Navigated to the image file.  The image file is there. Why it still says Unable to Pack File?  Could it be because some material is using it somewhere else? I was hoping if it was found in the Image Editor, it would be usable by all the materials referencing that image?  If not, how can I find the material which is looking for this image?  File has approximately 60 materials.  Thanks


Significance of American Mathematical Monthly Problems in Math Grad School Admissions

I have started solving problems from the American Mathematical Monthly. While I will definitely continue this, I am not sure how much this will help for math graduate school admissions (assuming I submit my solutions and they are recognized by the Monthly). How significant would multiple solutions to Monthly problems be in admissions? What about having the published solution to a problem? One issue is that I don't know how difficult the problems are presumed to be: all I know is that I personally have solved at least one of them!


Is there a general script to automatically update packages downloaded from the Internet?

Reopen request:  Yes, this is marked as duplicate.  ** What I am asking is a shell script that can help me achieve updating packages with .deb and .tar.gz, but NOT how .deb will affect apt-get update, and NOT just manually compile the .tar.gz and manually update the package.  As I've mentioned before:   queries the adding of PPA in /etc/apt/sources.list.d/, which is not what I wanted, because I said there is no PPA available already. Also, I don't like using other PPAs, I prefer a script that is viewable and editable by me at any time I want.   shows no sign of (even) automatically downloading the .tar.gz packages. Also, what it talks about is manually updating source code packages, but what I want is a custom script that I can automatically download the source code, compile it and also automatically install it.  For some more information, I already know the existence of Arch Linux's AUR, and according to  which previously also flagged suggested duplicate, it is saying that an equivalent to Arch Linux's AUR is Ubuntu's PPA, which is not what I wanted.  I am now requesting to reopen this question. Please, and please understand what I want, not just marking some topics I don't need, and then say "This is a duplicate question".  Also check out  on this.    Question:  I know that we can automatically update packages using apt or apt-get if they are installed via PPA.  However, recently I found out that a package I installed, which is downloaded from the Internet in .deb format, is seriously outdated. There is no offical or unoffical PPA available for that program.  Also, another program that I complied long ago (also downloaded from the Internet, .tar.gz format) is also outdated.  Is it possible to have a shell script that can automatically check for updates online, download the .deb and .tar.gz packages, automatically compile it, and install it in Ubuntu?    For reference only:   Preferred: wget, make, crontab I understand the risk of using such scripts (risk of malicious downloads), I can personally bear it because I know how to remove infections when the system got infected by viruses. If anyone want me to specify a package I want to update, please use  and  (it's .tar.gz package).


Showing that gcd(a,b) = gcd(c,d) in this case

We have a $2\times2$ matrix with $\mathbb{Z}$ entries, $$M =\begin{bmatrix}i&j\\k&l\end{bmatrix}$$ with $\det(M) = 1$.  If $(c\; d) = (a\; b)M$ then how do we show that $\gcd(a,b) = \gcd(c,d)$ ?  Multiplying out we get $ai + bk =c$ and $aj + bl = d$. assuming $a,b,c,d$ non-zero integers then by Bezout $\gcd(a,b) |c$ and $\gcd(a,b) |d$ so $\gcd(a,b) |\gcd(c,d)$ since $\det(M) = 1$ then $il - kj = 1$. by Bezout $\gcd(i,k) = \gcd(j,l) = 1$ That's all I have really, any help would be appreciated thanks.


There is a Stack Exchange site called "Software Recommendations".  Since we are living in a cloud world full of services for every aspect of live: do we need a new Stack Exchange site called "cloud recommendations" or "service recommendations"?  Topics in that site could be about:   Is there a cloud service that... How to combine Cloud services A and B? Which free services can I use in order to do... Condiguration recommendations for cloud services? API vs UI


Determine whether each of the following sets can be made into a vector space a)The set of all 2x2 matrices with trace zero(the trace of a matrix is the sum of the entries on the main diagonal)


How to calculate joint distribution probability samples from the probabilities of the two univariate distributions?

If random variables $x$ and $y$ have probability distributions $f(x)$ and $f(y)$ that each sum to 1, indexed by $i$, \begin{array} {|r|r|}\hline i & f(x) & f(y) & f(x,y) \\ \hline 1 & 0.1 & 0.1 &  \\ \hline 2 & 0.2 & 0.4 &  \\ \hline 3 & 0.4 & 0.3 &  \\ \hline 4 & 0.2 & 0.15 &  \\ \hline 5 & 0.1 & 0.05 &  \\ \hline  \end{array} How do I compute corresponding probability samples for their joint distribution $f(x,y)$ for the final column in the table?


Minecraft 1.15 a way to check if entity can see a player

Hope you are all doing well, i trying to figure out how i can test if an entity can see a player in it's view atm i am using code below;  execute as @e[type=minecraft:villager,tag=Path,tag=Villager10] at @s anchored eyes facing entity @e[sort=nearest,limit=1,type=player] eyes anchored feet positioned ^ ^ ^1 rotated as @s positioned ^ ^ ^-1 if entity @s[distance=..0.1] run say Success  This code runs along side a villager with the tags path and Villager10. (side not i have removed AI for the villager so it wont move around)  This code works however it doesn't take into consideration if there are blocks in the way.  Dose anyone know if i am using the right method to do such a thing and if so how. Fairly new to commands like so.  Many Thanks. Dave


Completion with wildcards in directory names in bash

I can do:  $ cd sources/ar #[TAB] here would complete word 'ar' to 'art'   I can do  $ cd */art #[enter] here would bring me to sources/art   I can do  $ cd */art #[TAB] that would expand */art to sources/art in command-line    I want to do  $ cd */a #[TAB] to complete to '*/art' or to 'sources/art'.   Is there any way to enable that in bash?


I am trying to understand subnetting. I understand that you can take the 192.168.0.0/24 domain and break it into 2 subnets: 192.168.0.0/25 and 192.168.0.128/25. What if I need to create 2 more subnets inside both of those above subnets?  What if I need to create 2 subnets, which have 2 more subnets inside them and each of those 2 subnets have 2 hosts. As per my calculation, this would be something like.  top 2 subnets: 192.168.0.0/25 and 192.168.0.128/25  subnets of 192.168.0.0/25: 192.168.0.0/26 - 192.168.0.128/26  subnets of 192.168.0.128/25: 192.168.0.128/26 - 192.168.0.192/26  hosts of 192.168.0.0/25: 192.168.0.1/25 - 192.168.0.2/25  hosts of 192.168.0.128/25: 192.168.0.129/25 - 192.168.0.130/25  hosts of 192.168.0.0/26: 192.168.0.1/26 - 192.168.0.2/26  hosts of 192.168.0.128/26: 192.168.0.129/26 - 192.168.0.130/26  hosts of 192.168.0.128/26: 192.168.0.129/26 - 192.168.0.130/26  hosts of 192.168.0.192/26: 192.168.0.193/26 - 192.168.0.194/26  The above doesn't seem right, I am moving down like a tree, however the subnet mask and IPs are being repeated, I am just adding 1 to /x and making the IPs from there. Can anyone please tell me if this is correct?  The scenario I am trying to understand is similar to , however I just want to add hosts on each level as well.


Add/Show comments focuses text box by default

If I open a post using the mobile theme, which has many comments, there is a link at the footer "add/show n more comments". If this link is clicked, the comments are loaded and displayed.   At the moment the text area is automatically focused which is not a great experience (in my opinion), as you have to close the editor and scroll back to the top if you just wanted to read the comments, without adding a new one.  Would it be possible to either   not focus the text area by default and to load only the comments add a new link for adding a comment


I have bin searching a solution for my question but didn't find a or better said I did not get it with what I found. So lets talk about what my problem is about. I am using a Smart Home Control Software on a Raspberry Pi and as I found out this weekend using pilight-receive I can catch the data from my outdoor temperature sensor. The output of pilight-receive looks like that:  {         "message": {                 "id": 4095,                 "temperature": 409.5         },         "origin": "receiver",         "protocol": "alecto_wsd17",         "uuid": "0000-b8-27-eb-0f3db7",         "repeats": 3 } {         "message": {                 "id": 1490,                 "temperature": 25.1,                 "humidity": 40.0,                 "battery": 1         },         "origin": "receiver",         "protocol": "alecto_ws1700",         "uuid": "0000-b8-27-eb-0f3db7",         "repeats": 3 } {         "message": {                 "id": 2039,                 "temperature": 409.5         },         "origin": "receiver",         "protocol": "alecto_wsd17",         "uuid": "0000-b8-27-eb-0f3db7",         "repeats": 4 }   Now my question to you:  How the heck can I extract the temperature and humidity from where the id is 1490. And how would you recommend me to do check this frequently? By a cron job that runs every 10 minutes, creates an output of the pilight-receive, extracts the data of the output and pushes it to the Smart Home Control Api.  Someone having an idea - thanks a lot


Compact set in $\mathbb{R}^n$ and the finite intersection property

Show that a set $K ⊂ \mathbb{R}^n$ is compact if and only if every family of closed subsets of K having the finite intersection property has nonempty intersection. I was able to prove one side (That if $K$ is compact then every family of closed subsets of $K$ having the finite intersection property has nonempty intersection), but something doesn't work in the other direction. Our definition of compact set is that for every open cover $\{F_{i}\}_{i\in I}$ there exists a finite subcover such that $K\subset\bigcup_{i\in J}F_{i}$ where $J\subset I$ is a finite subset of indices. I tried using De - Morgan, but that fact that $K\subset\bigcup_{i\in J}F_{i}$ and not $K=\bigcup_{i\in J}F_{i}$ got me stuck.


Has anybody used a good obfuscator for PHP? I've tried some but they don't work for very big projects. They can't handle variables that are included in one file and used in another, for instance.  Or do you have any other tricks for stopping the spread of your code?


Difference between "anything" and "everything"

Something just came up on a news bulletin, and I'm a bit puzzled.        I was unaware of everything that happened that night.   I wasn’t aware of anything that happened that night.      "Not aware" and "unaware" mean the same thing, a lack of awareness (as far as I am aware!), and yet the everything and anything are not interchangeable.  Am I right in this? If so, can anyone explain the intricacy?


Finding the order of Z(G) in a non-Abelian group of order 8

Let $G$ be a non-Abelian group of order $8$. Prove that $|Z(G)|$ is less or equal to $2$.  First I must say this is a question about normal subgroups. I haven't yet studied homomorphisms or more complex material.  This is my try to solve the problem. Since $Z(G)$ is a subgroup of $G$, its order should be $8, 4, 2$ or $1$. Because $G$ is non-Abelian, it can't be $8$. Then I assumed the order is $4$ and tried to get to a contradiction. Since $|Z(G)|=4$, there are only two cosets of $Z(G)$ in $G$. One of them is $Z(G)$ itself, and the other one is all the elements that are not in $Z(G)$.  Here I am stuck. Maybe it's not the right way to think about this problem.. Help would be greatly appreciated.


How to use table inside a newenvironment

I'm using a table inside a new environment to create a list of definitions, but some of the things being defined are two words. I want to have the first word on one line and the other word on the next line but everything I try gives an error or an incorrect out. (This works fine if it's only one word.) Here is what I have so far:  \documentclass{article} \usepackage{fullpage} \setlength\parindent{0pt}  \newenvironment{defn}[2]   {\begin{tabular}{p{1in} p{5in}}   \hfill\underline{#1} & #2   }   {\\ \end{tabular}}  \begin{document}  \begin{defn} {Jib\\ Jab} {Here is the definition of the word Jib Jab} \end{example}  \begin{defn} {Def2} {Here is the definition of the word Def2} \end{defn}  \end{document}


How can I get the count of line in a file in an efficient way?

I have a big file. It includes approximately 3.000-20.000 lines. How can I get the total count of lines in the file using Java?


prove that maximal ideal in $\mathbb{Z}$ generated by a prime number

I am trying to prove $(a)$ is a maximal ideal in $\mathbb{Z}$,  if and only if $a$ is prime number.  Now I wrote: assume $a \in\mathbb{Z}$, while it's not prime number we can write as $a=xy$, for some integers $x$ and $y$. then $(a)\subset (x)$ and $(a)\subset (y)$  while if $(a)$ is maximal ideal, it's not exist $(k)$ such that $(a)\subset (k)\subset\mathbb{Z}$. so $(a)$ cannot be maximal ideal. we can say by contradictory if $a$ is prime, $(a)$ is maximal ideal.  is this correct?  and how to prove the other way.


Free datasets of Europe's historical country borders since the Middle Ages

Is there a source for historical shapefiles of Europe since the Middle Ages?  There was a promising answer to the similar question   but the link provided doesn't work (anymore).


Is the following true? Let $x_n$ be a sequence with the following property: Every subsequence of $x_n$ has a further subsequence which converges to $x$. Then the sequence $x_n$ converges to $x$.  I guess that it is true but I am not sure how to prove this.


install windows 8 in GPT style hard disk

I have an Acer Aspire E15 laptop, of my friend, in which I have been trying to install Windows 8 but I am unable to do so. It has 4 partitions:  Partition 1: total: 900MB - free: 900MB - type: Primary Partition 2:  total: 128MB - free: 128MB - type: MSR Partition 3:  total: 447.9GB - free: 447.9GMB - type: Primary Partition 4:  total: 16GB - free: 16GMB - type: Recovery   When I select partition 3 to install OS it says "windows cant be installed because it is GPT type" or something similar. How do I install in this partition?  Additional info: -without installation disc it shows "no bootable device- insert boot disc and press any key" so cant restore or repair. BIOS: -boot mode selected : Legacy (when switched to UEFI it says "no installation disc is inserted) -HDD name and serial numbers are visible in BIOS.  How do I fix this issue? Do I need other installation media? or do I have any problem with my HDD?


We have: $$ x^{x^{x^{ x^{x ^{x ^{\dots}}}}}} =  2.$$   I tried a reasoning by recursion:  For $n=1$: \begin{align}  x^x &= 2 \\ \implies x\ln x &= \ln 2 \end{align}  For $n=2$: \begin{align}  x^{x^x} &= 2 \\ \implies x\ln x^x &= \ln 2  \\ \implies x^2\ln x  &= \ln 2 \\ \end{align}  For an arbitrary $n$ we can solve: $$x^n \ln x = \ln 2 $$  But for $n \to \infty$, I can't seem to find something. Does anyone have an idea on how to tackle this problem?


Integrate $\int_{-\infty}^\infty xe^{-\alpha x^2+\beta x}dx$

I am familiar with the gauusian integral $$\int_{-\infty}^\infty e^{-\alpha x^2+\beta x}dx=\sqrt{\frac{\pi}{\alpha}}e^{\beta^2/(4\alpha)}$$ Could anyone help me to find out the value of the following? $$\int_{-\infty}^\infty xe^{-\alpha x^2+\beta x}dx$$ Integration by parts turns out to contain error function which I am not familiar with.


Clearly I am being thrilled with this question boggling in my mind. "Should I root my phone?" What are the pros and cons? Clarify this thing to me, is it dangerous or is it better than I imagine?


What happens to the content of RAM when a computer turns off?

I have 8GB RAM with and it have variables and stuff. I close the computer and most of the data on the RAM is no longer there.  If the normal hard drive make files on overwriting mode when they get deleted what happens with RAM when I shutdown my computer does they just disappear to the air? Or what?


Can I check-in for both flights in Bangkok, if not do I need a transit visa or Sydney?

I'm traveling from Bangkok to Auckland, changing flights in Sydney, the stop over is 5h and 10m and the flights are both with Qantas. I hold an Italian passport.   Do I need a transit visa? Is it possible to check-in for both flights in Bangkok, if not and I have to exit


Which files does `adb backup -apk -shared -all -f  back up?

I wanted to back up everything on my phone: call logs, messages, whatsapp texts, photos, videos, screenshots, screen video captures, recordings, app data... and everything else, before selling my phone. So, basically, data-wise, I wan't to create a clone of the (entire) current state of my phone. I don't necessarily wan't to restore all of it on my new phone, but I want to be able to access the stuff that I backed-up on my computer later, when needed...I saw a few answers on this site, but they don't answer my questions fully.  Is the command line adb backup -apk -shared -all -f <filename> well-suited to my purpose? My phone has 32G capacity, but the backup file generated is only 5.3G. How do I know that the backup completed properly and contains all the data I wanted? Are there ways to do the backup over a network (WAN) using ADB, instead of having to depend on the USB debugging mode.


Montezuma's revenge or Aztec two step in Central America, mummy's tummy, or Cairo two-step in Egypt, Kurtz Hurtz in Uzbekistan, Bombay belly or Delhi belly in India.  A case of the sh-- or Hershey Squirts or The McSh-- in North America, Down Under Butt Chunder in Australia, Karachi crouch in Pakistan, Suryavarman's Revenge in Cambodia.  Kabulitis in Afghanistan, holiday tummy in United Kingdom, Bali belly in Bali, or Taghazout Tummy in Taghazout or Kathmandu quickstep in Nepal.  Beaver fever in Canada, Thailand it's Thai-dal wave. Peacekeepers to Arabic-speaking countries have called it yalla yalla (Arabic for "fast, fast").  In Central Asia, it was ridiculous, with every second backpacker walking around with toilet paper on them, regularly having to make a 'run' for it. In Egypt, half my tour group got sick, by the time we'd converted into a mobile pharmacy!  Regardless of what it's called, what's the best way to try and prevent it?


What do * and ** before a variable name mean in a function signature?

Possible Duplicate:          I have read a piece of python code, and I don't know what does * and ** mean in this code :   def functionA(self, *a, **kw):    // code here   I just know about one use of *: extract all attribute it has to parameter of method or constructor.  If this true for above function, so what does the rest : ** ?


Prove that $t_{n-1, \alpha/2}$ is strictly decreasing in $n$

This question is related to a couple of other questions ( and ) relating to some material that I teach in sampling theory.  Consider the critical points of the  defined as follows.  The value $t_{n-1, \alpha/2}$ is a function of $n$ defined by the implicit equation: $$\frac{\alpha}{2} = \frac{1}{\sqrt{(n-1) \pi}} \cdot \frac{\Gamma(\tfrac{n}{2})}{\Gamma(\tfrac{n-1}{2})} \int \limits_{t_{n-1, \alpha/2}}^\infty \Big( 1+ \frac{r^2}{n-1} \Big)^{-n/2} dr.$$ Normally we treat the input $n>1$ as an integer, but it is possible to extend the treatment to consider it a real value (since the T-distribution is well-defined for non-integer degrees-of-freedom).  I'm trying to come up with a (relatively simple) proof that this critical point value is decreasing in $n$, but I seem to be making quite a mess.  Differentiation using Leibniz rule gets part way, but it quickly becomes a bit of a mess.  Consequently, I would like to solicit proofs of this result --- this simpler the better. Question: How do you prove that this critical point is strictly decreasing in $n$?


I have been following a tutorial on YouTube that instructs how to create a wrecking ball that uses a rigid body to smash some cubes. In the video, the person who created the tutorial made an animated video of the wrecking ball. How do I do that? Please help with detailed instructions (in Blender 2.7)!


SmartSreen can't be reached in windows-10

I've been trying to download Minecraft but it said "SmartScreen can't be reached." I've tried everything I know, I can't download anything at all.


I am using Ubuntu 12.04 with Unity. I just found that there is no Trash directory at: ~/.local/share/Trash like  here.  Where is the Trash dir?


Where can I ask questions about gaming history?

Currently, I have many historical questions (which have short, definitive, objective answers) that I would like to ask about games, and gaming. While much of gaming history is not necessarily well known, a lot of that is changing. Questions like:    Why does Mario have a mustache? (yes, there is a non subjective answer to this!)  Why did the original zelda have such strange enemy names?  Why did early consoles have so few buttons?  Why was Japanese Mario 2 not released in the United States?  Why did John Romero leave id?    The answers to these questions can be found, and answers can be backed up with evidence, citations etc. Since this information is historical (over 30 years old some of it) it is not hidden behind non-disclosures, as some might assume. However, there is no Stack Exchange that I know of that accepts these types of questions about games, while there is a an ever expanding study of gaming history.   Edit: Just so those skipping the comments know, no, I am not allowed to post these types of questions on "Gaming" - though I wish I could.


$gh = hg, \ \gcd(|g|, |h|) = 1\Rightarrow|gh| = |g||h|\ \ (|a|$ = order of element $a)$

Let $G$ be a group and $g,h \in G$. I need to prove that if $g$ and $h$ commute and their orders are coprime, then $|gh| = |g||h|$, that is, the order of their product is the multiple of their orders.  Since $gh = hg$, then $(gh)^{ lcm(|g|, |h|)} = e$, so, $|gh|$ divides $lcm(|g|, |h|)$. Since $\gcd(|g|, |h|) = 1$, then $lcm(|g|, |h|) = |g||h|$.  So, $|gh|$ divides $|g||h|$.


Can't boot Windows 8 after installing Ubuntu 13.10 in legacy mode

I just installed Ubuntu 13.10 in legacy mode (secure boot disabled) next to a Windows 8.1 partition. Ubuntu works perfectly (in UEFI and in legacy modes) but I can't load Windows anymore - there is no Windows entry in the Grub boot choices.  When the secure boot is enabled, I can't load Ubuntu anymore ('No bootable devices').  I've tried to repair the system with Boot Repair, but nothing changed.  Any help appreciated !  Thanks  (My machine is a Dell XPS13)


What is a closure? Do we have them in .NET?  If they do exist in .NET, could you please provide a code snippet (preferably in C#) explaining it?


Evaluating the limit of multivariable equation $\frac{x^2y}{x^2+y^2}$

$$ \lim_{(x,y)\to(0,0)}{\frac{x^2y}{x^2+y^2}} $$  If you substitute in $(0,0)$ for $x$ and $y$. It becomes $$ \frac{0}{0} $$ usually you would apply the L'Hopital's rule. However, I think it is not possible with the multivariable equation.  If I cannot apply the L'Hopital's rule here, what should be my first step in solving this limit?


Crop a big picture into several small size pictures

Is there a a way with GIMP editor to crop a big picture into several small equal sized pictures? So when all those small pictures connected in order would make a big picture.


Can one delete a Gmail attachment but keep the email?

My Gmail account is starting to get full, so I have been using the new search term larger:1M to find attachments that are larger than 1 Megabyte.  I'd like to just delete the attachment without losing the email itself?


'Official' way to install some packages in Debian 10 that are in Testing?

I looked at the most popular answer in  thread, but people said it broke their system. Is there no 'official', safe way to do this?


How do I create a Windows 8.1 bootable usb stick in Ubuntu 15.10?

I've already partitioned my hard drive and have my iso. I can't download Winusb, UNetbootin doesn't work, and neither does startup disk creator. I've tried Rufus and Microsoft's official usb tools through Wine and nothing has worked. Does anyone have any idea how to make it work?


How can I construct a Controlled-Hadamard gate using single qubit gates and Controlled phase-shift?

I am stuck in this and any help would be appreciated.


After reading up on quantum mechanics considering entangled qubits I was asking myself this simple question:  If one qubit (A) positioned on earth is entangled with another qubit (B) which is - say - a lightyear away, and we perform a bell-measurenment with (B) and an additional qubit (C), it would cause the entanglement of (A) and (B) to break in an instant, or am I wrong? Wouldn't that mean that a communication (say via morse-code) with speed that's exceeding the speed of light from point a to point b is possible? If so, isn't it also possible to communicate from out of a black hole using this method? (disregarding time-dilation).


Where can I exchange Canadian loonies and toonies for USD in the US?

I recently returned to the USA from an extended trip in Canada with around CAD$25 in loonies and toonies (CAD$1 and CAD$2 coins).  As I won't be returning to Canada for a while, and don't live near Canada, I was hoping to exchange the coins, even at a worse rate (since they're worth nothing to me at the moment).   However, I went to a local Travelex and was told that they did not exchange Canadian coins and indeed, that no currency bureaus would take the coins.   Is there anywhere I could go to exchange these coins?


Go to just about any eCommerce site and the homepage is nearly guaranteed to feature a carousel - an auto-rotating panel, usually with some sort of small navigation, usually highlighting new product releases, sales or offers.   Are there any studies out there that look into how effective carousels actually are in terms of conversions and as compared against other ways of displaying similar information? I have a hypothesis that they might be something of a UI cliche, partially supported by looking at click data from some of our own sites.


Choice of initial value for weights in Tensorflow MNIST Tutorial

I was tweaking the , and I am not clear why the weights are initialized using tf.zeros. If I switch to using tf.random_normal, or tf.truncated_normal, I see a very significant drop in accuracy.  Any intuition why tf.zeros is better initial value of the weight and biases (even tf.ones perform the same as tf.zeros), than random values?  Conversely, it seems that if I want to extend the network to have a hidden layer, the weights of the hidden layer should be intialized with random values instead of zeros (unlike the first layer) to do well.  Eg.  x = tf.placeholder(tf.float32, [None, 784]) W = tf.Variable(tf.zeros([784, 100])) b = tf.Variable(tf.zeros([100])) h1 = tf.sigmoid(tf.matmul(x, W) + b)  W2 = tf.Variable(tf.random_normal([100, 10])) b2 = tf.Variable(tf.zeros([10])) y = tf.matmul(h1, W2) + b2   W2 should be intiailized using tf.random_normal (accuracy > 92%) instead of tf.zeros (accuracy ~ 25%).  Edit: My question is not a duplicate, because unlike in the tagged question, I understand why initializing with random weights will help. It is counterintuitive why initializing with zeros does much better for the first layer, but not for the subsequent layers?


understanding the difference between uniform continuity and continuity

We have defined continuity as $\forall \epsilon, \exists \delta > 0 s.t. |x-c| < \delta, x \in D \implies |f(x) - f(c)| < \epsilon$  and uniform continuity as $\forall \epsilon, \exists \delta > 0 s.t. |x-y| < \delta, x,y \in D \implies |f(x) - f(y)| < \epsilon$  The only difference I see is that we have $x,y$ in the domain rather than just $x$, but what does that really change? Furthermore, we have a theorem about the continuity on a closed domain implies uniform continuity, why does this work? I understand the proof but I'm just not sure why it works.


How to partition Ubuntu 13.10 in order to install windows 7? NO DUAL BOOT

I have been using ubuntu for almost a year now, and it is just not working out for me. I would like to switch back to windows. I have both a Windows 7 installation dvd, and a windows xp installation disc, as well as my old ubuntu 12.10 boot dvd before I updated.  I am currently NOT running a dual boot system, it is solely Ubuntu, I erased windows when I switched.  I have no idea how to parition my drive to NTFS, and I would like to be able to do it in under 5 hours.  I know I may be a bit vague, but does anyone have any ideas?


What is the complete command to be type in the command prompt to add the execute permission?

Help! I just need to know the complete command. To add the execute permission. Please.


doing animation in one laptop and render it in another is this possible?

I had made a big animation in my laptop but now the problem is the process of rendering, I can't render in my laptop because it is 2GB RAM. So is it possible to copy it in another laptop and render it?


Workaround for lack of 'nameof' operator in C# for type-safe databinding?

There has been a lot of sentiment to include a nameof operator in C#. As an example of how this operator would work, nameof(Customer.Name) would return the string "Name".  I have a domain object. And I have to bind it. And I need names of properties as strings then. And I want them to be type-safe.  I remember coming across a workaround in .NET 3.5 which provided the functionality of nameof and involved lambda expressions. However, I have not been able to locate this workaround. Can anyone provide that workaround to me?  I am also interested in a way to implement the functionality of nameof in .NET 2.0 if that is possible.


Synonyms for exclamations of joy or excitement

I am looking for words that convey similar meaning to the following: 'whoopee', 'yeah', 'yahoo', when such words are used as exclamations of joy or excitement, as in :     'Whoopee! Hammertime!'       'Yeah! Holidays!'       'Yahoo! School's out!'   Perhaps in this type of usage 'synonym' is not the correct term, and I hope what I am asking is in any case clear.  In addition, very localised or period-specific words are very much okay (as long as you can reference it). For example, perhaps in 18th century Bordeaux people shouted "Mercante!" to mean the same thing.


Are there any special rules for using "get/got" with another verb? Sometimes i feel, i overuse the word "Get/Got". e.g do the following sentences mean the same thing?     (1) Internet "get disconnected" frequently.      (2) Internet disconnects frequently.   Thanks in advance


If you delete Minecraft from your iPad, will you get your worlds back when you download it again?


Find the number of ways to arrange $n$ people in a circle so  that $3$ people are separated. My approach: The number of ways to arrange $n$ people in a circle is $(n - 1)!$. If the $3$ people are together, the number of arrangement is $(n - 3)!$. The $3$ people can rearrange themselves in $3!$ ways, the number of ways for the $3$ people together is $3!(n - 3)!$. Therefore, the number of ways so that none of the $3$ people is seated together is $(n - 1)! - [3!(n - 3)!]$. Is that correct? If not, where did I go wrong? For instance, 4 girls and 3 boys to be arranged in a circle so that none of the boys is together. In this case, we have $(7 - 1)! - [3!(7 - 3)!] = 576$. Any help is appreciated.


Prove an eigenvector for two matrices is also the eigenvector for the product of those matrices.

So let's assume that A and B are both nxn matrices, and that u is an eigenvector for both A corresponding to lambda one and B corresponding to lambda 2. I need to prove that u is also the eigenvector for the product AB.  Initial Thoughts: Au=x'=Bu Au=Bu  I'm really not quite sure about where to go with this one, unfortunately for me my teacher has an affinity for proofs.


I am trying to compare the two String to check if the values are the same from a scanner input. The problem is that after the input of both of the values, the output is saying the two Strings are not the same.  import java.util.Scanner;  public class Test {      public static void main(String[] args) {          String testOne = "";         String testTwo = "";          Scanner input = new Scanner(System.in);         testOne = input.next();          Scanner inputOne = new Scanner(System.in);         testTwo = inputOne.next();          System.out.println("Before comapring: testOne = " + testOne + "\t testTwo = " + testTwo +"\n");          if(testOne == testTwo){             System.out.println("The same");             System.out.println("After comparing: TestOne = " + testOne + "\t testTwo = " + testTwo);         }         else{             System.out.println("Not The same");             System.out.println("After comparing: testOne = " + testOne + "\t testTwo = " + testTwo);         }        } }   I have tried this with multiple inputs, and the outcome is always they are not the same.  Any thoughts would be appreciated.


Allocating 8 bytes of memory dynamically

I want to create an integer array that can hold 8 bytes of data, I have used this code   int n =50;  long long *buffer = new long  long [n];   the size of long long is 8 bytes but    sizeof(buffer)    only gives 4 bytes is it that the heap doesn't allow more than 4 bytes allocation? there is something that I have missed here but don't know what it is.


Can I buy, insure and register a car as a foreigner in Nevada in 1 day?

I'm planning to fly to Las Vegas on holiday and drive to Toronto in a used car. I live in the UK and am unfamiliar with licensing laws in Nevada (and the rest of the US!) - though from what I understand the car would need insuring and registering before I could drive it. These are my questions:   Do I simply need to ensure my full UK driving licence is valid for the insurance I buy? Can insurance be purchased instantly online? What is sufficient for proving I have it when registering the car? How do I register the car and can I do it online? Can insurance and registration be handled on the same day? Is there anything I need to be aware of when driving between various states and Canada? These are the states I plan to visit:   Nevada Arizona Utah Colorado Kansas Missouri Arkansas Tennessee Kentucky Indiana Illinois Michigan    Just to point out in advance, I'm well aware that I could hire a car, but that's not an answer to my questions.  Thanks!


Is there a word for one who drives in the direction opposite the one prescribed for the given lane?

After having found the image below, I’m wondering whether there is a word that English speakers use to describe someone driving on the opposite side of a road.  A bit of searching pulled up , which is a German word whose translation into English is at best unclear. In fact, according to Google Translate, geisterfahrer is rendered in English as ghost rider. However, I’m unable to find this two-word phrase in any dictionary I have consulted — and besides, I’m interested to find a single word.   Thus my question is, is there a word for someone who drives in the direction opposite the one prescribed for the lane they are driving in?  Note that I dislike, and will not accept, wrong-way rider, both because it is too far from the single-word concept and because it seems like a made-up phrase to me.


extract ip address from a string containing ip address and other alphnum

Say I have this   str="System IP is 9.9.9.9 on port 3442" str2="ip 192.168.0.9 is using port 222"   I would like to remove all substrings except for the one which contains periods which would leave me with :  9.9.9.9  192.168.0.9   Any ideas ?


In thousands of movies, books and TV shows, vampires have to be invited inside of the house in order to attack the inhabitants. My question is why do they have to be invited inside, is there an actual reason or is this going on ancient folklore? Is there an explanation?


How can I disable the hot corner /Activities corner using the Terminal?  I know I can use the Tweak Tool, as mentioned , but I am writing a little bash script to reconfigure my Ubuntu Gnome quickly to my needs so I would like to use e.g. gsettings for that.


I have an IEnumerable. I want to chunk it up, ie say there are 500 elements, I want 10 50 element chunks out of it. I tried this          while (true)         {             var page = ret.Take(pagesize).ToList();             .. do stuff with page         }   but that starts at the beginning every time. I am happy with either the above model (an external loop over each page). Or soemting that looks like this   ret.ChunkIt(pagesize).Select(chunk => >do stuff with the page)   I would like to avoid something that materializes the whole list (it might be huge). Ie something that did   List<List<object>> chunks = ret.Chunkit(100);


Let $R$ be a commutative ring and $I_1, \dots, I_n$ pairwise comaximal ideals in $R$, i.e., $I_i + I_j = R$ for $i \neq j$. Why are the ideals $I_1^{n_1}, ... , I_r^{n_r}$ (for any $n_1,...,n_r \in\mathbb N$) also comaximal?


Showing $\int_{\mathbb R} \mid F(x)-G(x)\mid dx = \int_0^1 \mid F^{-1}(u)-G^{-1}(u)\mid du$ with $F$, $G$ CDF functions

Let's $X$ and $Y$ have CDF functions admitting moment of order $1$. Let's be $F$ cdf of $X$ and $G$ cdf of $Y$.  I want to show that $$\int_{\mathbb R} \mid F(x)-G(x)\mid dx = \int_{0}^{1} \mid F^{-1}(u)-G^{-1}(u)\mid du\,.$$


I have a problem with the MATLAB 2012 installation.  After having installed it using Alt + F2 and having used gksudo nautilus, I have installed MATLAB in the correct folder, /usr/local/MATLAB/R2012a.  Then I inserted the license and the window told "activation complete" or something like that.  This made me happy, but only for a while because as soon as I try to search for MATLAB within the applications I cannot find it and neither if I try to run  matlab   into terminal it says:  command not found   How can I fix this problem?


I looked at  and saw that I lost -2 rep with the explanation User was removed. I searched around and found .  But then, something doesn't fit in. According to  up-votes of any kind can give me rep by multiples of 5 - but I lost 2 rep. How?


In practical terms what does the Prefix on ICs usually mean?

In this case I am  using 4538 retriggerable mono-multivibrators, i have bought them from all over and i have HEF14538 CD14538 MC14538's   Is this representing the different internal technologies used in the chips? Does this make ANY difference for standard use? Can I work of one datasheet for all of them!   They also end in BP BC  and BCP in that order.  Does this indicate the tolerance like in BC range transistors or the package type or something?  If anyone has a comprehensive "how to read components guide" or rule-of-thumb syntax I would appreciate a link as similar occurs with capacitors, transistors and other ICs.


How to keep track of attendance and student-submitted excuses for absences?

I will be teaching an introductory class, in which attendance is important, with approximately 60 students in 3 sections.  I'd like to have a system that:   Enables me to quickly mark whether a student is present. Allows students to see their own attendance record but not other students'. Lets students provide information about their absences.   For small classes, students email me (or I email them) for information about absences, but it would be overwhelming with this many students.  A single Google spreadsheet would be great for data entry, and students could use comments to annotate their absences, but it wouldn't protect students' privacy.  Any suggestions (besides not tracking attendance)?  My school provides Google Apps and Blackboard, although I'm willing to use other solutions.  UPDATE: I know a hack that would work in Blackboard would be to create a fake assignment for each day (attending class) and enter attendance information (0 or 1) there.  This is not ideal because (1) entering data into Blackboard is slower than putting it into a spreadsheet, (2) it would bloat the grade listings seen by the students, and (3) I don't think students could add a comment to the "grade" (the excuse).  There is a , but it does not address how to incorporate excuses/explanations, which, to me, is the tricky part.


Ubuntu is not booting after grub. I have a black screen

I installed Ubuntu LTS 20.04 beside windows 10 from usb and when I’m trying to run it ,I have a black screen and keyboard is not working. It was approximately 6 attempt to install it. I tried mint and Debian and Manjaro(in that case even live mode wasn’t working) , but I had the same problem. I have a laptop with:     AMD CPU and GPU:     A8-4500M AMD Radeon HD 7640G + HD 8570M Dual Graphics     Please help!


I'm using the  and I'm trying to set the margins. The guidelines for writing my thesis states this about the margins:        Printed double-sided on white A4 paper within the range 70g/m2 to   100g/m2;   Margins should be set to ‘Mirrored’ The outside margin should be 4cm   (1.5”); all other margins 2cm (0.75”)      The thesis template set the margins with this code:  \setmarginsrb  { 1.5in}  % left margin                         { 0.75in}  % top margin                         { 0.75in}  % right margin                         { 0.75in}  % bottom margin                         {  20pt}  % head height                         {0.25in}  % head sep                         {   9pt}  % foot height                         { 0.3in}  % foot    I need to alter this code so it fit with what my thesis writing guidelines state. I tried the code below, but this failed:  \usepackage[left=0.75in,right=0.75in,top=0.75in,bottom=0.75in,bindingoffset=0.75in,headheight=20pt,headsep=0.25in,footheight=9pt,footsep=0.3in]{geometry}   How can I set my margins to fit with my thesis guidelines?


Reset iCloud password from Mac OS X 10.7.5

Is it possible to reset an iCloud password from an old Macbook running on OS X 10.7.5? This is an iCloud account that I didn't use for some years, unfortunately I don't remember the answer to the recovery questions and I don't have access to the recovery email anymore (but I do have access to the icloud email itself). For these reasons I cannot use  I already tried going to System preferences > ICloud > Account Details but there is no reset password option. Any help would be appreciated!


I forgot my username, how do I get it back?

When I installed the latest update of Ubuntu, I was asked for the username but I do not remember what my username is. How do I find out what my username is?


Renaming files to have lower case extensions with 'rename'

I'm trying to currently rename a large set of files and have been using quite kludgy methods to do so, such as:  rename 's:(.*)\.MOV:$1.mov:g' *.MOV rename 's:(.*)\.JPG:$1.jpg:g' *.JPG   What I'd really like to do is to be able to combine all of these commands using the . Evidently, using this operator, you can transform items to lower case. The problem is that I need to convert only the extensions. Is there a way to do this using this command? I need to essentially transform the capture group in the following expression to lowercase: ^.+\.(.+)$. Is there a way to do this? I'm kind of new to these kinds of transformations.


Permutation with prime order, fixed point

Let $M$ be a finite set and $\varphi$ a permutation of this set with prime order $q$. How do I show that $\varphi$ has a fixed point if $q$ is not a divisor of $|M|$?


Is code coverage required for wrapper class to deploy in production if it has only variables declared in it

public class PP_SI_Wrapper {     public class checkBoxWrapper{         @AuraEnabled public String que;         @AuraEnabled public Boolean val;     }         public class empWrapper {          public Integer intId;          public String strName;          public String strEmpName ;          public String strGloId;      } }


I already tried several ways to create Mist in Blender, but it never worked 100%. I use Blender 2.78 and I want to create Mist like in this scene here.  What are the exact steps?     Here is what I have tried so far:  I already tried this:  but it simply did not work .. I dont know why.  (EDIT: I managed to fix it: Check out this graphic:   Until now I already used objects successfully as Mist-creators (Volume Scatter under Volume Material). The bad thing about using Objects as Mist-creator is that they dont have an endless mist range + the mist can not be bright. Normally it appears grayish result is bad..  Check it out  Please help


Django, how to trigger functions at a specific time?

I have a Django Model which has a published_at field. I want to execute a function every 24 hrs after the published_at everyday. So if,  publish_at = '5 Feb 2020 12AM'  At 6 Feb 2020 12AM , a set of methods will be implemented At 7 Feb 2020 12AM , a set of methods will be implemented  for x days


how to uninstall gromacs package via cmake

I have installed gromacs package with deffect to on usr/local/gromacs. Simple command lines like these: 'sudo apt-get remove gromacs, sudo apt-get remove --purge gromacs, sudo apt-get remove --auto-remove gromacs' did not work. How to get rid of this package?


The following SQL Server query need help       select      JI.id, RBIEnvironment from    (select         issue,        case when cfname='RBI-Environment'                then customvalue               else null         end as 'RBIEnvironment'      from X) as CT where      CT.issue = JI.id group by      JI.id, RBIEnvironment   The issue is the CT table returns the data in following format  1   NULL 1   STG 1   PROD 2   SIT 2   DIT 3   SIT   Hence the outer query returns   1   NULL 1   STG 1   PROD 2   SIT 2   DIT 3   SIT   I need in following format  1   STG,PROD 2   SIT,DIT 3   SIT   Please use the same inner dynamic table as such as it contains some more columns which needs to be displaye din the resultselt .This inner table is linked with the outer table using the issue field and ID field respectively


Why does Padme still have a belly even after child birth?  Here is the picture of Padme's dead body. I believe she gave birth before death. Is she died with baby in her body?


What exactly are Hamiltonian Mechanics (and Lagrangian mechanics)

What exactly are  (and )?   I want to self-study QM, and I've heard from most people that Hamiltonian mechanics is a prereq. So I wikipedia'd it and the entry only confused me more. I don't know any differential equations yet, so maybe that's why.    But what's the difference between Hamiltonian (& Lagrangian mechanics) and Newtonian mechanics?  And why is Hamiltonian mechanics used for QM instead of Newtonian?  Also, what would the prereqs for studying Hamiltonian mechanics be?


Proving that a sequence has $a_n = a_{n+2}$ for $n$ sufficiently large.

The problem states:  a sequence of real numbers $a_0, a_1, \dots $ is defined as follows. $a_0$ is an arbitrary real number and for $n \ge 0, a_{n +1} = \lfloor a_n \rfloor \{ a_n \}$ (where $\{x\} = x - \lfloor x \rfloor$).  Prove that for $a_n = a_{n+2}$ for $n$ large enough.  my attempt:  I notice that this is a decreasing sequence because $$\frac{a_{n+2}}{a_{n+1}} = \frac{\lfloor a_{n+1} \rfloor \{ a_{n+1} \}}{ a_{n+1}} < 1$$  since $\{ a_{n+1} \} \le 1$ (we can exclude the case where it's equal to one since then it becomes the null sequence that satisfies the thesis).  Moreover this sequence is bounded between $0$ and $a_0$ so by the monotone convergence theorem it must have a limit.  Taking the limit I obtain $$\ell = \lim \lfloor a_n \rfloor (\ell - \lim \lfloor  a_n \rfloor) \iff \ell = - \lim \lfloor a_n \rfloor^2 / (1 - \lim \lfloor  a_n \rfloor) $$  And so if I prove that there exists $n$ s.t. $ \lfloor a_n \rfloor < 1$ I am done. Because then the limit could only be $0$ and this implies that there exist infinite $a_n = a_{n+2} = 0$.  But I can't seem to prove it. Is my reasoning up to now ok? How could I proceed?  Edit:  Add original text of the problem.


Getting Google satellite images (via plugin) to behave well in QGIS with map created with different CRS

How to get Google satellite images (via the plugin) to behave well in QGIS with a map created with a difference CRS?  I have a problem using the Google Image layer plug in - at some scales, it won’t match the rest of the project (but does at others).  The project started with Tiff files imported from GB Ordinance Survey and set the CRS to EPSG:27700 - OSGB 1936 / British National Grid (which I think these tiles default to).  I then added a couple of shapefile layers (set to the same CRS). One has point data, the other is a polygon which defines a site boundary.  I then added (via the plug in) the google satellite image layer.  Whenever I add this layer to any project, this always defaults to a view where the whole world is repeated several times across the screen.  If I zoom in by one click from there, it seems to find itself ok and the site boundary matches the OS tile and the satellite image.  However on this project (and a previous one), when I zoom in too far, suddenly the site boundary doesn't match the same area on the google image (about 1:1000) - it is quite a jump.  I can zoom back out any amount and the polygon and google image match fine.  When the polygon and google image don’t match up, if I bring the OS tile above the Google image, I can see that the polygon and OS tile have remained lined-up.  I know Google use a different CRS - WGS 84 / Pseudo Mercator, which I assume is the root of the problem, but there must be a fix.  I’ve tried changing the google image layer’s CRS to match the rest of the project with the obvious result that it goes even further off (“sorry we don’t have image for here”) and right clicking on the OS layer and selecting “set project CRS from layer” doesn't help.


Yesterday I went to the cinema and watched Captain America: Civil War, the movie was great IMO, I have no big complaints.  Although, one of the things that bugged me is how come the Winter Soldier didn't break any of his non-enhanced parts of the body, since he is only shown to have a superhuman arm. Also, when Iron Man gets angry at the end of the movie and destroys his enhanced arm he basically can't do anything any more.  There was no on-screen enhancement with a serum as far as I remember in any of the movies. I understand that he is a trained soldier, perhaps the best one in the world (if you don't count cap); but still if he gets knocked into a wall it shouldn't be so easy to recover from.  So if he gets punched by Iron Man (when he stopped holding back) anywhere but in the arm he should get at least some broken bones. Why doesn't that occur in the movie (apart from the plot armor that kinda saved captain america too in the end since it's his movie)?


If U is a T-invariant subspace of dim n+1, and if there is no subspace W ⊆≠U such that T(w) ∈ W for all w ∈ W, then the set of vectors {u,T(u),T^2(u),...,T^n(u)}, u ∈ U, u ≠ 0  forms a basis for U.   To show the set of vectors forms a basis. I need to show         The set is a linearly independent set    The span of this set is U.       I am stuck at this point. How can I show the vectors in this set is linearly independent? Also, I am not sure how to show the span(set) = U. I know the dimension of this set is also n, which matches to the dimension of the subspace. Can I claim since all the T-invariant subspaces are in U, the set of vectors span U? Thank you so much!    Edit: added u is non-zero


understanding a c++ expression: 1[p], p a pointer

I have found online this question: (original post: )  What is output of:  int arr[] = {1, 2, 3, 4}; int* p = arr; int* k = p; std::cout << (*(k + 2) + 1[p] + *(0 + arr)) << std::endl;   I think I understand correctly the *(k + 2) and the *(0 + arr), but I really cannot understand how 1[p] can be valid and what it really means.  Any simple explanation?  I guess one should not write code like this ever (or am I wrong? any case when writing something like that would be good, readable code?), but just curious.