Search Results

Search found 2235 results on 90 pages for 'dictionary'.

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

  • C# Array or Dictionary?

    - by Valentin
    Hi. I wanted to know is C# array has a constant access speed? I need to store 1000 items in static array, that will be initialized during server startup. This array will be used readonly, so there will be no changes to array. Should I use a simple C# array (new MyClass[]) or Dictionary instead. I am really new to C# and trying to understand how C# arrays access works. Can they be compared to c++ arrays by speed?

    Read the article

  • UIView as dictionary key?

    - by subw
    I want to have a NSDictionary that maps from UIViews to something else. However, since UIViews do not implement the NSCopying protocol, I can't use them directly as dictionary keys.

    Read the article

  • How trasmit a Dictionary in a jsons form

    - by xRobot
    I have a dictionary in jsons form like this: $user = "{ name: Mary , born: 1963, money: 213 }"; I need to pass it throught this field: <input type="hidden" name="custom" value="" > and then insert it in the db: INSERT INTO user ( name, born, money ) VALUE ( $name, $born, $money ) How can I do that ?

    Read the article

  • python destructuring-bind dictionary contents

    - by Stephen
    Hi, I am trying to 'destructure' a dictionary and associate values with variables names after its keys. Something like params = {'a':1,'b':2} a,b = params.values() but since dictionaries are not ordered, there is no guarantee that params.values() will return values in the order of (a,b). Is there a nice way to do this? Thanks

    Read the article

  • Use the style defined in resource dictionary :

    - by Malcolm
    I have a style defined for listboxitem in a resource dictionary. I want to use this style in a cs file of listbox : I am doing the below thing but it gives me null ,CustomListBoxItemStyle is a name of a key given to the style. public class CustomListBox : ListBox { public CustomListBox() { this.ItemContainerStyle = Application.Current.Resources["CustomListBoxItemStyle"] as Style; } } There is no xaml for this. How to achieve this?

    Read the article

  • The model item passed into the dictionary is of type 'System.Collections.Generic.Lis

    - by mazhar
    Calling Index view is giving me this very very annoying error . Can anybody tell me what to do about it Error: The model item passed into the dictionary is of type 'System.Collections.Generic.List1[MvcApplication13.Models.Groups]', but this dictionary requires a model item of type 'MvcApplication13.Helpers.PaginatedList1[MvcApplication13.Models.Groups]'. public ActionResult Index(int? page) { const int pageSize = 10; var group =from p in _db.Groups orderby p.int_GroupId select p; var paginatedGroup = group.Skip((page ?? 0) * pageSize).Take(pageSize).ToList(); return View(paginatedGroup); } View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" % Index <h2>Index</h2> <table> <tr> <th></th> <th> int_GroupId </th> <th> vcr_GroupName </th> <th> txt_GroupDescription </th> <th> bit_Is_Deletable </th> <th> bit_Active </th> <th> int_CreatedBy </th> <th> dtm_CreatedDate </th> <th> int_ModifiedBy </th> <th> dtm_ModifiedDate </th> </tr> <% foreach (var item in Model) { %> <tr> <td> <%= Html.ActionLink("Edit", "Edit", new { id=item.int_GroupId }) %> | <%= Html.ActionLink("Details", "Details", new { id=item.int_GroupId })%> | <%= Html.ActionLink("Delete", "Delete", new { id=item.int_GroupId })%> </td> <td> <%= Html.Encode(item.int_GroupId) %> </td> <td> <%= Html.Encode(item.vcr_GroupName) %> </td> <td> <%= Html.Encode(item.txt_GroupDescription) %> </td> <td> <%= Html.Encode(item.bit_Is_Deletable) %> </td> <td> <%= Html.Encode(item.bit_Active) %> </td> <td> <%= Html.Encode(item.int_CreatedBy) %> </td> <td> <%= Html.Encode(String.Format("{0:g}", item.dtm_CreatedDate)) %> </td> <td> <%= Html.Encode(item.int_ModifiedBy) %> </td> <td> <%= Html.Encode(String.Format("{0:g}", item.dtm_ModifiedDate)) %> </td> </tr> <% } %> </table> <% if (Model.HasPreviousPage) { % <%= Html.RouteLink("<<<", "UpcomingDinners", new { page = (Model.PageIndex-1) }) % <% } % <% if (Model.HasNextPage) { % <%= Html.RouteLink("", "UpcomingDinners", new { page = (Model.PageIndex + 1) }) % <% } % <p> <%= Html.ActionLink("Create New", "Create") %> </p>

    Read the article

  • Sort a python dict

    - by ensnare
    I have a list of dictionaries: [{'title':'New York Times', 'title_url':'New_York_Times','id':4}, {'title':'USA Today','title_url':'USA_Today','id':6}, {'title':'Apple News','title_url':'Apple_News','id':2}] I'd like to sort it by the title, so elements with A go before Z: [{'title':'Apple News','title_url':'Apple_News','id':2}, {'title':'New York Times', 'title_url':'New_York_Times','id':4}, {'title':'USA Today','title_url':'USA_Today','id':6}] What's the best way to do this? Also, is there a way to ensure the order of each dictionary key stays constant, e.g., always title, title_url, then id? Thank you.

    Read the article

  • How can I find the columns of a disabled index constraint?

    - by thecoop
    For a normal index constraint, you can find the columns it is on by querying the all_ind_columns sysview using the index name in all_constraints. But if the constraint is disabled, no index exists, and there doesn't seem to be anywhere else that has constraint column information. How can I get the columns of a disabled index constraint from the data dictionary (without re-enabling the constraint)?

    Read the article

  • Sort a list of dicts by dict values

    - by ensnare
    I have a list of dictionaries: [{'title':'New York Times', 'title_url':'New_York_Times','id':4}, {'title':'USA Today','title_url':'USA_Today','id':6}, {'title':'Apple News','title_url':'Apple_News','id':2}] I'd like to sort it by the title, so elements with A go before Z: [{'title':'Apple News','title_url':'Apple_News','id':2}, {'title':'New York Times', 'title_url':'New_York_Times','id':4}, {'title':'USA Today','title_url':'USA_Today','id':6}] What's the best way to do this? Also, is there a way to ensure the order of each dictionary key stays constant, e.g., always title, title_url, then id? Thank you.

    Read the article

  • Problem in converting ToDictionary<Datetime,double>() using LINQ(C#3.0)

    - by Newbie
    I have written the below return (from p in returnObject.Portfolios.ToList() from childData in p.ChildData.ToList() from retuns in p.Returns.ToList() select new Dictionary<DateTime, double> () { p.EndDate, retuns.Value } ).ToDictionary<DateTime,double>(); Getting error No overload for method 'Add' takes '1' arguments Where I am making the mistake I am using C#3.0 Thanks

    Read the article

  • Is there an API available to retrieve raw Wiktionary Data?

    - by Armentage
    I want to build a simple application that looks up words against Wiktionary to see if they exist. Is there a standard API supported by the Wiktionary software that would let me do this? Alternatively, is there any way I can pull down the dictionary data that backs a Wiktionary? There are many international variants who's data I would love to put a different front-end around.

    Read the article

  • python 3 self class dict

    - by Jjang
    I am trying to create my own class of dictionary in python 3 which has a field of dict variable and setitem and getitem methods. Though, it doesnt work for some reason. Tried to look around but couldn't find the answer. class myDictionary: def __init(self): self.myDic={} def __setitem__(self, key, value): self.myDic[key]=value I'm getting: 'myDictionary' object has no attribute 'myDic' Any ideas? :)

    Read the article

  • C# convert an IOrderedEnumerable<KeyValuePair<string, int>> into a Dictionary<string, int>

    - by Kache4
    I was following the answer to another question, and I got: // itemCounter is a Dictionary<string, int>, and I only want to keep // key/value pairs with the top maxAllowed values if (itemCounter.Count > maxAllowed) { IEnumerable<KeyValuePair<string, int>> sortedDict = from entry in itemCounter orderby entry.Value descending select entry; sortedDict = sortedDict.Take(maxAllowed); itemCounter = sortedDict.ToDictionary<string, int>(/* what do I do here? */); } Visual Studio's asking for a parameter Func<string, int> keySelector. I tried following a few semi-relevant examples I've found online and put in k => k.Key, but that gives a compiler error: 'System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,int>>' does not contain a definition for 'ToDictionary' and the best extension method overload 'System.Linq.Enumerable.ToDictionary<TSource,TKey>(System.Collections.Generic.IEnumerable<TSource>, System.Func<TSource,TKey>)' has some invalid arguments

    Read the article

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