I am attempting to loop through the rows of a database (in this case players) and gather their scores. The columns of the database represent different positions, for each of which a player has a score value. As there are more columns than positions within a formation, the query must SELECT only those 11 columns within the given formation ($most_common_formation). The scores must then be multiplied by the corresponding value in the player's "total_picks" column before being placed into a multidimensional array.   The final array should contain the 25 players as arrays, and within each display the "full_name" along with the 11 scores that have been multiplied by "total_picks".  The $team array holds the "full_names" of all players.  Please help it's driving me crazy!  // Create array to hold final scores per player $player_scores = array();  // Loop through all players in $team array for ($l=0; $l &lt; 25; $l++) {      // SELECT each players scores per position in $most_common_formation     $players_picks_query = "SELECT                                  ?,                                 total_picks,                                 ?,                                 ?,                                 ?,                                 ?,                                 ?,                                 ?,                                 ?,                                 ?,                                 ?,                                 ?,                                 ?                             FROM table";      // prepare and bind statement     $stmt = mysqli_prepare($conn, $players_picks_query) or die(mysqli_error($conn));     mysqli_stmt_bind_param($stmt, 'ssssssssssss', $player_name, $pos1, $pos2, $pos3, $pos4, $pos5, $pos6, $pos7, $pos8, $pos9, $pos10, $pos11);      $player_name = $team[$l];     $pos1 = $most_common_formation[0];     $pos2 = $most_common_formation[1];     $pos3 = $most_common_formation[2];     $pos4 = $most_common_formation[3];     $pos5 = $most_common_formation[4];     $pos6 = $most_common_formation[5];     $pos7 = $most_common_formation[6];     $pos8 = $most_common_formation[7];     $pos9 = $most_common_formation[8];     $pos10 = $most_common_formation[9];     $pos11 = $most_common_formation[10];      mysqli_stmt_execute($stmt);     $result = mysqli_stmt_get_result($stmt);      while ($row = mysqli_fetch_array($result, MYSQLI_NUM)) {         foreach ($row as $r) {             echo "$r ";         }         echo "&lt;br&gt;";     }      // close statement     mysqli_stmt_close($stmt);   }
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"
How do I get the feature id after featureAdded signal (PyQGIS)? I'm trying to make an edit form in QGIS (Python code) ,and i want after feature drawing to get the id, and the feature to be selected. Do you have any ideas to do that?  Tried so far:  self.iface.activeLayer().featureAdded.connect(self.myfonction)  def myfonction(self):      for feat in self.iface.activeLayer().getFeatures():         self.iface.activeLayer().setSelectedFeatures([feat.id()]) Will cases with front USB port support USB 3.0? I am using MiKTeX 2.9 on Windows 7.   I'm getting the error: "can't write on pdf file."  The pdf doesn't reflect what I wrote.  What did I do wrong?  My input:  \documentclass[12pt]{article} \usepackage{epsf} \usepackage{amssymb} \usepackage{graphicx} \usepackage{setspace} \usepackage{amsmath} \usepackage{rotate} \usepackage{endnotes} %\usepackage{harvard} \usepackage{vmargin} \usepackage[nolists,noheads,tablesfirst,nomarkers]{endfloat} \usepackage{natbib} \bibliographystyle{apsr}  \oddsidemargin=1.0in\evensidemargin=0.in \textheight=8.5in\textwidth=6.6 in \baselineskip=18pt \parskip=6pt  \begin{document}  % added, was missing  TEXT  \newpage \baselineskip=12pt \doublespacing  \bibliographystyle{apsa} \bibliography{Dissertation_Proposal}   \end{document} Right at the beginning of the game, Meowth comes into your room and attempts to wake you up. At this point, I assume I have to press some button to get out of bed, but the D-Pad or A button doesn't do anything, nor any of the other buttons. How do I get out of bed to start the game? Why is the Sun approximated as a black body at ~ 5800 K? Limit of a Piecewise Function defined on Rationals and Irrationals Female main character in an ice world earning gems/runes Here's what I remember:   The main character's female (99% sure) There is one part where she has to cross a big tundra and she has to kill a big ice creature The kids in the story go to a school-like place where they train for something. I'm pretty sure they earn gems or runes or something like that There's one part where the main character has to play a piece of music perfectly to earn her gem/rune thing It's definitely a series; young-adult (I read them in middle school)   Thanks! Rendering order in an Entity System Say I use a , and also inside Systems I hold lists of all entities that Systems are required to process.  How do I maintain this list of entities in desired rendering order, i.e. for a dumb 2D RenderingSystem?   I saw , and what they suggest is to do something like Z ordering - what I would probably do is just to store a "layer" int in DrawableComponent and then, inside RenderingSystem, just sort entities by mentioned "layer" whenever the entity list for RenderingSystem changes.  They also say we could just delete and recreate the entity whenever we want it on the top, but it seems too inflexible to me.  How is this problem usually solved? How to make a simple app from an applescript! I've got an applescript that I use to open files such as test.txt in vim, using the terminal.  I usually open a file by right-clicking it an selecting the service open in vim (this service is created by me and basically runs the applescript).  How do I build an actual program, that can be set in the "open with" option for a file?  This way, when I double click test.txt, the applescript gets run and the file gets opened in my vim in terminal.app.  I would also like to create custom icons that will be applied to all files I open using this app (using the "Change All..." button).  Where would I begin? Is this easy, because I'm just a novice -although I love programming and would spend much to to get to know all that is needed to do this.  the code is:  on open this_item      tell application "System Events"         if (count (processes whose name is "Terminal")) is 0 then             tell application "Terminal"                 activate                 do script with command "vim " &amp; (POSIX path of this_item) in front window             end tell         else             tell application "Terminal"                 activate                 tell application "System Events" to tell process "Terminal" to keystroke "t" using command down                 do script with command "vim " &amp; (POSIX path of this_item) in selected tab of the front window             end tell         end if     end tell  end open Is there a difference between copy initialization and direct initialization? Exclusion in formation of comparative statements I was going through the topic "formation of comparative and superlative".       The rule says     When two objects are compared with each other, the latter term of comparison must exclude the former, as in "Iron is more useful than any other metal". If we say "Iron is more useful than any metal", that is the same thing as saying    "Iron is more useful than iron", since iron is itself a metal.   I am finding difficulty to relate the rule with example. Why might one also use a blank constructor? I was reading some Java recently and came across something (an idiom?) new to me: in the program, classes with multiple constructors would also always include a blank constructor. For example:   public class Genotype {   private boolean bits[];   private int rating;   private int length;   private Random random;    public Genotype() {              //  &lt;= THIS is the bandit, this one right here     random = new Random();   }    /* creates a Random genetoype */   public Genotype(int length, Random r) {     random = r;     this.length = length;     bits = new boolean[length];      for(int i=0;i&lt;length;i++) {         bits[i] =random.nextBoolean();     }   }    /* copy constructor */   public Genotype(Genotype g,Random r) {     random = r;     bits = new boolean[g.length];     rating = g.rating;     length = g.length;      for(int i=0;i&lt;length;i++) {         bits[i] = g.bits[i];     }    } }   The first constructor doesn't seem to be a "real" constructor, it seems as though in every case one of the other constructors will be used. So why is that constructor defined at all? Is this asbestos? (South korea) School in South Korea removed asbestos over the past few weeks. Now I am all paranoid.   Is this asbestos? Found these dime-sized chunks by my desk.          Higher resolution images are available here:    There should be 4 pics. If not clear enough let me know. I want to synchronise two folders in real time under Windows 7.  Basically, I want to monitor a folder and synchronise each change (new files, changed files, deleted files) to another drive. It has to be in real time, so it gets synchronised instantly when a change happens. A one-direction synchronisation is enough.  I tried Microsoft's , but it does only syncing by hand or scheduled (thus not satisfying the "real-time" requirement).  Can this be achieved with Windows 7 itself? If not, are there other methods of doing this? Polynomials, prove exercise question about question There is a polynomial P with integer coefficients and with pairwise different integers $a,b,c$ . Prove that it is not possible for $P(a) = b$, $P(b)=c$, $P(c) = a$  First off I don't understand "pairwise different" part - what does it mean ,can you show me this as an equation? After that I'd like to get a hint in case I don't make it. + I'd prefer to have hints/answers written more algebraically without $\sum$ etc. (It helps me get better understanding what's going on under the hood) Counterspelling a counterspell I am using cURL to insert data into salesforce. It works with single record but I need to insert multiple records at a time. Is it possible to do so and is it possible via a REST interface? If refraction slows down light, isn't it possible to hold light still? I have a quick question about the refraction of light, and I'm sorry if it seems a bit simplistic or even stupid, but I'm still learning.  We know that when light passes through a denser medium, it slows down. However, is there a limit to that slowing down? If no, wouldn't it be possible, with some type of medium we make ourselves (like a crystal), to decrease the light's speed down to a point where we would be able to "see the photons moving forwards"?  I know it is way more complicated than that and that you can't see light unless some other light bounces off it, what I mean is slowing down light to an extreme and unusual speed). That sounds completely absurd but I can't seem to find what is wrong. Can anyone can explain it to me? :) Is there such a thing as a deposit-only bank account? My employer wants me to give my routing-numbers, social-security numbers, and basically everything else required to take money out of my account, to several third-party direct-deposit websites (one for weekly paychecks, one for mileage reimbursements, etc.).  I am not comfortable giving my identity information away to all these places.  I'd like to give them access to an account which they can only deposit into, never withdraw (either a separate account, or, even better, a deposit-only alias to my real account).  Does such a thing exist?    [Edit] I'm not worried about the companies so much as I am worried about bad guys who inevitably hack those companies' databases, or get hired to work there.  This type of account would also be handy for giving read-only access to sites like mint.com or quicken.com, easing my mind about their hackers/unscrupulous employees. This or That person Today I heard a speaker use the phrase "this person", referring to the subject-person of the story they were telling, and I heard it as (that person). Between the words “this” or “that” in context with the phrase and story-tense, which should you use.