value

Changing the values of variables in methods, Java

Hello, I have a questions about changing the values of variables in methods in Java. I have the following example class: public class Test { public static void funk(int a, int[] b) { b[0] = b[0] * 2; a = b[0] + 5; } public static void main(String[] args) { int bird = 10; int[] tiger = {7}; T...

What is the type of the 'value' reserved word in C# properties

I am wondering what type the 'value' keyword in a property takes. so: public class Test { string _numberAsString; int _number = -1; public Test() {} public string NumberAsString { get { return _numberAsString; } set { _numberAsString= value; } } public int Number { get { return...

least 'worth it' unit test you've ever written?

On the SO blog and podcast Joel and Jeff have been discussing the, often ignored, times when unit testing a particular feature simply isn't worth the effort. Those times when unit testing a simple feature is so complicated, unpredictable, or impractical that the cost of the test doesn't reflect the value of the feature. In Joel's case,...

default value of a variable at the time of declaration in C# and VB ??

Can anybody tell me what is the default value of a variable at the time of declaration in C# and vb?? ...

Effect of casting to int in C#

Could someone take the time to explain me the language underpinnings here : int foo = myObject.SomeList.Count; for (int i = 0 ; i < foo ; i++) { myObject.SomeList.Add(bar); } goes into an infinite loop because foo references a value that keeps being incremented. Modifying the first line to: int foo = (int)myObject.SomeList.Count; ...

Default value of a property

Hi, If you have an object like this: public class Foo { private int _id; public int id { get { return _id; } set { _id = value; } } private string _name; public string name { get { return _name; } set { _name = value; } } } And you want to initialize id to -1 and name to String.Empty what is the best practice? (an...

Problem getting Javascript variable to hidden input value

Hi, I'm trying to create a system where you can drag and resize divs (jquery ui) and then save the positions and sizes to a css file. I already got the system working with one div, but now that I tried to update the system to support multiple divs, I ran into a problem. The source: http://ezmundorf.110mb.com/problem.txt (It's ugly, but...

Get ListItem Values using JQuery

I'm trying to use JQuery to get the values of the ListItems in an unordered list (see below). The code below is close to working, but it always returns the value of the first ListItem, even if the second one is checked. Thanks, Russ. $(document).ready(function() { $("li").click(function() { $("input:checked")....

How might I implement immediate text submission when the enter key is pressed in a textarea?

Duplicate: Submitting data from textarea by hitting “Enter”. I've got a textarea and a submit button: <textarea id="chat"></textarea> <input type="submit" value="Submit" onclick="send_msg();"> The value of the of the texarea is submitted when Enter is hit: textarea.onkeyup = function(e) { alert(e.keyCode); ...

disable value in s:select

Hi, if I have a for example this struts tag: <s:select name="country.id" list="countries" listValue="name" listKey="id" headerValue="Select Country" headerKey="" label="Country" /> output is the following html code: <select name="country.id" tabindex="12" id="registration_country"> <option value="">Select Country</option> <opt...

Property Name and need its value

I have a name of a property and need to find its value within a Class, what is the fastest way of getting to this value? ...

determine if a wpf dependencyproperty value is inherited

Does anyone know how to determine if the value of a WPF property is inherited? In particular, I'm trying to determine if the DataContext of a FrameworkElement was inherited from the parent or set directly on the element itself. Thanks, - Mike ...

C# - Capture incoming Argument Values in KeyValuePair Array

Hi, I am wondering how I can fetch the incoming arguments of my method in an array. Or just retrieve the values of my arguments dynamicly. Meaning, a call like: MyMethod(10, "eleven"); For method: void MyMethod(int Test, str Test2) {} Would resolve in an array like: {{"Test" => 10}, {"Test2", "eleven"}} Would be even better if I cou...

Overriding an attribute in Rails and getting at the underlying value.

For the life of me, I can't figure out how to do this. I have a model for which the stored value is a path to a resource on the file system. I'd like the model to write and fetch the resource from the file system, so I naturally want to override the getter and setters to do this. How do I then get at the underlying value that's in the db...

when the gridview is set to display values from session arraylist "array" the following error is shown "Object must implement IConvertible." in c#

when the user selects "add to cart" the itemID of that row item is added to arraylist which is then stored in a session. in the shopping cart page ive got a gridview which reads name, price from item db where session["array"]=itemID the error is displayed when the shopping cart page loads. all i want to do is to get the list of items ...

Programmatically Search an Access Listbox control's Items Based Off of a Textbox Entry

I don't know if this is possible, but I am trying to code an Access textbox that will act as a search engine entry control for a database. Specifically, I wanted to add mulitple, non-visible, listboxes to a form, and have them filled with table or query data. When ever an end-user enters a search word in the textbox and presses search,...

dotnet:is there any way out to directly get reference of value collection in dictionary?

i want to sort dictionary based upon value of each dictioanry item.but if i use sorted dictionary search time complexity will increase from constant to log2(n).so i want to directly assign reference of value list in dictionary to a list.then i can sort this list and get results.i dont want to iterate to each element of dictionary to add ...

xaml Application Resource Value

I want to set an application wide Value i.e. TextHeight (others as well) and I can't seem to find a reference. IOW, set the Text Height to a StaticResource in various styles, etc. TIA ...

int to std::string?

I have following code: Tools::Logger.Log(string(GetLastError()), Error); GetLastError() returns a DWORD a numeric value, but the constructor of std::string doesnt accept a DWORD. What can I do? thanks in advance ...

What is the value of software

It seems the value of most technology has depreciated to 'nothing.' Is it that the cost of developing supposed "technology" has been drastically lowered to where it is a commodity for the taking? Is it that the sum of all human knowledge is now readily available for study (Internet)? The software I write at work seems to be valuable i...