In my script I can select a midifile that's in the same directory as the script by typing the name of the file: 'moonlight.mid'. I chose to organize the midifiles and move them to the folder testmidifiles. I would expect that I could use 'testmidifiles/moonlight.mid' but this gives the error 'No such file in directory'. Is there a way to make this work? As an example: projectfolder/test.py print(open('testfolder/test.txt'))  projectfolder/testfolder/test.txt The reason is that testing on different systems, you have to change the path to the file every time and I'm a bit lazy :) I would love to know the trick!
How do you call an external command (as if I'd typed it at the Unix shell or Windows command prompt) from within a Python script?
I have just started studying implication in mathematics. So, you'll probably have an idea of where my confusion lies right from the get go.  In the truth table, where $A \implies B$ we obtain this result:  A   B   T/F ___________ T | T | T T | F | F F | T | T F | F | T   Now, my confusion here is regarding why $A\implies B$ given A is false, and B true. The others I understand. The first and last one are obvious, the second one implies, to me anyway, that given A implies B, the truth of B rests upon the truth of A, B is false, A is True, which cannot be, thus not B given A is false.  Now... then, why is B true despite the fact that A is false? Or rather, why is the statement B given not A, True. The truth of B is implied from the truth of A, but A is a false statement. So it's very contradictory that this may be, and in fact, if you go through a real life example, you would find that the third statement seems to be false.  Say $A$ is the statement that it is dark outside, and $B$ the statement that the sun is not on our side of the earth. If it is not dark outside, than stating that the sun is on the other side of the planet must be wrong (in my example i'm going to claim that the sun is the only light source).  Side note:  I just had a thought, if A is false, does that mean you can conclude... mmm, whatever? I mean, B is implied via the truth of A, if A is false, B is NOT implied, but then B could be EITHER true or false, I suppose. Is this correct?  However, would that not mean that A does not imply anything when false. Would that not set the 3rd and 4th statement to be undefined? I am using lightning:recordEditForm and lightning:inputField for creating a new record. this component is being used inside a lightning community builder. When i click the submit button, i am able to create a new record in my custom object. However i need the created record ID as i need to pass it in the URL for the next page. Where are the corrosive weapons at? I'm a Siren and I'm getting almost nothing but Fire elemental guns; about 90% of guns have been fire, most of the rest Explosive and a scare few Shock.  Are the elemental varieties more common at different levels? I've seen zero corrosive/shock guns so far. I'm level 12 at the moment. Let's say I have Windows installed on drive C, however I install all of my programs on the D drive, and I keep my user profile on the D drive as well (things like My Documents). How can I have Windows use those folders instead of the ones on the C drive? How to switch between virtual console and GUI in Ubuntu? I wanted to see what key functions would allow me to switch between the two. XML serialization without null XMLArray New messages flagged blue bubble does not go away When someone flags a message in chat all 10k+ users in chat get a little blue bubble to vote on. It shows up in the upper left hand corner of your gravatar (which is in the bottom left of the page).  When someone flags a message and it shows up, if I wait for a second to click on it, and then click on it, and it has already been handled, it shows the message  "There are no flags to display."  In the past, after showing this message, the blue (1) would disappear. However, lately it has not been going away and requires a page refresh in order to remove. Can this be fixed?  This issue is addressed here:  from September 12th 2012. But since it is still occurring 10 months later, I believe the cause is different. Suppose that sequences of real numbers satisfy:  \begin{align*}   a_n &amp;= \sum\limits_{r=0}^n \binom{n}{r} b_r \\ \end{align*}  Prove that:  \begin{align*}   (-1)^n b_n &amp;= \sum\limits_{s=0}^n \binom{n}{s} (-1)^s a_s \\ \end{align*}  My work:  The $n=0$ case:  \begin{align*}   a_0 &amp;= b_0 \\   b_0 &amp;= a_0 \\ \end{align*}  Then $n=1$ case:  \begin{align*}   a_1 &amp;= \binom{1}{0} b_0 + \binom{1}{1} b_1 = b_0 + b_1 \\   -b_1 &amp;= \binom{1}{0} a_0 - \binom{1}{1} a_1 = a_0 - a_1 \\   b_1 &amp;= a_1 - a_0 = b_0 + b_1 - a_0 = b_1 \\ \end{align*}  The inductive step:  \begin{align*}   (-1)^{n+1} b_{n+1} &amp;= \sum\limits_{s=0}^{n+1} \binom{n+1}{s} (-1)^s a_s \\ \end{align*}  I'm not sure where to go from here. I tried substituting $a_s$ into that last equation and it didn't help. Any ideas? How do I get my Broadcom BCM4313 working correctly? How to monitor battery condition and pop-up notification? Essentially, I would like  into a working answer.   I know how to extract the battery percentage from :   upower -i $(upower -e | grep BAT) | grep --color=never -E percentage|xargs|cut -d' ' -f2|sed s/%//   And how to pop-up a basic notification:   notify-send "battery low"   But how can I set up a (bash?) script to permanently monitor the output and send notification as per this pseudo-code:   if battery_status &lt; 10% then notify-send "battery low" and put my system to suspended state sudo pm-suspend Consider a rocket in deep space with no external forces. Using the formula for linear kinetic energy $$\text{KE} = mv^2/2$$ we find that adding $100\ \text{m/s}$ while initially travelling at $1000\ \text{m/s}$ will add a great deal more energy to the ship than adding $100 \ \text{m/s}$ while initially at rest: $$(1100^2 - 1000^2) \frac{m}{2} \gg (100^2) \frac{m}{2}.$$ In both cases, the $\Delta v$ is the same, and is dependent on the mass of fuel used, hence the same mass and number of molecules is used in the combustion process to obtain this $\Delta v$. So I'd wager the same quantity of chemical energy is converted to kinetic energy, yet I'm left with this seemingly unexplained $200,000\ \text{J/kg}$ more energy, and I'm clueless as to where it could have come from. What does the word treats mean in this context? I don't think it means entertainment, food, drink etc.. Maybe it is an old usage of this word? Does it mean influencing factors or something like that?  This is the first part of the title of the first chapter of the novel "Oliver Twist" by Charles Dickens. The whole title reads:     Treats of the Place Where Oliver Twist was Born and of the Circumstances Attending His Birth Symfony plugin sfDoctrineActAsTaggablePlugin not working Parsing an Int from a string in javascript In javascript, what is the best way to parse an INT from a string which starts with a letter (such as "test[123]")?  I need something that will work for the example below.  My JS:  $(document).ready(function() {      $(':input').change( function() {         id = parseInt($(this).attr("id"));  //fails for the data below         alert(id);     }); }   My generated HTML:  &lt;select id="attribute[123]"&gt; &lt;!-- various options --&gt; &lt;/select&gt; &lt;select id="attribute[456]"&gt; &lt;!-- various options --&gt; &lt;/select&gt;   Thank you! I would like to create some kind of feature matrix with available classes in columns and implemented features as rows. Problem is, that the class names are quite long.  Rotating them by 90° simply looked quite silly, so am looking for alternate ideas.  The only idea I had so far was to write the heading text horizontally with a arrow (or similar) matching the "heading row" with a column. But frankly I have no idea how to do something like this in latex.  An minimal example of my naive approach looks like this.  \documentclass{beamer}  \usepackage{tabularx}  % I am actually using a custom theme % The space ``wasted'' is similar for PaloAlto though \usetheme{PaloAlto}  \begin{document} \frame {   \frametitle{Comparision of boost implemented graph classes}   \begin{tabularx}{\textwidth}{X c c c}     %     % Column Headers, first column is empts     %     & \rotatebox{90}{adjacency\_list}     & \rotatebox{90}{adjacency\_matrix}     & \rotatebox{90}{compressed\_sparse\_row\_graph}      \     %     % Rows, I suspect I need about 10     % Class               adjlist          adjmatrix     csrg     \hline      AdjacencyGraph        & Yes            & No          & Yes \\     Interface \#2         & Yes            & No          & Yes \\     Interface \#3         & Yes            & No          & Yes \\     Interface \#4         & Yes            & No          & Yes \\     Interface \#5         & Yes            & No          & Yes \\     Interface \#6         & Yes            & No          & Yes \\     Interface \#7         & Yes            & No          & Yes \\     Interface \#8         & Yes            & No          & Yes \\     Interface \#9         & Yes            & No          & Yes \\     % Rest omitted   \end{tabularx} } \end{document}    If its important: I am doing this for a presentation with beamer. How do I choose a macro lens for a Canon APS-C camera? Should I vote to close a duplicate question, even though it's much newer, and has more up to date answers? I am a history teacher and I like to make my own maps (I can never find exactly what I want).  I am using QGIS 1.8 and .  I want to reproject their cross-blended hypso rasters into projections that are more familiar looking to my students, like Lambert Conic Conformal.  I have tried changing the crs for the whole project, and the warp and assign functions from the raster menu, and changing the crs for the raster layer itself.  None of these seem to work properly - the resulting maps are unrecognizable and extremely large (file size).  I feel like I am making some kind of basic mistake but I don't know where to begin with this.  Any help would be appreciated. What is the antiderivative of $e^{-x^2}$ I was wondering what the antiderivative of $e^{-x^2}$ was, and when I wolfram alpha'd it I got $$\displaystyle \int e^{-x^2} \textrm{d}x = \dfrac{1}{2} \sqrt{\pi} \space  \text{erf} (x) + C$$  So, I of course didn't know what this $\text{erf}$ was and I looked it up on wikipedia, where it was defined as:   $$ \text{erf}(x) = \dfrac{2}{\sqrt{\pi}} \displaystyle \int_0^x e^{-t^2} \textrm{d}t $$   To my mathematically illiterate mind, this is a bit too circular to understand. Why can't we express $\int e^{-x^2} \textrm{d}x$ as a 'normal function'? Also, what is the use of the error function? How to implement a tree data-structure in Java?