Here is my javascript:
$(document).ready(function(){
var queries = getUrlVars();
$.get("mail3.php", { listid: queries["listid"], mindex: queries["mindex"] }, showData, 'html');
});
function showData(data)
{
var response = $(data).find("#mailing").html();
if (response == null)
{
$("#results").html("<h3>Server didn't respond, try again.</h3>");
}
else if (response.length)
{
var old = $("#results").html();
old = old + "<br /><h3>" + response + "</h3>";
$("#results").html(old);
var words = response.split(' ');
words[2] = words[2] * 1;
words[4] = words[4] * 1;
if (words[2] < words[4])
{
var queries = getUrlVars();
$.get("mail3.php", { listid: queries["listid"], mindex: words[2] }, function(data){showData(data);}, 'html');
}
else
{
var done = $(data).find("#done").html();
old = old + "<br />" + done;
$("#results").html(old);
}
}
else
{
$("#results").html("<h3>Server responded with an empty reply, try again.</h3>");
}
}
function getUrlVars()
{
var vars = [], hash;
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < hashes.length; i++)
{
hash = hashes[i].split('=');
vars.push(hash[0]);
vars[hash[0]] = hash[1];
}
return vars;
}
After the first line in showData:
var response = $(data).find("#mailing").html();
the javascript stops. If I put an alert before it, the alert pops up, after it, it doesn't pop up. There must be something wrong with using $(data), but why? Any ideas would be appreciated.
I have a relationship like this:
class E {
string name
hasMany = [me:ME]
}
class M {
float price
}
class ME {
E e
M m
int quantity
}
And I'd hate to iterate to achieve this: "obtain the sum of the quantity in ME times the price of the corresponding M for a given E".
Any hints on how to implement it using GORM/HQL ?
Thanks in advance
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?
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?
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 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'});
});
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 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?
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+
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
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?
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
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.
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 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.
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.
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 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 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
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.
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?
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
Entities:
public class Person
{
public Person(){}
public virtual long ID { get; set; }
}
public class Employee : Person
{
public Employee(){}
public virtual long ID { get; set; }
public virtual string Appointment { get; set; }
}
Mappings:
public class PersonMap : ClassMap<Person>
{
public PersonMap()
{
Id(x => x.ID)
.GeneratedBy.Identity();
}
}
public class EmployeeMap : SubclassMap<Employee>
{
public EmployeeMap()
{
KeyColumn("ID");
Map(x => x.Appointment)
.Not.Nullable()
.Length(50);
}
}
2 items in Person table
1 item in Employee table
(1 in base class, 1 in child class)
Query:var list = Session.CreateQuery("from Person").List<Person>();
Return:
0 | ID = 1
1 | ID = 0, Appointment = "SomeAppointment"