select

BASH scripts : whiptail file select

I've found a great little program that will allow me to add user friendly GUI's to my Bash Scripts; whiptail However the whiptail man page isn't all that helpful and doesn't provide any examples. After doing some google searches I understand how to create a simple yes/no menu using whiptail: #! /bin/bash # http://archives.seul.org/s...

jquery: grab the values from multiple select menus each time a new option is chosen

I'm building a live price quote form with jQuery, using a series of select menus. I've come up with the code below, which grabs the default values from each select menu and adds them together: $(document).ready(function(){ $('select > option:selected').each(function() { var value = $(this).attr('label'); total = parseFloat(total) ...

Sorting nearest date with MySQL

I have a simple task list which contains amongst others a title field and a deadline field. Some tasks got deadlines, other don't. Deadlines are simply stored with a MySQL date type. But the tough part (for me anyway) is to sort the tasks in the correct order: Ascending deadlines The rest (maybe by ID, but not important) Current que...

HQL select case

Hi I want to do like: select case when a.id is not null then new A(a.id) when b.id is not null then new A(null) but it gives the error: unepected token new on line... Any ideas? thanks! ...

jQuery - select item just clicked

I would like to know which item in select list was last clicked I have select drop down like this <select id="selectId" multiple="multiple" onchange=""> <option value=1>Value 1</option> <option value=2>Value 2</option> <option value=3>Value 3</option> <option value=4>Value 4</option> </select> I would like to know, which item from se...

How to calculate age (in years) based on Date of Birth and getDate()

Hi I have a table listing people along with their date of birth (currently a nvarchar(25)) How can I convert that to a date, and then calculate their age in years? My data looks as follows ID Name DOB 1 John 1992-01-09 00:00:00 2 Sally 1959-05-20 00:00:00 I would like to see: ID Name AGE DOB 1 John 17 ...

jQuery / Programmatically Select an Option in Select Box

Hello, I'm currently using jQuery to return some JSON results. Once these results are returned, I'm using them to pre-populate fields in my form. However, I need some help in pre-selecting items in a drop down box. For example, I have a select box (this is shortened): <select id="startTime"> <option value="14:00:00">2:00 pm</option...

How to wrap a CLI program in Python (keeping the interactivity)?

Hello everybody, I'd like to write a wrapper for an interactive CLI Program (the Asterisk CLI). Basically, I need to keep the interaction with the CLI (including tab-completion) but I want to filter the output of Asterisk, in order to show only lines matching a given pattern. I tried a select() based approach, using popen.popen4 and pu...

xpath select referenced xml node

I need to select a node whose "name" attribute is equal to the current node's "references" attribute. <node name="foo" /> <node name="bar" references="foo" /> I couldn't find a way to express this in XPATH. Any ideas. Ive tried the following: ./node[@name=@references] ./node[@name={@references}] Obviously the above didn't work. I g...

rails multiple form selects

I have a rails form with 2 selects where one of them depends on the the selected value of the other. So if I have 3 users and 5 items per user, once a user is selected I want the items selection to contain only the items specific to that user. Sounds pretty straightforward but I'm having a very difficult time getting this working. Her...

MySQL Select Statement, WHERE 'IN' Clause

Hello, I currently have the following row in my table: course_data: user_id days <-- This is a varchar column. 405 1,3,5 and I am trying to implement the following SELECT statement: SELECT usrID, usrFirst, usrLast, usrEmail FROM tblUsers WHERE usrID NOT IN ( ...

SQL Server 2008 select top 1 row from multiple tables?

Hello! I have a table that stores articles, like the example: Article table: ID #CategoryID #Text #Date So on the page I have different sections and each section has its own categoryID. For example, sports is 1, news is 2 etc. Now I want the possibility to load the latest article from x number of categories. I have an SP that takes ...

Use a left hand value in right hand SQL comparison

I have this SELECT statement: SELECT SUM(dbo.DLData.Quantity) FROM dbo.MasterDates JOIN dbo.DLData ON MasterDates.[ID] = dbo.DLData.DownloadID WHERE dbo.MasterDates.[Date] BETWEEN @From AND @To AND dbo.MasterDates.SiteID = @X If you plug in the @From, @To and @X it works. This is to be the right hand side of a comparis...

How to use a select to go to the Show action of another controller?

I'm trying to do something I thought easy and natural but I'm struggling.. On the homepage of my website, I want a select containing a list of users. After selecting a user and clicking on a button, it should go to the show action of the User controller page. I searched and found differents answers that I don't find very elegant: usi...

Select * from table1 where JID is not in table2 with table2.uid also not being 11111

I want to select everything from table one, which contains a column JID. These are available things the player can learn. But there is a table2 which has a list of things the player has already learned. So if JID is in table2, it has been learned, and I do not want that selected from table 1. For exampel. table 1 JID Title Descripti...

range - how to select new inserted node automatically ?

hi, i have range> newNode = document.createElement("span"); newNode.innerHTML = 'example'; range.insertNode(newNode); i insert new node. is there way, how to automatically select this newNode (as it appears on page, it is not selected) ? thanks. ...

is my mysql query correct? (does not seem like it)

I want to select data between 1 week ago data until today data: SELECT username, email, date FROM users WHERE date(date) BETWEEN (CURDATE() AND (CURDATE() - 7)) ORDER BY userid DESC LIMIT 10 Hope you guys can help me. It does not work!!! This question has been answered by lexu (can somebody close this question?) ...

formatting results using sql select with jet

I have data in Excel files that I am pulling out using the MS Jet OLEDB provider. The results of my select are being passed into a component that I cannot change to generate an html table on the fly. Some of my data files contain numbers that I need formatted with commas (#,###). As I said I cannot change the output component to forma...

Is there a jQuery jEditable Multi-select plugin?

I'm using the excellent jEditable plugin for some in-place editing on my page. There is one spot I need a multiple select element. Is there a jEditable plugin that allows me to do this? I've been trying to use the jEditable author's plugin API to create my own multiselect plugin, but no dice so far. There just doesn't seem to be quite e...

PHP/MYSQL: SELECT statement, multiple WHERE's, populated from database

I'm trying to figure out how to get a select statement to be populated by an ever-changing number of where's. This is for an order-status tracking application. Basically, the idea is a user (customer of our company) logs in, and can see his/her orders, check status, etc. No problem. The problem arises when that user needs to be associat...