Search Results

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

Page 89/391 | < Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >

  • Image compression and thumbnail creation for PHP

    - by Saif Bechan
    I need some PHP classes that deal with image processing in a good manner. I have made a thumbnail creator myself but the end result quality is just horrible. Is it also possible to let PHP convert and save all images to one type. For example take an image(jpg,png,gif), compress it, resize it, and save as png. Can anyone recommend some good classes for this.

    Read the article

  • remove duplicate code in java

    - by Anantha Kumaran
    class A extends ApiClass { public void duplicateMethod() { } } class B extends AnotherApiClass { public void duplicateMethod() { } } I have two classes which extend different api classes. The two class has some duplicate methods(same method repeated in both class) and how to remove this duplication? Edit The ApiClass is not under my control

    Read the article

  • java interfaces

    - by Codenotguru
    write an interface with one method,two classes that implement the interface, and a main method with an array holding an instance from both classes.Using this array variable call the method in a foreach loop.This is a interview question in java anybody?

    Read the article

  • Java Object class

    - by SHiNKiROU
    I have a weird Java question: As we know: All Java classes extend java.lang.Object All Java classes cannot extend itself Then, java.lang.Object must extend java.lang.Object, which is itself, therefore, it should be impossible. How is Object implemented in Java?

    Read the article

  • Servlet unit test

    - by Thomman
    Currently I'm using TestNG framework for testing application business logic, i added some Servlet classes recently. How do I unit test these Servlet classes in TestNg framework?

    Read the article

  • Java Object superclass

    - by SHiNKiROU
    I have a weird Java question: As we know: All Java classes extend java.lang.Object All Java classes cannot extend itself Then, java.lang.Object must extend java.lang.Object, which is itself, therefore, it should be impossible. How is Object implemented in Java?

    Read the article

  • maven project with netbeans compiles fully on every run

    - by Jeff Storey
    I was experimenting with Netbeans 6.8 (I'm currently an Eclipse user) because I like having a profiler built into the IDE. It seems that for maven projects, netbeans does a full compile (it invokes process-classes) every time I try to run the project, as opposed to Eclipse, which uses the incremental Java compiler. Is there a way to avoid having netbeans run mvn process-classes every time I want to run the main class? thanks, Jeff

    Read the article

  • Adding a reference to a css file in an ascx file in vs2008 only to get intellisense

    - by Nick Allen - Tungle139
    Normally visual studio brings up intellisense for available css classes, which it draws from css files linked to the current aspx/master document. Is there a way to get this to work in an ascx file in a similar way to referencing external JavaScript files in js files for the purpose of intellisense /// <reference path="jquery-1.4.1.js" /> I only want this for the purpose of intellisense and not getting squiggly lines under un-recognised classes. My css files will be actually linked from the aspx/master page.

    Read the article

  • Many-To-Many Query with Linq-To-NHibernate

    - by rjygraham
    Ok guys (and gals), this one has been driving me nuts all night and I'm turning to your collective wisdom for help. I'm using Fluent Nhibernate and Linq-To-NHibernate as my data access story and I have the following simplified DB structure: CREATE TABLE [dbo].[Classes]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](100) NOT NULL, [StartDate] [datetime2](7) NOT NULL, [EndDate] [datetime2](7) NOT NULL, CONSTRAINT [PK_Classes] PRIMARY KEY CLUSTERED ( [Id] ASC ) CREATE TABLE [dbo].[Sections]( [Id] [bigint] IDENTITY(1,1) NOT NULL, [ClassId] [bigint] NOT NULL, [InternalCode] [varchar](10) NOT NULL, CONSTRAINT [PK_Sections] PRIMARY KEY CLUSTERED ( [Id] ASC ) CREATE TABLE [dbo].[SectionStudents]( [SectionId] [bigint] NOT NULL, [UserId] [uniqueidentifier] NOT NULL, CONSTRAINT [PK_SectionStudents] PRIMARY KEY CLUSTERED ( [SectionId] ASC, [UserId] ASC ) CREATE TABLE [dbo].[aspnet_Users]( [ApplicationId] [uniqueidentifier] NOT NULL, [UserId] [uniqueidentifier] NOT NULL, [UserName] [nvarchar](256) NOT NULL, [LoweredUserName] [nvarchar](256) NOT NULL, [MobileAlias] [nvarchar](16) NULL, [IsAnonymous] [bit] NOT NULL, [LastActivityDate] [datetime] NOT NULL, PRIMARY KEY NONCLUSTERED ( [UserId] ASC ) I omitted the foreign keys for brevity, but essentially this boils down to: A Class can have many Sections. A Section can belong to only 1 Class but can have many Students. A Student (aspnet_Users) can belong to many Sections. I've setup the corresponding Model classes and Fluent NHibernate Mapping classes, all that is working fine. Here's where I'm getting stuck. I need to write a query which will return the sections a student is enrolled in based on the student's UserId and the dates of the class. Here's what I've tried so far: 1. var sections = (from s in this.Session.Linq<Sections>() where s.Class.StartDate <= DateTime.UtcNow && s.Class.EndDate > DateTime.UtcNow && s.Students.First(f => f.UserId == userId) != null select s); 2. var sections = (from s in this.Session.Linq<Sections>() where s.Class.StartDate <= DateTime.UtcNow && s.Class.EndDate > DateTime.UtcNow && s.Students.Where(w => w.UserId == userId).FirstOrDefault().Id == userId select s); Obviously, 2 above will fail miserably if there are no students matching userId for classes the current date between it's start and end dates...but I just wanted to try. The filters for the Class StartDate and EndDate work fine, but the many-to-many relation with Students is proving to be difficult. Everytime I try running the query I get an ArgumentNullException with the message: Value cannot be null. Parameter name: session I've considered going down the path of making the SectionStudents relation a Model class with a reference to Section and a reference to Student instead of a many-to-many. I'd like to avoid that if I can, and I'm not even sure it would work that way. Thanks in advance to anyone who can help. Ryan

    Read the article

  • In Sphinx, can I register a bunch of keywords that should always be translated into links?

    - by Ross Rogers
    My doc strings have references to other python classes that I've defined. Every time Sphinx encounters one of these classes, I want it to insert a link to the documentation for that other class. Is this possible in Sphinx? Specifically, I have a doc string like: '''This class contains a bunch of Foo objects''' I could write: '''This class contains a bunch of :class:`~foo.Foo` objects''' but I would prefer that Sphinx finds all text matching Foo and makes it seem as though I had typed :class:~foo.Foo

    Read the article

  • Making Custom DataGridViewCell ReadOnly

    - by Ashton Halladay
    I am making several custom DataGridViewCell classes to handle various cases in my C# application. One of the custom classes is associated with read-only data, so I'm attempting to make the cell itself read-only. I initially tried setting the ReadOnly property in the constructor, but doing so causes an InvalidOperationException: "ReadOnly property of a cell cannot be set before it is added to a row." Which method should I override (i.e., which method adds the cell to the row), so that I can set the ReadOnly property?

    Read the article

  • SWC Loading issue

    - by Fahim Akhter
    Hi, Is it possible that even if I'm using a class from a swc it does not get merged into my SWF? I have the SWC as external but as soon as I use any of the classes my swf size jumps. Secondly, if I'm making a preloader should I load the classes and swc in the mainproject or load the compiled swf ?

    Read the article

  • Get list of Class names in package

    - by TandemAdam
    Is there any way I can get a list of all the classes in a particular package? I know getDefinitionByName, getQualifiedClassName, and getQualifiedSuperclassName in flash.utils can find me a class, but I can't find anyway to find all the classes in a package at runtime.

    Read the article

  • Use string value to create new instance

    - by Brian David Berman
    I have a few classes: SomeClass1, SomeClass2. How can I create a new instance of one of these classes by using the class name from a string? Normally, I would do: var someClass1 = new SomeClass1(); How can I create this instance from the following: var className = "SomeClass1"; I am assuming I should use Type.GetType() or something but I can't figure it out. Thanks.

    Read the article

  • Unable to instantiate class containing Hibernate code

    - by Steven
    hi, i am developing a plug in which deals with hibernate project.I get some classes which contain Session and Session factory .Then i want to instantiate an object of these classes using reflections which i am not able to do it even after including the hibernate jars in the classpath of my plug in.What is the problem?Help

    Read the article

  • Pre-Compiled Header Design Question

    - by ML
    Hi All, I have code that uses a pre-compiled header. (previously done by someone else) In it, they are including several .h files. If I have classes that use common .h files that are not currently in the existing pre-compiled header, would tossing them in there be of any real benefit? Maybe compilation speed, but I was thinking it would clean up the classes/headers a bit too? What are do's and don't with pre-compiled headers?

    Read the article

  • What to put in a python module docstring?

    - by 007brendan
    Ok, so I've read both PEP 8 and PEP 257, and I've written lots of docstrings for functions and classes, but I'm a little unsure about what should go in a module docstring. I figured, at a minimum, it should document the functions and classes that the module exports, but I've also seen a few modules that list author names, copyright information, etc. Does anyone have an example of how a good python docstring should be structured?

    Read the article

  • error-no suitable method found to override?

    - by Jun Jie
    When i use some of the codes Why do i always get this error..no suitable method found to override? and Warning 2 The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: Thing --- The base class 'System.Object' cannot be designed. Form1 --- The base class 'System.Object' cannot be designed. 0 0

    Read the article

  • C++ Virtual Constructor, without clone()

    - by Julien L.
    I want to perform "deep copies" of an STL container of pointers to polymorphic classes. I know about the Prototype design pattern, implemented by means of the Virtual Ctor Idiom, as explained in the C++ FAQ Lite, Item 20.8. It is simple and straightforward: struct ABC // Abstract Base Class { virtual ~ABC() {} virtual ABC * clone() = 0; }; struct D1 : public ABC { virtual D1 * clone() { return new D1( *this ); } // Covariant Return Type }; A deep copy is then: for( i = 0; i < oldVector.size(); ++i ) newVector.push_back( oldVector[i]->clone() ); Drawbacks As Andrei Alexandrescu states it: The clone() implementation must follow the same pattern in all derived classes; in spite of its repetitive structure, there is no reasonable way to automate defining the clone() member function (beyond macros, that is). Moreover, clients of ABC can possibly do something bad. (I mean, nothing prevents clients to do something bad, so, it will happen.) Better design? My question is: is there another way to make an abstract base class clonable without requiring derived classes to write clone-related code? (Helper class? Templates?) Following is my context. Hopefully, it will help understanding my question. I am designing a class hierarchy to perform operations on a class Image: struct ImgOp { virtual ~ImgOp() {} bool run( Image & ) = 0; }; Image operations are user-defined: clients of the class hierarchy will implement their own classes derived from ImgOp: struct CheckImageSize : public ImgOp { std::size_t w, h; bool run( Image &i ) { return w==i.width() && h==i.height(); } }; struct CheckImageResolution; struct RotateImage; ... Multiple operations can be performed sequentially on an image: bool do_operations( std::vector< ImgOp* > v, Image &i ) { std::for_each( v.begin(), v.end(), /* bind2nd(mem_fun(&ImgOp::run), i ...) don't remember syntax */ ); } int main( ... ) { std::vector< ImgOp* > v; v.push_back( new CheckImageSize ); v.push_back( new CheckImageResolution ); v.push_back( new RotateImage ); Image i; do_operations( v, i ); } If there are multiple images, the set can be split and shared over several threads. To ensure "thread-safety", each thread must have its own copy of all operation objects contained in v -- v becomes a prototype to be deep copied in each thread.

    Read the article

  • Error while building Struts2 Application by Ant

    - by Jeeva
    I'm following Rose India Hello World Tutorial for Struts2 development, I'm Getting, Buildfile: D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\struts2tutorial\WEB-INF\src\build.xml clean: [delete] Deleting directory D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\struts2tutorial\WEB-INF\classes [mkdir] Created dir: D:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\struts2tutorial\WEB-INF\classes prepare: BUILD FAILED

    Read the article

  • Passing Auth to API calls with Web Service References

    - by coffeeaddict
    I am new to web services. The last time I dealt with SOAP was when I created a bunch of wrapper classes that sent requests and received responses back per some response objects/classes I had created. So I had an object to send certain API requests and likewise a set of objects to hold the response back as an object so I could utilize that 3rd party API. Then someone came to me and said why not just use the wsdl and a web service. Ok, so today I went and created a "Service Reference". I see that this is what's called a "Proxy Class". You just instantiate an instance of this and then walla you have access to all the methods from the wsdl. But this leaves me with auth questions. Back when I created my own classes manually, I had a class which exposed properties that I would set then access for things like signature, username, password that got sent along with the Http request that were required by whatever 3rd party API I was using to make API calls. But then with using a Service Reference, how then would I pass this information just like I had done in my custom classes? For instance I'm going to be working with the PayPal API. It requires you to send a signature and a few other pieces of information like username and password. // Determins if API call needs to use a session based URI string requestURI = UseAuthURI == true ? _requestURIAuthBased + aSessionID : _requestURI; byte[] data = XmlUtil.DocumentToBytes(doc); // Create the atual Request instance HttpWebRequest request = CreateWebRequest(requestURI, data.Length); So how do I pass username, password, signature, etc. when using web service references for each method call? Is it as simple as specifying it as a param to the method or do you use the .Credentials and .URL methods of your proxy class object? It seems to me Credentials means windows credentials but I could be wrong. Is it limited to that or can you use that to specify those required header values that PayPal expects with each method call/API request?

    Read the article

  • clarification on the concept of "web service"

    - by udit
    Im a little confused on the varying definitions and implementations of web services available as implementations. Need some clarification please. Ones I have used till now: If a vendor gives me a specific format of XML that I can send populated with data to request and I make a simple HTTP POST over the internet passing in the XML String as the payload, is this a web service call ? If so, is there a specific name to it, this kind of web service ? Because obviously, it does not use anything like Axis, WSDL or SOAP to establish this connection. A variant of this is If the vendor gives me an XSD, I use JAXB to make a java class out of it and pass in the serialized version of the object, which eventually works out to be the same as option 1. RESTful web service: Vendor gives me a URL like http://restfulservice/products and I can make HTTP Requests to the URL and depending on what HTTP verb I use, the appropropriate action is called and the response sent over the wire. Ones I have only read about\ have a vague idea about SOAP. How does this work?.. Ive read the W3Schools tutorial and I undertsand that there is a very specific form of XML that is standardized according to W3C standards that we use to pass the same kind of messages as we did in option 1. But how does this work in real life? Vendor sends me what? Do I generate classes? Do I serialize some objects and http post them over to an address? Or do the generated objects themselves have connection methods that will do them for me? What about WSDL? When does a vendor send me WSDL and what do I do with it ? I guess I can generate classes from it. If yes, then what do I do with the generated classes ? When do I need that axis jar to generate classes from something that the vendor sends ? As you can see, I have some clear and other mostly vague ideas about the different kinds of web services available. would help if someone ould clarify and\or point to more real-world resources. I've looked a little bit into Java Web Services on the internet and the numerous four letter acronyms that get thrown at me make me dizzy. Thanks

    Read the article

  • polymorphism and interfaces

    - by mixm
    if i have two classes x and y, both extend class w. and x implementing interface z. if i have methods doSomething(w object) and doSomething(x object), what would happen if i call doSomething(x)? edit: im implementing this on java, more specifically on android. im asking this because some classes which implement a specific interface mostly does the same thing when doSomething() is called. but there are special cases which i would like to single out.

    Read the article

< Previous Page | 85 86 87 88 89 90 91 92 93 94 95 96  | Next Page >