Search Results

Search found 4775 results on 191 pages for 'databound lists'.

Page 19/191 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Arrays/Lists and computing hashvalues (VB, C#)

    - by Jeffrey Kern
    I feel bad asking this question but I am currently not able to program and test this as I'm writing this on my cell-phone and not on my dev machine :P (Easy rep points if someone answers! XD ) Anyway, I've had experience with using hashvalues from String objects. E.g., if I have StringA and StringB both equal to "foo", they'll both compute out the same hashvalue, because they're set to equal values. Now what if I have a List, with T being a native data type. If I tried to compute the hashvalue of ListA and ListB, assuming that they'd both be the same size and contain the same information, wouldn't they have equal hashvalues as well? Assuming as sample dataset of 'byte' with a length of 5 {5,2,0,1,3}

    Read the article

  • How to count children from different lists? [jQuery]

    - by Filip Breckx
    Hi, I'm trying to count the number of child elements a certain category has. This is the situation: <ul id="select_cat"> <li id="_1">Category 1 (<span>#</span>)</li> <li id="_2">Category 2 (<span>#</span>)</li> </ul> <ul id="cat_1> <li>Link 1</li> <li>Link 2</li> <li>Link 3</li> </ul> <ul id="cat_2"> <li>Link 1</li> <li>Link 2</li> </ul> So I want to count the number of children a category has. In this example the first cardinal sign should be 3, and the second should be 2. How can I do this, using jQuery. Check an example (not jQuery) Thanks!

    Read the article

  • Changing style of latex description lists.

    - by Halpo
    This should be an easy question for someone out there. I have a description list \begin{description} \item[Name:] Halpo \item[Email Address:] [email protected] \item[Address:] 1234 Ivy Ln \\ Springfield, USA \end{description} It comes back as Name: Halpo Email Address: [email protected] Address: 1234 Ivy Ln Springfield, USA This is for an official document that has style requirements. The First thing is how do I turn off the bold? second how do I have all the text line up with the item labels and still be left justified?

    Read the article

  • Accessing generic lists with delegate notation

    - by n0vic3c0d3r
    I see some people write: //wordList is List<string> wordList.ForEach(delegate(string word){ Console.WriteLine(word);}); instead of: foreach(string word in wordList) { Console.WriteLine(word); } What is the advantage in doing so. Also I couldn't fathom the Action delegate syntax given above though I have used delegates in C# 2.0. Basically I am not able to relate the syntax with the concept of delegates I am familiar with. Can you please help me understand the syntax. Is it some shorthand?

    Read the article

  • Java - Layering issues with Lists and Graphics2D

    - by Mirrorcrazy
    So I have a DisplayPanel class that extends JPanel and that also paints my numerous images for my program using Graphics2D. In order to be able to easily customly use this I set it up so that every time the panel is repainted it uses a List, that I can add to or remove from as the program processes. My problem is with layering. I've run into an issue where the List must have reached its resizing point (or something whacky like that) and so the images i want to display end up beneath all of the other images already on the screen. I've come to the community for an answer because I have faith you will provide a good one. DisplayPanel: package earthworm; import java.awt.Graphics; import java.awt.Graphics2D; import java.util.ArrayList; import java.util.List; import javax.swing.JPanel; public class DisplayPanel extends JPanel { private List<ImageMap> images = new ArrayList(); public DisplayPanel() { setSize(800, 640); refresh(); } public void refresh() { revalidate(); repaint(); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); Graphics2D g2d = (Graphics2D) g; g2d.clearRect(0, 0, 800, 640); for(int i = 0; i < images.size(); i++) g2d.drawImage( images.get(i).getImage(), images.get(i).getX(), images.get(i).getY(), null); } public void paintImage(ImageMap[] images, ImageMap[] clearImages, boolean clear) { if(clear) this.images.clear(); else if(clearImages!=null) for(int i = 0; i < clearImages.length; i++) this.images.remove(clearImages[i]); if(images!=null) for(int i = 0; i<images.length; i++) this.images.add(images[i]); refresh(); } }

    Read the article

  • Are NHibernate lists loaded on demand?

    - by André Pena
    This is a pretty simple question. When I do this: session.CreateCriteria(typeof(Product)).List(); The resulting list will load as I access it? Let's say, from 100 to 100 elements for example? Or will it load all once? In the case it's not "virtual" how can I make it so? What's the best pratice about it? Thanks;

    Read the article

  • jQuery way to handle select lists, radio buttons and checkboxes

    - by Álvaro G. Vicario
    When I handle HTML form elements with jQuery, I always end up with an ugly mix of jQuery syntax and plain JavaScript like, e.g.: function doStuff($combo){ if( $combo.get(0).options[$combo.get(0).selectedIndex].value=="" ){ var txt = ""; }else{ var txt = $combo.get(0).options[$combo.get(0).selectedIndex].text; } var $description = $combo.closest("div.item").find("input[name$=\[description\]]"); $description.val(txt); } Are there standard jQuery methods to handle typical operations on elements like <select>, <input type="radio"> and <input type="checkbox">? With typical, I mean stuff like reading the value of the selected radio button in a group or replacing elements in a selection list. I haven't found them in the documentation but I admit that method overloading can make doc browser kind of tricky.

    Read the article

  • Create a WebPart which displays people who have rights on lists

    - by cocoggu
    I want to develop a WebPart in C# to display peoples who have a certain right on the list of the SharePoint page. So I began by creating a "Visual Web Part" in VS2010, and in the View Designer I add a DataList because I think it is the most relevant. But now, I don't know how to link my data with this DataList. It ask me for an XML file but which one choose ? And where can I take it ? After all, how to make this WebPart generic with all my SharePoint pages which implements one list ?

    Read the article

  • Left floated element and unordered lists (ul).

    - by superUntitled
    Hello, I am trying to indent the li elements of a ul. There is a left floated div with an image in it. The li element will indent only if I add left padding that is wider than the image itself. I you would like to look at a version irl, take a look. On this page, I have given the li a background color to demonstrate. <div class="left"> <p ><img src='image.jpg' alt='homepage.jpg' width="360" height="395" /></p> </div> <p> Est tincidunt doming iis nobis nibh. Ullamcorper eorum elit lius me delenit. </p> <hr /> <h3>Lorem</h3> <ul> <li>list element</li> <li>list element</li> <li>list element</li> </ul> The css: .left {float: left; } .left img {padding-right: 20px;} ul li { padding-left: 10px; background: blue; } thanks!

    Read the article

  • Reordering Lists like playlists in the media player

    - by CrazyBS
    Hi, I have a list of items that are displayed using a ListView from a SQLCursor. The SQL table includes(as well as other things) a _id field and an order field. I use the order field to sort the list before it gets to the ListView. What I need is a widget like the MediaPlayer has in its playlist view. It allows you to click the icon and drag the item in the playlist around and put it into a new order. With that ability I can then retrieve the new order and update the SQL table with the new order. However, I am not having any luck finding any clues to help me add that functionality into my program. The question is whether I can use existing functions to help me, or do I need to manually program motion events and such until I get nearly the same functionality.

    Read the article

  • Finding greatest product of two lists, but keep getting #unspecific

    - by user1787030
    (define (greatest-product lst1 lst2) (define (helper lst addtimes total toacc) (cond ((null? lst) '()) ((= (countatoms lst) 1) (display total)) ((= addtimes (cadr lst)) (helper (cdr lst) 1 total total)) (else (helper lst (+ 1 addtimes) (+ toacc total) toacc)))) (cond ((> (helper lst1 0 0 (car lst1)) (helper lst2 0 0 (car lst2))) (helper lst1 0 0 (car lst1))) ((< (helper lst1 0 0 (car lst1)) (helper lst2 0 0 (car lst2))) (helper lst2 0 0 (car lst2))) ((= (helper lst1 0 0 (car lst1)) (helper lst2 0 0 (car lst2))) (display 'equal)))) Scheme keeps returning back that it cannot perform the procedure with #unspecific Im running it with (display (greatest-product '(1 2 3) '(4 5 6))) (display (greatest-product '(1 2 3) '(1 2 3))) (display (greatest-product '(1 2 3) '())) what is wrong with it? the problem seems to be occurring

    Read the article

  • C++ stl collections or linked lists

    - by Lucas
    I'm developing a OpenGL based simulation in C++. I'm optmizing my code now and i see throughout the code the frequently use of std:list and std:vector. What is the more performatic: to continue using C++ stl data structs or a pointer based linked list? The main operation that involve std::list and std::vector is open a iterator and loop through all items in the data structs and apply some processing

    Read the article

  • Handling very large lists of objects without paging?

    - by user246114
    Hi, I have a class which can contain many small elements in a list. Looks like: public class Farm { private ArrayList<Horse> mHorses; } just wondering what will happen if the mHorses array grew to something crazy like 15,000 elements. I'm assuming that trying to write and read this from the datastore would be crazy, because I'd get killed on the serialization process. It's important that I can get the entire array in one shot without paging, and each Horse element may only have two string properties in it, so they are pretty lightweight: public class Horse { private String mId; private String mName; } I don't need these horses indexed at all. Does it sound reasonable to just store the mHorse array as a raw Text field, and force my clients to do the deserialization? Something like: public class Farm { private Text mHorsesSerialized; } then whenever the client receives a Farm instance, it has to take the raw string of horses, and split it in order to reinstantiate the list, something like: // GWT client perhaps Farm farm = rpcCall.getMyFarm(); String horsesSerialized = farm.getHorses(); String[] horseBlocks = horsesSerialized.split(","); for (int i = 0; i < horseBlocks.length; i++) { // .. continue deserializing the individual objects ... } yeah... so hopefully it would be quick to read a Farm instance from the datastore, and the serialization penalty is paid by the client, Thanks

    Read the article

  • c++ lists question

    - by mousey
    I want put a value from front of the list into an another list but I am getting an error. for exmaple List<int> li; List<int> li2; ............. ............. li2.push_back(li.front()); // this statement doesnt work for me. Can someone please help me. example code: list li; list li2; li.push_back(1); li.push_back(2); li.push_back(3); for(int i=0;i<3;i++) { cout<<li.front()<<endl; li2.push_back(li.pop_front()); }

    Read the article

  • Databinding and Lists in instances of classes

    - by Younes
    I have initialised an instance of a class i have called "Relation" this class also contains a list of "Bills". When i databind this information to a grid, the Relations are showing, tho the Bills ain't. The Relation information is returning in a List and the Bills are inside. Relation cRelation = new Relation(); List<tRelation> relationList = cRelation.getRelations(); a relation has: relation.Bills <== List<tBills>; How to make sure that the list inside the list is also getting showed in the Datagrid?

    Read the article

  • Implement two lists in ExtJS

    - by Anandan
    Hi, I am new to ExtJS. I want to implement two tables. First one will have list of possible items to select. Second one can be empty. I will have 4 buttons in between the two tables as "move this item left", "move all to left", "move all to right" and "move this to right". Which component should i use to implement this? Regards, Anandan

    Read the article

  • Create comma separated string from 2 lists the groovy way

    - by Micor
    What I have so far is: def imageColumns = ["products_image", "procuts_subimage1", "products_subimage2", "prodcuts_subimage3", "products_subimage4"] def imageValues = ["1.jpg","2.jpg","3.jpg"] def imageColumnsValues = [] // only care for columns with values imageValues.eachWithIndex { image,i -> imageColumnsValues << "${imageColumns[i]} = '${image}'" } println imageColumnValuePair.join(", ") It works but I think it could be better. Wish there was a collectWithIndex ... Any suggestions?

    Read the article

  • Understanding prolog [lists]

    - by wwrob
    I am to write a program that does this: ?- pLeap(2,5,X,Y). X = 2, Y = 3 ; X = 3, Y = 4 ; X = 4, Y = 5 ; X = 5, Y = 5 ; false. (gives all pairs X,X+1 between 2 and 5, plus the special case at the end). This is supposedly the solution. I don't really understand how it works, could anyone guide me through it? pLeap(X,X,X,X). pLeap(L,H,X,Y) :- L<H, X is L, Y is X+1. pLeap(L,H,X,Y) :- L=<H, L1 is L+1, pLeap(L1,H,X,Y). I'd do it simply like this: pLeap(L,H,X,Y) :- X >= L, X =< H, Y is X+1. Why doesn't it work (ignoring the special case at the end)?

    Read the article

  • LINQ: display results from empty lists

    - by Douglas H. M.
    I've created two entities (simplified) in C#: class Log { entries = new List<Entry>(); DateTime Date { get; set; } IList<Entry> entries { get; set; } } class Entry { DateTime ClockIn { get; set; } DateTime ClockOut { get; set; } } I am using the following code to initialize the objects: Log log1 = new Log() { Date = new DateTime(2010, 1, 1), }; log1.Entries.Add(new Entry() { ClockIn = new DateTime(0001, 1, 1, 9, 0, 0), ClockOut = new DateTime(0001, 1, 1, 12, 0, 0) }); Log log2 = new Log() { Date = new DateTime(2010, 2, 1), }; The method below is used to get the date logs: var query = from l in DB.GetLogs() from e in l.Entries orderby l.Date ascending select new { Date = l.Date, ClockIn = e.ClockIn, ClockOut = e.ClockOut, }; The result of the above LINQ query is: /* Date | Clock In | Clock Out 01/01/2010 | 09:00 | 12:00 */ My question is, what is the best way to rewrite the LINQ query above to include the results from the second object I created (Log2), since it has an empty list. In the other words, I would like to display all dates even if they don't have time values. The expected result would be: /* Date | Clock In | Clock Out 01/01/2010 | 09:00 | 12:00 02/01/2010 | | */

    Read the article

  • Cleanest way to store lists of filter coefficients in a C header

    - by Nick T
    I have many (~100 or so) filter coefficients calculated with the aid of some Matlab and Excel that I want to dump into a C header file for general use, but I'm not sure what the best way to do this would be. I was starting out as so: #define BUTTER 1 #define BESSEL 2 #define CHEBY 3 #if FILT_TYPE == BUTTER #if FILT_ROLLOFF == 0.010 #define B0 256 #define B1 512 #define B2 256 #define A1 467 #define A2 -214 #elif FILT_ROLLOFF == 0.015 #define B0 256 #define B1 512 // and so on... However, if I do that and shove them all into a header, I need to set the conditionals (FILT_TYPE, FILT_ROLLOFF) in my source before including it, which seems kinda nasty. What's more, if I have 2+ different filters that want different roll-offs/filter types it won't work. I could #undef my 5 coefficients (A1-2, B0-2) in that coefficients file, but it still seems wrong to have to insert an #include buried in code.

    Read the article

  • Passing through lists from jQuery to the service

    - by thedixon
    I'm sure I've done this in another solution, but I can't seem to find any solution as to do it again and wondered if anyone can help me... This is my WebAPI code: public class WebController : ApiController { public void Get(string telephone, string postcode, List<Client> clients) { } } And, calling this from jQuery: function Client(name, age) { this.Name = name; this.Age = age; } var Clients = []; Clients.push(new Client("Chris", 27)); $.ajax({ url: "/api/Web/", data: { telephone: "999", postcode: "xxx xxx", clients: Clients } }); But the "clients" object always comes back as null. I've also tried JSON.stringify(Clients), and this is the same result. Can anyone see anything obvious I'm missing here?

    Read the article

  • Python lists/arrays: disable negative indexing wrap-around

    - by wim
    While I find the negative number wraparound (i.e. A[-2] indexing the second-to-last element) extremely useful in many cases, there are often use cases I come across where it is more of an annoyance than helpful, and I find myself wishing for an alternate syntax to use when I would rather disable that particular behaviour. Here is a canned 2D example below, but I have had the same peeve a few times with other data structures and in other numbers of dimensions. import numpy as np A = np.random.randint(0, 2, (5, 10)) def foo(i, j, r=2): '''sum of neighbours within r steps of A[i,j]''' return A[i-r:i+r+1, j-r:j+r+1].sum() In the slice above I would rather that any negative number to the slice would be treated the same as None is, rather than wrapping to the other end of the array. Because of the wrapping, the otherwise nice implementation above gives incorrect results at boundary conditions and requires some sort of patch like: def ugly_foo(i, j, r=2): def thing(n): return None if n < 0 else n return A[thing(i-r):i+r+1, thing(j-r):j+r+1].sum() I have also tried zero-padding the array or list, but it is still inelegant (requires adjusting the lookup locations indices accordingly) and inefficient (requires copying the array). Am I missing some standard trick or elegant solution for slicing like this? I noticed that python and numpy already handle the case where you specify too large a number nicely - that is, if the index is greater than the shape of the array it behaves the same as if it were None.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >