Daily Archives

Articles indexed Tuesday May 4 2010

Page 7/117 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • What is the most basic class that inherits ICollection<T>

    - by Martin Neal
    I need a generic collection class which I can add to, and enumerate over. Since ICollection<T> inherits from IEnumerable<T>, the class really just needs to inherit from ICollection<T>. Is there a simple generic class in the BCL that just inherits ICollection<T>? If not, then what class comes closest? I would guess List<T> which is what I've been using. Is there anything better (by which I mean [smaller/faster/simpler])? Thanks in advance!

    Read the article

  • How to develop for iphone application about "retrieving database file on web"?

    - by coverboy
    Hi...all experts! I'm a newbie to iphone developer. Well, currently, I'm developing iphone for Location Based Service. That application need to have these functions. 1. hierarchical tree-view on navigation bar. 2. list up page 3. detail page for example, Let's say. I have top category like "Restaurant, Hotel, Gift Shop" Second level "New York, LA, London,....." Third Level displays all Data with 1 photo. Fourth Level displays Detail of that "Restaurant or Hotel, Gift shop, ..." So, My Only Interest is "How to retrieve the data from remote database server. not using iphone local one." Because, that locations, and shops should be updated frequently, (you know some shops closed, new shops opens.) So, till now, I figured out that using XML to retrieve data. However, using XML is the most effective way to implement? Is there any other way to accomplish this work? You know, transferring XML data via 3G Network is really slow. XML file have more bytes than plist file. I'm currently a beginner of iphone development. So, please help me find a right way!! And, one more question, if I use xml way. Is it possible to Paging? (First page 10 lists up, below that more button...) well, you might guess each category have hundreds of shops!!

    Read the article

  • DataGridView with row-specific DataGridViewComboBoxColumn contents

    - by XXXXX
    So I have something like the following data structure (constructors omitted) class Child { public string Name { get; set; } public int Age { get; set; } } class Parent { public string Name { get; set; } public List <Child> Children { get; private set; } // never null; list never empty public Child FavoriteChild { get; set; } // never null; always a reference to a Child in Children } List < Parent > Parents; What I want to do is show a DataGridView where each row is a Parent from Parent list. Each row should have two columns: a text box showing the parent's name and a DataGridViewComboBoxColumn containing that parent's children, from which the user can select the parent's favorite child. I suppose I could do the whole thing manually, but I'd like to do all this with more-or-less standard Data Binding. It's easy enough to bind the DataGridView to the list of parents, and easy enough to bind the selected child to the FavoriteChild property. The part that's giving me difficulty is that it looks like the Combo Box column wants to bind to one data source for all the combo-box's contents on all rows. I'd like each instance of the combo box to bind to the list of each parent's children. I'm fairly new to C#/Windows Forms, so I may well be missing something obvious. Or it could be that "you can't get there from here." It's not too tough to make a separate list of all the children and filter it by parent; I'm looking into that possibility right now. Is this feasible, or is there a better way?

    Read the article

  • Positioning an image inside an ImageView with max height and max width set

    - by andern
    I have an ImageView with max height and max width both set to 100. The figure below is clearly not a square, but you can use your imagination ;) Figure 1: +----------------------------------------------+ ¦ ImageView +--------------+ ¦ ¦ ¦ ¦ ¦ ¦ ¦ Actual image ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ +--------------+ ¦ +----------------------------------------------+ Anyway, If I try to set a BitMap to the ImageView that does not have a ratio of 1:1, the image is positioned like pictured in Figure 1. What I want is for the picture to be placed to the left inside the ImageView like pictured in Figure 2 below. Figure 2: +----------------------------------------------+ ¦--------------+ ¦ ¦ ¦ ¦ ¦ Actual image ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦ ¦--------------+ ¦ +----------------------------------------------+ You can see my ImageView in XML below. maxHeight, maxWidth and adjustViewBounds are set during runtime. <ImageView android:id="@+id/someImage" android:layout_alignParentLeft="true" android:layout_below="@+id/textName" android:layout_height="wrap_content" android:layout_width="wrap_content" android:paddingRight="4dp" /> This is in a RelativeLayout if it makes any difference.

    Read the article

  • Why is this MySQL Join Statement not Working?

    - by Timmy
    Here is my code: $query2 = mysql_query("SELECT * FROM categories WHERE parent = $id JOIN SELECT * FROM posts WHERE main_nav_page = '$idTwo'"); while ($row2 = mysql_fetch_assoc($query2)) { $id = $row2['id']; $name = $row2['name']; $slug = $row2['slug']; $subMenuOrder = $row2['sub_menu_order']; echo "<tr>\n"; echo "<td>&nbsp; -- $name</td>\n"; echo "</tr>\n"; } Is my syntax wrong? EDIT: the error message is: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/studentw/public_html/new_nav.php on line 30

    Read the article

  • Submit Form Equivalent To WML

    - by Nathan Campos
    I'm playing a little bit with WML with PHP, then I want to know what is the equivalent of this on WML: <form action="upload_file.php" method="post"enctype="multipart/form-data"> <label for="file">File:</label><br /> <input type="file" name="file" id="file" /><br /> <input type="submit" name="submit" value="Submit" /> </form>

    Read the article

  • Algorithm for creating a school timetable.

    - by cand
    Hello all. I've been wondering if there are known solutions for algorithm of creating a school timetable. Basically, it's about optimizing "hour-dispersion" (both in teachers and classes case) for given class-subject-teacher associations. We can assume that we have sets of classes, lesson subjects and teachers associated with each other at the input and that timetable should fit between 8AM and 4PM. I guess that there is probably no accurate algorithm for that, but maybe someone knows a good approximation or hints for developing it. P.S. I know, there was http://stackoverflow.com/questions/1259686/school-timetable-generation-algorithm-closed , but unlike in that case, I'm not looking for actual implementation, rather for thoughts on how to do it or why it's impossible.

    Read the article

  • How should I check that a given argument is a datetime.date object?

    - by rmh
    I'm currently using an assert statement with isinstance. Because datetime is a subclass of date, I also need to check that it isn't an instance of datetime. Surely there's a better way? from datetime import date, datetime def some_func(arg): assert isinstance(arg, date) and not isinstance(arg, datetime),\ 'arg must be a datetime.date object' # ...

    Read the article

  • C++, Get text from a website, part 3

    - by pure841
    So, thanks for all the help guys, I am just have one last problem, I am putting the website source in a char var, and then reading the product title (I have gotten that), however it only works if I take part of the source, or only the html from one of the featured products on neweggs page. I think the program is crashing, because it doesnt know which title to pick when I need to get all three titles and put them into an array. Any ideas? Thanks. Here is the parser code: http://paste2.org/p/809045 Any solution is greatly appreciated.

    Read the article

  • Create a CBitmap from Resources ID

    - by Smashery
    I need to fill a CImageList with a number of bitmaps which are stored in separate bmp files (rather than as a single bmp with numerous parts). I assume I need to create a CBitmap so I can call the Add method of CImageList. So how might one create a CBitmap object using only MFC Resource IDs?

    Read the article

  • Nullable<T> as a parameter

    - by ferch
    I alredy have this: public static object GetDBValue(object ObjectEvaluated) { if (ObjectEvaluated == null) return DBNull.Value; else return ObjectEvaluated; } used like: List<SqlParameter> Params = new List<SqlParameter>(); Params.Add(new SqlParameter("@EntityType", GetDBValue(EntityType))); Now i wanted to keep the same interface but extend that to use it with nullable public static object GetDBValue(int? ObjectEvaluated) { if (ObjectEvaluated.HasValue) return ObjectEvaluated.Value; else return DBNull.Value; } public static object GetDBValue(DateTime? ObjectEvaluated) {...} but i want only 1 function GetDBValue for nullables. How do I do that and keep the call as is is? Is that possible at all? I can make it work like: public static object GetDBValue<T>(Nullable<T> ObjectEvaluated) where T : struct { if (ObjectEvaluated.HasValue) return ObjectEvaluated.Value; else return DBNull.Value; } But the call changes to: Params.Add(new SqlParameter("@EntityID ", GetDBValue<int>(EntityID)));

    Read the article

  • ASP.NET MVC 2 InputExtensions different on server than local machine

    - by Mike
    Hi everyone, So this is kind of a crazy problem to me, but I've had no luck Googling it. I have an ASP.NET MVC 2 application (under .NET 4.0) running locally just fine. When I upload it to my production server (under shared hosting) I get Compiler Error Message: CS1061: 'System.Web.Mvc.HtmlHelper' does not contain a definition for 'TextBoxFor' and no extension method 'TextBoxFor' accepting a first argument of type 'System.Web.Mvc.HtmlHelper' could be found (are you missing a using directive or an assembly reference?) for this code: <%= this.Html.TextBoxFor(person => person.LastName) %> This is one of the new standard extension methods in MVC 2. So I wrote some diagnostic code: System.Reflection.Assembly ass = System.Reflection.Assembly.GetAssembly(typeof(InputExtensions)); Response.Write("From GAC: " + ass.GlobalAssemblyCache.ToString() + "<br/>"); Response.Write("ImageRuntimeVersion: " + ass.ImageRuntimeVersion.ToString() + "<br/>"); Response.Write("Version: " + System.Diagnostics.FileVersionInfo.GetVersionInfo(ass.Location).ToString() + "<br/>"); foreach (var method in typeof(InputExtensions).GetMethods()) { Response.Write(method.Name + "<br/>"); } running locally (where it works fine), I get this as output: From GAC: True ImageRuntimeVersion: v2.0.50727 Version: File: C:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll InternalName: System.Web.Mvc.dll OriginalFilename: System.Web.Mvc.dll FileVersion: 2.0.50217.0 FileDescription: System.Web.Mvc.dll Product: Microsoft® .NET Framework ProductVersion: 2.0.50217.0 Debug: False Patched: False PreRelease: False PrivateBuild: False SpecialBuild: False Language: Language Neutral CheckBox CheckBox CheckBox CheckBox CheckBox CheckBox CheckBoxFor CheckBoxFor CheckBoxFor Hidden Hidden Hidden Hidden HiddenFor HiddenFor HiddenFor Password Password Password Password PasswordFor PasswordFor PasswordFor RadioButton RadioButton RadioButton RadioButton RadioButton RadioButton RadioButtonFor RadioButtonFor RadioButtonFor TextBox TextBox TextBox TextBox TextBoxFor TextBoxFor TextBoxFor ToString Equals GetHashCode GetType and when running on the production server (where it fails), I see: From GAC: True ImageRuntimeVersion: v2.0.50727 Version: File: C:\Windows\assembly\GAC_MSIL\System.Web.Mvc\2.0.0.0__31bf3856ad364e35\System.Web.Mvc.dll InternalName: System.Web.Mvc.dll OriginalFilename: System.Web.Mvc.dll FileVersion: 2.0.41001.0 FileDescription: System.Web.Mvc.dll Product: Microsoft® .NET Framework ProductVersion: 2.0.41001.0 Debug: False Patched: False PreRelease: False PrivateBuild: False SpecialBuild: False Language: Language Neutral CheckBox CheckBox CheckBox CheckBox CheckBox CheckBox Hidden Hidden Hidden Hidden Hidden Hidden Password Password Password Password RadioButton RadioButton RadioButton RadioButton RadioButton RadioButton TextBox TextBox TextBox TextBox ToString Equals GetHashCode GetType note that "TextBoxFor" is not present (hence the error). I have MVC referenced in the csproj: <Reference Include="System.Web.Mvc, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <SpecificVersion>True</SpecificVersion> <HintPath>References\System.Web.Mvc.dll</HintPath> <Private>True</Private> </Reference> I just can't figure it what to do next. Thoughts? Thanks! -Mike

    Read the article

  • Can you point me to current examples using NHibernate in an ASP.NET MVC2 app?

    - by alphadogg
    Can anyone point me to any self-contained, complete, current reference materials/projects using NHibernate in an ASP.NET MVC2 application? I have looked at Sharp Architecture, but I am not sure I need the complexity in that project. I certainly don't know enough about it to know if it is over-engineered for my purposes. I would like to see more types of implementations to gauge the various ways people have skinned this cat.

    Read the article

  • jqModal dialog always under overlay.

    - by ProfK
    I have the following code, and am at my wit's end because the dialog always appears under the overlay. Any advice will be most appreciated: <head runat="server"> <title></title> <link href="../Styles/jqModal.css" rel="stylesheet" type="text/css" /> <style type="text/css"> #shift-edit-popup { display: none; } </style> <script src="../Scripts/jquery-1.4.2.js" type="text/javascript"></script> <script src="../Scripts/jqModal.js" type="text/javascript"></script> <script type="text/javascript"> $(function () { $("#shift-edit-popup").jqm({ toTop: true }).jqmAddTrigger("#show-button"); }); </script> </head> <body> <form id="form" runat="server"> <input id="show-button" type="button" value="Show" /> <div id="shift-edit-popup"> <div> <asp:Label ID="resourceLabel" runat="server" AssociatedControlID="resourceList">Resource:</asp:Label> <asp:DropDownList ID="resourceList" runat="server" DataTextField="Name" DataValueField="ResourceId" Width="120px"> </asp:DropDownList> </div> </div> </body>

    Read the article

  • Should DKIM signing happen in the application or the MTA?

    - by thomasrutter
    I'm trying to weigh up whether DKIM signing should be done by the application sending mail (for instance, the mailing list software you're using) or at the mail transfer agent (sendmail, postfix etc). Do you know any good arguments either way? As far as I can see, doing it at the MTA, such as with dkim-milter, is a lot easier to set up. However, if anyone gets access to the server, even just a normal unprivileged account such as a web hosting client's login, they'd be able to send email using sendmail and get the full blessing of my DKIM signature. What do you think is the best solution for my situation? I'm using a Debian server with apache, postfix, php&mysql, etc.

    Read the article

  • SQLAuthority News – Microsoft SQL Server 2005/2008 Query Optimization & Performance Tuning Training

    - by pinaldave
    Last 3 days to register for the courses. This is one time offer with big discount. The deadline for the course registration is 5th May, 2010. There are two different courses are offered by Solid Quality Mentors 1) Microsoft SQL Server 2005/2008 Query Optimization & Performance Tuning – Pinal Dave Date: May 12-14, 2010 Price: Rs. 14,000/person for 3 days Discount Code: ‘SQLAuthority.com’ Effective Price: Rs. 11,000/person for 3 days 2) SharePoint 2010 – Joy Rathnayake Date: May 10-11, 2010 Price: Rs. 11,000/person for 3 days Discount Code: ‘SQLAuthority.com’ Effective Price: Rs. 8,000/person for 2 days Download the complete PDF brochure. To register, either send an email to [email protected] or call +91 95940 43399. Feel free to drop me an email at pinal “at” SQLAuthority.com for any additional information and clarification. Training Venue: Abridge Solutions, #90/B/C/3/1, Ganesh GHR & MSY Plaza, Vittalrao Nagar, Near Image Hospital, Madhapur, Hyderabad – 500 081. Additionally there is special program of SolidQ India Insider. This is only available to first few registrants of the courses only. Read more details about the course here. Read my TechEd India 2010 experience here. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Optimization, SQL Performance, SQL Query, SQL Server, SQL Tips and Tricks, SQL Training, SQLAuthority News, T SQL, Technology

    Read the article

  • Wise Selection of SEO Services Company

    As a site owner, you have to be wise enough in the selection of the SEO services company that will help your site rank high in the search engine. Be aware to some companies who are just interested with your money that will give you a poor outcome.

    Read the article

  • Search Engine Optimization - A Part of Web Promotion

    Search Engine Optimization (SEO) is considered as a technical part of Web promotion. This is true because it does lend a hand in the advertising of websites and simultaneously it requires some technical understanding - as a minimum familiarity with fundamental HTML. It is sometimes also called SEO copyrighting since most of the practice that are used to egg on sites in search engines pact with text.

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >