Good day,  I am trying to create a program that obtains orientation data from Sensors then uses that in a PID control algorithm to create corresponding PWM signals. I would like to be able to stop the program by pressing enter. I tried using opencv's waitKey(); however it does not accept my keyboard inputs. I also tried cin.get(); but it pauses my loop which creates a problem. My pwm would not get refreshed once the quadcopter changes orientation. I tried researching other methods however I could not get them to work. Here is a sample of my code using the two methods mentioned above.  Using cin.get():  using namespace std;  int main(void){      while(1){         /* get orientation data */      /* output corresponding pwm */      //Press enter to stop loop         if(cin.get() == '\n'){             /* Stop Pwm */              break;         }     }     return 0; }   Using waitKey();  using namespace std; using namespace cv;  int main(void){      while(1){         /* get orientation data */          /* output corresponding pwm */          //Press ESC to stop loop         int key = waitKey(33){         if(key == 27){             /* Stop Pwm */              break;         }     }     return 0; }
I'm trying to write a program in C (on Linux) that loops until the user presses a key, but shouldn't require a keypress to continue each loop.  Is there a simple way to do this? I figure I could possibly do it with select() but that seems like a lot of work.  Alternatively, is there a way to catch a ctrl-c keypress to do cleanup before the program closes instead of non-blocking io?
Adding Table to Layout View using ArcPy? I am using ArcGIS 10.1 and I have a non-spatial table and some layers in a Data Frame.   When I switch to Layout View I want to be able to show the map in a data frame element and the table in another element (something that one could do with "Add Table To Layout" from Table Options, but I want to do this in one step without having to go to Table Options).   Is there a way to do this using ArcPy?   I couldn't find any function in the ArcPy library that would create a new Layout Element ... and then I also don't know how to add the contents of the table to the Layout Element. A closed form for a triple integral with sines and cosines I generated a key and copied it to my target:  ssh-keygen ssh-copy-id username@hostname   I left the the location of the key as default and did not set any passphrase.  For a small while after that, I was able to ssh username@hostname without being prompted for a password, and then it stopped working for some reason. NSdate Assuming wrong time zone Why don't I get a link error when I provide my own malloc and free? Ted Shifrin on this site posed an interesting problem to me: show that   $$ \lim_{(x,y) \to (0,0)} \frac {|x|^ \alpha |y|^ \beta} {|x|^ \gamma + |y|^ \delta} \text {exists} \iff \frac\alpha\gamma + \frac\beta\delta &gt; 1, \,\,\,\,\text{where } \alpha, \beta, \gamma, \delta &gt;0$$  I think I've got the $(\Leftarrow)$ direction as follows: assume WLOG that $\gamma \leq \delta$. Then switch to polar coordinates and get   $$\frac {r^ {\alpha + \beta} (*) } {r^\gamma (1(*) + r^{\delta - \gamma}(*))},$$  where $(*)$ represents some trig stuff that is bounded near zero.   Edit: I need to make sure that $(1(*) + r^{\delta - \gamma}(*))$ is bounded below here.  The other direction is giving me some trouble. It seems we need a lower bound for the fraction (something to force to zero), and I'm not sure where to find one. In particular, I'm not sure what to do with the denominator. Any ideas? Seatpost Overextension I've been riding with my very short seat post extended well past its maximum extension line for quite a while now. Looking at the seat post itself I don't see any signs of deformation or damage other than some very minor surface rust.   Could my bike frame have been damaged? Could the lever force have damaged the frame? I can post some pictures of the frame if needed. My bike is all aluminum. A closed form of $\int_0^1\frac{\ln\ln\left({1}/{x}\right)}{x^2-x+1}\mathrm dx$ This integral has been bugging me since yesterday:     $$\int_0^1\frac{\ln\ln\left({1}/{x}\right)}{x^2-x+1}\mathrm dx$$   I've tried substitution $y={1}/{x}$ and $e^y={1}/{x}$, but those didn't help much. Wolfram Alpha gives me result: $-0.67172$. Could anyone here please help me to obtain the closed form of the integral preferably (if possible) with elementary ways (high school methods)? Any help would be greatly appreciated. Thank you. Forcing series convergence Make gedit embedded terminal colours the same as the default terminal I've just updated to 11.10 and now my embedded terminal in gedit does not match my default terminal. I hate looking at a white and black terminal. Does anyone know how to make the embedded terminal match the default terminal?  This is a screenshot:    I want my embedded terminal in gedit to match my default terminal. For $a,b,c>0$, prove that $\frac{a^2}{b}+\frac{b^2}{c}+\frac{c^2}{a}\ge a+b+c+\frac{4(a-b)^2}{a+b+c}$ Bought a new battery, do I need to calibrate it? My original battery is bloated and is dying quickly after a full charge so I now bought a replacement. Do I need to calibrate this new battery using a calibration app? A gateway to a new world/future where things can be improved with use This book is about an explorer (with robot companion) who walks through a "gateway" into the future/parallel world. In this world, things that are created do not fall into disrepair, instead things get better.  The main character is kidnapped early on in the story and forced to labor by beating the outside of a castle with a spear. It is explained to him that this makes the wall better and able to resist attacks by these weapons. In his cell, he meets a man wearing an extravagant shirt and asks about it and the man explains to him that the shirt has been in his family for several generations, which is why it looks so nice.   To escape from the jail cell, the man tears one of his zippers from his jump suit and uses it like a saw to cut a hole in the wall. He escapes with the man in the fancy shirt and a woman.   The woman, is something special in this world. (She can focus on the change that is happening to an item and somehow enhance or speed up the process)  The man makes a wheeled cart for them to escape in. While the wheels are at first rough and wobbly, they soon "become better" and spin better. At what times before $1{:}30$ in the afternoon do all three doctors schedule their appointments to begin at the same time? In a certain medical group, Dr. Schwartz schedules appointments to begin $30$ minutes apart, Dr. Ramirez schedules appointments to begin $25$ minutes apart, and Dr. Wu schedules appointments to begin $50$ minutes apart. All three doctors schedule their first appointments to begin at $8{:}00$ in the morning, which are followed by their successive appointments throughout the day without breaks. Other than at $8{:}00$ in the morning, at what times before $1{:}30$ in the afternoon do all three doctors schedule their appointments to begin at the same time?  I'm not sure how to approach this question. They all begin at the same time at $8{:}00$. Also doesn't the overlapping of appointments depend on how long their respective appointments take? What is the right way to apply an image texture over a glass or plastic material? I am trying to put a label over the transparent plastic bottle, but i was unable to do so, because when i build the bottle material(plastic) and mix it with the diffuse shader(using the label texture), the label gets faded. So the solution i found was to duplicate the bottle and scale a little bit and apply the label material on it. So it looks its the same material, but in reality its one material over the other. How can I make my plastic material be under my label material(image)? Here's how it looks:   Here's my material setting for the plastic bottle:   Thanks in advance. Where did object dimensions go in 2.8? Windows Media Player 12 shows wrong cover art when playing Show that $$\sum_{k=0}^n(-1)^k\binom nk=0$$ So for odd $n$ we have an even number of terms. So $\binom nk=\binom n{n-k}$ which have opposite signs. Thus the sum is 0.  For even $n$ we have that $$\sum_{k=0}^n(-1)^k\binom nk= \binom n0+\sum_{k=1}^{n-1}(-1)^k\binom nk+\binom nn$$ Now $$\sum_{k=1}^{n-1}(-1)^k\binom nk= \sum_{k=1}^{n-1}(-1)^k\left[\binom{n-1}k+\binom{n-1}{k-1}\right]$$ What would that sum be in the square brackets? Remove association with blank file extension? Is QImage able to open and render pure 16-bit images?