I am having an issue accessing my global variables inside the same file where the variables exist. However, they work just fine when I call the same variable in other files. To call the variable in another file I have used the required_once to call my file where the globals are located and then called each variable I need individually like  global $example_vairable. The issue is that when I use  global $example_vairable later on in the same file where I defined  global $example_vairable it does not work. Inside of another function on the same page I have called my variable  global $example_vairable and then just tested with either an echo or a var_dump. echo shows no display and var_dump provides a bool(false)  telling me I have an error but I have no idea where or why. This is in wordpress so I am using my functions file where my variables are located. Here is my code: THE FUNCTIONS FILE GLOBAL VAIRABLE function Total_Result(){     global $total_result, $resultx;       $resultxs = array($resultx);      $total_result =  count($resultxs[0]);     //return($total_result); } add_action( 'after_setup_theme', 'Total_Result' );  Then the function on the same file (functions.php) that I am trying to call the global from: add_action(&quot;wp_ajax_getvendorresponsestatus&quot;, &quot;getvendorresponsestatus&quot;); add_action(&quot;wp_ajax_nopriv_getvendorresponsestatus&quot;, &quot;getvendorresponsestatus&quot;);  function getvendorresponsestatus() {     global $wpdb, $endResult,$total_result ;     if(isset($_POST['action']) == 'getvendorresponsestatus'){                      echo $total_result;         var_dump($total_result);             var_dump($endResult);             echo $endResult-&gt;posted_by;           }; }  I have also tried to pass the variable in the function itself but it too doesnt work. add_action(&quot;wp_ajax_getvendorresponsestatus&quot;, &quot;getvendorresponsestatus&quot;); add_action(&quot;wp_ajax_nopriv_getvendorresponsestatus&quot;, &quot;getvendorresponsestatus&quot;);  function getvendorresponsestatus($endResult, $total_result) {     global $wpdb;     if(isset($_POST['action']) == 'getvendorresponsestatus'){                      echo $total_result;         var_dump($total_result);             var_dump($endResult);             echo $endResult-&gt;posted_by;           }; }
In reading I am not sure if the issue below could have something to do with needing a custom wordpress ajax handler? All of these functions are inside my functions.php file. I have a couple of PHP functions that are supposed to pass information from one to another. The an AJAX call to the final function should produce the final result through that call. Its not happening. My count results in 0 and I am not understanding why. If I replace my query with a static array like [44,55,99,33] then it will pass the values ok. Likewise if I keep the query and simply replace the $id in the query and make it a static id such as '20' then it works. I would think that the id was the issue then and it wasnt pulling properly but it seems to work ok just not pass? function idx(){     global $wpdb, $id;       $getId = $_SERVER['REQUEST_URI'];     $ecp = explode('/', $getId);     if($ecp[3] != ''){         $id = $ecp[3];     }         return $id; } add_action( 'after_setup_theme', 'idx' );  =============================================== function Total_Result(){     global $wpdb;     $id = idx();        /*$resultx = [44,88,59,52];*/ ;      $resultx = $wpdb-&gt;get_results( $wpdb-&gt;prepare(&quot;SELECT * FROM {$wpdb-&gt;prefix}custom_form_submission_conversation as cc LEFT JOIN {$wpdb-&gt;prefix}custom_form_submission as cs on cc.fsid ='$id' WHERE fsid='$id'&quot; ));          $resultxs = array($resultx);          $total_result =  count($resultxs[0]);     echo  $total_result; }  when I var_dump $resultx I get: array(3) { [0]=&gt; object(stdClass)#1256 (36) { [“cid”]=&gt; string(3) “167” [“fsid”]=&gt; string(2) “20” [“specified_date”]=&gt; string(3) “yes” [“price_quote”]=&gt; string(4) “1140” [“posted_by”]=&gt; string(9) “dc_vendor” [“limit_count”]=&gt; string(1) “1” [“read_unread”]=&gt; string(1) “1” [“vendor_response”]=&gt; string(4) “zero” [“date_created”]=&gt; string(19) “2021-04-15 11:39:08” }   [1]=&gt; object(stdClass)#1257 (36) { [“cid”]=&gt; string(3) “186” [“fsid”]=&gt; string(2) “20” [“specified_date”]=&gt; string(3) “Yes” [“price_quote”]=&gt; string(3) “602” [“posted_by”]=&gt; string(8) “customer” [“limit_count”]=&gt; string(1) “1” [“read_unread”]=&gt; string(1) “1” [“vendor_response”]=&gt; string(4) “zero” [“date_created”]=&gt; string(19) “2021-04-15 11:39:08” }   [2]=&gt; object(stdClass)#1258 (36) { [“cid”]=&gt; string(3) “188” [“fsid”]=&gt; string(2) “20” [“specified_date”]=&gt; string(3) “yes” [“price_quote”]=&gt; string(4) “1017” [“posted_by”]=&gt; string(9) “dc_vendor” [“limit_count”]=&gt; string(1) “1” [“read_unread”]=&gt; string(1) “0” [“vendor_response”]=&gt; string(4) “zero” [“date_created”]=&gt; string(19) “2021-04-15 11:39:08” } }   so then I try and pass that data like so: function getvendorresponsestatus() {     global $wpdb; $id = idx();          $total_resultx = Total_Result($id);         die; }  Ive tried with and without the die();. The AJAX call is: setInterval(function(){     var ffiidd = jQuery('#ffiidd').val();     var ajaxurl = &quot;&lt;?php echo admin_url('admin-ajax.php'); ?&gt;&quot;;          jQuery.post(ajaxurl, {         action: &quot;vendorAjaxprog&quot;,         ffiidd: ffiidd     }, function(data) {         console.log(data);         jQuery.post(ajaxurl, {             action: &quot;getvendorresponsestatus&quot;, //&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; this is the action that calls the function             fsid : ffiidd         },         function(datas) {             console.log('+ datas);             jQuery('.cust_vendor_top').html(datas);         });         if(data == 0){}else{             jQuery('.ajaxreload').html(data);                                     }     });               }, 5000);/*==30 seconds==*/  So the question is why wont it pass along the query array information but it passes a basic array or it will pass if I change the id in the query to be static? I know the query is good because of when I var_dumped it, I have results before I get to the Total_Result() function.
In Star Trek II: The Wrath of Khan (the one from 1982, not the recent remake), Khan yells "This is Ceti Alpha V!" and they're all like this is a big surprise, we didn't know.  If they had previously charted the planet, wouldn't the computer have told them the planets weren't quite where they should be based on earlier visits? I mean, we can predict the next hundred transits of Venus, shouldn't 23rd century explorers be able to predict where the Ceti planets are less than twenty years after their first visit? The strange thing is that opened scripts or newly opened ones are working fine. It's the new created C# scripts that are not working.  With not working, I mean the MonoBehaviour is not in light blue color it's in black color. In this screenshot I took, I marked it with a red circle.    What have I tried so far? I have closed Visual Studio and started over again.  Since it didn't solve it, I closed the unity editor and started it over again, to no avail.  I pressed 'clean solution', I pressed 'rebuild solution', I pressed 'build solution'.  What else can I do ? And why are the other scripts working fine? If I type gameo...it will auto complete it to GameObject but in this specific script it's just not working.  This is a screenshot of the editor. I have in the Hierarchy a Ladder object.  In the Assets I created a folder name Ladder and a script name Ladder. But this Ladder script is not working.    This is the Ladder script and this script was working before but once I created another script inside the ladder folder name Raise empty script the Raise script didn't work and now the Ladder is not working either. But other scripts are working fine.  using System.Collections; using System.Collections.Generic; using UnityEngine;  public class Ladder : MonoBehaviour {     public Transform charcontroller;      private bool inside = false;     private float heightFactor = 3.2f;      private void OnTriggerEnter(Collider other)     {             inside = true;     }      private void OnTriggerExit(Collider other)     {             inside = false;     }      private void Update()     {         if (inside == true &amp;&amp; Input.GetKey("w"))             charcontroller.transform.position += Vector3.up / heightFactor;     } } What is the simplest way to prove the Earth is round? Assume you've come in contact with a tribe of people cut off from the rest of the world, or you've gone back in time several thousand years, or (more likely) you've got a numbskull cousin.  How would you prove that the Earth is, in fact, round? Using a keyboard shortcut to paste text I understand that the architecture of Convolutional Neural Networks (CNN) and Feed forward (FNN) are quite different. And that CNNs use pooling and filters of shared weights over a patch of the image. I am not so clear on the core convolution operator (1):   If anyone could link me to an explanation, I have looked at the Colah blog and Nielsen's online book, and I understand what it is doing but don't understand the convolution operator.  Also, it looks quite similar to the the core FNN function is there and difference? (2).  (1) convolution operator is $a^1 = \sigma(b + w*a^0)$ which is equivalent to:  $a^1 = \sigma(b + \sum^4_{l=0}\sum^4_{l=0}w_{l,m}a_{j+l,k+m})$  (2) feed forward operation:  $a^1_i = \sigma(\sum^n_{j=1}w_{ij}x_j +b_i)$  Many thanks  Sources: functions taken from: Is there a limit of $\cos(n!)$? I encountered a problem today to prove that $(X_n)$ with $X_n = \cos(n!)$ does not have a limit (when $n$ approaches infinity). I have no idea how to do it formally. Could someone help? The simpler the proof (by that I mean less complex theorems are used) the better. Thanks According to the microtype manual, Kerning, Spacing and Tracking are not enabled by default in pdftex (>= 1.4). What are the reasons for this? I found this problem on a well-known problem solving website. It is apparently from Ramanujan.     With   $$\LARGE{a = \frac{1}{1 + \frac{e^{-2\pi}}{1 + \frac{e^{-4\pi}}{1 + \ddots}}}},$$   what is $a$?   The basic methods I know for questions of this type were not helpful to me.  I do not require a full solution, but feel free to post one if you would like. Hints or lecture notes on how to solve problems of this nature would be appreciated.   Keep in mind that I am at an undergraduate level in mathematics. Is there a way to disable access to certain Settings components? How are the AES S-Boxes calculated? I'm trying to understand how the AES S-Boxes are calculated. I understand how the multiplicative inverse is calculated over $GF(2^8)$, but I'm confused by the description of the affine transformation. I haven't been able to Google a good explanation of how the S-Box values are calculated. Can someone explain how this works, starting after the calculation of the multiplicative inverse? How to prove a cross is not locally homeomorphic to an euclidean space? Consider the subset $X = \{(x, 0) \mid -1 \lt x \lt 1\} \cup \{(0, y) \mid -1 \lt y \lt 1\} \subset \Bbb R^2$. It's just two open segments intersecting at $(0, 0)$.  How do you show that $X$, equipped with the subspace topology of $(\Bbb R^2, \lvert \lvert \cdot \rvert \rvert_2)$, is not locally homeomorphic to an euclidean space because of the point $(0, 0)$ ? chemformula: No auto-completion in TeXstudio? I have trouble getting auto-completion to work with chemformula in TeXstudio. I have other packages working just fine.   The .cwl-file is showing up in "Options > Configure TeXstudio > Completion", and I have it ticked. However, it doesn't work when typing.  I have contacted Clemens Niederberger (who maintains the package), however he recommended I ask here instead.  It is mainly the \ch command I would like to have auto-complete, but all commands would be ideal.  N.B. I'm running TeXStudio 2.9.4 TeXLive 2015 (both newest, at the time of writing) What does "Change" represent in the User Leagues? What does the Change field represent on the  for SO? Refer to the highlighted areas in the image below:   Rank: the user's ranking for the selected time period (week, month, quarter, year) Change: +/- change representing... ??? Total Reputation: the user's total reputation [Time Period] Reputation: the user's reputation for the selected time period (week, month, quarter, year)  So what is the Change field measuring? Electric monopoles do exist, but why cannot magnetic monopoles exist?    The question is closed because I need to clarify it, but I don't know how I could ask it another way. However, I've recieved many answers that were appropiate and added something to my knowledge, so I consider it answered. The context for my question might be a bit strange.   I have stuttering and therefore I have some difficulties pronouncing some words starting with particular phonetics. And I've found that if a sentence starts with a /th/ sound, it makes me feel uncomfortable.  Especially in the word is "thanks" or "thank you".  So I want to know if there's a popular alternative for "thank you" that may not seem strange and that unnatural. I've searched the website and I know there are alternatives like "I appreciate your help." but that sounds a bit overly formal for me. (Or is it? correct me if I'm mistaken.) In PHP 5, what is the difference between using self and $this?  When is each appropriate? Cutting a circular hole in a hollow cylinder without distorting the cylinder Whenever I try to cut out a circular hole in either a cylinder or sphere the polygons around the circular hole always have distorted normals after smoothing. Is there anyway to fix this. I've tried using the remesh modifier but wind up with some pretty ugly results. How do I reset my manor so I can rebuild it with different options? Explanation of method for showing that $\frac{0}{0}$ is undefined After the recent "Look and Feel" Apple vs Samsung lawsuits, I've been wondering to what extent this might affect websites/webapps that offer functionality similar to other existing sites.  So what exactly would one have to be wary of to make sure they don't step on the toes of a big corporation?  I could see carbon copying a companies website/app (especially if it's a very distinctive product) being a bad practice that could get you some backlash, especially blatantly ripping off iconic terminology, but how similar is too similar?  Does the ten-foot rule apply to the web?     “If a reasonable person could not, at ten feet, tell the difference between two competitive products, then there was cause to believe an infringement was occurring.”   Or is there a separate legal precedent associated with the web?  And then where does feel, which is essentially the common term for UX, come in.  Can you patent the way a website "feels", as in the flow, organization and functionality associated.  I understand that you can't patent basic elements like radio buttons, but what about the layout and look of a large number of those elements used in combination to complete a certain action/s?    I know that is still a bit of a Sword of Damocles for online retailers.  Where is the line drawn for website/webapp copyright infringement?  Or is there even a line drawn yet?