Search Results

Search found 45581 results on 1824 pages for 'value objects'.

Page 11/1824 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Combining lists of objects containing lists of objects in c#

    - by Dan H
    The title is a little prosaic, I know. I have 3 classes (Users, Cases, Offices). Users and Cases contain a list of Offices inside of them. I need to compare the Office lists from Users and Cases and if the ID's of Offices match, I need to add those IDs from Cases to the Users. So the end goal is to have the Users class have any Offices that match the Offices in the Cases class. Any ideas? My code (which isnt working) foreach (Users users in userList) foreach (Cases cases in caseList) foreach (Offices userOffice in users.officeList) foreach (Offices caseOffice in cases.officeList) { if (userOffice.ID == caseOffice.ID) users.caseAdminIDList.Add(cases.adminID); }//end foreach //start my data classes class Users { public Users() { List<Offices> officeList = new List<Offices>(); List<int> caseAdminIDList = new List<int>(); ID = 0; }//end constructor public int ID { get; set; } public string name { get; set; } public int adminID { get; set; } public string ADuserName { get; set; } public bool alreadyInDB { get; set; } public bool alreadyInAdminDB { get; set; } public bool deleted { get; set; } public List<int> caseAdminIDList { get; set; } public List<Offices> officeList { get; set; } } class Offices { public int ID { get; set; } public string name { get; set; } } class Users { public Users() { List<Offices> officeList = new List<Offices>(); List<int> caseAdminIDList = new List<int>(); ID = 0; }//end constructor public int ID { get; set; } public string name { get; set; } public int adminID { get; set; } public string ADuserName { get; set; } public bool alreadyInDB { get; set; } public bool alreadyInAdminDB { get; set; } public bool deleted { get; set; } public List<int> caseAdminIDList { get; set; } public List<Offices> officeList { get; set; } }

    Read the article

  • Objective PHP and key value coding

    - by Lukasz
    Hi Guys. In some part of my code I need something like this: $product_type = $product->type; $price_field = 'field_'.$product_type.'_price'; $price = $product->$$price_field; In other words I need kind of KVC - means get object field by field name produced at the runtime. I simply need to extend some existing system and keep field naming convention so do not advice me to change field names instead. I know something like this works for arrays, when you could easily do that by: $price = $product[$price_field_key]. So I can produce key for array dynamically. But how to do that for objects? Please help me as google gives me river of results for arrays, etc... Thank you

    Read the article

  • Hibernate Query for a List of Objects that matches a List of Objects' ids

    - by sal
    Given a classes Foo, Bar which have hibernate mappings to tables Foo, A, B and C public class Foo { Integer aid; Integer bid; Integer cid; ...; } public class Bar { A a; B b; C c; ...; } I build a List fooList of an arbitrary size and I would like to use hibernate to fetch List where the resulting list will look something like this: Bar[1] = [X1,Y2,ZA,...] Bar[2] = [X1,Y2,ZB,...] Bar[3] = [X1,Y2,ZC,...] Bar[4] = [X1,Y3,ZD,...] Bar[5] = [X2,Y4,ZE,...] Bar[6] = [X2,Y4,ZF,...] Bar[7] = [X2,Y5,ZG,...] Bar[8] = ... Where each Xi, Yi and Zi represents a unique object. I know I can iterate fooList and fetch each List and call barList.addAll(...) to build the result list with something like this: List<bar> barList.addAll(s.createQuery("from Bar bar where bar.aid = :aid and ... ") .setEntity("aid", foo.getAid()) .setEntity("bid", foo.getBid()) .setEntity("cid", foo.getCid()) .list(); ); Is there any easier way, ideally one that makes better use of hibernate and make a minimal number of database calls? Am I missing something? Is hibernate not the right tool for this?

    Read the article

  • Dropdownmenu SELECTED value as per value return fromDB

    - by Faizan Qadri
    All i am trying to do is to set the selected value of drop down menu according to the particular value returned from the database like if person saved his gender as 'Male' and he wants to update his profile then the selected option shown on the Gender's dropdown llist should be shown as Male cause if this doesn't happen 'Poor guy becomes a female due to this small problem in my code' KINDLY HELP!!!!!!! MY Current Code: <select name="Gender" id="Gender"> <option selected="selected"><?php echo $row_Recordset1['Gender']; ?></option> <option value="Male">Male</option> <option value="Female">Female</option> </select> The above code work fine but causes repitition of values in dropdown like Male Male Female

    Read the article

  • creating BeanInfo objects in NetBeans 6.1 does not work for some objects

    - by Coder
    I have recently learned about BeanInfo classes in Java, and have successfully used them to add icons to my custom GUI components which extend swing components such as JTextField, however i have a more specialized GUI component which extends from another one of my GUI components, which then extends from JTextField. Ie. the class hierarchy is of the form "A - B - JTextField". I can create a bean info object that works for class B, but when i click on the bean info editor option in netbeans to create a bean info object for class A, nothing happens. Ie. there is no error pop-up and a bean info object is not created. There isn't much difference between class A and B. Both A and B have default no argument constructors and they are very similar to each other. The only thing i can really think of is that A uses generics and B does not. I would like to create a beaninfo object for class A so that i can add custom icons for that component. Any help would be appreciated. Thanks.

    Read the article

  • Convert Qcolor value to hex value

    - by vettipayyan
    I have implemented a Qcolor dialog box which opens on certain condition. To get the selected color after final selection i use the method selectedColor() which returns the value in QColor . When i print that value , it's like this : <PyQt4.QtGui.QColor object at 0x01DD7880> I want color value in hex value . like this : #DFDFDF (for grey ). If it's not hex , correct me. Is there any function to convert that? Any suggestions welcome .

    Read the article

  • XUL: Printing value from SQL query without using value attribute

    - by Grip
    I want to print the results of an SQL query in XUL with word-wrapping using the description tag. I have the following code: <grid> <columns> <column flex="2" /> <column flex="1" /> </columns> <rows datasources="chrome://glossary/content/db/development.sqlite3" ref="?" querytype="storage" > <template> <query>select distinct * from Terms</query> <action> <row uri="?"> <description value="?name" /> <description value="?desc" /> </row> </action> </template> </rows> This works for printing the data, but since I'm using the value attribute of description, there's no word-wrapping. I don't understand entirely what I'm doing with the value attribute, but I don't seem to be able to get the values of my SQL query in any other way. So, how could I get those values without the value tag? Thanks.

    Read the article

  • Autocad 2014 - Positioning electrical objects for plans (icons and symbols, not actual objects)

    - by zazkapulsk
    I am using Autocad to design my home. I am at a phase where I want to set the location for the switches, lighting fixtures, power sockets, communication sockets etc. I am thinking of something like this http://www.the-house-plans-guide.com/electrical-blueprint-symbols.html. I am not interested in placing specific lighting fixtures or rendering them, just putting the symbol and distances for the symbol. I can use Autocad Electrical, but that's a GIANT overshoot. What am I missing? Thanks.

    Read the article

  • Passing input value thru XML loop and return value

    - by Mike Dyer
    "X" is reading the form value, but it is still passing and older "var thisMarket" value. The objective is to take a zip code via HTML form: <form id="market" name="market" onSubmit="return validateZIP(this.zip.value);" method="get" action=""> <input type="text" name="zip" id="zip" value="zipcode" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;" style="float:left; width:100px; margin-top:5px;"> <input type="image" style="float:left; margin-top:5px; border: 0pt none ; width: 22px; height:17px;" src="images/nav/bottom/linkbar/btn_search_btn.gif" onClick="findLda();"> </form> The script being passed thru is: function findLda(x){ marketName = new Array(); marketURL = new Array(); zip = new Array(); zip_temp = new Array(); zipMatch = false; var shareZip = "Shared Zips"; var thisMarket = "Market value"; xmlDoc=loadXML("/_includes/market.xml"); var Offer,node; document.getElementById('market').innerHTML=''; for(var j=0; j<xmlDoc.getElementsByTagName('market').length; j++){ node = xmlDoc.getElementsByTagName('market')[j]; marketName.push(node.childNodes[3].textContent); marketURL.push(node.childNodes[5].textContent); for(var k=0; k<node.getElementsByTagName('zip').length; k++){ if(node.getElementsByTagName('zip')[k].textContent!=null){ zip_temp.push(node.getElementsByTagName('zip')[k].textContent); } } zip.push(zip_temp); zip_temp = new Array(); } //loop the zip Array to find a match for the query Zip. for(k=0; k<zip.length; k++){ for(m=0; m<zip[k].length; m++){ if(x == zip[k][m].toString()){ zipMatch=true; thisMarket=marketName[k].toString(); } } } alert(thisMarket); } The objective naturally is to take field input (A), pass it thru market.xml - initialize a loop and match a zip (B), alert the result (C). Looking for any direction with what is existing or a completely new direction. Thanks!

    Read the article

  • Java HashSet key/value pair

    - by harley
    Why does Java not provide functions to get at the key/value pairs in a HashSet like in Hashtable? It seems like a real pain to have to iterate over it every time you need to get at something. Or am I just a newb missing something?

    Read the article

  • JQuery ajax call default timeout value

    - by Marcus
    I got a bug report that I can't duplicate, but ajax-call timeout is the current best guess. So I'm trying to find out the default value for timeout of a jQuery $.ajax() call. Anybody have an idea? Couldn't find it in jQuery documentation. Thanks in advance, Marcus

    Read the article

  • pass by reference or pass by value?

    - by Sven
    When learning a new programming language, one of the possible roadblocks you might encounter is the question whether the language is, by default, pass-by-value or pass-by-reference So here is my question to all of you, in your favorite language, how is it actually done? and what are the possible pitfalls? your favorite language can, of course, be anything you have ever played with: popular, obscure, esoteric, new, old ...

    Read the article

  • Ajax jquery async return value

    - by Sonny
    Hi, how can i make this code to don't pause the browser but still return value. You can rewrite this with new method of course. function get_char_val(merk) { var returnValue = null; $.ajax({ type: "POST", async: false, url: "char_info2.php", data: { name: merk }, dataType: "html", success: function(data) { returnValue = data; } }); return returnValue; } var px= get_char_val('x'); var py= get_char_val('y');

    Read the article

  • Using NHibernate to insert/update using a SQL server-side DEFAULT value

    - by Joseph Daigle
    Several of our database tables contain LastModifiedDate columns. We would like these to stay synchronized based on a single time-source. Our best time-source, in this case, is the SQL Server itself since there is only one database server but multiple application servers which could potentially be off sync. I would like to be able to use NHibernate, but have it use either GETUTCDATE() or DEFAULT for the column value when updating or inserting rows on these tables. Thoughts?

    Read the article

  • Default value of a type

    - by viky
    For any given type i want to know its default value. In C#, there is a keyword called default for doing this like object obj = default(Decimal); but I have an instance of Type (called myType) and if I say this, object obj = default(myType); it doesn't work Is there any good way of doing this? I know that a huge switch block will work but thats not a good choice.

    Read the article

  • jQuery find by value

    - by Happy
    There is a link with title and some value: <a href="http://site.com/someid/" title="Use ctrl + >">next</a> How to find this link and throw its href attribute to some variable?

    Read the article

  • How to get the top keys from a hash by value

    - by Kirs Kringle
    I have a hash that I sorted by values greatest to least. How would I go about getting the top 5? There was a post on here that talked about getting only one value. What is the easiest way to get a key with the highest value from a hash in Perl? I understand that so would lets say getting those values add them to an array and delete the element in the hash and then do the process again? Seems like there should be an easier way to do this then that though. My hash is called %words. use strict; use warnings; use Tk; #Learn to install here: http://factscruncher.blogspot.com/2012/01/easy-way-to-install-tk- on-strawberry.html #Reading in the text file my $file0 = Tk::MainWindow->new->Tk::getOpenFile; open( my $filehandle0, '<', $file0 ) || die "Could not open $file0\n"; my @words; while ( my $line = <$filehandle0> ) { chomp $line; my @word = split( /\s+/, lc($line)); push( @words, @word ); } for (@words) { s/[\,|\.|\!|\?|\:|\;|\"]//g; } #Counting words that repeat; put in hash my %words_count; $words_count{$_}++ for @words; #Reading in the stopwords file my $file1 = "stoplist.txt"; open( my $filehandle1, '<', $file1 ) or die "Could not open $file1\n"; my @stopwords; while ( my $line = <$filehandle1> ) { chomp $line; my @linearray = split( " ", $line ); push( @stopwords, @linearray ); } for my $w ( my @stopwords ) { s/\b\Q$w\E\B//ig; } #Comparing the array to Hash and deleteing stopwords my %words = %words_count; for my $stopwords ( @stopwords ) { delete $words{ $stopwords }; } #Sorting Hash Table my @keys = sort { $words{$b} <=> $words{$a} or "\L$a" cmp "\L$b" } keys %words; #Starting Statistical Work my $value_count = 0; my $key_count = 0; #Printing Hash Table $key_count = keys %words; foreach my $key (@keys) { $value_count = $words{$key} + $value_count; printf "%-20s %6d\n", $key, $words{$key}; } my $value_average = $value_count / $key_count; #my @topwords; #foreach my $key (@keys){ #if($words{$key} > $value_average){ # @topwords = keys %words; # } #} print "\n", "The number of values: ", $value_count, "\n"; print "The number of elements: ", $key_count, "\n"; print "The Average: ", $value_average, "\n\n";

    Read the article

  • Updating a TextView with a SeekBar's value (ultra-slow)

    - by Peter Bjorn
    Now look at that! I am having trouble with one of the simplest goals: updating a plain TextView with the value of a SeekBar. This is my approach: @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { if (fromUser) { mInfoText.setText(mFunction.getUserFriendlyString(progress)); } } It basically works, but it kind of blocks the whole UI when I'm dragging. (Note: I tried both View.post() and Activity.runOnUiThread()). Am I overlooking something?

    Read the article

  • Get value of "data"

    - by Nicole Loyal-Windham
    Hi, I need to figure out the value of data strings with jquery, for example like this: { label: "Beginner", data: 2}, { label: "Advanced", data: 12}, { label: "Expert", data: 22}, to add them up. Something like: var sum = data1+data2+data3; alert(sum); So the result for this example would be 36. Appreciate your help! Nicole

    Read the article

  • HTML Option Tag with Value set as an Anchor

    - by Craig
    Hello, I am updating some super legacy code and I am unsure how to make this HTML5 compatible. <option value='<a href='http://localhost:8080/dm?id=&#037;&#037;SUBSCRIBER_ID_TAG&#037;&#037;'>View in a browser window</a>'>Display Message(HTML Version)</option> I personally have never run across something like that so any help would be great.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >