Search Results

Search found 6357 results on 255 pages for 'generic relations'.

Page 164/255 | < Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >

  • ObservableCollection Implementation

    - by wpfwannabe
    I know I am missing something obvious but I can't seem to implement ObservableCollection in my class below. IE it won't show up in intellsense. Can someone please let me know what I am missing. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; using System.Collections.ObjectModel; using System.Reflection; using System.ComponentModel; namespace MyBTOList { public class InventoryListBTO : List<InventoryBTO> { /// <summary> /// Get all inventory records from local database /// </summary> /// <returns></returns> public static InventoryListBTO GetAllInventoryRecords() { return GetInventoryListBO(Inventory.GetAllInventoryRecordsDb()); } } public class InventoryBTO : INotifyPropertyChanged { }

    Read the article

  • Check if table exists in c#

    - by apoorv020
    I want to read data from a table whose name is supplied by a user. So before actually starting to read data, I want to check if the database exists or not. I have seen several pieces of code on the NET which claim to do this. However, they all seem to be work only for SQL server, or for mysql, or some other implementation. Is there not a generic way to do this? (I am already seperately checking if I can connect to the supplied database, so I'm fairly certain that a connection can be opened to the database.)

    Read the article

  • Can I have one makefile to build a hierarchical project?

    - by saramah
    I have several hundred files in a non-flat directory structure. My Makefile lists each sourcefile, which, given the size of the project and the fact that there are multiple developers on the project, can create annoyances when we forget to put a new one in or take out the old ones. I'd like to generalize my Makefile so that make can simply build all .cpp and .h files without me having to specify all the filenames, given some generic rules for different types of files. My question: given a large number of files in a directory with lots of subfolders, how do I tell make to build them all without having to specify each and every subfolder as part of the path? And how do I make it so that I can do this with only one Makefile in the root directory?

    Read the article

  • Performance intensive string splitting and manipulation in java

    - by juhanic
    What is the most efficient way to split a string by a very simple separator? Some background: I am porting a function I wrote in C with a bunch of pointer arithmetic to java and it is incredibly slow(After some optimisation still 5* slower). Having profiled it, it turns out a lot of that overhead is in String.split The function in question takes a host name or ip address and makes it generic: 123.123.123.123-*.123.123.123 a.b.c.example.com-*.example.com This can be run over several million items on a regular basis, so performance is an issue.

    Read the article

  • Visual Studio XSD Tool: Generate Collections Rather Than Arrays

    - by senfo
    I generated some C# classes from an XSD using the Visual Studio XSD utility and it generated arrays for storing a collection of elements, rather than one of the built-in generic Collection<T> (or related) classes. None of the command line parameters mentioned in xsd /? mention anything about generating collections rather than arrays, but I know that this can be done with web service proxy classes that Visual Studio generates, so I figured it must be possible. Does anybody know how to have the XSD utility generate collection classes rather than arrays?

    Read the article

  • MySQL/SQL: Update with correlated subquery from the updated table itself

    - by Roee Adler
    I have a generic question that I will try to explain using an example. Say I have a table with the fields: "id", "name", "category", "appearances" and "ratio" The idea is that I have several items, each related to a single category and "appears" several times. The ratio field should include the percentage of each item's appearances out of the total number of appearances of items in the category. In pseudo-code what I need is the following: For each category find the total sum of appearances for items related to it. For example it can be done with (select sum("appearances") from table group by category) For each item set the ratio value as the item's appearances divided by the sum found for the category above Now I'm trying to achieve this with a single update query, but can't seem to do it. What I thought I should do is: update Table T set T.ratio = T.appearances / ( select sum(S.appearances) from Table S where S.id = T.id ) But MySQL does not accept the alias T in the update column, and I did not find other ways of achieving this. Any ideas?

    Read the article

  • SMS Receiving using DOTNET C#

    - by sheery
    Hi dears, I have build an application using C# to send and receive sms, my application works fine for sending sms but when i try to read sms from my mobile through my application i get following error "Error: Phone reports generic communication error or syntax error." can any one help me in this matter, my syntax for reading sms is private void btnReadMessages_Click(object sender, System.EventArgs e) { Cursor.Current = Cursors.WaitCursor; string storage = GetMessageStorage(); try { // Read all SMS messages from the storage DecodedShortMessage[] messages = comm.ReadMessages(PhoneMessageStatus.All, storage); foreach(DecodedShortMessage message in messages) { Output(string.Format("Message status = {0}, Location = {1}/{2}", StatusToString(message.Status), message.Storage, message.Index)); ShowMessage(message.Data); Output(""); } Output(string.Format("{0,9} messages read.", messages.Length.ToString())); Output(""); } catch(Exception ex) { ShowException(ex); } Cursor.Current = Cursors.Default; }

    Read the article

  • LINQ - Contains with anonymous type

    - by Marlos
    When using this code (simplified for asking): var rows1 = (from t1 in db.TABLE1 where (t1.COLUMN_A == 1) select new { t1.COLUMN_B, t1.COLUMN_C }); var rows2 = (from t2 in db.TABLE2 where (rows1.Contains(t2.COLUMN_A)) select t2; I got the following error: The type arguments for method 'System.Linq.Enumerable.Contains(System.Collections.Generic.IEnumerable, TSource)' cannot be inferred from the usage. Try specifying the type arguments explicitly. I need to filter the first result by COLUMN_B, but I don't know how. Is there a way to filter it?

    Read the article

  • Performance statistics hooks

    - by tinny
    Lets be honest, most software that developers produce has quite modest performance requirements. E.g. Systems perhaps serving 100's of requests per second, if that. But lets assume for a moment (or even dream) that you where perhaps involved in the "next big thing" (whatever that means) and you wanted to put some sort of performance statistics logging in place to help you out when all those users come flying in. Performance statistics logging, how would you approach this requirement? Perhaps you would use some sort of generic framework for this? Or roll your own solution? What would you log? How granular? Or would you not even bother putting anything in place and rather deal with this issue when it actually became an issue? It would be really interesting to hear your thoughts on this topic.

    Read the article

  • .net Diagnostics best practices?

    - by mamu
    We initially didn't use any logging or debug tracing but after spending few weeks to trace down some data corruption we decided to put required Debug.Write and Trace for production and Debug.Assert So now question is What is the best practice to use debug and trace logging. I am just looking for some thing generic. public void AddRectodatabase(object record) { Debug.WriteLine(record.ToString()); Trace.WriteLine(record.ToString()); // Add it to databse Debug.Assert(true, "Use this on case by case basis"); } Is this good enough for general purpose, am i doing anything wrong in there? We want to stick with .net System.Diagnostics over other alternatives like log4net. Is there any thing else useful in System.Diagnostics?

    Read the article

  • Service locator for generics

    - by vittore
    Hi everyone, I have say a dozen types T which inherit from EntityObject and IDataObject. I have generic the following interface IDataManager<T> where T : EntityObject, IDataObject ... I have also base class for data managers BaseDataManager<T> : IDataManager<T> where T : EntityObject, IDataObject .... And i have particular classes public class Result : EntityObject, IDataObject .... public class ResultDataManager : BaseDataManager<Result> ... I want to implement service locator, which will return instance of IDataManager<T> for T But I stucked how to implement it in a neat way without a lot of castings. Any ideas?

    Read the article

  • Why do Java/C# edge out C++ as the recommended language to learn OOP on S.O?

    - by viksit
    I noticed after reading the answers/discussion to this question (What is the best language to learn OOP on?) - that more and more people are recommending C# or Java over C++ to learn OOP on. A simple term search on that answer page results in 10 hits for C++, 21 for C# and 27 for Java. Now, I understand that these 2 languages fix a lot of quirks and issues with C++, and looked up these resources that relate mostly to performance, JVM vs native implementation, systems focus vs applications, manual memory management vs automated et al. My question is - are there any fundamental differences in the OO capabilities of Java/C# vs C++? Or are the former recommended purely due to their generic ease of use/improvements over the latter? Thanks. PS, I'm aware of Java interface inheritance vs C++ multiple inheritance as a difference. I would consider that an implementational one rather than functional.

    Read the article

  • nhibernate : mapping to column other than primary key

    - by frosty
    I have the following map. My intention is for the order.BasketId to map to orderItem.BasketId. Tho when i look at the sql i see that it's mapping order.Id to orderItem.BasketId. How do i define in my order map which order property to map against basketId. It seems to default to the primary key. <property name="BasketId" column="Basket_ID" type="Int32"/> <set name="OrderItems" table="item_basket_contents" generic="true" inverse="true" > <key column="Basket_ID" /> <one-to-many class="EStore.Domain.Model.OrderItem, EStore.Domain"/> </set>

    Read the article

  • How Can i click on this element using XPATH in Web driver?

    - by Mike
    Here is the html..... <li> <input type="checkbox" checked="" name="selectedMstrPrivGroupList[9].mstrAuthorities[0].status"/> Add Dexter </li> How will I be able to click on this element. It is a check box. And I want to use XPath as I have close to 30+ checkboxes in the page, so that I can create a generic method and pass only the Webelement.. I tried the following but didn't work. Driver.findElement(By.xpath("//input[contains(.,'Add Dexter')]")).click(); Please help!! Thanks, Mike

    Read the article

  • Can a single solution hold projects from multiple repositories?

    - by cyclotis04
    I've begun setting up SVN repositories to store my code, and am wondering if a single Visual Studio solution can have projects from multiple repositories. I have a shared library with different helper functions, generic custom controls, etc, that are used by multiple projects, and hosted in its own repository. Then I have my project repository, which contains all of the program-specific code such as forms, etc. I know I could copy the shared library into the program's repository, then copy them back when I make changes, but I'd much rather keep them in different repositories so I can hit "Commit" and the general library commits to it's repository, and the program code commits to it. I'm currently using AnkhSVN, but if it's possible with other tools, I'll look into it. Preemptive clarification for all the "just use one repository" answers: The shared library is hosted in an online repository, viewable by anyone, but the program code is proprietary and resides on our office servers, so they need different repositories.

    Read the article

  • Genetic programming in c++, library suggestions?

    - by shuttle87
    I'm looking to add some genetic algorithms to an Operations research project I have been involved in. Currently we have a program that aids in optimizing some scheduling and we want to add in some heuristics in the form of genetic algorithms. Are there any good libraries for generic genetic programming/algorithms in c++? Or would you recommend I just code my own? I should add that while I am not new to c++ I am fairly new to doing this sort of mathematical optimization work in c++ as the group I worked with previously had tended to use a proprietary optimization package. We have a fitness function that is fairly computationally intensive to evaluate and we have a cluster to run this on so parallelized code is highly desirable. So is c++ a good language for this? If not please recommend some other ones as I am willing to learn another language if it makes life easier. thanks!

    Read the article

  • Data bind enum properties to grid and display description

    - by TrueWill
    This is a similar question to How to bind a custom Enum description to a DataGrid, but in my case I have multiple properties. public enum ExpectationResult { [Description("-")] NoExpectation, [Description("Passed")] Pass, [Description("FAILED")] Fail } public class TestResult { public string TestDescription { get; set; } public ExpectationResult RequiredExpectationResult { get; set; } public ExpectationResult NonRequiredExpectationResult { get; set; } } I'm binding a BindingList<TestResult> to a WinForms DataGridView (actually a DevExpress.XtraGrid.GridControl, but a generic solution would be more widely applicable). I want the descriptions to appear rather than the enum names. How can I accomplish this? (There are no constraints on the class/enum/attributes; I can change them at will.)

    Read the article

  • How to add reference an assembly that is not in the GAC from a t4mvc template (.tt)

    - by stephen
    I have found the place near the very top in a T4MVC template file (.tt) where assembly references can be added, which looks like: <#@ assembly name="System.Core" #> <#@ import namespace="System.Collections.Generic" #> However, it seems that I can only reference assemblies that are in the GAC. i.e. if I have an assembly MyProject.Stuff.dll (not in the GAC) added as a reference to the VS project containing the template then I expected to be able to add something like the following: <#@ assembly name="MyProject.Stuff" #> <#@ import namespace="MyProject.Stuff" #> If I do this then I get the following error: Error 1 Compiling transformation: Metadata file 'MyProject.Stuff' could not be found C:\Work\Development\DotNetSolution\MyProject\Utils\T4MVC\T4MVC.tt 1 1 How can I add a reference to an assembly that isn't in the GAC?

    Read the article

  • Strategy in storing ad-hoc numbers/constants?

    - by Jiho Han
    I have a need to store a number of ad-hoc figures and constants for calculation. These numbers change periodically but they are different type of values. One might be a balance, a money amount, another might be an interest rate, and yet another might be a ratio of some kind. These numbers are then used in a calculation that involve other more structured figures. I'm not certain what the best way to store these in a relational DB is - that's the choice of storage for the app. One way, I've done before, is to create a very generic table that stores the values as text. I might store the data type along with it but the consumer knows what type it is so, in situations I didn't even need to store the data type. This kind of works fine but I am not very fond of the solution. Should I break down each of the numbers into specific categories and create tables that way? For example, create Rates table, and Balances table, etc.?

    Read the article

  • Visual Studio 2005 - VC++ compiler C1001 on Windows 7

    - by Fritz H
    When I try to build a simple "Hello World" C++ app on Windows 7 Beta, using Visual Studio 2005 (VC++2005) I get a rather generic error C1001 error (Internal compiler error) The compiler seems to just crash, and Windows pops up its (un)helpful This program has stopped working dialog. The file it complains about is mcp1.cpp. Has anyone come across this before? Cheers, Fritz EDIT: The code is: #include <iostream> int main(int argc, char** argv) { std::cout << "Hello!"; return 0; } EDIT 2: I have installed SP1 as well as SP1 for Vista. VS popped up a warning saying it needs SP1 for Vista, but installing it makes no difference. No ideas about what I can possibly do to fix this?

    Read the article

  • Longer Form Fields in Drupal

    - by Slinger Jansen
    I have a really silly problem that has cost me a load of time already. I have created a content template with a URL in there. When I look at the HTML code for it, I see a big fat "maxlength=256" in the form tag. I'd like to expand the length of this field, because my customer wishes to enter really long links (over 500 characters). Any idea how I can change it? When I do a generic search through the code I see so many occurences of 256, but the length might just as well be in the database somewhere. I have of course made the database field a longer varchar (1024 sounded poetic to me), so that's something I don't have to worry about. I think it's silly, but the customer's always right, as we know. I am using Drupal 6.14.

    Read the article

  • Good book(s) for MMORPG design & implementation?

    - by mawg
    I am a long time professional C/C++ programmer (mostly embedded systems) and a hobbyist windows & php hacker. Can anyone recommend a book(s) specifically aimed at designing and (hopefully) implementing an MMORPG? I don't need general how to design or how to code books. Maybe a really good generic games book, but I am not interested in 1st person shooters, I want to know what it takes to implement an MMORPG. Good books, maybe also good URLs. Thanks just searching eBay and Amazon threw up a whole slew of books. Amazon's customer reviews give me an idea of how good they are, and the overview tells me what areas they cover

    Read the article

  • JAXB Customizations and List<Object>

    - by DaUltimateTrooper
    Hi everybody. I used JAXB to create some classes from an XSD. The result was not quite what I expected and most probably it can be customized. It created a generic list instead of 3 different lists. Can this be corrected somehow? @XmlElements({ @XmlElement(name = "M1", type = M1_Type.class), @XmlElement(name = "M2", type = M2_Type.class), @XmlElement(name = "M3", type = M3_Type.class) }) protected List<Object> m1Orm2OrM3; Is there a customization to fix this?

    Read the article

  • Determine if on product page programmatically in Magento

    - by dfondente
    I want to insert tracking codes on all of the pages of a Magento site, and need to use a different syntax if the page is a CMS page, a category browsing page, or a product view page. I have a custom module set up with a block that inserts a generic tracking code on each page for now. From within the block, how can I distinguish between CMS pages, category pages, and product pages? I started with: Mage::app()->getRequest(); I can see that Mage::app()->getRequest()->getParam('id'); returns the product or category ID on product and category pages, but doesn't distinguish between those page types. Mage::app()->getRequest()->getRouteName(); return "cms" for CMS pages, but returns "catalog" for both category browsing and product view pages, so I can't use that to tell category and product pages apart. Is there some indicator in the request I can use safely? Or is there a better way to accomplish my goal of different tracking codes for different page types?

    Read the article

  • Comparison of collection datatypes in C#

    - by Joel in Gö
    Does anyone know of a good overview of the different C# collection types? I am looking for something showing which basic operations such as Add, Remove, RemoveLast etc. are supported, and giving the relative performance. It would be particularly interesting for the various generic classes - and even better if it showed eg. if there is a difference in performance between a List<T> where T is a class and one where T is a struct. A start would be a nice cheat-sheet for the abstract data structures, comparing Linked Lists, Hash Tables etc. etc. Thanks!

    Read the article

< Previous Page | 160 161 162 163 164 165 166 167 168 169 170 171  | Next Page >