how to prevent (programmatically) a java application from starting if it's not in a predefined directory?  Example:  I have application.jar and I want to make it runnable only if it's located in             "C:\runnable" directory else the application will exit.  any ideas?
My code runs inside a JAR file, say foo.jar, and I need to know, in the code, in which folder the running foo.jar is.  So, if foo.jar is in C:\FOO\, I want to get that path no matter what my current working directory is.
How do I configure a new Ubuntu installation to accept ssh connections? Removing unnecessary vertices? Delay answer downvote rep loss to voter to help hide voter's identity A while back, I posted an answer to SO, which was downvoted.  I wasn't sure who did it, but had a suspicion because I thought I had seen a particular user lose a reputation point.  When I deleted the answer, my suspicion was confirmed by a point gain in reputation by the particular user.  Now, I wasn't going to attempt any sort of retaliation (and did deserve the downvote) but this seems like it could lead to abuse.  My suggestion is to apply answer downvote rep loss/gain at a particular time of day, and not immediately after the vote or answer deletion. When a body lies on the surface of the Earth it is under the influence of gravity. The force on the body due to gravity causes it to exert a force on the ground and the normal reaction acts in the opposite direction causing the resultant force on the body to be zero.  However, how can the body exert a force on the ground when it does not have any acceleration? Since force equals mass times acceleration how does a body without acceleration experience a force? What is the best way to store user settings for a .NET application? I have a .NET 2.0 Windows Forms application. Where is the best place the store user settings (considering Windows guidelines)?  Some people pointed to Application.LocalUserAppDataPath. However, that creates a folder structure like:     C:\Documents and Settings\user_name\Local Settings\Application   Data\company_name\product_name\product_version\   If I release version 1 of my application and store an XML file there, then release version 2, that would change to a different folder, right? I'd prefer to have a single folder, per user, to store settings, regardless of the application version. ­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­­ I am trying to show $$\lim_{n\rightarrow \infty} \int_{[0,1]^n} \frac{|x|}{\sqrt{n}}dx=\frac{1}{\sqrt{3}}$$ where $[0,1]^n$ is the unit cube in $\mathbb{R}^n$. I would appreciate any hint. Do I use ext4 for all partitions (such as / and /boot)? What are the other formats used for? I'm installing ubuntu onto a new laptop with 24gb SSD and a 500gb HDD. I wanted to put / and swap onto the SSD and /home onto the HDD. Is there anything I shouldn't use ext4 for?  I do not ever intend to dual boot. Ubuntu only. How many constructor arguments is too many? Let's say you have a class called Customer, which contains the following fields:   UserName Email First Name Last Name   Let's also say that according to your business logic, all Customer objects must have these four properties defined.  Now, we can do this pretty easily by forcing the constructor to specify each of these properties.  But it's pretty easy to see how this can spiral out of control when you are forced to add more required fields to the Customer object.    I've seen classes that take in 20+ arguments into their constructor and it's just a pain to use them.  But, alternatively, if you don't require these fields you run into the risk of having undefined information, or worse, object referencing errors if you rely on the calling code to specify these properties.  Are there any alternatives to this or do you you just have to decide whether X amount of constructor arguments is too many for you to live with? Making extra parameters optional I've setup a very specific function and it works well but I'd like to make the parameters optional but I can't get a handle on the regex bit:  add_rewrite_rule('whats-on/([^/]+)/([^/]+)/([^/]+)/?$', 'index.php?page_id=71&amp;event_year=$matches[1]&amp;event_month=$matches[2]&amp;event_day=$matches[3]','top');   /whats-on/2012/01/25 I'll show all events on this date.  /whats-on/2012/01 goes to 404 but I'd like the parameter to be optional so I can show all January dates and the same for /whats-on/2012 all dates in year 2012  Any help will gratefully received - thanks Tabular with p type columns to fill page width Thermodynamics of supercooled water Now that it's been freezing outside for the last few days, I experimented a bit with supercooling. I've left a bottle of clean water outside for a few hours, and behold, when I shook the bottle, the liquid began to freeze rapidly, as expected.   However, not all of the water froze, only about half of it. This got me thinking.  I reasoned that happens because freezing releases heat, and that heat raises the temperature of the ice and remaning water to 0$^\circ$C, at which point the freezing stops.  To try to quantify this, set   $H_f = 334000 \frac{J}{kg}$, the "freezing heat" (enthalpy of fusion) of ice, $c_i = 2110 \frac{J}{kg\cdot K}$, specific heat of ice, $c_w = 4181 \frac{J}{kg\cdot K}$, specific heat of water, $M$, initial mass of supercooled water, $T_0$, initial temperature of supercooled water, $m$, mass of ice at a given moment, $T$, temperature at a given moment.   We suppose that the energy released by the freezing of a $\textrm dm$ mass of ice is used up by raising the temperature of both the already frozen ice ($m$) and the remaining water ($M-m$):  $$ \textrm dm \cdot H_f = c_i m \cdot\textrm dT + (M-m)c_w \cdot\textrm dT$$  By rearranging we get a linear differential equation for $m(T)$:  $$\frac{\textrm dm}{\textrm dT}+\frac{c_w-c_i}{H_f}m = \frac{c_w}{H_f}M$$  The solution of this equation, using the initial condition that at $T=T_0$, $m=0$:  $$ m = M \frac{c_w}{c_w-c_i}\left[ 1-e^{-\frac{c_w-c_i}{H_f}(T-T_0)} \right]$$  This looks neat, however, plugging in the actual values of the constants, $T = 0^\circ$C and $T_0 = -6^\circ$C, I get that little more than 7% of the water should freeze - as opposed to more than half, as I've observed. What's worse, the formula can be used to calculate the starting temperature required to freeze all the supercooled water: $$T_{all} = \frac{H_f \log\frac{c_w}{c_i}}{c_i-c_w}=-110.26^\circ \textrm C$$ which seems absurd.  Where is the error in the calculation above?  I've made a number of assumptions which may or may not hold:   the constants are really constant. I think this is a good approximation for $c_w$, a not that good but still acceptable approximation for $c_i$, and I suppose it holds to $H_f$ to some extent as well. there is no heat transfer with the environment, i.e. the bottle is a closed system. The process seemed fast enough (a few seconds at most) for this to be a good approximation. the system is in a thermal equilibrium at all times and the heat released by the freezing of the ice is distributed evenly in the emerging ice-water mixture. Now this is where I have doubts. Precisely because of the process happening so fast, this might not be true at all. However, acknowledging the presence of temperature variations makes the problem order of magnitudes harder: one has to solve a system of partial differential equations that take heat transfer, the shape of the bottle and \$deity knows what else into account. How to execute multiple statements in a MATLAB anonymous function? I'd like to do something like this:  &gt;&gt; foo = @() functionCall1() functionCall2()   So that when I said:  &gt;&gt; foo()   It would execute functionCall1() and then execute functionCall2().  (I feel that I need something like the )  EDIT:  functionCall1 and functionCall2 are not necessarily functions that return values. Is it possible to browse a chatroom under invisible mode? E.g.  I know that I can browse the chat when I'm not logged on. But what if I am logged on and want to spare the inconvenience of logging off/multiple browsers? Given an infinite set of cardinality $X$, is there a chain in $\mathcal P(X)$ of the same cardinalty of $\mathcal P(X)$? $P(\mathbb N)$ = power set of $\mathbb N$. $A \subset P(\mathbb N)$ is a chain if $a,b \in A \implies$ either $a \subseteq b$ or $ b \subseteq a$ That is, we have something like this: $$\cdots a \subseteq b \subseteq c \subseteq\cdots$$ where $a,b,c \in A$ are distinct. We can show easy enough that there is an uncountable chain - this is done by noting $\mathbb N\sim\mathbb Q$ then using Dedekind cuts in $\mathbb Q$ to define $\mathbb R$ we see that a family of (nearly arbitrary) cuts satisfy the condition. For instance the family $L_r=\{q \in \mathbb Q : q &lt; r \}$ for $r &gt; 0$ gives us the sets we need and obviously we can pick others. I tried doing this for $ \mathbb R$ and don't seem to be getting anywhere.  To be more specific, does there exist a chain in $P(\mathbb R)$ with cardinality $2^ \mathbb R$? Given a set of cardinality $X$ (necessarily non-finite), is there a chain in $P(X)$ of the same cardinalty of $P(X)$? Mint 18 will boot only to a black screen Support for N-Gons (polygons consisting of more than 4 vertices) has been in Blender for a while now, but many of us still may not know when to use them, and how to do so effectively.  In what situations do N-Gons really come in handy? When should they be just plain left out? Do they have any place in finished models? 3-4 old computers = general purpose cluster? Footnotes in tables? I would like to have footnotes in tables, but the \footnote command does not work inside a table environment.  Googling one finds that this is , at least in the UK.  That link contains a list of solutions to the problem, but since the author of the FAQ does not believe that this is good style, no comparison is made between the different methods.  I am sure that there are good typographical reasons why in most situations it is undesirable to have footnotes in tables (although I have never come across them), however I have recently felt the need to do just this in a paper I am currently writing.  Therefore I'd like to ask two questions:   What are the arguments against footnotes in tables? If one really must go against the advice in 1., which method (whether considered in the  or not) would you recommend?   Thanks in advance.  Added  In response to ShreevatsaR's comment: I do not much care for where the text of the footnote appears.  I do however insist on the footnote marks being attached to the relevant entries in the table, so that I can avoid having to reference "the second entry in the eighth line of the table", etc... 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? What is a good algorithm for estimating the median of a huge read-once data set?