select

Sort by order of values in a select statement "in" clause in mysql

I'm selecting a set of account records from a large table (millions of rows) with integer id values. As basic of a query as one gets, in a sense. What I'm doing us building a large comma separated list, and passing that into the query as an "in" clause. Right now the result is completely unordered. What I'd like to do is get the resu...

C: Part of the code doesn't execute under select()

I have something like this: #define QUIT_TIME 5 int main(int argc, char **argv) { //... SOCKETS STUFF .... fdmax = parentfd; while (notdone) { //Set the timers waitd.tv_sec = 1; waitd.tv_usec = 0; FD_ZERO(&tempreadfds); FD_ZERO(&tempwritefds); FD_ZERO(&readfds); ...

Rails - Should an object's types be in its own model?

I have a contact, and contact has_many :phones. The phones table has a column named, phones_desc, where I want to include the type of phone number the user has saved. My question / Best practice Should I provide a select with manually provided options (such as "mobile", "work", "home")... -or- ...create a new model named phones_type...

Greater area for radio selection

<span> <img src="img/icon.png" alt="" /> <label><input type="radio" name="" /> Label here</label> </span> I want the whole <span> to be clickable, not just the radio input. How do I do it with jQuery? ...

Help with asp.net mvc select dropdown

I have a marital status field in my users table that its just varchar yet I only want to give the users four options (married, single, widowed and divorced) and i want to have the correct one selected when Im editing the form.. is it possible? please help. ...

Remove bias from the monthly totals

In order to remove the bias introduced by the differences in the number of days in the months and years (in case of leap years), from monthly total comparisons of arbitrary quantities and assuming, for example, a table named My_Table with a datetime column named order_date, and an integer one named revenue, I use the following query to g...

SQL If "something" select count

The output that comes from a custom view of mine is as follows... Col1 Col2 Col3 Col4 xxxx Cake 1 1* Cake xxxx 2* 1 xxxx Cake 2 0* xxxx Cake 0 0* Cake xxxx 2* 0 Cake xxxx 2* 0 and what i would like to sum is... For every row, if the word Cake is found in Col1, t...

selectText of NSTextField on focus

Hi Could anybody suggest a method to select all the text of an NSTextField when the user clicks it ? I'm new to Cocoa, and could not find a solution here or on the web. I did find suggestions to subclass NSTextField and then use mouseDown or firstResponder, but it's beyond my skill for now. So I was hoping either there would be an easi...

VB.NET Select Case Compiler Optimizations?

Does the VB.NET 2008 compiler selectively optimize Select Case Statements? For example, a Select Case Statement with a sufficient quantity of integer cases could be organized as a binary search. I ask this because I am curious whether or not I should opt for a Select Case in place of If Statements with multiple Else If's where integer...

ui.tabs add callback not able to set tab

Hi, I am trying to get jQuery tabs to behave like IE and Firefox. I have a few tabs with an "addtab" at the end. When this tab is clicked a new tab is added, this is fine. But i want to select the second last tab. This is proving to be quite difficult. my init code is $tabs =$("#tabs").tabs({ add: function(event, ui) { ...

How to select multiple rows filled with constants?

Selecting constants without referring to a table is perfectly legal in an SQL statement: SELECT 1, 2, 3 The result set that the latter returns is a single row containing the values. I was wondering if there is a way to select multiple rows at once using a constant expression, something kind of: SELECT ((1, 2, 3), (4, 5, 6), (7, 8, 9))...

Select all/Unselect all is not working with dynamically genrated multiple select box

I have a dynamically generated multiple select box in which values are coming from mysql database and i want to give user a chance to select all values at once and unselect them at on click and this javascript code working fine in normal html case but not in this case... any guess any help... thanks in advance. ...

JQuery select box focus problem in internet explorer

In the following ".input" matches with a tag. The code works fine in all browser except in internet explorer where I need to click on a select box twice to get the dropdown. $(".input").focus(function () { var rc = $(this).parents(".rc-input"); rc.removeClass("rc-input-default"); rc.addClass("rc-input-active"); }); If I use moused...

Using Select with ruby sockets what is a good way to ignore a given socket if a certain condition is met?

A little background: I've written a script that will act as a receiver for incoming Syslog/Email/Snmp(v1) traps. It receives the data and stores it as a custom defined object. My "messageSocket" is a means to control the behavior from a script outside of this general listener. I want to send messages to this to either start/stop on ...

Adding optgroups to select using javascript dynamically

Hello! I have a dynamically populated (by ajax) select box with resulting options like that: <select id="destination" name="destination"> <option value="london-paris">London-Paris</option> <option value="paris-london">Paris-London</option> <option value="london-newyork">London-New-York</option> <option value="newyork-london">New-York-...

Advanced many2many query for MYSQL

I im trying to build a imagegallery where people have access to different groups and the groups decide what catalogues and images they are allowed to see. I though many2many structure would be best for this. So far, ive manage to build the database like this: image (image_name, image_file, image_id) catalog (catalog_id, catalog_nam...

How to select on STDIN_FILENO ignoring signals?

Please check the following code #include <stdio.h> #include <string.h> #include <stdlib.h> #include <termios.h> #include <unistd.h> #include <sys/types.h> #include <signal.h> #include <sys/time.h> #include <time.h> #define CLOCKID CLOCK_REALTIME #define SIG SIGRTMIN int reset = 0; void changemode(int); int kbhit(void); int pfds[2]; s...

Limiting number of selections to one cell/row per group in a grouped UITableView on iPhone...

Hi! I´m working on a quiz application which uses a grouped UITableView, where i need to limit the users selection to one cell per group and also make the group selectable only once per group, in order to stop the user from correcting any potential wrong answers. Is there any way of doing this? Cheers, Adam ...

Using readv(), writev() and poll() from C++

There is a multiplayer card game which I had first programmed as a non-forking socket server in C (using poll() call). Then it was too difficult for me to add new features and I've switched to Perl (using IO::Poll module). As Perl doesn't support readv()/writev(), requires more memory/CPU and also isn't very commercial (I'd like to sel...

Why is this SQL query not working?

this script have to update things on every refresh but not working. lend me a hand $yp = mysql_query("select id from yyy where twitterid = '$tid'"); $qq = "update yyy set twitterid = '$tid', twitterkullanici = '$twk', tweetsayisi = '$tws', takipettigi = '$tkpettigi', takipeden = '$tkpeden', nerden = '$nerden', bio = '" . mysql_re...