How do i get access to an element in a set ?
vector<int> myvec (4,100);
int first = myvec.at(0);
set<int> myset;
myset.insert(100);
int setint = ????
Can anybody help ?
I have an interval let's say (0..3) where next element is +1 unless the last. Then the next is 0. I solved it by the code below. Just wondering if there is anything else outhere :-)
def next(max,current)
if current+1 == max
return 0
else
return current+1
end
end
I have a base class that declares a grouping of objects. That grouping can be an array, List, Collection, that's up to me.
The derived classes of this base class are the ones that actually set the values of this multi-element field. What is the best way to expose this field to the derived classes?
Hi i have to select the 2 lastest element for every topic
ex:
table: msg
id | topic_id
-----------
1 | 1
2 | 1
3 | 1
4 | 1
5 | 2
6 | 2
7 | 2
8 | 3
i want obtain these rows:
3 1
4 1
6 2
7 2
8 3
How can i do?
thanks
Hi,
Can you please tell me if there is any DOM API which search for an element with given attribute name and attribute value:
Something like:
doc.findElementByAttribute("myAttribute", "aValue");
Thank you.
Hello everybody,
I'm using this codes for listing custom field values into drop-down list element on this category in Wordpress (screenshot is here what i'm point out).
So there are duplicate items on drop-down list and how i can delete duplicate entries on list?
Thanks in advance.
On load, the script is not un-checking the disabled checkboxes, I have tried everything. I have even tried running this code from Chrome Console, and it is working, but not in normal ways. Where is the error?Javascript:
document.observe("dom:loaded", function() {
$(document.body).select('input').each(function(element) {
init();
element.observe('click', function(element) {
init();
});
});
loopGroup1();
loopGroup3();
loopGroup4();
});
function init() {
$(document.body).select('input').each(function(element) {
if (!element.checked) {
element.up().removeClassName('yes');
} else {
element.up().addClassName('yes');
}
if (element.disabled && element.checked) {
element.checked = !element.checked;
element.up().removeClassName('yes');
}
});
}
I would like to listen for the mouse over event in GWT 1.6. Since GWT 1.6 has introduced handlers and deprecated listeners I'm unsure as to how I can accomplish this with what little information exists.
Note: I have an Element object. That's what I need to add the mouse handler to. I apologize for my lack of clarity.
Thanks!
Hi
I wanna know when I leave empty element empty in my Deployment Descriptor file then it does not grant any role to access
But when do i need it DD where all the time anyone role must access my web page.
In which situation I do not need no role to be accessed?
I have a bunch of elements with a classname
<p class="red"></p>
<div class="red"></div>
I cant seem to select the first element with the class="red" using the following CSS rule:
.red:first-child{
border:5px solid red;
}
What is wrong in this selector and how to correct it ??
I have some JQuery code that shows or hides a div.
$("div#extraControls").show(); // OR .hide()
I initially want the div to be not visible so I used:
$(document).ready(function() {
$("div#extraControls").hide();
});
However, on the browser, the content loads visible for a second before disappearing, which is not what I want.
How do I set the hide the element before the page loads whilst keeping the ability to show hide it dynamically with a script?
Hi,
I am new to numpy. Am wonder is there a way to do lookup of two ndarray of different shapes?
for example, i have 2 ndarrays as below:
X = array([[0, 3, 6],
[3, 3, 3],
[6, 0, 3]])
Y = array([[0, 100],
[3, 500],
[6, 800]])
and would like to lookup each element of X in Y, then be able to return the second column of Y:
Z = array([[100, 500, 800],
[500, 500, 500],
[800, 100, 500]])
thanks, fahhean
I am trying to create a thin line under a nav bar to follow the mouse but am having trouble getting e.page:X to set the width of the element.
Here is what I have:
$('#test').mousemove(function(){
var linewidth = e.pageX;
$("#line").width($linewidth);
})
})
Can anyone tell me why this is not setting the width of #line
I currently have a std::vector which holds std::vector of double. I'd want to sort it by the second element of the double vectore. ex:
instead of sorting by MyVec[0] or myvec[1] I wat it to sort myVec[0] and myvec[1] based on myvec[0][1] myvec[1][1]. Basically sort by a contained value, not the objects in it.
so if myvec[0][1] is less than myvec[1][1] then myvec[0] and myvec[1] will swap.
Thanks
Hello all,
How do I get the id of an input element based on its value? The values will always be unique and there are only 7 of them. I have tried this:
$('#wrapper').find("input[value='"+value+"']").each(function(){
return this.id;
});
But nothing is returned!
Thanks all for any help
hey,
iN eclipse, is there any way to view element under . How can I add more elements under types through design view instead of writing code manually? Thanks.
Dim arr As New Collection, a
Dim aFirstArray() As Variant
...some code
For Each a In aFirstArray
arr.Add a, a
Next
i get this error: This key is already associated with an element of this collection
on this line : arr.Add a, a
what am i doing wrong?
Hi Could anyone give me a sample program to "Create an ApplyRemoveConst template that
constructs a new typelist with remove_const applied to each element"
For example:
typedef TYPELIST_3(A, const B, B) TL;
typedef ApplyRemoveConst::Result TL2;
// TL2 is the same as TYPELIST_3(A, B, B)
I have an error message like this:
<span class="errorMessage">Your input sucks!</span>
and I need to determine when it changes. the validation framework I'm using sets the text when there's an error and removes it when it's complete. I'm hoping to tap into that by watching for changes to the text property of the element using jquery. Any idea of how to go about doing this?
Thanks!
hi,
i'm using the mshtml library for parsing out html via MSHTML.HTMLDocument.
my question: is there a way to assign a javascript function to a dom element?
i've tried something like:
div.onmouseover = "function(){alert('mouseover')}"
and
div.setattribute "onmouseover" , "function(){alert('mouseover')}"
without success (no error but no effect either).
anyone knows if its possible?
thx