Lets see same program written in java and python . I cannot understand the motive behind python's behavior .  prog.py :  #!/usr/bin/python print "Hello, World!\n" def hello(name):     print "Hello " + name     print sample  #hello("harish")   Prog.java  public class Prog {     public static void hello(String name) {        System.out.println("Hello " + name);        System.out.println(sample);       }      public static void main (String... args) {         System.out.println("Hello, World!\n");        //hello("Harish");     } }   The above python code prog.py executes without any problem  but Prog.java raises errors .  My arguments   1) I would prefer python is good , looking from the angle that I need not bother about it until I call the function hello(name) . If i called the function during execution phase , then an error would be flung as "NameError: global name 'sample' is not defined".  2) But it looks danger by looking at the angle that it might fling such errors in execution time . But java tells all these things even during compile time .  3) also if I want to distribute the python code as .pyc file , using py_compile.compile("prog.py") . The pyc file is generated without warning that 'sample' is an undefined variable . This puts me at risk because these errors might be discovered in production ,which is too dangerous .  What am I to interpret from this type of working of python . Why is it designed to be so ? what is the advantage in not being so strict while compilation (py -> pyc ) ? Is it not dangerous ?
What are the advantages and limitations of dynamic type languages compared to static type languages?  See also:  (a far more argumentative thread...)
show that the interval of the form $[0,a)$ or $(a, 1]$ is open set in metric subspace $[0,1]$ but not open in $\mathbb R^1$ On the metric subspace $S = [0,1]$ of the Euclidean space $\mathbb R^1 $, every interval of the form $A = [0,a)$ or $(a, 1]$ where $0&lt;a&lt;1$ is open set in S. These sets are not open in $\mathbb R^1$   Here's what I attempted to show that $A$ is open in $S$. I have no idea how it is not open in $\mathbb R^1$.  Let $M = \mathbb R^1$, $x \in A  = [0,a)$ . If $x = 0$, $ r \leq \min \{a, 1-a\}, \\\  B_S(0; r) = B_M(0,r)\cap[0,1] = (-r, r) \cap[0,1] = [0,r) \subseteq A $  If $x \neq 0, r \leq \min \{x,|a-x|, 1-x\},  \\B_S(x; r) = B_M(x,r)\cap[0,1] = (x-r, x+r) \cap[0,1] \subset (0,x) \text{ or } (x, 1) \subset A$ How to redirect output to a file and stdout New flagging dialog has a duplicate for duplicate We've changed the flagging format from today(AFAIK) as below,        looks good.  But, when I select it should be closed for another reason...  I can see the same reason duplicate on the top.        What is the need of placing that reason over there? It should not be there. Please remove the dupe. QR factorization of complex matrix If you have two complex numbers $a,b$ how can you find the QR factorization of   $ M = \begin{bmatrix}        aI_n\\          bI_n \end{bmatrix} $,  I can't seem to be able to do it. I tried an earlier trick, but I now know it's not necessary true for complex numbers. Is there anyway to do this?  I think if I use a Givens algorithm I should be able to reduce it to a QR factorization. Are "w/o", "w/", "b/c" common abbreviations in the US? How to add a confirm dialog to a command button? I am using my notes app on OSX 10.11.5 and iOS 8. For the most part, things are working, but I am noticing that many of my older notes are not searchable. When I type something in the search box, these older notes do not appear in search results even if there is a match. However, if I edit a note or create a new one, it is fully searchable.  My guess is that somehow the search indexes for my notes got corrupted. Is there any way to fix this or rebuild the indexes? We know that if you (using Polyjuice), take the form of someone who had been injured, you assume that injured form (e.g. Barty/Moody). If you are injured, presumably you would be uninjured while under Polyjuice. My question is, is this in real-time? That is, if you take a Polyjuice, and while you're still under its effects, the person being transformed into gets injured (or even dies), will that injury be transferred onto you? And conversely, if you get injured while in someone else's body, will that transfer over to your real body after the Polyjuice wears off, will it disappear, or will it go to the person you turned into? Emacs: How to use a major mode for non-standard file extension "register" keyword in C? What does the register keyword do in C language?  I have read that it is used for optimizing but is not clearly defined in any standard.  Is it still relevant and if so, when would you use it? Why do modern mountain bike forks no longer use boots on fork stanchions? Why do modern mountain bike forks no longer use boots on fork stanchions? Older mountain bikes used to have them on the forks, and lefty and headshocks still do. Why have these fallen out of fashion and would putting aftermarket fork boots on your stanchions be productive or not? In Monopoly, Is it OK for a third party to make a trade with a player who is about to lose? I play with some serious board gamers, but we have neglected Monopoly for a number of years, so our knowledge is mostly based on high school &amp; house rules.  We played last week and enjoyed it, but there was a piece of contention. There are times where we decide that we don't like one of our friends for some reason and don't want them to win (i.e. we landed on their property a bunch, or they refused to make a deal, etc.).  So when player 1 has some property and player 2 lands on it and cannot pay the rent their assets (houses/hotels get liquidated), their property gets transferred to the other player. (Please correct me if I'm wrong.) In this case, though, player 3 "traded" the amount of money owing for a piece of property (way overpaid). In this case they did it so that player 1 would not get the properties. Player 2 had no chance of winning the game (all properties mortgaged, no cash to speak of and many of the other properties with 3+ houses/hotels on them).  To summarize: Is it OK for a third player to purchase/trade property or cash to/from a player who is about to lose? Why are there no animals in "The Matrix"? Missed the MyOpenID demise; account lost forever? Is there any way to get my old account + metadata back if I have lost an account ties to MyOpenID? Looking at the properties for a Windows file I get two attributes, “Size” and “Size on disk,”  and "Size on disk" is always larger.  What do these two metrics mean? On proving that a finitely generated group has a finite number of subgroups with index $n$. Theorem: If $G$ is a finitely generated group, then it has a finite (maybe zero) number of subgroups of index $n$ for any $n\in \mathbb{N}$.   is a sketch of a proof. It consists of assuming such a subgroup $H$ exists, and allowing $G$ to act on $G/H$ by left multiplication. Such action defines a homomorphism $$\phi :G \rightarrow \text{Sym}(G/H)\cong \mathbb{S}_n$$  If $G=\langle g_1, \ldots ,g_r\rangle$, then the homomorphism is uniquely determined by where it sends the generators $g_i$. In particular, there are at most $(n!)^r$ such homomorphisms.  The last step of the proof requires one to notice that a different subgroup $H'$ of index $n$ in $G$ would produce a different homomorphism, and here is where I'm struggling. I've been able to show that $\text{ker}(\phi )=\text{core}(H)$, yet haven't been able to rule out the possibility of $\text{core}(H)=\text{core}(H')$. jQuery - auto size text input (not textarea!) How to search based on part of file name in Google Drive I'd like to be able to find all files in my Google drive that contain the string "_INSTRUCTION_" in the file name. Is there a way to do this?  EDIT 1: When I search for "RMA2013", I should get a dropdown with several options. As you can see, there are several Word and .pdf files with the phrase "RMA2013". Still I get no dropdown help:   And even if I click the search button, I get nothing: Which is correct, "neither is" or "neither are"? Bob: "Can I set the font color? Can I customize the text?"  Frank: "Neither of these options is available. Sorry!"    Is "neither is" always correct or should one use "neither are" in some cases and what are the exact rules?  of this-is-why-stackexchange-exists :P How many times can an Australian leave and re-enter South Africa (90 days at a time without a visa) in a year, and do they need to be out of the country for a certain period of time before they re-enter?  I want to be in South Africa for as long as I can, however as an Australian without a visa I can only stay for 90 days at a time. What I would like to do is simply leave South Africa and go to another country in Africa for a few days, before returning with a new 90 day allowance.    Is this possible, or must I wait a certain period before re-entering South Africa/is there a limit to the amount of times I can do this in one year?