Search Results

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

Page 79/391 | < Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >

  • Creating multiple log files of different content with log4j

    - by Daniel
    Is there a way to configure log4j so that it outputs different levels of logging to different appenders? I'm trying to set up multiple log files. The main log file would catch all INFO and above messages for all classes. (In development, it would catch all DEBUG and above messages, and TRACE for specific classes.) Then, I would like to have a separate log file. That log file would catch all DEBUG messages for a specific subset of classes, and ignore all messages for any other class. Is there a way to get what I'm after? Thanks, Dan

    Read the article

  • How can I stub out a call to super in a imported Java class in JRuby for testing

    - by Doug Chew
    I am testing Java classes with RSpec and JRuby. How can I stub out a call to super in an imported Java class in my RSpec test? For example: I have 2 Java classes: public class A{ public String foo() { return "bar"; } } public class B extends A public String foo() { // B code return super.foo(); } } I am just trying to test the code in B.foo and not the code in A.foo with JRuby. How can I stub out the call to the super class method in my RSpec test? rspec test: java_import Java::B describe B do it "should not call A.foo" do # some code to stub out A.foo b = B.new b.foo.should_not == "bar" end end I have tried including a module with a new foo method in B's class hoping that it would hit the module method first but B still makes a call to A. The inserting module technique works in Ruby but not with JRuby and imported Java classes. Any other ideas to stub out the superclass method to get my RSpec test to pass?

    Read the article

  • Looking for Eclipse plugin: Lock source tabs in place

    - by Fredrik
    When working with java code in Eclipse I can typically juggle between 20-40 different files, but there usually are just two that I actively work with at the time (test and code). Going back to the code where I want to work after having debugged through 5-10 classes can be a pain. So what I would like to do is to be able to right click on the tab of a class and choose to lock them in place. The classes would then always be available as the first and second tabs furthest to the left in the editor. All other classes (and other files opened in the editor) would then fight over the remaining space in the editor like today. Is there a plugin like this? My google-fu might not be strong enough, cause I find nothing.

    Read the article

  • Symbol error in java application using netbeans 6.8 when adding a shared project to library

    - by Malachi
    I have a project which has shared functionality between three other projects and have linked these to existing projects as I normally would using the add project functionality of the libraries folder. This all used to work however when I started up Netbeans yesterday it just wasn't working as in the other projects won't compile even though the projects are linked. It can recognise the packages - just the actual classes themselves were not recognised... and to add to the weirdness some of the classes are getting picked up fine. I have checked the dist folder of the shared project and the Shared.jar file exists. Also I have checked the Jar and the other classes that are not being recognises are there also. Any suggestions? Solution I had to reinstall netbeans to get this solution resolved

    Read the article

  • How far does Dependency Injection reach?

    - by Baddie
    My web app solution consists of 3 projects: Web App (ASP.NET MVC) Business Logic Layer (Class Library) Database Layer (Entity Framework) I want to use Ninject to manage the lifetime of the DataContext generated by the Entity Framework in the Database Layer. The Business Logic layer consists of classes which reference repositories (located in the database layer) and my ASP.NET MVC app references the business logic layer's service classes to run code. Each repository creates an instance of the MyDataContext object from the Entity Framework Repository public class MyRepository { private MyDataContext db; public MyRepository { this.db = new MyDataContext(); } // methods } Business Logic Classes public class BizLogicClass { private MyRepository repos; public MyRepository { this.repos = new MyRepository(); } // do stuff with the repos } Will Ninject handle the lifetime of MyDataContext despite the lengthy dependency chain from the Web App to the Data Layer?

    Read the article

  • What is the purpose of Managers / Transactions?

    - by maxdj
    I'm building a spring application for the first time. I'm running into lots of problems with concurrency, and I suspect that there is something wrong with the way I'm managing the backend. The only difference I can see between my backend code and examples I've seen are manager classes. In my code, I have my model (managed by hibernate) and my DAOs on top of that to do CRUD/searching/etc on the models. In example code I have looked at, they never use the DAO directly. Instead, they use manager classes that call the DAOs indirectly. To me, this just seems like pointless code duplication. What are these manager classes for? I've read that they wrap my code in "transactions," but why would I want that?

    Read the article

  • How do I get the Zend_Application's database into a model class?

    - by Billy ONeal
    I have a Zend_Framework application, which has a whole bunch of model classes. I need these model classes to be able to access the application's database (naturally). Currently I've put this in my index.php: Zend_Registry::set('db', $application->bootstrap()->getBootstrap() ->getPluginResource('db')->getDbAdapter()); And then $db = Zend_Registry::get('db'); in each of my model classes that require the database. But this seems like a horrible horrible hack. Am I missing something basic here?

    Read the article

  • How to design this class hierarchy?

    - by devoured elysium
    I have defined an Event class: Event and all the following classes inherit from Event: AEvent BEvent CEvent DEvent Now, with the info I gather from all these Event classes, I will make a chart. With AEvent and BEvent, I will generate points for that chart, while with CEvent and DEvent I will paint certain regions of the chart. Now, how should I signal this in my class hierarchy? Should I make AEvent and BEvent inherit from PointEvent while CEvent and DEvent inherit from RegionEvent, being that both RegionEvent and PointEvent inherit from Event? Should I add a field with an Enum to Event with 2 values, Point and Region, and each of the child classes set their value to it? Should I use some kind of pattern here? Which one? Thanks.

    Read the article

  • Is there a way to convert a swf to an .abc file?

    - by Jeremy Ruppel
    I'm looking for a way, preferably a command-line utility, to pump out an .abc file for a compiled swf. I've looked into asc.jar, but so far it seems like it can only accept classes, not compiled swfs. Anybody know of a good way to do this? The end-goal of this process is to use Zwetan's RedTamarin project to run describeType on some specific classes inside a loaded swf, but there are complications with SecurityDomain preventing me from using Loader.loadBytes. If there's another good way to describe classes in the loaded swf via command-line, I'd be interested in that solution as well. Cheers, J

    Read the article

  • Symbol error in java application using netbeans when adding a shared project to library

    - by Malachi
    I have a project which has shared functionality between three other projects and have linked these to existing projects as I normally would using the add project functionality of the libraries folder. This all used to work however when I started up Netbeans yesterday it just wasn't working as in the other projects won't compile even though the projects are linked. It can recognise the packages - just the actual classes themselves were not recognised... and to add to the weirdness some of the classes are getting picked up fine. I have checked the dist folder of the shared project and the Shared.jar file exists. Also I have checked the Jar and the other classes that are not being recognises are there also. Any suggestions?

    Read the article

  • Easy way to apply Joomla template styling to my own content

    - by Joey Adams
    I have an application that is mainly a bunch of PHP files included in a Joomla! application by Jumi. I want to make the site look nicer, but I'd rather not reinvent the wheel. There is a RocketTheme template installed on the site, and I'd like to be able to leverage it or some of the other CSS used alongside it. Specifically, I want to decorate tables. Should I search for and include CSS classes directly into my tags by searching through the template's classes, or is there a framework I could use that automatically adds the right classes based on the current theme?

    Read the article

  • CSS class equivalent for LaTeX

    - by Ryan Scott Bardsley
    I am trying to figure out if there is a way to apply the CSS methodology to the LaTeX template I am building. What I would like to do is to have a set of classes that apply a specific style treatment to the bracketed words. For example: If I have three paragraphs of text, I want to have all of the paragraphs have [0.5cm] of spacing after the last line without having to add \\[0.5cm] after each paragraph. Is there a LaTeX equivalent of defining the treatment for all paragraphs in the preamble so that it cascades throughout my document? The equivalent of: <style> p {padding-bottom:0.5cm} </style> I want to be able to specify multiple version of these CSS-like LaTeX classes throughout my document, so I don't need a specific solution. I need help understanding how to add custom labels/names/classes to the preamble and an example of how to use them in the document itself. Thanks! Ryan

    Read the article

  • WindowsForms difference to simple Console App

    - by daemonfire300
    I currently started to "port" my console projects to WinForms, but it seems I am badly failing doing that. I am simply used to a console structure: I got my classes interacting with each other depending on the input coming from the console. A simple flow: Input -> ProcessInput -> Execute -> Output -> wait for input Now I got this big Form1.cs (etc.) and the "Application.Run(Form1);" But I really got no clue how my classes can interact with the form and create a flow like I described above. I mean, I just have these "...._Click(object sender....)" for each "item" inside the form. Now I do not know where to place / start my flow / loop, and how my classes can interact with the form.

    Read the article

  • Include code in ASP.net

    - by Tom Gullen
    I've got an ASP.net file, and I'm trying to include dynamic code which was easy in classic ASP. Here is what I have tried so far: <%@ Register TagPrefix="TagPre" TagName="header" Src="alg/classes.aspx"%> and <!--#include file="alg/classes.aspx"--> But neither of these seem to work. The content of classes.aspx is: <script runat="server"> ' Square class Public Class square Public sqRows As Integer 'Numbers of rows this square has Public sqCols As Integer 'Number of columns this square has Public sqArray(,) As Integer 'The square array ' Initialise square array to match size of canvas Public Sub initSqArray(ByVal canvCols, ByVal canvRows) ReDim sqArray(canvCols, canvRows) sqRows = canvRows sqCols = canvCols End Sub End Class Thanks for any help!

    Read the article

  • Do we need HyperJAXB generated hashCode & equals methods?

    - by Marcus
    We've generated some (well a lot) of classes using HyperJAXB. All of the classes implement Equals and HashCode and have the implementation style below. Appears this code is never executed.. is there any particular reason we need this code? I'm looking to simplify the classes if we can. public boolean equals(Object object) { if (!(object instanceof MyClass)) { return false; } if (this == object) { return true; } final EqualsBuilder equalsBuilder = new JAXBEqualsBuilder(); equals(object, equalsBuilder); return equalsBuilder.isEquals(); } public void hashCode(HashCodeBuilder hashCodeBuilder) { hashCodeBuilder.append(this.getValue()); hashCodeBuilder.append(this.getId()); } public int hashCode() { final HashCodeBuilder hashCodeBuilder = new JAXBHashCodeBuilder(); hashCode(hashCodeBuilder); return hashCodeBuilder.toHashCode(); }

    Read the article

  • Accessing constructor from abstract base class with reflection

    - by craesh
    Hi! I'm playing around with Java's Reflection. I have an abstract class Base with a constructor. abstract class Base { public Base( String foo ) { // do some magic } } I have some further classes extending Base. They don't contain much logic. I want to instantiate them with Base's constructor, without having to write some proxy contructors in those derived classes. And of course, I want to instantiate those derived classes with Reflection. Say: Class cls = SomeDerivedClass.class; Constructor constr; constr = cls.getConstructor( new Class[] { String.class } ); // will return null Class clsBase = Base.class; constr = clsBase.getConstructor( new Class[] { String.class } ); // ok Base obj = (Base) constr.newInstance( new Object[] { "foo" } ); // will throw InstantiationException because it belongs to an abstract class Any ideas, how I can instantiate a derived class with Base's constructor? Or must I declare those dumb proxy constructors?

    Read the article

  • How to inject dependencies into a custom UserNamePasswordValidator in WCF?

    - by Dannerbo
    I'm using a UserNamePasswordValidator in WCF along with Unity for my dependency injection, but since WCF creates the instance of the UserNamePasswordValidator, I cannot inject my container into the class. So how would one go about this? The simplest solution I can think of is to create a static proxy/wrapper class around a static instance of a UnityContainer, which exposes all the same methods... This way, any class can access the container, and I don't need to inject it everywhere. So I could just do UnityContainerWrapper.Resolve() anywhere in code. So basically this solution solves 2 problems for me, I can use it in classes that I'm not creating an instance of, and I can use it anywhere without having to inject the container into a bunch of classes. The only downside I can think of is that I'm now potentially exposing my container to a bunch of classes that wouldn't of had access to the container before. Not really sure if this is even a problem though?

    Read the article

  • Add remove class?

    - by Steven
    Okay I have two classes for two links and two divs with different information. What I am trying to do is have it so when you click on one link it adds a 2 to both of the classes and makes the second div visable. When you click on the other link it takes off a 2 and makes the first div visable. Here is what I currently got $("#posts").click(function () { $("#sideboxtopleft").toggleClass("2"); $("#arrow").toggleClass("2"); }); Pretty much posts is the link, when when you click on it. It would make sideboxtopleft and arrow, sideboxtopleft2 and arrow2 and when you clicked on comments it would take off the 2 of both of those. Then there are two divs, one is set to hidden and I want to make it visable and set the other to hidden. Pretty much creating a tab system with changing tab classes.

    Read the article

  • Linking Excel and Access

    - by Mel
    I run a sports program where i have a master roll of who is in which class in excel. I want to link this to a database in access that stores the other information about each athlete, e.g. address, parents name, school, medical details. I want to be able to add names to class in the excel speadsheet and have this automatically generate a record for that person in access. There also needs to be some failsafe for athletes that are in multiple classes. I was also doing class roles as pivot tables out of the access database so i need to code for classes and also have this allow for athletes in multiple classes/disciplines.

    Read the article

  • Java: Best practices for turning foreign horror-code into clean API...?

    - by java.is.for.desktop
    Hello, everyone! I have a project (related to graph algorithms). It is written by someone else. The code is horrible: public fields, no getters/setters huge methods, all public some classes have over 20 fields some classes have over 5 constructors (which are also huge) some of those constructors just left many fields null (so I can't make some fields final, because then every second constructor signals errors) methods and classes rely on each other in both directions I have to rewrite this into a clean and understandable API. Problem is: I myself don't understand anything in this code. Please give me hints on analyzing and understanding such code. I was thinking, perhaps, there are tools which perform static code analysis and give me call graphs and things like this.

    Read the article

  • C#, WindowsForms difference to simple Console App

    - by daemonfire300
    Hi there, I currently started to "port" my console projects to WinForms, but it seems I am badly failing doing that. I am simply used to a console structure: I got my classes interacting with each other depending on the input coming from the console. A simple flow: Input -> ProcessInput -> Execute -> Output -> wait for input Now I got this big Form1.cs (etc.) and the "Application.Run(Form1);" But I really got no clue how my classes can interact with the form and create a flow like I described above. I mean, I just have these "...._Click(object sender....)" for each "item" inside the form. Now I do not know where to place / start my flow / loop, and how my classes can interact with the form. thanks and regards daemonfire

    Read the article

  • mysql GROUP_CONCAT

    - by user301766
    I want to list all users with their corropsonding user class. Here are simplified versions of my tables CREATE TABLE users ( user_id INT NOT NULL AUTO_INCREMENT, user_class VARCHAR(100), PRIMARY KEY (user_id) ); INSERT INTO users VALUES (1, '1'), (2, '2'), (3, '1,2'); CREATE TABLE classes ( class_id INT NOT NULL AUTO_INCREMENT, class_name VARCHAR(100), PRIMARY KEY (class_id) ); INSERT INTO classes VALUES (1, 'Class 1'), (2, 'Class 2'); And this is the query statement I am trying to use but is only returning the first matching user class and not a concatenated list as hoped. SELECT user_id, GROUP_CONCAT(DISTINCT class_name SEPARATOR ",") AS class_name FROM users, classes WHERE user_class IN (class_id) GROUP BY user_id; Actual Output +---------+------------+ | user_id | class_name | +---------+------------+ | 1 | Class 1 | | 2 | Class 2 | | 3 | Class 1 | +---------+------------+ Wanted Output +---------+---------------------+ | user_id | class_name | +---------+---------------------+ | 1 | Class 1 | | 2 | Class 2 | | 3 | Class 1, Class 2 | +---------+---------------------+ Thanks in advance

    Read the article

  • Subsonic 3.0 - .Net - Error : Can not ceate an instance of an interface

    - by George
    Hi, I am new to Subsonic, I have configured Subsonic3.0 T4 Template and created classes for my project. I have taken GridView and Object Datasource. Object datasource will connect to the one of the classes which is created from subsonic. I have set object datasource for g\fetch, Insert, Update and delete methods. Then i set the datasource of grid witht he object datasource. Grid view successfully showing me all the records. But at the time of Update, Insert or delete it throws an exception that "Can not ceate an instance of an interface". And also i am not able to dwbug in the code of the subsonic. May be because of partial classes. Can anyone please let me know what is happening at the backgrund? Or may be one can give me sample example which contains subsonic 3.0 and grid add, edit and delete so it will be really helpful for me.... Please... :) Thanks, George

    Read the article

  • Error "E_UNEXPECTED(0x8000FFFF)" when using CDec/CInt/IsNumeric

    - by Marc vB
    I have encountered a strange problem, which I could solve but don't understand why it did occur. I have build a DLL with COM enabled. In this DLL I have classes that did use the functions CInt, CDec and IsNumeric. If I test these classes from a .NET application then it works ok. But when I called/run these classes from a Win32 application (with COM) then I did get an "E_UNEXPECTED(0x8000FFFF)" error. After some debugging I found out that the problem would go away if I: - replaced IsNumeric with Integer.TryParse or Decimal.TryParse - replaced CInt with Integer.Parse - replaced CDec with Decimal.Parse Can anyone explain this? Again, I could solve it by doing this but I would like to know why.

    Read the article

  • Parsing mutiple xml files in android

    - by cppdev
    Hi, I ma writing an application where I have to parse multiple xml files as a response from a server. Till now, I have written different xml parser classes for each xml depepending on the tags present in different xmls ? Can I combine all xml parser classes and write a single xml parser that handles all different tags in different xmls ? Will it work ? Will combining xml parser classes add an overhead because xml parser will check for every tag irrespective of whether that is part of file or not ? Please help.

    Read the article

< Previous Page | 75 76 77 78 79 80 81 82 83 84 85 86  | Next Page >