I have a new table where I need to insert data.  My new table is called userOptions and have the following columns:  userId, optionId, date   I have a users table, where all existing users are stored.  I would like to insert the optionId = 2 for all existing users.  getting all ids with:  SELECT id from users;   inserting the result of previous query like:  INSERT INTO userOptions (userId, optionId, date)  VALUES(id, 2, NOW());   How do I combine those two queries?
I am trying to INSERT INTO a table using the input from another table. Although this is entirely feasible for many database engines, I always seem to struggle to remember the correct syntax for the SQL engine of the day (, , , , and ).  Is there a silver-bullet syntax coming from an SQL standard (for example, ) that would allow me to insert the values without worrying about the underlying database?
Copying protected files between servers in one line? I'd like to copy squid.conf from one server to another.   The servers don't talk to each other. I'd like to go through my workstation. Both servers have the file, so it will be overwritten on the target. The files have 600 permission and are owned by root. root login via ssh is disabled (PermitRootLogin no). I'd like to do it in one line, if possible, since it will be a part of a setup guide.   I know to do  ssh source 'tar czpf - -C /etc/squid/ squid.conf' | \     ssh target 'tar xzpf - -C /etc/squid/'   to copy files between servers and preserve permissions. However, in this case I will get "Permission denied".  I also know I can do this:  ssh -t source 'sudo cat /etc/squid/squid.conf'   This way the -t allows sudo to ask for the admin password before outputing the content of the file.  The problem is, I don't know how to combine those techniques into something that will ask for the sudo password on each server, and transfer the file to its destination. Is this possible?  UPDATE: Here's the best I could come up with:  ssh -t source 'sudo tar czf /tmp/squid.tgz -C /etc/squid squid.conf' &amp;&amp; \ ssh source 'cat /tmp/squid.tgz' | \     ssh target 'cat &gt;/tmp/squid.tgz' &amp;&amp; \ ssh -t source 'sudo rm /tmp/squid.tgz' &amp;&amp; \ ssh -t target \     'sudo tar xzf /tmp/squid.tgz -C /etc/squid &amp;&amp; sudo rm /tmp/squid.tgz'   Calling this a one-liner seems like a stretch. I think I'll just break it down to separate steps in the setup guide. What does "soft" in "soft symmetry breaking" mean? Where can I find Obsidian in the Pocket Edition? I have looked everywhere for lava or obsidian in 0.7.1. I've looked all the way from top to bottom and all around, in about a 100 block diameter, but I can't find any. Where can I get some? Prove that If $m'$ is a common multiple of $s$ and $t$, then $m | m'$. Here $m$ is the LCM of $s$ and $t$.    Although the statement is intuitively clear to me I don't know how to prove. Continuous v. per-chapter/section numbering of figures, tables, and other document elements How does a USB 2.0 Wall Charger negotiate current output? I'm trying to use a mobile phone charger for my projects, and want a high current output. I have read , however my measurements show something else.  is a link to the Battery Charging Specification Rev. 1.2.  1.4.7 Dedicated Charging Port A Dedicated Charging Port (DCP) is a downstream port on a device that outputs power through a USB connector, but is not capable of enumerating a downstream device. A DCP shall source \$I_{DCP}\$ at an average voltage of \$V_{CHG}\$. A DCP shall short the D+ line to the D- line.   I verified on three different chargers, and all read \$R_{DCP\_DAT}\$ as ~1.5 Ohms. Now, if there is a short between the D+ and D-, there is no detection on the charging port side, and the charger should always output \$I_{DCP}\$ {0.5 - 5.0A max} on the VBUS line - is this correct? I tested the current output of three chargers, but they are all completely different. Charger 1 - Nokia Rated current output: 1.3A Measured current output: 1.34A Charger 2 - Asus Rated current output: 2.0A Measured current output: 0.7A - 1.1A (unstable) Charger 3 - HTC Rated current output: 1A Measurent current output: 0.1A If all these dedicated charging ports have no current negotiation, how come only one charger is showing it's rated output? N.B All three chargers can charge a mobile phone in a reasonable amount of time. In the 1960s I read book--an older children's book, I think--which I loved, and still remember, roughly.  I have no idea what the title is or who the author is, and I'm wondering if anyone knows this one:  Scientists had invented a device which they didn't fully understand, and which had puzzling effects.  For example, when a pencil was put into the machine, it disappeared, and then reappeared inside out: The lead was on the outside.  When people went into the machine, they came back dead, having died from fright.  Finally they sent a very open-minded person into the machine.  She was an artist, I think.  She was able to return alive, and described an alternate universe in which geometry was very different.  I distinctly remember that there were supposedly square triangles or four-sided triangles--or was it three-sided squares?  (This is, of course, a literally contradictory claim, but I didn't see the matter as clearly then.)  Thanks! I was reviewing  for , and noticed that nobody voted to close it, even though the page reports a duplicate.      Why does this happen? AngularJS Directives: Change $scope not reflected in UI I am having an issue with wifi; it seems when I'm trying Ubuntu without installing, it only detects connection via the ethernet cable.  I can't connect and none of the available wifi networks are detected.  $ lspci 00:00.0 Host bridge: Intel Corporation Device 5904 (rev 02) 00:02.0 VGA compatible controller: Intel Corporation Device 5916 (rev 02) 00:04.0 Signal processing controller: Intel Corporation Skylake Processor Thermal Subsystem (rev 02) 00:08.0 System peripheral: Intel Corporation Sky Lake Gaussian Mixture Model 00:14.0 USB controller: Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller (rev 21) 00:14.2 Signal processing controller: Intel Corporation Sunrise Point-LP Thermal subsystem (rev 21) 00:16.0 Communication controller: Intel Corporation Sunrise Point-LP CSME HECI (rev 21) 00:17.0 SATA controller: Intel Corporation Sunrise Point-LP SATA Controller [AHCI mode] (rev 21) 00:1c.0 PCI bridge: Intel Corporation Device 9d10 (rev f1) 00:1c.4 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1) 00:1c.5 PCI bridge: Intel Corporation Sunrise Point-LP PCI Express Root Port (rev f1) 00:1f.0 ISA bridge: Intel Corporation Device 9d4e (rev 21) 00:1f.2 Memory controller: Intel Corporation Sunrise Point-LP PMC (rev 21) 00:1f.3 Audio device: Intel Corporation Device 9d71 (rev 21) 00:1f.4 SMBus: Intel Corporation Sunrise Point-LP SMBus (rev 21) 01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330] (rev 83) 02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15) 03:00.0 Network controller: Realtek Semiconductor Co., Ltd. Device d723     $ lspci -knn | grep Net -A3 03:00.0 Network controller [0280]: Realtek Semiconductor Co., Ltd. Device [10ec:d723]     DeviceName: Hanksville Gbe Lan Connection     Subsystem: Hewlett-Packard Company Device [103c:8319] I have a problem with arscalssica style in combination with classicthesis.  The text under the chapter title starts always at the same position, independently on how long is the chapter title, which produce this ugly behaviour:   The code I used to generete this output is really basic:  \documentclass[10pt,a4paper,twoside,openright,titlepage,fleqn,headinclude,footinclude,BCOR5mm,numbers=noenddot,cleardoublepage=empty,tablecaptionabove]{scrreprt} \usepackage{subfig} \usepackage[eulerchapternumbers,subfig,beramono,eulermath,pdfspacing]{classicthesis}  \usepackage{arsclassica}  \usepackage{blindtext}  \begin{document}     \chapter{\blindtext}     \blindtext \end{document}   The compilation raises the following warnings:  C:\Program Files (x86)\MiKTeX 2.9\tex\latex\koma-script\scrreprt.cls: Class scrreprt Warning: You've used obsolete option `tablecaptionabove'. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\classicthesis\classicthesis.sty: Class scrreprt Warning: Usage of package `titlesec' together(scrreprt)              with a KOMA-Script class is not recommended. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\titlesec\titlesec.sty: Package titlesec Warning: Non standard sectioning command detected(titlesec)                Using default spacing and no format. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\titlesec\titlesec.sty: Package titlesec Warning: Non standard sectioning command detected(titlesec)                Using default spacing and no format. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\titlesec\titlesec.sty: Package titlesec Warning: Non standard sectioning command detected(titlesec)                Using default spacing and no format. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\titlesec\titlesec.sty: Package titlesec Warning: Non standard sectioning command detected(titlesec)                Using default spacing and no format. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\titlesec\titlesec.sty: Package titlesec Warning: Non standard sectioning command detected(titlesec)                Using default spacing and no format. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\classicthesis\classicthesis.sty:373: Package scrreprt Warning: Activating an ugly workaround for a missing(scrreprt)                feature of package `titlesec` on input line 373. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\arsclassica\arsclassica.sty:192: Package hyperref Warning: Option `hyperfootnotes' has already been used,(hyperref)                setting the option has no effect on input line 192. C:\Program Files (x86)\MiKTeX 2.9\tex\latex\arsclassica\arsclassica.sty:192: Package hyperref Warning: Option `pdfpagelabels' has already been used,(hyperref)                setting the option has no effect on input line 192   The behaviour is ok if I do not use arsclassica but only classicthesis: unable to printout arrayOfInt initialised within the class constructor How to display special German characters "ÄÜÖß" in a map? Clamp velocity along local axis In the attached , I have a representation of a airplane/jet fighter (cube scaled at one end to indicate direction of flight). I am using torque to steer, and adding Linear Velocity along a local axis for thrust/brakes. What I want to know is how to clamp the velocity along the plane's local axis so when the plane steers, it does not simply keep flying in the direction that is was before it turned. I would prefer a solution with logic bricks, but if that is not possible, python would be acceptable. (it just needs to keep a speed relative to how long the thrust/breaks have been held no mater which direction it is pointing.) The actual question was to find the area bounded by the curve $y=\int_{-1}^{1}(1-x^2)^ndx$ and coordinate axes. But I haven't came across these type of problems with power $n$. How to discover USB storage devices and writable CD/DVD drives (C#) How can I discover any USB storage devices and/or CD/DVD writers available at a given time (using C# .Net2.0).  I would like to present users with a choice of devices onto which a file can be stored for physically removal - i.e. not the hard drive. How do I get the result of a command in a variable in windows? I'm looking to get the result of a command as a variable in a Windows batch script (see  for the bash scripting equivalent).  A solution that will work in a .bat file is preferred, but other common windows scripting solutions are also welcome. Is it possible to prevent DHCP service on SBS 2003 from shutting down due to rogue DHCP server? Tony's suit is an engineering marvel, and they explain many facets of the technology to help give legitimacy to the special powers, abilities and weapons it has.  I never read the Iron Man comics, but in the movie they really don't have a technological explanation for how he miraculously seems to be unaffected by crushing G-forces of sudden acceleration, the inertia of sudden stops and hair-pin turns, and especially the blunt force trauma from getting smashed in the face with Thor's hammer.  Certainly it appears the suit takes punishment, but Tony always remains unscatched, never a collapsed lung, broken bone or even a bloody nose.  In my infantile understanding of theoretical physics, the same technology that would be used to counter G-forces and sudden blunt force trauma to the body inside would be the very same technology used for  which in my honest opinion would be a much more stunning technological achievement than his heralded Arc Reactor.  Was their ever an explanation proferred for this and if so was it indeed attributed to Anti-Gravity? Integer solutions for $x^2-y^3 = 23$.