Search Results

Search found 8397 results on 336 pages for 'implementation'.

Page 219/336 | < Previous Page | 215 216 217 218 219 220 221 222 223 224 225 226  | Next Page >

  • possible implementations of casting in c++

    - by lego69
    I have this snippet of the code in my header: class A { private: int player; public: A(int initPlayer = 0); A(const A&); A& operator=(const A&); ~A(); void foo() const; friend int operator==(const A& i, const A& member) const; }; implementation of the operator== int operator==(const A& i, const A& member) const{ if(i.player == member.player){ return 1; } return 0; } and I need casting for this part of my code: A *pa1 = new A(a2); assert(i == *pa1); i - is some int, which my function receives I receive an error non-member function, How can I fix it? thanks in advance

    Read the article

  • Getting changes in one column of an historical table

    - by Javi
    Hello, I have a table which stores historical data. It's mapped to an Entity with the following fields (I use JPA with Hibernate implementation): @Entity @Table(name="items_historical") public class ItemHistory{ private Integer id; private Date date; @Enumerated(EnumType.ORDINAL) private StatusEnum status @ManyToOne(optional=false) private User user; @ManyToOne(optional=false) private Item item; } public enum StatusEnum { OK, BAD,...//my status } In every row I store historical data of another table. I need to get the list of the changes on "status" column: the status, the date and the previous status on a specified item (It would be good as well getting the status and date when status was changed). I don't know if this is possible by using HQL. Thanks.

    Read the article

  • UITableView cell selection disabled and UITableViewHeader Enabled

    - by andyPaul
    I am adding a my header view to self.tableView.tableHeaderView=headerView; This tableView has 10 cells. I want to disable the cell Selection but, headerView touch events must be enabled. To achieve this I added the following code: self.tableView.userInteractionDisabled=YES; self.headerView.userInteractionDisabled=NO; self.headerView.exclusiveTouch=YES; Where I am wrong? Basic idea of implementation is , If headerView is enabled then cell selection is disabled and vice-versa.

    Read the article

  • Windows Form Components Access

    - by rxm0203
    What is the best way to access components (e.g. imagelist, timer) from a form instance? I am working on multi form windows forms application on .NET Compact Framework version 3.5 SP1 with C#. I have a Controller class associated with each form for MVC implementation. Here is my sample Controller class. public class Controller { public void Init(Form f) { //f.Controls will allow access to all controls //How shall I access imagelist, timer on form f. } } My question is how can I access non visual components without taking a performance hit of reflection? Any code snippets are welcome. If reflection is only way, then can you provide me optimal way for components access please? Thanks,

    Read the article

  • How do I "step over" jQuery code while debugging?

    - by Scott Rippey
    While stepping through a script that uses jQuery, I just want to test the code I wrote. I don't want to step into the jQuery file -- I'm not debugging jQuery, just my own file. Are there any ways to tell a debugger to not step into the jQuery file? I use Visual Studio + Internet Explorer, as well as Firefox + Firebug for stepping through code ... and both seem to love to step through dozens of jQuery statements. For example, say I have a script like this: $("div").each(function() { $(this).hide(); }); I would like to press "step into" and not see the implementation of ".each()" etc... In C#, this is possible by using the [DebuggerStepThrough()] attribute on a class. But that doesn't help with JavaScript.

    Read the article

  • Application file (Real world example)

    - by aalhamad
    Looking for guidelines to create application file. For example I have an application that store user input into a file (Textbox, DataGrid, ListBox etc). I'm looking for WPF-C# implementation. I would like to have the following: If user edit a any form(Textbox, etc) an asterisk is displayed to the window title. When window is closed and asterisk is still there, a promote "Would you like to save changes" appears. If then saved the asterisk disappear. What do real applications use to create their application file? (Note: I'm not looking for database saving or SQL) I'm just looking for hints and guidelines. Thank you.

    Read the article

  • Calling R Script from within C-Code

    - by tiny81
    Hi, Is there a way to call an R-Script within C-Code? I did find the R Api for C (chaper 6. of the 'Writing R Extensions' manual), but as far as I understood this does "only" allow to call the C-Implementation of R. Of cause I could call the R-Script via shell, but that's no solution for me, since this does not allow proper passing of data (at least no if I don't what to write the data into a Csv-File or something like this). Is there a easy way of using the R to C parser beforehand? Any hints you can give me? regards, Tiny

    Read the article

  • Guidance on using drop in DLLs

    - by Scott Chamberlain
    I have been giving the task to rewrite a internal utility in .net for my work. One of program requirements the new system has is have a dll that implements a set of interfaces and have the program call the DLL. Now this dll will be changed out a lot per deployment. My question is what is the best way to do it from a development standpoint? Do I add a template DLL (one that only has the interfaces but no implementation) to the project references like I would do any other dll that I would use. Or do I need to use somthing like this every time I want to use code from the dll? var DropIn = System.Reflection.Assembly.LoadFrom("DropInDll.dll"); var getActions = DropIn.GetType("Main").GetMethod("GetActions"); List<IAction> ActionList = (List<IAction>)getActions.Invoke(null, null);

    Read the article

  • How to deal with delegate method calling back the object who send the message ?

    - by olipion
    I have two object: @protocol ObjectADelegate - (void)objectAfirst:(ObjectA *)obj; - (void)objectAsecond:(ObjectA *)obj; @end @interface ObjectA : NSObject { id<ObjectADelegate> delegate; - (void)callSecond { [self.delegate objectAsecond:self]; } @end @interface ObjectB : NSObject <ObjectADelegate>{ ObjectA *myObjectA; } @implementation ObjectB - (void)objectAfirst:(ObjectA *)obj { // First is finished, do second [obj callSecond]; } - (void)objectASecond:(ObjectA *)obj { // Do my stuff } @end As you can see in the code, when ObjectA send the message objectAfirst to its delegate, objectb use again objectA methods that result in objecta calling back objectb. It means that what first fire objectAfirst is not finished but objectA send the objectAsecond message. Could it be a problem ? Any way to let delay message handling in objectB ? for example, something like using [obj performSelector:@selector(callSecond) afterDelay:0.01]; instead of [obj callSecond]; ?

    Read the article

  • Is it possible in Scala to force the caller to specify a type parameter for a polymorphic method ?

    - by Alex Kravets
    //API class Node class Person extends Node object Finder { def find[T <: Node](name: String): T = doFind(name).asInstanceOf[T] } //Call site (correct) val person = find[Person]("joe") //Call site (dies with a ClassCast inside b/c inferred type is Nothing) val person = find("joe") In the code above the client site "forgot" to specify the type parameter, as the API writer I want that to mean "just return Node". Is there any way to define a generic method (not a class) to achieve this (or equivalent). Note: using a manifest inside the implementation to do the cast if (manifest != scala.reflect.Manifest.Nothing) won't compile ... I have a nagging feeling that some Scala Wizard knows how to use Predef.<:< for this :-) Ideas ?

    Read the article

  • WebKit & Objective-C: how to parse a HTML string into a DOMDocument?

    - by Rinzwind
    How do you get a DOMDocument from a given HTML string using WebKit? In other words, what's the implementation for DOMDocumentFromHTML: for something like the following: NSString * htmlString = @"<html><body><p>Test</body></html>"; DOMDocument * document = [self DOMDocumentFromHTML: htmlString]; DOMNode * bodyNode = [[document getElementsByTagName: @"body"] item: 0]; // ... etc. This seems like it should be straightforward to do, yet I'm still having trouble figuring out how :( ...

    Read the article

  • Force to call virtual base function instead of the overriden one.

    - by Roberto Sebestyen
    In the following example "Test that v1 function was called" fails. Is there a way to force call the base implementation of "RunFunction" through an instance of "class V2" ?? class V1 { public virtual string RunFunction() { return "V1"; } } class V2 : V1 { public override string RunFunction() { return "V2"; } } [Test] public void TestCall() { var v1 = (V1)new V2(); var v2 = new V2(); Assert.IsTrue(v1.RunFunction() == "V1", "Test that v1 function was called"); Assert.IsTrue(v2.RunFunction() == "V2", "Test that v2 function was called"); }

    Read the article

  • Video/ Speech Development of Applications

    - by idea_
    Why do we continue to type and click away in IDEs when we could theoretically use hand gestures and speech to develop applications? Think about it - Developing a class by standing in-front of your computer, making some gesture, and yelling "CAR!". This doesn't have to strictly apply to OOP either. We have sufficient speech and image acquisition/ processing and analysis tools available to us, don't we? This seems plausible to me, but I may be overly ambitious. From a conceptual point-of-view, do you see any problems with the implementation?

    Read the article

  • Implemention of scattering in this paper

    - by pelb
    Hi, For some time I tried implementing the scattering model described in this paper: Salama Paper The BRDF part of this paper is pretty clear and straightforward. Where I am hanging is the scattering part. When scattering at the first hitpoint once only, I'm just not getting the same results as proposed by the images in the very same paper. Of course I'm scattering multiply rays inside the proposed scattering cone and averaging the results of the different rays. Does anyone have more or less concrete ideas on the implementation of this nice and beautiful illustrative rendering method. I am glad and thankful for any hints.

    Read the article

  • Error message regarding IEnumerable.GetEnumerator().

    - by Bon_chan
    I get this error message and I can't figure out why! Error 1 'Exo5Chap12.ShortCollection<T>' does not implement interface member 'System.Collections.IEnumerable.GetEnumerator()'. 'Exo5Chap12.ShortCollection<T>.GetEnumerator()' cannot implement 'System.Collections.IEnumerable.GetEnumerator()' because it does not have the matching return type of 'System.Collections.IEnumerator'. E:\MyFolders\Dev\c#\Chapter12\Exo5Chap12\Exo5Chap12\exo5.cs 9 18 Exo5Chap12 Here is the code with an implementation of GetEnumerator(). What is wrong? public class ShortCollection<T> : IList<T> { protected Collection<T> innerCollection; protected int maxSize = 10; public IEnumerator<T> GetEnumerator() { return (innerCollection as IEnumerator<T>).GetEnumerator(); } }

    Read the article

  • Does Java have "properties" that work the same way properties work in C# (see the body of my text)?

    - by tyrone302
    In C#, you can use properties to make a data field publicly accessible (allowing the user to directly access it), and yet retain the ability to perform data validation on those directly-accessed fields. Doese Java have something similar? For Instance, suppose there exists a C# class with the following implementation(see below): public class newInt{ public newInt(){...} public int x{ get{ return this.x } set{ this.x = isValid(value) } } } private static int isValid(int value){...} This definition in the class allows the user to "naturally" use the data field 'x' when retrieving values from it and assigning values to it. Below is how it would be used in main. public class Test{ public static void main(String[] args){ newInt a = new newInt(); a.x = 50; int b = a.x; } } The question is... can java do this as well? if so, what is it called?

    Read the article

  • How to edit files on the users file system from my web server?

    - by Abs
    Hello all, I am really looking for implementation advice as I have entered a new realm that I am not familiar with. At the simplest level, I would like to find a way that I can read/write to a users machine from my web server. For this to work, I think I will have to install some sort of "plugin" on the users machine which can receive (or poll?) the server for instructions. The above is the line of thought that I currently have, maybe using JAVA to do this. This needs to work on Linux, Mac and Windows OS. I am really looking for advice on the above, is it a good idea? Is there a better way of doing this? Is there something out there already that I can build on top of? I really appreciate all input and advice as this is something I have not done before. Thanks all

    Read the article

  • Drawing graphs on java

    - by nunos
    I want to draw graphs (nodes and edges) in Java. However, since I don't know how to go about it, I would like to have some advice before starting. How should I do this? use Graphics2D package, right? How about the labels for the nodes? should I use something like drawString and handle all the "centering" manually or create a JLabel for that? Can I put a JLabel on a Graphics2D environment? I have searched but haven't found any simple implementation of this. If you know of one, please provide the link in your answer. Thanks.

    Read the article

  • What language should I use to parse a lot of text?

    - by BicMan
    My company's proprietary software generates a log file that is much easier to use if it is parsed. The log parser we all use was written by another employee as a side project, and it has horrible performance. These log files can grow to 10s of megabytes very quickly, and the parser we currently use has issues if a log file is bigger than 1 megabyte. So, I want to write a program that can parse this massive amount of text in the shortest amount of time possible. We use Windows exclusively, so running on Windows is a must. Our current implementation runs on a local web server, and I'm convinced that running it as an application would have to be faster. All suggestions will be helpful. Thanks.

    Read the article

  • How to write an unit test for WCF behaviors?

    - by katie77
    I am new to unit testing. How do I write a unit test for a method when I am extending a WCF behavior. Since I am not sure of when the class is being instantiated, or I can not change the method signature. In the behavior implementation, I am getting the header and looking up a value in the config. public class IncomingValidator : IDispatchMessageInspector { public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext) { // Grab the header and see if one of the particular values(read from config) is there. } public void BeforeSendReply(ref Message reply, object correlationState) { } }

    Read the article

  • Inventory Management OOP design

    - by rgamber
    This was an OOP design and implementation interview question, which I came across on glassdoor.com. Design and implement a inventory management system to minimize the number of missed delivery dates while keeping costs to the company low. Of course there is no right answer to this, but I am not sure I understand the question correctly and am wondering what would be a good answer. Is this as simple as creating an undirected graph with nodes as the delivery points, and edges having weights as the cost of the delivery, and then use a single-source-shortest-path algorithm (like Dijkstras, or Bellman-Ford) on the graph? Not sure if this type of question should be asked here,so let me know and I will delete it.

    Read the article

  • c++ possible errors

    - by lego69
    hello I've got error a1 was not declared in this scope, can somebody please explain me my fault my header: #ifndef QUIZ_H_ #define QUIZ_H_ #include "quiz.cpp" class A { private: int player; public: A(int initPlayer); ~A(); void foo(); }; #endif /* QUIZ_H_ */ implementation of class functions: #include "quiz.h" #include <iostream> using std::cout; using std::endl; A::A(int initPlayer = 0){ player = initPlayer; } A::~A(){ } void A::foo(){ cout << player; } my main #include "quiz.h" int main() { quiz(7); return 0; } function quiz: #include "quiz.h" void quiz(int i) { A a1(i); a1.foo(); }

    Read the article

  • Optimal strategy to make a C++ hash table, thread safe

    - by Ajeet
    (I am interested in design of implementation NOT a readymade construct that will do it all.) Suppose we have a class HashTable (not hash-map implemented as a tree but hash-table) and say there are eight threads. Suppose read to write ratio is about 100:1 or even better 1000:1. Case A) Only one thread is a writer and others including writer can read from HashTable(they may simply iterate over entire hash table) Case B) All threads are identical and all could read/write. Can someone suggest best strategy to make the class thread safe with following consideration 1. Top priority to least lock contention 2. Second priority to least number of locks My understanding so far is thus : One BIG reader-writer lock(semaphore). Specialize the semaphore so that there could be eight instances writer-resource for case B, where each each writer resource locks one row(or range for that matter). (so i guess 1+8 mutexes) Please let me know if I am thinking on the correct line, and how could we improve on this solution.

    Read the article

  • Java Web Application

    - by Mark R
    I am interested in creating a simple web application that will take in user input, convert it to an XML file and send the file to a database. Coding wise I feel I am okay, it is just the general setup and what implementation to use I am a bit unsure of. At the moment I have a JSP page containing a form, the user fills out the form and on submit a get method is sent to a servlet, in the servlet doGet() method the servlet is instantiating a java object and passing it the user inputted data. The java object then writes that data to an XML file and sends it to the database via REST. All I would be interested to know is if this the standard/optimal way of creating such a web application. Any and all feedback is appreciated. Thanks

    Read the article

  • Need my video to loop please

    - by Jay L
    Hi all, Thank you in advance for any help, I am a newbie and would appreciate any help here.. I have this code to play a movie and it works great. Can somebody PLEASE tell me how to make this movie loop and replay from the beginning non stop ( any code would help). Also I would like to know how to play 2 movies, one after the other, preferably with a fade or smooth transition. Thank you for any help import "MyAppViewController.h" @implementation MyAppViewController -(IBAction)button:(id)sender{ NSString *path = [[NSBundle mainBundle] pathForResource:@"mymovie" ofType:@"mp4"]; player = [[MPMoviePlayerViewController alloc] initWithContentURL:[NSURL fileURLWithPath:path]]; [self presentMoviePlayerViewControllerAnimated:player]; }

    Read the article

< Previous Page | 215 216 217 218 219 220 221 222 223 224 225 226  | Next Page >