On click, preselect items in a dropdown menu I have multiple buttons which are Order 1  and a contact form below it with a  field with multiple options (Order 1, Order2, etc...)  When I click on the "Order 1" button , I want the  field to select Order 1. And if I click on the "Order 2" button, I want the  field to select Order 2 for example. Is there a way to do that with javascript?  I've seen this done in some websites but can't remember exactly where.
jQuery - setting the selected value of a select control via its text description I have a select control, and in a javascript variable I have a text string.  Using jQuery I want to set the selected element of the select control to be the item with the text description I have (as opposed to the value, which I don't have).  I know setting it by value is pretty trivial. e.g.  $("#my-select").val(myVal);   But I'm a bit stumped on doing it via the text description. I guess there must be a way of getting the value out from the text description, but my brain is too Friday afternoon-ed to be able to work it out.
Why can't two series-connected diodes act as a BJT? Is it possible to password protect a zip file created by Windows itself (without external tools?) What is the expected value of the maximum of 500 IID random variables   with uniform distribution between 0 and 1?   I'm not quite sure of the technique to go about solving something like this. Could anyone point me the right direction?  Thanks I don't understand this..maybe there is something wrong with my understanding of battery or electricity.  I am learning about electricity more deeply this time. So please bear with me.  So lets begin with what I know:   follow of current occurs when there is voltage drop. voltage drop happens when there is imbalance in charge. a battery is basically two separated chemicals. One side with electrons to spare and other side that needs electron to balance itself. which is imbalance in charge. When both sides are connected + side snatches electrons from - side. (And if there is a medium, conductor, then first electrons are taken from conductor that in turn snatches from - side, which not being able to keep electrons lose them and give up those electrons, we label it as excessive.)   The analogy i was taught with used marbles in pipe... When one side has excessive marbles And this pipe is connected to other side that has no marbles the marbles will instantaneously start falling out so even though marbles from container with excessive marbles haven't traveled there yet, they still start falling because filled side marbles are pushing marbles in pipe and which in turn push the last marbles in pipe out.   1st, Aren't electrons pulled by atoms that can use more electrons, and not move because one side is overfilled with electrons so they can't wait to push some out.  Questions:    if I connect a conductor to positive side of a battery, shouldn't it make all electrons/marbles fall into empty container as empty container will pull marbles as atoms need electrons? if I connect two batteries' only opposite sides to each other shouldn't they drain (balance the each other out, cancelling all - &amp; + charges)? What is the difference between a deep copy and a shallow copy? I need to solve $3x^2 + 6x +1 \equiv 0 \pmod {19}$  I saw the same problem here -     but didn't understand how he got to the conclusion   $x(x+2) \equiv 6 \pmod {19}$  and anyway im trying to solve it how we learned in class -   multiply both sides and the modulo by $4a$ then solve the two equations  $y^2 \equiv b^2 -4ac \pmod {4an}$  $2ax + b \equiv y \pmod {4an}$  so I tried multiplying the hole thing by $4a$ , that is $4 \times 3$  and got to $(2 \times 3x + 6)^2 \equiv 36 -4 \times 3 \pmod {19 \times 4 \times 3}$  now I am stuck . any help will be appreciated Array of zero length I am working on refactoring some old code and have found few structs containing zero length arrays (below). Warnings depressed by pragma, of course, but I've failed to create by "new" structures containing such structures (error 2233). Array 'byData' used as pointer, but why not to use pointer instead? or array of length 1? And of course, no comments were added to make me enjoy the process...  Any causes to use such thing? Any advice in refactoring those?  struct someData {    int nData;    BYTE byData[0]; }   NB It's C++, Windows XP, VS 2003 How to make a domain receiving email behind cloudflare? Proofs involving $ (A\setminus B) \cup (A \cap B)$ Can you explain briefly the main concepts and command line tools used to manage file permissions? When I boot my Windows 8 laptop (see details below), it displays this message:  Recovery  Your PC needs to be repaired  A required device isn't connected or can't be accessed.  Error code: 0xc0000225  [ A text saying I should use recovery tools on my installation media to fix the issue. ]  Press Enter to try again  Press F8 for Start-up Settings  Press Esc for UEFI Firmware Settings   If I press Enter or F8, the central part of the message changes to:  The application or operating system couldn't be loaded because a required file is missing or contains errors.  File: \Windows\system32\winload.efi  Error code: 0xc0000225   I don't have a recovery disk and I have owned this computer for a year with no problems. All I did prior to this error was unistall avast and restart. I can only access UEFI Firmware Settings and have no clue what to do from there. PLEASE HELP! How to show the number of domains the disk is split into is $1+ C_n^2 + C_n^4$? Assuming there are n points on a circle, then there are $C_n^2$ chords. If any three chords don't intersect in circle. How to show the circle will be divided into $1+ C_n^2 + C_n^4$ domains?  Picture below is a example of 5 points on circle. Leaving the States on Visa Waiver and coming back I'm travelling on the ESTA visa waiver, I'm now in the States but would like to go to Costa Rica for a bit (say three weeks) then come back to the States. All will be within my 90 day limit.  Is that allowed?  (I have my onward ticket home.) Joint distribution of a Normal and Truncated Normal I have a random variable $X\sim \text{Normal}(\mu,\sigma)$ and have the transformation $Y=\max\{0,X\}$.  Is the distribution of $Y$ a truncated normal where it is truncated to live on the positive half of the real line?  Secondly, is there a closed form solution for the joint distribution of a Normal random variable and a truncated Normal random variable? Vertical spacing in floats I am using a float inside the text. As I found out, using \intextsep I could set space above and below the float and the texts. But when I am using \setlength{\intextsep}{5mm}, the space below the float is more than the one above it. Why they are not equal?  % Preview source code  %% LyX 2.0.0beta1 created this file.  For more info, see http://www.lyx.org/. %% Do not edit unless you really know what you are doing. \documentclass[english]{report} \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc} \setcounter{secnumdepth}{3} \setcounter{tocdepth}{3} \usepackage{graphicx}  \makeatletter  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands. %% A simple dot to overcome graphicx limitations \newcommand{\lyxdot}{.}   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands. \usepackage{setspace} \setlength{\intextsep}{5mm} \setlength{\belowcaptionskip}{0mm}  \setstretch{2}  \makeatother  \usepackage{babel}  \begin{document} Text Text Text Text Text Text Text Text Text Text Text Text  \begin{figure}[h] \begin{centering} \includegraphics[scale=0.5]{\lyxdot \lyxdot /Pictures/fedora} \par\end{centering}  \caption{}  \end{figure} Text Text Text Text Text Text Text Text Text Text Text Text \end{document} Which is the best way to install new hplip versions? Hplip is the software that drives most hp printers. Usually new printers are only supported in newer versions of the software. Canonical doesn't backport new versions packages to older Ubuntu versions, that means that newer drivers are not going to be available in the Software Center of older Ubuntu versions.  As an example yesterday I needed to hook a hp 1005p to a computer running 8.04. I was forced to install a newer hplip than the version available in the repositories. I installed it using the script from the hp page, but I'd like to know other alternatives.  Which is the best (technically, not the easiest) way to install it and why?. Extract Raster Value into Polygon Attribute I have Raster Data for a State which has Elevation Data in its pixels. I also have Vector layer which has the 300 divisions of State. what I need is, I want to get the average elevation value of particular division from the raster data using ArcGIS. I tried extract by mask in ArcGIS to extract individual polygon to clip the raster into 300 raster then from individual raster i have collected average elevation but it has taken days together to complete the work. Is there any other easy way to get it? How to allow to run su instantly after I added the user to the appropriate group I have the su executable with the following permissions:  bash-4.2# ls -la /bin/su -rws--s--- 1 root wheel 59930 Sep 14  2012 ./su   When I am logged in as a user, not in the wheel group and try to run su, I get an error, which is correct:  bash-4.2$ su bash: /bin/su: Permission denied   After that I add this user to wheel group from root:  bash-4.2# usermod -a -G wheel user   But for the same terminal session I still can't run su:  bash-4.2$ su bash: /bin/su: Permission denied   For the new sessions I can run su. How to allow to run su instantly after I added the user to the appropriate group? What is a "callable"? I'm trying to load a field value (machine name: field_theme_image) from a content of node value 3, in "page--front.tpl.php".  &lt;?php   $node=node_load(3);   print $node-&gt;field_theme_image[$node-&gt;language][0]['uri']; ?&gt;   Using the above code I'm not getting full URL value. Please see the image below. I can see the path value in Devel themer.