Is it slower to iterate through a list in Java like this:
for (int i=0;i<list.size();i++) {
.. list.get(i)
}
as opposed to:
for (Object o: list) {
... o
}
Back again with a javascript question within sharepoint. I would like to hide a list temporarly while my javascript code is running. So lets say I have a to do list.
Hide the list
I run my javascript code (doesn't matter what it is, so plz don't ask).
Show the list
I know how to do it with a calendarview but not listview yet:
HIDE CALENDAR--$(".ms-cal-gempty").hide();
I've been looking for something very simple: How to make a side navigation expand with animation on page load, but all the tutorial websites I usually go to don't seem to have it.
The closest I could find is this jQuery sample: http://codeblitz.wordpress.com/2009/04/15/jquery-animated-collapsible-list/
I've managed to strip down the list like so:
<script type="text/javascript" src="jquery-1.3.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('li')
.css('pointer','default')
.css('list-style','none');
$('li:has(ul)')
.click(function(event){
if (this == event.target) {
$(this).css('list-style',
(!$(this).children().is(':hidden')) ? 'none' : 'none');
$(this).children().toggle('slow');
}
return false;
})
.css({cursor:'pointer', 'list-style':'none'})
.children().hide();
$('li:not(:has(ul))').css({cursor:'default', 'list-style':'none'});
});
<body>
<fieldset>
<legend>Collapsable List Demo</legend>
<ul>
<li>A - F</li>
<li>G - M
<ul>
<li>George Kent Technology Centre</li>
<li>Hampshire Park</li>
<li>George Kent Technology Centre</li>
<li>Hampshire Park</li>
</ul>
</li>
<li>
N - R
</li>
<li>S - Z</li>
</ul>
</fieldset>
My question is:
Is there any way to make this list expand on page load instead of on click? I also don't need it to collapse at all; basically I need only the animating expansion.
Thank you for your time and advice. :)
I am trying to create a list of a certain type.
I want to use the List notation but all I know is a "System.Type"
The type a have is variable. How can I create a list of a variable type?
I want something similar to this code.
public IList createListOfMyType(Type myType)
{
return new List<myType>();
}
Iam new to flex.
in my work I have a problem.
in my program i have to use three lists and one button.
one is employees list,2nd is managers list and third is details list.
depending on the selected items in the 2 lists i have display the items in detailed list
can any one help me?
thanks in advance.
I have the class herichary as follows
CEntity----CNode---CElement
I have a
class Nodes : List<Cnode>
and
Class Elements : List<Element>
Node class contain common item common across different project
Element class has item specific to a project.
I have to shallow copy the element list into the node list (basically down casting the elements to nodes)
I am having a sorted list which is rotated and I would like to do a binary search on that list to find the minimum element.
Lets suppose initial list is {1,2,3,4,5,6,7,8}
rotated list can be like {5,6,7,8,1,2,3,4}
Normal binary search doesn't work in this case. Any idea how to do this.
Hey im new to python. How do you get a portion of a list by the relative value of its sorting key.
example...
list = [11,12,13,14,15,16,1,2,3,4,5,6,7,8,9,10]
list.sort()
newList = list.split("all numbers that are over 13")
assert newList == [14,15,16]
I have looked over the PHP list of supported timezones, but the whole list is a little long to include in a drop-down menu, for the user to select his or her timezone. Is there a list with the main city/area on that can be used?
My geography is terrible and add that to not knowing all the area and which timezone they fall into it could be a long day to construct the list my self!
Thanks in advance
Guys, Ive been using jquery to do this, but now I need to do it with Prototype and Im little confused due lack of documentation
I have 2 lists of check boxes
First List:
Check box 1
Check box 2
Second list:
Check box x
check box y
check box z
I need the JS code, using prototype to work like this: Second list, remains disabled unless I check one of the checkboxes of the First List.
Any suggestions, or help, please!
Thankyou.
Hi all,
I have to make a custom webpart in sharepoint 2010 to customize defaults form of SP List.
But, the custom form i make have a field must get/set data to field of other list.
Sample :
I make a custom create custom Editform.aspx for List A by add a webpart to this page, that add. but in it have a text box that load data from a field in List B. is it possible to use method FieldName in TextField class ?
Thank alot.
Hello,
I would like a select list that does the following:
When the select list is open, display the list of descriptions.
When the user selects an item, the select list will close an only the value will be displayed.
The reason for this is to conserve space as the values will be much shorter. I'm hoping that there's an answer in jQuery.
Thanks.
Hi,
Is it possible to get a list of all applications installed in a Blackberry, similar to the applications list when you go into your settings.
I can get a list of all visible applications using the following but I was wondering if it's possible to get a list of apps that aren't necessarily running but are installed,
ApplicationDescriptor[] descriptors =
ApplicationManager.getApplicationManager().getVisibleApplications();
Guys, Ive been using jquery to do this, but now I need to do it with Prototype and Im little confused due lack of documentation
I have 2 lists of check boxes
First List:
Check box 1
Check box 2
Second list:
Check box x
check box y
check box z
I need the JS code, using prototype to work like this: Second list, remains disabled unless I check one of the checkboxes of the First List.
Any suggestions, or help, please!
Thankyou.
I am having a sorted list which is rotated and I would like to do a binary search on that list to find the minimum element.
Lets suppose initial list is {1,2,3,4,5,6,7,8}
rotated list can be like {5,6,7,8,1,2,3,4}
Normal binary search doesn't work in this case. Any idea how to do this.
If you have an Interface IFoo and a class Bar : IFoo, why can you do the following:
List<IFoo> foo = new List<IFoo>();
foo.Add(new Bar());
But you cannot do:
List<IFoo> foo = new List<Bar>();
I have the following compiled query that I want to return a list of "groups" that don't have a "GroupID" that's contained in a filtered list:
CompiledQuery.Compile(ConfigEntities contexty, List list) =
from c in context.Groups
where (!csList.Contains(c.GroupID))
select c).ToList()
However I'm getting the following run-time error:
The specified parameter 'categories' of type 'System.Collections.Generic.List`1[[System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c261364e126]]' is not valid. Only scalar parameters (such as Int32, Decimal, and Guid) are supported.
Any ideas?
I have a list of items in a generic list:
A1 (sort index 1)
A2 (sort index 2)
B1 (sort index 3)
B2 (sort index 3)
B3 (sort index 3)
The comparator on them takes the form:
this.sortIndex.CompareTo(other.sortIndex)
When I do a List.Sort() on the list of items, I get the following order out:
A1
A2
B3
B2
B1
It has obviously worked in the sense that the sort indexes are in the right order, but I really don't want it to be re-ordering the 'B' items.
Is there any tweak I can make to my comparator to fix this?
Hi
I have a un-ordered (ul) html list. Each li item has 1 or more classes attached to it.
I want to go through this ul list and get all the (distinct) classes. Then from this list create a list of checkboxes who's value matches that of the class and also who's label matches that of the class. One checkbox for each class.
What is the best way to do this using JQuery?
Thanks
hi,
here i have an return type as class object collection.
where Emp is class , having properties like Fname, lname,Age
WebApplication1.kumar .Job Emp = objEmp.GetJobInfo2(1);
i need to convert the oject collections into ListList objEmp = new List();
what is the steps that i need to do here to convert class object to List
thanks in advance
Hi,
I have a sortable list like this one: http://jqueryui.com/demos/sortable
Is it possible to get the start and end position of the element in the list, when it has been moved? I'm talking about their position number, in the list.
For example, if I move element 2 to position 5 in the list, I'd like to assign those two numbers to variables.
I'm new to jQuery - any help would be much appreciated.
how to make the items in a List to zero
I've a list List< String sampleList which contains 10 items.
eg:
1
2
3
4
5
6
7
8
9
0
how to make the list contents into zero like
0
0
0
0
0
0
0
0
0
0
Thanks in advance...
why i'm getting the memory leak errors without allocating or adding any elements to list below. should i just ignore it?
#define CRTDBG_MAP_ALLOC
#include <crtdbg.h>
#include <list>
using std::list;
int main()
{
list <char*> roots;
_CrtDumpMemoryLeaks();
}
My doubt is that if the len(list) calculates the length of the list everytime it is called or it returns the value of the builtin counter.I have a context where i need to check the length of list everytime in a loop, likelistData = []
for value in ioread():
if len(listData)=25:
processlistdata()
clearlistdata()
listData.append(value)
Should I check len(listData) every iteration, or can I have a counter for the length of the list.
I have a List defined like this :
public List<string> AttachmentURLS;
I am adding items to the list like this:
instruction.AttachmentURLS = curItem.Attributes["ows_Attachments"].Value.Split(';').ToList().Where(Attachment => !String.IsNullOrEmpty(Attachment));
But I am getting this error: Cannot implicitly convert IEnumerable to List
What am I doing wrong?