Search Results

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

Page 191/391 | < Previous Page | 187 188 189 190 191 192 193 194 195 196 197 198  | Next Page >

  • a design to avoid circular reference in this scenario

    - by BDotA
    Here is our dependency tree: BigApp - Child Apps - Libraries ALL of our components are HEAVILY using one of the Libraries as above ( LibA). But it has a ‘few’ public methods that require classes from ‘higher-level’ assemblies and we want to avoid CIRCULAR references. What do you propose as a good design for this?

    Read the article

  • How can I link two Java serialised objects back together?

    - by Kidburla
    Sometimes (quite a lot, actually) we get a situation in Java where two objects are pointing to the same thing. Now if we serialise these separately it is quite appropriate that the serialised forms have separate copies of the object as it should be possible to open one without the other. However if we now deserialise them both, we find that they are still separated. Is there any way to link them back together? Example follows. public class Example { private static class ContainerClass implements java.io.Serializable { private ReferencedClass obj; public ReferencedClass get() { return obj; } public void set(ReferencedClass obj) { this.obj = obj; } } private static class ReferencedClass implements java.io.Serializable { private int i = 0; public int get() { return i; } public void set(int i) { this.i = i; } } public static void main(String[] args) throws Exception { //Initialise the classes ContainerClass test1 = new ContainerClass(); ContainerClass test2 = new ContainerClass(); ReferencedClass ref = new ReferencedClass(); //Make both container class point to the same reference test1.set(ref); test2.set(ref); //This does what we expect: setting the integer in one (way of accessing the) referenced class sets it in the other one test1.get().set(1234); System.out.println(Integer.toString(test2.get().get())); //Now serialise the container classes java.io.ObjectOutputStream os = new java.io.ObjectOutputStream(new java.io.FileOutputStream("C:\\Users\\Public\\test1.ser")); os.writeObject(test1); os.close(); os = new java.io.ObjectOutputStream(new java.io.FileOutputStream("C:\\Users\\Public\\test2.ser")); os.writeObject(test2); os.close(); //And deserialise them java.io.ObjectInputStream is = new java.io.ObjectInputStream(new java.io.FileInputStream("C:\\Users\\Public\\test1.ser")); ContainerClass test3 = (ContainerClass)is.readObject(); is.close(); is = new java.io.ObjectInputStream(new java.io.FileInputStream("C:\\Users\\Public\\test2.ser")); ContainerClass test4 = (ContainerClass)is.readObject(); is.close(); //We expect the same thing as before, and would expect a result of 4321, but this doesn't happen as the referenced objects are now separate instances test3.get().set(4321); System.out.println(Integer.toString(test4.get().get())); } }

    Read the article

  • Difference between a Deprecated and Legacy API?

    - by Vaibhav Bajpai
    I was studying the legacy API's in the Java's Collection Framework and I learnt that classes such as Vector and HashTable have been superseded by ArrayList and HashMap. However still they are NOT deprecated, and deemed as legacy when essentially, deprecation is applied to software features that are superseded and should be avoided, so, I am not sure when is a API deemed legacy and when it is deprecated.

    Read the article

  • Adding the text area input to a list with jquery

    - by amylynn83
    I am making a shopping list app. When an item is added to the text input, it should be converted into a list item with a class of "tile" and added to the beginning of the list with a class of ".shopping_item_list". Here is my HTML: <section> <h1 class="outline">Shopping List Items</h1> <ul class="shopping_item_list"> <li class="tile">Flowers<span class="delete">Delete</span></li> </ul> </section> My jQuery: $("input[name='shopping_item']").change(function() { var item = $(this).val(); $("<li class='tile'>+ item +</li>").prependTo(".shopping_item_list"); $(".tile").removeClass("middle"); $(".shopping_item_list li:nth-child(3n+2)").addClass("middle"); }); This isn't working, and I can't figure out why. I'm new to jQuery. Also, I need to add the "delete" span to the list item and am not sure how. Thanks for any help you can offer! Edited to add: Thanks to the feedback here, I was able to make it work with: $("input[name='shopping_item']").change(function() { var item = $(this).val(); $("<li class='tile'>" + item + "<span class='delete'>Delete</span>" + " </li>").prependTo(".shopping_item_list"); $(".tile").removeClass("middle"); $(".shopping_item_list li:nth-child(3n+2)").addClass("middle"); }); However, in my jquery, I have functions for the classes "tile" and "delete" that are not working for newly added items. // hide delete button $(".delete").hide(); // delete square $(".tile").hover(function() { $(this).find(".delete").toggle(); }); $(".tile").on("click", ".delete", function() { $(this).closest("li.tile").remove(); $(".tile").removeClass("middle"); $(".shopping_item_list li:nth-child(3n+2)").addClass("middle"); }); // cross off list $(".tile").click(function() { $(this).toggleClass("deleteAction"); }); The new items, which have these classes applied aren't using these functions at all. Do I need to add the functions below the add item? Does the order in which they appear in my js file matter? Do I need to add some kind of function?

    Read the article

  • meaning of import statement in java file

    - by Rozer
    Can any one clear me exactly what happend when we do import statement in java files. does it inscrease the size of file if we add more and more java classes. why we dont use classloader for the same and what are the restrictin for importing.

    Read the article

  • Sharing code between Android and Windows Mobile

    - by reuscam
    I'm doing some initial research on smart phone development, and I noticed that Android and Windows Mobile both support c++ for application development. I was curious if anyone had any experience trying to manage shared files between both Android and Windows Mobile, and to what extent that code can be shared? e.g. no user interface can be shared, but web service and business logic classes can be shared, etc.

    Read the article

  • Unit testing directory structure

    - by zachary
    Huge project tons of classes and directories. Do I make my unit test project mirror these directories or do I put them all at the root directory? Somewhat annoying to have to make directory changes and class name changes twice.

    Read the article

  • Why should Java ThreadLocal variables be static

    - by kellyfj
    I was reading that JavaDoc for Threadlocal here http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ThreadLocal.html and it says "ThreadLocal instances are typically private static fields in classes that wish to associate state with a thread (e.g., a user ID or Transaction ID). " But my question is why did they choose to make it static (typically) - it makes it a bit confusing to have "per thread" state but its static?

    Read the article

  • using generic and for each loop in jsp

    - by mawia
    I am developing a web application. I am using Eclipse as IDE. I was using generic and for each loop, both being feature of java 1.5, and it compiled quite fine when used in backend means in simple java classes. But when I'm using these on jsp, jsp is failing to compile with error showing generic and for each as culprit. Can you shed some light on this? Maybe I am at fault with Eclipse settings?

    Read the article

  • nsmutablearray and saving to file

    - by Amir
    hello all, I have class named Shop that contain data members (NSString , NSInteger and nsmutablearray that contain another class(that have also NSString and NSInteger) Now if i use nsmutablearray to hold alist of Shops what is the best way to save the list to file and load it later? again the class Shop contain data memeber that is another class both of the classes have NSString and NSinteger (maybe also NSdata and NSdate) i heard somthing about archiver?? thanks.

    Read the article

  • C++ - Is it possible to implement memory leak testing in a unit test?

    - by sevaxx
    I'm trying to implement unit testing for my code and I'm having a hard time doing it. Ideally I would like to test some classes not only for good functionality but also for proper memory allocation/deallocation. I wonder if this check can be done using a unit testing framework. I am using Visual Assert btw. I would love to see some sample code , if possible !

    Read the article

  • Do I Need To Reference Indirect DLLs

    - by ChloeRadshaw
    Suppose I have DLLA which is a standalone library that contains classes I use I have DLLB that references DLLA I now have DLLC that references DLLB - Why is it that DLLC also needs a reference to DLLA? Can I not have VS2005 build a dll which contains all the assemblies it needs embedded inside it?

    Read the article

  • .NET Results Class

    - by pm_2
    I have a C# function that does some processing and needs to return figures about what it has processed, success, failure, etc. Can anyone tell me if there are any standard framework classes that will handle this (for example, number of records processed, number successful, failed, etc) ? Alternatively, can anyone say how they usually handle this? Is the best way to create a class, or to use out parameters?

    Read the article

  • Main point of Application Delegate class

    - by ahmet732
    What's the main point behind putting variables and method signatures inside ApplicationDelegate.h in Objective-C ? By doing this, all those methods and variables are seen by another view controller classes? Is that the point? And also: is there only one application delegate class inside each project?

    Read the article

  • Need help setting up doctrine 2 cascade deletes

    - by jiewmeng
    I am quite confused setting up cascade deletes in Doctrine 2. Here's what my setup looks like I want to setup cascading so that I can do something like $list->getStages()->clear() I tried in Stage class /** * @OneToMany(targetEntity="TaskProgress", mappedBy="stage", cascade={"remove"}) */ protected $taskStages; But that did nothing, I even tried putting the same thing in other classes like List, TaskProgress or Task but nothing seem to work, I may have done it wrong tho ..

    Read the article

  • How value objects are saving and loading?

    - by yeraycaballero
    Since there isn't respositories for value objects. How can I load all value objects? Suppose we are modeling a blog application and we have this classes: Post (Entity) Comment (Value object) Tag (Value object) PostsRespository (Respository) I Know that when I save a new post, its tags are saving with it in the same table. But how could I load all tags of all posts. Has PostsRespository got a method to load all tags? I usually do it, but I want to know others opinions

    Read the article

< Previous Page | 187 188 189 190 191 192 193 194 195 196 197 198  | Next Page >