Search Results

Search found 4616 results on 185 pages for 'lists'.

Page 26/185 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • using '.each' method: how do I get the indexes of multiple ordered lists to each begin at [0]?

    - by shecky
    I've got multiple divs, each with an ordered list (various lengths). I'm using jquery to add a class to each list item according to its index (for the purpose of columnizing portions of each list). What I have so far ... <script type="text/javascript"> /* Objective: columnize list items from a single ul or ol in a pre-determined number of columns 1. get the index of each list item 2. assign column class according to li's index */ $(document).ready(function() { $('ol li').each(function(index){ // assign class according to li's index ... index = li number -1: 1-6 = 0-5; 7-12 = 6-11, etc. if ( index <= 5 ) { $(this).addClass('column-1'); } if ( index > 5 && index < 12 ) { $(this).addClass('column-2'); } if ( index > 11 ) { $(this).addClass('column-3'); } // add another class to the first list item in each column $('ol li').filter(function(index) { return index != 0 && index % 6 == 0; }).addClass('reset'); }); // closes li .each func }); // closes doc.ready.func </script> ... succeeds if there's only one list; when there are additional lists, the last column class ('column-3') is added to all remaining list items on the page. In other words, the script is presently indexing continuously through all subsequent lists/list items, rather than being re-set to [0] for each ordered list. Can someone please show me the proper method/syntax to correct/amend this, so that the script addresses/indexes each ordered list anew? many thanks in advance. shecky p.s. the markup is pretty straight-up: <div class="tertiary"> <h1>header</h1> <ol> <li><a href="#" title="a link">a link</a></li> <li><a href="#" title="a link">a link</a></li> <li><a href="#" title="a link">a link</a></li> </ol> </div><!-- END div class="tertiary" -->

    Read the article

  • How do I connect multiple sortable lists to each other in jQuery UI?

    - by Abs
    I'm new to jQuery, and I'm totally struggling with using jQuery UI's sortable. I'm trying to put together a page to facilitate grouping and ordering of items. My page has a list of groups, and each group contains a list of items. I want to allow users to be able to do the following: 1. Reorder the groups 2. Reorder the items within the groups 3. Move the items between the groups The first two requirements are no problem. I'm able to sort them just fine. The problem comes in with the third requirement. I just can't connect those lists to each other. Some code might help. Here's the markup. <ul id="groupsList" class="groupsList"> <li id="group1" class="group">Group 1 <ul id="groupItems1" class="itemsList"> <li id="item1-1" class="item">Item 1.1</li> <li id="item1-2" class="item">Item 1.2</li> </ul> </li> <li id="group2" class="group">Group 2 <ul id="groupItems2" class="itemsList"> <li id="item2-1" class="item">Item 2.1</li> <li id="item2-2" class="item">Item 2.2</li> </ul> </li> <li id="group3" class="group">Group 3 <ul id="groupItems3" class="itemsList"> <li id="item3-1" class="item">Item 3.1</li> <li id="item3-2" class="item">Item 3.2</li> </ul> </li> </ul> I was able to sort the lists by putting $('#groupsList').sortable({}); and $('.itemsList').sortable({}); in the document ready function. I tried using the connectWith option for sortable to make it work, but I failed spectacularly. What I'd like to do is have the every groupItemsX list connected to every groupItemsX list but itself. How should I do that?

    Read the article

  • How to convert linq entitySet AND CHILDREN to lists?

    - by Abe Miessler
    I ran into an error when trying to serialize a linq entitySet. To get around this i converted the entitySet to a list. The problem I have run into now is that it's child entity sets are not converting to a list and when I try to serialize the parent those are now throwing an error. Does anyone know of a way to convert a linq entitySet AND it's children to lists? p.s. I'm new to linq so if any of this dosn't make sense let me know

    Read the article

  • How to drag items between 2 sorted lists with jQuery?

    - by sa125
    Hi - I'm trying to implement drag/drop/sort between 2 list elements: <ul id="first"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> <ul id="second"> <li>item 4</li> <li>item 5</li> <li>item 6</li> </ul> Basically I just want to be able to pass items between the lists and sort the items in each list. What's the simplest way to implement this using jQuery?

    Read the article

  • Most efficent way to create all possible combinations of four lists in Python?

    - by Baresi
    I have four different lists. headers, descriptions, short_descriptions and misc. I want to combine these into all the possible ways to print out: header\n description\n short_description\n misc like if i had (i'm skipping short_description and misc in this example for obvious reasons) headers = ['Hello there', 'Hi there!'] description = ['I like pie', 'Ho ho ho'] ... I want it to print out like: Hello there I like pie ... Hello there Ho ho ho ... Hi there! I like pie ... Hi there! Ho ho ho ... What would you say is the best/cleanest/most efficent way to do this? Is for-nesting the only way to go?

    Read the article

  • In SICP exercise 2.26 using DrScheme, why does cons return a list, instead of a pair of lists?

    - by limist
    In SICP exercise 2.26, this Scheme code is given: (define x (list 1 2 3)) (define y (list 4 5 6)) Then this cons call is given: (cons x y) I expected a pair of lists would result, ((1 2 3) (4 5 6)) but the interpreter gives, ((1 2 3) 4 5 6) ...a list with 4 elements, the first being a list. Why is y treated differently? I've tried looking up other SICP answers for an explanation, but couldn't find something satisfactory. So could any Scheme/Lisp experts please shed some light on this aspect of cons? Thanks in advance for any insight.

    Read the article

  • How do I get Mathematica to thread a 2-variable function over two lists, using functional programmin

    - by Leah Wrenn Berman
    Lets say I have a function f[x_, y_], and two lists l1, l2. I'd like to evaluate f[x,y] where x runs over the list l1 and y runs over the list l2, and I'd like to do it without having to make all pairs of the form {l1[[i]],l2[[j]]}. (Motivation: I'm trying to implement some basic Haskell programs in Mathematica. In particular, I'd like to be able to code the Haskell program isMatroid::[[Int]]->Bool isMatroid b =and[or[sort(union(xs\\[x])[y]'elem'b|y<-ys]|xs<-b,ys<-b, xs<-x] I think I can do the rest of it, if I can figure out the original question, but I'd like the code to be Haskell-like. Any suggestions for implementing Haskell-like code in Mathematica would be appreciated.)

    Read the article

  • Why are difference lists more efficient than regular concatenation?

    - by Craig Innes
    I am currently working my way through the Learn you a haskell book online, and have come to a chapter where the author is explaining that some list concatenations can be ineffiecient: For example ((((a ++ b) ++ c) ++ d) ++ e) ++ f Is supposedly inefficient. The solution the author comes up with is to use 'difference lists' defined as newtype DiffList a = DiffList {getDiffList :: [a] -> [a] } instance Monoid (DiffList a) where mempty = DiffList (\xs -> [] ++ xs) (DiffList f) `mappend` (DiffList g) = DiffList (\xs -> f (g xs)) I am struggling to understand why DiffList is more computationally efficient than a simple concatenation in some cases. Could someone explain to me in simple terms why the above example is so inefficient, and in what way the DiffList solves this problem?

    Read the article

  • Can anyone help with java? Finding common nodes from two linked lists using recursion

    - by Dan
    I have to write a method that returns a linked list with all the nodes that are common to two linked lists using recursion, without loops. For example, first list is 2 - 5 - 7 - 10 second list is 2 - 4 - 8 - 10 the list that would be returned is 2 - 10 I am getting nowhere with this.. What I have been think of was to check each value of the first list with each value of the second list recursively but the second list would then be cut by one node everytime and I cannot compare the next value in the first list with the the second list. I hope this makes sense... Can anyone help?

    Read the article

  • Python - Flatten a dict of lists into unique values?

    - by Jonathan Vanasco
    I have a dict of lists in python: content = {88962: [80, 130], 87484: [64], 53662: [58,80]} I want to turn it into a list of the unique values [58,64,80,130] I wrote a manual solution, but it's a manual solution. I know there are more concise and more elegant way to do this with list comprehensions, map/reduce , itertools , etc. anyone have a clue ? content = {88962: [80, 130], 87484: [64], 53662: [58,80]} result = set({}) for k in content.keys() : for i in content[k]: result.add(i) # and list/sort/print just to compare the output r2 = list( result ) r2.sort() print r2

    Read the article

  • What's the proper way of importing option lists into an Android app?

    - by Scott
    I have been storing option lists for my Android app in a cloud table. For example, categories like "historical fiction","biography","science fiction", etc. I see the following pros and cons: Pro: I can make changes to the list without sending an app update to Google Play Not normalized - I can use the text in my other data tables instead of a reference ID Con: App needs to take time to download from the web each time (or at least check for changes) English only I believe the "proper" way to do this is the use the XML resource files. But I need to make sure the selection references correctly with my data. That is, my app needs to understand that "Poetry" and "Poesía" are the same thing. Is the correct thing to do: Forget about it since I'll never get to the point where I'm translating my app anyway Use a string-array and use the index (0...x) to know what the selection is Use a 2-dimensional string-array with a reference ID in the first column and the text in the second?

    Read the article

  • How do I avoid nesting forms when offering inline editing of lists with checkboxes for mass updates.

    - by adam
    A lot of sites offer the ability to edit lists of items inline as well as allowing multiple items to be selected via checkboxes and have an action performed all at once e.g. delete, mark as spam etc. But how do you implement this without violating html rules. I need one form for the checkboxes with individual submit_tags for the mass actions. But after a user clicks on an item in the list, another form via Ajax will be inserted within the checkbox form. How do I avoid doing this? I'm using rails and jQuery.

    Read the article

  • How would I initialize these two lists so that modifying one doesn't modify the other?

    - by Brandon
    I'm aware of why this is happening, but is there any way to do this without having to implement ICloneable or a Copy() method? Preferably .net 2.0, but 3.5 is fine if it is necessary. Essentially I'm trying to implement an undo method. In most cases I can just perform the reverse action in the Undo(), but for others that is not possible. So I want to keep two lists. One for the list of items that I will be modifying, and one for the original, unmodified list of items. This way if I need to do an undo, I just delete the modified items and replace them with the originals. Most of the ways I've tried to assign the _originalItems variable doesn't work, so what would I need to do? public MyClass(List<SelectedItems> selectedItems) { _selectedItems = new List<SelectedItems>(selectedItems); _originalItems = ?? }

    Read the article

  • How can I convert this string to list of lists?

    - by Phrixus
    Hi, what I'm trying to do is.. if a user types in [[0,0,0], [0,0,1], [1,1,0]] and press enter, the program should convert this string to several lists; one list holding [0][0][0], other for [0][0][1], and the last list for [1][1][0] I thought tuple thing would work out but no luck... :( I started phython yesterday -- (I'm C / C++ guy.) and cannot use the full advantages of this language... Does python have a good way to handle this? I need help~ :'(

    Read the article

  • How do I remove initial indents on numbered lists?

    - by Peter
    In Word 2007 I want all numbers in a numbered list to be down the LH margin in line with the paragraphs. When a numbered list is selected, the numbers 1,2,3 are indented by a default 0.63cm. Ctrl-Shift-M will shift this indent back to the left margin. How do I permanently remove that initial indent and save that change to the normal template so that all new documents have zero indent on a newly inserted numbered list? (Same issue in Word 2010)

    Read the article

  • Can Windows 7 Jump Lists be made to behave like menus when dragged out with a mouse?

    - by FocusStealer
    On a traditional menu, if you mousedown on the menu title, drag down, then release on a menu item, it will trigger that menu item immediately, e.g. in Notepad: Left mouse button down on File Drag down to New Release mouse button will start a new file without requiring an additional click. However, when dragging out a Jump List on Windows 7, you must additionally click the desired item to launch it. Is there any way to change this behavior?

    Read the article

  • ASA firewalls: how does stateful filtering affect my access lists?

    - by Nate
    Ok, so assume that I have an ingress access list that looks like this: access-list outside_in extended ip permit any X.Y.Z.1 eq 25 access-group outside_in in interface outside And I want to do egress filtering. I want to allow inside machines to respond on port 80, and I want to allow ports over 1024. Given that the firewall is statefull, do I need to have the rule access-list inside_in extended ip permit X.Y.Z.1 any eq 25 in my inside_in ACL, or can I get away with just access-list inside_in extended ip permit any any gt 1024 access-group inside_in in interface inside In other words, if I apply an egress access list, do I have to explicitly allow machines to respond to requests allowed by the ingress access list, or does the statefullness of the firewall handle that for me? Thanks!

    Read the article

  • Ldap access lists users even if user has no rights...

    - by Patkos Csaba
    I am trying to set up a more complex Active Directory structure for some testing purposes. What I did so far: set up 2 windows (one 2008 and one 2003) to control the same domain set up an Organizational Unit (ou): Developers set up 2 child OUs: "one" and "two" each OU has it's admin: adminOne and adminTwo I denied all access to OU "two" by removing on the Security tab all the groups I don't want to access it. now, when I log in as adminOne and I try to click on OU "two" it says I don't have permissions to see the users and properties of "two" - this is perfect, it's what I want Here comes my problem: I do a LDAP query with the adminOne user on the "Developers" What I expect to happen: I expect to retrieve the users from Developer - One I expect to NOT be able to retrieve the users from Developers - Two What actually happens: ldap shows all the users, both from Developers - One and Developers - Two, even if the user should not have permissions to Developers - Two And now my question: is there any specific settings on Windows 2003 or 2008 Active Directory servers which allow or deny access over LDAP? I could not find any.

    Read the article

  • How to I create a user that is allowed to only add/remove users to distribution lists in Active Directory?

    - by Sorin Sbarnea
    I do have a third party product (Jira) that has Active Directory integration via LDAP. I want to enable Jira administrators to edit group memberships and have them syncronized inside Active Directory. This currently works but I needed to use a Domain Administrator service account in order to do this. The question is how can I do this without giving the entire Domain Administrator permission to the service account.

    Read the article

  • what is the purpose of the files in this directory: /var/lib/apt/lists?

    - by Magpie
    linux lubuntu HD4000 intel ivy-bridge 8gb 1600 ram. I am getting a duplicate entry error message from synaptic package manager and it says the problem is there. I am wondering a few things: What this directory is. Whether it safe to simply delete the offending duplicates from there. Whether this is a useful new discovery... Is this where all the packages I have no use for end up and something I can edit to suit my fancy in the long run? It would be nice to be able to reduce the clutter in my package manager. Especially find a way to get rid of all the 32 bit stuff or older versions of programs I have downloaded manually elsewhere. I had meant to post this in linux! So if this is wrong place let me know and I will move it there!

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >