ending input loop when input file is routed through stdin at end of file
Detecting EOF in C++ from a file redirected to STDIN
"This is considered..." vs. "This is considered as..." Does this "as" change the meaning or correctness of this sentence?     This is considered as socially desired.   This is considered socially desired.   Are both of them grammatically correct? Why or why not? How many connected components does $\mathrm{GL}_n(\mathbb R)$ have? How do you pass a member function pointer? I am trying to pass a member function within a class to a function that takes a member function class pointer.  The problem I am having is that I am not sure how to properly do this within the class using the this pointer.  Does anyone have suggestions?  Here is a copy of the class that is passing the member function:  class testMenu : public MenuScreen{ public:  bool draw;  MenuButton&lt;testMenu&gt; x;  testMenu():MenuScreen("testMenu"){     x.SetButton(100,100,TEXT("buttonNormal.png"),TEXT("buttonHover.png"),TEXT("buttonPressed.png"),100,40,&amp;this-&gt;test2);      draw = false; }  void test2(){     draw = true; } };   The function x.SetButton(...) is contained in another class, where "object" is a template.  void SetButton(int xPos, int yPos, LPCWSTR normalFilePath, LPCWSTR hoverFilePath, LPCWSTR pressedFilePath, int Width, int Height, void (object::*ButtonFunc)()) {      BUTTON::SetButton(xPos, yPos, normalFilePath, hoverFilePath, pressedFilePath, Width, Height);      this-&gt;ButtonFunc = &amp;ButtonFunc; }   If anyone has any advice on how I can properly send this function so that I can use it later. Derivative of determinant of a matrix I would like to know how to calculate:  $$\frac{d}{dt}\det \big(A_1(t), A_2(t), \ldots, A_n (t) \big).$$ Is simply connectedness preserved after deleting a high codimension set Prove that $1 + \cos\alpha + \cos\beta + \cos\gamma = 0$ If $\alpha + \beta + \gamma = \pi $ and $\tan(\frac{-\alpha + \beta + \gamma}4)\tan(\frac{\alpha - \beta + \gamma}4)\tan(\frac{\alpha + \beta - \gamma}4) = 1$  Then prove that:     $1 + \cos\alpha + \cos\beta + \cos\gamma = 0$.   I have no idea how to go about this.   Please help. Stern-Brocot tree where each node has two fathers $\|h(x)-h(y)\|\geq 3\|x-y\|$ prove that image of open is open I'm thinking that one way Jeff and the Stack Overflow team could squeeze some extra money out of this site would be to automatically convert all Amazon links posted here into affiliate links, e.g. Stick "tag=codinghorror-20" (or more likely a new site-specific tag) onto every Amazon link. This would bring in some additional revenue every time someone purchased a book via a link on this site.   They could do similar things with other links as well. Amazon's simply the most obvious choice.  So my question is, would anyone have a problem with this?  I know I wouldn't mind, but I don't know how other people would react.  What does everyone think? Is this a horrible idea, a great idea, a waste of time? Altium - create a mirror image of a board I want to create an identical motor drive board in the right and left sides.  I just finished layout for the right side and I am wondering what is the easiest way to create the mirror image of this board for the left side?  For example: the connectors on the "top" side would now be on the bottom of the other board.  All components and tracks will also switch sides, layer stack will be inverted, etc.  Is there any command sequence in Altium that will do this without me having to manually re-assign everything to the other layer? Non-empty intersection. Let $A_1,A_2,...,A_{2019}$ be sets s.t. $|A_i|$=45 for each $i=\overline{1,2019}$ and $|A_i\cap A_j|=1$ for every $i\neq j$. Is it true that $$\Big|\bigcap _{i=1}^{2019} A_i\Big|=1?$$ What I thought of doing is proving by induction by i, the base is obvious. However I'm stuck on the next step. I want to make a plane for my supply on my PCB and a plane for my MCU to isolate the MCU from the power supply noise.  I found this article in Altium designer :  But it isn't clear how the split plane tool work. Can someone explain it in a different manner?  [EDIT]  This is a picture how I see the planes: How can I create light trails without a blurry subject? I would like to achieve this effect using my Nikon P510:      Are there any suggestions or tips that would help me do that? Is this notification that keeps coming up on my phone a virus? This notification keeps coming up, and i'm not sure if it's real or a virus, or how to stop it coming up. It says 'Android system warning! Google has found serious bugs in your Battery Module!Click on [OK] to view details.'   Screenshot (click for larger variant)  Any help appreciated, thanks. Lauren. How do I prove this function is bijective? $$ v(s,p)=2^{p-1}(2s-1). $$ The domain is natural numbers and the codomain is also the natural numbers.  And this one: $$ f(s)=2s-1. $$ The domain is the natural numbers, and the codomain is the odd numbers in the natural numbers.  With this one I would do this to show it's injective: $$ \begin{align} v(s)&amp;=v(s_1)\\ \implies 2s-1&amp;=2s_1-1\\ \implies (2s_1)/2&amp;=(2s_2)/2\\ \implies s=s_1 \end{align} $$ So it's injective since if $v(s)=v(s_1)$ then $s=s_1$.  And to show it's surjective $f(s)=y$: $$ \begin{align} y&amp;=2s-1\\ \implies s&amp;=(y+1)/2 \end{align} $$ Then the function must be surjective since every $y$ is the same as the codomain for $f$.  Am I correct? Violation of linearity assumption in Logistic Regression I built a logistic model with 7 continuous independent variable and 8 categorical (dummy) variables in R. I tested for the linearity assumption using the Box Tidwell test and all my variables show high significance.  I am wondering now, if the assumption is violated what it would mean for the coefficient estimates and if I still can run the model with caution.   I read about the approach of using regression splines but I am confused how I would determine those and interpret the model then. How do I efficiently get "the most recent corresponding row"? I have a query pattern that must be very common, but I don't know how to write an efficient query for it.  I want to look up the rows of a table that correspond to "the most recent date not after" the rows of another table.  I have a table, inventory say, which represents the inventory I hold on a certain day.  date       | good | quantity ------------------------------ 2013-08-09 | egg  | 5 2013-08-09 | pear | 7 2013-08-02 | egg  | 1 2013-08-02 | pear | 2   and a table, "price" say, which holds the price of a good on a given day  date       | good | price -------------------------- 2013-08-07 | egg  | 120 2013-08-06 | pear | 200 2013-08-01 | egg  | 110 2013-07-30 | pear | 220   How can I efficiently get the "most recent" price for each row of the inventory table, i.e.  date       | pricing date | good | quantity | price ---------------------------------------------------- 2013-08-09 | 2013-08-07   | egg  | 5        | 120 2013-08-09 | 2013-08-06   | pear | 7        | 200 2013-08-02 | 2013-08-01   | egg  | 1        | 110 2013-08-02 | 2013-07-30   | pear | 2        | 220   I know one way of doing this:  select inventory.date, max(price.date) as pricing_date, good from inventory, price where inventory.date &gt;= price.date and inventory.good = price.good group by inventory.date, good   and then join this query again to inventory. For large tables even doing the first query (without joining again to inventory) is very slow.  However, the same problem is quickly solved if I simply use my programming language to issue one max(price.date) ... where price.date &lt;= date_of_interest ... order by price.date desc limit 1 query for each date_of_interest from the inventory table, so I know there is no computational impediment.  I would, however, prefer to solve the whole problem with a single SQL query, because it would allow me to do further SQL processing on the result of the query.  Is there a standard way to do this efficiently? It feels like it must come up often and that there should be a way to write a fast query for it.  I'm using Postgres, but an SQL-generic answer would be appreciated. Textbooks on linear regression with least squares How to assign a function in Lua for a randomly generated numbers What is a session 0? What is a "Session 0"?   When is it done? What does it contain? Is it recommended, if not mandatory? What is each person's role (DM/GM, players, etc.)? What topics are best discussed there?   Usually with my groups, we go directly to the meat of the game right after the character creation, but I see a lot of answers that basically say "you should have a session 0", but it's never explained what it is made of, so it's kind of an enigma for me.