I've developed a custom control for money input, which contains UITextField and UILabel. When the user taps on it, it becomes active and switches to the UITextField for data input and accepts only numbers and dot symbol, when the user finishes editing it becomes passive and switches to UILabel just to show formatted money value. But there is one little issue which I'm unable to fix a lot of days already. Let's say the user writes down 88.99 and presses done, this becomes "$ 88.99" in a UILabel, next when the user again taps on it to edit the initial value I get the following value "88.98999999999999". To not present the entire code I selected the core part in a playground format which gives the same result as in my complete project: extension NumberFormatter {     static public func defaultCurrencyFormatter() -> NumberFormatter {         let formatter = NumberFormatter()         formatter.usesGroupingSeparator = true         formatter.numberStyle = .currency         formatter.currencySymbol = ""         formatter.minimumFractionDigits = 1         formatter.maximumFractionDigits = 2         formatter.currencyGroupingSeparator = ","         formatter.currencyDecimalSeparator = "."         return formatter     } }  let stringValue = NumberFormatter.defaultCurrencyFormatter().number(from: "88.99")?.stringValue  print(stringValue) // result is Optional("88.98999999999999")  I have no idea why using this NumberFormatter I get such a result. I was thinking that explicitly setting minimumFractionDigits and maximumFractionDigits will solve my issue but it does not affect my result

Consider the following code:   0.1 + 0.2 == 0.3  ->  false   0.1 + 0.2         ->  0.30000000000000004   Why do these inaccuracies happen?


I'm a little stuck on an exercise in a textbook of mine, and need some help. Let $J = \{e \in \mathbb{N}^* | e = ar + bs\}$ for some integers $r,s$. and let $d$ be the least element of J. Show that $d | a$ and $d|b$. I see that I'm supposed to divide d into a (stated in the back of the book) but I don't know where to go from there. If someone could lead me in the right direction, that'd be great (and explain step-by-step, cause I have trouble following sometimes.) Thanks!

Given $a_1, a_2, a_3, \ldots , a_n$ not all zero, show $\gcd(a_1, a_2, a_3, \ldots , a_n)$ is the least positive integer that can be expressed in the form $a_1x_1+a_2x_2+ \ldots +a_nx_n$. Also deduce $a_1x_1+a_2x_2+ \ldots +a_nx_n = b$ has solutions $\iff \gcd(a_1, a_2, a_3, \ldots , a_n)|b$.   I know that $ax+by=n$ has integer solutions $\iff \gcd(a,b)|n$. I'll need to use induction to show $a_1x_1+a_2x_2+ \ldots +a_nx_n = \gcd(a_1, a_2, a_3, \ldots , a_n)$ has solutions, and then I will be able to say that as $\gcd(a_1, a_2, a_3, \ldots , a_n) | a_1x_1+a_2x_2+ \ldots +a_nx_n $ for any $x_1,x_2, x_3 \ldots x_n$ then $c \leq \gcd(a_1, a_2, a_3, \ldots , a_n)$ and $c \geq \gcd(a_1, a_2, a_3, \ldots , a_n)$, and thus $c=\gcd(a_1, a_2, a_3, \ldots , a_n)$.


Let $U \subseteq \Bbb R^n$ be an open set and let $f:U \to \Bbb R^n$ be a differentiable function. if $U$ is path connected and $D_f=0$ for every point in $U$, show that $f$ is constant ($D_f$ is the differential of $f$).   I thought about proving that $f$ is locally constant and then showing that if $f$ is locally constant and $U$ is path connected then $f$ is global constant, but it seems like a lot of work. Is there something simpler / shorter?

How can I prove the following statement?     Given a function $U: A \subset \mathbb{R}^n \to \mathbb{R}$ with $A$   connected set, $$\nabla U=\bar{0} \,\,\,\,\,\,\, \forall \bar{x} \in A\implies U=\mathrm{constant} \,\,\,\,\,\,\, \forall \bar{x} \in A$$   In particular I do not understand how the condition of $A$ as a connected set is necessary to prove the statement.


I am thinking of building a Barn door tracker for some basic Astrophotography. I have seen some of the builds by people such as .  In all builds I have seen, Camera is mounted few inches away from axis of rotation. If I have to guess, center of camera lens is probably 5-6 inches away from axis. Won't this cause error?  If I point camera at Pole star, I suspect this offset will cause camera lens to prescribe a small circle instead of being fixed on target.  Is this understanding right? No one has mentioned this anywhere.

I'm heading up to Scotland in April for a bit of a road trip and I'd like to give astrophotography a bit of a go. I'm like to try and get some deep sky photos (Andromeda etc) and have decided that rather committing to an expensive tracking mount, I'd just spend a small amount and give a barn door tracker a try.  I'm following this guide:   It nearly all makes sense but I'm a bit unsure about the polar alignment. I'm thinking I'll get a laser pointer as the above article suggests but I'm not really sure how to A) attach it to the wood (should it be attached to the top plank?) and B) does it matter how far from the bit of wood it sits? Does it have to be right on top of the hinge or does it not matter?  I was thinking of getting a mount like this:   Any advice would be super. Thank you!


Can somebody explain, why a standard folder has always 4kB and some special directories have more or less?  some examples:   /dev   3280B, 0 Blocks, 16 Links /etc   12288B, 24 Blocks, 119 Links /proc  0B, 0 Blocks, 85 Links /home  4096B, 8 Blocks, 4 Links

What does size of a directory mean in output of ls -l command?


I have a table where some cells contain a bulleted list produced by itemize. I want to present these lists in a compact way. I use the enumitem package and \setlist[itemize]{nosep} (plus other parameters to reduce horizontal space but they're irrelevant here so I didn't include them in my MWE).  I'm still getting unwanted whitespace above and below the list, when it's the sole item in a cell (but not when there's text above/below). How can I get rid of this unwanted vertical space?  I'd like the first line of the list item to be aligned with the first line of a plain text cell in the same row of the table, or close enough.  Not acceptable: , because some items are multiline and I do want the indentation. I won't have nested lists, so redoing the bullets and the indentation of subsequent lines without invoking the itemize environment would be ok.    \documentclass{article} \usepackage{enumitem} \begin{document} \setlist[itemize]{nosep,topsep={0pt},partopsep={0pt}}  Too much space before and after \verb`itemize`:  \begin{tabular}{p{5em}p{15em}p{5em}}   \hline   wibble \par wobble \par wubble &   \begin{itemize}   \item something   \item something else, which can span multiple lines   \end{itemize} &   \begin{itemize}   \item hello   \item world   \item more   \end{itemize}   \\ \hline   wibble \par wobble \par wubble &   \begin{itemize}   \item something   \item something else, which can span multiple lines   \end{itemize} &   \begin{itemize}   \item hello   \item world   \item more   \end{itemize}   even more   \\ \hline \end{tabular}  \bigskip  Approximate desired visual effect:  \begin{tabular}{p{5em}p{15em}p{5em}}   \hline   wibble \par wobble \par wubble &   \vspace{-0.5\baselineskip}   \begin{itemize}   \item something   \item something else, which can span multiple lines   \end{itemize}   \vspace{-0.7\baselineskip}   &   \vspace{-0.5\baselineskip}   \begin{itemize}   \item hello   \item world   \item more   \end{itemize}   \vspace{-0.7\baselineskip}   \\ \hline \end{tabular} \end{document}

I've been trying to use lists of items in a table. This was easy to do but I could not find a way to align them in the same way as plain text in a table. Let me give an example:  \documentclass{article}  \usepackage{paralist}  \begin{document}  \begin{tabular}{|p{2cm}|p{10cm}|}     \hline     Blah blah &      \begin{compactitem}         \item First         \item Second     \end{compactitem} \\         \hline \end{tabular}  \end{document}   Instead of just itemize I used paralist so the list gets more compact, however there is still a lot of space added before and after the list. The result looks pretty awful, I would like to have the same spacing around "Blah Blah" as I have around the items in the right cell.    I've also found some tricks to reduce the space to the upper or lower \hline of the cell, but none of these could match the alignment with just plain text.


I'm looking for some good comprehensive reading material on when JavaScript passes something by value and when by reference and when modifying a passed item affects the value outside a function and when not.  I'm also interested in when assigning to another variable is by reference vs. by value and whether that follows any different rules than passing as a function parameter.  I've done a lot of searching and find lots of specific examples (many of them here on SO) from which I can start to piece together pieces of the real rules, but I haven't yet found a single, well written document that describes it all.  Also, are there ways in the language to control whether something is passed by reference or by value?  Here are some of the types of questions I want to understand.  These are just examples - I'm actually looking to understand the rules the language goes by, not just the answers to specific examples.  But, here are some examples:  function f(a,b,c) {    a = 3;    b.push("foo");    c.first = false; }  var x = 4; var y = ["eeny", "miny", "mo"]; var z = {first: true}; f(x,y,z);   When are the contents of x, y and z changed outside the scope of f for all the different types?  function f() {     var a = ["1", "2", "3"];     var b = a[1];     a[1] = "4";     // what is the value of b now for all possible data types that the array in "a" might hold? }  function f() {     var a = [{yellow: "blue"}, {red: "cyan"}, {green: "magenta"}];     var b = a[1];     a[1].red = "tan";     // what is the value of b now and why?     b.red = "black";     // did the value of a[1].red change when I assigned to b.red? }   If I want to make a fully independent copy of an object (no references whatsoever), what's the best practice way to do that?

The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?


Forgive me if my reasoning is based on flawed logic and information. I am no physics expert. As I understand it when light strikes an object the energy of the photons is absorbed by the atoms that make up the object. An atom's electrons can only orbit its nucleus at one level or another, nothing in between. When the atom absorbs the photon, the electrons jump up another level before going back down again. When this happens a new photon is emitted by the atom, it's energy dictated by the level the electron fell. Once this photon enters the eye we perceive it as a color prepending on how much energy it has. This is the photoelectric effect. In other words, when I turn on the light in my living room, the light hits my walls and is absorbed by the atoms in the purple paint. They tune the light to their own frequency, in a sense dye the light, and eject it out into the world. This is how we not only see in color but see at all. Atoms that emit photons at very specific levels and only a finite number of levels, like cars have a finite number of gears and are either in one or another. From this line of reasoning, I suspect that means there are a finite number of possible colors. That the spectrum we can see is quantized and not continuous. If light depends on the atoms in the physical matter to give them color and atoms can only emit photons at a fixed set of discrete frequencies based on what element they are, then it would follow there are a fixed, finite number of colors, of shades that could possibly exist in the universe. Is this true? Is every photon that comes off an object the same? Does this apply to monitor too? Is every color we see part of a fixed pallet? Something predetermined and unchangeable? Like a cheap art program where you can only select from a list of preprogrammed colors? Is mixing paints, mixing atoms of various elements together make it continuous or is it still quantized and finite? It is said that color is a wavelength and a wavelength can be any length and there can be an infinite number of differences between 2 points if you make the integer small enough. So there can hypothetically be any wavelength, any color, any shade within the visible spectrum. But how can wavelengths be infinitely variable if they depend on atoms that can only emit wavelengths of certain colours? I write this because I have always been a very creative person and this idea is very upsetting to me. And if it's a vast but finite number of colors it would still upset me. Without going into how human perception works, could you answer my question? This is very important to me so please, if you answer, make the argument intelligent and open-minded. I know that scientists sometimes talk about unproven things as if they are proven. I've never been able to pick up on that so if your answer is based on something that's still theoretical, please let me know because I tend to take things literally and think in absolutes. Someone talks about a theory like it's a truth and I can't help but assume it's already been proven beyond a doubt.

The electromagnetic spectrum is a continuum of wavelengths of light, and we have labels for some ranges of these and numerical measurements for many.  Question: Is the EM spectrum continuous such that between two given wavelengths (e.g. 200nm and 201nm) there is an infinite number of distincts wavelengths of light?  Or is there some cut-off of precision with which light might exist (e.g. can light only have wavelengths of whole number when measured in nanometers, etc.)?


Basically all I want to do is define a generic stack using arrays in stack-array.cpp, and use it in stack-test.cpp.  I've read a few answers  and  but somehow i'm still unable to create a stackarray in stack-test.cpp. I'm a C++ beginner and I'm afraid I'm at my wits end..  Here is the code:  stack-array.h  template<typename T> class stackarray { public:     int stacksize;     T stacks;     T *sp;      T pop();     void push(T);     int isempty();     stackarray<T>();     virtual ~stackarray<T>(); };   stack-array.cpp  #include "stack-array.h" #include <stdio.h> #include <string.h> #include <stdlib.h>      template<typename T>     stackarray<T>::stackarray()     {         stackarray<T>::stacksize =10;         stackarray<T>::stacks = new T[stacksize];         stackarray<T>::sp = stacks;     }      template<typename T>     stackarray<T>::~stackarray()     {         // TODO Auto-generated destructor stub     }      template<typename T>     void push(T n)     {         // TODO Auto-generated destructor stub     }      template<typename T>     T pop()     {         // TODO Auto-generated destructor stub     }      template<typename T>     int isempty()     {         // TODO Auto-generated destructor stub     }      template<typename T>     T applyToAll() {         // TODO Auto-generated destructor stub     }   stack-test.cpp  # include <iostream> #include <stdio.h> #include <string.h> #include <stdlib.h>  # include "stack-array.h"   int main() {     stackarray<int> x; //erroring here      return 0; }   this gives me several "undefined references to stackarray :: stackarray()"

Quote from :     The only portable way of using templates at the moment is to implement them in header files by using inline functions.   Why is this?  (Clarification: header files are not the only portable solution. But they are the most convenient portable solution.)


We have a linear operator $T : L^2[a,b] \rightarrow L^2[a,b]$ (with $|a| \le |b|$), $f \mapsto (x \mapsto xf(x))$  Now I shall determine what $\Vert T\Vert$ is.   We clearly have $\Vert x \mapsto xf(x)\Vert \le   |b|\,\Vert f\Vert$, so $\Vert T\Vert \le |b|$. But do we also have $||T||=|b|$?

I'm having some (hopefully small) issues computing the norm of an operator. Firstly, the problem,     For $f\in L^\infty[0,1]$, define $M_f: L^2[0,1]\to L^2[0,1]$ by $M_f(g)(x) = f(x)g(x)$. Show that $M_f$ is a bounded linear operator and $\|M_f\| = \|f\|_\infty$.   What I've done so far:  To see that $M_f$ is linear, let $g_1,g_2\in L^2[0,1]$ and $\lambda\in\mathbb{R}$. Then $$ M_f(g_1 + \lambda g_2)(x) = f(x)(g_1(x) + \lambda g_2(x)) = f(x)g_1(x) + \lambda f(x)g_2(x) = M_f(g_1)(x) + \lambda M_f(g_2)(x).$$  As $f\in L^\infty$ we know there is some minimal $N\in \mathbb{R}$ such that $|f(x)| \leq N$ almost everywhere (i.e., $\|f\|_\infty = N \lt \infty$). The fact that $M_f$ is bounded comes straight this assupmtion, as $$ \|M_f\| = \sup \frac{\|fg\|_2}{\|g\|_2} \leq \sup \frac{\|Ng\|_2}{\|g\|_2} = N\sup \frac{\|g\|_2}{\|g\|_2} = N < \infty.$$ almost everywhere in $[0,1]$, for all non-zero $g\in L^2[0,1]$. So $M_f$ is a bounded linear operator on $L^2[0,1]$.  To prove equality, we must show there is some $g\in L^2[0,1]$ so that $\frac{\|fg\|_2}{\|g\|_2} = N$. Now I want to say something along the lines of pick $g = 1$, but this won't have $\|g\|_2 = 1$ for all measures, so this won't work. Is there any simple way of picking a $g$ that does what we want? Or am I farther off than I'm expecting?  Thanks!


In QGIS (2.10.1 on a Mac), I am trying to make some multiline labels on a map I have with a bunch of trees in them. In the attribute table I have columns with the Latin scientific name, the English name (when one exists), the year the tree was planted etc.  I am labelling the trees in my map with an expression like this:  genus_species + '\n' + case     when  "english_species" is not null then  "english_species" + '\n' end + to_string( "planted_year")   This works well for the rows where english_species is not null, however whenever I have a row with no English name, the entire expression just seems to break and nothing is printed, not even the scientific name or the year (which always exists).  I have tried adding a  when  "english_species" is null then ''   But that doesn't work either. The expression just breaks for rows with no value in the field english_species.

I am having some issues trying to show multiple fields for a single label in QGIS. In QGIS2.6, attempting to display labels for a feature consisting of multiple fields results in an empty label if one of the fields is null. So for example, in the label expression dialog:  concat("Temp Site",'\n',"Notes",'\n',"Function")   will function normally unless one of the fields is null, then it results in no label being shown. Using the '||' operator instead in the expression dialog also results in the same behaviour:  "Temp Site" || '\n'  ||  "Notes" || '\n'  ||  "Function"   Is there a way to display the labels even if one of the fields is null?


Can a druid rest in his animal form so he can then just keep shifting into animal form? Say turn into a cat, nap for an hour turn into a cat rest for an hour and so on to stay in disguise for a spy mission?

Do the druid's uses of the Wild Shape feature recharge while still in Wild Shape?  Say a 10th-level Circle of the Moon Druid spends two uses of Wild Shape to transform into an Air Elemental, whose form she can stay in for the next 5 hours. After 2 hours, she takes a short rest, but does not drop the Wild Shape. She has another couple of hours to keep the Air Elemental form.  My main concern: Does she get her two uses of Wild Shape back with that short rest? Or, does she have to drop the Air Elemental form first before taking the short rest to recharge Wild Shape?


I have the following program (let's call it program.cc):  int main() {   int x, y, sum;   std::cout << "A program which adds two integers\n";   std::cout << "Enter 1st integer: ";   std::cin >> x;   std::cout << "Enter 2nd integer: ";   std::cin >> y;   sum = x + y;   std::cout << "Sum is " << sum << std::endl;   return 0; }   I'm currently writing a bash script that would take a file and push it through the command line as arguments being passed to this cpp program. As you can see, the above program asks for two inputs.  I know how you can pass the contents of a file for use as input on stdin. But how would you do this if you want to pass the contents of a file as arguments through the command line?   To elaborate, let's say file.txt is the file i'm interested in, which simply contains two integers on separate lines.   EDIT: I tried the xargs command:         xargs program.cc < file.txt > outputresult.txt   But this ends up printing what I have in cout, e.g.:       A program which adds two integers      Enter 1st integer: Enter 2nd integer: Sum is 2   I only want what is cout'ed AFTER all my arguments have been passed. How do I do this?

I have a text file that has a list of paths to various files. Is there a command I can use that will iterate through each line and delete the file at the stated path?


Let $A$ and $B$ be two $2\times2$ square matrices such that $AB=I$ Then prove that $BA=I$.  I tried to do it by defining $A$ and $B$ manually by listing the elements but calculations become tedious. Is there a short way to obtain this result?  One is only allowed to use concept of product of matrices and elementry transformations.

If $A$ and $B$ are square matrices such that $AB = I$, where $I$ is the identity matrix, show that $BA = I$.    I do not understand anything more than the following.   Elementary row operations. Linear dependence. Row reduced forms and their relations with the original matrix.   If the entries of the matrix are not from a mathematical structure which supports commutativity, what can we say about this problem?  P.S.: Please avoid using the transpose and/or inverse of a matrix.


How can i stop the back button after user has logout ? (LOGOUT button is in master page) Using webforms  I have few pages, the last page is the final page and after log out when i click back button its showing the previous page.How do i avoid this.Pls help me with the code   Code needs to trigger only after LOGOUT .The user must be able to go back n see previous page if he has to make any changes while he's loged in.

Our investigations have shown us that not all browsers respect the HTTP cache directives in a uniform manner.  For security reasons we do not want certain pages in our application to be cached, ever, by the web browser. This must work for at least the following browsers:   Internet Explorer 6+ Firefox 1.5+ Safari 3+ Opera 9+ Chrome   Our requirement came from a security test. After logging out from our website you could press the back button and view cached pages.


Is it possible to highlight Java annotations in lstlisting?   I could not find any similar questions in tex.stackexchange. I'm searching for some yellow-like color.  Update: I found another question similar to mine, but it didn't work well. My code is:      \documentclass{report} \usepackage{xcolor} \usepackage{listings}          % for source code snippets. \definecolor{pblue}{rgb}{0.13,0.13,1} \definecolor{pgreen}{rgb}{0,0.5,0} \definecolor{pred}{rgb}{0.9,0,0} \definecolor{pgrey}{rgb}{0.46,0.45,0.48} \lstdefinestyle{Javastyle}{       showspaces=false,     showtabs=false,     breaklines=true,     showstringspaces=false,     breakatwhitespace=true,     commentstyle=\color{pgreen},     keywordstyle=\color{pblue},     stringstyle=\color{pred},     basicstyle=\ttfamily\singlespacing,     moredelim=[il][\textcolor{pgrey}]{\$\$},     moredelim=[is][\textcolor{pgrey}]{\%\%}{\%\%},     rulecolor= \color{black}  }  \begin{document}  %\lstset{style=Javastyle} \begin{lstlisting}[language=Java] @NonNull public static byte[] longToBytes(long x) { buffer.clear(); buffer.putLong(0, x); return buffer.array(); } \end{lstlisting} \end{document}   When I remove the % before \lstset{}, I get an error message:  Undefined control sequence. \begin{lstlisting}[language=Java]

I am typesetting something that has a lot of Java code listings. Because the Java code has a lot of annotations, and that they are important to the reader, I'd like to have them highlighted, like other keywords such as class, public, etc.  I want the output to be in black and white.  I tried using minted, but the bw output does not highlight the annotations.  How can I arm-twist listings to highlight the annotations?  P.S. Here is the lstset that I am using:  \lstset{   basicstyle=\footnotesize\tt,        % the size of the fonts that are used for the code   breakatwhitespace=false,         % sets if automatic breaks should only happen at whitespace   breaklines=true,                 % sets automatic line breaking   captionpos=b,                    % sets the caption-position to bottom   extendedchars=true,              % lets you use non-ASCII characters; for 8-bits encodings only, does not work with UTF-8   frame=single,                    % adds a frame around the code   language=Java,                 % the language of the code   keywordstyle=\bf,   showspaces=false,                % show spaces everywhere adding particular underscores; it overrides 'showstringspaces'   showstringspaces=false,          % underline spaces within strings only   showtabs=false,                  % show tabs within strings adding particular underscores   tabsize=2                       % sets default tabsize to 2 spaces }


Years ago I was confronted with a (self imposed) problem, which unexpectedly resurfaced just recently... I don't know whether it makes sense to explain the background or not, so I'll be brief.  If I was given two points in a plane, and two lines passing through them would I be able to construct (or get a equation of) an ellipse to which those lines are tangents in given points? At a first glance, four equations (each point belonging to the ellipse, and each of the lines being a tangent in respective point) would be insufficient to solve for five unknowns (major and minor axis, coordinates of the ellipse centre and the angle for coordinate system transform)- so there would be infinite number of ellipses that could be drawn with those constraints. But it was intuitive to me that only finite number would indeed be possible... So, what is the correct answer to this?  Hopefully, I wont be considered rude- but there is a twist to this... Firstly, I believe to have solved this problem, but recently I was working in a top of the line CAD program, where those constraints seemed to yield an infinite number of solutions. This bit puzzled me greatly- because it doesn't seem correct (so I'm assuming the ellipses they use are not proper ellipses). Secondly, I hope it won't be taken against me because I'm trying to pick your brains and having a theory of my own... which I will disclose a bit later.

Please answer to a question , how to find an ellipse which passes the 2 given points and has the given tangents at them. And one related question is that the given condition can decide just one ellipse which satisfies it?  Thank you in advance.  Edit : May be , I can say the first answer (by Mr. André Nicolas) is for the general case. Is there no special case where only a finite set of ellipses satisfies the condition?  Edit : According to the answers and comments , I can compute an arbitrary chosen ellipse for my condition (using the method by Mr.Patrick Da Silva). But there are possibly many others which satisfy my conditions. Am I right?


This is the disk storage info:    This is the Applications folder info:    Why is the storage usage so high and how can it be reduced? This is on a MacBook Pro Retina 13" with OSX 10.9.5.  Edit: I had tried all the suggestions made by @user3439894 in his answer but didn't mention it before posting.

On my MacBook Pro Retina late 2014 running OS X Yosemite, there's something weird going on.  If i look at the storage tab in the "About my Mac" menu, I use only 67 gigabytes of storage but it says 151 gigabytes are used on apps alone.   Maybe this screenshot is a better explanation:    Is someone else experiencing this problem?


I have some classes A and B:  struct A {     typedef int value_type; }; struct B {     typedef float value_type; };   I want to make a tuple of A::value_type and B::value type via variadic template. I am expecting something like this:  template<typename ...T> struct my_tuple {      typedef std::tuple<T::value_type...> tuple_type; };   This doesnt compile. How can I make such kind of tuple?

In templates, where and why do I have to put typename and template on dependent names? What exactly are dependent names anyway?    I have the following code:  template <typename T, typename Tail> // Tail will be a UnionNode too. struct UnionNode : public Tail {     // ...     template<typename U> struct inUnion {         // Q: where to add typename/template here?         typedef Tail::inUnion<U> dummy;      };     template< > struct inUnion<T> {     }; }; template <typename T> // For the last node Tn. struct UnionNode<T, void> {     // ...     template<typename U> struct inUnion {         char fail[ -2 + (sizeof(U)%2) ]; // Cannot be instantiated for any U     };     template< > struct inUnion<T> {     }; };   The problem I have is in the typedef Tail::inUnion<U> dummy line. I'm fairly certain that inUnion is a dependent name, and VC++ is quite right in choking on it. I also know that I should be able to add template somewhere to tell the compiler that inUnion is a template-id. But where exactly? And should it then assume that inUnion is a class template, i.e. inUnion<U> names a type and not a function?


I just upgraded to Ubuntu 20.04 LTS Focal Fosa and I've lost the use of the Super key to bring up the search window with the Spanish and Belgian keyboard layouts (2nd and 3rd layouts). The Super key is still working with EN (1st language in the list). There's a  already being worked on (see comment by @to-do below)   I've tried adding it to the Keyboard Shortcuts in settings but it is not recognized.   This happens both with my laptop keyboard and an external keyboard. The computer is a Dell Precision 5520. There was a firmware upgrade during the upgrade from 19.04.   As a workaround I'm using Super+S , but I would prefer to have just the Super key working in all layouts as before.

I just updated to Ubuntu 20.04 LTS and my super key has lost its main functionality. Previously in Ubuntu 18.04LTS, I was able to click the super key and the applications drawer would show. Now it doesn't do that. I can still open it by clicking super+a but it's annoying that it doesn't do that.  I restarted my machine and still nothing.


I noticed that it is quite difficult to earn the [synonymizer] badge, and very few indeed earned it on SO.  Would it be appropriate to upgrade this badge from bronze to silver?

I noticed that Synonymizer is only a bronze badge. Yet in order to obtain this badge you need to have 2500 reputation or more to even create tag synonyms. Then, on top of that you also need to be able to find a tag synonym.  Only 514 of these have been awarded... This makes the BRONZE badge Synonymizer rarer to have than most the gold medal badges. So my question is, why is this a bronze badge?


I posted  a short while ago and accidentally left a few zero-width spaces from a bug I was testing earlier. odnU pointed out my error, and we both made edits to fix it, which you can see in  (edits #2 and #3). We both made the exact same edit (removing the 10-20 spaces), and submitted the edit within 2 seconds of each other. The odd thing is that the second edit created a new revision in the history, even though it changed nothing from the revision before it.  I have no idea how this is possible, but I'm pretty sure it's not supposed to be.

I just improved an answer which was one second later edited by another user with the same actions, so that the diff is completely empty. I think the later edit should been dropped automatically.  Here is the question I'm talking about:


I would like to write the character "\" in Latex but since it is a keyword I am struggling in doing so. Is there a way to write it somehow?

I need to output the below text but since \ is a special character, I cannot:  [RegularExpression(@"\d+")]   Also sometimes I need use dollar sign $ as well but it seems to be a special char, too.  What is the way to escape those in LaTeX?  UPDATE:  I used \verb as suggested but I am unable to run commands inside it. Also, in the output the font and the opacity of the text is different than the default one:  \verb|[RegularExpression(\newline @"\d+")]|


A basic algebra question: does a homomorphism of rings always send ideals into ideals?

I need an example of a ring homomorphism such that the image of an ideal needs not to be an ideal.   I found that the image is an ideal if the mapping is onto, so all we need to find a mapping that is not onto.


I am curious to know whether there is any way to list out a webpage and click links on it from the Ubuntu command line. I have tried various things including curl http://example.com and stuff like that but it always says 301 error whatever web address I try. I guess there is no way to do this but I am just checking whether you have any ideas.

How can I browse the Internet from the command line in Ubuntu?


Being a non-English native, I'm surprised when I read people who use a plural form when they're clearly talking about a single person.  Here are two excerpts from a software I used to work on, written by a former Irish co-worker:     ... a supervisor must assign it to themselves and deal with it.   and:     This supervisor has no restaurants assigned to them.   I would have written the following sentences instead:     ... a supervisor must assign it to himself and deal with it.   and:     This supervisor has no restaurants assigned to him.   Is the plural form correct English, and if so, is the plural preferred over the singular form?

Is it good English to say "They have just left", when talking about a single person (perhaps someone you don't know the gender of)?  (I am a native English speaker, I'm looking for the view held by lexicographers).


Edit:  The key point I'm attempting to understand is whether during a regression model building exercise, do I need separate datasets to:   search for predictors and settle on a functional form estimate the parameters (based on the predictors and functional form derived during #1) that will be actually reported along with reporting of fit statistics, residual analysis results, etc as a demonstration of model validity   The passage from ALSM would suggest that if I used only one dataset for both #1 and #2, there would be some bias in the reported coefficient estimates? Is this correct? The comment from "whuber" would suggest no particular problem.  Original Question:  I'm seeking clarification on the meaning and correctness of the following passage I found in:   Kutner, Neter, Nachtsheim, Li. Applied Linear Statistical Models (5th Edition - International Edition). page 375, point #5 in the section "Comments":      If a data set for an exploratory observational study is very large, it can be divided into three parts. The first part is used for model training, the second part for cross-validation and model selection, and the third part for testing and calibrating the final model (Reference 9.10). This approach avoids any bias resulting from estimating the regression parameters from the same data set used for developing the model.   I would like to understand the nature and source of the bias that is mentioned in the second sentence? I am further confused having found the following comment:     NB: After you have settled on a model and confirmed its usefulness with the hold-out data, it's fine to recombine the retained data with the hold-out data for final estimation. Thus, nothing is lost in terms of the precision with which you can estimate model coefficients.   . This suggests that there is no issue with "estimating the regression parameters from the same data set used for developing the model".  Note: Reference 9.10:   Hastie, Tibshirani, Friedman. The Elements of Statistical Learning: Data Mining, Inference, and Prediction.

I found this confusing when I use the neural network toolbox in Matlab. It divided the raw data set into three parts:   training set validation set test set   I notice in many training or learning algorithm, the data is often divided into 2 parts, the training set and the test set.  My questions are:   what is the difference between validation set and test set?  Is the validation set really specific to neural network? Or it is optional. To go further, is there a difference between validation and testing in context of machine learning?


If I scroll from an answer back to the question the questions text isn't visible any more:    After scrolling it again the text appears partially:    Sometimes the answer will appear with a very small font:    Source code doesn't appear in full width neither:    and when I scroll, the grey background covers the source code completely:    This makes the app totally unusable.  Galaxy S2, Android 4.0.3. App version 1.0.51

Note: the bug has returned in version 1.0.89 in a somewhat different form. See:      This possible bug report is similar to the bug in  that was deemed not-reproducible.  I can reproduce something similar with more recent app & Android versions.   App Version: 1.0.34 (original report; is still present in 1.0.38, 1.0.42, 1.0.58) Android Version: 4.4 (up to 4.4.4) Device: Motorola Droid Maxx   In the examples below, you can see some blank answer bodies.  These are on different sites, and represent answers with both edited and non-edited text. In the first example, I clicked on the top answer tab to get to the answers, and in the second example I clicked on the bottom "View n Answers" button. (Trying to be a good little tester!)  Because I've seen this blank-answer-body intermittently over the past couple weeks (before the May 7 update), my process to test was just to go to the first site I frequent and then systematically click through the question list until I found a question with answers in which at least one answer was blank.  For all three sites shown below, it was within the first 5 or 7 questions sorted by newest.  Please note that I have seen many questions with several answers, none of which were blank. It is truly intermittent.  Example blank answer body at Workplace.SE:    Example blank answer body at Programmers.SE:    Example blank answer body at UX.SE:    And now here's the kicker, which makes me think this is some sort of content-loading latency issue rather than a rendering issue:  I returned to the left-side menu, selected the User Experience site, picked the same question as above, and then clicked the top answer tab to view answers again, and lo and behold the text is there:    I then went back to the other questions with blank answers, shown above, and the answer bodies were no longer blank.  I am happy to go through more tests/paths and do screenshots if it is helpful.  The same bug also appears in question bodies.


If, in a contract fr example, the text reads: "X has to finish the work by MM-DD-YYYY", does the "by" include the date or exclude it?  In other words, will the work delivered on the specified date violate the contract?

Possible Duplicate:          For example, if John says:      Return it to me by March 24th.    Does it mean that I need to return it to him before 23:59 p.m. March 24th, or before 23:59 p.m. March 23rd?


Why was Jesse angry with Walter in the last few episodes of Breaking Bad when he was getting picked to be relocated in Alaska?   He already knows that Brock was poisoned with lily (from doc report), and from that he got to know that Gus didn't poison Brock and neither did Walter (because Walter had destroyed the plant of lily).  There is no evidence in the series by which Jesse could be knowing Walter's possession of the lily plant. Even if Walter stole ricin, there could be a possibility (which Jesse should have thought) that the stolen ricin can be used for any future endeavors (killing Hank perhaps). I mean what made Jesse so strongly believe that it was Walter who made Huell to pick pocket a ricin cigarette from him (because the second ricin cigarette, made by Walter was found in the Roomba in Jesse's house)?   Also Jesse was pretty sure that Walter only did the conspiracy of poisoning Brock where it was already established and known to him that poisoning was done from lily flower (doc report).  Jesse was definitely strongly believing that it was Walter who ordered for pick pocketing. But why does ricin poisoning matter at all now? Such that he made desperate attempts twice to burn down Walter's house.

In Breaking Bad, Brock is poisoned by some substance contained in the lily of the valley, as the detectives admit to Jesse as they release him from custody.  First of all, although Walt did indeed get hold of the ricin, he pretends to find it, or a replica, on Jesse's floor, after he convinces Jesse that Gus poisoned Brock.  At that point, in Jesse's mind, Gus poisoned Brock with lily of the valley but wanted him to believe that Walt poisoned the kid with ricin.  Later on, in the final season, realising Huell lifted the ricin (or replica) from his pocket, he shifts over to Walt's house pouring gasoline all over the carpet. But why does he then believe Walt to have poisoned Brock? Has he forgotten about the tox screen results?


I have seen many times in code that people use int or Integer to declare variable in beans. I know int is datatype and Integer is wrapper class. My question is, in which condition int or Integer should be used and is there any advantage of either of them over another?

I was reading  when I came across  saying something about a particular type of programmer knowing the difference between an int and an Integer in Java/C# (Object-Oriented Programming Languages).  So, what is the difference?


Evaluate $\displaystyle \lim_{x\to0} \frac{\cos (\sin x) - \cos x}{x^4}$   The answer stated is $\displaystyle {1 \over 6}$.     What I've tried:  $$\displaystyle \lim_{x\to0} \frac{\cos (\sin x) - \cos x}{x^4}$$  $$=\displaystyle \lim_{x\to0} \frac{\cos (\sin x) -1+1- \cos x}{x^4}$$  $$=\displaystyle \lim_{x\to0} \frac{1- \cos x}{x^4} - \frac {1-\cos (\sin x)}{x^4}$$  $$=\displaystyle \lim_{x\to0} \frac{2 \sin^2(\frac {x}{2})}{x^4} - \frac {2 \sin^2(\frac {\sin x}{2})}{x^4}$$  $$=\displaystyle \lim_{x\to0} \left(\frac{\sin(\frac {x}{2})}{x} \right)^2. \left( \dfrac{1}{2x^2} \right) - \frac {2 \sin^2(\frac {\sin x}{2})}{x^4}$$  I'm not sure how I can evaluate the limit by proceeding this way. All help will be appreciated.   P.S. I'd prefer not using L'Hôpital's rule, it can get really messy.  EDIT: I should have mentioned that I would prefer if the solution does not use taylor series approximations (or any approximations) for that matter.

To find limit of $\lim_{x\to 0}\frac {\cos(\sin x) - \cos x}{x^4} $. I differentiated it using L Hospital's rule. I got $$\frac{-\sin(\sin x)\cos x + \sin x}{4x^3}\text{.}$$ I divided and multiplied by $\sin x$. Since $\lim_{x\to 0}\frac{\sin x}{x} = 1$, thus I got $\frac{1-\cos x}{4x^2}$.On applying standard limits, I get answer $\frac18$. But correct answer is $\frac16$. Please help.


Since some time I encountered that people quickly are downvoting or voting to close on questions I pose without leaving any comment. Of course I'm adressing them in the hope to resolve the problem however mostly nothing comes back. But since some time this become already way to much. What should I do?

Note: If you're looking for a simple explanation as to why comments aren't required on downvotes, see .   I used to get "upset" (though that is too strong a term) when I got downvoted without comment. If my answer isn't good enough then I'd like to know why. Not only does it improve the answer for the OP but it improves my knowledge too.  Where the down-vote has been explained I've found it useful & it has improved my answer, or forced me to delete the answer if it was totally wrong.  So is there any way we can encourage people to leave a comment? Perhaps they don't lose rep if they explain their down-vote?  I must admit though that I haven't always explained my down-vote either so you could call me a hypocrite. I've also grown a thicker skin over the months of using SO (it seems to have come with the higher rep score ;-)), so I'm less bothered about this now.


Hi i'm coding my own sort of commentfield for my website, so im trying out using the append function in jquery, but netbeans is telling me this function call is missing quotes  $( "#comment" ).append( "
     testName
TestText

" );

console.log("double"); vs. console.log('single'); I see more and more JavaScript libraries out there using single quotes when handling strings. What are the reasons to use one over the other? I thought they're pretty much interchangeable.


After reading a bunch of past stack exchange posts like  and RFCs , , and  I felt comfortable that a 32-byte key was sufficient for HMAC-SHA256.  However, I am implementing my code in C# and someone pointed out to me that the  recommends a 64-byte key:     The key can be any length. However, the recommended size is 64 bytes.   Is there any good reason to use a 64-byte key instead of a 32-byte key?

I'm trying to generate a secret key to be used for HMAC SHA-256 signature processing. I've seen many sample of keys with variable length from 32 characters to 96 characters.  What is the ironclad rule for this key size?


I've been using tabularx and \begin{tabularx}{\textwidth}{X X} to get two equally spaced columns with text aligned to the left. Example:  \begin{table}[H]     \begin{tabularx}{\textwidth}{X X}         die Kleidung & clothes \\         der Schuh & shoe     \end{tabularx} \end{table}   The problem is that if I create a long table, the content goes outside the bottom page margins, like this:  How can I break this table automatically while keeping exactly the same alignment?  I've tried using the packages longtable, ltablex and ltxtable, unsuccessfully. Whenever I get the break to work properly at the end of the page, the alignment does not. See below.  However, this solution is still pretty bad... not only due to the alignment I can't fix, but also because it spoils all other tabularx tables. The next image shows how a table using \begin{tabularx}{\textwidth}{@{}Y|Y|Y@{}} becomes different. See how it changes below.

I have been trying to add caption and label to a long table (not entirely written below) inside the xltabular environment. After checking ,  and some other posts, I did this:  \usepackage{xltabular} \usepackage{caption} \captionsetup[table]{skip=-10pt}  \captionof{table}{My Table} \begin{xltabular}{\textwidth}{@{}Y|Y|Y@{}}     0.0  & 0    & 0      \\     1.0  & 1000 & 0      \\     2.0  & 2000 & 0  \end{xltabular}   which kinda works. However, I keep getting yellow warning messages:  Package caption Warning: \captionsetup{type*=...} or \captionof outside box or environment on input line 161.  Package caption Warning: The option 'hypcap=true' will be ignored for this particular \caption on input line 161.   Also, \captionsetup[table]{skip=-10pt} stops working if I use \captionof{table}{My Table} and I need it because the space between the table and the caption is too large.  How can I solve these problems without using table environment (it makes my table start in a new page)?


Due to the recent update to Guild Wars 2, which has changed the trait system, I've heard lots of people asking "What's the new meta?" and "Meta hasn't been outed yet"  In this context, what does "meta" mean? I assume they are talking about specific builds, or trait and skill combinations, so why is it called 'meta'?

What is so called meta-game in StarCraft 2?    What other games have this meta-game?


I have read almost every other post about size_t on SO but still i cant get why it should be used. Also i would like to know more about it.  I already know that it is unsigned,it cannot be negative,it is used to represent size of the object.

In several C++ examples I see a use of the type size_t where I would have used a simple int. What's the difference, and why size_t should be better?


I confused about how to calculate the PROBABILITIES and getting a certain result of measuring Bell's states with Pauli matrices as the operator. When you measure something, the state involved would be projected onto an eigenstate of the observable. Given $|ψ⟩ = \frac{1}{\sqrt2} (|01⟩ + |10⟩)$ as the state and $σy   = \left(\begin{matrix}0&-i\\i&0\\\end{matrix}\right)$ as the observable. How to calculate probability on the first qubit actually? What is the state after measurement?

I confused about how to calculate the probabilities and getting a certain result of measuring Bell's states with Pauli matrices as the operator. When you measure something, the state involved would be projected onto an eigenstate of the observable. given $|\psi\rangle = \frac{1}{\sqrt2} (|01⟩ + |10⟩)$ as the state and $\sigma_x = \left[\begin{matrix}0&1\\1&0\\\end{matrix}\right]$ as the observable. if the probability is 1/2, how to calculate them actually? What is the state after measurement?


I keep reading that the Bluetooth Low Energy modules are capable of working with a CR2032 battery for years, but their consumption is around 20mA and the max discharge of a CR2032 is around 3mA (200uA standard). How could this be possible?  I'm pretty sure it has something to do with the pulse discharge current, but the datasheets usually don't have a lot of information about that. In this case how can I determine the relation between the discharge current and the duration of the pulse?

I'm trying to determine which battery to use for my application. I'll be using a class 1 or class 2 Bluetooth (not low energy) module, which requires about ~50/60mA of RX/TX current. In addition, there is a microcontroller and some low power analog IC's. I require a continuous stream of data from the device for 1-10 minutes.  Are coin cells completely out of the question? I'm talking about CR2450 Lithium-ions. I don't really mind if they don't last long, but will they work? Because in my application, size is key, and battery life is a trade off that I'm willing to make.


The lifecycle of the Maker apparently contains stages when it produces spice (actually its precursor), and stage when it feeds on sand plankton, which are said to consume spice.   Where is the source of energy for the whole food chain? Where are the autotrophic organisms?  Are the sand plankton photosynthetisating, or are the sandtrouts using geothermal power?

In Frank Herbert's Dune books, the planet Arrakis has an interesting and well thought-out alien ecology. As summarised in , the sandworms eat sandplankton (which consists, at least in part, of larval sandworms), while the sandplankton eat the spice, which is produced by side-effects of the sandworm life cycle.  However, one thing has always bothered me about this: where does the energy come from? On Earth, most ecosystems are powered ultimately by sunlight, while others are powered by . But either way, you need a source of energy or life can't survive.  There seems to be no substantial photosynthesis on Dune, since the planet is almost all either open sand or bare rock. (Some plants are mentioned, but they are all familiar Earth species and were presumably brought there by humans.) Perhaps the sand plankton, or even the sandtrouts or the sandworms themselves, are  --- but if so, where do they get their energy from? In short, where are the  of the Dune ecosystem, and what do they eat?  To the best of my knowledge, this issue isn't mentioned in the original book, but Herbert wrote a lot of sequels, and it seems that having a plausible ecology is something he cared about, so I'm wondering if he addressed this point in any of his later works.


I want to change the value of the parameter sumOfCorrect. For some reason it isn't changing. Any suggestions? Basically the program asks ten simple mathematic questions and i want it to print how many of those did the user anwsered correctly.  import java.util.Scanner; import java.util.Random; public class HardEx3{     public static void main(String[] args){         Scanner scanner = new Scanner(System.in);         Random random = new Random();         int sumOfTimes = 0;         int sumOfCorrect = 0;         do{             int n1 = 1 + random.nextInt(9);             int n2 = 1 + random.nextInt(9);             multiplication3 test = new multiplication3();             test.question(n1,n2,sumOfCorrect);             sumOfTimes += 1;             System.out.println(sumOfCorrect);         }while(sumOfTimes < 10);     } } class multiplication3{     Scanner scanner = new Scanner(System.in);     Random random = new Random();     int question(int n1, int n2,int sumOfCorrect){             System.out.println("Με τι ισούται " + n1 + " " + "επί " + n2 + "?:");             int rightAnswer = n1 * n2;             int answer = scanner.nextInt();             if (rightAnswer == answer) {                 int positiveM = 1 + random.nextInt(4);                 switch (positiveM){                     case 1: System.out.println("Πολύ καλά!");                         break;                     case 2: System.out.println("Εξαιρετικά!");                         break;                     case 3: System.out.println("Καλή δουλειά!");                         break;                     case 4: System.out.println("Συνέχισε το ίδιο καλά!");                         break;                 }                 sumOfCorrect += 1;             }             else{                 int negativeM = 1 + random.nextInt(4);                 switch (negativeM){                     case 1:System.out.println("Όχι, παρακαλώ προσπαθήστε ξανά.");                         break;                     case 2:System.out.println("Λάθος, προσπάθησε άλλη μία φορά.");                         break;                     case 3:System.out.println("Μην τα παρατάς!");                         break;                     case 4:System.out.println("Όχι, συνέχισε την προσπάθεια.");                         break;                 }             }             return sumOfCorrect;     } }

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


When a particle keeps "accelerating" near the speed of light, is the energy gained expressed in linearly gained impulse, or relativistic mass?

Some people say that mass increases with speed, some people say that the mass of an object is independent of its speed.  I understand how some (though not many) things in physics are a matter of interpretation based on one's definitions. But I can't get my head around how both can be 'true' is any sense of the word.  Either mass increases or it doesn't, right?  Can't we just measure it, and find out which 'interpretation' is right? e.g.: (in some sophisticated way) heat up some particles in a box and measure their weight?  ------------------------------  UPDATE  Right, so I've got two identical containers, each with identical amounts of water, each on identical weighing scales, and each in the same g field. If one container has hotter water, will the reading on its scale be larger than the other? If the answer is yes, and g is constant, does this mean that the m in w=mg has got bigger?


I want to get onto a Pixelmon server, but I'm wondering if I need the mod installed locally in order to be on the server?

I'm wondering if I could play Minecraft with my friend. A modded Minecraft, only myself with mods and him without mods.  Is it possible?


Why can't the pair production process occur in empty space? I have read that a nucleus must exist and this is how it is useful: that the photon turns into virtual loops of e+ e- and one of them interacts with the field of a real charged particle exchanging enough energy and momentum so that both e+e- become real while energy and momentum are conserved in a three body diagram. What I don't understand is how the photon turns to virtual loops of e+e- what do they mean what are they... You know  there are lots of info from the Internet that now I knew them, my professor doesn't explain much, he just says that positron with a nucleus gives.... Etc so he just writes the equation but I'd really like to know specific details and it takes so much time from me.. :(

So I've been looking into particle-antiparticle pair production from a gamma ray and don't understand one thing.  Let's say I have a 1,1 MeV photon and it hits a nucleus - electron-positron pair with some momentum will be created and the nucleus will probably get some momentum as well because of the impact.  But why does the photon need the nucleus at all? Why can't it just fly through space and suddenly, with some probability, change into a electron-positron pair with momentum? I see that the momentum of the system wouldn't be conserved but I don't really understand how the nucleus helps it.


I am trying to get live tick from google finance site using  urllib,request but  it returns a lot of data but I want to select the only price so how do I select that without using loops **I want that thing from HTML ["INFY","Infosys Ltd","894.70","-0.90","chr"]  import urllib.request response = urllib.request.urlopen('https://www.google.com/finance?q=NSE:INFY') html = response.read()

I'm looking for access to financial data from Google services.   I found  that gets the stock data for Microsoft.  What are all the possible parameters that Google allows for this kind of HTTP request? I'd like to see all the different information that I could get.


A city's population in the $n^{th}$ year is denoted by $x_n$ (in millions). If, $\forall n \in \mathbb N^+$, we have: $x_1 = \frac34$, $x_{n+1} = 2x_n - x_n^2$, show that as $n \to \infty$, the population will tend to a finite limit. What is this limit?    For this question, I am supposed to use the Monotone Convergence Theorem, so I decided to start off by showing that that sequence $(x_n)$ is bounded. I wrote:    For each $n \in \mathbb N^+$, $x_n \ge 0$ (population cannot be negative). Also, $x_{n+1} = x_n(2 - x_n)$. If $x_n > 2$ then $x_{n+1} < 0$ which is an impossibility. Therefore $0 \le x_n \le 2$ and so $(x_n)$ is bounded.    For the "monotone" part of the proof, I computed a couple of terms of the sequence and realised that it was increasing towards the value $1$. I tried induction but got stuck. Here's what I wrote:    Let $P(n)$ be the proposition that $x_n \le x_{n+1}$. $P(1)$ is true (not gonna show the working here). Assume that $P(k)$ is true for some $k \in \mathbb N^+$, i.e. $x_k \le x_{k+1}$. Then I need to show $x_{k+1} \le x_{k+2} = 2x_{k+1} - x_{k+1}^2$. We have $x_{k+1} = 2x_k - x_k^2 \le 2x_{k+1} - x_k^2$. But from the inductive hypothesis we get $x_k^2 \le x_{k+1}^2$, which means $2x_{k+1} - x_k^2 \ge 2x_{k+1} - x_{k+1}^2$ and so we can't conclude $x_{k+1} \le x_{k+2}$?    Any help in this question is appreciated.

I'm stuck with the prove of the following recurrence sequence which was part of and old exam.  $a_1:=\frac{1}{2}, a_{n+1}:=a_n(2-a_n)$ for $n \in \mathbb{N}$   I have to show that $0 <a_n < 1$ and as a second part (b), that its monotonic increasing (That's where I got stuck) and as a thid part (c) the convergence and limit of the sequence  a) My approach was to use induction to show that the sequence is upper and lower bounded: Base case: $ n=1, a_1 < 1 = \frac{1}{2} <1 $ ok Inductive step: $n\rightarrow n+1$ $a_{n+2} = a_{n+1}(2-a_{n+1}) < 1$      Then my idea was to rewrite it as using the given definition from $a_{n+1}$: $a_{n+2}=a_n(2-a_n)(2-(a_n(2-a_n))$  and I know that $a_n<1$ Then I used the base case that $a_n=\frac{1}{2}<1$ so that I've got $ 0 < \frac{3}{4}*(2-\frac{3}{4}) = 0.9375 <1$   Question: Is this right?  b) For the second part of the task, to show montonic increasing I know that $a_{n+1} \leq a_n$ or $a_{n+1}-a_n\leq 0$ $a_{n+1}=a_n(2-a_n)  \geq 0 \Leftrightarrow a_n-a_n^2 \geq 0 \Rightarrow a_n^2-a_n \geq 0$ Here I got stuck:    Question: How do I make the final conclusion?  c) Limes: $a_n \rightarrow a$ $a=a(2-a) \Leftrightarrow a=2a-a^2 \Rightarrow a^2-a=0$ Solving gives $a_1=1$ and $a_2=0$ Because the sequence is monotonic increasing it converges and it must be $>0$ so the $\lim(a_n) =1$  Question: Is that conclusion "exact", I mean can I use this conlcusion or is there something missing?  Best Regards, Christoph


Given that $\det(I + uv^T) = 1 + v^T u$, show that $$\det(A + uv^T) = (1 - v^T(A^{-1}u))\det(A)$$ where $A \in R^{n \times n}$ is an invertible matrix.   My attempt: $\det(A + uv^T) = \det(A(I + A^{-1}uv^T) = \det(A) \times \det(I + A^{-1}uv^T)$. But how to continue from here using the given?

Let $A$ be an invertible square matrix. Prove that $$ |A + uv^T| = (1 + v^T A^{-1} u) |A|. $$   My attempt $|A + uv^T| = \left|A (I + A^{-1}uv^T)\right| = |A| |I + A^{-1} uv^T|$ I'm trying to use the following fact, $$(I + ab^T)^{-1} = I - \frac{1}{1+b^T a}ab^T$$ but it seems quite tricky because of the $A^{-1}$ part.


Use Lagrange's theorem to prove that if $G$ is a finite group of order $n$ then the map $x \to x^k$ is surjective.   Edit: (n,k) = 1 which I completely blanked on mentioning. Also I truthfully have no idea how my post is a duplicate.  My attempt: First prove $x^k$ is a subgroup of $G$. It is a subset because is some element of $x$ of $G$ and $x^k$ was not in $G$, $G$ won't be closed under addition. This subset is non-empty since it contains the identity element because $1^k=1$. It should be closed under multiplication because $\varphi(ab) = a^k b^k = \varphi(a) \varphi(b)$. I am reasonably confident that I am correct through here.   Let $|G| = n$ and $|H| = m$ for easier notation. Then by Lagrange's theorem $\frac{n}{m} = c$ with $c \in \Bbb Z$, $1 \leq c \leq n$. Then maybe I could use $n = c\cdot m$ so $\gcd(n,k) = 1 = \gcd(c\cdot m,k)$ which implies $\gcd(m,k) = 1$. But, if this reasoning is even correct, I don't know what to do now with it.

Suppose $G$ has odd order, show the function $f:G\rightarrow G$ defined by $f(x)=x^2$ is injective. This proposition is easily provable if we assume $G$ is Abelian, but I don't know how to start this without the assumption of being Abelian.


I am using Ubuntu 16.04 and I have noticed that from time to time a process named MainThread appears in my machine. I couldn't find out in which program it belong to though. Besides that I have noticed that if I kill it it doesn't seem to affect my machine. The reason I am interested in killing it is because it allocates some memory I need from my RAM (about half a GB).  So, I am wondering what's this process about and if it's OK to kill it (if I am missing something here I mean)?

This morning, running top, I noticed a process I nave never seen before in my Ubuntu 18.04 laptop called MainThread, which was periodically using a lot of CPU . There was also an entry called Privileged Cont. I recently installed nordvpn, but nordvpn support said the process is not theirs. Is this a new part of the operating system? Is it malware? It has never appeared in top on my laptop before, as far as I know.


I've seen a few posts discussing "what have you tried" comments here, but I thought I'd throw a suggestion out there after recently noticing quite a few of these comments on SO.  If the user has less than x reputation points, posts a question with a programming language tag (e.g. C#), and hasn't used the code tags in their question, then a pop up or alternative page could be shown explicitly asking the user what they have tried. They can leave this blank, but it ensures that they have purposely avoided showing code and, therefore, have not misunderstood that SO isn't for writing your code. This also helps avoid questions being closed when the user is genuinely unaware that this isn't considered a good question.   I understand not every question will be suited to this, but it might be an idea for users posting their first question or have a rep level below 15, for example.

Recently on SO, I've been noticing a lot of link-only comments on (admittedly bad) questions.  The typical comment looks like this:        Now, my first instinct is to flag the comment as "not constructive" or "too chatty", but the fact is that the blog post linked to is actually good advice.  On the whole though, the way it is being wielded like a blunt instrument comes across as—at best—lazy arrogance in my opinion and is not adding anything to the network.  Can we ban "What have you tried?" links like we did with ?  An example:    To be clear, I'm not proposing that we stop people asking for clarification or expecting askers to explain themselves properly. I just don't think comments like these are particularly constructive.


How could the Alien know that Ellen Ripley is going to blow up the Nostromo? He deliberately hid himself in the emergency ship in order to survive the explosion. Did he follow her? Is he super intelligent and knew how human spaceships operate? Why didn’t he kill her after she sent off the emergency ship?

In the last scene of Alien, Ripley escapes in a shuttle craft. She screams when she sees that the alien is onboard. Why didn't the alien kill her immediately when she boarded the shuttle craft? Is it sleeping? How deaf would a 'perfect' species have to be to not hear someone scream at the top of her lungs right next to you?


Two days ago I tried to order a book but could not pay because your system  has not accepted Paypal payments yet. I don't understand why present perfect with yet can not be used yet means that one day the system will accept this payment but not now, so I really don't understand why it is not possible.

Two days ago I tried to order a book but could not pay because your system  did not accept/ has not accepted paypal payments yet. if I choose to add  yet with past simple it means that at the time of writing  they still don't accept paypal payment but it has been planned . Past simple because it is a precise moment in the past. Would it be possible top use present perfect because the situation has not changed yet even if it also been planned .


In Visual Studio 2017 when creating Linux project and inserting using namespace std; in source code like this:  #include <iostream> #include <string>  using namespace std;  int main() {     size_t i = 1;     string s = to_string(i);     cout << i << s << endl;     return 0; }   VS underlines size_t and says that it is an ambiguous symbol.  If I press F12 (Go to definition) it offers me two definition places:  From stddef.h  (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Linux\include\usr\include\x86_64-linux-gnu\5\include\stddef.h):  // ... namespace std {   typedef __SIZE_TYPE__     size_t; // ...   And c++config.h  (C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\Linux\include\usr\include\x86_64-linux-gnu\c++\5\bits\c++config.h):  // ... #if !(defined (__GNUG__) && defined (size_t)) typedef __SIZE_TYPE__ size_t; // ...   It happens only with Linux projects in VS, not with Windows projects.  Is there any known solution (except for "do not use using namespace std; :) )?  Upd: Reported this problem to Microsoft:   Upd2: Microsoft says that they fixed it, and solution will be in next update:

In several C++ examples I see a use of the type size_t where I would have used a simple int. What's the difference, and why size_t should be better?


When buying ham slices from supermarket, I get like 10 slices in them. I want to use it for a week.  But the packing says when once opened it should be used within 2 days. So it seems like the 8 slices just always goes into bin. Is it safe for me to keep it from Monday to Friday?  And is there a way to store them?

How do I know if a given food or ingredient I have is still good, or if I should discard it?  How can I best preserve a food or ingredient?     This broad question is intended as a "general reference" question to quickly answer many how long will food keep for? questions. Please feel free to edit this question to expand and clarify as needed.


Has this bug been fixed in Ubuntu 18.04? Or it's the same as 16.04 where it hangs for eternity. p.s I don't want to pass that c state parameter it just eats up my battery a lot.

I want to know, if this bug is fixed, because all previous versions of Ubuntu didn't work for me. So I just want to know, should i leave Windows 10 and go for Ubuntu 17.10. Thanks!


Given two Fermat's number $a=2^{2^n}+1$ and $b=2^{2^m}+1$ with $n,m\in\mathbb{Z}, ~n,m\ge0~\wedge~n\ne m$. Prove $\gcd(a,b)=1$.


$\lim_{x\to\infty }\frac{q^{x}}{x!}$ I need to find a limit of this sequence and prove it using the definition.  I know that we can have several variants of the limit of $q^{x}$: if $1>q>-1$ the limit is $0$, for $q=1$ the limit is $1$, for $q>1$ the limit is $\infty $,  and for $q\leq -1$ it doesn't exist.  The limit of factorial $x!$ should be $\infty $, but I'm not sure and I don't know how to prove it.  Can you help me please with the whole fraction.  I don't know how to find a limit if we have something like $\frac{0}{\infty }$ or $\frac{1}{\infty }$ or $\frac{\infty}{\infty }$.

First I tried to use integration: $$y=\lim_{n\to\infty}\frac{a^n}{n!}=\lim_{n\to\infty}\frac{a}{1}\cdot\frac{a}{2}\cdot\frac{a}{3}\cdots\frac{a}{n}$$ $$\log y=\lim_{n\to\infty}\sum_{r=1}^n\log\frac{a}{r}$$ But I could not express it as a riemann integral. Now I am thinking about sandwich theorem.  $$\frac{a}{n!}=\frac{a}{1}\cdot\frac{a}{2}\cdot\frac{a}{3}\cdots\frac{a}{t} \cdot\frac{a}{t+1}\cdot\frac{a}{t+2}\cdots\frac{a}{n}=\frac{a}{t!}\cdot\frac{a}{t+1}\cdot\frac{a}{t+2}\cdots\frac{a}{n}$$ Since $\frac{a}{t+1}>\frac{a}{t+2}>\frac{a}{t+1}>\cdots>\frac{a}{n}$ $$\frac{a^n}{n!}<\frac{a^t}{t!}\cdot\big(\frac{a}{t+1}\big)^{n-t}$$ since $\frac{a}{t+1}<1$, $$\lim_{n\to\infty}\big(\frac{a}{t+1}\big)^{n-t}=0$$ Hence, $$\lim_{n\to\infty}\frac{a^t}{t!}\big(\frac{a}{t+1}\big)^{n-t}=0$$ And by using sandwich theorem, $y=0$. Is this correct?


I've been watching countless tutorials but still can't quite understand how to prove something like the following: $$\sum_{i=1}^ni^2=\frac{n(n+1)(2n+1)}{6}$$    The ^2 is throwing me off, I really wish I can show you what I've already tried but I have absolutely no clue where to start. I've also looked around for similar problems but can't find any that start with ^2.  I appreciate all help whatsoever, thank you!

I encountered the following induction proof on a practice exam for calculus:  $$\sum_{k=1}^nk^2 = \frac{n(n+1)(2n+1)}{6}$$  I have to prove this statement with induction.  Can anyone please help me with this proof?


when i press the mirror modifer nothing happens to my shape im a noob at blender so could someone please help? i've tried all other solutions that related to my post but none of them worked.

I'm learning how to use the mirror modifier and I am having some trouble.  When I apply the modifier to my object I don't see a mirrored version of it.  What am I doing wrong?


The following is an exercise in Hungerford (Ch. III, ex. 5.6).     Let $R$ be a commutative ring with identity. If $f=a_nx^n+\dots+a_0$ is a zero divisor   in $R[x]$, then there exists a nonzero $b$ in $R$ such that $ba_n=ba_{n-1}=\dots=ba_0=0$.   I can see for example that $\{g\in R[x]\mid fg=0\}$ is a nonzero ideal, so it contains a nonzero element of smallest degree.  But how to show that such an element is actually a constant?

Let $R$ be commutative ring with no (nonzero) nilpotents. If $f(x) = a_0+a_1x+\cdots+a_nx^n$ is a zero divisor in $R[x]$, how do I show there's an element $b \ne 0$ in $R$ such that $ba_0=ba_1=\cdots=ba_n=0$?


I use the old 2007 white macbook (that works great). There's a thunderbolt display lying idle in our office, and I wish to connect it to my macbook. The macbook has a mini DVI port. I searched online for a mini DVI male to thunderbolt female adapter, but couldn't find anything. Does such a thing not exist?

I have an older macbook pro with a mini display port. Can I use a Thunderbolt display as an external monitor?


I am beginners to LaTeX and I have been trying to learn Tikz & PSTricks for graphics.  My Question is: Is there any other software available in which we can draw our desirable figures (like graphs of equations, all mathematics geometric figures and etc.) and  which help us to generate codes for figure?

Are there any   editors for ? Perhaps something similar to    but for PGF/TikZ?   If there is no WYSIWYG editor for this tandem, is there one perhaps that allows the user to easily generate PGF/TikZ templates?  Alternatively, how can I most easily generate PFG/TikZ code from a visual conception? Do people mostly code their PGF/TikZ graphics from scratch?


Can I use the MTG card  in my mono black commander deck? It's a multi-colored card - black/white - but it pays for either four swamps (black mana) or four plains (white mana). I know of the rule in commander indicating that "All cards must be in the color identity of the commander." But since this is a black/white and can pay for either four black or four white, I just want to clarify. So, my question is Can I use Divinity of Pride in a mono black commander deck? If not, then what card is/similar to Divinity of Pride but is a mono black?

I recently began playing commander, and have run into a few questions, mainly about color compatibility with a commander. I think I can lump them all together into this one question: What exactly determines color identity in cards? And then just a few specific examples to make sure I'm understanding this correctly:  If my blue commander has an activated ability in non-blue color(s), what colors can I run in the deck? e.g.:   For a mono-blue commander deck, can I have a card with a non-blue color(s) activated ability in the deck? e.g.:   For a mono-blue commander deck, can I include in my deck a card with a hybrid mana cost that can be cast with either blue or non-blue mana? e.g.:   For a mono-blue commander deck, can I have a card that makes non-blue mana? e.g.:


I was looking into a Numberphile video . The guy says he was unable to find an intuition. Does there exist one? Is the premise, $1-1+1-1+...=\frac{1}{2}$, reasonable mathematically?

$\displaystyle\sum_{n=1}^\infty \frac{1}{n^s}$ only converges to $\zeta(s)$ if $\text{Re}(s) > 1$.  Why should analytically continuing to $\zeta(-1)$ give the right answer?


On Big Sur, every time I restart, I get asked asked again if I want to enable ask siri.  Is there a way to get it to stop asking?

macOS Sierra is constantly displaying an "Enable Siri?" dialog. If I pick cancel it just pops up again 5 seconds later.     How do I tell macOS Sierra to stop asking?


I can't find both Diffuse BDSF and Material Output, i am in fact in cycles render. Here is an image to show   Help would be highly appreciated since i can't really do anything without it at the moment.

I have been following  tutorial until I started adding nodes. The problem is that he has completely different nodes than I have. Even nodes that are created at start are different (I have Material and Output and he has Render Layers and Composite). Have I missed something or should I use different nodes than he?


suggests that the sum of two t-distributions is never t distributed.   With t distribution I mean the (non-standardized) t distribution with location and scale parameter.  Now, let $Y_1,Y_2$ be independently t distributed with same dof $\nu$, location $\mu$ and scale $\sigma$.  Then the sum is given by $X = Y_1+Y_2 = (\mu+\sqrt{\nu/V}\sigma Z_1) + (\mu+\sqrt{\nu/V}\sigma Z_2)$, where $V$ is $\chi^2$ distributed with $\nu$ degrees of freedom and $Z_1,Z_2\stackrel{iid}{\sim}N(0,1)$. Since the sum of two independent $N(0,1)$ is $N(0,2)$, it follows that $X = 2\mu+\sqrt{\nu/V}\sqrt{2}{\sigma}Z$, where $Z\sim N(0,1)$. Thus $X$ is t distributed with unchanged dof, twice the location and new scale $\sqrt{2}\sigma$.   So am I missing something?

... and why ?  Assuming $X_1$,$X_2$ are independent random-variables with mean $\mu_1,\mu_2$ and variance $\sigma^2_1,\sigma^2_2$ respectively. My basic statistics book tells me that the distribution of the $X_1-X_2$ has the following properties:    $E(X_1-X_2)=\mu_1-\mu_2$ $Var(X_1-X_2)=\sigma^2_1 +\sigma^2_2$   Now let's say $X_1$, $X_2$  are t-distributions with $n_1-1$, $n_2-2$ degrees of freedom. What is the distribution of $X_1-X_2$ ?   This question has been edited: The original question was "What are the degrees of freedom of the difference of two t-distributions ?". mpiktas has already pointed out that this makes no sense since $X_1-X_2$ is not t-distributed, no matter how approximately normal $X_1,X_2$ (i.e. high df) may be.


We want to knock the kitchen and dining room into 1 room and I am hoping someone can help tell me if the highlighted wall is non load bearing The house is a bungalow

We want to knock the kitchen and dining room into 1 room and I am hoping someone can help tell me if the highlighted wall is non load bearing:


What if a scene calls for an actor to pull out a cigarette and light up? But the actor isn’t a smoker?   Are there fake cigarette props? Vapor cigs that don’t have any nicotine or harm to the lungs?   How does that typically work? Please no “do you know Hollywood culture?” answers. I’m asking for serious answers.

Many movies depict children and minors (and non smoking actors) actively smoking a cigarette and blowing actual smoke. How is that done?


We've defined the square root of -1 as an imaginary number i (or j, if you're a physicist).   Is there any reason why we can't/haven't made other systems of imaginary numbers for other "impossible" operations, like log base 1 or dividing by zero?

Before, the concept of imaginary numbers, the number $i = \sqrt{-1}$ was shown to have no solution among the numbers that we had. So we declared $i$ to be a new type of number. How come we don't do the same for other "impossible" equations, such as $x = x + 1$, or $x = 1/0$?  Edit: OK, a lot of people have said that a number $x$ such that $x = x + 1$ would break the rule that $0 \neq 1$. However, let's look at the extension from whole numbers to include negative numbers (yes, I said that I wasn't going to include this) by defining $-1$ to be the number such that $-1 + 1 = 0$. Note that this breaks the "rule" that "if $x \leq y$, then $ax \leq ay$", which was true for all $a, x, y$ before the introduction of negative numbers. So I'm not convinced that "That would break some obvious truth about all numbers" is necessarily an argument against this sort of thing.


I have an object with tow properties and string, where I have the object name. I want to change object name with object value global, but not working. let obj = {   name: 'year',   value: '2020', };  let str = 'year year';  str.replace(/obj.name/g, obj.value);

I would like to create a String.replaceAll() method in JavaScript and I'm thinking that using a regex would be most terse way to do it.  However, I can't figure out how to pass a variable in to a regex.  I can do this already which will replace all the instances of "B" with "A".  "ABABAB".replace(/B/g, "A");   But I want to do something like this:  String.prototype.replaceAll = function(replaceThis, withThis) {     this.replace(/replaceThis/g, withThis); };   But obviously this will only replace the text "replaceThis"...so how do I pass this variable in to my regex string?


Made 12.04 64-bit USB bootable. Then I have been trying to install almost like twenty times to get succeed but still its failing / crashing/ freezing, after showing Grub screen.  What can I do to fix this? I have tried nomodeset and vga=770  Steps tried:    power on, bios shows I select the kernel and press e to go in details and press F10 to boot nothing just happens    Steps tried:   power on, bios shows hold shift key to have grub  press f2 to go to grub command line    But unable to boot in the installed OS

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


Before you point me to the countless answers of how to change backgrounds, here is the above question in DETAIL.   In Windows 10, every morning it comes up with a new photo background asking me if I like the background. If I respond on the upper right part of the screen with a YES, Windows 10 records that I like it and it becomes one of the images in my backgrounds collection and is used in rotation with other images I like.  There were a few images I accidentally said yes to when I meant to say no. Is there a way to reset this rotation to start over or maybe a way I can go back and remove that specific image from my selected images in the collection so that it will no longer be in my collection of backgrounds?

I am using Windows Spotlight on the lock screen of my Windows 10 laptop, and I have accidently liked some photos, and the keep coming up. is there a way to 'change your mind' about a photo, or just reset the whole thing?


What does "?" mean in this code?  #include <iostream> using namespace std;  int main () {     int size;     cout<<"Enter size: ";     cin>>size;     for (int row=1; row<=size;row++)     {         for (int col=1; col<=size;col++)             (row==col)?                 <------------------ this is what i mean             cout <<"*":cout<<" ";         for(int col=size-1;col>=1;col--)             (row==col)?             cout <<"*":cout <<" ";         cout <<endl;     }     return 0; }

I've always wondered how to write the "A ? B : C" syntax in a C++ compatible language.  I think it works something like: (Pseudo code)  If A > B    C = A Else    C = B   Will any veteran C++ programmer please help me out?


i have an asp.net webform (C#) project but when i try to build and compile project on two pc (same source code) result binary in bin are different,  Visual Studio 2015 and same publish profile settings  how we can explain why same source code make different output binary on checksum?  also i read:

When I do a clean build my C# project, the produced dll is different then the previously built one (which I saved separately). No code changes were made, just clean and rebuild.   Diff shows some bytes in the DLL have changes -- few near the beginning and few near the end, but I can't figure out what these represent. Does anybody have insights on why this is happening and how to prevent it?   This is using Visual Studio 2005 / WinForms.  Update: Not using automatic version incrementing, or signing the assembly. If it's a timestamp of some sort, how to I prevent VS from writing it?   Update: After looking in Ildasm/diff, it seems like the following items are different:   Two bytes in PE header at the start of the file. <PrivateImplementationDetails>{guid} section  Cryptic part of the string table near the end (wonder why, I did not change the strings) Parts of assembly info at the end of file.   No idea how to eliminate any of these, if at all possible...


I am trying to create a Beamer file with some images alongside lists. However, when I insert my image it either does not appear or it shifts it half off the slide to the rigth - see below. My question is how do I move it into the white space above? I did try seperating the page into columns but had the same issue. Any help would be appreciated.  My code:  \frame{     \frametitle{Coordinate Systems}     \begin{itemize}         \item Cartesian          \item Cylindrical          \item Spherical      \end{itemize}  \begin{figure}[h!]\centering     \includegraphics[scale=0.1]{C:/Users/john/Documents/Uni/MMath/Major Project/Major Report/Python/Co-ordiantes/sphere_no_numbers.png} \end{figure}  }

I am writing a LaTeX document with the apacite and graphicx package. The issue is when I include an image either using figure with an enclosed \includegraphics or \includegraphics by itself it shows the image with the file name to the side.  For example:              --------------             |             |             |    BOX 1    |               --------------- Error1.jpg   I do not want it to write Error1.jpg. Would show the image but it seems I do not have enough rep.  This is an example tex file to show the error (with Windows XP, using Miktex 2.8).  \documentclass[man]{apa} \usepackage{apacite} \usepackage{graphicx} \usepackage[utf8]{inputenc} \usepackage[english]{babel} \begin{document}   \includegraphics{Example Error1.jpg} \begin{figure}[htb] \includegraphics{Example Error1.jpg} \caption{This is the caption of the figure.} \label{fig:fig2} \end{figure} \end{document}


If $p_n(z)$ is a polynomial with degree $n$ and $|p_n(z)|\le M$ for all $|z|<1$, then $|p_n(z)|\le M |z|^n$ for all $1\le |z| < \infty$. It sounds reasonable. For example, take $n=3$, and $p_n(z) = 1 + \frac{z}{2} + \frac{z^2}{3}$ , then $M=1+\frac12+\frac13=1\frac56$; while $q_n(z):= \frac{p_n(z)}{z^n} = \frac13 + \frac1{2z}+\frac1{z^2}$, it does sounds get its maximum at $z=1$ and the maximum is just $M$. But I'm a bit lost, couldn't find a way to prove it. Pls kindly suggest where can I go?

Let $p(z)= \sum_{k=0}^n a_k z^k$ ,  $a_n \neq 0$ , be a polynomial of degree $n$ such that $|p(z)| \leq M$ for $|z| \leq 1$.  Show that $|p(z)| \leq M|z|^n$ for $|z| \geq 1$  This was an exam question. Part (a) of this question asked the converse: if $|p(z)| \leq M|z|^n$ and $|z|$ is sufficiently large, then $p(z)$ is a polynomial. This question came straight out of Ahlfors' Complex Analysis, which I solved by showing, using the Cauchy Estimate,  $|p^n (z)|  \leq \frac{n!M|z|^k}{R^n} = 0$ as $R \to \infty$.   I would like to work backwards with this.   May I do this, or similar:   $p(z) = \frac{1}{2\pi i} \int_{c} \frac{f(\zeta)d\zeta}{\zeta-z}$  $\Rightarrow  |p(z)| \leq \frac{2\pi M|z|^n}{1(2\pi)}= M|z|^n$


I have the following URL  https://website.com?id=XXXVVVCCCHHH   I only want XXXVVVCCCHHH, I've tried the following:  var phrase = 'https://website.com?id=XXXVVVCCCHHH';  var myRegexp = /id=(.*)/; phrase = myRegexp.exec(phrase);   But this is returning: id=XXXVVVCCCHHH;  How can Ii edit this to only return XXXVVVCCCHHH?

I want to match a portion of a string using a  and then access that parenthesized substring:  var myString = "something format_abc"; // I want "abc"  var arr = /(?:^|\s)format_(.*?)(?:\s|$)/.exec(myString);  console.log(arr);     // Prints: [" format_abc", "abc"] .. so far so good. console.log(arr[1]);  // Prints: undefined  (???) console.log(arr[0]);  // Prints: format_undefined (!!!)   What am I doing wrong?    I've discovered that there was nothing wrong with the regular expression code above: the actual string which I was testing against was this:  "date format_%A"   Reporting that "%A" is undefined seems a very strange behaviour, but it is not directly related to this question, so I've opened a new one, .    The issue was that console.log takes its parameters like a printf statement, and since the string I was logging ("%A") had a special value, it was trying to find the value of the next parameter.


There are rules for zero/definite/indefinite article. And I don't get why we use 'the' with word 'mountains' in the next sentence: I like to spend holidays in the mountains. As for me the correct rule for this case is speaking about things in general, which states that we should use no article (zero article), like in 'I afraid of spiders.' So why we use 'the' + 'mountains' ?

My classmate wrote a text about zoos in general, and the word "zoos" in plural form is mentioned many times in it. Later in the text he uses singular form "zoo" two times with indefinite articles, and both times he still refers to an abstract zoo, not to specific one. He wrote:  The place where animals can obtain shelter is a zoo. You can take the kids to a zoo.  I'm having trouble in figuring out whether it is correct or not. I think that he should have used a definite article the second time, because he already mentioned a singular abstract zoo, but he argues that he refers to "two different singular abstract zoos". So which article should be used in a second sentence?


What is the number of invertible $n \times n$ matrices with entries in a field $k$ with $q$ elements?

$F$ is a finite field of order $q$. What is the size of $\operatorname{GL}_n(F)$ ?  I am reading Dummit and Foote "Abstract Algebra".  The following formula is given:  $(q^n - 1)(q^n - q)\cdots(q^n - q^{n-1})$.  The case for $n = 1$ is trivial.  I understand that for $n = 2$  the first row of the matrix can be any ordered pair of field elements except for $0,0$. and the second row can be any ordered pair of field elements that is not a multiple of the first row.  So for $n = 2$  there are $(q^n - 1)(q^n - q)$ invertible matrices.  For $n\geq 3$, I cannot seem to understand why  the formula works.  I have looked at Sloane's OEIS A002884.  I have also constructed and stared at a list of all $168$ $3\times 3$ invertible matrices over $GF(2)$.  I would most appreciate a concrete and detailed explanation of how say $(2^3 - 1)(2^3 - 2)(2^3 - 2^2)$ counts these $168$ matrices.


This is my Java code to read text from a text file  import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException;  public class checking { public static void main(String[] args) throws IOException {  // Create a BufferedReader from a FileReader. BufferedReader reader = new BufferedReader(new FileReader("pw.txt"));  // Loop over lines in the file and print them. while (true) {     String line = reader.readLine();     if (line == null) {     break;     }      System.out.println(line); // The output is abc     if(line=="abc"){         System.out.println("true");     } else {         System.out.println("false"); //However it show false...     } }  // Close the BufferedReader. reader.close(); } }   Inside pw.txt, there is only one line which the only text in there was abc.  I did an if statement to check if the line is equal to "abc" however the output was false... which I don't quite understand. Did I made any stupid mistakes?

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


I have a project that requires a Debian device to run one simple custom app on a touchscreen from boot to death. It shouldn't be possible to exit the app.  I've looked into Gnome, KDE, XFCE, and Tcl/Tk, but it's hard to tell which are the best for a single app rather than an entire desktop. What are the best options out there?  Bonus points if the solution is in any way easy to program and/or better than average on security.

I would like to make a debian system where you can only open one GUI program at boot, no other graphical interface, no minimize, or any X apart from that program, is there a way to do it on debian if possible, or any other custom distro? I just want to boot open the program and allow the user to only see and use that program.


I want my MacBook pro-2020 to be closed and have one screen as the main screen(desktop) and the other screen as an extended one. I have 2 new Dell UltraSharp U2419HC monitors, and an UltraSharp U2419H (non-usbc). I have connected one screen to my MacBook using type c to type c cable (from screen to MacBook) and another display port cable from one screen to another one. It looks like either my mac detects only one screen, or either I can't get an extended view over the 2 Dell screens. Currently, the 2 Dell screens display the same thing, my Desktop. When I open my MacBook screen, it detects it's own screen and the Dell screen that is attached with the USB c on extended mode but doesn't detect the second Dell monitor. When I get into the System Pref -> Displays I can only see the Dell monitor that is connected with USB c. I have also tried to connect the USB c to a Dell laptop and it did work, so I assume it's not a connectivity issue, and furthermore when I'm connecting the second Dell screen using HDMI cable type c to my MacBook (overall 2 Dell monitors connected directly to my MacBook) it works.

I'm thinking about buying the new MacBook Pro with 4 USB-C ports.  I want to attach two screens, mouse and keyboard and ethernet to the MacBook Pro while using the fewest number of USB-C ports possible.  So what I need is an adaptor with:   two DP or HDMI ports (or one DP port with daisy chaining support) two or more USB ports an ethernet port   Best case would be a hub to which all devices are connected with a single connection to the MacBook Pro, including power supply. Worst case if attaching the MacBook Pro to the devices would require me to use all four of USB-C ports.  Given the answers up to far, I can tell that:   Daisy chaining might or might not work with the MacBook Pro (since it requires DP1.2 which is supported by the graphics chipset, but it's uncertain if it's supported by the MacBook Pro itself) I can attach the monitors with two cables as a last resort, leaving me with two ports for the remaining peripherals.   What I still don't know:   Would daisy chaining work with a hub or does it require the first monitor to be directly attached to the MacBook Pro? Does some kind of hub exist supporting attachment of all listed devices with a single upstream connection to the MacBook Pro?


I'm doing some dynamic A.I. programming and to avoid having to create so many different classes for each use case, so that the parameters can be passed correctly, I thought I'd use an an object bag/container, akin to a dictionary.  In order to support it fully generic, I made the key a Type parameter so I can use it in other projects, which works fine. My issue is, I want to support objects and structs so when it comes to implementing a TryGet style function, I don't know how to assign the out parameter.  Here is my class:  using System; using System.Collections.Generic;  namespace mGuv.Collections {     public class ObjectBag<TKey>     {         private Dictionary<Type, Dictionary<TKey, object>> _objects = new Dictionary<Type, Dictionary<TKey, object>>();          public ObjectBag()         {         }          private bool HasTypeContainer<T>()         {             return _objects.ContainsKey(typeof(T));         }          public bool HasKey<T>(TKey key)         {             if (HasTypeContainer<T>())             {                 return _objects[typeof(T)].ContainsKey(key);             }              return false;         }          public void Add<TIn>(TKey key, TIn value)         {             if(!HasTypeContainer<TIn>())             {                 _objects.Add(typeof(TIn), new Dictionary<TKey, object>());             }              _objects[typeof(TIn)].Add(key, value);         }          public bool TryGet<TOut>(TKey key, out TOut value)         {             if (HasKey<TOut>(key))             {                 value = (TOut)_objects[typeof(TOut)][key];                 return true;             }              // As expected, I can't assign value to null             value = null;               // I also can't just return false as value hasn't been assigned             return false;         }     } }   Is there anyway to assign value to the default of anything that is passed in?  I.e. I want to be able to do:  ObjectBag<string> myBag = new ObjectBag(); myBag.Add<int>("testInt", 123); myBag.Add<TestClass>("testClass", new TestClass(); myBag.TryGet<int>("testInt", out someInt); myBad.TryGet<TestClass>("testClass", out someTestClass);   I don't want to use ref, as that requires initializing the variable before passing it in.

I have a generic method with this (dummy) code (yes I'm aware IList has predicates, but my code is not using IList but some other collection, anyway this is irrelevant for the question...)  static T FindThing<T>(IList collection, int id) where T : IThing, new() {     foreach T thing in collecion     {         if (thing.Id == id)             return thing;     }     return null;  // ERROR: Cannot convert null to type parameter 'T' because it could be a value type. Consider using 'default(T)' instead. }   This gives me a build error      "Cannot convert null to type parameter   'T' because it could be a value type.   Consider using 'default(T)' instead."   Can I avoid this error?


I am using below css to display some content in the boxes. I am unable to bring the text in center of the box. text-align:center doesn't seem to be working. Also tried line-height: 30px; but it adds space between lines. I need this to be at central.   Is there any property I can set to make text in center of the box?    .sideBarList li {   width: 100px;   height: 60px;   margin: 0;   text-align: center;   line-height: 30px;   border-radius: 10px;   background: pink;   margin: 0 10px 100px 30px;   display: inline-block;   vertical-align: top;   color: black;   position: relative;   text-align: center;   font-family: Arial;   font-size: 11px; }

CDE RTR

ABC

 TYTYT YTYYT IIIOO TYTYYTYY RTRTRTR

I have a div with two images and an h1. All of them need to be vertically aligned within the div, next to each other. One of the images needs to be absolute positioned within the div. What is the CSS needed for this to work on all common browsers?

testing...


I'm trying to evaluate the sum of the following infinite series: $$\sum_{n=1}^{\infty}\frac{n}{16^n}$$  I know it converges to $\frac{16}{225}$, but I don't know how to reach this solution. It's not a geometric series or a telescoping sum, and I haven't found any way to relate it to a Taylor or Maclaurin series. How should I approach this problem?

I would like to know: How come that  $$\sum_{n=1}^\infty n x^n=\frac{x}{(x-1)^2}$$  Why isn't it infinity?


When I upgrade an Android application from Google Play, it gets downloaded, then the upgrade stops with the message      Error: Insufficient storage available.   I have a 32 GB SD card so I want to download to the SD card but it only puts apps on the internal memory. How can I get apps to install to the SD card?

I am following this tutorial for moving apps to sd card.    But My Default Location is not changing. And My Phone Memory is full and unable to install new apps.