I'm trying to add one object to another object.  Let's say I have two objects. selectedItemObj and selectedItemQueue. I'd like to add the selectedItemObj to selecteditemQueue but ONLY if that selectedItemObject does not match any of the objects in selectedItemQueue  Let's say I have this object here:  var selecteditemObj = [    {       "market_hash_name":"Chroma 2 Case Key 1",       "assetid":"92700754417_143965972",       "amount":1,       "image":"https://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXX7gNTPcUxuxpJSXPbQv2S1MDeXkh6LBBOie3rKFRh16PKd2pDvozixtSOwaP2ar7SlzIA6sEo2rHCpdyhjAGxr0A6MHezetG0RZXdTA/"    }];    var selectedItemQueue = [    {       "market_hash_name":"Chroma 2 Case Key 2",       "assetid":"92700754667_143865972",       "amount":1,       "image":"https://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXX7gNTPcUxuxpJSXPbQv2S1MDeXkh6LBBOie3rKFRh16PKd2pDvozixtSOwaP2ar7SlzIA6sEo2rHCpdyhjAGxr0A6MHezetG0RZXdTA/"    },    {       "market_hash_name":"Shadow Case Key 3",       "assetid":"1293611210722_143865972",       "amount":1,       "image":"https://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXX7gNTPcUxuxpJSXPbQv2S1MDeXkh6LBBOiePrKF4wi6aaIGwStN_jl4bSzvXwMO6AwDlSvsYoiOiZ8dij3QbtqkU9ZnezetFWWxusZg/"    },    {       "market_hash_name":"Shadow Case Key 4",       "assetid":"123393510722_143861972",       "amount":1,       "image":"https://steamcommunity-a.akamaihd.net/economy/image/-9a81dlWLwJ2UUGcVs_nsVtzdOEdtWwKGZZLQHTxDZ7I56KU0Zwwo4NUX4oFJZEHLbXX7gNTPcUxuxpJSXPbQv2S1MDeXkh6LBBOiePrKF4wi6aaIGwStN_jl4bSzvXwMO6AwDlSvsYoiOiZ8dij3QbtqkU9ZnezetFWWxusZg/"    } ];   Here is my attempt of it, it adds to the queue but it doesn't check if the child object exists. How can I add that?  function addItemToSelectedQueue(assetId){     var itemObj = findItemById(assetId);     var queueHasItem = false;     for (var i = selectedItemQueue.length - 1; i &gt;= 0; i--) {         if (selectedItemQueue[i] === itemObj) {             queueHasItem == true;         };     };     if (queueHasItem == false) {         selectedItemQueue.push(itemObj);         updateSelecteditems();     }; }
A strict equality operator will tell you if two object types are equal. However, is there a way to tell if two objects are equal, much like the hash code value in Java?  Stack Overflow question  is similar to this question, but requires a more academic answer. The scenario above demonstrates why it would be necessary to have one, and I'm wondering if there is any equivalent solution.
Email SMTP validator I need to send hundreds of newsletters, but would like to check first if email exists on server. It's called  validation, at least I think so, based on my research on Internet.    There's several libraries that can do that, and also a page with open-source code in  (), but I have hard time reading ASP Classic, and it seems that it uses some third-party library...    Is there some code for SMTP validation in C#, and/or general explanation of how it works? Importing Nodes to D7 with all custom fields I've got a Drupal site with an obscene about of content that has been given to me in CSV format. I'm toying with the idea of building a module to let me do this but if there's one already out there that I can use to just get this site out of the way that would be awesome.  My question is: Is there anything out there that allows you to import a CSV file into D7 that will populate the node table and all the custom fields tables as well?  Thanks. The text of the  spell reads:      A flickering flame appears in your hand. The flame remains there for the duration and harms neither you nor your equipment. The flame sheds bright light in a 10-foot radius and dim light for an additional 10 feet. The spell ends if you dismiss it as an action or if you cast it again.   Emphasis mine. The druid in our party asked our DM if he is able to cast produce flame in a dark cave, then opt not to attack with it, and wield a shield and sword. The goal is to continue emitting light, since he doesn't have the light spell. He claims that since the flame does not harm his equipment, he is able to hold a shield or sword with the fiery hand with no problem.  Is this okay to do RAW, or are we missing something?  This is specifically not asking about casting spells with a sword in hand. He wants to draw his weapon after casting and holding the flames.  Related, but not the same question: , , . If $\sum_{n=1}^\infty \frac{1}{a_n}$ converges, must $\sum_{n=1}^\infty \frac{n}{a_1 + \dots + a_n}$ converge? Suppose $\sum_{n=1}^\infty \frac{1}{a_n} = A$ is summable, with $a_n &gt; 0,$ $n = 1,2,3,\cdots.$ How can we prove that $\sum_{n=1}^\infty \frac{n}{a_1 + \dots + a_n}$ is also summable?  This question came from a problem-solving seminar, but I'm quite stuck without a push in the right direction. I tried a few things, including Cauchy-Schwarz (which says $\sum_{n=1}^\infty \frac{n}{a_1 + \dots + a_n} &lt; \sum_{n=1}^\infty \frac{A}{n}$) and also the idea of assuming the latter series diverges and attempting to deduce the divergence of the former series from that, using facts such as $\sum a_n = \infty \implies \sum \frac{a_n}{a_1 + \cdots + a_n} = \infty$. Nothing has worked so far. In this sentence:  "We would also accept an international transfer, but in that case we would ask you to pay your bank's charges at the time of the instruction to ensure that we received the full amount"  is it correct to use "received" or should it be in present tense? How to use early stopping properly for training deep neural network? I have a deep neural network model and I need to train it on my dataset which consists of about 100,000 examples, my validation data contains about 1000 examples. Because it takes time to train each example (around 0.5s for each example) and in order to avoid overfitting, I would like to apply early stopping to prevent unnecessary computation. But I am not sure how to properly train my neural network with early stopping, several things I do not quite understand now:   What would be a good validation frequency? Should I check my model on the validation data at the end of each epoch? (My batch size is 1) Is it the case that the first few epochs might yield worse result before it starts converging to better value? In that case, should we train our network for several epochs before checking for early stopping? How to handle the case when the validation loss might go up and down? In that case, early stopping might prevent my model from learning further, right?   Thank you in advance. What makes a bread either close or open crumbed/textured? What causes the texture of bread to be open, ie with lots of large holes, or close, ie a regular, uniform tender crumb with no large holes? How can I achieve either? I want to hatch the area under a curve (graph of a function) with oblique lines on an interval (to illustrate the function's integral on that interval). This can be done elegantly in gnuplot...   ...but I simply cannot reproduce this with pgfplots. The only solution I managed to find with google is the use of the patterns tikz library, however it is unacceptibly ugly:    I'm not aware of any way to alter the color, line width and - especially - the distance between the hatching lines when patterns library is employed. Is there any way to set it? (So that I can change it to resemble the gnuplot version.)  Or, should I choose a completely different approach to reproduce the gnuplot-style hatching...?  Also note that   pgfplots changes the color of the x-axis to red on the interval (which is not a critical problem, of course, but not elegant). the legend for the filling is much more logical in case of gnuplot. Can I reproduce it with pgfplots?   Here is the code I currently use:  \begin{figure}[ht!] \centering \begin{tikzpicture}     \begin{axis}[xmin=-4,xmax=4,xlabel={z},ymin=0,ymax=1]      \addplot[color=red,domain=-4:4,samples=100] {1/sqrt(2*pi)*exp(-x^2/2)};     \addlegendentry{z}     \addplot[color=red,fill=red, pattern=north east lines,  domain=0:1,samples=100] {1/sqrt(2*pi)*exp(-x^2/2)} \closedcycle;     \addlegendentry{Interval}     \end{axis} \end{tikzpicture} \end{figure} A result of Erdős on increasing multiplicative functions Erdős proved that if $f(n)$ is a monotone increasing function from the natural numbers to the positive reals, and $f(n)$ is completely multiplicative, then there exists some constant $C$ such that $f(n)=n^C$ for all $n$.  I have not been able to find a nice proof of this online and was hoping someone could provide a proof. In popular science books and articles, I keep running into the claim that the total energy of the Universe is zero, "because the positive energy of matter is cancelled out by the negative energy of the gravitational field".  But I can't find anything concrete to substantiate this claim. As a first check, I did a calculation to compute the gravitational potential energy of a sphere of uniform density of radius $R$ using Newton's Laws and threw in $E=mc^2$ for energy of the sphere, and it was by no means obvious that the answer is zero!  So, my questions:   What is the basis for the claim &ndash; does one require General Relativity, or can one get it from Newtonian gravity? What conditions do you require in the model, in order for this to work? Could someone please refer me to a good paper about this? Number of sigma algebras for set with 4 elements If a subring of a ring R has identity, does R also have the identity? I know it does not make sense that if a subring of a ring $R$ is commutative, then $R$ is also commutative. (For example, the set consisting of the matrices whose all entries except (1,1)-entry are zero, is a subring of ring of 2x2 real matrices.)  I also considered the case of a ring containing a subring with identity, but I had no ideas. Maybe it seems that it does not make sense, either.  Who give me some examples supporting my guess? In  related question (), the OP asks if it is grammatical to use the definite article before phrases like Advanced programming in Java whitepaper and Microsoft Office 2010 product. The accepted answer by @Kosmonaut was:     Yes, it is. This is because the "Advanced programming in Java"   whitepaper phrase forms a syntactic unit, with whitepaper as the head   of the unit. The definite article for a phrase always corresponds to   the head of the phrase, so using the definite (or indefinite) article   for these phrases makes perfect sense and is correct English.   My question is whether the same answer applies to phrases like Heathrow Airport, Hyde Park,  Waterloo Station, Edgware Road and Parliament Square. I ask becase it seems to me that airport, park and station, etc. sound like they are part of the proper noun itself, and not simply a common noun. Moreover, I think the head of the unit in these cases would be the place name (first noun) and not the place type (second noun). If that's true, then I assume that no definite article should precede these phrases. Is that correct? Decrypt all RSA ciphertexts if you can break 1% of them I was given a cryptography question during an interview the other day.   Imagine you are given an efficient algorithm which for a given RSA public key (n,e) is able to decrypt 1% of the messages encrypted with that key.   1% means that the algorithm will deterministically decrypt 1% of all possible ciphertexts on the first call, and will never decrypt the other 99% of all possible ciphertexts with any number of invocations.   Figure out an algorithm that uses this one and can decrypt any message. Any ideas? prove/disprove Big-Oh I have the following function f(n), and I want to prove/disprove that it is O(n$^2$): \begin{cases}     4[sum(n/2,n)],&amp; \text{if n is even } \\     2n-1+sum(n-3,n),              &amp; \text{otherwise} \end{cases} (it should be 2 n-1, so a space between 2 and n) where sum( j,k ) is a ‘partial arithmetic sum’ of the integers from j up to k, that is \begin{cases}     0&amp; \text{if j&gt;k } \\     j + (j+1) + (j+2) + ... + k,              &amp; \text{otherwise} \end{cases} e.g. sum(3,4) = 3 + 4 = 7, etc. Note that sum(j,k) = sum(1,k) – sum(1,j-1) How do I prove or disprove that this is O(n$^2$)? Process substitution and pipe I just tried to access a folder like so:  \\somecomputeronmynetwork\somelocation$   When going to this location I'm prompted for a user name and password.  I put one in, and it let me in fine.  Now I need to remove that login, so I can try a different user name and password.  What's the easiest way to do this? What are the differences between Linux and Windows .txt files (Unicode encoding) I am only using the 128 character set defined in the original ANSI standard.  But as a whole how are the files implmeneted differently.    I am not concerned with the display, i.e. if a tab is displayed with 6 or 8 characters but the actual internal representation in memory  One difference I've heard is the use of \r\n (Windows) vs. \n for line termination (Linux). Render not showing UV texture I have added a texture to a cube in the UV editor and it shows up fine in textured view  But when I render it there is no texture  What have I done wrong? How to print results in SQLcmd window