I'm running a jar file in various locations and I'm trying to figure out how to get the location of the jar file that is running.
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.
Setting "checked" for a checkbox with jQuery I'd like to do something like this to tick a checkbox using jQuery:  $(".myCheckBox").checked(true);   or  $(".myCheckBox").selected(true);   Does such a thing exist? To hyphenate or not? As a non-native speaker of English and an engineer by training, I always get confused about hyphenation and almost always end up referring to Google every time I need to make that decision.  Does anybody know of a concise, comprehensive style guide to hyphenation that explains this rather complex issue, once and for all? I'm trying to use the Bash parameter expansions to modify the output of a command substitution or another parameter expansion. The following nested expansions work quite well in Zsh; but result in a &quot;bad substitution&quot; error in Bash: ${${PWD##*/}//trunk/latest}  or ${$(basename $PWD)//trunk/latest}  the output should be the last folder of the $PWD, replaced by latest when my current directory is trunk so /home/user/trunk should become latest Is there a Bash equivalent allowing to chain expansions without relying on variables or pipes? Or do Bash expansions only allows the input to be a string or a plain variable? I want to copy/modify/delete a Minecraft world. Where can I find my saves folder? The maximum energy stored by a capacitor is when it’s (theoretically) fully charged, or just before it reaches dielectric breakdown, if you will. It seems, then, that the maximum energy ($E$) $=QV$, where $Q$ is the maximum charge attained and $V$ is the maximum ‘voltage’. However, the correct equation for the maximum energy is $E=\frac{1}{2}QV$. Why? I’m looking for a simple, intuitive explanation because my reasoning that $E=QV$ seems sound to me. I know about , but I’m looking for a reason to disprove my specific argument that $E=QV$ and not the “Oh, it comes from integration.” response. Let $V=\{f : S \to \mathbb{R} \}$ be the set of all the functions $f : S \to \mathbb{R}$. Let $S=\{ 1,2,...,n$}, now my train of thought was that the basis of V must be a linearly independent set that Span V so somehow show that there is a set of functions on S that can compose as a linear combination and map to any number in $\mathbb{R}$. Any idea how to get a general answer for basis for dimension of V? Remove blank attributes from an Object in Javascript How to fix sculpting ridges? I ran into a problem I have never seen before and that is when I try to sculpt on a mesh, it sculpts like this:  Instead of this: I am using dyntopo with these settings:   I feel like theres a very obvious solution to this, but I have no idea what it is. Links to the Wayback Machine are broken in chat transcript is an example of the bug. It looks like this in regular chat:  That link points to: http://web.archive.org/web/20080409050311/http://personalpages.manchester.ac.uk/staff/daryn.lehoux/Tropes.pdf  In the transcript, it looks like this:  That link points to: http://web.archive.org/web/20080409050311/%3Ca%20href=  ... which doesn't work so well! Could this be fixed? I'm not sure if this impacts links to elsewhere. Experiment to find structure of water Who first determined the structure of water (two hydrogen atoms stuck to an oxygen atom at approx 105 degrees), and, more importantly, how was this done? I am being prompted with the following error while using \pagestyle{headings} on a book class LaTeX document:  Overfull \hbox (240.44835pt too wide) has occurred while \output is active \OT1/cmr/m/sl/12 CHAPTER 1. THE CITY OF CARTHAGE WAS THE CENTRE OF THE ANCIENT CARTHAGINIAN CIVILIZATION \OT1/cmr/m/n/12 2   The following is the offending code:  \documentclass[12pt,letterpaper,oneside]{book}  \pagestyle{headings}   \begin{document}  \pagenumbering{arabic}  \chapter{The city of Carthage was the centre of the ancient Carthaginian civilization} The city of Carthage was the centre of the ancient Carthaginian civilization. The city developed from a Phoenician colony of the 1st millennium BC into the capital of an ancient empire.[2] The area of Carthage was before inhabited by Berber people who also became the bulk of Carthage's population and constituted a significant part of its army, economy and administration. Native Berbers and settling Phoenicians in Carthage mixed in different ways including religion and language, creating the Punic language and culture.  The name of Carthage, Latin: Carthago or Karthago,  meaning "New City"   The first civilization that developed within the city's sphere of influence is referred to as Punic (a form of the word "Phoenician") or Carthaginian. The city of Carthage is located on the eastern side of Lake Tunis across from the centre of Tunis. According to Greek historians, Carthage was founded by Canaanite-speaking Phoenician colonists from Tyre (in modern Lebanon) under the leadership of Queen Elissa or Dido. It became a large and rich city and thus a major power in the Mediterranean. The resulting rivalry with Syracuse, Numidia, and Rome was accompanied by several wars with respective invasions of each other's homeland.  Hannibal's invasion of Italy in the Second Punic War culminated in the Carthaginian victory at Cannae and led to a serious threat to the continuation of Roman rule over Italy; however, the Romans gained the upper hand by invading Africa and defeating Carthage at the Battle of Zama in 202 BC. Following the Third Punic War, the city was destroyed by the Romans in 146 BC. However, the Romans refounded Carthage, which became the empire's fourth most important city and the second most important city in the Latin West. It later became the capital of the short-lived Vandal kingdom. It remained one of the most important Roman cities until the Muslim conquest, when it was destroyed a second time in 698.  The ancient Greek philosopher Aristotle wrote extensively on Carthaginian politics, and he considered the city to have one of the best governing institutions in the world, along with those of the Greek states of Sparta and Crete.[5][6]  \section{Topography} Carthage was built on a promontory with sea inlets to the north and the south. The city's location made it master of the Mediterranean's maritime trade. All ships crossing the sea had to pass between Sicily and the coast of Tunisia, where Carthage was built, affording it great power and influence.  \end{document}    The \hbox refers to:      How can I solve this issue using \pagestyle{myheadings}? Or how can I solve this issue keeping the book class heading format? Explain travel times and distances on flight A flight from Los Angeles to ABQ is about 2 hours but is ~670.2 miles  A flight from San Jose to Chicago is 4 hours but is ~1859.0 miles  Can anyone explain why the travel time from San Jose to Chicago is not longer and closer to 5.75 hours?  If the distance increase by 2, shouldn't the time increase by a factor of 2 as well? PHP import Excel into database (xls & xlsx) I accidentally set an object as camera, how do I undo this? I have a problem with rendering in cycles. In blender render my object is rendering fine, but in cycles when I pushed F12 I got only this:    One more thing: when I click 0 on keyboard I'm not in camera persp, but in object as camera, it looks like invisible layer, I don't know how to undo this, and be in camera persp again.  Does anybody have any idea how to fix this? Why does my user number show up in the search box when clicking my profile information? Error/warning when using NSolve for simple equation This is a follow-up question to the discussion about the finite axiom of choice .  Suppose we have a countable collection of non-empty sets $\{A_1, A_2, A_3,\cdots\}$ Reasoning as indicated in that discussion, we can prove the existence of a choice function $c_n$ such that $c_n(i)$ belongs to $A_i$ for $i = 1,\cdots,n$  Again reasoning as suggested and using induction, we can prove the existence of a function $C$ defined over $\{1, 2, \cdots\}$ such that $C(n)$ is a choice function defined for $i=1,\cdots,n$ with $C(n)(i)$ an element of A_i. We can require in addition that $C(n)(i)$ and $C(n-1)(i)$ are equal for $i=1,\cdots,n-1$.  Now it would it seem that we can prove the countable axiom of choice by taking the union of $C(1)$, $C(2)$, $\cdots$  The question is as follows: why is that proof wrong? I suspect the answer may have something to do with the axiom of union. I want to show that if a function $f:[a,b]\rightarrow \mathbb R$ satisfies a Hölder condition of order $\alpha &gt; 1 $ then it is constant.  The way I think of it is as follows:  $$|f(x) - f(y)| &lt; K|x-y|^\alpha$$  $$\frac{|f(x) - f(y)|} {|x-y]}  &lt; K|x-y|^{\alpha -1}$$  $$\lim_{y\rightarrow x} \frac{|f(x) - f(y)|} {|x-y]} \le \lim_{y\rightarrow x}  K|x-y|^{\alpha -1} =0 $$ As the limit is $0$, we can remove the modulus, so we get:  $$\lim_{y\rightarrow x} \frac{f(x) - f(y)} {x-y} = 0$$ So $f$ is derivable and $f'(x) = 0$ for all $x$ in $[a,b]$. Note that the reason we can add the limit $y\rightarrow x$ is because $[a,b]$ is closed in $\mathbb R$.  However, the question gives as a hint using the mean value theorem. I am not sure why one should do that. You would first have to prove that $f$ is derivable in a similar manner to what I did, and then prove that $f$ is constant. Or is there a simpler way to do it and I am missing it?  Also please inform me of any mistakes I did in the proof (if any)/ Thank you! I would like to declare functions in tikz for multiple uses of the same function within the code.  Sadly, it seems that the tikz "declare function" is not compatible with the french option in babel. Indeed, the following code (that I simplifed on purpose) runs fine :  \documentclass[english]{article} \usepackage{babel}                       \usepackage{tikz}  \begin{document} \begin{tikzpicture}     \tikzset{declare function={Carre(\t)=\t*\t;}}     \draw plot [domain=-1:1] (\x,{Carre(\x)}); \end{tikzpicture} \end{document}   But when I replace   \documentclass[english]{article}   with   \documentclass[english,french]{article}   compilation generates an error. This is what the log file says :     Missing character: There is no = in font nullfont!   Missing character: There is no @ in font nullfont!   Missing character: There is no @ in font nullfont!      Runaway argument?   -1:1] (\x ,{Carre(\x )}); \end {tikzpicture} \end {document}    ! Paragraph ended before \pgfmath@local@@functions was complete.                          \par    l.18       I suspect you've forgotten a `}', causing me to apply this   control sequence to too much text. How can we recover?   My plan is to forget the whole thing and hope for the best.   Before posting this, I updated all packages without success.  Any help welcome! Local anchor for group master (move/translate/offset of group master moves group instances)? Let's say I start with the default Blender (2.64) file, except I set the cube to be 1 for all dimensions. At that point, the cube is at xyz location (0,0,0).  Then, let's say I select the cube with right mouse button, and go to Object / Group / Create New Group, and confirm the name "Group" in the "Create New Menu" bar with [Enter]. The selection outline turns green, meaning it's a group "master" (as far as I can see).  Now, let's say I press Shift-A; and choose "Group Instance" > "Group", and set the new instance to Z=2.3; with all selected, the view looks something like this:    Now, let's say I deselect all with A, then select the group master with right-click; and let's say I move it to Y=-2; then the result is:    ... that is, it is noticeable that the group instance/clone also moved in respect to its center (note the group instance axes, which remain in the set position)! Which means, I guess, that groups are defined in respect to the global coordinate center (0,0,0) as anchor.   My question is: is it possible to define a group, but in respect to the, say, bounding box center of the group as anchor - such that when I move/translate the group master, the group instances would remain anchored at their set position (basically, at the center of the group instance axes)? Also, is this documented anywhere in Blender documentation (I had problems finding this info)?