Search Results

Search found 9771 results on 391 pages for 'equivalence classes'.

Page 113/391 | < Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >

  • C# - What should I do when every inherited class needs getter from base class, but setter only for O

    - by msfanboy
    Hello, I have a abstract class called WizardViewModelBase. All my WizardXXXViewModel classes inherit from the base abstract class. The base has a property with a getter. Every sub class needs and overrides that string property as its the DisplayName of the ViewModel. Only ONE ViewModel called WizardTimeTableWeekViewModel needs a setter because I have to set wether the ViewModel is a timetable for week A or week B. Using 2 ViewModels like WizardTimeTableWeekAViewModel and WizardTimeTableWeekBViewModel would be redundant. I do not want to override the setter in all other classes as they do not need a setter. Can I somehow tell the sub class it needs not to override the setter? Or any other suggestion? With interfaces I would be free to use getter or setter but having many empty setter properties is not an option for me.

    Read the article

  • Monitoring Reasoning Progress using the Pellet Reasoner

    - by Nico
    I am currently constructing an OWL ontology, which - until very recently classified rapidly using the Pellet reasoner. However, since the introduction of several new classes, the reasoning performance has slowed to a crawl. Although the reasoner completes and the ontology does not contain any unsatisfiable concepts etc, the time the reasoning takes is unacceptable. I am currently trying to track down the offending classes/class that may have led to the slowdown. Here's my question: is it possible to log the reasoning progreess of Pellet? I.e. is it possible to produce some output that will document how long pellet has spent on certain reasoning tasks/traces how long reasoning over any given class and axiom takes? If so, does anyone have some java code they could post up? Thanks in advance for your answers!

    Read the article

  • Java Program Design Layout Recommendations?

    - by Leebuntu
    I've learned enough to begin writing programs from scratch, but I'm running into the problem of not knowing how to design the layout and implementation of a program. To be more precise, I'm having difficulty finding a good way to come up with an action plan before I dive in to the programming part. I really want to know what classes, methods, and objects I would need beforehand instead of just adding them along the way. My intuition is leading me to using some kind of charting software that gives a hierarchal view of all the classes and methods. I've been using OmniGraffle Pro and while it does seem to work somewhat, I'm still having trouble planning out the program in its entirety. How should I approach this problem? What softwares out there are available to help with this problem? Any good reads out there on this issue? Thanks so much! Edit: Oh yeah, I'm using Eclipse and I code mainly in Java right now.

    Read the article

  • Can pydoc/help hide the documentation for inherited class methods and attributes?

    - by EOL
    When declaring a class that inherits from a specific class: class C(dict): added_attribute = 0 the documentation for C lists all the methods of dict (either through help(C) or pydoc). Is there a way to hide the inherited methods from the automatically generated documentation (the documentation string can refer to the base class, for non-overwritten methods)? This would be useful: pydoc lists the functions defined in a module after its classes. Thus, when the classes have a very long documentation, a lot of less than useful information is printed before the new functions provided by the module are presented, which makes the documentation harder to exploit (you have to skip all the documentation for the inherited methods until you reach something specific to the module being documented).

    Read the article

  • Standard Workflow when working with JPA

    - by jschoen
    I am currently trying to wrap my head around working with JPA. I can't help but feel like I am missing something or doing it the wrong way. It just seems forced so far. What I think I know so far is that their are couple of ways to work with JPA and tools to support this. You can do everything in Java using annotations, and let JPA (whatever implementation you decide to use) create your schema and update it when changes are made. You can use a tool to reverse engineer you database and generate the entity classes for you. When the schema is updated you have to regenerate these classes, or manually update them. There seems to be drawbacks to both, and benefits to both (as with all things). My question is in an ideal situation what is the standard workflow with JPA? Most schemas will require updates during the maintenance phase and especially during the development phase, so how is this handled?

    Read the article

  • Is this physical collection class that contains only static methods an Anti-Pattern?

    - by Tj Kellie
    I'm trying to figure out if I should continue on with a current pattern in an application I'm working in, or refactor this into something else. I have a set of collection classes off a generic base of List. These classes have public constructors but contain only static methods that return collections. They look like this: public class UserObjCollection : BaseCollection<UserObj> { public static UserObjCollection GetAllUserObj() { UserObjCollection obj = new UserObjCollection(); obj.MapObjects(new UserObjDataService().GetAllUserObj()); return obj; } } Is this a Pattern or Anti-Pattern and what are the merits of this over a straight factory pattern?

    Read the article

  • Training new employees on undocumented code

    - by glowcoder
    Our company has a large codebase (2500+ classes/interfaces in just the core alone, many more in other projects) for our flagship software product. We've never really hired more than one developer at a time, so we don't have a real training process. We're going to be bringing in 2-5 more developers now, and probably more in the near future (to put things into perspective, we have 7 right now.) Obviously, we would like to get these guys up to speed as soon as possible. The catch - almost all of our classes (95%+) are completely undocumented. No javadoc, no design docs, basically completely undocumented. What strategies can we employ to bring the new developers up to speed? I'd like to consider situations that include the existing code getting documented, but it's possible management won't allow for the time to get that done, so I also must consider situations where that won't happen. Has anyone been there before? What worked well for you? Thanks!

    Read the article

  • How do you learn a class hierarchy quickly?

    - by rsteckly
    Hi, Something I don't enjoy about programming is learning a new API. For example, right now I'm trying to learn Windows Identity Foundation. Its frustrating because I'm going to spend the bulk of the time learning how a few classes work and actually only write several lines of code. In .NET, there are so many types that I seem to spend more time hunting around in msdn for a class than writing code. It also interrupts my workflow while I'm working because I have to type a little bit than look something up. Obviously, I don't have to do this for the basic classes. Whenever new things come though there is definitely some looking up to do. Then I often don't reuse that class enough to really review it or bring it into action. I'm wondering if anybody out there has a found a way to memorize (or look up more efficiently) these object model hierarchies?

    Read the article

  • Hierarchy inheritance

    - by reito
    I had faced the problem. In my C++ hierarchy tree I have two branches for entities of difference nature, but same behavior - same interface. I created such hierarchy trees (first in image below). And now I want to work with Item or Base classes independetly of their nature (first or second). Then I create one abstract branch for this use. My mind build (second in image below). But it not working. Working scheme seems (third in image below). It's bad logic, I think... Do anybody have some ideas about such hierarchy inheritance? How make it more logical? More simple for understanding? Image Sorry for my english - russian internet didn't help:) Update: You ask me to be more explicit, and I will be. In my project (plugins for Adobe Framemaker) I need to work with dialogs and GUI controls. In some places I working with WinAPI controls, and some other places with FDK (internal Framemaker) controls, but I want to work throw same interface. I can't use one base class and inherite others from it, because all needed controls - is a hierarchy tree (not one class). So I have one hierarchy tree for WinAPI controls, one for FDK and one abstract tree to use anyone control. For example, there is an Edit control (WinEdit and FdkEdit realization), a Button control (WinButton and FdkButton realization) and base entity - Control (WinControl and FdkControl realization). For now I can link my classes in realization trees (Win and Fdk) with inheritence between each of them (WinControl is base class for WinButton and WinEdit; FdkControl is base class for FdkButton and FdkEdit). And I can link to abstract classes (Control is base class for WinControl and FdkControl; Edit is base class for WinEdit and FdkEdit; Button is base class for WinButton and FdkButton). But I can't link my abstract tree - compiler swears. In fact I have two hierarchy trees, that I want to inherite from another one. Update: I have done this quest! :) I used the virtual inheritence and get such scheme (http://img12.imageshack.us/img12/7782/99614779.png). Abstract tree has only absolute abstract methods. All inheritence in abstract tree are virtual. Link from realization tree to abstract are virtual. On image shown only one realization tree for simplicity. Thanks for help!

    Read the article

  • C# dependency injection - how to you inject a dependency without source?

    - by Phil Harris
    Hi, I am trying to get started with some simple dependency injection using C# and i've run up against an issue that I can't seem to come up with an answer for. I have a class that was written by another department for which I don't have the source in my project. I wanted to inject an object of this type though a constructor using an interface, but of course, i can't change the injected objects implementation to implement the interface to achieve polymorphism when casting the object to the interface type. Every academic example I have ever seen of this technique has the classes uses classes which are declared in the project itself. How would I go about injecting my dependency without the source being available in the project? I hope that makes sense, thanks.

    Read the article

  • Getting all types from an assembly derived from a base class

    - by CaptnCraig
    I am trying to examine the contents of an assembly and find all classes in it that are directly or indirectly derived from Windows.Forms.UserControl. I am doing this: Assembly dll = Assembly.LoadFrom(filename); var types = dll.GetTypes().Where(x => x.BaseType == typeof(UserControl)); But it is giving an empty list because none of the classes directly extend UserControl. I don't know enough about reflection to do it quickly, and I'd rather not write a recursive function if I don't have to.

    Read the article

  • What is prefered stratigies for cross browser and multiple styled table in CSS

    - by jitendra
    in default css what should i predefined for <table>, td, th , thead, tbody, tfoot I have to work in a project there are so many tables with different color schemes and different type of alignment like in some table , i will need to horizontally align data of cell to right, sometime left, sometime right. same thing for vertical alignment, top, bottom and middle. some table will have thin border on row , some will have thick (same with column border). Some time i want to give different background color to particular row or column or in multiple row or column. So my question is: What code should i keep in css default for all tables and how to handle table with different style using ID and classes in multiple pages. I want to do every presentational thing with css. How to make ID classes for everything using semantic naming ? Which tags related to table can be useful?

    Read the article

  • jQuery slider widget background -- change dynamicaly

    - by publicRavi
    I use a custom background for my slider by overriding the CSS: .ui-widget-content {background: transparent url(../img/bg.png) no-repeat;} Slider's behavior is controlled by: $(document).ready(function() { $(".myslider5").slider({ animate: "true", step: 1, min: -1950, max: 1950, value: 0, slide: function(event, ui) { // magic happens here } }); There is a need for me to use 2 different classes for my slider DIV, based on some logic. So, myslider5 and myslider3 are the two classes. But their background images need to change too. How do I go about doing this?

    Read the article

  • How to link Cocoa static library to C command line target?

    - by Devara Gudda
    I have static library target, which uses Foundation classes(NSArray,etc) . I want to use this static library in Command line tool target. The command line tool contains only C files. From command line tool I want to call a method exported in static library. So I have modified header search path and linked the static library. When I compile the command line tool it is following linker errors. Undefined symbols: "_OBJC_CLASS_$_NSMutableArray", referenced from: "_objc_msgSend", referenced from: What is the method to link a static library which uses Foundation classes from a command line tool which contains C files? Regards Devara Gudda

    Read the article

  • execute java class with ant

    - by cateof
    I want my ant script to execute the command java -cp libs/a.jar:libs/b.jar org.stack.class1 --package pName --out classes new.wsdl How can I do it with an Ant script? The following does not work <?xml version="1.0" encoding="UTF-8"?> project name="class" default="compile"> <target name="compile"> <java classname="org.stack.class1" fork="true"> <classpath> <pathelement location="libs/a.jar"/> <pathelement location="libs/b.jar"/> </classpath> <arg value="--package pName --out classes new.wsdl"/> </java> </target>

    Read the article

  • Patterns for dynamic CMS components (event driven?)

    - by CitrusTree
    Sorry my title is not great, this is my first real punt at moving 100% to OO as I've been procedural for more years than I can remember. I'm finding it hard to understand if what I'm trying to do is possible. Depending on people's thoughts on the 2 following points, I'll go down that route. The CMS I'm putting together is quote small, however focuses very much on different types of content. I could easily use Drupal which I'm very comfortable with, but I want to give myself a really good reasons to move myself into design patterns / OO-PHP 1) I have created a base 'content' class which I wish to be able to extend to handle different types of content. The base class, for example, handles HTML content, and extensions might handle XML or PDF output instead. On the other hand, at some point I may wish to extend the base class for a given project completely. I.e. if class 'content-v2' extended class 'content' for that site, any calls to that class should actually call 'content-v2' instead. Is that possible? If the code instantiates an object of type 'content' - I actually want it to instantiate one of type 'content-v2'... I can see how to do it using inheritance, but that appears to involve referring to the class explicitly, I can't see how to link the class I want it to use instead dynamically. 2) Secondly, the way I'm building this at the moment is horrible, I'm not happy with it. It feels very linear indeed - i.e. get session details get content build navigation theme page publish. To do this all the objects are called 1-by-1 which is all very static. I'd like it to be more dynamic so that I can add to it at a later date (very closely related to first question). Is there a way that instead of my orchestrator class calling all the other classes 1-by-1, then building the whole thing up at the end, that instead each of the other classes can 'listen' for specific events, then at the applicable point jump in and do their but? That way the orchestrator class would not need to know what other classes were required, and call them 1-by-1. Sorry if I've got this all twisted in my head. I'm trying to build this so it's really flexible.

    Read the article

  • Is there a reason why a base class decorated with XmlInclude would still throw a type unknown exception when serialized?

    - by Tedford
    I will simplify the code to save space but what is presented does illustrate the core problem. I have a class which has a property that is a base type. There exist 3 dervived classes which could be assigned to that property. If I assign any of the derived classes to the container then the XmlSerializer throws dreaded "The type xxx was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically." exception when attempting to seralize the container. However my base class is already decorated with that attribute so I figure there must be an additional "hidden" requirement. The really odd part is that the default WCF serializer has no issues with this class hierarchy. The Container class [DataContract] [XmlRoot(ElementName = "TRANSACTION", Namespace = Constants.Namespace)] public class PaymentSummaryRequest : CommandRequest { /// <summary> /// Gets or sets the summary. /// </summary> /// <value>The summary.</value> /// <remarks></remarks> [DataMember] public PaymentSummary Summary { get; set; } /// <summary> /// Initializes a new instance of the <see cref="PaymentSummaryRequest"/> class. /// </summary> public PaymentSummaryRequest() { Mechanism = CommandMechanism.PaymentSummary; } } The base class [DataContract] [XmlInclude(typeof(xxxPaymentSummary))] [XmlInclude(typeof(yyyPaymentSummary))] [XmlInclude(typeof(zzzPaymentSummary))] [KnownType(typeof(xxxPaymentSummary))] [KnownType(typeof(xxxPaymentSummary))] [KnownType(typeof(zzzPaymentSummary))] public abstract class PaymentSummary { } One of the derived classes [DataContract] public class xxxPaymentSummary : PaymentSummary { } The serialization code var serializer = new XmlSerializer(typeof(PaymentSummaryRequest)); serializer.Serialize(Console.Out,new PaymentSummaryRequest{Summary = new xxxPaymentSummary{}}); The Exception System.InvalidOperationException: There was an error generating the XML document. --- System.InvalidOperationException: The type xxxPaymentSummary was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically. at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPaymentSummaryRequest.Write13_PaymentSummary(String n, String ns, PaymentSummary o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPaymentSummaryRequest.Write14_PaymentSummaryRequest(String n, String ns, PaymentSummaryRequest o, Boolean isNullable, Boolean needType) at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterPaymentSummaryRequest.Write15_TRANSACTION(Object o) --- End of inner exception stack trace --- at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id) at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces) at UserQuery.RunUserAuthoredQuery() in c:\Users\Tedford\AppData\Local\Temp\uqacncyo.0.cs:line 47

    Read the article

  • Hibernate pluralization

    - by matiasf
    I have A MySQL database currently in production use for a CakePHP application A Java SE application accessing the same database via Hibernate, currently in development. I'm using the Netbeans "automigrate" feature to create the POJO classes and XML files (do I really need the XML files when using annotations?). As the schema is quite complex creating the tables manually is way too much work. Cake expects all DB tables to be pluralized (the Address class is automagically mapped to the addresses table). When running the Netbeans automigration it then does pluralization on the already pluralized table names (I'm getting Addresses.java and setAddresseses() methods). I know I'm asking for trouble running two very different data layers against the same database, but I'd like to know if it's possible to have Netbeans generating the POJO classes in singular form or if there is another (better) way to manage this.

    Read the article

  • Reflection: take values from an unknown running alpplication

    - by Dr.Lesh
    I'm writing an application that searchs for Semaphore types in the fields of unknown classes in unknown application (passed by user). I made it using Reflection and it worked. Now I want to fill up these semaphores with values, taking them from a running instance of this unknown application. So i took the class with "main" method of this unknown application, made a newInstance, and passed it when invoking the main method to start the application: Class mainClass = getItSomeWhere(); Object instance = mainClass.newInstance(); Method mainMethod = mainClass.getDeclaredMethod("main", new Class[]{String[].class}); mainMethod.invoke(instance, new Object[]{args}); and it worked fine. Now, how can I get the semaphore values, taking them from the classes of this running application, when I only have an instance of the main class? Many thanks for the answers.

    Read the article

  • Page inheritance in mixed asp.net Forms and MVC application

    - by Rising Star
    I'm working on a web application. One of my co-workers has written some asp.net forms pages. The page classes all inherit from BasePageClass, which of course inherits from the Page class. I wish to add some MVC controllers that I've been told need to use the same logic implemented in the BasePageClass. Ordinarily, I would want to inherit the functions in the BasePageClass in the controller classes, but this breaks the inheritance heirarchy. What is the best practice for solving this problem?

    Read the article

  • CSS selectors : should I minimise my use of the class attribute in the HTML or optimise the speed

    - by Laurent Bourgault-Roy
    As I was working on a small website, I decided to use the PageSpeed extension to check if their was some improvement I could do to make the site load faster. However I was quite surprise when it told me that my use of CSS selector was "inefficient". I was always told that you should keep the usage of the class attribute in the HTML to a minimum, but if I understand correctly what PageSpeed tell me, it's much more efficient for the browser to match directly against a class name. It make sense to me, but it also mean that I need to put more CSS classes in my HTML. It also make my .css file a little harder to read. I usually tend to mark my CSS like this : #mainContent p.productDescription em.priceTag { ... } Which make it easy to read : I know this will affect the main content and that it affect something in a paragraph tag (so I wont start to put all sort of layout code in it) that describe a product and its something that need emphasis. However it seem I should rewrite it as .priceTag { ... } Which remove all context information about the style. And if I want to use differently formatted price tag (for example, one in a list on the sidebar and one in a paragraph), I need to use something like that .paragraphPriceTag { ... } .listPriceTag { ... } Which really annoy me since I seem to duplicate the semantic of the HTML in my classes. And that mean I can't put common style in an unqualified .priceTag { ... } and thus I need to replicate the style in both CSS rule, making it harder to make change. (Altough for that I could use multiple class selector, but IE6 dont support them) I believe making code harder to read for the sake of speed has never been really considered a very good practice . Except where it is critical, of course. This is why people use PHP/Ruby/C# etc. instead of C/assembly to code their site. It's easier to write and debug. So I was wondering if I should stick with few CSS classes and complex selector or if I should go the optimisation route and remove my fancy CSS selectors for the sake of speed? Does PageSpeed make over the top recommandation? On most modern computer, will it even make a difference?

    Read the article

< Previous Page | 109 110 111 112 113 114 115 116 117 118 119 120  | Next Page >