Search Results

Search found 32453 results on 1299 pages for 'acts as list'.

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

  • The best way to use dictionary items as we use the advantages of List

    - by blgnklc
    I want to get use of dictionary items like I do in List generic class, e.g; foreach(item in ItemList) { item.BlaBla; } but in dictionary there s no chance, like e method above... Dictionary<string, HtmlInputImage> smartPenImageDictionary; I mean I got to know the key item for the dictionary item.. but what I want, I want to travel from beginning of the list till the end..

    Read the article

  • searching a list of tuples in python

    - by hdx
    So I have a list of tuple like: [(1,"juca"),(22,"james"),(53,"xuxa"),(44,"delicia")] I want this list for a tuple whose number value is equal to something. So that if I do search(53) it will return 2 Is is an easy way to do that?

    Read the article

  • Remove duplicates from a list

    - by Mercer
    Hello i want to remove duplicates from a list i do this but not working List<Customer> listCustomer = new ArrayList<Customer>(); for (Customer customer: tmpListCustomer) { if (!listCustomer.contains(customer)) { listCustomer.add(customer); } }

    Read the article

  • Sikuli List of Functions & Operators

    - by PPTim
    Hello, I've just discovered Sikuli, and would like to see a comprehensive functions list without digging through the online-examples and demos. Has anyone found such a list? Furthermore, apparently Sikuli supports more complex loops and function calls as well, and seems to be based in Python(!!). Examples would be great. Thanks.

    Read the article

  • Erlang : flattening a list of strings

    - by ErJab
    I have a list like this: [["str1","str2"],["str3","str4"],["str5","str6"]] And I need to convert it to ["str1", "str2", "str3", "str4", "str5", "str6"] How do I do this? The problem is that I'm dealing with lists of strings, so when I do lists:flatten([["str1","str2"],["str3","str4"],["str5","str6"]]) I get "str1str2str3str4str5str6" However, if the elements of the original list where just atoms, then lists:flatten would have given me what I needed. How do I achieve the same with strings?

    Read the article

  • has any simply way to delete a value in list of python

    - by zjm1126
    a=[1,2,3,4] b=a.index(6) del a[b] print a it show error: Traceback (most recent call last): File "D:\zjm_code\a.py", line 6, in <module> b=a.index(6) ValueError: list.index(x): x not in list so i have to do this : a=[1,2,3,4] try: b=a.index(6) del a[b] except: pass print a but this is not simple,has any simply way ? thanks

    Read the article

  • RegEx to reverse order of list?

    - by quantomcat
    Is there a singular regular expression that can be used in, say, a text editor's search/replace dialog to reverse the order of the items in a list? For instance, take this list: First item Second item Third item Select it in a text editor like EditPad, bring up the search and replace box, apply a regex (run as a loop or not) and turn it into: Third item Second item First item Can this be done?

    Read the article

  • Ensuring the contacts in a Distribution List are displayed with both name and email address

    - by hawbsl
    How can I ensure the contacts I add to an Outlook distribution list are displayed with both name and email address? These contacts may not exist in any other address book, just the distribution list. Currently they show up just as an email address (in both columns). Here's roughly the VBA we're using: Do Until RS.EOF //here's where we want to inject RS!FirstName, RS!Surname etc objRecipients.Add RS!Email objRecipients.Resolve RS.MoveNext Loop Set objDistList = contactsFolder.Items.Add("IPM.DistList") objDistList.DLName = "Whatever" objDistList.AddMembers objRecipients objDistList.Save etc

    Read the article

  • c# array vs generic list

    - by L G
    Hi, i basically want to know the differences or advantages in using a generic list instead of an array in the below mentioned scenario Class Employee { private _empName; Public EmpName { get{return _empName;} set{_empName = value;} } } 1. Employee[] emp 2. List<Employee> emp can anyone please tell me the advantages or disadvaatges and which one to prefer

    Read the article

  • asp.net mvc2 - update list of objects

    - by ile
    I want to display list of objects from database, and on the same page have option to edit them. When submitting, I'd like to submit changes to all of them. I found this link: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx and http://www.hanselman.com/blog/ASPNETWireFormatForModelBindingToArraysListsCollectionsDictionaries.aspx but there is no description how to handle posted data in controller. Thanks in advance!

    Read the article

  • Returning all "positions" of a list

    - by Daymor
    I Have a list with "a" and "b" and the "b"'s are somewhat of a path and "a"'s are walls. Im writing a program to make a graph of all the possible moves. I got the code running to check the first "b" for possible moves, but i have NO Idea how im going to find all "b"'s , even less check them all without repeating. Major issue im having is getting the tuple coordinates of the "b"'s out of the list. Any pointers/tips?

    Read the article

  • Query a SharePoint List from InfoPath web form in code

    - by dawsonweb
    I'm writing an InfoPath web form, using C# code behind. The form is a holiday request, after the user inputs the start and end dates I want the code to query a bank-holiday sharepoint list and count occurrences between the dates. I've added the sharepoint list as a second datasource however I'm now stuck. Any ideas?

    Read the article

  • Convert list of dicts to string

    - by John
    I'm very new to Python, so forgive me if this is easier than it seems to me. I'm being presented with a list of dicts as follows: [{'directMember': 'true', 'memberType': 'User', 'memberId': '[email protected]'}, {'directMember': 'true', 'memberType': 'User', 'memberId': '[email protected]'}, {'directMember': 'true', 'memberType': 'User', 'memberId': '[email protected]'}] I would like to generate a simple string of memberIds, such as [email protected], [email protected], [email protected] but every method of converting a list to a string that I have tried fails because dicts are involved. Any advice?

    Read the article

  • Maddening Linked List problem

    - by Mike
    This has been plaguing me for weeks. It's something really simple, I know it. Every time I print a singly linked list, it prints an address at the end of the list. #include <iostream> using namespace std; struct node { int info; node *link; }; node *before(node *head); node *after(node *head); void middle(node *head, node *ptr); void reversep(node *head, node *ptr); node *head, *ptr, *newnode; int main() { head = NULL; ptr = NULL; newnode = new node; head = newnode; for(int c1=1;c1<11;c1++) { newnode->info = c1; ptr = newnode; newnode = new node; ptr->link = newnode; ptr = ptr->link; } ptr->link=NULL; head = before(head); head = after(head); middle(head, ptr); //reversep(head, ptr); ptr = head; cout<<ptr->info<<endl; while(ptr->link!=NULL) { ptr=ptr->link; cout<<ptr->info<<endl; } system("Pause"); return 0; } node *before(node *head) { node *befnode; befnode = new node; cout<<"What should go before the list?"<<endl; cin>>befnode->info; befnode->link = head; head = befnode; return head; } node *after(node *head) { node *afnode, *ptr2; afnode = new node; ptr2 = head; cout<<"What should go after the list?"<<endl; cin>>afnode->info; ptr2 = afnode; afnode->link=NULL; ptr2 = head; return ptr2; } void middle(node *head, node *ptr) { int c1 = 0, c2 = 0; node *temp, *midnode; ptr = head; while(ptr->link->link!=NULL) { ptr=ptr->link; c1++; } c1/=2; c1-=1; ptr = head; while(c2<c1) { ptr=ptr->link; c2++; } midnode = new node; cout<<"What should go in the middle of the list?"<<endl; cin>>midnode->info; cout<<endl; temp=ptr->link; ptr->link=midnode; midnode->link=temp; } void reversep(node *head, node *ptr) { node *last, *ptr2; ptr=head; ptr2=head; while(ptr->link!=NULL) ptr = ptr->link; last = ptr; cout<<last->info; while(ptr!=head) { while(ptr2->link!=ptr) ptr2=ptr2->link; ptr = ptr2; cout<<ptr->info; } } I'll admit that this is class work, but even the professor can't figure it out, and says that its probably something insignificant that we're overlooking, but I can't put my mind to rest until I find out what it is.

    Read the article

  • List querying with Lamda Expressions in C#.NET

    - by Pavan Kumar Pabothu
    public class Employees {     public int EmployeeId { get; set; }     public string Name { get; set; }     public decimal Salary { get; set; } } List<Employees> employeeList = new List<Employees>(); List<Employees> resultList = new List<Employees>(); decimal maxSalary; List<string> employeeNames = new List<string>(); protected void Page_Load(object sender, EventArgs e) {     if (!IsPostBack)     {         FillEmployees();     }     // Getting a max salary     maxSalary = employeeList.Max((emp) => emp.Salary);     // Filtering a List     resultList = employeeList.Where((emp) => emp.Salary > 50000).ToList();     // Sorting a List     // To get a descending order replace OrderBy with OrderByDescending     resultList = employeeList.OrderBy<Employees, decimal>((emp) => emp.Salary).ToList();     // Get the List of employee names only     employeeNames = employeeList.Select<Employees, string>(emp => emp.Name).ToList();        // Getting a customized object with a given list     var employeeResultSet = employeeList.Select((emp) => new { Name = emp.Name, BigSalary = emp.Salary > 50000 }).ToList(); } private void FillEmployees() {     employeeList.Add(new Employees { EmployeeId = 1, Name = "Shankar", Salary = 125000 });     employeeList.Add(new Employees { EmployeeId = 2, Name = "Prasad", Salary = 90000 });     employeeList.Add(new Employees { EmployeeId = 3, Name = "Mahesh", Salary = 36000 }); }

    Read the article

  • Do you know a good html mailing list management software with admin levels?

    - by SirG
    I'm basically looking for a program/app/script (can be commercial) which I can ideally install on a windows server (we can run asp, asp.net php mssql) we have different groups of people who send newsletters to web members, I want to bring it all into one app which I can monitor and control. Ideally it would be able to create html newsletters, (with some templates) track emails and click throughs. Manage email lists subscribe/unsubscribes. And importantly have different levels of admin, so a newsletter creator could log in and create and send off an email, it goes into a queue where a communications editor can have an overview of all newsletters and approve the sending of the emails or edit them before they are sent off. before I start coding something up myself I thought I'd ask if anyone has any advice! Cheers!

    Read the article

  • How to Create SharePoint List and Insert List Item programmatically from a Windows Forms Application.

    - by Michael M. Bangoy
    In this post I’m going to demonstrate how to create SharePoint List and also Insert Items on the List from a Windows Forms Application. 1. Open Visual Studio and create a new project. On the project template select Windows Form Application under C#. 2. In order to communicate with Sharepoint from a Windows Forms Application we need to add the 2 Sharepoint Client DLL located in c:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI.  3. Select the Microsoft.Sharepoint.Client.dll and Microsoft.Sharepoint.Client.Runtime.dll. (Your solution should look like the one below) 4. Open the Form1 in design view and from the Toolbox menu add a button on the form surface. Your form should look like the one below. 5. Double click the button to open the code view. Add Using statement to reference the Sharepoint Client Library then create method for the Create List. Your code should like the codes below. using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Security; using System.Windows.Forms; using SP = Microsoft.SharePoint.Client; namespace ClientObjectModel {     public partial class Form1 : Form     {         // url of the Sharepoint site         const string _context = "urlofthesharepointsite";         public Form1()         {             InitializeComponent();         }         private void Form1_Load(object sender, EventArgs e)         {                    }         private void cmdcreate_Click(object sender, EventArgs e)         {             try             {                 // declare the ClientContext Object                 SP.ClientContext _clientcontext = new SP.ClientContext(_context);                 SP.Web _site = _clientcontext.Web;                 // declare a ListCreationInfo                 SP.ListCreationInformation _listcreationinfo = new SP.ListCreationInformation();                 // set the Title and the Template of the List to be created                 _listcreationinfo.Title = "NewListFromCOM";                 _listcreationinfo.TemplateType = (int)SP.ListTemplateType.GenericList;                 // Call the add method to the ListCreatedInfo                 SP.List _list = _site.Lists.Add(_listcreationinfo);                 // Add Description field to the List                 SP.Field _Description = _list.Fields.AddFieldAsXml(@"                                     <Field Type='Text'                                         DisplayName='Description'>                                     </Field>", true, SP.AddFieldOptions.AddToDefaultContentType);                 // declare the List item Creation object for creating List Item                 SP.ListItemCreationInformation _itemcreationinfo = new SP.ListItemCreationInformation();                 // call the additem method of the list to insert a new List Item                 SP.ListItem _item = _list.AddItem(_itemcreationinfo);                 _item["Title"] = "New Item from Client Object Model";                 _item["Description"] = "This item was added by a Windows Forms Application";                 // call the update method                 _item.Update();                 // execute the query of the clientcontext                 _clientcontext.ExecuteQuery();                 // dispose the clientcontext                 _clientcontext.Dispose();                 MessageBox.Show("List Creation Successfull");             }             catch(Exception ex)             {                 MessageBox.Show("Error creating list" + ex.ToString());             }          }     } } 6. Hit F5 to run the application. A message will be displayed on the screen if the operation is successful and also if it fails. 7. To make that the operation of our Windows Form Application has really created the List and Inserted an item on it. Let’s open our SharePoint site. Once the SharePoint is open click on the Site Actions then View All Site Content. 7. Click the List to open it and check if an Item is inserted. That’s it. Hope this helps.

    Read the article

  • How to generate SPMetal for a specific list (OOTB: like tasks or contacts) with custom columns

    - by KunaalKapoor
    SPMetal is used to make use of LINQ on a list in SharePoint 2010. By default when you generate SPMetal on a site you will get a code generated file for most of the lists and probably more. Here is a MSDN link for some info on SPMetal.http://msdn.microsoft.com/en-us/library/ee538255(office.14).aspxBut what if you want only to generate the code for one list?Well it is quite simple once you figure it out. You need to add an xml file to override the default settings of SPMetal and specify it in the /parameters option. I will show you how to do this.First create a Folder that will contain two files (GenerateSPMetalCode.bat and SPMetal.xml).Below is the content of the files:GenerateSPMetalCode.bat "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\SPMetal" /web:http://YourServer /code:OutPutFileName.cs /language:csharp /parameters:SPMetal.xml pause SPMetal.xml <?xml version="1.0" encoding="utf-8"?> <Web AccessModifier="Internal" xmlns="http://schemas.microsoft.com/SharePoint/2009/spmetal"> <List Name="ListName"> <ContentType Name="ContentTypeName" Class="GeneratedClassName" /> </List> <ExcludeOtherLists></ExcludeOtherLists> </Web> You will have to change some of the text in the files so that it will be specific to your SharePoint Server Setup. In the bat file you will have to change http://YourServer to the url of the web where your list is. In the SPMetal.xml file you need to change ListName to the name of your list and the ContentTypeName to the name of the content type you want to extract. The GeneratedClassName can be anything but perhaps you should rename it to something more sensible.Adding the following line: '<List Name="ListName"><ContentType Name="ContentTypeName" Class="GeneratedClassName" /> </List>'  makes sure that any custom columns added to an OOTB list like contacts or tasks are also generated, which are missed out in a regular generation.So now when you run it the SPMetal command will read the SPMetal.xml list and override its commands. ExcludeOtherLists element makes it so that only the code for the lists you specify will be generated. For some reason I got an error if I had this element above the List element.You sould now have a code file called OutPutFileName.cs that has been generated. You can now put this in your SharePoint project for use with your LINQ queries against that list.I will soon write a LINQ example that uses the generated class. UPDATE: Add the /namespace parameter to add a namespace to the generated code. "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN\SPMetal" /web:http://YourServer /namespace:MySPMetalNameSpace /code:OutPutFileName.cs /language:csharp /parameters:SPMetal.xml

    Read the article

  • How to select a rectangle from List<Rectangle[]> with Linq

    - by dboarman
    I have a list of DrawObject[]. Each DrawObject has a Rectangle property. Here is my event: List<Canvas.DrawObject[]> matrix; void Control_MouseMove ( object sender, MouseEventArgs e ) { IEnumerable<Canvas.DrawObject> tile = Enumerable.Range( 0, matrix.Capacity - 1) .Where(row => Enumerable.Range(0, matrix[row].Length -1) .Where(column => this[column, row].Rectangle.Contains(e.Location))) .????; } I am not sure exactly what my final select command should be in place of the "????". Also, I was getting an error: cannot convert IEnumerable to bool. I've read several questions about performing a linq query on a list of arrays, but I can't quite get what is going wrong with this. Any help? Edit Apologies for not being clear in my intentions with the implementation. I intend to select the DrawObject that currently contains the mouse location.

    Read the article

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