C++ check if a function exists and if so, invoke

In my current C++ (14 / 17) project, I need a way to, firstly, find a function and, secondly, invoke the function, if it exists.  At the current stage, I already found a way to tell if the function does exist. But now I am unsure how to actually call or invoke it.    Code  This is my current code for detecting, if the functin (std::string toString()) does exist:    /**  * Found at:  * https://stackoverflow.com/a/16824239  */ #include <type_traits>  template<typename, typename T> struct has_function {     static_assert(std::integral_constant<T, false>::value, "Second template parameter needs to be a function type."); };  template<typename C, typename Ret, typename... Args> struct has_function<C, Ret(Args...)> { private:     template<typename T>     static constexpr auto check(T *) -> typename     std::is_same<decltype(std::declval<T>().toString(std::declval<Args>()...)), Ret>::type;      template<typename>     static constexpr std::false_type check(...);      typedef decltype(check<C>(0)) type;  public:     static constexpr bool value = type::value; };   My objects and main function to test for the std::string toString() function:  #include <string> #include <iostream>  struct Object {     virtual auto toString() -> std::string { return "Object"; } };  struct TestObject: Object {     std::string toString() override {         return "TestObject";     } };  struct NonObject { }  int main() {     if (has_function<Object, std::string(void)>::value)         std::cout << "Object has toString()" << std::endl;      if (has_function<TestObject, std::string(void)>::value)         std::cout << "TestObject has toString()" << std::endl;      if (has_function<NonObject, std::string(void)>::value)         std::cout << "NonObject has toString()" << std::endl; }   Which gives the output:  Object has toString()! TestObject has toString()!     Now I am asking for a way to actually calling / invoking std::string toString(). I did try something like this (within the has_function struct):  static constexpr auto call(...) -> Ret {     return decltype(std::declval<C>().toString(std::declval<Args>() ...))(); }   Which does literally nothing (noticeable?) on Object as-well-as on TestObject and does not even compile when used on NonObject. (I probably do misunderstand decltype, declval etc.)  Thanks in advance.    Update  This question is not a duplicate. I am trying to execute / invoke / call the function after it was found. As I already said: I already have the 'is the function declared?' part working (which I got from , as seen above).  In the upper section, I explained my try, which obviously did not work out.


Showing that if $E^*$ is reflexive, then $E$ is reflexive , for a Banach space $E$.

Let $E$ be a banach space. I have already shown that if $E$ is reflexive then $E^{*}$ is reflexive. Now I want to show that     if the dual space  $E^{*}$ is reflexive, then $E$ is reflexive.    If $E^{*}$ is reflexive then, as a corolary, $E^{**}$ is reflexive. Therefore $E^{**}=E^{****}$.   Then, as the canonical injection $J$ is an isometry, $J(E)$ is closed in $E^{**}$, so it is also reflexive, so $J(E)=J(E)^{**} \subset E^{****}$.  How does one conclude from here that $E=E^{**}$?


What contour should be used to evaluate $\int_0^\infty \frac{\sqrt{t}}{1+t^2} dt$

Could anyone help me decide what contour to use to evaluate this integral?  $$\int_0^\infty \frac{\sqrt{t}}{1+t^2} dt$$  So we have simple poles at $i$,$-i$. Why does using a quarter of a circle in the upper right quadrant not work -is it a problem having $i$ on the contour of integration?  My second idea was to let $$\sqrt{t}=e^{\frac{1}{2}\operatorname{log}t}$$  And defining the branch of the logarithm to be the negative imaginary axis. Then using an upper semi-circular contour. With a hole at 0, which will tend to the point 0 as the radius of the semi circle tends to infinity. Then we'll divide by two to get the integral from $0$ to $\infty$. Does this work, as this does not seem to be an even function we're integrating.  I apolygise for the poor explanation of my contours, it's quite difficult without pen and paper!  EDIT: Ok, so using an upper semi circle, with a semicircular hole about $0$. let us call the contour $\gamma$, we have:  $$\int_\gamma \frac{e^{\frac{1}{2}\operatorname{log}t}}{1+t^2}dt =2\pi i\Big(\frac{e^{\frac{1}{2}\operatorname{log}t}}{t+i}\Big)\Big|_{t=i}=\frac{e^{\pi/4}}{2i}$$  But by letting on the positive real axis $z=x+iy$ implies $log(z)=log(x)+0$ and on the negative axis $log(z)=log(x)+\pi$ Therefore if we tend the large arc's radius to infinity and the small arc about the origin's radius to zero we find the integral along the arc tends to zero. So  $$\int_\gamma \frac{e^{\frac{1}{2}\operatorname{log}t}}{1+t^2}dt=\int_0^\infty \frac{\sqrt{x}}{1+x^2} dx+\int_0^\infty \frac{\sqrt{x}e^{\pi/2}}{1+x^2} dx=(1+e^{\pi/2})\int_0^\infty \frac{\sqrt{x}}{1+x^2} dx$$  $$\Rightarrow \int_0^\infty \frac{\sqrt{x}}{1+x^2} =\frac{e^{\pi/4}}{2i(1+e^{\pi/2})}$$  This is wrong but can anyone point out what mistake I have made here?


R glm() with a categorical response variable

I want to know whether I can use glm() with a categorical response variable, and if yes how exactly. I have a response variable with three unordered levels, and both categorical and continuous predictors. Here is an example dataset with just continuous predictors:  outcome <- gl(3,1,20) expl1 <- runif(20, min=0, max=100) expl2 <- runif(20, min=0, max=100)  mod1 <- glm(formula = factor(outcome) ~ expl1 + expl2, family = binomial()) summary(mod1) Coefficients:              Estimate Std. Error z value Pr(>|z|) (Intercept)  0.205746   1.412173   0.146    0.884 expl1       -0.001620   0.016636  -0.097    0.922 expl2        0.008509   0.014943   0.569    0.569   When I compare the output to that of MCMCglmm():  expl <- cbind(expl1, expl2) x <- cbind(outcome, expl)   x <- as.data.frame(x)   IJ <- (1/3) * (diag(2) + matrix(1, 2, 2))  prior = list(R = list(V = IJ, fix = 1))  mod2 <- MCMCglmm(factor(outcome) ~ -1 + trait:(expl1 + expl2), rcov = ~us(trait):units,               prior = prior, data = x, family = "categorical",               verbose = FALSE)   summary(mod2)   In MCMCglmm() I code with 'trait' to express the latent variables 2/3, and consequently the output has separate coefficients for level 2/3:     Location effects: factor(outcome) ~ -1 + trait:(expl1 + expl2)                         post.mean  l-95% CI  u-95% CI eff.samp pMCMC  traitoutcome.2:expl1 -0.006716 -0.036872  0.025785    80.26 0.690  traitoutcome.3:expl1 -0.010447 -0.041454  0.017851   103.78 0.516  traitoutcome.2:expl2  0.004231 -0.021471  0.037971    67.26 0.808  traitoutcome.3:expl2  0.011534 -0.014867  0.041410   105.17 0.424   The glm() output does not feature this, so I am worried it is interpreting 'outcome' as a continuous variable despite my use of factor(). As far as I have found in glm() descriptions, defining dummy variables is not necessary (see here: ). Also, the glm families does not include a multinominal model, and I'm not sure whether the binominal model (as I did above) can be used, despite glm() above not throwing an error. Any help is very welcome.   PS In reality, I need a mixed model, which supposedly can be fitted by glmmPQL() in the MASS library, which depends om glm(). Hence the question about glm() only. I want to compare results with MCMCglmm().    EDIT: OK my question was perhaps too long and not very clear. But it's not a duplicate. I don't want to know which function I can use for a multinomial regression. I want to know if glm() can do it. Or, how I can make it work with glmmPQL() as suggested elsewhere. Again, I need a mixed model and it's not clear from the suggested duplicate question that nnet's multinom() can deal with that.


Assigning an element of a pointer to another element from the same pointer

I'm trying to assign an element from a pointer the same value as another element from the same pointer.  int testFunc() {     char *p = "123";     p[0] = p[2];     return 0; }   Curious as to why the above code doesn't work - and what is the best way to achieve what I'm trying to do?


Bounty grace period claims to be expired while it's in its last hour

(10k, sorry), which is being discussed , has a bounty that ended "at 2011-12-14 17:06:44Z", but as of now (2011-12-15 16:30:00Z, near enough) "the grace period has ended".  Isn't the grace period 24 hours, so there's another 36 minutes to go before it's ended?


Show that $A$ is an invertible matrix if $\left(A+I\right)^3=0$ and find $A^{-1}$

If $A\in M_{n\times n}\left(\mathbb{R}\right)$ is such that $ (A+I)^3=0$, show that $A$ is an invertible matrix and find the inverse of $A$.  My idea was: \begin{eqnarray*} 0&=&\left(A+I\right)^3\\ &=&A^3+3A^2I+3AI^2+I^3\\ &=&A^3+3A^2+3A+I, \end{eqnarray*} then $$I=-A^3-3A^2-3A,$$ so $$I=A\left(-A^2-3A-3I\right).$$ It follows that $$A^{-1}=-A^2-3A-3I.$$ Now I found the inverse matrix, but how does this show that an inverse actually exists?


ColdFusion adding extra quotes when constructing database queries in strings

I am coding in ColdFusion, but trying to stay in cfscript, so I have a function that allows me to pass in a query to run it with   <cfquery blah >   #query# </cfquery>   Somehow though, when I construct my queries with sql = "SELECT * FROM a WHERE b='#c#'"  and pass it in, ColdFusion has replaced the single quotes with 2 single quotes.  so it becomes  WHERE b=''c'' in the final query.  I have tried creating the strings a lot of different ways, but I cannot get it to leave just one quote.  Even doing a string replace has no effect.   Any idea why this is happening?  It is ruining my hopes of living in cfscript for the duration of this project


I am looking for a general formulation to find the closest points on two line segments. What I was thinking about is to define our lines as:  $$ P1 + s  (P2-P1)$$  $$ Q1 + t  (Q2-Q1)$$  Where $P1 , P2, Q1$ and $Q2$ are the beginning and the end points on each segment.  Now we should go through an optimization problem as: $\min f(s,t)$ such that $0<s<1$ and $0<t<1$.  Where $f(s,t)$ is the point-to-point distance function.  Is there any straight forward solution?


Help understanding Fundamental Theorem of Finite Abelian Groups

The book I'm reading defines the Fundamental Theorem of Finite Abelian Groups in the usual way that a finite abelian group is isomorphic to a direct product of cyclic groups $\mathbb{Z}_{{p_1}^{e_1}} \times \cdots \times  \mathbb{Z}_{{p_r}^{e_r}}$, but then it also states that the group is isomorphic to $\mathbb{Z}_{m_1} \times \cdots \times  \mathbb{Z}_{m_t}$ where for each $i = 1,...,t-1$ we have $m_i | m_{i+1}$. How can this be if the groups orders are supposed to be relatively prime.  If anyone can give an example of how this works I would greatly appreciate it.


Duplicate editor names and no page numbers for book chapters in BibLatex APA using Overleaf

I am using the apa style with Biblatex on Overleaf, and when I cite a chapter in an edited volume I get two mentions of the editors.  In the APA style there should be only the second of those two mention.   Also, the page number does not appear as should be the case.   Could someone help me solve this?   Two examples below with a screen cap and the bib entries  \documentclass{article} \usepackage[utf8]{inputenc}  \title{example} \author{cameron} \date{May 2020}  \usepackage[style=apa, backend=biber]{biblatex} \addbibresource{Morin220520.bib} \usepackage{graphicx}  \begin{document} \cite{goldberg_constructionist_2013} \cite{nagle_double_2003}   \printbibliography \end{document}     @incollection{goldberg_constructionist_2013,     address = {Oxford},     title = {Constructionist approaches},     booktitle = {The {Oxford} {Handbook} of {Construction} {Grammar}},     publisher = {Oxford University Press},     author = {Goldberg, Adele},     editor = {Hoffmann, Thomas and Trousdale, Graeme},     year = {2013},     pages = {15--31} }  @incollection{nagle_double_2003,     address = {Berlin, Boston},     title = {Double modals in the {Southern} {United} {States}: syntactic structure or syntactic structures?},     booktitle = {Modality in {Contemporary} {English}},     publisher = {Mouton de Gruyter},     author = {Nagle, Stephen},     editor = {Facchinetti, Roberta and Palmer, Frank and Krug, Manfred},     year = {2003},     pages = {359--72} }


Which one you would choose?     I really had had a pleasant meal until you came   OR   I really had a pleasant meal until you came   I personally think that both are correct, but I am interested to see which one has greater emphasis.


Multilingual website proper url, how should it look like?

Tell me which option is a proper option and if any of these options has some serious flaw that one should avoid at all costs English website root folder installed main websie  subsite english version  subsite german version  PLEASE note that help and hilfe are not just pages but entire websites created with wordpress subsite. IN other words those are separate websites/blogs and not just pages of the mainsite. would this be okay from the SEO point of view? Basically the german version of the website having /de/ in its url? English version not having en. But version being subsites. mainsite simply being in english. Would that be a big problem?


Distribution of a vector divided by its sum

Suppose that the vector      $\tilde{a} = (a_1,a_2,...,a_J)$ has a multivariate normal distribution and let      $$A = \Sigma_{j=1}^J a_j\,.$$  Then what is the distribution of $a_j/A$ or $\tilde{a}/A$ called?  I do know that Dirichlet distribution can be used to deal with a vector of which the sum of the elements is one, but I'm asking the special case where the vector has a multivariate Normal distribution.


my niece who lives in another state has the D5000, as do I. Her camera has stopped auto-focusing.  I've tried troubleshooting over the phone but the focusing problem continues. Here are the settings and what we tried so far:   made sure the lens' A/M switch is set to 'A' Focus mode is set to AF-A 18-55 VR. I had her switch lenses but still no auto-focus  tried different Auto Focus area modes (single, dynamic, auto-area).   The battery is charged. She can see the focus points in the optical viewfinder light up in red.  Thanks in advance for your help


Reading through my textbook I came across the following problem, and I am looking for some help solving it. I believe I have done the workings correctly but I just wanted to make sure as it seemed a little to easy.  Find,  $$\sum_{k=0}^{n}4^k \binom{n}{k}$$ Consider the expansion $(1+x)^n$ using binomial theorem.  $$(1+x)^n = \sum_{k=0}^{n} x^k \binom{n}{k}$$ Then substitute $x = 4$. That should lead you to the answer $5^n$. Therefore $$\sum^{n}_{k=0}4^k\binom{n}{k} = 5^n$$


How to install Konica MInnolta bizuz 206 in Ubuntu 18.04

I found drivers in the official site of Konica Minnolta.They are rpm files. But don't know how to install


Nexus 4 - Failed to install Ubuntu Touch

I have followed the steps on the Ubuntu website as it says, and it gets stuck halfway through 'phablet-flash -b'. What makes it worse i then when i try to put it into recovery, and run the code 'adb devices' it doesn't show any devices?  Any help please?


skip 1st value of loop. i'm trying getting youtube video search data from api with php in loop a got 2 video i want show only 2nd one and skip 1st one.  $grab=grabe('https://www.googleapis.com/youtube/v3/search?key='.$key.'&part=snippet&order=relevance&maxResults=2&q='.$q.''); $json = json_decode($grab); foreach ($json->items as $sam){     $link= $sam->id->videoId;   i got '.$link.' 2 video , bout i want show 2nd video skip 1st 1 how it possible


Postgres won't use btree index in left-anchored LIKE query

Using Postgres 9.5. The  says that the btree index can be used for left-anchored "like" queries (i.e. "%" only at end). But my left-anchored "like" queries on a 1 billion row table won't use a btree index, and my queries are taking forever. What am I missing? Here's a small example that demonstrates the problem:  -- generate a table of 100K integers with random texts CREATE TABLE test(num integer, string text); INSERT INTO test(num, string) (SELECT generate_series(1, 100000), md5(random()::text));  CREATE INDEX test_string ON test USING btree (string); -- b-tree index  EXPLAIN SELECT * FROM test WHERE string LIKE 'asdf%'; -- will use seqscan EXPLAIN SELECT * FROM test WHERE string = 'asdf'; -- will use index SET enable_seqscan=off; -- tell query planner to avoid seqscan if possible EXPLAIN SELECT * FROM test WHERE string LIKE 'asdf%'; -- will still use seqscan


How do I open PDF in Adobe Reader DC without locking the file from being updated by pdflatex?

I don't know if this is possible on Adobe Reader DC on Windows, but asking in case someone has managed to do it.   When I am working on a large document in LaTeX (I use TexStudio) I sometimes like to keep a second copy of my PDF on a second screen so that I can easily refer to what I wrote before, while on my main screen I would have TexStudio with its preview window, which is typically automatically in sync with my current editing location.  On Ubuntu (which uses evince as its default PDF viewer) I used to do it quite nicely. It also seems to watch the PDF file for updates, and keeps in sync of any new versions of the PDF file and reloads it (staying on the same page) when I re-run pdflatex from TexStudio.  At the moment I am working on a Windows machine, and I am trying to recreate the same workflow. I would really like to open a second viewer on my second screen so that I can navigate easily to previous chapters without losing my current position in TexStudio's preview window (which will anyway go back to the current editing location when I run pdflatex).  The only problem however is that when I open the PDF in Adobe Reader DC to put it on the second screen and then I try to recompile the PDF I get the error "I can't write to file". I presume that for some stupid reason Adobe Reader DC maintains some write lock on the file, probably keeping it open while the PDF is visible on screen.  Is there a way to disable this stupid file-locking behaviour from Adobe Reader DC?  UPDATE  After some valuable comments, a workaround is possible using a different viewer. One could either use  or  (the default PDF viewer on Ubuntu, but also available for Windows). They are not so feature rich, and maybe do not look so nice, but in this case do the job.  A similar question was posted  for reference.


Does Magneto have more powers in the movie X-Men: Days of Future Past?

In the movie X-Men : Days of Future Past, Magneto is shown not only controlling metal but breaking it down to microscopic level, inserting it into 8 different robots at the same time, controlling and operating these robots and their internal parts and system that he hasn't seen. Doesn't that give him the power of omniscience or at least more than his original powers? I don't think he ever has these powers in the comic books or in any of his appearance in movies or book.   EDIT The movie shows him having an extra power than his real and original powers. He can only control the metal, not control the operating system of other robots with the help of metal he just broke down. Apart from that, who's to say that the main functioning core and system of those robots was made up of pure metal? It could have been anything. But he altered their programming and turned them against the good guys without having any knowledge of science or programming.


Is the Erevana the ship flying away from Jakku as Rey is left behind?

Seems like they make sure we do not see who is dragging Rey along but still provide a clue with a long shot of the spaceship in the distance. I don't think we ever get an external view of the Erevana, the freighter Han is using after having to abandon the Falcon. Could it be the Han dropped Luke and Rey on Jakku and somehow had to leave the Falcon behind?


Move space from one partition to another partition

I want to get 50 GB from my ubuntu machine(bootcamp), to my macintosh. I have released the 50 GB from my ubuntu machine with gparted, but i dont know to transfer it over to my mac.   Thanks


Relation between an Abelian subgroup of a group and center of the group.

Original Question:  Let $G$ be a group and $N \trianglelefteq G$. $N$ is abelian. If $\gcd(|G/N|,|\text{Aut}(G)|)=1$, then prove that $N \subseteq Z(G)$.  All I could find is that Inner Automorphisms of $N$ is trivial and the automorphism group is of the form $|N|k, k\in \mathbb{N}.$ I am feeling kind of lost and just wanted a push in the right direction. Thank you in advance.


Remove association with blank file extension?

The launcher for Mass Effect 2 mistakenly associates itself with files with no extension. The game's patch apparently fixes this, but it's too large for me to download on this connection. How do I fix this myself? It doesn't appear on Windows' "set associations" list. (Windows 7 x64)


How to deploy ItemAdded event receiver to the entire farm?

I have created an ItemAdded event receiver that is supposed to process new documents/files after they've been added to any document library in the farm - i.e., I'd like the event receiver to automatically monitor all document libraries across the farm, both already existing and those that will be created in the future.  The problem is, if I set the event receiver feature scope to "Farm", I get an error in VS2010 when I try to deploy:     The Project Item cannot be deployed through a Feature with Farm   scope.   How can I deploy event receiver for the entire farm, if possible at all? (Because if it isn't possible, that pretty much renders the entire concept of event receivers useless to me...).


Have any English words been turned foreign only to be then used again in English in an altered state?

What are some examples of English words that got taken into use in a foreign language in a changed state, and then subsequently re-entered the English language in state B or even state C.


Show that there is a symmetric matrix A such that $\forall g\in G,\rho(g)^tA\rho(g)=A$.

Let $G$ be a finite group, $n$ a positive integer and $\rho: G \to  GL(n;\mathbb{R} ) $ a homomorphism. Show that there is a positive definite symmetric $n\times n$ matrix A such that $\forall  g\in G, \rho(g)^tA\rho(g)=A $.


Proof by Induction: Alternating Sum of Fibonacci Numbers

Possible Duplicate:          This is a homework question so I'm looking to just be nudged in the right direction, I'm not asking for my work to be done for me.      The Fibonacci numbers are defined as follows: $f_0 = 0$, $f_1 = 1$, and $f_{n+2} = f_n + f_{n+1}$ whenever $n \geq 0$. Prove that when $n$ is a positive integer:  \begin{equation*} f_0 - f_1 + f_2 + \ldots - f_{2n-1} + f_{2n} = f_{2n-1} - 1 \end{equation*}    So as I understand it, this is an induction problem. I've done the basis step using $n = 1$:    \begin{align*} - f_{2(1)-1} + f_{2(1)} &= f_{2(1)-1} - 1\newline - f_1 + f_2 &= f_1 - 1\newline - 1 + 1 &= 1 - 1\newline 0 &= 0 \end{align*}  I've concluded that the inductive hypothesis is that $- f_{2n-1} + f_{2n} = f_{2n-1} - 1$ is true for some $n \geq 1$. From what I can gather, the inductive step is:    \begin{equation*} f_0 - f_1 + f_2 + \ldots - f_{2n-1} + f_{2n} - f_{2n+1} = f_{2n} - 1 \end{equation*}  However, what I find when I try to prove it using that equation is that it is incorrect. For example, when I take $n = 1$    \begin{align*} - f_{2(1)-1} + f_{2(1)} + f_{2(1)+1} &\neq f_{2(1)} - 1\newline - f_1 + f_2 - f_3 &\neq f_2 - 1\newline - 1 + 1 - 2 &\neq 1 - 1\newline -2 &\neq 0 \end{align*}  I suppose that my inductive step is wrong but I'm not sure where I went wrong. Maybe I went wrong elsewhere. Any hints?


Why does PGFplots not recognize my expression?

I want to graph two quadratic equations using pgfplots. The first one work fine, however when I add the second equation, I get the following error message:  Package PGF Math Error: Unknown operator `x' or `x+' (in 'x^2 - 3x + 4').   It seems PGFplots will not let me multiply numbers at all. Functions such as 2x or even x * 2 don't seem to work. Here is what I am working with:  \documentclass[12pt]{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{pgfplots} \begin{tikzpicture} \begin{axis}[     axis lines = center,     xlabel = {$x$},     ylabel = {$ y = f(x)$} ]     \addplot[no markers, red]{x^2};     \addplot[no markers, blue]{x^2 - 3x + 4}; \end{axis} \end{tikzpicture}   The red plot works fine, but the blue one causes a compilation error.


How can SE more properly represent close-voters' reasons?

The close notice there says:     marked as duplicate by Stephen Touset, Neil Smithline, WhiteWinterWolf, Iszi, Xander    And there's a note added to the question with links to the proposed duplicates.  It's great that we're now showing multiple duplicates in the case of a split vote (if I recall correctly, it used to be that only the majority vote was shown) but we still have a problem of misrepresentation here:  I did not vote that the question be closed as duplicate.  My vote was to close the question as primarily opinion-based. That means, regardless of whether the question is duplicate or not, it's just not a good fit for SE in general. I didn't even look at the duplicate questions to see if it was properly matched. However, my name is included in the "marked as duplicate by..." statement as if that's the reason I selected.  A somewhat similar case, albeit perhaps handled a little better, can also be seen here:    Closure notice says (in whole):     closed as off-topic by RoraΖ, UserName, Deer Hunter, Neil Smithline, Iszi Oct 29 at 21:37      This question appears to be off-topic. The users who voted to close   gave this specific reason:         "This question does not appear to be about Information security within the scope defined in the help center." – RoraΖ, UserName, Deer   Hunter, Neil Smithline         If this question can be reworded to fit the rules in the help center, please edit the question.   A careful reading will show that I'm indeed not associated with the specific off-topic reason selected by the majority. (I'm listed as one who voted as "off-topic", but not listed alongside the specific reason.) That's great. But anyone not so carefully reading it could be easily led to assume such.  Additionally, the reason I did select was this:  "Questions asking us to break the security of a specific system for you are off-topic unless they demonstrate an understanding of the concepts involved and clearly identify a specific problem."  This is a much more specific close reason, which would be useful information to have for the asker in case they wanted to edit the question and request re-opening. However, as it is now, the asker does not have that information (or, at least they didn't until I mentioned it in a comment).  I can dig up numerous other examples. These are just the two most recent cases I've been involved in. Are there any plans to address this?


Yes/No : Is $f_n(x)$ is uniformly convergent on $\mathbb{R}$?

Is $f_n(x)= \frac{x}{n}$  is uniformly   convergent on $\mathbb{R}$ ?  My attempt : i think yes, take $f(x) = \lim_{n\rightarrow \infty}f_n(x) =0$ because  $\sup | f_n(x) - f(x) |= \sup\{\frac{1}{n}\}= 0$  Is its true ?


If the dimension of a sufficient statistic $T(X)$ equals the dimension of parameter space, $T(X)$ is minimal sufficient?

I came cross an interesting  saying  If the dimension of a sufficient statistic $T(X)$ is the same as that of the parameter space, then $T(X)$ is minimal sufficient.  Is this is true? I examined some examples e.g. full-rank exponential families, curved exponential families e.g. $N(\theta, \theta^2)$, and some uniform distributions, e.g. $U(-\theta,\theta)$, $U(0,\theta)$, $U(\theta,\theta+a)$ and found their sufficient statistic has the same dimension with the parameter space and indeed they are minimal sufficient. Is this quoted statement correct? Can you please provide a reference of a proof, or a counter example?


Implement char * ithword(char * str, int i) that will return the ith word in str. The words are alphanumeric and separated by non-alphanumeric characters. The function will allocate memory for the word returned, and return a pointer to it.  My approach is : Start traversing the string and count the numbers of spaces and non-alphanumeric characters and when the count reaches i-1, start printing till you get another space or non-alphanumeric characters.  Is it correct?


Prove that $\sum_{j=1}^{\infty} \left[ \frac{n}{2^j}+\frac{1}{2} \right] = n$ for interger $n\ge 1$

This is the full question:     Consider an integer $n\ge 1$ and the integers $i$,$1\le i \le n$. For each $k=0,1,2,\cdots$, find the number of $i$'s that are divisble by $2^k$ but not by $2^{k+1}$.Thus prove $$ \sum_{j=1}^{\infty} \left[ \frac{n}{2^j}+\frac{1}{2} \right] = n$$ and hence that we get the correct value for the sum $\dfrac{n}{2}+\dfrac{n}{4}+\dfrac{n}{8}+\cdots$ if we replace each term by its nearest integer, using the larger one if two exist. Note: $[x]$ denotes the greatest integer function/floor function of $x$.   This is what i did: The number of integers less that $n$ divisible by $m$ are given by $\left[ \dfrac{n}{m}\right]$, those integers will be $m,  2m, \cdots, \left[ \dfrac{n}{m}\right]m$. Hence for the first part of this question, the answer will be precisely $\left[ \dfrac{n}{2^k}\right]-\left[ \dfrac{n}{2^{k+1}}\right]$. But i am not able to see how this helps in proving the given sum. Also i don't understand what the question is trying to say after we have calculated the sum.


Two days back when I booted my system up, it was showing a screen with a bunch of messages and instructed to press F12 to continue booting.  Two times it showed up when I booted my system and now it is not there, the problem was solved before I could take a screenshot of the message.  The only thing important I remember of the message is "CMOS checksum bad"  What is this error and how does it occur? How did this problem fix itself? (there wasn't any hardware changes at that time.)  If this problem persists in the future how can I go around without pressing F12 key.


How does this context[key](...args) work?

I am reading about the 30s of code in JavaScript and find the following code in adapter chapter. I did not quite understand how this code snippets bind the map and the callback function to the context. Could someone help in explaining this?     const call = (key, ...args) => (context) => context[key](...args);  Promise.resolve([1, 2, 3])  .then(call('map', x => 2 * x))   //Does it mean [1,2,3][map](x=> 2*x)? How does this work?  .then(console.log);   // [ 2, 4, 6 ]


Converting a hexidecimal string to a byte array in C#

So, as the title states, I am trying to convert a string into a byte array.  So, I have this string: string bytes = "2C 2D 3B 27", and I want to convert it from a string, to a byte array, without actually converting the strings contents to a byte array.  So, turn this: string bytes = "2C 2D 3B 27"  to this: byte[] byteArray = { \x2C, \x2D, \x3B, \x27 }.


How many dimensions does a singularity have?

my understanding of a singularity is that it is a 'point' in the universe with an infinite energy density. I have also read on the internet that a singularity is one-dimensional.  This is a concept that troubles me. using my (very limited) knowledge of what dimensions are and how they work, I have made the following assumptions:   we live in a three-dimensional world with length, width and height (excluding time which  I am confused about and am unsure as to whether it is a dimension or not)  so a two-dimensional object would have only length and width (sort of like a flat shape in an area question in a textbook). so a one-dimensional object would only have length and would be a sort of 'line'.   But a 'line' is not a 'point', therefore in order to have a pointlike singularity it would need to be zero-dimensional. another aspect of the one-dimensional 'linear' singularity that I find difficult to understand is that for the finite amount of energy in the universe to be infinitely dense, it cannot be spread out along one or more dimensions, but rather it must be contained in zero dimensions. Hence the energy is 'X' joules per zero metres so the density is undefined.  are singularities one or zero-dimensional and why/how?   if the above reasoning is wrong, why is it wrong?


I have bought a removable hard drive enclosure and a 1TB hard drive to fit in it.  Its pretty cool; it has a little handle at the front of the caddy that allows you to take out the hard drive and stick into another caddy - or swap it for another hard drive, whatever you choose.  The manual talks about converting your dynamic disk to a basic disk if you want the ability to be able to use the "Swap Manager" software (some 3rd party software to allow swapping out of hard drives).  Can anyone explain to what the pros and cons are of having a basic vs dynamic HD?


Probability of Player Winning Tournament Given his chances of winning each round

Tom and Luke are playing a chess tournament against each other. Each game results in either a win for Tom, a win for Luke, or a tie. A tie is worth 1 point, a win is worth 2 points, and a loss is worth 0 points. Someone wins the overall tournament when his score exceeds the other player's score by 3 or more points. The probability that Tom wins a game is 0.25. The probability that Luke wins a game is 0.15. The probability that they tie is 0.6 What is the probability that Tom eventually wins?


Gmail as default Windows mail program (not same as `mailto:`)

How to set Gmail as the default system mail client on Windows 7?  This is not the same as setting the default client for mailto: hyperlinks. Gmail is my default for mailto links, but when I use Windows Photo Viewer (for example, other programs do the same) and select Email I get the error:     There is no email program associated to perform the requested action. Please   install an email program or, if one is already installed, create an   association in the Default Programs control panel.    As noted in a comment by @eselk to  The Google Notifier a.k.a  also doesn't work for this purpose: "GMail notifier only takes over mailto: URLs, it doesn't support "Simple MAPI". What this means ... is that any program that uses simple MAPI to send email (most that send file attachments use MAPI), will not use GMail and will continue to use your default email client. The mailto: URL is pretty much only used by email hyperlinks or typing mailto: in the Windows Run box, not any "send as attachment" options in apps."  The registry solution here  does not work on my machine. The same answer references a program called Affixa which does, by report, seem to work. I don't want to resort to installing a program for this unless there really is no other option. What says Super User?


A non-polyhedral pair $(X,A)$ with both $X$ and $A$ polyhedral

Does there exist a topological space $X$ and a closed subspace $A$ such that each of $X$ and $A$ is isomorphic to the topological space of some simplicial complex, but such that there does not exist a pair $(S,T)$ consisting of a simplicial complex $S$ and a subcomplex $T$ with $(X,A) \cong (|S|,|T|)$?  This is (essentially) problem A2 from Chapter 3 of Spanier's book Algebraic topology. At first I suspected that the intended example was the comb space $A$ inside the unit square $X$, but it seems that $A$ is not polyhedral (if it were, then being compact, it would have to be the space of a finite simplicial complex). It doesn't seem to me that there is an example that has already appeared in Spanier's book, so I am somewhat at a loss as to the intended answer.


Can I use Mage Hand to fly by Polymorphing myself and picking myself up with the hand?

Could I first cast Mage Hand, then Polymorph into a Tiny creature less than 10 pounds then use the Mage Hand to pick myself up and fly at 30 Ft per turn?  Polymorph says:     The new form can be any beast ... The target's game statistics,   including mental ability scores, are replaced by the statistics of the   chosen beast. It retains its alignment and personality ... The   creature is limited in the actions it can perform by the nature of its   new form and it can't speak, cast spells, or take any other action   that requires hands or speech.   This keeps me from casting spells, which keeps me from just casting Mage Hand to fly as long as I want to over and over. But for that initial duration of the Mage Hand cantrip, could I use the Mage Hand to fly as a Tiny polymorphed creature until the spell runs out?


Can general relativity be explained by equations describing a fabric of space embedded in a flat 5-dimensional Minkowski space?

Does such a set of equations exist or does our universe have an intrinsic curvature that can't be explained by an embedding in a flat Minkowski space of 1 higher dimension? Even if general relativity can be explained by such equations, it still doesn't prove our universe is embedded in a flat Minkowski space of higher dimension.


In the example below I am trying to set explicitly some numbered styles and then loop through those styles in a plot. However the variable \i doesn't seem to expand correctly in mystyle\i (however it does in \i*x**2). How can I make this work?  Note that I don't want to specify a cycle list in this case.    \documentclass[tikz]{standalone}  \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc}  \usepackage{pgfplots}   \pgfplotsset{   compat=1.13,   mystyle1/.style={red,dashed},   mystyle2/.style={black,dotted},   mystyle3/.style={blue},   samples=100 } \begin{document}   \begin{tikzpicture}   \begin{axis}     \foreach \i in {1,2,3}{ %      \addplot[no markers,mystyle2] gnuplot {\i*x**2};%works       \addplot[no markers,mystyle\i] gnuplot {\i*x**2};     }   \end{axis} \end{tikzpicture}   \end{document}


Calling a template method on a class template parameter

The following minimal example put in a .cpp file causes a compiler error in VisualStudio 2017 (15.7.4, with /std:c++17 enabled):  template <typename T> class A {     void f(T& t)     {         t.g<2>();     } };  // B is a candidate for the template parameter T in A struct B {     template <int a>     void g() {         // nothing here     } };   The compiler error refers to the body of A::f() and reads:  error C2760: syntax error: unexpected token ')', expected 'expression' .   Note that neither A nor B are actually instantiated. The same error also occurs without declaring B.   However, if I switch the order in which A and B are declared, the example compiles (and A can be instantiated). This is surprising, because I have not expressed any relation between A and B in the code. Another surprising fact is that adding an argument (e.g. an int) to the signature of B::g() and the call of g() also seems to solve the error (without changing the order of declaration).  My questions are: (1) Why does the code above produce a compiler error? (2) How I can resolve it in a clean way?


Can a homomorphic encryption scheme be made CCA2 Secure?

Is it possible to modify a homomorphic encryption scheme so that it can be CCA2 secure?  From the definition of a homomorphic scheme, it seems that it is malleable, which would result in lack of CCA2 security. So, if we use the regular method to convert a CPA secure scheme to CCA2 secure scheme (using a hash of the message and a random value), will it still preserve its homomorphic property? Please correct me if my understanding is wrong.


I can't keep my armature in pose mode when selecting another object

I have set my armature to pose mode, and now want to select the rigged mesh so that I can weight paint it. The only way I can select the mesh as the active object is to set the armature back to object mode, which I don't want.  Using blender 2.8


How long can we preserve yogurt using a refrigerator?

How long can we keep yogurt in the refrigerator and still consume it?


What hardware does Ubuntu Touch support?

With the announcement of the Ubuntu Phone OS I'd like to know what phone (and tablet) models are supported at this time.  Note from foss & Oli: We are making this the master question for all future "Will this work on <insert random tablet/phone/device here>?!" questions


How to ensure that only one instance of an app is running?

I want to ensure that only one instance of my WinForm application is running at a time. I use separate utility to run my application.   In that utility, I want to ensure that my app's EXE is not called by my utility if there is already a running instance of my app. To check if there is a already running instance or not, I have used Process.GetProcessesByName (in my utility) which is pretty much suggested by many people. It works in normal circumstances.   However, we found that if user keeps double clicking (too fast) on the utility (which starts an app), he ends up getting more than one instances (number of instances are not equal to number of double clicks). How can we handle this case?  I think, code which checks for the already running process executes by the time first instance is up & running and it's process details are available through Process.GetProcessesByName.   Note: Whether to allow multiple instances or not is dependent on the configuration in my utility.


Do I need to use autorelease on object which created not using alloc init?

I usually work using recent version of Objective C / Swift which already use ARC. But now I have to continuing the work on progress, which uses an old "situation" of Objective C, which happen to predates the ARC stuff. I have never learn about how to use release and autorelease properly, and now got confused and paranoid.  From what I learn, I can just use autorelease on any of my object initialisation, and not worry about the rest of it, just like if I use ARC. But recently, I began to think whether I also need to add autorelease to:   object automatically created using syntax, which using @ symbol. object returned from method and static method, such as [UIColor redColor].   So now, I began to add autorelease each time I see any object creation. I even began to write:  NSString * data = [@"" autorelease]; MyClass * myClass = [[[MyClass alloc] init] autorelease]; if (flag == true) {     data = [[NSString stringWithFormat:[@"%@%@" autorelease], info1, info2, nil] autorelease];     label.backgroundColor = [[UIColor redColor] autorelease]; } label.text = data;   Can you give me a simple rule of when I need or don't need to use autorelease, because all the autoreleases in my code starts to make me check my sanity of whether I'm doing the right thing or it's just my paranoia. Help!


Why does Ubuntu fail to run .exe files? / How do I run .exe?

So, I just built my PC today, and am only using Ubuntu until I get Windows installed (sorry, guys!) But when I go to click on any .exe file, nothing happens.  It just sits there.  No error message, nothing.  I've seen other people with similar problems, but they all get an error message.  But not me... Whats going on?  How do I fix this?  Help?


What is meant by mounting a device in Linux?

I've heard the term "mounting" when referring to devices in Linux. What is its actual meaning? How it handling now unlike older versions?  I haven't done that manually via the command-line. Can you give the steps (commands) for mounting a simple device in Linux?


How to select max date using SQL without using group by clause . There are solutions for this which have group by clause I want solution without it


I have a query in a before-update trigger that looks like following:  [SELECT Id,(SELECT Id,Active_opp__c              FROM Opportunities              ORDER BY Days_from_Last_Stage__c ASC)   FROM Account WHERE Id IN: conAccMap.values()]   I have checked this in query plan and it looks like :    Is there a chance that the inner query will cause selective query error since I dont have a WHERE Clause on an indexed field in the inner query?


Why does this rename operation not work?

This works:  $ touch abcdefg $ mv -v abcdefg abc[de]fg ‘abcdefg’ -> ‘abc[de]fg’   But this doesn't work:  $ touch abcdefg $ mv -v abcdefg abc[d]efg mv: ‘abcdefg’ and ‘abcdefg’ are the same file   Why?


I have a shiny new Debian server running in an Amazon EC2 instance. I've spent a while setting it up and it now works nicely. However, because it's a cloud server, if I (or someone else) presses the wrong button then its virtual hard disk will go pop and I have to do it all over again. So, I want to make backups.  But I'm paying by the byte for storage, so I want to make a small backup.  It should be possible to backup a complete Debian server by recording the set of currently installed packages (which I can do via dpkg --get-selections), the state of the debconf database (which I can do via debconf-get-selections), and then only backing up files that cannot be trivially replaced from the packages --- i.e., everything else. Then restoring the backup should be a matter of reinstalling the packages and dropping the files on top.  This is precisely the sort of thing I don't want to do myself because I'll get it wrong. Are there any tools to allow me to do this?  (Note: I'm not looking for an incremental backup solution. I want to take a complete snapshot.)


I'm working with Ubuntu 12.04 LTS, and in my application I turn on and turn off the system from a energy switch. My problem is the screen presentation of recovery mode. I want to disable it, because I don't have a keyboard to do the selection. Is it possible? I tried    but it didn't work.  I tried changing  GRUB_DISABLE_RECOVERY="true"    to  GRUB_DISABLE_LINUX_RECOVERY="true"   in /etc/default/grub, without sucess too.


Getting values from Qt widgets and using them for a buffer

I am writing a simple plugin that finds buffer. My gui has 2 combo box and 1 Line edit. The first combo box will have a drop down of values  from column 'States' and 2nd combo will have a drop down of values from column 'Cities'. Note that the Cities will be filtered in the combo box depending on the states selected. And 3rd Lineedit gets a distance from the user. As a result, I want buffer for the cities (from the 2nd combo box) with the user specified 'distance value' given in the lineedit box.I tried QgsGeometryAnalyzer().buffer() function in QGIS API. But the first argument is a layer for the above mentioned function. Instead i want my gui to take value from the city combo and lineedit and find buffer. How to accomplish. Sorry for the lengthy post.


I am stuck with the this question:     Prove by induction that $2^n > n^3$, for all $n \ge 10$   I got this far:  Base: For $P(10)$: $$ 2^n > n^3 \\ 2^{10} > 10^3 \\ 1024 > 1000  $$ so, $P(10)$ is true  Inductive steps: Need to show $P(k+1)$ is true, assuming $P(k)$ is true.  For $P(k+1)$: $$ 2^{k+1} > (k+1)^3 \\ 2 \times 2^k > k^3 + 3k^2 + 3k + 1 \\ 2^k + 2^k > k^3 + 3k^2 + 3k + 1  $$  We assume $2^k > k^3$, so we only need to show $2^k > 3k^2 + 3k + 1$ ? But I am stuck here.   Any idea/hints? Thanks a lot for the help.


In a metric $(X,d)$, prove that for each subset $A$, $x\in\bar{A}$ if and only if $d(x,A)=0.$

In a metric space $(X,d)$, prove that for each subset $A$, $x\in\bar A$ if and only if $d(x,A)=0$  I feel like this isn't necessarily true. For example, let $X$ equal the reals and $A$ be some open subset of $X$, let's say $(0,1)$. Then $0.5$ is an element of $\bar{A}$, but $d(x,A) = d(0.5,0) \neq 0$  This question seems simple enough; I don't know why it's giving me such trouble.


How to get layer list of layers that are published?

I'm stuck.  I've been using geoserver with python extension gsconfig library for a while now. Almost everything works as it should be. While there are little things like publish raster images are problematic, there is still workaround that isn't written into the catalog.py class.   But there is this where I have no idea how to get around.  How do you get a list of layer resource objects that unpublished? catalog.py provides get_layers and get_resources that return layers that are published but not the unpublished layers in a datastore.   I could list all the layers (publish and unpublished) in a datastore through geoserver interface but wms/wfs/wcs and even rest does not  The wms/wfs/wcs services can return layer information in xml but still no layers that are unpublished. I could understand why that is in this case since it is publish facing but I don't know why REST services have this problem as well.  I have searched a lot of forum with no luck.  Did anyone manage to find a solution for this?


Why do some words in the simple present end in -ed

I am helping two students with their English. They asked me why there is -ed at the end of some words in the simple present tense, e.g.  Are you married? He is annoyed. I am worried.  I wasn't sure how to answer this.


In a question I asked on algorithms with time complexity of $f(x) = n^n$ I was told that enumerating the number of strings that can be formed from a string of length $n$ qualifies.   I.e the sum of all permutations of $n$ from $n$ to $0$ is $n^n$  $\sum ^n_{i=0} nPi$ $= n^n$  Can I please see an easy to understand derivation of that formula.   EDIT The above identity is wrong. I just tested it. Can I get a derivation of the formula for the sum of permutations.


Participative maps for collecting geographic information?

I'm looking for a simple way to collect information for a participative plans (regarding landscape) and show them on Google Maps.  I'm thinking to a small web form for asking information to public (es: point of interest, ), then they have to digtize the refered point, line or polygon. After submit, the information are showed in a map.  Any ideas? Like using Joomla extension or similar.


How do we calculate the input impedance of an op-amp?

Question:  1.3  1.4  How would I calculate the input impedance in the diagrams above?  This is what I have tried in my exam, however I got this wrong, and my teacher had told me not to take into account the 2 10k resistors.


I read a lot about trading in the ingame hints, but still cannot figure this out.  When I send a merchant to a trade node, I have the option to collect money from the node or to steer the trade "uphill" to another trade node.  What advantages do I get by trade steering? If I send someone to this trade node, is it not equally good to collect the money there right away?  Does it always make sense to steer trade between two nodes I have merchants in?


I am a UK citizen and will be flying to Toronto in September and spending 2 weeks in Canada before traveling by train from Montreal to New York for 4 days and then flying back to the UK form New York.  Will I need to apply for an ESTA and a I-94 for my trip to the US?


I'm having major 'disagreements' with Sierra, compatibility issues with software etc, & have decided to revert to El Capitan.  I have done this many times in the past, tested an OS then gone back to the earlier version. I make a clone of the old drive, then update; clone back after a few days & all is well. Most I lose is a few non-essential emails which doesn't bother me. This time, I've left it too long to do that. My clone is 2 weeks old, my POP email will only sync back one day. I have no real trace of what else may have changed in that period, but let's say with the best of intentions I'll miss something that I later discover I should have made a safety of.  I have Time Machine, up to date, but of course it's now syncing Sierra. I also have Backblaze. So ultimately I should have the resources to go back & find anything I may have missed.  My worry is if I use a clean install & migrate from Time Machine, some old authorisations on the drive will be lost. Some cannot be retrieved if they break because the servers that authorised them no longer exist. [Old pro audio plugins etc, still working but no longer supported.] These survive a clone, but I don't know if they'd survive a migrate. [I didn't migrate from my old 3,1 to this 5,1, I just moved the boot drive from the old to the new machine.]  I have all old installers in my Purchase History, so obtaining El Capitan is not an issue.  I'm on a Mac Pro 5,1 so dropping in a spare drive is no problem, if that would help. I've never tested whether this machine will boot from USB, my older 3,1 never would - I shall test that & update the question. Edit I've tested, it will successfully boot from an El Capitan installer USB. I've also made a clone of the boot drive as it is right now, belt & braces.  I see my options as... 1. Restore from the clone & try to find anything I missed. 2. Nuke & pave, then migrate Time Machine    Is there a 3rd option?  Some method to restore to my current backup, but sitting on El Capitan rather than Sierra?  Late Edit Well, option 2 just went away. The installer simply refuses to migrate from a newer OS to an older one, whether from a mounted or remote drive, or Time Machine.   may help future Googlers too.


Blackbody emission spectrum vs Boltzmann distribution

In Hydrogen we see certain specific emission spectral lines corresponding to the discrete quantum energy levels of it's single electron. As the material gets up to higher atomic number and more electrons these spectral lines increase in number and cover a wider color/frequency range. Now if we are talking about blackbody spectrum then I would assume that Hydrogen gas would be a poor blackbody emitter because if heated it releases distinct spectrum colors instead of a more homogeneous spectrum, so if I could make a incandescent filament from hydrogen it would shine less like a blackbody emitter and more like a gas discharge lamp , but filament from tungsten for example shines closer to a perfect blackbody right? Is that because higher atomic number elements have more electrons and so more electron energy levels so they can have much more spectral emission lines almost filling the visible spectrum with some gaps that are not seen by the eye ? Also while we are at it , if we take a ideal gas as a blackbody emitter, the gas particles follow the boltzmann distribution bell type curve but blackbody spectrum is always different and not linear, why is that ? is it because some energy levels emit stronger than others due to their difference? thanks.


Open Source Command Line Tools to Remove Hyperlinks in PDFs?

Are there any Open Source Tools to Remove PDF links in Ubuntu.  I use PDFtk and i am not able to find any internal links in it. Due to the Internal links my python script that uses PyPdf to merge the PDF files into one file fails.


Is there a simple hash function that one can compute without a computer?

I am looking for a hash function that is computable by hand (in reasonable time). The function should be at least a little bit secure: There should be no trivial way to find a collision (by hand). For instance, a simple cross-sum is not meeting this criteria since one can easily construct a number with the same hash than another.  Is there a (simple) function? I am interested in this for a presentation about commitment schemes in my CS class at school.


In  I asked about ways one might obfuscate the design of a system, to prevent unauthorized cloning. One suggestion was that IC manufacturers are often willing to put custom labels on their chips. The idea is interesting, but my quantities are low enough that this would not be cost-effective. How might one remove or otherwise render unreadable the labels on ICs?


Is there any way to disable Mac OS X global search string propagation?

Mac OS X has a feature where if you use any search box in any app, it automatically overwrites every other search box with the text you searched.  I find this rarely useful and it often interferes with any workflow where I expect an individual app to stay pre-filled with what I last searched in that app. Is there any way to disable it?  (I've also never seen anyone discuss this feature anywhere. When was it introduced? Does it have a name? Is it mentioned anywhere in the documentation on developer.apple.com?)


Apt-get install - hash sum mismatch for 16.04 but not for 17.10

I'm using Docker and what I try to do is running:  # Base image FROM ubuntu:16.04  RUN export DEBIAN_FRONTEND=noninteractive  # Update packages list and system RUN apt-get -y update; RUN apt-get -y upgrade  # Allow to use add-apt-repository command RUN apt-get -y install software-properties-common locales poppler-utils   But somehow on my Mac (on Windows it's fine) I'm getting strange errors:   Hash Sum mismatch Writing more data than expected Failed to fetch ... 501 Not Implemented   However when I change 16.04 to 17.10 most errors disappear and my build go further but finally I also get for example:  E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/g/gtk+3.0/gtk-update-icon-cache_3.22.25-0ubuntu0.1_amd64.deb  File has unexpected size (10314 != 27564). Mirror sync in progress? [IP: 91.189.88.152 80]    Hashes of expected file:     - SHA256:f229acedb2cc946ff64a418245d10ea1166f0f8efaecf64fb59fae3d7f388c06     - SHA1:675dbd8cf9818e3b277d33f762c249f6b7ecf685 [weak]     - MD5Sum:934e1f67f0589a0b283c883fd21340f9 [weak]     - Filesize:27564 [weak] E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?   Is there any reasonable explanation for this or maybe this is MacOS/Docker for Mac issue? As I said on Windows (in same network) I'm not getting such problem at all.


How to remove warnings from "keytool" command

When I run   keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore -storepass android | openssl sha1 -binary | openssl base64   I get an android debug key hash, but it comes with a warning like this:     Warning:      The JKS keystore uses a proprietary format. It is recommended to   migrate to PKCS12 which is an industry standard format using "keytool   -importkeystore -srckeystore /home/racu/.android/debug.keystore -destkeystore /home/racu/.android/debug.keystore -deststoretype pkcs12".      Dswo5LsHyIM+dEniA4dpvwvs7c5=   How can I remove the warning from the output, I'm only interested in printing the very last line:      Dswo5LsHyIM+dEniA4dpvwvs7c5=   As this is part of a script I use to get all my key hashes. keytool does not have an -qquiet option


How to use memoir environment to set a motto for a chapter?

I would like to set a motto after the chapter title. While the title is set left-aligned the motto should be set left-aligned too, but the longest line of the motto should be aligned to the right outer border of the page:  The Title is Great That is the subtitle if there is one  The Authors name                           There was a young man of Quebec                          Who was frozen in snow to his neck.                          When asked: ‘Are you friz?’                          He replied: ‘Yes, I is,                          But we don’t call this cold in Quebec.   1. Maybe the section title And last but not least the text of the essay and what else I do not know...   This is a working example, but what I need to know is, how to set the whole 'block' with the poetry to the right border (that the longest verse hits it)?  \documentclass[10pt,twoside]{memoir} \usepackage{blindtext} \newcommand{\chapterauthor}  \makeatletter \DeclareRobustCommand\authortoctext[1]{% {\addvspace{10pt}\nopagebreak\setlength{\parindent}{0em}\relax \rightskip \@tocrmarg\relax \itshape#1\par\addvspace{-7pt}}} \makeatother \newcommand\authortoc[1]{\needspace{3\baselineskip}%   \gdef\chapterauthor{#1}%   \addtocontents{toc}{\authortoctext{%     \needspace{2\baselineskip}%   Vgl. http://tex.stackexchange.com/questions/134016 #1}}} \renewcommand{\afterchaptertitle}{%  \vskip\onelineskip\begin{large}\normalfont\textit{\Large\chapterauthor}\end{large} \vspace{4ex} \vskip\onelineskip}  \newcommand\Chapter[3][]{   \chapter[%   \if\relax\detokenize{#1}\relax #2%   \else #1\fi. #3]{#2\\[2ex]\Large\Large#3}   \chaptermark]{\markboth{%   \if\relax\detokenize{#1}\relax  #2%   \else  #1\fi }{}%   }}   \begin{document} \authortoc{The Author} \chapter[]{The Title of the Chapter} \settowidth{\versewidth}{I will pour out my spirit on all people}  \begin{verse} In the last days, God says, \\ I will pour out my spirit on all people. \\ Your sons and daughters will prophesy, \\ \ldots \\ And everyone who calls \ldots ’’\,’ \end{verse}  \section*{The section Title} \blindtext   \end{document}


Prove that $Q_8$ has a subgroup $H$ of order $2$ and $H$ is normal in $Q_8$  Attempt  We have Quantemion group $Q_8=\{\pm 1, \pm i, \pm j,\pm k\}$. Its subgroups are $\{1\}, \{-1,1\}, \{-1,1,-i,i\}, \{-1,1,-j,j\}, \{-1,1,-k,k\}$, and $\{-1,1,-i,i,-j,j,-k,k\}$ of which $H=\{-1,1\}$ is a subgroup of order 2.  Question: 1. Is there any other subgroup of order 2. 2. How to show that this subgroup of order 2 is normal in $Q_8$?  Please help.


Where can I ask a 'reference-request' questions? (Or the tag is 'reference-request' missing)

On StackOverflow, I noticed that there is no tag: reference-request. That is, I have questions of the type: "I am learning X within the context of Y with language Z for application W. What are the recommended references?".  Are those questions within the scope of StackOverflow?  If yes, can someone with reputation > 1500 add this tag please?  If not, then where should I take those question?


Unpooling standard deviation from a combined set and a subset

I do not have access to the original data set. AB: Overall mean: 149.41   sd: 89.13 N: 2284 B: Subset  mean: 110.98    sd: 73.53 N:  917 I need to determine the original mean and standard deviation or variance of the original A set that is combined in the set AB In order to determine the mean of A given sd, and N of AB and B we can do: mean(AB-B) = (149.41*2284 - 110.98*917)/(2284-917) = 175.19 Is it possible to determine the standard deviation or variance of the set AB=(AB-B) given the limited data? Update: @WHuber suggested @Ben's post  which suggests:  I converted that to R, tested it and indeed it works. pooledSD=function(n1,n2,m1,m2,s1,s2) {     sqrt( 1/(n1+n2-1)*( (n1-1)*s1^2 + (n2-1)*s2^2 + (n1*n2)/(n1+n2)*(m1-m2)^2)) }  Testing the above on a synthetic data works perfectly for the union of sets. Using algebra and solving for s1^2, I get:  I  tested the above function now and it works! P.S. I appreciate the additional background that Ben gives below.


Can you use Cox Regression to model non-linear relationships?

The question says it all - I'm just wondering whether Cox regression models are used to model non-linear relationships.


Does using the words "might" and "could" consecutively in same sentence have a name or is it just improper English? (spoken English)

It is now more than a coincidence, but I have heard numerous people from different parts of the country use the words "might" and "could" together in a sentence as in:  "This might could help."  The first time I heard this, I chalked it up to a mid-sentence correction where the speaker started to say "This might help", but then changed mid-sentence to "This could help." I've heard it now in spoken English from various people from different parts of the country. I'm curious if this is a dialect thing or if it has a name. I've also heard it repeated by the same person multiple times, both people I know and other people I don't know, so it appears not to be just a one-off mid-sentence correction, but a way of speaking that I'm not familiar with.


how to get visualforce url to use in navigation mixin LWC

I'm trying to navigate from a LWC to a visualforce. I had found in an answer here that just using the navigationmixin.navigate with type 'standard_webPage' and attribute with url '/apex/vfpagename' worked, but it didn't for me. I tried this:  this[NavigationMixin.Navigate]({       type: 'standard_webPage',       attributes: {           url: '/apex/printAllCheques'       },       state: {           c__formato: this.formato,           c__chequesAImprimir: this.chequesIds       }  });  and this: this[NavigationMixin.GenerateUrl]({         type: 'standard_webPage',         attributes: {             url: '/apex/printAllCheques'         }         state: {             c__formato: this.formato,             c__chequesAImprimir: this.chequesIds         }     }).then(url => {         console.log(url);         window.open(url);     });  and it didn't work. the url for the visualforce is this one 'https://virtualseller-dev-ed--erpvs.na139.visual.force.com/apex/printAllCheques' and for some reason with the NavigationMixin.GenerateUrl, it generates 'https://virtualseller-dev-ed.lightning.force.com/lightning/cmp/null' I understand that there is a difference as the visualforce url is in salesforce classic, I don't know how is that supposed to be handled.


What does * mean in the argument of np array shape? For example, np.multiply(*arr.shape)?

I'm wondering what * mean in this context. I've looked in the documentation too, but I'm still not too sure what it means. I've attached some code below for context.  (As an aside, I've also seen this used PyTorch tensors' .view() or .reshape_() method. Wondering if this is the same meaning.)  documentation:   def one_hot_encode(arr, n_labels):      one_hot = np.zeros((np.multiply(*arr.shape), n_labels), dtype=np.float32)      one_hot[np.arange(one_hot.shape[0]), arr.flatten()] = 1.      one_hot = one_hot.reshape((*arr.shape, n_labels))      return one_hot


I'm working towards beating the Ender Dragon on hardcore vanilla Minecraft. I've gotten myself all the way up to locating the stronghold, however the End Portal is nowhere to be seen. I had 10 Eyes of Ender, and used up all but one of them to find the exact coordinates of where the eye ends up:    This is where the eye floats to when you're near the portal, meaning it triangulates on the Y axis as well. Thinking that it has to be nearby, I exploded a small stack of TNT to open the place up a bit:    It floats in the exact same spot, but there's still no portal nearby. It does not matter if I'm above or below that spot, it always floats to that exact location. Looking at the wiki, it says the PC version of Minecraft Eyes of Ender go to the exact coordinates of the End Portal, however I've dug all the way down to bedrock without any luck.  I seem to have exhausted all methods to locate the End Portal here. Is there a way I can still salvage this game without having to resort to cheating?  Edit: Here's my coordinates and seed as requested.


Change the word "Chapter" to something else

I am using fancyhdr. With that, using the command  \renewcommand{\chaptername}{Lecture}   has no effect. How can I change the name "Chapter" into something else?


A funny edit happened on an answer today

I was reading an answer on my PC and keeping an eye out for errors in it as I usually do (too much actually). I liked it and upvoted it, and since I found no major errors, I decided to 'cancel' the edit window after I upvoted it.  But accidentally, I hit "save edits" instead of "cancel".   There were no edits made by me. But somehow it saved my "edit" and this is what happened next.  See . It says "added 6 characters in body".    EDIT — Tried to reproduce it on another answer, but it wasn't funny anymore.


Finding closed form of $\sum\limits_{r=0}^n r^2 \binom nr p^{n-r}q^r$ where $p>0$ and $q=1-p$

Here is a question from Indian Statistical Institute (ISI) Entrance Exam CSA-2020, Question 11: $\binom n0, \binom n1,..., \binom nn$ denote the binomial coefficients in the expansion of $(1 + x)^n \ \text{where} \   p > 0$ is a real number and $q = 1 − p$ then $$  \sum\limits_{r=0}^n r^2 \binom nr p^{n-r}q^r  $$ is equal to $ (A)\ np^2q^2 \ (B)\ n^2p^2q^2 \ (C)\ npq + n^2p^2 \ (D)\ npq + n^2q^2 $  My Thoughts: (1) If I put the formula for $\binom nr$ in the given sum. I am getting $$  \sum\limits_{r=0}^n r^2 \frac{n!}{r!(n-r)!} p^{n-r}q^r  $$ How do I proceed after this?  Edit: Taking help from  and the comments below I wrote the following, although I am stuck in the last step, please help me out. $$ (1+x)^n=\sum\limits_{r=0}^n \binom nr x^r $$ Taking derivative on both sides we have: $$ n(1+x)^{n-1}=\sum\limits_{r=1}^n r\binom nr x^{r-1} $$ Multiplying both sides by $x$ we get: $$ nx(1+x)^{n-1}=\sum\limits_{r=1}^n r \binom nr x^r $$ Taking derivative another time: $$ n(1+x)^{n-1}+nx(n-1)(1+x)^{n-2}=\sum\limits_{r=1}^n r^2 \binom nr x^{r-1} $$ Multiplying both sides by $x$ we get: $$ nx(1+x)^{n-1}+nx^2(n-1)(1+x)^{n-2}=\sum\limits_{r=1}^n r^2 \binom nr x^r $$ Given that $p>0$ and $q=1-p$ . So let $x=\frac qp$ then we have: $$ n\frac qp\left(1+\frac qp\right)^{n-1}+ n\left(\frac qp\right)^2(n-1)\left(1+\frac qp\right)^{n-2} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  n\frac qp\left(\frac{p+q}{p}\right)^{n-1}+ n\left(\frac qp\right)^2(n-1)\left(\frac{p+q}{p}\right)^{n-2} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  n\frac qp \left(\frac{1}{p}\right)^{n-1}+ n\left(\frac qp\right)^2(n-1)\left(\frac{1}{p}\right)^{n-2} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r \ \ \ \ \  [\text{Since}\ p+q=1] $$ $$ \implies  n\frac{q}{p^n}+ n(n-1)\frac{q^2}{p^n} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  nq+ n(n-1)q^2 = p^n\sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  nq+ n(n-1)q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  n(q-q^2)+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  n\{(1-p)-(1-p)^2\}+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  n\{(1-p)-(1+p^2-2p)\}+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  np(1-p)+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  npq+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ Hence option (D) is correct.  This question is almost similar to  but is slightly different. So I have added this question.


terminal - Save chmod executable (./) as terminal command

How can i save a ./ executable as a terminal command? Like, so I don't longer have to type ./ in order to run the executable.


How to determine if a type implements a specific generic interface type

Assume the following type definitions:  public interface IFoo<T> : IBar<T> {} public class Foo<T> : IFoo<T> {}   How do I find out whether the type Foo implements the generic interface IBar<T> when only the mangled type is available?


Roughly how long is a winning playthrough on Rogue?

I'm just wondering how long the game is if you finish it.  Ordinarily, you just die.


Copy stdout and stderr to a log file and leave them on the console within the script itself

Using bash, how do I copy stderr and stdout to a log file and also leave them displayed on the console?  I would like to do this within the script itself using an exec.  I tried with  exec &>> log.out  echo "This is stdout" echo "This is stderr" >&2   But the above prints nothing on the console. How can I achieve this in bash?


I had done this previously but now I don't remember the trick, Something like when you type in command in terminal it should auto complete it by matching it with the similar commands given in History, so Up Arrow would show me matching history commands instead of plain old previous irrelevant commands.


Should votes be unlocked after comments, not just edits?

A hypothetical situation:   I downvote a question or answer and leave a comment as the pop-up notification suggests. The author responds to my comment in another comment explaining or clarifying something I missed or didn't understand. I go to remove my downvote, but can't because the question/answer has not been edited and my vote is locked.   Should comments, and in particular comments from the author, unlock votes?


Tesla patented a device he believes gathered energy from light. (US 685,957 - Apparatus for the Utilization of Radiant Energy):

The invention is a sheet metal (top) place high above the ground. The sheet of metal is connected to a capacitor (the ⊔⊓ shapes) connected to the Earth. (The other stuff on the right of the image is a load intermittently driven when the charge on the capacitor rises high enough.) When I asked my question, I was confronted with the following statement. Your question has been identified as a possible duplicate of another question. If the answers there do not address your problem, please edit to explain in detail the parts of your question that are unique. The other question is titled. Does Tesla's photoelectric “solar cell” really work?  The first line is Tesla patented a device for gathering energy from light, using the photoelectric effect. It should be noted that I looked at this question and studies the answers before I asked my question.  In fact, I asked my question because I believe that "Does Tesla's photoelectric “solar cell” really work?"  was not answered, and most of the answers are looking in the wrong direction.  The device proposed in the patent works. Numerous experiments show that an electrode (metal plate)  above the ground will generate electricity when grounded through a load. It also gathers energy at a high voltage if placed high enough. There is a Scientific American Amateur Scientist article on this topic and does this experiment.  However, it is my opinion, and I believe most scientists' opinion, that the device does not gather its energy from the photoelectric effect.  This was put forth by an answer by  Carl Brannen for the question.  He stated, “Finally, it seems to me that you're restricted to the voltage of the electrons, i.e. about 12.4 - 4 = max photon - aluminum = 8 volts. I don't see how he got extremely high voltages. Maybe I misread it and he only got high charges (by waiting a long time). “ I agree with Carl Brannen.  I believe that the energy that Tesla sees is from atmospheric electricity. Thus. I asked the question, “does Tesla’s invention collect energy from the sun through the photoelectric effect, or does it collect energy from atmospheric electricity the way any electrode place above the ground does, or does it collect energy both from the photoelectric effect and atmospheric electricity? I then go on and ask the more pertinent question.  Does the field around the plate affect the positive charge left behind on the plate by the emitted electron?  Does the positive charge raise to the voltage that the atmosphere has induced on the plate? This is pertinent because it will further the understanding of electrostatics and would, if the field does affect the positive charge on the plate, make Tesla’s device more commercially viable. The patent says the invention collects energy from the sun.  My question is, does it collect energy from the sun through the photoelectric effect, or does it collect energy from atmospheric electricity the way any electrode place above the ground does, or does it collect energy both from the photoelectric effect and atmospheric electricity? Tesla states that the capacitor is charged to a high voltage.  In the photoelectric effect, the electron emitted would be at most 12 electron volts.  The electron would flow away from the plate due to the field around the plate.  However, does this affect the positive charge left behind on the plate by the emitted electron?  Does the positive charge raise to the voltage that the atmosphere has induced on the plate?


How to conjugate verb in relative clause where case changes?

I'm not sure how the following sentence should be built:  "She gives a blanket to me, who (am/is/?) cold"  I can't come up with anything that sounds right, and I'm not certain there is a right. Can this be done in English? Obviously in this example sentence, it should be restructured to sound normal, but I'm looking for a rule on this structure.


How to build your own preset(node) in Animation Nodes?

How to build your own preset(node) like spider generetor or procedural wire generator?


Insert eps graphics with graphicx (file not found)

When I run  in MikTeX I get an error message saying that the image file is not found:  ! LaTeX Error: File `chick' not found.  See the LaTeX manual or LaTeX Companion for explanation. Type  H <return>  for immediate help.  ...                                                l.21   \includegraphics{chick}  ?   I have put the image file (in this case chick.eps) in the same folder as import.tex.


Invalid token 'while' in class, struct, or interface member declaration in very simple code

I am not sure what the problem is but I keep receiving this error when I try to use a while statement in my code.     Invalid token 'while' in class,   struct, or interface member   declaration   I want to use a while loop to have something continuously update while a statement is true.  The rest of my code is rather long but whenever I type in the syntax:  while(a<b) { //do whatever i want it to do here }   It gives me that compiler error right off the bat. Not quite sure what the problem is. I am doing this in a C# windows application under the Form1.cs file with all the other event handlers (for buttons and such).  Thanks!    I was unaware that loops had to be placed within a method (fairly new to c#), but I tried it and no errors were returned. Thanks for your help everybody!  Previously, I just had the loop within the main class of the program.


I tried to use natbib and other attempts but for vain. I would like to produce a cite key which is identical to the BibTeX entry. For example, if I have a BibTeX entry Bt98, then I want \cite{Bt98} to produce something like [Bt98].  Any ideas how can I accomplish this?


How can I show that this is a partial order?

Let $S$ be an arbitrary amount and define the relation $R \subseteq \mathcal{P}(S) \times \mathcal{P}(S)$ so that $(A,B) \in R$ if and only if $A \supseteq B$. Here $\mathcal{P}(S)$ is a spelling for the power set to $S$. Show that $(\mathcal{P}(S),R)$ is a partially ordered quantity.


Regular expression matching a multiline block of text

I'm having a bit of trouble getting a Python regex to work when matching against text that spans multiple lines. The example text is ('\n' is a newline)  some Varying TEXT\n \n DSJFKDAFJKDAFJDSAKFJADSFLKDLAFKDSAF\n [more of the above, ending with a newline]\n [yep, there is a variable number of lines here]\n \n (repeat the above a few hundred times).   I'd like to capture two things: the 'some_Varying_TEXT' part, and all of the lines of uppercase text that comes two lines below it in one capture (i can strip out the newline characters later).  I've tried with a few approaches:  re.compile(r"^>(\w+)$$([.$]+)^$", re.MULTILINE) # try to capture both parts re.compile(r"(^[^>][\w\s]+)$", re.MULTILINE|re.DOTALL) # just textlines   and a lot of variations hereof with no luck. The last one seems to match the lines of text one by one, which is not what I really want. I can catch the first part, no problem, but I can't seem to catch the 4-5 lines of uppercase text. I'd like match.group(1) to be some_Varying_Text and group(2) to be line1+line2+line3+etc until the empty line is encountered.  If anyone's curious, its supposed to be a sequence of aminoacids that make up a protein.


Calculating angle of projectile motion with constant initial velocity

The following question was asked by someone few years ago but the question was answered a bit superficially. Previous question:   I want to calculate an angle $\theta$ to get the correct trajectory to hit an enemy in my video game.  I have two equations for the projectile motion. $$ x(t) = v_0\cos(\theta)*t $$ $$ y(t) = v_0\sin(\theta)*t + {1 \over 2}gt^2$$  Now I solved the first equation for $t$ and put it in $y(t)$.  $$ y(x) = v_0\sin(\theta)*{x \over v_0\cos(\theta)}+{1 \over 2}g{x^2 \over v_0^2\cos^2(\theta)}$$  We can simplify that into  $$ y(x) = {\sin(\theta) \over \cos(\theta)}*x+{gx^2 \over 2v_0^2\cos^2(\theta)}$$  I want to solve for $\theta$ for any point $(x,y)$, so I can multiply both sides with $\cos^2(\theta)$ to get a quadratic equation, and then substitute $\cos(\theta)$ with $u$, like $$ 0 = -y \cos^2(\theta) + \sin(\theta)\times x\cos(\theta) + {gx^2 \over 2v_0^2}$$ $$ \cos(\theta) = u$$  The problem is, that I can't solve this in a regular way. I type that in mathematica, and got this:  $$\theta=-\cos^{-1}\cfrac{\sqrt{-\cfrac{\sqrt{-x^4(g^2x^2+2gv^2y-v^4)}}{v^2(x^2+y^2)}-\cfrac{gx^2y}{v^2(x^2+y^2)}+\cfrac{x^2}{x^2+y^2}}}{\sqrt{2}}$$  Does someone have an idea or had a similar problem?


What's the correct way to import a symbol from another font compatible with XeLaTeX/LuaLatex?

EDIT: Apparently I wasn't very clear since I linked the question this supposedly duplicates in the first sentence so I could ask about the robustness of that solution..  I want to know if the method described there is something I can count on to be robust across various engines XeLatex, pdflatex, lualatex and something that won't break by running out of the math alphabets.  I should have been more clear and simply said:  Is the method used in  the right way to do it in a package that might be used under multiple different engines.    I want to do the same thing described in this  except for the \ndivides symbol (both \centernot and \nmid options look weird to me for \nmid) but I'm doing this in a package that I want to be compatible with XeLaTeX and LuaLaTeX font selection using unicode-math.  Is using \DeclareFontShape the right way to do things universally?  Do I need to break this up into cases (different code for the different engines) or what?  I'd like to do things the appropriate way so it won't break with future changes to how font-selection is done or cause people to run out of math alphabets.


Converting Javascript date string to PHP date

I'm stuck trying to convert a string in a Javascript format into a format I can use in PHP for filtering.  An example of the date string that I'm given is  "Thu Jan 01 2015 00:00:00 GMT-0800 (Pacific Standard Time)"  Let's say I have that assigned to a variable $z.  When I run the following, I get an unexpected result:  $z = "Thu Jan 01 2015 00:00:00 GMT-0800 (Pacific Standard Time)"; $value = date('Y-m-d H:i:s', strtotime($z));   This gives me $value = "1970-01-01 00:00:00", obviously not what I wanted.  I've also tried the following with no luck:  $value = DateTime::createFromFormat('D M d Y H:i:s',$z); //Fails   Now I'm pretty sure that the timezone info is what is messing everything up, but I just can't seem to figure out what to do here.  I'm using Laravel 5, so I've also attempted similar operations with Carbon. Does anyone have any suggestions?


is a good question with multiple good answers. Unfortunately, the person who asked the question seems to have deleted their account (at least, that's my assumption since their profile is not hyperlinked) so this question will never get an "accepted answer".  What happens in such a case? Can moderators mark an answer as accepted?  I know that technically speaking we don't need an answer to get marked as accepted (you'll likely tell me to just vote it up) but I think the question is still valid. How do we "fix" abandoned questions?


I am trying to get the type of the key and value of a HashMap using reflection. I have the following code:      HashMap<String, Integer> map = new HashMap<>();     map.put("a", 1);     Class c = map.getClass();     if (c.getTypeParameters().length > 0) {         Type superClass = c.getGenericSuperclass();         TypeVariable<?> f = (TypeVariable<?>)(((ParameterizedType)superClass).getActualTypeArguments()[0]);         for (Type type1 : ((ParameterizedType)superClass).getActualTypeArguments()) {             TypeVariable<?> c1 = (TypeVariable<?>)type1;             System.out.println(c1.getBounds()[0]);         }     }   But this prints:  class java.lang.Object class java.lang.Object   Instead of:  class java.lang.String class java.lang.Integer   I assume I'm doing something stupid. Any ideas?


I am trying to tail a log file. At some point the program writing to the log file will say "your foo is ready". I expect my tail -f to conclude gracefully. So I came up with the following lines of code: tail -f out.log | grep ready | while read ln; do   echo "ln: $ln" done  I stopped my coding prematurely since I cannot understand why I don't see any output.


Proxy pass for GeoServer not working properly

I have GeoServer 2.18.2 hosted on tomcat 9.  With the IP it is working perfectly fine. To use it within OpenLayers I was needed it behind SSL. So through proxypass I have hosted it in apache2 to give it a domain name. Below are the configurations <VirtualHost *:80>     ServerName geoserver.example.com     ProxyRequests Off     ProxyPreserveHost On     <Proxy /geoserver>         Order deny,allow          Allow from all      </Proxy>     ProxyPass /geoserver http://127.0.0.1:8080/geoserver     ProxyPassReverse /geoserver http://127.0.0.1:8080/geoserver RewriteEngine on RewriteCond %{SERVER_NAME} =geoserver.example.com RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent] </VirtualHost>   Now I can access the layers in OpenLayers and login into admin successfully but when I click on navigation and use search and save other settings it gives me 400 Bad Request Error. Apparently, it seems like there is an issue in proxy pass configurations because when I use it along with port 8080 it works prefectly. But I needed this way along with SSL


What happens to humans inside titans when they die?

In attack on titan, if someone were swallowed by a titan (it doesn't matter if the person if dead or alive) what happens to the body if a titan dies before it pukes them up?


How to prove that $\Bbb Q(\sqrt 2)$ and $\Bbb Q(\sqrt 3)$ are not isomorphic. I thought that they are but I got this problem in Dummit Foote Section 14.1. Question no 4. As they extension over $\Bbb Q$ by the polynomials $x^2-2$ and $x^2-3$ resp.


Would you please tell me how to install Windows games on Ubuntu? I really need it.


Is there a name for the use of symbols in place of curse words, for example #$@&%*!?


How can I automate calculation of time complexity of algorithms in JavaScript?

Is there an inbuild method in JavaScript for calculating time complexity of algorithms?   For instance, if I feed in this function:  function solution(A) {     let smallestInt = 1;      function existsInArray(val) {         return A.find((a) => a === val);     }      for (let index = smallestInt; index < 1000000; index++) {         if (existsInArray(index) && !existsInArray(index + 1) &&             existsInArray(smallestInt)) {             smallestInt = index + 1         }     }     return smallestInt; }   The method should be able to tell me that the time complexity of the algorithm is O(N*2) or whichever correct answer would be?  If no inbuild method is available, is there a library with automated methods for achieving this?


Convergence of the series $\sum_{n\geq 2}\text{log}(1+\frac{(-1)^n}{\sqrt{n}})$

How can I determine  the convergence and absolute convergence of $$\sum_{n\geq 2}\text{log}\left(1+\frac{(-1)^n}{\sqrt{n}}\right)$$ I have seen that the series $$\sum_{n\geq 1}\frac{(-1)^n}{\sqrt{n}}$$ converges (not absolutely).


I have a Mini-ITX Intel DH61AG mobo w/ an Intel i3 processor and 8GB of 1600MHz DDR3 RAM. Anyways, this computer has been crashing kind of frequently. It is not an OS problem, as I have used Ubuntu (and had kernel panics), Windows 7, and Windows 8. Each of these OSes have had problems, so I ran a HDD check, and I know it is not a heat issue because I tested the processor for a few days when I first put the computer together. When I ran memtest86+, however, I got an error - so I did individual testing, and both chips came back good, did a really intense test with both of them again (took half a day), and no errors. So, I still think the problem could be RAM, but I am not sure - I tested it pretty extensively (might let it run all night again tonight)... which brings me to my point.   Could someone explain to me (in simple terms if possible) how to READ the minidump files of Windows computers? I've tried before with a guide I found online, but failed miserably. I'm fine with installing the software, I will probably need it sometime in the future as well. I have seen a few other posts on SU that just ask people to post minidump logs, but I feel as if that is too localized. Would someone be able to explain this?


Is it possible to derive a formula for this series? If there is, how can it be derived? $$\sum_{R=1}^{K-1} (R\times2^R)$$


Is it possible to install Ubuntu on tablets and mobile phones by yourself? Just as you can with computers ?  I'd be interested in having a go because then I could integrate all my stuff.  Thanks for any replies.


cmake add_test() with different runtime_output_directory

Building off of , I have a setup where I:   have CMAKE_RUNTIME_OUTPUT_DIRECTORY set to ${CMAKE_BINARY_DIR}/bin have a test added via:  add_executable(my_test test.cxx) add_test(my_test my_test)    With that, make test fails. I get the exact same kind of output as in the linked question:     Could not find executable test   Looked in the following places:   my_test   my_test   Release/my_test   Release/my_test   [...]   As suggested in the answer, I changed to:  add_test(NAME my_test COMMAND my_test)   With that fix, I can now run:  $ make my_test # necessary! $ make test   This works great. It is able to find and run my tests. However, if I don't run make my_test first, make test still fails - it won't build anything.   What do I do to get make test to actually both build and run all the tests?


Biblatex with ieee doesn't produce the same output as bibtex with the ieeetran.bst configuration

I want to use biblatex with the biber backend for my ieeetran paper. When I use the following commands:  \documentclass[conference]{IEEEtran} \usepackage[backend=biber, sorting=none, style=ieee, doi=false, isbn=false, url=false]{biblatex} \bibliography{biblio}  \begin{document} Abstract \cite{ibrahim_synchronous_2015} \printbibliography  \end{document}   The references look like follows:   When I use the original   \documentclass[conference]{IEEEtran} \usepackage{cite} \begin{document} Abstract \cite{ibrahim_synchronous_2015}  \bibliographystyle{ieeetran} % use IEEEtran.bst style \bibliography{IEEEabrv,biblio}  \end{document}   it looks like follows on the other hand:   You can see, that the version with biblatex is much mor spacious than the original one (second one). Are there any settings or other templates which make the references really look like the IEEEtran.bst style? The reason why I'm asking is, that I'm usally used to biblatex (with biber backend) and I don't always want to change the settings when I change between my documents.


Sharepoint sites asks autherization continous in Safari 8.0.2

Sharepoint sites doesn't open in Safari 8.0.2 . It asks authentication continous.  How can I solve this problem?   Someone adviced to me this :"Change your Form Based Authentication (FBA) to Claims authentication in SharePoint."  It is a complex process. When I do this, does be formed any problem in  exist users profile.  Is there any way for fix?


Can I run XCOM 2 in my 32-bit Windows 7 machine? The recommendation says it needs 64 bit to run the game.


If else statement is not working as expected

I am not sure why it is not working. Even the condition is true, when I am clicking on submit button it is running the else statements and returning 0. Please help.  XML Code:  <EditText     android:id="@+id/dog_textView"     android:layout_width="0dp"     android:layout_height="wrap_content"     android:layout_weight="1"     android:layout_marginTop="72dp"     android:layout_marginRight="8dp"/>  <Button     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:text="Submit"     android:layout_gravity="center_horizontal"     android:layout_marginTop="16dp"     android:onClick="submitOrder"/>   MainActivity.java:  public class MainActivity extends AppCompatActivity {      int playerScore = 0;      @Override     protected void onCreate(Bundle savedInstanceState) {         super.onCreate(savedInstanceState);         setContentView(R.layout.activity_main);     }      public void submitOrder(View v){          EditText editText = (EditText) findViewById(R.id.dog_textView);         String answer = editText.getText().toString().toUpperCase();         if (answer == "DOG"){             playerScore = playerScore + 2;             Toast toast = Toast.makeText(MainActivity.this,"Your player score is: "+ playerScore ,Toast.LENGTH_SHORT);             toast.show();         } else {             Toast toast = Toast.makeText(MainActivity.this,"Your player score is: "+ playerScore ,Toast.LENGTH_SHORT);             toast.show();         }     }  }


how to understand what the inverse limit is?

I really can't understand the meaning of inverse limit and even examples of computing it in diffrent cases and I'm looking for some easy(if such a thing exists!!!) for it.  thanks for any help...


NullPointerException, can I use throws because I "expect" code might crash because of NullPointerException?

Can I declare my method with throws when code in method body might crash because of NullPointerException  I have code like a.getB().getC() inside this method  Edit:    I have tried with sample code,  class B {     public void methodB() {} }  class A {     public void methodA(B b) throws NullPointerException {         b.methodB();     } }  @Test public void test_null_pointer() {     boolean thrown1 = false;     boolean thrown2 = false;     A a = new A();      try {         B b = new B();         a.methodA(b);     } catch (NullPointerException n) {         thrown1 = true;     }      try {         a.methodA(null);     } catch (NullPointerException n) {         thrown2 = true;     }      assertFalse(thrown1);     assertTrue(thrown2); }   Test has succeeded.


Decomposition of an arbitrary gate using given matrix in Qiskit

If I have an arbitrary non-unitary matrix of say $$ U = \begin{pmatrix} 1.5 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1.6 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 &  0 \\ \end{pmatrix},  $$  is it possible to decompose it into gates implementable in qiskit?  If so, how? If not, why not?  Is is possible to have any arbitrary non-unitary matrix as an input and get the corresponding gates that implement this arbitrary matrix?


Why some posts have all community-wiki answers?

I saw some questions that are strange in that all answers for them are community wikis. Examples:     Why are they like this? And what's the purpose behind it?


Don't show 10k users posts they can't delete in the delete tools

Apparently, . This led to a moment of confusion for me today, when I fired up the 10k tools and had links on the "delete" tab take me to answers of questions that weren't even closed, let alone accumulating delete votes.  Can the 10k tools' delete tab show only posts that 10k users can vote to delete? This specifically includes questions that have been closed for two days, and excludes answers and recently closed questions. (Or is it by design that 10kers may see which posts 20kers are voting to delete?)


Username still showing old name on a question

From what I know, changing your username will change it everywhere but looking at , Robert Harvey ♦'s name is still showing as The Grinch as the name of the question OP.    It is also still showing as The Grinch on the question in .    Is there a reason for this or this a bug?


Disabled or Hide "Open with Explorer" ribbon button for View Only Permission Users

I want to hide Open with Explorer ribbon button only those users has View Only permission and it should appear for other permission user.  I've tried with below custom action reference by this   <CustomAction Id="RemoveExplorerButton" Location="CommandUI.Ribbon" RegistrationType="List" RegistrationId="101" Rights="ViewListItems"> <CommandUIExtension>   <CommandUIDefinitions>     <CommandUIDefinition       Location="Ribbon.Library.Actions.OpenWithExplorer" />   </CommandUIDefinitions> </CommandUIExtension>     It's working and removing Open with Explorer button for all the permission users. Is there any way that just remove only for View Only Permission user.  Question : I mean Ribbon button should appear if user have read only or edit permission or any other permission except user has View Only.


Why the integral of $\sin x\cos x$ has two results

when I integrate $\sin x \cos x$ using $u$ substitution I'm getting $\frac{1}{2}\sin^2 x$ and $-\frac{1}{2}\cos^2 x$, I cannot identify the relationship here


Should I use $\hat{i}$ or $\vec{i}$ when writing out a vector in full?

There is another question related to vector notation here:  but it does not answer my question. It questions using the arrow and bar together. My question has nothing got to do with that. My textbook expresses vectors as: $$\vec{v}_{(t=1)}=10\ \vec{i} + 21\ \vec{j}\ m\ s^{-1}$$ But my understanding is that the $i$ and $j$ are both unit vectors in this expression. Would it be better to express the vector as: $$\vec{v}_{(t=1)}=10\ \hat{i} + 21\ \hat{j}\ m\ s^{-1}$$ Obviously it's understood that the $i$ and $j$ are unit vectors in the first expression but I feel it's better to just use the correct notation. Also the textbook labels the axis as $\vec{i}$ and $\vec{j}$. I have a problem with this as well as the axes are not vectors themselves. I think the axes should be labelled $i$ and $j$ without anything overhead. Is there anything wrong with my preference of using $\hat{i}$ and $\hat{j}$ within the vector expression and $i$ and $j$ for my axes?


I'm running code that works with MODIS HDF4 datasets on a Debian Linux distribution.  I am also running this code on a Windows machine.  On both the Windows and the Linux machines, I have the most recent GDAL version (gdal 1.11.1, np19py27_1), however on the Linux machine, GDAL doesn't seem to recognize HDF4 Drivers... it won't load or process any of the HDF4 datasets that are easily processed on the Windows machine (unfortunately this machine doesn't have enough space to run the full code).  Has anyone else encountered this problem?  Do I need to install an additional module on the Linux system?


I have to  to avoid an immediate wakeup after suspend in my desktop machine, and I made it by trial and error (works well, so that is not a problem). But I wonder...  for example in my laptop I have a long list in /proc/acpi/wakeup:  [...] RP03      S4    *disabled PXSX      S4    *disabled RP04      S4    *disabled  pci:0000:00:1c.3 PXSX      S4    *enabled   pci:0000:03:00.0 RP06      S4    *disabled [...]   I have searched around and I can't find a place where a list with the meaning of the 4-letter code in the first column is explained. I imagine that the events with a device name after them are linked/generated by that device, but I am at a loss with most of the rest... minus wild guesses.   How can I know what, for example, event RP06 is? Is there anywhere a list? Or are that codes vendor-specific?