I am storing the response to various rpc calls in a mysql table with the following fields:
Table: rpc_responses
timestamp (date)
method (varchar)
id (varchar)
response (mediumtext)
PRIMARY KEY(timestamp,method,id)
What is the best method of selecting the most recent responses for all existing combinations of method and id?
For each date there can only be one response for a given method/id.
Not all call combinations are necessarily present for a given date.
There are dozens of methods, thousands of ids and at least 356 different dates
Sample data:
timestamp method id response
2009-01-10 getThud 16 "....."
2009-01-10 getFoo 12 "....."
2009-01-10 getBar 12 "....."
2009-01-11 getFoo 12 "....."
2009-01-11 getBar 16 "....."
Desired result:
2009-01-10 getThud 16 "....."
2009-01-10 getBar 12 "....."
2009-01-11 getFoo 12 "....."
2009-01-11 getBar 16 "....."
(I don't think this is the same question - it won't give me the most recent response)
I have a single MYSQL Question and need help ASAP.
Database:
Email | Name | Tag
[email protected] |Test Person | TagOne
[email protected] |Test Person | Tag Two
Need an SQL query that will return
Email | Name | Tag
[email protected] |Test Person | TagOne, Tag Two
Any help?
I have a Users Table where it stores city, state and country along with other Users attributes. The states are stored as California, Alabama and so forth. Now I want to retrieve the user information for certain records but the state should get translated to two digit code. Say 'California' should be 'CA'. How should I go about doing this.
I was thinking to create a mapping table for state names with there abbreviation and then use some sort of replace function to do it.
Any ideas ?
I have an architecture similar to this:
<div id="container">
<div>stuff here</div>
<div>stuff here</div>
<div>stuff here</div>
<div>stuff here</div>
</div>
I want to, using jQuery, hide the cursor when the mouse enters #container. However as the nested divs appear on top it doesn't quite work that way. How can I hide the mouse cursor when hovering over any of the divs within #container. Below is the cursor hiding code.
$('#container').mouseover(function()
{
$(this).css({cursor: 'none'});
});
How can I query a table which has a column of data type HIERARCHYID and get a list of descendants X levels deep under an employee?
Here is the current structure:
CREATE TABLE [dbo].[Employees](
[NodeId] [hierarchyid] NOT NULL,
[EmployeeId] [int] IDENTITY(1,1) NOT NULL,
[FirstName] [varchar](120) NULL,
[MiddleInitial] [varchar](1) NULL,
[LastName] [varchar](120) NULL,
[DepartmentId] [int] NULL,
[Title] [varchar](120) NULL,
[PhoneNumber] [varchar](20) NULL,
[IM] [varchar](120) NULL,
[Photo] [varbinary](max) NULL,
[Bio] [varchar](400) NULL,
[Active] [bit] NULL,
[ManagerId] [int] NULL
)
I have the following tables/columns:
Parent:
ParentID
Child:
ChildID
ParentID
SubChild:
SubChildID
ChildID
Date
Parent has 1 to Many relationship with Child
Child has 1 to Many relationship with SubChild
For every Parent, I need to get the SubChild with the most recent Date value.
How can I do this using SQL. I've tried using MAX(Date),
but I can't seem to figure out how to join Parent and Child successfully.
The ideal result set would contain all the Parents joined with all the SubChild columns of the latest record.
Note: using MS SQL 2005+
Under
(BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)
peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier{}
is it possible to get returned the phone number or somewhat the user has clicked?
hello, i have following function:
function delete_auswahl()
{
var anzahl =document.getElementById ("warenkorbfeld").length ;
for (var i =0; i<=anzahl; i++)
{
if (document.getElementById ("warenkorbfeld").options[i].selected==true)
{
if (document.getElementById ("warenkorbfeld").options[i].id == "Margherita" )
gesamtbetrag = gesamtbetrag - 4;
if (document.getElementById ("warenkorbfeld").options[i].id=="Salami" )
gesamtbetrag = gesamtbetrag - 4.50;
if (document.getElementById ("warenkorbfeld").options[i].id=="Hawaii" )
gesamtbetrag = gesamtbetrag - 5.50;
document.getElementById ("warenkorbfeld").options[i]=null;
i--;// auf der gleichen stelle bleiben, da dass nächste feld nachrückt
}
}
document.getElementById('gesamtbetrag').innerHTML=gesamtbetrag ;
}
before i added values with
function hinzu (pizza)
{
NeuerEintrag = new Option(pizza, pizza, false, false);
document.getElementById("warenkorbfeld").options[document.getElementById("warenkorbfeld").length] = NeuerEintrag ;
if (pizza=="Margherita")
{
gesamtbetrag = gesamtbetrag + 4;
}
if (pizza=="Salami")
{
gesamtbetrag = gesamtbetrag + 4.50;
}
if (pizza=="Hawaii")
{
gesamtbetrag = gesamtbetrag + 5.50;
}
document.getElementById('gesamtbetrag').innerHTML=gesamtbetrag ;
}
now, in the delete function doesn't substract the price.
despite this, all works.
what's wrong with this term?
if (document.getElementById ("warenkorbfeld").options[i].id == "Margherita" )
gesamtbetrag = gesamtbetrag - 4;
thanks in advance
I had a table (Some_Table) with two columns:
A B
-------------------
1 test
2 test
3 test1
4 test1
i would like to return DISTINCT values for column B and it's associated value in column A (first in distinct set), so something like this:
A B
-----------
1 test
3 test1
What is the sql?
Our solution is built using Release|x86; however, when our designers try to build using Blend they are forced to use Any CPU which we don't want to to add since it's going to change the behavior. I checked version 4, and it does not seem to address this issue.
Is there a way to specify Solution Configuration/Platform when using Blend? Any workarounds?
Take the following file...
ABCD,1234,http://example.com/mpe.exthttp://example/xyz.ext
EFGH,5678,http://example.com/wer.exthttp://example/ljn.ext
Note that "ext" is a constant file extension throughout the file.
I am looking for an expression to turn that file into something like this...
ABCD,1234,http://example.com/mpe.ext
ABCD,1234,http://example/xyz.ext
EFGH,5678,http://example.com/wer.ext
EFGH,5678,http://example/ljn.ext
In a nutshell I need to capture everything up to the urls. Then I need to capture each URL and put them on their own line with the leading capture.
I am working with sed to do this and I cannot figure out how to make it work correctly. Any ideas?
Say I have an unordered list like so:
<ul>
<li>Some Text</li>
<li>Some Text</li>
<li>Some Text</li>
<li>Some Text</li>
</ul>
I want to use jquery so that when I click a "li", the background changes to blue. So I do this:
$('li').click(function() {
$(this).addClass('active');
});
And the "active" class has as background of blue. However, I can't figure out how to make it so that when I click another "li", the other "li" that has a background of blue stops having a background of blue. I guess what I'm trying to say is how to make only one "li" have a background of blue at a time--using jquery.
I wrote some code for selecting the particular row and pasting it in column wise using paste-special property. It is working correctly my code is :
lngRow = Me.TextBox4.Value
strCol = Me.TextBox5.Value
Set rng = Range("A:A").Find(What:=lngRow, LookIn:=xlValues, LookAt:=xlWhole)
If rng Is Nothing Then
MsgBox "Value not found in row 1", vbExclamation
Else
Range(rng, rng.End(xlToRight)).Copy
Range("A1:E3").Columns(strCol).Offset(, 1).PasteSpecial Transpose:=True
Range("A1:E3").Rows(1).Copy
Range("A1:E3").Columns(strCol).PasteSpecial Transpose:=True
endif
the problem here is I am using
Range(rng, rng.End(xlToRight)).Copy
to copy the values
and for pasting I am using Range("A1:E3").Columns(strCol).Offset(, 1).PasteSpecial Transpose:=True.
How can I paste all the values which are copied? Because if the values are in column F then this macro will not paste those values.
Hi!
I have a collection of elements of type B and C, which all extends A. I need to filter the collection to get elements of only B type.
Is there any way to do it except:
for (A a : initCollection) {
if (a instance of B) {
newCollection.add(a)?
}
}
Thanks
I am in need of a jquery based 360 rotational slider I want the user to be able to grab the end and rotate it 360 degrees anyone know of anything like that I can't seem to find one
Hello,
I want to hide and show some form in my page.
For each form theres a link, and i want that, when i click on this link,
it hide and show the nearest form of the link.
My code looks like this :
$$('.flagLink').each(function(s){
$(s).observe('click', function(event) {
// here i want to hide and show the nearest form
});
});
I've tried this :
$$('.flagLink').each(function(s){
$(s).observe('click', function(event) {
$(s).next('form').toggle();
});
});
It works but, i would like to be more precise like :
$$('.flagLink').each(function(s){
$(s).observe('click', function(event) {
$(s).next('.flagForm').toggle();
});
});
but the .flagForm selector doesnt work.
Two tables
1) product
--------------------
id | Name | price
1 | p1 | 10
2 | p2 | 20
3 | p3 | 30
2) product_attributes:
---------------------------------------------------
id | product_id | attribute_name | attribute_value
---------------------------------------------------
1 | 1 | size | 10
2 | 1 | colour | red
3 | 2 | size | 20
I need to join these two tables. In the where clause I need to match both the
two rows attribute values. Is it possible to get the result based on two rows
value. Here if size=10 and colour=red.
Output should be
1 | p1 | 10
It could be greatly helpful to get a query for this.
I have an arbitrarily deep list of the form:
<ul>
<li></li>
<li>
<ul>
<li></li>
</ul>
</li>
</ul>
I am trying to build a function "nextElement" that returns a jQuery selector.
The first time the function is called, it returns the first li in the list. The second time it is called, it returns the next li in the page. Etc.
I'd like this function to pay no attention to siblings, parents, children, etc. All I care about is that everytime it is called, the next li in the source gets chosen.
Any suggestions on how to go about approaching this?
Thanks
I am simply attempting to get jquery to identify the first letter of a paragraph. How would I do this?
For example, I have a page with a number of paragrahs on a page. I would like only the paragraphs starting with a specified letter to be given the class "current" and all others to be hidden. I pretty much know how to add the class and hide the others but, I cant get jquery to recognize the first letter.
Secondly, is it possible to pull this 'first letter' variable from the url string?
For example,
Page 1 - There is a list of letters. The user clicks 'B' and the url is
http://domain.com/page2.html?letter=b
And page2 picks up that variable (b) and applies it to the Jquery, showing only those paragraphs
I want to use an image for the background of a selec/dropdown. The following CSS works fine in Firefox and IE, but does not in Chrome:
#main .drop-down-loc { width:506px; height: 30px; border: none;
background-color: Transparent;
background: url(images/text-field.gif) no-repeat 0 0;
padding:4px; line-height: 21px;}
THANKS
I have to see which of the following from a vector is a square number then make another vector with only the square numbers
For example: (4,15,6,25,7,81) the second will be (4,25,81)
4,25,81 because 2x2=4 5x5=25 and 9x9=81
I started like this:
{
int A[100],n,r,i;
cout<<"Number of elements=";
cin>>n;
for(i=1;i<=n;i++)
{
cout<<"A["<<i<<"]=";
cin>>A[i];
}
for(i=1;i<=n;i++)
{
r=sqrt(A[i]);
if(r*r==A[i])
}
return 0;
}
but I am not really sure how to continue
Hello,
I just started working on a Ruby On Rails project and i got to the point where i need to see the contacts of a company.
They should appear once the company is selected..
<%= observe_field :empresa_id, :url={:action = "get_contactos", :controller= :contactos, :updatewith =:empresa_id} %
but nothing happens, i don't see even a error on the script/server.
Can someone point me in the right direction?
http://nealenssle.com/blog/2007/04/12/how-to-dynamically-update-form-elements-in-rails-using-ajax/
I see on the link that a guy did the exact same thing i need but did not post any info.
Cheers.
hi,
I have audio files in var/
This is the file name
2-3109999999-3246758493-1271129518-1271129505.6.wav
Format
2=campaign id
3109999999=caller id
3246758493=number called
1271129518=timestamp call ended
1271129505=timestamp call started
6=call id
If I were to pass just the number called which was 3246758493, how can I find all the files without defining all the other variables(such as timestamp, etc) and just the files that have that number in the filename?