Showing MySql error in tickets
How can I prevent SQL injection in PHP?
I am trying to test the impact of a sale initiative on store revenue. I have created 10 matched pairs of stores and then randomly distributed one store in each pair into a test or control group.  I then ran the sale for 21 days within the test group (keeping control constant) and measured relative lift in revenue compared to baseline.  My questions  1.) Should I be using a paired t-test based on the previous store matching  2.) Should I be measuring across each day of the test such as:          Control Test 1/1/2017    4   3 1/2/2017    3   4 1/3/2017    1   3 1/4/2017    2   3 1/5/2017    2   4 1/6/2017    1   7   Or measuring across my paired markets such as:                 Test Control Market Pair 1   10  5 Market Pair 2   8   3 Market Pair 3   5   1 How to Calculate the time of Charging and Discharging of battery? How do you run a Python script as a service in Windows? I am sketching the architecture for a set of programs that share various interrelated objects stored in a database. I want one of the programs to act as a service which provides a higher level interface for operations on these objects, and the other programs to access the objects through that service.  I am currently aiming for Python and the Django framework as the technologies to implement that service with. I'm pretty sure I figure how to daemonize the Python program in Linux. However, it is an optional spec item that the system should support Windows. I have little experience with Windows programming and no experience at all with Windows services.  Is it possible to run a Python programs as a Windows service (i. e. run it automatically without user login)? I won't necessarily have to implement this part, but I need a rough idea how it would be done in order to decide whether to design along these lines.  Edit: Thanks for all the answers so far, they are quite comprehensive. I would like to know one more thing: How is Windows aware of my service? Can I manage it with the native Windows utilities? What is the equivalent of putting a start/stop script in /etc/init.d? Point Renderings Slightly Off in Mathematica don't really understand how to log on with your SE account in the new logon screen.  And although it might be obvious to most of us, some people find the new dialog hard to understand.        Can we add a logo and some text to make clear users can log on with their SE account? Something like:     [SE LOGO] Log on using your StackExchange account   Followed by the two boxes for email and password. How can I reject all changes in a Linq to SQL's DataContext? On Linq to SQL's DataContext I am able to call SubmitChanges() to submit all changes.  What I want is to somehow reject all changes in the datacontext and rollback all changes (preferable without going to the database).  Is this possible? says:  SSH_ASKPASS    If  ssh needs a passphrase, it will read the passphrase from the    current terminal if it was run from a terminal.  If ssh does not    have  a  terminal associated with it but DISPLAY and SSH_ASKPASS    are set, it will execute the program  specified  by  SSH_ASKPASS    and open an X11 window to read the passphrase.   I'd like SSH to use an askpass program even if it was run from a terminal.  On occasion, I have to connect to servers, where there's some delay in showing a password prompt (maybe due to network issues, maybe due to attempted reverse DNS lookups, …). I get annoyed and switch to something else, and forget about the attempted connection. (Insert joke about attention span of a goldfish.) When I finally get back to it, the prompt's timed out and even a correct password would just result in a closed connection.  Keys would be one solution, but not every system I use has my usual SSH keys. However, I usually use Ubuntu systems, and Ubuntu has an SSH askpass program installed by default.  If an askpass window popped up, however, I'd be immediately aware of it. That's a good enough compromise for me, if only I can get it to work. I understand that when I press and release the power button on the top of my iPhone or iPad, it stays on but turns off the screen.  Whereas if I press and hold the power button, a "slide to turn off" control appears on the screen.  Sliding this, as I was told, does turn the unit off, but it does so by suspending the RAM to disk (flash memory, actually.) So, when turning on the iPhone or iPad, it isn't so much rebooting the OS as it is resuming it from flash storage.  How to force the OS to completely reboot on these devices? Calculate mean of ordinal variable I've read in a number of places that calculating the mean of an ordinal variable is inappropriate. I'm trying to get an intuition for why it might be inappropriate. I think it is because, in general, an ordinal variable is not normally distributed and so calculating the mean will give an inaccurate representation. Could somebody give more detailed reasoning for why calculating the mean of an ordinal variable might be inappropriate? "Users" folder shared with everyone Today I found something strange on my newly installed Windows 7 OS - my "users" folder C:\Users was shared and "Everyone" had full access... I disabled that and now it seems fine, however I'm a bit scared actually, I'd like to know what caused that and if my system is compromised. The following code best describes the situation.  Why is the last line not outputting the trailing newline char?  Each line's output is shown in the comment.  I'm using GNU bash, version 4.1.5          echo -n $'a\nb\n'                  | xxd -p  # 610a620a              x=$'a\nb\n'   ; echo -n "$x" | xxd -p  # 610a620a      echo -ne "a\nb\n"                  | xxd -p  # 610a620a x="$(echo -ne "a\nb\n")" ; echo -n "$x" | xxd -p  # 610a62 How to disprove this fallacy that derivatives of $x^2$ and $x+x+x+\dots\quad(x\text{ times})$ are not same. Possible Duplicate:          \begin{align*} x^2 &amp;= \underbrace{x + x + x + \dots + x}_{x \text{ times}}, \\ \therefore \frac{\mathrm{d}}{\mathrm{d}x} (x^2) &amp;= \frac{\mathrm{d}}{\mathrm{d}x} (\underbrace{x + x + x + \dots + x}_{x \text{ times}}) \\ &amp;= \underbrace{1 + 1 + 1 + \dots + 1}_{x \text{ times}} \\ &amp;= x. \end{align*}  But we know that $$ \frac{\mathrm{d}}{\mathrm{d}x} (x^2) = 2x. $$  So what is the problem?  My take is that we cannot differentiate both sides because $\underbrace{{x+x+x+\cdots+x}}_{x \text{  times}}$ is not fixed and thus $1$ is not equal to $2$. The limit of a sum $\sum_{k=1}^n \frac{n}{n^2+k^2}$ as $n\rightarrow\infty$ Show a Form without stealing focus? I'm using a Form to show notifications (it appears at the bottom right of the screen), but when I show this form it steals the focus from the main Form. Is there a way to show this "notification" form without stealing focus? Factoring Quadratics Is there a method to find which numbers to use when simplifying quadratics?   For example $x^2 + 5x + 6$ is easy enough to find, but what if I have bigger numbers, or I have this quadratic expression: $x^2 + 7x – 6$, then it gets very hard to think of a valid simplification.  EDIT: Here's an example: $(x^2 + 5x + 6)/(x + 2)$. When simplifying the first half we get $(x + 2)(x + 3)/(x + 2)$, then we can cancel out $(x + 2)$ and the answer would be $(x + 3)$. The question is: How to always find the right numbers which to put in? (in this example they where 2 and 3) How to solve a system of PDEs with zip condition? I've got a circuit in the basement carrying a handful of outlets.  This circuit has no ground wire.  I want to add a couple of outlets and want them to be grounded.  I may even want gfci outlets on them in the future.  I have no reasonable way of getting a ground wire to the panel but I do have easy access to another circuit that does have a ground wire.  Is it acceptable to borrow or share a ground wire between circuits?  If not, why not?  Both circuits are 20A with 12 AWG wire. How does the EMH hold onto a phaser while having bullets go through him? In the Voyager episode: "Future's End, Part II" the doctor rescues B'elanna and Chakotay.     PORTER: They've got lasers! A black man and some bald guy.  (The EMH   enters. Porter and Butch's bullets go straight through him.)       PORTER: God in heaven help us.       EMH: Divine intervention is unlikely.  (The EMH phaser stuns them,   then unties Torres and Chakotay.)   In an earlier episode of Voyager, "Phage":     PARIS: But a hologram is just a projection of light held in a magnetic   containment field. There's no real matter involved. (The EMH slaps   Paris.)       EMH: Now, you hit me.  (Paris's hand passes through the EMH's head.)       EMH: The magnetic containment field that creates the illusion of my   body can be modulated to allow matter to pass through it or be   stopped. I might be able to modulate the holographic lungs in the same   way, allowing oxygen and carbon dioxide to pass from the lungs to the   blood stream.   In order to make the above adjustments the doctor had to touch several buttons on a control panel. I realize the time I refer to above he was using the holo-emitter instead.    How does it work exactly that the doctor can have bullets pass straight through him but he's able to hold on to a phaser without it falling out of his hand? Can he simultaneously have part of his body be transparent and the rest be more like matter at the same time? What if the bullets hit the hand holding the phaser? I think one had a shotgun as I recall so there probably would have been pellets going all over the place. How does the Battle Booster work? I received the 80% battle point booster. It has 500 minutes on it and says the booster is only consumed when battle points are earned. Does this mean I can play 500 minutes of matches during a week and earning the bonus points? Or does it wear off in 500 minutes after equipping it?  Also it says my team is granted a 16% bonus. Does this stack? Do i get another 16% if I and another player wears it? Since it's a new item with the present chest it would be wise to use it later if the bonus does not stack. Why did my TeX-related GUI program stop working in Mac OS X Yosemite?