I have a datatable. I need to fetch a certain column value based on the user input. For example, lets say the datatable has two columns CountryID and CountryName.
I need to find CountryID in the datatable based on the user input country name. I could just open a connection with DB and run the query select countryID from Country where countryName = @userinput. Is there anyway i could do this on the datatable.
What's the quickest way to remove an element from a Map by value in Java?
Currently I'm using:
DomainObj valueToRemove = new DomainObj();
String removalKey = null;
for (Map.Entry<String, DomainObj> entry : map.entrySet()) {
if (valueToRemove.equals(entry.getValue())) {
removalKey = entry.getKey();
break;
}
}
if (removalKey != null) {
map.remove(removalKey);
}
I need to multiply an integer (two's compliment) by a floating point constant. Here is what I have:
.data
pi dd 3.14
int dd 0ah
.code
fld pi
???
fmul ST(1), ST
How can I convert int to a floating point value for multiplying against pi?
Documentation says (http://code.google.com/appengine/docs/java/urlfetch/overview.html#Request_Headers):
These headers are set to accurate values by App Engine, as appropriate
Does the value for X-Forwarded-For included some identity of the gae application?
Hi there,
I want to allow users enter numbers in textfield and once the textbox loses focus. The number is formatted with commas.
e.g. User enters 100000
textfield looses focus
value displayed: 100,000
How can I achieve this in Grails.
I have looked at
<g:formatNumber number="${myNumber}" format="\\$###,##0" />
But it doesnt solve my problem as the number is from a textfield.
thanks
Much appreciated.
How do I hard code an absolute maximum or minimum value for a float or double? I want to search out the max/min of an array by simply iterating through and catching the largest.
There are also positive and negative infinity for floats, should I use those instead? If so, how do I denote that in my code?
I'm getting this message,"The string '7/22/2006 12:00:00 AM' is not a valid AllXsd value.", when deserializing an XML, the element contains a date, this is the property that is supposed to be mapped to the element:
[XmlElement("FEC_INICIO_REL",typeof(DateTime))]
public DateTime? FechaInicioRelacion { get; set; }
Am I doing something wrong?
Each item in my array is an array of about 5 values.. Some of them are numerical ending in "GB".. I need the same array but with "GB" stripped out so that just the number remains.
So I need to iterate through my whole array, on each subarray take each value and strip the string "GB" from it and create a new array from the output.
Can anyone recommend and efficient method of doing this?
I am using C++ boost's dynamic_bitset.
I have already allocated a variable and I just want to change its value - to construct it anew from an 'unsigned long' like from the constructor, but I don't want to allocate the memory again or to create a temporary variable.
What can I do?
How to save user imputed value in TextBox? (WPF XAML) So in my xaml window I have a TextBox. User sturts my application inputs some values in to it and presses a button or hints Enter. He closes an app. Opens it up again. How to make his inputs be saved in that TextBox in WPF?
I'm trying to get the first href attribute in a page using Selenium RC (in Python):
sel.get_text("xpath=//@href")
this returns an empty string.
However, an identical xpath on the same page inside Firefox (using the "View XPath" extension) yields the correct value.
I've tried fiddling with it, but the same happens for other attributes (eg @class) -- is there something awfully wrong with selenium or am I overlooking something trivial here?
A = imread(filename, fmt)
[X, map] = imread(...)
The above is in the synopsis part of imread, which seems to say that the return value of a MATLAB function depends on how it's called? Is that true?
I have a table having a single auto Auto Incremented column. How Can i insert the value. Using
Insert into table or some other way
Thanks
Waiting for your replay..
I saw this construction in order to get the browser viewport width:
function () { return window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; }
I understand the browser quirks involved. What I don't understand is why || returns the value. So I tried this alert(undefined || 0 || 3); and sure enough, it alerts 3. I find this bizarre, because I expect true or false. Could anyone explain what's going on?
Hello,
I need to find the string,decimal or boolean, byte value from jquery grid control,,
using extension methods,, can anybody tell me how to write extension methods to find string,decimal values?
thanks
Hi, I need to know the signal strength of a Bluetooth connection to a remote device that I make with my Android 2.1 phone. From the SDK, I can see that I can determine the RSSI at the time I discover the remote device. But I can't see how to update that RSSI value over time.
Can someone give me a hand? Thanks!!
plz help me
i am creating multiple chechbox with same name and id how i get value of array when i submited form ? using cake php
create('Report', array('action'='add')));
for($i=0;$i
" id="Report" /
}
}
?>
I am trying to put all elements of rbs into a new array if the elements in var(another numpy array) is =0 and <=.1 . However when I try the following code I get this error:
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
rbs = [ish[4] for ish in realbooks]
for book in realbooks:
var -= float(str(book[0]).replace(":", ""))
bidsred = rbs[(var <= .1) and (var >=0)]
any ideas on what I'm doing wrong?
I've finally installed all the requirements (so i think!) of a Django project, and I'm trying to get a local install running on my Mac (OSX 10.4).
I'm getting the following error:
Blockquote
OperationalError at /
no such table: django_content_type
Request Method: GET
Request URL: http://127.0.0.1:8000/
Exception Type: OperationalError
Exception Value:
no such table: django_content_type
Exception Location: /Users/Diesel/Desktop/DjangoWork/pinax-ev/lib/python2.5/site-packages/django/db/backends/sqlite3/base.py
in execute, line 170
Python Executable: /Users/Diesel/Desktop/DjangoWork/pinax-ev/bin/python
Python Version: 2.5.1
Consider a hiddenfield in the page HfId
<input type="hidden" id="HfId"/>
How to assign,clear and get value of a hidden field in jquery? ANy suggestion...
We have a WPF windows application that contains a stackpanel control, that I want to be visible only for testing, but not when it is in production.
We'd like to store the visibility value of that stackpanel in the application configuration file (app.config).
What is the WPF way of achieving this?
When I add a reference to my project, I usually want to use Specific Version = FALSE. This is because our automated build will set the version number. I see the default behavior is to be TRUE.
Is there a way to change this? Counting on manually changing that value is error prone (and I end up breaking the build).
I have several select boxes and textboxes with the same class and I have the following statement.
if ($('.selTxtClass:visible').val() == "") {
$('.selTxtClass:visible').focus();
}
}
If I do an alert with ($('.selTxtClass:visible').val()) it comes as undefined.
I want to check that the value of these elements are empty, but I cant see what is wrong with this if statement, could you give me a hand, please?
Thanks a lot.
Does map() iterate through the list like "for" would? Is there a value in using map vs for?
If so, right now my code looks like this:
for item in items:
item.my_func()
If it makes sense, I would like to make it map(). Is that possible? What is an example like?