Intermediate AI for Java games
How does A* pathfinding work?
When to use RSA and when ElGamal asymmetric encryption Unable to 'apt-get dist-upgrade' due to appstreamcli database error I have created a USB stick with a persistent Ubuntu 16.04 (release version). I tried a couple of ways, using Startup Disk Creator and MultiSystem, but I get the same end result.  When I boot into the USB and do 'apt-get update', all is well.  When I try 'apt-get dist-upgrade' I get:     ** (appstreamcli:2761): CRITICAL **: Error while moving old database out of the way. AppStream cache update failed.   The only reference to this error message I can find is  but would appear to be fixed, at least fixed by the time the release version of Ubuntu 16.04.  Aside: I want to test Unity8, which includes installing software.  I don't have a spare computer, so I thought a persistent USB would do the trick.  Any takers? Index entries duplicated for captions In document class book, and package caption, creating index with makeidx. Index entries for the main text and for footnotes collate properly; but those for captions create their own entries.  Example: for the tag \index{New York!Custom House!\textit{Cartouche}}, text and footnotes collate properly; but used in a caption, a new entry is created at the third level, and is also out-of-alphabetic-sequence. Note: the top level, and first sub are correct; only the second sub is duplicated.  How to get the caption index entries under the same entry? Floating Objects and Weight The Situation:  A ball is placed in a beaker filled with water and floats. It is also attached to the bottom of the beaker via a string.   The Question:  The ball is attached to the beaker, thus making the ball and beaker (and string included) a system. However, it is floating. Does the ball add to the weight of the beaker? How to create an animated Electric Arc or Lightning? I know about the technique of using a displace modifier with an animated displace object on a thin plane, but there are no "branches", no forking in the lightning.  Here is an image  that shows more or less what I'm thinking of:    Is it possible to achieve an 3D animated affect like this?  I have tried a few things, such as the . However, it doesn't support animation and repeatedly generating meshes and then manually animating the visibility is a tedious. If the matrix $A^3 = 0$, is $A$ singular? Bending of light - photon's inertia instead of mass Using classical mechanics, the formula for gravitational attraction is   $$F = G\frac{m_1m_2}{r^2}.$$   This formula does not work for photons, and we need to use Einstein's theory of gravity to account for that, as the photon is massless. What if, instead of using the mass of the photon, we rather used the inertia of it?  The momentum of a photon is     $$p=\frac{h}{\lambda}.$$  Thus, using that, we can calculate its supposed 'mass' (inertia) as momentum is also equal to mass times velocity. So 'mass' of a photon is     $$m=\frac{p}{v}=\frac{h}{\lambda  c}.$$   If we use this mass as the mass of a photon, can we use Newton's equation for gravitational attraction? Repeatedly rolling a six sided die four times and summing the highest three results gives you a distribution with what mean and standard deviation? Repeatedly rolling a six sided die four times and summing the highest three results gives you a distribution with what mean and standard deviation?  I've only taken AP statistics, but I would like to learn how to do this. I have a Python script I recently wrote that I call using the command line with some options. I now want a very thin web interface to call this script locally on my Mac.  I don't want to go through the minor trouble of installing mod_python or mod_wsgi on my Mac, so I was just going to do a system() or popen() from PHP to call the Python script.  Any better ideas? Thanks in advance! Firefox browser opens but URL is not launched Tips to extend battery life for laptops and notebooks This question is present as a matter of historical interest.  While you are encouraged to help maintain its answers, please understand that "big list" questions are not generally allowed on Ask Ubuntu and will be closed per the .   It is possible to greatly extend the usage time of a laptop or netbook running on battery by disabling various services and installing various packages.   What tricks or tips do people have for getting an extra hour or two out of their batteries? Change the selected value of a drop-down list with jQuery I have a drop-down list with known values. What I'm trying to do is set the drop down list to a particular value that I know exists using jQuery.  Using regular JavaScript, I would do something like:  ddl = document.getElementById("ID of element goes here"); ddl.value = 2; // 2 being the value I want to set it too.   However, I need to do this with jQuery, because I'm using a CSS class for my selector (stupid  client ids...).  Here are a few things I've tried:  $("._statusDDL").val(2); // Doesn't find 2 as a value. $("._statusDDL").children("option").val(2) // Also failed.      How can I do it with jQuery?     Update  So as it turns out, I had it right the first time with:  $("._statusDDL").val(2);   When I put an alert just above it works fine, but when I remove the alert and let it run at full speed, I get the error     Could not set the selected property. Invalid Index   I'm not sure if it's a bug with jQuery or Internet Explorer 6 (I'm guessing Internet Explorer 6), but it's terribly annoying. The highest common factor and the lowest common multiple of two numbers $A$ and $B$ are $12$ and $168$ respectively. Find the possible values of $A$ and $B$ with the exception of $12$ and $168$.   Help me with this equation please. I kind of get it but I don't understand the concept behind it... I do not want to memorize. How to redirect a URL to a custom IP address? I have an Ubuntu machine that I'm using as my home Internet router.  It uses a USB mobile broadband modem as its Internet connection, and shares this with another router (via the router's "Internet" port) which I use as my LAN.  How do I redirect requests from within my LAN for a given URL to a custom IP address (ex have google.com redirect to x.x.x.x)? Top-bar hat misplaced Vandermonde Determinant This is an exercise from Ian Stewart's Galois Theory, $3^{rd}$ edition:     If $z_1,z_2,\ldots,z_n$ are distinct complex numbers, show that the determinant $$D=\left|\begin{array}[cccc]  11&amp;1&amp;\cdots&amp;1\\ z_1&amp;z_2&amp;\cdots&amp;z_n\\ z_1^2&amp;z_2^2&amp;\cdots&amp;z_n^2\\ \vdots&amp;\vdots&amp;\ddots&amp;\vdots\\ z_1^{n-1}&amp;z_2^{n-1}&amp;\cdots&amp;z_n^{n-1} \end{array}\right|$$   is nonzero.       Hint: Consider the $z_j$ as independent indeterminates over $\Bbb C$. Then $D$ is a polynomial in the $z_j$, of total degree $0+1+\cdots+(n-1)=\frac{1}{2}n(n-1)$. Moreover, $D$ vanishes whenever $z_j=z_k$ for $k\neq j$, as it then has two identical rows. Therefore $D$ is divisible by $z_j-z_k$ for all $j\neq k$, hence it is divisible by $\prod_{j&lt;k}(z_j-z_k)$. Now compare degrees.   My question is how to do this. I follow the hint and I'm thinking of $D$ as a cofactor expansion; is that the idea? Also, the fact that $D$ vanishes whenever $z_j=z_k$ for $k\neq j$ follows since it would have two identical columns, right? I don't see why $z_j=z_k$ would imply it has two identical rows, as the hint suggests. The fact that it is divisible by $(z_j-z_k)$ is easy since that would make $z_k$ a root for $k=j$, but I'm not quite sure I follow why the degrees would be different. I think the degree of the product would be $1+2+\cdots+(k-1)$, but then add these up for all $k&lt;n$?   I appreciate any clarification that you can provide! For some complicated diagrams, I need to use something like Adobe Illustrator or Inkscape, and would like to include nicely typeset labels. (I'm aware of post-processing solutions, such as pinlabel.) One way to do this is to use a closely-matching font, and then convert fonts to outlines. Better, however, would be to use Computer Modern directly in Illustrator.  Where can I find a Computer Modern font compatible with Adobe Illustrator? Privilege Notifications The Problem For a small mass a distance $R_i$ away from the center of the Earth, how long would it take for the object to fall to the surface of the Earth, assuming that the only force acting upon the object is the Earth's gravitational force?  Relevant Information The following discussion seems to have solved exactly the same problem:   However, upon working out the mathematics, I'm not exactly sure how to evaluate the constant of integration.   A Partial Solution $$ F=\frac {-GMm}{s^2} $$ $$ a=\frac {-GM}{s^2} $$ $$ \frac {dv}{dt} = \frac {-GM}{s^2} $$ Multiplying by $v$ and then integrating by $dt$ on both sides, we have $$\frac {1}{2} v^2=\frac {GM}{s} +c_1$$ where $c_1$ is a constant of integration. Substituting initial conditions of $v=0, s=R$, we have $$\frac {1}{2} v^2=GM(\frac {1}{s}-\frac{1}{R})$$  At this point of time, when I use Wolfram Alpha, I get  $$c_2+\sqrt{\frac{2}{R}}t=\frac{\sqrt{s}(s-R)+R\sqrt{R-s}\times{\tan^{-1}(\sqrt{\frac{s}{R-s}})}}{\sqrt{GM(R-s)}}$$  where $c_2$ is a constant of integration. Substituting initial conditions of s=R, t=0, we find that the term $$\tan^{-1}(\sqrt{\frac{s}{R-s}})$$ is undefined. At this point, I'm stuck. Any ideas on where I've made the mistake here?  (For those interested, this question was inspired by the Greek myth which states that a bronze hammer dropped from heaven would take 9 days to hit the Earth and would reach on the tenth). How to sail downwind faster than the wind? Recently a  set a record for sailing a wind-powered land vehicle directly down wind, and a speed faster than wind speed. Wikipedia has a  talking about it, but it doesn't explain exactly how it works.  I can imagine some configurations, but I don't get how a system could be set up to push forward with a tailwind (when the cart is moving slower than the wind) and push forward with a head wind (when the cart is moving faster than the wind).  Could someone help explain how this is possible?