I've encounterd a confusing matter written in one of my college books: It is stated there that "The heap is not static and can grow as needed by requesting more memory from the operating system".  So what I'm confused about is the following: Suppose I run my application, and objects are allocated on the heap. At some point, the application runs out of memory: what happens now?   From what I understand, Gc (Garbage collector) kicks in and begins it's mark and sweep operations. I wonder if somehow, instead of invoking the Gc by the CLR, is there any possibility for the heap to request more memory from the operating system?   I read that in C++ language, there is a way to achieve that, but is it possible in C# .Net Framework 4.5?
Coming from a java background, one of the things I am used to is telling the JVM what the maximum heap size should be.  If the running program tries to swallow more than is allowed, and the garbage collector cannot free any more resources, then OutOfMemoryError is thrown and it all goes bang.  So setting the maximum heap size is important in Java.  Does this apply in .net?  Can you set the heap size limits?  Does the CLR just keep growing its heap until it reaches the machine's physical limits?  Or is it not an issue in .net for some subtle reason that my Java blinkers stop me from seeing?
Enumerate or list all variables in a program of [your favorite language here] A friend asked me last week how to enumerate or list all variables within a program/function/etc. for the purposes of debugging (essentially getting a snapshot of everything so you can see what variables are set to, or if they are set at all). I looked around a bit and found a relatively good way for Python:   #!/usr/bin/python                                                                                                                                                                                                                            foo1 = "Hello world" foo2 = "bar" foo3 = {"1":"a",         "2":"b"} foo4 = "1+1"  for name in dir():     myvalue = eval(name)     print name, "is", type(name), "and is equal to ", myvalue   which will output something like:   __builtins__ is &lt;type 'str'&gt; and is equal to  &lt;module '__builtin__' (built-in)&gt; __doc__ is &lt;type 'str'&gt; and is equal to  None __file__ is &lt;type 'str'&gt; and is equal to  ./foo.py __name__ is &lt;type 'str'&gt; and is equal to  __main__ foo1 is &lt;type 'str'&gt; and is equal to  Hello world foo2 is &lt;type 'str'&gt; and is equal to  bar foo3 is &lt;type 'str'&gt; and is equal to  {'1': 'a', '2': 'b'} foo4 is &lt;type 'str'&gt; and is equal to  1+1   I have so far found a partial way in PHP (courtesy of ) but it only lists all variables and their types, not the contents:   &lt;?php // create a few variables $bar = 'foo'; $foo ='bar'; // create a new array object $arrayObj = new ArrayObject(get_defined_vars()); // loop over the array object and echo variables and values for($iterator = $arrayObj-&gt;getIterator(); $iterator-&gt;valid(); $iterator-&gt;next())         {         echo $iterator-&gt;key() . ' =&gt; ' . $iterator-&gt;current() . '&lt;br /&gt;';         } ?&gt;   So I put it to you: how do you list all variables and their contents in your favorite language?    Edit by : I propose this question follows the spirit of a little "". If you do not agree, just edit and remove the tag and the link. For regression problem, I have seen people use "coefficient of determination" (a.k.a R squared)  to perform model selection, e.g., finding the appropriate penalty coefficient for regularization.   However, it is also common to use "mean squared error" or "root mean squared error" as a measure of regression accuracy.  So what is the main difference between these two? Could they be used interchangeably for "regularization" and "regression" tasks?  And what are the main usage of each in practice, such as in machine learning, data mining tasks? If a function returns no value, with a valid return type, is it okay to for the compiler to return garbage? Are there any open source alternative to Landscape? How can I get a views exposed filter to persist across multiple views? I have 2 separate views that return a set of results for each of my content types. The fields are different, but the filters are exactly the same - Sort by Location / Distance. This Distance / Proximity filter is exposed, and it is set to 'remember' the last entry. I followed the tutorial here  to be able to filter results by distance. It works great.  In views, to remember the last entry, Views uses sessions. But, each view has its own individual $_SESSION variable. That means what I set for one view does not carry over to the next, and even each view can have different values, which is not what I want. Here is a dump of the session after they have been set:  [views] =&gt; Array     (         [search_pages] =&gt; Array             (                 [default] =&gt; Array                     (                     )              )          [baby_clothes_pages] =&gt; Array             (                 [default] =&gt; Array                     (                         [distance] =&gt; Array                             (                                 [postal_code] =&gt; 11211                                 [search_distance] =&gt; 100                                 [search_units] =&gt; mile                             )                      )              )          [baby_gear_pages] =&gt; Array             (                 [default] =&gt; Array                     (                         [distance] =&gt; Array                             (                                 [postal_code] =&gt; 22343                                 [search_distance] =&gt; 100                                 [search_units] =&gt; mile                             )                      )              )      )   What I would like to do is create a small module or snippet of code that will simply allow someone to type in their 5 digit zip code and then it update all the values across all my pages with this filter. If it is changed on any page, then it changes it for the rest of the pages as well. It also needs to work so that it affects the results on the next page load so that it correctly shows them filtered.  Here is a snippet of code I was experimenting with to try to set this value, but it's the wrong direction.   $all_views = views_get_all_views();            // get an array of all views in use on the site  foreach ($all_views['category_pages']-&gt;display as $key =&gt; $value) {  //check to see if the structure exists I am looking to modify if(array_key_exists('postal_code', $all_views['category_pages']-&gt;display[$key]-&gt;display_options['filters']['distance']['value'])) {  //if so, set its value $all_views['category_pages']-&gt;display[$key]-&gt;display_options['filters']['distance']['value']['postal_code'] = '28152';  //try setting the session instead $_SESSION['views']['category_pages'][$key]['distance']['postal_code'] = '28152';     }   What's the correct direction? How do I get this value changed? Could it be done in the template.php file with preprocess function? Should I do it in a module, and if so, what do I need to alter?  Very lost at this point. Thanks for the direction! Increase iPhone call history How can see call history in iPhone one month back, i also tried with tried party software but that is not perfect , is the any solution from apple? Consider the following code:  foo () {     echo $* }  bar () {     echo $@ }  foo 1 2 3 4 bar 1 2 3 4   It outputs:     1 2 3 4       1 2 3 4   I am using Ksh88, but I am interested in other common shells as well. If you happen to know any particularity for specific shells, please do mention them.  I found the follwing in the Ksh man page on Solaris:     The meaning of $* and  $@  is   identical  when  not  quoted  or  when  used  as a parameter   assignment value or as a file name. However, when used as  a   command argument, $* is equivalent to ``$1d$2d...'', where d   is the first character of the IFS variable,  whereas  $@  is   equivalent  to  $1 $2 ....   I tried modifying the IFS variable, but it doesn't modify the output. Maybe I'm doing something wrong? Assumed True until proven False. The Curious Case of the Vacuous Truth Given two statements, $P$ and $Q$, and the logical connective, $\implies$, the truth table for $P \implies Q$ is:  $$\begin{array}{ c | c || c | }   P &amp; Q &amp; P\Rightarrow Q \\ \hline   \text T &amp; \text T &amp; \text T \\   \text T &amp; \text F &amp; \text F \\   \text F &amp; \text T &amp; \text T \\   \text F &amp; \text F &amp; \text T  \end{array}$$  Lines one and two are quite clear. What is ambiguous is lines three and four.  One explanation as to why $P \implies Q$ is true when $P$ is false, provided by Velleman goes:     Let $P(x)$ be the statement $x&gt;2$ and $Q(x)$, $x^2 &gt; 4$. When $x=3$, $P$ is true, and $Q(x) = 9$ thus $Q$ is true. If $P(x) = 1$ then $Q(x) = 1$ and they are both false. If $P(x) = -3$ then $Q(x) = 9$ and so the statement is true.   This explanation was quite unsatisfactory to me. Looking at Enderton, we have:     For example, we might translate the English sentence, ”If you're telling the truth then I'm a monkey's uncle,” by the formula ($V \implies M$). We assign this formula the value $T$ whenever you are fibbing. In assigning the value $T$, we are certainly not assigning any causal connection between your veracity and any simian features of my nephews or nieces. The sentence in question is a conditional statement. It makes an assertion about my relatives provided a certain condition — that you are telling the truth — is met. Whenever that condition fails, the statement is vacuously true.      Very roughly, we can think of a conditional formula ($p\implies q$) as expressing a promise that if a certain condition is met (viz., that $p$ is true), then q is true. If the condition $p$ turns out not to be met, then the promise stands unbroken, regardless of $q$.   Though a significant improvement over the Velleman explanation, I still feel uncomfortable with it.  Really, it seems we can conjure up as many silly counter-examples as we like, such as:     If pigs can fly, then I can walk on water.   Though following the above truth table, the implication is that my ability to walk on water is true.  After considering it, it seems to me that $\implies$ is only meaningful when $P$ is true, then we can look at it in relation to $Q$. However, if $P$ is false, then we actually know nothing about the relationship between $P$ and $Q$. This would give a truth table of:  $$\begin{array}{ c | c || c | }   P &amp; Q &amp; P\Rightarrow Q \\ \hline   \text T &amp; \text T &amp; \text T \\   \text T &amp; \text F &amp; \text F \\   \text F &amp; \text T &amp; \text ? \\   \text F &amp; \text F &amp; \text ?  \end{array}$$  where the $?$ denotes that given $P$ we actually don't know anything about $ \implies $.  Thus. one way to clear this up would be to assume that $? = T$. Thus the vacuous truth is a "definition of convenience" in a sense.  The above is my take on the matter.  Could someone provide some clarification on the conditional logical connective? Word for something sad and funny at the same time What's a word for conflicting emotions that are felt at the same time? For example, loneliness, sadness, happiness, being content but also feeling as if something isn't right?  To sum up: What's a word for something that is sad and funny at the same time? biblatex, authoryear style: In-text citations display first name initials for certain bibliography entries You're too clever a man to imagine this.   The above sentence was , a man of excellent rhetorical skills.   Since he said it, I doubt it's wrong, grammatically. But, I wonder if there is an explanation for this. Because adjectives always come after the article not before it. e.g. You're a clever man.   How could this be, grammatically? How do I instantiate a string array object into a Spring.Net container? I add js file with drupal_add_js in hook_form_alter, it is ok and I see it in list of js loaded in page, but when I submit form and form not validate and return to that form (after validation failed) I don't see js files that added to form, why this happened? and how can add my js file in that form after validation failed ?   some part of my code   function mymodle_form_alter(&amp;$form, $form_state, $form_id) {   if ($form_id == 'news_node_form') {     drupal_add_js(drupal_get_path('module', 'mymodule') . '/js/mymodulejsfile.js'); //, array('scope' =&gt; 'footer','weight' =&gt; 10));   } }   code work correctly in add and edit form, but when form submit and validation failed it show validation error but my js file not loaded in page (I checked html source and check firebug script files), but there is not my js file, I'm trying to print types like off_t and size_t.  What is the correct placeholder for printf() that is portable?  Or is there a completely different way to print those variables? C programming: How to program for Unicode? What prerequisites are needed to do strict Unicode programming?  Does this imply that my code should not use char types anywhere and that functions need to be used that can deal with wint_t and wchar_t?  And what is the role played by multibyte character sequences in this scenario? Is there a way to configure your Stack Overflow account so that you receive notification emails when posts are made to specific tags?    Or do you simply have to log on to see new posts? How to control the coordinates in Tikz & Matrix? I use Tikz with Matrix because I need to draw arrows and write on and beside the matrix. However, I don´t control the coordinates well other than using trail and error. For instance in the matrix below I have put an X at (0,0) and it is not in the centre of the matrix. However, if the matrix is 4x4 than it is in the centre. Is there any convenient way to know the coordinates? \documentclass[border=1cm]{standalone}  \usepackage{tikz} \usetikzlibrary{matrix}   \begin{document}  \begin{tikzpicture} \matrix(m) [matrix of math nodes, nodes in empty cells, nodes={minimum size=1cm, outer sep=0pt, text height=1.5ex, text depth=.25ex}] {  36     &amp;   &amp; 32    &amp;   &amp; 33    &amp;   \\         &amp;   &amp;       &amp;   &amp;       &amp;   \\  10     &amp;   &amp; 8     &amp;   &amp; 7     &amp;   \\         &amp;   &amp;       &amp;   &amp;       &amp;   \\  12     &amp;   &amp; 17    &amp;   &amp; 16    &amp;   \\         &amp;   &amp;       &amp;   &amp;       &amp;   \\  23     &amp;   &amp; 15    &amp;   &amp; 16    &amp;   \\     &amp;   &amp;   &amp;       &amp;   &amp;       &amp;   \\ };  \draw (m-1-1.north west) rectangle (m-8-6.south east);    % Lineas horizontales \foreach \i in {2,4,6,8} {   \draw (m-\i-1.south west) -- (m-\i-6.south east); }  % Lineas verticales \foreach \j in {2,4,6} {   \draw (m-1-\j.north east) -- (m-8-\j.south east); }  % dual ui \node [font=\color{red}] at (3.5,3) {$\ge 10$}; \node [font=\color{red}] at (3.5,1) {$\ge 8$}; \node [font=\color{red}] at (3.5,-1) {$=4$}; \node [font=\color{red}] at (3.5,-3) {$=3$};  % dual vj \node [font=\color{red}] at (-2.5,-5) {$\le12$}; \node [font=\color{red}] at (-0.5,-5) {$=12$}; \node [font=\color{red}] at (1.5,-5) {$=6$};  \node [font=\color{red}] at (0,0) {X};  \end{tikzpicture}     \end{document} Let $x_{1},x_{2},\cdots,x_{n}$ be real numbers. Show that     $$\sum_{i,j=1}^{n}|x_{i}+x_{j}|\ge n\sum_{i=1}^{n}|x_{i}|.$$   I think this problem may be solved using nice methods, but I can't find them yet; I know this may be of use: $$|a|+|b|\ge |a+b|.$$ But I can't make it work. Thank you everyone. Does a percentage quantity take singular or plural verb agreement? Does a percentage require a singular or plural verb, for example, do we say ten percent "go" or "goes"? I have reviewed this:   but it does not answer my question. The suggested fixes in this question is to set up FB, IG, and other social media pages. We have had these for months. We have 576 Instagram followers, 293 followers on Facebook, 17,425 views on Vimeo, Youtube, Pinterest and LinkedIn presence. Here is the response in a YouTube search:  Let's be clear. If you search for my company name and product name YT changes the spelling to something that doesn't exist and suggests a video with no matching result terms (using either spelling) disparaging OTHER luxury handbags, while insinuating it is referring to my handbags. When a user searches for our business, , Google and Youtube changes the spelling to Aslan Vaughn and displays these results:  For the first few months it just seemed like it was taking some time to percolate, but over 7 months we have had 17,500 unique visitors and nearly 90 backlinks.  The only results for Aslan Vaugn is the birth announcement of the second child of a musician in New Jersey. It is a Facebook post and has 14 likes. Google is favoring a spelling that has only two results with 14+ views over dozens of links and tens of thousands of views. How is this possible? An FB post with 14 likes is that much more popular than a business with 17,500 unique visitors (despite the Google obfuscation)? Is my company on some list? On other search engines my company covers the first few pages in results. Through Google, you cannot find our company no matter how many pages in you go. Unless you search for the term in quotes, . In which case we cover the first few pages here as well: