Search Results

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

Page 96/391 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • Partial class or "chained inheritance"

    - by Charlie boy
    Hi From my understanding partial classes are a bit frowned upon by professional developers, but I've come over a bit of an issue; I have made an implementation of the RichTextBox control that uses user32.dll calls for faster editing of large texts. That results in quite a bit of code. Then I added spellchecking capabilities to the control, this was made in another class inheriting RichTextBox control as well. That also makes up a bit of code. These two functionalities are quite separate but I would like them to be merged so that I can drop one control on my form that has both fast editing capabilities and spellchecking built in. I feel that simply adding the code form one class to the other would result in a too large code file, especially since there are two very distinct areas of functionality, so I seem to need another approach. Now to my question; To merge these two classes should I make the spellchecking RichTextBox inherit from the fast edit one, that in turn inherits RichTextBox? Or should I make the two classes partials of a single class and thus making them more “equal” so to speak? This is more of a question of OO principles and exercise on my part than me trying to reinvent the wheel, I know there are plenty of good text editing controls out there. But this is just a hobby for me and I just want to know how this kind of solution would be managed by a professional. Thanks!

    Read the article

  • What's the difference between DI and factory patterns?

    - by Anthony Short
    I have a class which depends on 3 classes, all 3 of which have other classes they rely on. Currently, I'm using a container class to build up all the required classes, inject them into one another and return the application. The simplified version of the container looks something like this: class Builder { private $_options; public function __construct($options) { $this->_options = $options; } public function build() { $cache = $this->getCache(); $response = $this->getResponse(); $engine = $this->getEngine(); return new Application($cache,$response,$engine); } public function getResponse() { $encoder = $this->getResponseEncoder(); $cache = $this->getResponseCache(); return new Response($encoder,$cache); } // Methods for building each object } I'm not sure if this would be classified as FactoryMethod or a DI Container. They both seem to solve the same problem in the same way - They build objects and inject dependencies. This container has some more complicated building methods, like loading observers and attaching them to observable objects. Should factories be doing all the building (loading extensions etc) and the DI container should use these factories to inject dependencies? That way the sub-packages, like Cache, Response etc, can each have their own specialised factories.

    Read the article

  • WSDL first for existing service layer

    - by Jurgen H
    I am working on an existing Java project with a typical services - dao setup for which only a webapplication was available. My job is to add webservices on top of the services layer, but the webservices have their own functional analysis and datamodel. The functional analyses ofcource focuses on what is possible in the different service methods. As good practice demands, we used the WSDL first strategy and generated JAXB bound Java classes and a SEI for the webservices. After having implemented the webservices partially, we noticed a 70% match between the datamodel. This resulted in writing converters which take the webservice JAXB classes and map them with the service layer classes. Customer customer = new Customer(); customer.setName(wsCustomer.getName()); customer.setFirstName(wsCustomer.getFirstName(); .. This is a very obvious example, some other mappings where little more complicated. Can anyone give his best practices, experiences, solutions to this kind of situations? Are any of these frameworks usefull? http://transmorph.sourceforge.net/wiki/index.php/Main_Page http://ezmorph.sourceforge.net/ Please don't start a discussion about WSDL first vs code first.

    Read the article

  • Sending a JSON object to an ASP.NET web service using JQUERY ajax function

    - by uzay95
    I want to create object on the client side of aspx page. And i want to add functions to these javascript classes to make easier the life. Actually i can get and use the objects (derived from the server side classes) which returns from the services. When i wanted to send objects from the client by jquery ajax methods, i couldn't do it :) This is my javascript object: function ClassAndMark(_mark, _lesson){ this.Lesson = _lesson; this.Mark = _mark; } function Student(_name, _surname, _classAndMark){ this.Name = _name; this.SurName = _surname; this.ClassAndMark = _classAndMark; } JSClass.prototype.fSaveToDB(){ $.ajax({ type: "POST", contentType: "application/json; charset=utf-8", url: "/WS/SaveObject.asmx/fSaveToDB"), data: ????????????, dataType: "json" }); } Actually i don't know what should be definition of classes and methods on the Server side but i think: class ClassAndMark{ public string Lesson ; public string Mark ; } class Student{ public string Name ; public string SurName ; public ClassAndMark ClassAndMark ; } Web service is below but again i couldn't get what should be instead of the ???? : [WebMethod()] public void fSaveToDB(???? _obj) { // How can i convert input parameter/parameters // of method in the server side object? }

    Read the article

  • What's the correct terminology for something that isn't quite classification nor regression?

    - by TC
    Let's say that I have a problem that is basicly classification. That is, given some input and a number of possible output classes, find the correct class for the given input. Neural networks and decision trees are some of the algorithms that may be used to solve such problems. These algorithms typically only emit a single result however: the resulting classification. Now what if I weren't only interested in one classification, but in the posterior probabilities that the input belongs to each of the classes. I.E., instead of the answer "This input belongs in class A", I want the answer "This input belongs to class A with 80%, class B with 15% and class C with 5%". My question is not on how to obtain these posterior probabilities, but rather on the correct terminology to describe the process of finding them. You could call it regression, since we are now trying to estimate a number of real valued numbers, but I am not quite sure if that's right. I feel it's not exactly classification either, it's something in between the two. Is there a word that describes the process of finding the class conditional posterior probabilities that some input belongs in each of the possible output classes? P.S. I'm not exactly sure if this question is enough of a programming question, but since it's about machine learning and machine learning generally involves a decent amount of programming, let's give it a shot.

    Read the article

  • Advice on Linq to SQL mapping object design

    - by fearofawhackplanet
    I hope the title and following text are clear, I'm not very familiar with the correct terms so please correct me if I get anything wrong. I'm using Linq ORM for the first time and am wondering how to address the following. Say I have two DB tables: User ---- Id Name Phone ----- Id UserId Model The Linq code generator produces a bunch of entity classes. I then write my own classes and interfaces which wrap these Linq classes: class DatabaseUser : IUser { public DatabaseUser(User user) { _user = user; } public Guid Id { get { return _user.Id; } } ... etc } so far so good. Now it's easy enough to find a users phones from Phones.Where(p => p.User = user) but surely comsumers of the API shouldn't need to be writing their own Linq queries to get at data, so I should wrap this query in a function or property somewhere. So the question is, in this example, would you add a Phones property to IUser or not? In other words, should my interface specifically be modelling my database objects (in which case Phones doesn't belong in IUser), or are they actually simply providing a set of functions and properties which are conceptually associated with a User (in which case it does)? There seems drawbacks to both views, but I'm wondering if there is a standard approach to the problem. Or just any general words of wisdom you could share. My first thought was to use extension methods but in fact that doesn't work in this case.

    Read the article

  • JPA - Real primary key generated ID for references

    - by Val
    I have ~10 classes, each of them, have composite key, consist of 2-4 values. 1 of the classes is a main one (let's call it "Center") and related to other as one-to-one or one-to-many. Thinking about correct way of describing this in JPA I think I need to describe all the primary keys using @Embedded / @PrimaryKey annotations. Question #1: My concern is - does it mean that on the database level I will have # of additional columns in each table referring to the "Center" equal to number of column in "Center" PK? If yes, is it possible to avoid it by using some artificial unique key for references? Could you please give an idea how real PK and the artificial one needs to be described in this case? Note: The reason why I would like to keep the real PK and not just use the unique id as PK is - my application have some data loading functionality from external data sources and sometimes they may return records which I already have in local database. If unique ID will be used as PK - for new records I won't be able to do data update, since the unique ID will not be available for just downloaded ones. At the same time it is normal case scenario for application and it just need to update of insert new records depends on if the real composite primary key matches. Question #2: All of the 10 classes have common field "date" which I described in an abstract class which each of them extends. The "date" itself is never a key, but it always a part of composite key for each class. Composite key is different for each class. To be able to use this field as a part of PK should I describe it in each class or is there any way to use it as is? I experimented with @Embedded and @PrimaryKey annotations and always got an error that eclipselink can't find field described in an abstract class. Thank you in advance! PS. I'm using latest version of eclipselink & H2 database.

    Read the article

  • Custom PHP Framework Feedback

    - by Jascha
    I've been learning OOP programming for about a year and a half now and have developed a fairly standard framework to which I generally abide by. I'd love some feedback or input on how I might improve some functionality or if there are some things I'm overlooking. VIEW MODE 1) Essentially everything starts at the Index.php page. The first thing I do is require my "packages.php" file that is basically a config file that imports all of the classes and function lists I'll be using. 2) I have no direct communication between my index.php file and my classes, what I've done is "pretty them up" with my viewfunctions.php file which is essentially just a conduit to the classes so that in my html I can write <?php get_title('page'); ?> instead of <?php echo $pageClass->get_title('page'); ?> Plus, I can run a couple small booleans and what not in the view function script that can better tailor the output of the class. 3) Any information brought in via the database is started from it's corresponding class that has direct communication with the database class, the only class that is allowed direct to communicate with the database (allowed in the sense that I run all of my queries with custom class code). INPUT MODE 1) Any user input is sent to my userFunctions.php. 2) My security class is then instantiated where I send whatever user input that has been posted for verification and validation. 3) If the input passes my security check, I then pass it to my DB class for input into my Database. FEEDBACK I'm wondering if there are any glaringly obvious pitfalls to the general structure, or ways I can improve this. Thank you in advance for your input. I know there is real no "right" answer for this, but I imagine a couple up votes would be in order for some strong advice regarding building frameworks. -J

    Read the article

  • Run code before class instanciation in ActionScript 3

    - by soow.fr
    I need to run code in a class declaration before its instanciation. This would be especially useful to automatically register classes in a factory. See: // Main.as public class Main extends Sprite { public function Main() : void { var o : Object = Factory.make(42); } } // Factory.as public class Factory { private static var _factory : Array = new Array(); public static function registerClass(id : uint, c : Class) : void { _factory[id] = function () : Object { return new c(); }; } public static function make(id : uint) : Object { return _factory[id](); } } // Foo.as public class Foo { // Run this code before instanciating Foo! Factory.registerClass(42, Foo); } AFAIK, the JIT machine for the ActionScript language won't let me do that since no reference to Foo is made in the Main method. The Foo class being generated, I can't (and don't want to) register the classes in Main: I'd like to register all the exported classes in a specific package (or library). Ideally, this would be done through package introspection, which doesn't exist in ActionScript 3. Do you know any fix (or other solution) to my design issue?

    Read the article

  • How to find all initializations of instance variables in a Java package?

    - by Hank Gay
    I'm in the midst of converting a legacy app to Spring. As part of the transition, we're converting our service classes from an "instantiate new ones whenever you need one" style to a Springleton style, so I need a way to make sure they don't have any state. I'm comfortable on the *nix command-line, and I have access to IntelliJ (this strikes me as a good fit for Structural Search and Replace, if I could figure out how to use it), and I could track down an Eclipse install, if that would help. I just want to make absolutely sure I've found all the possible problems. UPDATE: Sorry for the confusion. I don't have a problem finding places where the old constructor was being called. What I'm looking for is a "bullet-proof" why to search all 100+ service classes for any sort of internal state. The most obvious one I could think of (and the only one I've really found so far) is cases where we use memoization in the classes, so they have instance variables that get initialized internally instead of via Spring. This means that when the same Springleton gets used for different requests, data can leak between them. Thanks.

    Read the article

  • Mysterious double execution of Click handler after change to Windows 2008 Server

    - by mjn
    After moving a Delphi 2009 application from a Windows 2003 / Citrix environment to a 64 bit Windows 2008 R2 environment (users now use RDP instead of Citrix), there are frequent runtime errors which are caused by a double exection of a menu item click handler. The first call of the event handler opens a modal form. Then the same event handler is triggered again and thus a runtime exception occurs since the visible form can not be made modal. The madExcept stack trace looks like this: main thread ($2dc): 004ffa88 +06c Ladelist.exe Forms TCustomForm.ShowModal 0052f4ff +0bb Ladelist.exe DB TDataSet.SetActive 008fc9a1 +089 Ladelist.exe u_ladeli 928 +16 TForm1.EditLoadingList 008fadec +070 Ladelist.exe u_ladeli 504 +5 TForm1.OpenLoadingListClick <----- 2 004d6e27 +0a7 Ladelist.exe Menus TMenuItem.Click 004d857f +0ef Ladelist.exe Menus DoClick 004d866b +087 Ladelist.exe Menus TMenu.IsShortCut 005001c1 +04d Ladelist.exe Forms TCustomForm.IsShortCut 004e8dc0 +068 Ladelist.exe Controls TWinControl.IsMenuKey 004e8f89 +011 Ladelist.exe Controls TWinControl.CNSysKeyDown 004e247e +2d2 Ladelist.exe Controls TControl.WndProc 004e6983 +513 Ladelist.exe Controls TWinControl.WndProc 004fb5e8 +594 Ladelist.exe Forms TCustomForm.WndProc 004e20a4 +024 Ladelist.exe Controls TControl.Perform 004856e0 +014 Ladelist.exe Classes StdWndProc 004e609c +02c Ladelist.exe Controls TWinControl.MainWndProc 004856e0 +014 Ladelist.exe Classes StdWndProc 775b00e3 +02b ntdll.dll KiUserCallbackDispatcher 008fc9a1 +089 Ladelist.exe u_ladeli 928 +16 TForm1.EditLoadingList 008fadec +070 Ladelist.exe u_ladeli 504 +5 TForm1.OpenLoadingListClick <----- 1 004d6e27 +0a7 Ladelist.exe Menus TMenuItem.Click 004d857f +0ef Ladelist.exe Menus DoClick 004d866b +087 Ladelist.exe Menus TMenu.IsShortCut 005001c1 +04d Ladelist.exe Forms TCustomForm.IsShortCut 004e8dc0 +068 Ladelist.exe Controls TWinControl.IsMenuKey 004e8e0d +01d Ladelist.exe Controls TWinControl.CNKeyDown 004e247e +2d2 Ladelist.exe Controls TControl.WndProc 004e6983 +513 Ladelist.exe Controls TWinControl.WndProc 004fb5e8 +594 Ladelist.exe Forms TCustomForm.WndProc 004e20a4 +024 Ladelist.exe Controls TControl.Perform 004e609c +02c Ladelist.exe Controls TWinControl.MainWndProc 004856e0 +014 Ladelist.exe Classes StdWndProc 775b00e3 +02b ntdll.dll KiUserCallbackDispatcher 753c3675 +010 kernel32.dll BaseThreadInitThunk

    Read the article

  • How to use interfaces in exception handling

    - by vikp
    Hi, I'm working on the exception handling layer for my application. I have read few articles on interfaces and generics. I have used inheritance before quite a lot and I'm comfortable with in that area. I have a very brief design that I'm going to implement: public interface IMyExceptionLogger { public void LogException(); // Helper methods for writing into files,db, xml } I'm slightly confused what I should be doing next. public class FooClass: IMyExceptionLogger { // Fields // Constructors } Should I implement LogException() method within FooClass? If yes, than I'm struggling to see how I'm better of using an interface instead of the concrete class... I have a variety of classes that will make a use of that interface, but I don't want to write an implementation of that interface within each class. In the same time If I implement an interface in one class, and then use that class in different layers of the application I will be still using concrete classes instead of interfaces, which is a bad OO design... I hope this makes sense. Any feedback and suggestions are welcome. Please notice that I'm not interested in using net4log or its competitors because I'm doing this to learn. Thank you Edit: Wrote some more code. So I will implement variety of loggers with this interface, i.e. DBExceptionLogger, CSVExceptionLogger, XMLExceptionLogger etc. Than I will still end up with concrete classes that I will have to use in different layers of my application.

    Read the article

  • Entity Filter child without include

    - by Lic
    i'm a C# developer and i have a trouble with Entity Framework 5. I have mapped my database with Entity using the default code generation strategy. In particolar there are three classes: menus, submenus and submenuitems. The relationships about three classes are: one menu - to many submenus one submenu - to many submenuitems. All classes have a boolean attribute called "Active". Now, i want to filter all the Menus with the SubMenus active, and the SubMenus with the SubMenuItems active. To get this i've tried this: var tmp = _model.Menus.Where(m => m.Active) .Select => new { Menu = x, SubMenu = x.SubMenus.Where(sb => sb.Active) .Select(y => new { SubMenu = y, SubMenuItem = y.SubMenuItems.Where(sbi => sbi.Active) }) }) .Select(x => x.Menu).ToList(); But didn't work. Someone can help me? Thank you for your help!

    Read the article

  • How should I organize my Java GUI?

    - by Spencer
    I'm creating a game in Java for fun and I'm trying to decide how to organize my classes for the GUI. So far, all the classes with only the swing components and layout (no logic) are in a package called "ui". I now need to add listeners (i.e. ActionListener) to components (i.e. button). The listeners need to communicate with the Game class. Currently I have: Game.java - creates the frame add panels to it import javax.swing.; import ui.; public class Game { private JFrame frame; Main main; Rules rules; Game() { rules = new Rules(); frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); main = new Main(); frame.setContentPane(main.getContentPane()); show(); } void show() { frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } public static void main(String[] args) { new Game(); } } Rules.java - game logic ui package - all classes create new panels to be swapped out with the main frame's content pane Main.java (Main Menu) - creates a panel with components Where do I now place the functionality for the Main class? In the game class? Separate class? Or is the whole organization wrong? Thanks

    Read the article

  • How would you update 100+ variables if something is changed in a different class?

    - by N. Lucas
    I have a class Grid which produces a graph paper like grid on in the drawing area. I then have 5 other classes for different shapes to draw with; Line, Polygon, Ellipse, Curve, Arc Now, these 5 classes use an instance of Grid because Grid has a resolution and a scale. Inside Grid I have: public function set resolution(x:Number):void { _gap = (modBy10(x) / 10); _scale = (modBy10(x) / (this.resolution * _scale)); draw(); } public function get resolution():Number { return (_gap * 10); } public function set scale(x:Number):void { _scale = (this.resolution / x); } public function get scale():Number { return _scale; } /**/ public function scaleLength(x:Number):Number { return (x * this.scale); } public function scaleLengthDown(x:Number):Number { return (x / this.scale); } public function scaleArea(x:Number):Number { return (x / Math.pow(this.scale, 2)); } I'm just lost for a solution on how to update every instance of my 5 drawing classes when Grid is changed. For instance, Polygon is made up of multiple instances of Line, Line(length, angle) where "length" is in either in, ft, cm, or m. If the user wishes to change the scale from say 10ft per 100px resolution.. Is there an easier way than re-drawing every Line inside Polygon?

    Read the article

  • How to delete ProgIDs from other user accounts when uninstalling from Windows?

    - by Mordachai
    I've been investigating "how should a modern windows c++ application register its file types" with Windows (see http://stackoverflow.com/questions/2828637/c-how-do-i-correctly-register-and-unregister-file-type-associations-for-our-ap). And having combed through the various MSDN articles on the subject, the summary appears to be as follows: The installer (elevated) should register the global ProgID HKLM\Software\Classes\my-app.my-doc[.version] (e.g. HKLM\Software\Classes\TextPad.text) The installer also configures default associations for its document types (e.g. .myext) and points this to the aforementioned global ProgID in HKLM. NOTE: a user interface should be provided here to allow the user to either accept all default associations, or to customize which associations should be set. The application, running standard (unelevated), should provide a UI for allowing the current user to set their personal associations as is available in the installer, except that these associations are stored in HKCU\Software\Classes (per user, not per machine). The UN-installer is then responsible for deleting all registered ProgIDs (but should leave the actual file associations alone, as Windows is smart enough to handle associations pointing to missing ProgIDs, and this is the specified desired behavior by MSDN). So that schema sounds reasonable to me, except when I consider #4: How does an uninstaller, running elevated for a given user account, delete any per-user ProgIDs created in step #3 for other users? As I understand things, even in elevated mode, an uninstaller cannot go into another user's registry hive and delete items? Or can it? Does it have to load each given user hive first? What are the rules here? Thanks for any insight you might have to offer! EDIT: See below for the solution (My question was founded in confusion)

    Read the article

  • Database/Object Mapping

    - by Eric
    Hello everyone, This is a beginner question, but it's been frustrating me... I am using C#, by the way. I'd like to make a few classes, each with their own properties and methods. I would also like to have a database to store certain instances of these classes in case I would ever need to look at them again. So, for example... class Polygon { String name; Double perimiter; int numSides; public Double GetArea() { // ... } } class Circle { String name; Double radius; public void PrintName() { // ... } } Say I've got these classes. I also want a database that has the TABLES "Polygon" and "Circle" with the COLUMNS "name" "perimeter" "radius" etc. And I want an easy way to save a class instance into the database, or pull a class instance out of the database. I have previously been using MS Access for my database stuff, which I don't mind using, but I would prefer if nothing other than .NET need to be installed. I've been researching online a bit, but I wanted to get some opinions on here. I have looked at Linq-to-Sql, but it seems you need Sql-Server. Is this true? If so, I'd really rather not use it because I don't want to have to have it installed everywhere. Anway, I'm just fishing for some ideas/insights/suggestions/etc. so please help me out if you can. Thanks.

    Read the article

  • mutableCopyWithZone updating a property value.

    - by Jim
    I have a Class that I need to copy with the ability to make changes the value of a variable on both Classes. Simply put the classes need to remain clones of each other at all times. My understanding of the documentation is that I can do this using a shallow copy of the Class which has also been declared mutable. By shallow copying the pointer value for the variable will be cloned so that it is an exact match in both classes. So when I update the variable in the original the copy will be updated simultaneously. Is this right? As you can see below I have used mutableCopyWithZone in the class I want to copy. I have tried both NSCopyObject and allocWithZone methods to get this to work. Although I'm able to copy the class and it appears as intended, when updating the variable it is not changing value in the copied Class. - (id)mutableCopyWithZone:(NSZone *)zone { //ReviewViewer *copy = NSCopyObject(self, 0, zone); ReviewViewer *copy = [[[self class] allocWithZone:zone] init]; copy->infoTextViews = [infoTextViews copy]; return copy; } infoTextViews is a property declared as nonatomic, retain in the header file of the class being copied. I have also implemented the NSMutableCopying protocol accordingly. Any help would be great.

    Read the article

  • Using same log4j logger in standalone java application

    - by ktaylorjohn
    I have some code which is a standalone java application comprising of 30+ classes. Most of these inherit from some other base classes. Each and every class has this method to get and use a log4j logger public static Logger getLogger() { if (logger != null) return logger; try { PropertyUtil propUtil = PropertyUtil.getInstance("app-log.properties"); if (propUtil != null && propUtil.getProperties() != null) PropertyConfigurator.configure(propUtil.getProperties ()); logger = Logger.getLogger(ExtractData.class); return logger; } catch (Exception exception) { exception.printStackTrace(); } } A) My question is whether this should be refactored to some common logger which is initialized once and used across by all classes? Is that a better practice? B) If yes, how can this be done ? How can I pass the logger around ? C) This is actually being used in the code not as Logger.debug() but getLogger().debug(). What is the impact of this in terms of performance?

    Read the article

  • Does implementing a Java class under an open-source library's package name constitutes a modificatio

    - by Minyu
    Greetings, I understand that this is not the best forum for getting legal advices. But I am still wondering if anybody has some experience around this topic, or can point me to relevant resources that explain it. I have tried to search it online but could not find clear answers. Assuming I am using a Java open-source library from "somecompany", specifically its entities in the "org.somecompany.somepackage". During development, I found that I need to access some of the internals of that package that are not exposed through its public interface. So I thought maybe creating my own classes under the same "org.somecompany.somepackage" name would make that easier. My question is: does this constitutes a modification of the open-source library? The fully qualified name of my classes look like "org.somecompany.somepackage.myclass". It does seem an "extension" of the original library, even though I am not modifying the original library source or binary. I am also not adding my classes to the open-source jar files. Any advice or pointer to resources will be appreciated!

    Read the article

  • How to get a nicely formatted PHP Web Service response?

    - by Bruno
    I called an API like this: $service = new Class_Service(); $parameters = new GetClasses(); $parameters->Request = new GetClassesRequest(); $parameters->Request->SourceCredentials = new SourceCredentials(); $parameters->Request->SourceCredentials->SourceName = "Name"; $parameters->Request->SourceCredentials->Password = "Pass"; $parameters->Request->SourceCredentials->SiteIDs = array( 12 ); $classes = $service->GetClasses($parameters); var_dump($classes); And received a response like this: object(GetClassesResponse)#7 (1) { ["GetClassesResult"]=> object(GetClassesResult)#8 (6 { ["Classes"]=> object(stdClass)#9 (1) { ["Class"]=> array(25) { [0]=> object(Mi_Class)#10 (21) { ["ClassScheduleID"]=> int(15) ["Visits"]=> NULL ["Clients"]=> NULL ["Location"]=> object(Location)#11 (30) { ["BusinessID"]=> NULL ["SiteID"]=> int(12) ["BusinessDescription"]=> NULL ["AdditionalImageURLs"]=> object(stdClass)#12 (0) { } ["FacilitySquareFeet"]=> NULL Does a response normally look like this? How do I go about getting the data in a formatted manner?

    Read the article

  • Setting the type of a field in a superclass from a subclass (Java)

    - by Ibolit
    Hi. I am writing a project on Google App Engine, within it I have a number of abstract classes that I hope I will be able to use in my future projects, and a number of concrete classes inheriting from them. Among other abstract classes I have an abstract servlet that does user management, and I hava an abstract user. The AbstractUser has all the necessary fields and methods for storing it in the datastore and telling whether the user is registered with my service or not. It does not implement any project specific functionality. The abstract servlet that manages users, refers only to the methods declared in the AbstractUser class, which allows it to generate links for logging in, logging out and registering (for unregistered users). In order to implement the project-specific user functionality I need to subclass the Abstract user. The servlets I use in my project are all indirect descendants from that abstract user management servlet, and the user is a protected field in it, so the descendant servlets can use it as their own field. However, whenever i want to access any project specific method of the concrete user, i need to cast it to that type. i.e. (abstract user managing servlet) ... AbstractUser user = getUser(); ... abstract protected AbstractUser getUser(); (project-specific abstract servlet) @Override protected AbstractUser getUser() { return MyUserFactory.getUser(); } any other project specific servlet: int a = ((ConcreteUser) user).getA(); Well, what i'd like to do is to somehow make the type of “user” in the superclass depend on something in the project-specific abstract class. Is it at all possible? And i don't want to move all the user-management stuff into a project-specific layer, for i would like to have it for my future projects already written :) Thank you for your help.

    Read the article

  • Basic Application Organization + Publishing (.NET 4.0)

    - by keynesiancross
    Hi all, I'm trying to figure out the best way to keep my program organized. Currently I have many class files in one project file, but some of these classes do things that are very different, and some I would like to expose to other applications in the future. One thought I had to organizing my application was to create multiple project files, with one "Main" project, which would interact with all the other projects and their relevant classes as needed. Does this make sense? I was wondering if anyone had any suggestions in regards to using multiple project files in one solution (and how do you create something like this?), and if it makes sense to have multiple namespaces in one solution... Cheers ----Edit Below---- Sorry, my fault. Currently my program is all in one console project. Within this project I have several classes, some of which basically launch a BackgroundWorker and run an endless loop pulling data. The BackgroundWorker then passes this data back to the main business logic as needed. I'm hoping to seperate this data pull material (including the background worker material) into one project file, and the rest of the business logic into another project file. The projects will have to pass objects between eachother though (the data to the main business logic, and the business logic will pass startup parameteres to the dataPull project)... Hopefully this adds a bit more detail.

    Read the article

  • jqgrid questions

    - by user508518
    Hi All- I recently posted a question on SO on freezing columns in jqgrid(http://stackoverflow.com/questions/4586924/jqgrid-freeze-columns). I got the following solution to be working in IE8, but its not all perfect: I set to use two css classes, one for header and other one for the rows like below: .jqgridbodyLock{ position:relative; left: expression(parentNode.parentNode.parentNode.parentNode.parentNode.scrollLeft); z-index: 10; } .jqgridheaderLocked{ position:relative; left: expression(parentNode.parentNode.parentNode.parentNode.parentNode.scrollLeft); /* IE5+ only */ z-index:30; } Then in colModel, I used the property classes {name:'column1', width:100, index:'column1', sorttype:"string", classes:'jqgridbodyLock'},//lock the body row and to lock the respective header I used code as below: $("#grid").setLabel("column1","column1","jqgridheaderLocked"); Though the solution works, I have the following problems: 1) The header values shake a lot when scrolling to the right though they remain frozen 2) The body values of the frozen column disappear when the cursor is taken out of the grid. 3) How to lock a normal table in firefox. I see that 'expression' is exclusive only to IE browser Thanks a lot

    Read the article

  • Calling member functions dynamically

    - by user652511
    I'm pretty sure it's possible to call a class and its member function dynamically in Delphi, but I can't quite seem to make it work. What am I missing? // Here's a list of classes (some code removed for clarity) moClassList : TList; moClassList.Add( TClassA ); moClassList.Add( TClassB ); // Here is where I want to call an object's member function if the // object's class is in the list: for i := 0 to moClassList.Count - 1 do if oObject is TClass(moClassList[i]) then with oObject as TClass(moClassList[i]) do Foo(); I get an undeclared identifier for Foo() at compile. Clarification/Additional Information: What I'm trying to accomplish is to create a Change Notification system between business classes. Class A registers to be notified of changes in Class B, and the system stores a mapping of Class A - Class B. Then, when a Class B object changes, the system will call a A.Foo() to process the change. I'd like the notification system to not require any hard-coded classes if possible. There will always be a Foo() for any class that registers for notification. Maybe this can't be done or there's a completely different and better approach to my problem. By the way, this is not exactly an "Observer" design pattern because it's not dealing with objects in memory. Managing changes between related persistent data seems like a standard problem to be solved, but I've not found very much discussion about it. Again, any assistance would be greatly appreciated. Jeff

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >