I have a large array of stock ticker symbols, as I am for a project writing a stock market simulation webapp. One of my helper functions is one to determine whether the entered stock is valid by checking the array for the symbol. To do this, I am using array_search(). The problem I have is one by checking edge cases. It seems that the search isn't picking up the 0th element, even though it picks up other elements completely fine. Here is part of the array:  [0] =&gt; AAC [1] =&gt; AACC [2] =&gt; AACOU [3] =&gt; AACOW [4] =&gt; AAIT [5] =&gt; AAME [6] =&gt; AAON [7] =&gt; AAPL [8] =&gt; AAWW [9] =&gt; AAXJ [10] =&gt; ABAX [11] =&gt; ABCB [12] =&gt; ABCD [13] =&gt; ABCO [14] =&gt; ABFS [15] =&gt; ABIO [16] =&gt; ABMD [17] =&gt; ABTL [18] =&gt; ABVA [19] =&gt; ACAD [20] =&gt; ACAS [21] =&gt; ACAT [22] =&gt; ACCL   Etc, etc. As said before, it works fine for other elements, just not the 0th one. It returns FALSE when searching for AAC.  Here is the PHP code I am using.  &lt;?php                    if(isset($_GET[stock])) {                     $ticker = $_GET[stock];                     $ticker = trim($ticker);                     print("&lt;pre&gt;Ticker is $ticker&lt;/pre&gt;");                      print("Validity: " .        Stock::isValidStock($ticker));                      print('&lt;pre&gt;');                     $stock = Stock::getStockList();                     print_r($stock);                     print((bool)array_search('AAC', $stock));                     print('&lt;/pre&gt;&lt;/br&gt;');                 }             ?&gt;    You can change the stock by editing the query string in the url.  As I said, ?stock=AAC returns false, while something like ?stock=GOOG is true. Thanks for any help!
What is the difference between == and ===?  How exactly does the loosely == comparison work? How exactly does the strict === comparison work?  What would be some useful examples?
Storable Action - System.LimitException: Too many DML statements: 1 @AuraEnabled(cacheable=true) public static String  deleteContacts(List&lt;String&gt; contactIds) {     List&lt;Contact&gt; returnList = new List&lt;Contact&gt; ();     String query = ' SELECT Id,Name, LastName,Department,MobilePhone, Email FROM Contact WHERE id IN : contactIds ';     for (Contact thisContact:  Database.Query(query)) {          returnList.add(thisContact);     }     try {       delete returnList;       return'deleted successfully';     }     catch(Exception ex){        return 'Problem occoured';     }  }  JS Method deleteSelected(){     deleteContacts({         contactIds :this.selectedIds     })      .then(result =&gt; {         this.dispatchEvent(             new ShowToastEvent({                 title: 'Success',                 message: result,                 variant: 'success',             }),         );         return refreshApex(this.getContactList, { searchKeyWord: '$searchKeyWord' });     })     .catch(error =&gt; {         this.error = error;     }); I have been reading through my notes and I came across this example and I found it hard to understand so I need some help in explaining how the inverse of this is found.  The set $\mathbb Q(\sqrt 2)=\{a+b\sqrt2$: $a,b$ in $\mathbb Q \}$ is a field. The inverse of an element $a+b\sqrt 2$ in $ \mathbb Q(\sqrt 2$) is  $$\frac{1}{a+b\sqrt{2}}=\frac{a}{a^2-2b^2}+\frac{-b}{a^2-2b^2}\sqrt{2} $$  Can anyone explain  to how the inverse was found? Appreciate your help. How can I flush the output of the print function? How do I force Python's print function to output to the screen? delete vs delete[] operators in C++ Atheros AR9485 wifi disconnects randomly I'm testing something in Oracle and populated a table with some sample data, but in the process I accidentally loaded duplicate records, so now I can't create a primary key using some of the columns.  How can I delete all duplicate rows and leave only one of them? How to make a different font and color of text in labels? Your last flag was declined - no it wasn't I went to flag something, and in the flag dialog I got the message  "Your last flag was declined - please review it before flagging this post!"    That's all well and good, but when I went to review my flags, the statement is not accurate.  My last 5 flags were all marked 'helpful'.  The 6th down the list is marked 'declined', but that wasn't my last flag.  The message should probably be modified to correspond to the actual condition that triggers it.  Perhaps it should say     One of your flags was recently declined - please review it before flagging this post!   I'm going to guess that this message is triggered if, of all the flags of mine that have been handled by a moderator, the one that was most recently handled was declined. This isn't necessarily the last flag that I raised (the one I raised most recently), as moderators might handle them in a different order than I raised them, and it's not necessarily the flag at the top of the list.  Thus, calling it my "last" flag seems like it could cause confusion.  Yes, I realize this is extremely minor. ASP.NET MVC How to pass JSON object from View to Controller as Parameter I have a complex JSON object which is sent to the View without any issues (as shown below) but I cannot work out how Serialize this data back to a .NET object when it is passed back to the controller through an AJAX call. Details of the various parts are below.     var ObjectA = {         "Name": 1,         "Starting": new Date(1221644506800),          "Timeline": [             {                 "StartTime": new Date(1221644506800),                 "GoesFor": 200              }             ,             {                 "StartTime": new Date(1221644506800),                 "GoesFor": 100              }          ]     };   I am not sure how this object can be passed to a Controller Method, I have this method below where the Timelines object mirrors the above JS object using Properties.  public JsonResult Save(Timelines person)   The jQuery I am using is:          var encoded = $.toJSON(SessionSchedule);          $.ajax({             url: "/Timeline/Save",             type: "POST",             dataType: 'json',             data: encoded,             contentType: "application/json; charset=utf-8",             beforeSend: function() { $("#saveStatus").html("Saving").show(); },             success: function(result) {                 alert(result.Result);                 $("#saveStatus").html(result.Result).show();             }         });   I have seen this question which is similar, but not quite the same as I am not using a forms to manipulate the data.   I have also seen references to using a 'JsonFilter' to manually deserialize the JSON, but was wondering if there is a way to do it nativly though ASP.NET MVC? Or what are the best practices for passing data in this way? How can I enable Hardmode? Right place to ask a "discussion" question (I'm setting up a blog, what should....) Examples:   In a car, van, etc. On a bus, boat, motorcycle, etc.   How can one decide which preposition to use? Is memorization the only way or is there a better way?  Note: People generally explain this by either distinguishing between open and closed vehicles or between large and small vehicles. However, the examples I've given defeat both explanations. When is a review task "completed" or "invalidated"? I've noticed that the number of reviews required to remove a post from a queue varies. For example, to accept/reject a suggested edit, you need two votes of the same kind. If the votes are conflicting, the number goes higher. This seems to be the case for the other queues as well. (Additionally, I think that a mod-review is binding) So, my question is: what are the criteria for a review to be marked as a &quot;completed&quot; review? Also, when is a review considered invalidated (i.e. &quot;no longer reviewable&quot;)? Formerly When is a post removed from a review queue?. How can I cast int to enum? Can we prevent titles with an unnecessary tag in them? In the tense of present perfect, Are 'recent past' and 'hot news' the same? Prove $\mathbb{P}(\sup_{t \geq 0} M_t > x \mid \mathcal{F}_0)= 1 \wedge \frac{M_0}{x}$ for a martingale $(M_t)_{t \geq 0}$ Let $M$ be a positive, continuous martingale that converges a.s. to zero as $t$ tends to infinity. I now want to prove that for every $x&gt;0$ $$ P\left( \sup_{t \geq 0 } M_t &gt; x \mid \mathcal{F}_0 \right) = 1 \wedge \frac{M_0}{x}. $$ My approach: I thought that rewriting the conditional probability to an expectation would help so we obtain that we must prove: $$ \mathbb{E} \left[ 1_{\sup_{t \geq 0 } M_t &gt; x}  \mid \mathcal{F}_0 \right] = 1 \wedge \frac{M_0}{x}.$$ A hint to me was given that I should consider stopping the process when it gets above $x$. Thus a stopping time that would do this is $\tau = \inf\{t\geq 0 : M_t&gt;x\}$. But now I'm stuck as I want to apply optional sampling results but we have an indicator which complicates things. How could I proceed from this? Any help is appreciated! How to remove title entry in the bibliography contents? I use plain bibliography style for my book. When I compile it, by default, I get the details including the title in my reference. like this:     H. J. C. Berendsen, J. P. M. Postma, W. F. van Gunsteren, a. Dinola, and J. R. Haak. Molecular dynamics with coupling to an external bath. J. Chem. Phys., 81:3685-3690,1984.   This is too long and I have more than 100 such references which makes the document too long. How can I force it to remove the title from this reference? something like this:     H. J. C. Berendsen, J. P. M. Postma, W. F. van Gunsteren, a. Dinola, and J. R. Haak.  J. Chem. Phys., 81:3685-3690,1984.   Your answer will be greatly appreciated.  By the way, I still would like to use the plain bibliography style. SQL Server Max Memory not limiting use of RAM I would like your input on this. I have a sql server 2008r2 Ent. Ed. 64bit with 16 cores and 64GB RAM. There is one instance of SQL server patched fully as of 20111014.  The max ram is set to 60000MB. Amount of free ram is 0 according to task manager after a few days online.  If I change the max ram to below 53GB it will after a few days to stabilize and have some free ram.   It is the sql process that does allocate the ram according to task manager. How do i come to terms with what the problem really is? It goes without saying that i did alot of testing already but havn't solved this to my liking yet. and ohh we do not get the typical memory starvation lagging when the available ram is down to 0 free.  Update 1:  Inspired by another Q/A related to RAM on this page  . I used these two to see what the RAM is being used for.  SELECT TOP ( 10 )         [type] AS [Memory Clerk Type] ,         SUM(single_pages_kb) AS [SPA Mem, Kb] FROM    sys.dm_os_memory_clerks GROUP BY [type] ORDER BY SUM(single_pages_kb) DESC OPTION  ( RECOMPILE ) ;  SELECT  DB_NAME(database_id) AS [Database Name] ,         COUNT(*) * 8 / 1024.0 AS [Cached Size (MB)] FROM    sys.dm_os_buffer_descriptors --WHERE   database_id &gt; 4 -- system databases --        AND database_id &lt;&gt; 32767 -- ResourceDB GROUP BY DB_NAME(database_id) ORDER BY [Cached Size (MB)] DESC OPTION  ( RECOMPILE ) ;   The amount used shown by these are  first select 7948432    Kb second one 44030,57812  MB that is a total of about 52GB used by sql server... so where did the rest of my RAM go? :-) Task manager show right now cached 363, available 401, free 40 and sqlservr.exe has Memory private set 64 459 656. Max Ram set to 60000MB as before. How to transit through Delhi without a visa?