So I was surprised I didn't find anything regarding this.  I have a python script which is testing a C++ program. It needs to format a float in the same way std::setprecision does. That is a float like 1.265 should be rounded UP to 1.27 (2 dp).  Now I have the following code: "{:.2f}".format(myFloat)  The issue is that numbers like 1.265 are rounded to 1.26 and my tests fail. setprecision rounds 1.265 to 1.27. What is the best way to fix this issue?
I want a to be rounded to 13.95.  &gt;&gt;&gt; a 13.949999999999999 &gt;&gt;&gt; round(a, 2) 13.949999999999999   The  function does not work the way I expected.
Since 11.10 nautilus shows my Desktop in Unity. As I remember correctly, tthis wasn't in 11.04. How can I disable that? A geometric reason why the square of the focal length of a hyperbola is equal to the sum of the squares of the axes? Help with proving that $\pi$ is irrational What vintage movie had this blue floating holographic head talking to some kind of military installation? Filter to change the content of 404 page I have created custom rewrite rules. These rules now go to 404 page as expected. I can use action hook template_redirect to change the template matching query_var.  But I don't want to create separate template files as the page structure depend on the current theme in use. Rather I just want to change the content and title. I have tried change the content using the_content filter, but it seems the filter doesn't even get called for 404 page.  I also tried loading index.php template and then using the_content filter, but it also doesn't work.  Is there any way to achieve this? Dell Inspiron 3551 Unresponsive Touchpad I just got my laptop in the mail and I installed Ubuntu 14.04 LTS. It all went smooth until it booted up and I noticed my touch pad doesn’t work at all. It works perfectly on Windows and when I use a wireless mouse it works as well.  Here's my xinput:  ⎡ Virtual core pointer                          id=2    [master pointer  (3)]   ⎜   ↳ Virtual core XTEST pointer                    id=4    [slave  pointer  (2)]   ⎜   ↳ 2.4GHz RF  KEYBOARD  AND  MOUSE               id=11   [slave  pointer  (2)]   ⎜   ↳ DLL06AB:00 06CB:78F1                          id=13   [slave  pointer  (2)]   ⎜   ↳ SynPS/2 Synaptics TouchPad                    id=15   [slave  pointer  (2)]   ⎣ Virtual core keyboard                         id=3    [master keyboard (2)]       ↳ Virtual core XTEST keyboard                   id=5    [slave  keyboard (3)]       ↳ Power Button                                  id=6    [slave  keyboard (3)]       ↳ Video Bus                                     id=7    [slave  keyboard (3)]       ↳ Power Button                                  id=8    [slave  keyboard (3)]       ↳ Sleep Button                                  id=9    [slave  keyboard (3)]       ↳ 2.4GHz RF  KEYBOARD  AND  MOUSE               id=10   [slave  keyboard (3)]       ↳ Integrated_Webcam_HD                          id=12   [slave  keyboard (3)]       ↳ AT Translated Set 2 keyboard                  id=14   [slave  keyboard (3)]       ↳ Dell WMI hotkeys                              id=16   [slave  keyboard (3)]     I would love to have my track pad working and I've done some googling and browsing of this site and nothing I've tried has worked. Any input would be great. Let me know if there’s any other information that can help remedy this. I'm pretty new to Linux. Thank you very much.  Edit: I've updated the kernel to 3.19 and checked my Additional Drivers which had nothing for me. Neither of which worked. What's the difference between the atomic and nonatomic attributes? What do atomic and nonatomic mean in property declarations?  @property(nonatomic, retain) UITextField *userName; @property(atomic, retain) UITextField *userName; @property(retain) UITextField *userName;   What is the operational difference between these three? How can I install Sun/Oracle's proprietary Java JDK 6/7/8 or JRE? Forcing linebreaks in \url Heap versus Stack allocation implications (.NET) From an 1 about Heap and Stack, it raised me a question: Why it is important to know where the variables are allocated?  At  someone pointed that the stack is faster. Is this the only implication? Could someone give a code example where a simple allocation location change could solve a problem (eg. performance)?  Note that this question is .NET specific  1 the question is removed from SO. Rstudio is duplicating commands in the command line Ball motion with air resistance coupled differential equation for fourth-order Runge-Kutta I've created a MATLAB function for solving coupled differential equation with the fourth-order Runge-Kutta method based on what is provided  (Simultaneous Equations of First Order). Here the function:  function [y] = rk4_c(f, g, h, x, y, z, n) % Runge-Kutta % Implementation of the fourth-order method for coupled equations % h = dt % x is the time here  for ii=1:(n-1)     k1 = h * f(x(ii), y(ii), z(ii));     l1 = h * g(x(ii), y(ii), z(ii));     k2 = h * f(x(ii) + 0.5*h, y(ii) + 0.5*k1, z(ii) + 0.5*l1);     l2 = h * g(x(ii) + 0.5*h, y(ii) + 0.5*k1, z(ii) + 0.5*l1);     k3 = h * f(x(ii) + 0.5*h, y(ii) + 0.5*k2, z(ii) + 0.5*l2);     l3 = h * g(x(ii) + 0.5*h, y(ii) + 0.5*k2, z(ii) + 0.5*l2);     k4 = h * f(x(ii) + h, y(ii) + k3, z(ii) + l3);     l4 = h * g(x(ii) + h, y(ii) + k3, z(ii) + l3);     y(ii+1) = y(ii) + (1/6)*(k1 + 2*k2 + 2*k3 + k4);     z(ii+1) = z(ii) + (1/6)*(l1 + 2*l2 + 2*l3 + l4); end   I would like to use this function for solving motion equations for a ball with air resistance. So starting with the basic equations (I hope they are correct): $$md^2x/dt^2 = F_{D_x}$$ and $$md^2y/dt^2 = F_{D_y}-mg$$ with $$F_{D_x} = -Dvvcos(\theta)$$ and $$F_{D_y} = -Dvvsin(\theta)$$ where $D$ is a drag coefficient. From my understanding, and from what I read, both second-order equation can be converted to two coupled equations that could be used with my coupled Runge-Kutta method function. Can someone help me understand how to convert my equation to a set of coupled equations that could be used with my MATLAB function?  EDIT  I was able to use my rk4_c function, however it only works for solving the velocities. I'm now trying to see how I could solve for the positions x and y. I'm kind of learning about Runge-Kutta methods at the same time, so sorry for the questions that may sound trivials.  % Runge Kutta code to solve projectile motion with quadratic drag % dVx/dt = -(D/m)*vx*sqrt(vx^2+vy^2) % dVy/dt = -(D/m)*vy*sqrt(vx^2+vy^2) - g  clc clear all  % Constant D = 0.24; % m = 2; % kg g = 9.80665; % m/s^2  % Define function handles fVx = @(t,vx,vy) -(D/m)*vx*sqrt(vx^2+vy^2); fVy = @(t,vx,vy) -(D/m)*vy*sqrt(vx^2+vy^2) - g;  % Initial conditions v0 = 200; % m/s theta = 30*pi/180; % rad t(1) = 0; vx(1) = v0*cos(theta); vy(1) = v0*sin(theta);  % Step size h = 0.01; % s tFinal = 2; N = ceil(tFinal/h);  % RK4 simultaneous coupled loop for ii = 1:N     % Update time     t(ii+1) = t(ii) + h;      % Update vx and vy     k1 = h * fVx(t(ii), vx(ii), vy(ii));     l1 = h * fVy(t(ii), vx(ii), vy(ii));     k2 = h * fVx(t(ii) + 0.5*h, vx(ii) + 0.5*k1, vy(ii) + 0.5*l1);     l2 = h * fVy(t(ii) + 0.5*h, vx(ii) + 0.5*k1, vy(ii) + 0.5*l1);     k3 = h * fVx(t(ii) + 0.5*h, vx(ii) + 0.5*k2, vy(ii) + 0.5*l2);     l3 = h * fVy(t(ii) + 0.5*h, vx(ii) + 0.5*k2, vy(ii) + 0.5*l2);     k4 = h * fVx(t(ii) + h, vx(ii) + k3, vy(ii) + l3);     l4 = h * fVy(t(ii) + h, vx(ii) + k3, vy(ii) + l3);     vx(ii+1) = vx(ii) + (1/6)*(k1 + 2*k2 + 2*k3 + k4);     vy(ii+1) = vy(ii) + (1/6)*(l1 + 2*l2 + 2*l3 + l4); end  % Plot the solution figure(1) plot(t, vx, t,vy) xlabel('Time (s)') ylabel('Velocities (m/s)') legend('Vx', 'Vy') adding @2x to src above certain resolution on none retina devices DEFINE vs Variable in PHP \overbrace and \underbrace with square bracket Prove :(P → Q) ∨ (Q → P) using natural deduction Allowed inference rules: ∨-I, ∨-E, ∧-I, ∧-E, →-I, →-E, ¬-I, ¬-E  I tried to prove a contradiction by assuming $¬ ((P → Q) ∨ (Q → P))$ but got stuck, or am I doing it in the wrong way?  Edit:  My proof attempt  $1.\qquad¬ ((P → Q) ∨ (Q → P))\qquad \qquad\qquad\qquad\qquad\qquad\qquad \qquad\qquad Assum$  $2.\qquad P → Q\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\  Assum$  $3.\qquad(P → Q) ∨ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\; ∨-I(2)$  $4.\qquad(¬ ((P → Q) ∨ (Q → P))) ∧ ((P → Q) ∨ (Q → P))\qquad\qquad\qquad\; ∧-I(1,3)$  $5.\qquad  ¬ (P → Q)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\;\;\; ¬-I(2,4)$  $6.\qquad  Q → P\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad \qquad\qquad\qquad\quad\; Assum$  $7.\qquad  (P → Q) ∨ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\quad\;\; ∨-I(6)$  $8.\qquad  (¬ ((P → Q) ∨ (Q → P))) ∧ ((P → Q) ∨ (Q → P))\qquad\qquad\qquad\;\; ∧-I(1,7)$  $9.\qquad  ¬ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\qquad\; ¬-I(6,8)$  $10.\qquad ¬ (P → Q) ∧ ¬ (Q → P)\qquad\qquad\qquad\qquad\qquad\qquad\;\qquad\qquad\quad\;\;\, ∧-I(5,9)$  Stuck at this line, can't spot any contradiction to line 1 How does one change the frame size and colors in the frame option of titlesec as in MWE? In "Seeing like a state" of James C.Scott there is a sentence at the beginning of a paragraph (Acknowledgements xi):     There are a good many scholars whose writings opened up new   perspectives for me or provided outstanding analyses of issues that I   could not have hoped to study so comprehensively on my own.   What worries me is a good many scholars. Is this some type of inversion or ancient English? Is this grammatically right? Why is a here? I thought that appropriate version would be There are many good scholars. Am I wrong? Uncountable $\sigma$-algebra I'm stuck on the following problem (Source: Real Analysis for Graduate Students; Exercise 2.6; ):     Suppose $\mathcal A$ is a $\sigma$-algebra with the property that whenever $A \in \mathcal A$, there exists $B, C \in \mathcal A$ with $B \cap C = \emptyset$, $B \cup C = A$, and neither $B$ nor $C$ is empty. Prove that $\mathcal A$ is uncountable.   I think there is the added assumption that this is only true for $A \in \mathcal A$ having at least two elements, so it doesn't hold for singletons and the emptyset?  I tried to show this by way of contradiction and say that $\mathcal A = \{A_k\}$ is countable, but I didn't see how this could get me to a contradiction.  The other approach I tried was to look at $X = B_1 \cup C_1$ where $B_1 \cap C_1 = \emptyset$, then look at $B_1 = B_2 \cup C_2$ where $B_2 \cap C_2 = \emptyset$ and so on. If I look at the $C_k$'s they are pairwise disjoint and I either have a finite number of them or an infinite number of them in which case I've created a countable sequence of pairwise disjoint nonempty elements of $\mathcal A$. This path looked promising, but I couldn't see what to do next. Any ideas?  As a secondary question: I think this result is supposed to be used to show that if $\mathcal A$ is a $\sigma$-algebra with infinitely many elements, then it's uncountable, but I wasn't able to show that the property mentioned above (the one I'm trying to show) was satisfied in this case. Access to our computer (not only to the internet) needs to be restricted for the accounts of my kids (7, 8) until they are old enough to manage this by themselves. Until then we need to be able to define the following:   the hours of the day when computing is o.k. (e.g. 5 - 9 pm) the days of the week when computing is not o.k. (e.g. mondays to fridays) the amount of time allowed per day (e.g. 2 hours)   In 11.10 all of the following that used to do the job don't work any more:   : for > 11.10 no more available through the ppa. : command line alternative, but from 11.10 removed from the repositories. : Looks great but repeatedly crashes to force restarting X-server. So we can't use or recommed this program at the moment.   Are there any other alternatives?