I have the following Json structure on my project:  "disputas": [     {       id: "",       tipo_negociacao: "",       historico:[{          fl_usuario: "",          created_at: "",          updated_at: "",          created_by: null,          updated_by: null,          texto: "",       }]     } ]   I want to add a new index of historico when I click on a button but don't know how to do it, I want it to look like this:   "disputas": [         {           id: "",           tipo_negociacao: "",           historico:[{              fl_usuario: "",              created_at: "",              updated_at: "",              created_by: null,              updated_by: null,              texto: "",           },            {              fl_usuario: "",              created_at: "",              updated_at: "",              created_by: null,              updated_by: null,              texto: "",           }         ]     } ]   So far, I've done something like this (function that the button calls):       recusaProposta() {         this.disputa.historico[this.i].texto = "something";            this.i++; }   now, since i starts on 0 this works on the first time I click on the button, but if I click on it again I'll get this error:     Cannot set property 'texto' of undefined   Can someone help me? thanks
How do I append an object (such as a string or number) to an array in JavaScript?
How to simulate artificial data for logistic regression? I know I'm missing something in my understanding of logistic regression, and would really appreciate any help.  As far as I understand it, the logistic regression assumes that the probability of a '1' outcome given the inputs, is a linear combination of the inputs, passed through an inverse-logistic function. This is exemplified in the following R code:  #create data: x1 = rnorm(1000)           # some continuous variables  x2 = rnorm(1000) z = 1 + 2*x1 + 3*x2        # linear combination with a bias pr = 1/(1+exp(-z))         # pass through an inv-logit function y = pr &gt; 0.5               # take as '1' if probability &gt; 0.5  #now feed it to glm: df = data.frame(y=y,x1=x1,x2=x2) glm =glm( y~x1+x2,data=df,family="binomial")   and I get the following error message:      Warning messages:   1: glm.fit: algorithm did not converge    2: glm.fit: fitted probabilities numerically 0 or 1 occurred    I've worked with R for some time now; enough to know that probably I'm the one to blame.. what is happening here? What do two question marks together mean in C#? Ran across this line of code:  FormsAuth = formsAuth ?? new FormsAuthenticationWrapper();   What do the two question marks mean, is it some kind of ternary operator? It's hard to look up in Google. Where do I ask where to ask? Requesting raw data from previously published research I am just curious that the following format looks good to you or not? The preamble I used is just   \documentclass[12pt,a4paper]{article}  \usepackage{amsmath} \usepackage{amsthm} \usepackage{amssymb}   I don't feel it's so good because the first paragraph has no indent but the second does. If the first paragraph is much longer, than it's fine. But if not, it looks strange. Should I leave it, or you have suggestions for this? Wheel going badly out of true on final tightening On two occasions (same wheel, loosened everything off and re-did the whole thing after the first time) as I've applied a final half turn to tighten the spokes round the wheel it's gone from being pretty laterally true (within about 0.5 mm) to badly out of true (probably a couple of mm or more out).  The simplest explanation would be that I've managed to mess up by missing spokes/over under-tightening some of them, but I'm fairly sure that's not the case.  What else could cause this?  This is a rear wheel with a fair amount of dish. I'm worried that I might be over-tightening. On both occasions I decided to do a final half turn as the non drive side seemed a little loose, but I was concerned the drive side might be over tight. Could this cause a sudden change in trueness?  I've got the wheel back to a reasonable state, but I'm no longer sure I have even tension in the spokes. What are the main reasons the elves did not show up in force to defeat Sauron? During The Great Battle of the Last Alliance, there were an estimated 100,000 elves that fought with the armies of Isildur. This was one of the first scenes in the first LOTR movie. However, in the trilogy, it appears that only a small number of elves show up to Helms Deep and overall left the majority of the fighting to the humans. Why did the elves not participate during the rest of the war? Combinatorial proof of $\sum^{n}_{i=1}\binom{n}{i}i=n2^{n-1}$. How to set root password to null How to add System.Windows.Interactivity to project? Given a number, how do I discover in what table and column it could be found within? I don't care if it's fast, it just needs to work. Show $$\frac{(2n)!}{n!\cdot 2^n}$$ is an integer for $n$ greater than or equal to $0$.   Could anyone please help me with this proving? Thanks! Minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$ I had an example in the book given as follows:        Find the minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$ .       Solution:  $~~~~~$$(\sqrt{2}+\sqrt{3})^2=5+2 \sqrt6$      $(\sqrt{2}+\sqrt{3})^4=49+20 \sqrt6$       Then $(\sqrt{2}+\sqrt{3})^4-10(\sqrt{2}+\sqrt{3})^2+1=0.$       Thus $a=\sqrt{2}+\sqrt{3}$ satisfies $f(x)=x^4-10x^2+1$ over $\mathbb Q$.       Let $p(x)$ be the minimal polynomial of $\sqrt{2}+\sqrt{3}$ over $\mathbb Q$.Then $(\sqrt{2}-\sqrt{3}),(-\sqrt{2}+\sqrt{3}),(-\sqrt{2}-\sqrt{3})$ are also roots of $p(x).$   So degree of $p(x)$ is atleast $4$.      But $f(a)=0 $ and $f(x) \in \mathbb Q[x] \implies p(x)$ divides $f(x)$ .      So $f(x)$ is minimal polynomial of $\sqrt{2}+\sqrt{3}.$   But I can't get the step  how are $(\sqrt{2}-\sqrt{3}),(-\sqrt{2}+\sqrt{3}),(-\sqrt{2}-\sqrt{3})$ also roots of $p(x).$   Kindly help with this. Entry to The US before 30-day grace period for student visa The F student visa allows me to enter the US up to 30 days before the program starts. For starting to set up things it is of my interest to arrive sooner than that. How hard is it to travel there beforehand with a tourist visa (waiver) and leave to, say Mexico, to then re enter on a proper date within the 30 days with the student visa? This seems easier than requesting for a status change inside the US from tourist to student.. PHP class: Global variable as property in class How to calculate the difference between two dates using PHP? I have two dates of the form:  Start Date: 2007-03-24  End Date: 2009-06-26   Now I need to find the difference between these two in the following form:  2 years, 3 months and 2 days   How can I do this in PHP? Finding empty directories recursively Why do fonts look messed up in Adobe Acrobat? I came across this :     Unbelievable as it may seem, many individuals that fought in the   American Revolution were still alive in 1839, the year the world was introduced to photography. (choose the error - the 'answer' is in bold)   It noted that the reason "that fought" is wrong is that 'The relative pronoun “that” may not be used to refer to people (“individuals”) and should be replaced with the relative pronoun “who.”'   I had thought that the word "that" could refer to both people and objects (while which was reserved for objects and who reserved for people). Am I wrong? How to to calculate the hash of an unordered set Suppose I have a set of elements, with known hash (e.g. SHA-2). How can I calculate the hash of the set? With it I mean an unordered set, so the order of elements is undefined and shall not play any role in determining the hash of the set.  In theory any commutative operation applied to the hashes should be fine, but I have the strong feeling that XORing all of them together is quite unsafe. An attacker could add an element to the set to produce a hash collision, although finding an element with that wanted hash is as hard as breaking the hash of the whole set.  Anything better solution than the trivial one of sorting the elements into a list, calculating their hashes and then calculating the hash of the hash list?  I think Merkle trees can't help here if they are based on some sort of ordering of the elements.