select

Reading from multiple BlockingQueues within a single thread

I have three Java's LinkedBlockingQueue instances and I'd like to read from them (take operation) only using one thread. The naive approach is to have one thread per queue. Is there anything like the UNIX select system call for blocking queues in Java? Thanks. ...

SELECT and UPDATE not working -- MySQL

Hello, After I upload a photo to a server, I want to save it in the user's database in MySQL, but for some reason, it is not working. Below is the code for uploader.php: session_start(); if(!$_SESSION['userid']) { header("Location: index.php"); exit; } $con = mysql_connect("host","db","pw"); if (!$con) { die('Could not conne...

SQL Derby: GROUP BY not selected id

I am using Derby. I have a table with two columns X and Y. I want to select column X but group by column Y. This means I want to show only ONE X value for each row with the first Y value to it. How can I do this? CREATE TABLE test ( x INTEGER NOT NULL , y INTEGER NOT NULL ) INSERT INTO test VALUES (1,1) ,(1,2) ,(1,3) ,(2 ...

ASP.NET DropDownList / HTML select list default selection

For my ASP.NET page, in the code behind I load various items/options into a DropDownList but I do not set a default by assigning SelectedIndex. I notice for the postback SelectedIndex is set to 0, even if I never set focus to or changed the value in the DropDownList. If not otherwise specified in the code behind or markup, will a defaul...

How to make a select field show list of options? - Javascript/jQuery

Hi folks, I'm trying to mimic focus on a select field. e.g. When a user gains focus on a select field, the select field shows the options in a drop down list. When using $('select').focus(), the options are not shown. Any help on this one guys? =) ...

Select from where field not equal to Mysql Php

Hi, I'm just wondering what kind of mysql command i could execute in php that would select all items from a certain table where columna is not equal to x and columnb is not equal to x so like select something from table where columna does not equal x and columnb does not equal x If anyone could help that would be great! Thanks ...

How to Set the Select List & Radio button Values by default

Dear All I am using jquery my html code <input type="radio" name="maritalstatus" id="maritalstatus" value="single"/> single <input type="radio" name="maritalstatus" id="maritalstatus" value="married"/> Married <input type="submit" id="clicksingleactive" /> <input type="submit" id="clickmarriedactive"/> if i submit the click ...

Select query on a partitioned table

Hi, I have partitioned a table and it has been partitioned according to an account id. ie also rows that have accountid =1 will be in A partition and all rows that have accountid = 2 will be in B partition. so now if i execute a query with where condition accountid =1 sql server will search only in A partition. Suppose if i add anothe...

SQL select for all records that may holds specific value

How to select all records,that may contain specific value that is known, without referring to specific column in SQL expression? For instance, i know,that some unknown column holds value 'xxx' and there are many columns and records in table. Thank you. ...

XPath select an image by classname

Hi, I have an xml sheet with some data and some images that i want to collect only a part using xslt. However, there is one image with a particular classname that i would like to collect especially. For example, the xml says: <img class="itemImage" height="130" src="image.png" width="195"/> How do I get the src attribute of this im...

how can I select both label and input?

I have form containing several options like this: <label for="edit-attributes-2-29" class="option"> <input type="checkbox" class="form-checkbox" value="29" id="edit-attributes-2-29" name="attributes[2][29]"> Cajunkryddad biffstek, +30 Kr </label> I need to select the whole surrounding div(not included abov...

Order by Maximum condition match

Please help me to create a select query which contains 10 'where' clause and the order should be like that: the results should be displayed in order of most keywords(where conditions) matched down to least matched. NOTE: all 10 condition are with "OR". Please help me to create this query. i am using ms-sql server 2005 Like: Select * ...

PHP + form select options

I have a select that looks like this, it is written in in HTML and is not rendered via any php, <select name="position"> <option value="left">Left</option> <option value="right">Right</option> <option value="centre">Centre</option> </select> The value gets sent to database an...

How to find rows in SQL that start with the same string (similar rows)?

I have a table with primary keys that look like this: FIRSTKEY~ABC SECONDKEY~DEF FIRSTKEY~DEF I want to write a SELECT statement that strips off the segment following the tilde and returns all rows that are duplicates after the post-tilde segment is gone. That is, SELECT ... Gives me: FIRSTKEY~ABC FIRSTKEY~DEF As "duplicates". ...

Multiple select() syscalls from one thread in Python.

I'm using a couple of Python libraries, and they both use a select() syscall. I was wondering if it was safe to have two select() syscalls from within the same thread (assuming there are no shared descriptors between them)? ...

Why is my number column not returning data?

I have a table, which I shall call table_name, for that is it's name. Table_name has two columns, column_a, a varchar column; and column_b, a number(10) column. I have a process which selects information out of column_b, using column_a in the where clause. For some reason, this process keeps lagging: I fire the process, and it never com...

JQGrid Dynamic Select Data

Hi, I have utilised the example code at Example Code at this link and I have got my grid to show a dynamically constructed select dropdown on add and edit. However when it is just showing the data in the grid it shows the dropdown index instead of its associated data. Is there a way to get the grid to show the data associated with t...

Select entire row into another table regardless of column names in SQL Server

Is there a way to select the row from a temp table (table has only one row anyway), into another table that has some columns with differenet names? For example: TempTable FirstName LastName Column1 Column2 ------------ ------------ ----------- ----------- Joe Smith OKC ...

Rails: Manually change order of choices in select() helper?

I've got the following select() form helper method: select("treatment", "frequency_unit", { "hour" => "hour", "day" => "day", "week" => "week", "month" => "month", "year" => "year" }) The helper is organizing the choices seemingly randomly...I'd like it to maintain the order of the choices as I have them listed above. How can I make ...

Getting the "newest" selected option's text from multiple select list

I have a HTML select list, which can have multiple selects: <select id="mySelect" name="myList" multiple="multiple" size="3"> <option value="1">First</option> <option value="2">Second</option> <option value="3">Third</option> ` <option value="4">Fourth</option> ... </select> I want to get an option's text everytime i c...