I have a MySQL database containing Countries   id  | de          | en          | fr    ---------------------------------------------   1  | Afghanistan | Afghanistan | Afghanistan  2  | Albanien    | Albania     | Albanie ...   I'd like to get a list of the countries, according to visitor's language.  Here's the method in my class :  public function getList($language){     $countries = array();     $req = ('SELECT id, :language FROM country ORDER BY :language ASC');             $q = $this-&gt;_db-&gt;prepare($req);     $q-&gt;bindValue(':language', $language, \PDO::PARAM_STR);     $q-&gt;execute();     while ($data = $q-&gt;fetch(\PDO::FETCH_ASSOC)) {         $countries[] = new Country($data);     }     return $countries;     $q-&gt;closeCursor(); }   It returns an array, but country names are replaced by the language.  It seems bindValue is adding quotes to my variable, which is fine in the ORDER BY, but creates problems in the fields i want to SELECT.  $countryManager-&gt;getList('fr');   returns something like this   Array ( [0] =&gt; Entities\Country Object     (         [id:Entities\Country:private] =&gt; 1         [de:Entities\Country:private] =&gt;           [en:Entities\Country:private] =&gt;          [fr:Entities\Country:private] =&gt; fr     )  [1] =&gt; Entities\Country Object     (         [id:Entities\Country:private] =&gt; 2         [de:Entities\Country:private] =&gt;          [en:Entities\Country:private] =&gt;          [fr:Entities\Country:private] =&gt; fr     )   If you have any idea on where the problem might be, i'd be very glad to know :)  Thank you in advance for your help.
Why can't I pass the table name to a prepared PDO statement?  $stmt = $dbh-&gt;prepare('SELECT * FROM :table WHERE 1'); if ($stmt-&gt;execute(array(':table' =&gt; 'users'))) {     var_dump($stmt-&gt;fetchAll()); }   Is there another safe way to insert a table name into a SQL query? With safe, I mean that I don't want to do  $sql = "SELECT * FROM $table WHERE 1"
Do these two observations suffice to show that a finite boolean ring must be of the form $\mathbb{Z}_2\times\cdots\times\mathbb{Z}_2$? Question: If $R$ is a finite boolean ring, then show $R \cong \mathbb Z_2 \times \mathbb Z_2 \times \cdots\times \mathbb Z_2$.   I know that   $\mathrm{char}(R) =2$  $R$ has $2^k$ elements for some $k$  (this is because, if $p\neq 2$ is a prime with $p\mid|R|$, then there exists a non-zero $x \in R$ s.t. $px=0$ and $p $ is odd $\implies x=0$, contradiction).   Does this suffice to answer my question? What is the most preferred and easiest way to do pagination in ASP.NET MVC?  I.e. what is the easiest way to break up a list into several browsable pages.  As an example lets say I get a list of elements from a database/gateway/repository like this:  public ActionResult ListMyItems() {     List&lt;Item&gt; list = ItemDB.GetListOfItems();     ViewData["ItemList"] = list;      return View(); }   For simplicity's sake I'd like to specify just a page number for my action as parameter. Like this:  public ActionResult ListMyItems(int page) {    //... } Why do we say "is it" when asking a question rather than "it is"? My primary router has trouble extending wifi coverage to some bedrooms in the house so I am planning to add a second router to extend the wifi network using the wired Ethernet ports in one of the areas of poor coverage. Basic layout -   The ISP's router is in my family room downstairs (fiber connection) and the internet connects to the fiber via a box in an upstairs closet.   I purchased and installed an unmanaged Ethernet switch/splitter. In the upstairs closet where all of the Ethernet wires meet, the family room Ethernet cable was plugged into the ISP's box. I disconnected this wire and replaced it with a CAT5 cable running from the ISP's box in the closet to the Ethernet switch's port 1.  I think connected the family room Ethernet cable to port 2 and did the same in order for all the remaining Ethernet cables to various bedrooms.   So far, the switch is working fine.  I have wifi working with internet coming off of the router in the living room so I believe the switch is installed correctly otherwise that wifi should not have internet coming off of the living room jack.   Here is where things go awry - I took my second wifi router and connected the WAN/Yellow port to the Ethernet wall jack in another bedroom.  I then connected a lap top to one of the Ethernet ports on this router and found "no internet" after connecting.  On a whim, I changed the connection so that the router was connected to the Ethernet wall jack in one of the white ports but with the same results.   I don't think this counts as cascading and I don't really need a new network since I do not share the connection with any non-family members.  The router has been reset to factory settings to clear out any old instructions - but I still can't get it to connect to the internet or access the router to change the settings even - it's a netgear and the routerlogin.net will not let me access the router even when I am on the working WIFI for internet and have a cable running from the laptop to the netgear router.   I could use some help - just trying to extend the wifi range and it seems like it should be much less complicated. Tried following instructions in several other posts and they did not work for me - because I cannot access the router to change any settings. $\DeclareMathOperator{\card}{card}$From Problem-Solvers Topology  Prove the following: CANTOR'S THEOREM If $A$ is a set, then $$\card A &lt; \card \mathcal{P}(A)$$ where $\card A$ stands for the cardinality of set $A$.  My Answer If $A = \emptyset$, then $\card A =0$ and $\card \mathcal{P}(A)=1$. If $A = \{a\}$, then $\card A=1$ and $\card \mathcal{P}(A)=2$. So suppose that $A$ has at least two elements. Define a function $f: A \rightarrow \mathcal{P}(A)$ such that $f(x) = \{x\}$ for all $x \in A$. Then $f$ is injective. But it cannot be surjective, because for any two distinct elements $a,b \in A$, there is no element in $A$ that is sent to the set $\{a,b\}$ in $\mathcal{P}(A)$. Therefore, there is no bijection, and $\card A &lt; \card\mathcal{P}(A)$. Do you think my answer is correct? Thanks in advance Direct observations of a black hole? I'm not very knowledgeable about physics generally, but know that nothing can escape a black hole's gravitational pull, not even light (making them nearly invisible?).   My question is: What has been obtained from direct observation of a black hole to prove their existence? Please note that I'm not questioning the existence of black holes, but am just curious as to how we have come to realize it. I am building a regression model and I need to calculate the below to check for correlations   Correlation between 2 Multi level categorical variables Correlation between a Multi level categorical variable and continuous variable  VIF(variance inflation factor) for a Multi level categorical variables   I believe its wrong to use Pearson correlation coefficient for the above scenarios because Pearson only works for 2 continuous variables.   Please answer the below questions   Which correlation coefficient works best for the above cases ?  VIF calculation only works for continuous data so what is the alternative?  What are the assumptions I need to check before I use the correlation coefficient you suggest?  How to implement them in SAS &amp; R? Do I have to recompile my application when I upgrade a third party jar? How to prove $b=c$ if $ab=ac$ (cancellation law in groups)? In my family we have a DNA contradiction – two cousins (at about the 4th cousin level) took a Y-DNA test, but did not match and had two completely different haplogroups.   Since then, I have traced living cousins with the same surname – the only ones left living that I am aware of – and I would love to pay to have them tested to see if we can figure out where the non-paternity event (NPE) or other event happened (i.e. this new cousin could help us determine which line the NPE occurred in depending on which cousin he matches).   Does anyone have a sample letter, or know the best way to go about asking a distant cousin for DNA?   I have their address and am planning to write a letter, but I can't imagine receiving such a letter, so I am not quite sure how to ask without scaring them off. Weird syslog order Have you ever seen wrong order in /var/log/syslog ? I think that it causes only crontab.  Jun 28 22:20:01 alex CRON[2327]: (root) CMD (something &gt; /dev/null) Jun 28 22:21:01 alex CRON[2700]: (root) CMD (something &gt; /dev/null) Jun 21 03:49:01 alex CRON[2753]: (root) CMD (something &gt; /dev/null) Jun 28 22:23:01 alex CRON[2754]: (root) CMD (something &gt; /dev/null) Jun 27 05:08:01 alex CRON[2813]: (root) CMD (something &gt; /dev/null) Jun 26 00:19:01 alex CRON[2816]: (root) CMD (something &gt; /dev/null) Jun 28 22:25:01 alex CRON[2816]: (munin) CMD (if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron; fi) Jun 28 22:25:01 alex CRON[2821]: (root) CMD (something &gt; /dev/null) Jun 28 22:27:01 alex CRON[3225]: (root) CMD (something &gt; /dev/null) Jun 28 22:28:01 alex CRON[3240]: (root) CMD (something &gt; /dev/null) Jun 28 22:30:01 alex CRON[3290]: (root) CMD (something &gt; /dev/null) Jun 26 12:03:01 alex CRON[3291]: message repeated 2 times: [ (root) CMD (something &gt; /dev/null)] Jun 28 22:30:01 alex CRON[3291]: (munin) CMD (if [ -x /usr/bin/munin-cron ]; then /usr/bin/munin-cron; fi) Jun 28 22:31:01 alex CRON[3659]: (root) CMD (something &gt; /dev/null) Jun 28 22:32:01 alex CRON[3754]: (root) CMD (something &gt; /dev/null) Jun 16 06:41:01 alex CRON[3846]: (root) CMD (something &gt; /dev/null) Jun 28 22:35:58 alex cron[909]: (CRON) INFO (pidfile fd = 3) Jun 28 22:35:58 alex cron[944]: (CRON) STARTUP (fork ok) Jun 28 22:35:58 alex cron[944]: (CRON) INFO (Running @reboot jobs) Jun 28 22:36:01 alex CRON[1428]: (root) CMD (something &gt; /dev/null) Jun 28 22:37:01 alex CRON[3050]: (root) CMD (something &gt; /dev/null) Jun 28 22:38:01 alex CRON[3082]: (root) CMD (something &gt; /dev/null) Jun 28 22:39:01 alex CRON[3114]: (root) CMD (something &gt; /dev/null)   As you can see, there is bad time order between lines. It is just crontab error, or there is some problem with system clock, or something?  I am running the latest Ubuntu 14.04 kernel:  Linux alex 3.13.0-30-generic #54-Ubuntu SMP Mon Jun 9 22:45:01 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Give each site a parallel site for polling, recommendations and subjective-ish stuff Stuff like polls, recommendations based on subjective constraints, puzzles, webcomics etc. do not belong on the serious main SE sites, where professionals should be considered at work and having just a few spare minutes ("code's compiling") to answer questions, so they should not be distracted by such things. However, I'd also like to have a home for these things still using the SE engine. For the reason I mentioned before, this needs to be a separate place though. Let's call it four.[sitename-here].com. Alternative proof that $(a^2+b^2)/(ab+1)$ is a square when it's an integer Let $a,b$ be positive integers.  When $$k = \frac{a^2 + b^2}{ab+1}$$ is an integer, it is a square.    Proof 1: (Ngô Bảo Châu): Rearrange to get $a^2-akb+b^2-k=0$, as a quadratic in $a$ this has two values: $a$ and $kb - a = (b^2-k)/a$. (The second root is determined in two different ways from the expansion $(x-r_1)(x-r_2) = x^2 - (r_1 + r_2)x + r_1 r_2$.)  Now suppose we have $a,b$ such that $k$ is an integer but not a square, by the investigation about roots we have that the second root is a nonzero integer since $k,b,a$ are integers and $k \not = b^2$, futhermore it is positive which is easily seen from its defining equation.  WLOG assume $a \ge b$ so that the second root is strictly smaller than $a$. This leads to a decent, replacing $a$ with the second root.    Proof 2 (Don Zagier): Apply reduction theory (specifically, Sätze 1 and 2 of Section 13 of my book on quadratic fields) to the quadratic form $x^2 + kxy + y^2$, which is the unique reduced quadratic form in its equivalence class.    Note that Proof 2 is pretty much the same as Proof 1 when written out in explicit detail, but I could not read Zagier's book because I cannot read German.  I would like to know more approaches to this and other alternative proofs of this result if possible! Thanks in advance.  I would also be interested in related problems (especially easier ones of a similar nature) and texts which cover the reduction theory in English. How to set scale across all blender objects and keyframes? Drawing on an image with TikZ Is there any point in taking the alternate exits in Bit Trip Runner 2?  I can't see any benefit to doing so in terms of unlocking a different path in the overworld, so is it just for your own benefit? How to derive the conjugate prior of an exponential family distribution I am trying to derive the conjugate prior of the univariate Gaussian distribution over both the mean and the precision. I know that the prior I'm looking for is the normal-gamma distribution, but the idea is to derive this result.  It seems that you can write down the conjugate prior of an exponential family distribution immediately if you represent it in the canonical exponential family form.  suggests a way to do just that. So far I have written the Gaussian probability function in this form and equated the following, but I don't see how the form of the conjugate prior is immediately obvious.  $$p(\mu, \lambda | D) \propto p(\mu,\lambda)p(D | \mu, \lambda)$$ In Mootools, I'd just run if ($('target')) { ... }.  Does if ($('#target')) { ... } in jQuery work the same way? What do you call an 'unselfish' action made with a selfish reason? There are many examples of this, and I'd like to give a few:   A person who puts a lot of effort to help the community and earns reputation points. But that reputation is the motivation behind helping the community, not because they really want to. A student approaches a professor, and helps them in their teaching and doing research in order to have a good LOR (letter of recommendation). To a SEO, the content of the website must be good (well, this one is a little tricky, but you get the spirit.)   I'm not saying that the reputation/LOR/high-ranked is not deserved. It is. I just want to focus more on the selfish reason(s) behind that.  Any kind of answer can be accepted: single word, phrase, proverb or idiom. Why do some websites show the company name next to the URL? Some websites show the company name next to the URL (in Chrome) and some don't.  How do I set this up for my website? Is there a reason why or why I wouldn't want to do this?