Search Results

Search found 15081 results on 604 pages for 'passing by reference'.

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

  • How to reference a class that implements certain interface?

    - by vikp
    Hi, I have an interface for logging the exceptions, i.e. IExceptionLogger. This interface has 3 implementations: DBExceptionLogger, XMLExceptionLogger, CSVExceptionLogger. I have an application that will make a use of DBExceptionLogger. The application references only IExceptionLogger. How do I create an instance of DBExceptionLogger within the application. I can't reference the DBExceptionLogger directly since it will break the purpose of having IExceptionLogger interface. Thanks

    Read the article

  • Where is a good javascript reference for object event handlers?

    - by GregH
    I am relatively new to Javascript and constantly need to look up how to handle various events for objects. For example, I have a table containing a few text fields and need to know when somebody starts typing in any of the text boxes. Is there any good concise reference on the web anyplace that documents all of the objects and event handlers associated with all objects? I'd like to be able to look up the object and see all of the events I can handle for that object.

    Read the article

  • does passing __m128i objects by reference to inline function cause these objects to be moved to stac

    - by ~buratinas
    Hello, I'm writing transpose function for 8x16bit vectors with SSE2 intrinsics. Since there are 8 arguments for that function (a matrix of 8x8x16bit size), I can't do anything but pass them by reference. Will that be optimized by the compiler (I mean, will these __m128i objects be passed in registers instead of stack)? Code snippet: inline void transpose (__m128i &a0, __m128i &a1, __m128i &a2, __m128i &a3, __m128i &a4, __m128i &a5, __m128i &a6, __m128i &a7) { .... }

    Read the article

  • Passing Services to MainViewModel - SHOULD I use a dependency injection container ?

    - by msfanboy
    Hello, I have this code: public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var mainVM = new MainViewModel ( new Service1(), ... new Service10(), ); var window = new MainWindow(); window.DataContext = mainVM; window.Show(); } } I pass all my Services instances to the MainViewModel. Within the MainViewModel I spread those services to other ViewModels via constructor parameter passing. Should I use any DI framework for the services in the App class? If yes whats the benefit of resolving the services instead of just creating the instance manually... ?

    Read the article

  • how to interpret testng console log message for passing tests?

    - by Kunal Cholera
    I ran testng tests for my test classes, I get the following three types of log output when I run the passing tests. I am using org.testng.AssertJUnit.assertTrue() methods in my tests. [testng] PASSED: testMethod1 on null(test.foo.bar.Class1) [testng] PASSED: testMethod2 on Default test name(test.foo.bar.jar.Class2) [testng] PASSED: testMethod3 Can any one please tell me why for some tests it says "on null" for some it says "on Default test name ... " and for some it does not say anything on the console output. Specifically I want to make it consistent message. Environment : linux Testng framework : 6.3.2beta please advise. thanks.

    Read the article

  • Jython: Is there any difference between adding to sys.path vs passing -D?

    - by trinth
    I have a python application that is trying to load some Java libraries (specifically Axis2 web services). When I add the necessary jars in Eclipse via PyDev Project Source Folders, everything seems to work fine. However, I want to be able to do this at run time by adding to sys.path, but then my application doesn't seem to work. In both cases I can load the jars just fine, but something must be different for there to be different results. My question is, is there a difference between adding jars via the sys.path at run time with sys.path.append() versus passing -D to the jython interpreter?

    Read the article

  • Can I create a cross-project source reference in redmine?

    - by UlfR
    If you have two separate projects that is somehow connected. How can one make a reference to the source of the other project? For referencing the source of your own project you use: source:some/file But since I want to refer to code in another project my thought was that I could write something like: other_project:source:some/file Anyone that knows if this is possible in some way? I have read http://www.redmine.org/wiki/redmine/RedmineTextFormatting#Redmine-links but found no clues there.

    Read the article

  • Android: how to obtain AssetManager without reference to Context?

    - by ab11
    I have a Class that needs to obtain a reference to it's application's AssetManager. This class does not extend any sort of android UI class, so it doesn't have a getContext() method, or anything similar. Is there some sort of static Context.getCurrentApplicationContext() type of method? To clarify: my class is intended to be used like a library, for other applications. It has no associated AndroidManifest.xml or control over the context which is calling it.

    Read the article

  • PHP Passing Data to a Specific Class? (Data Encapsulation)

    - by Adam184
    I've learned that OOP is all about data encapsulation, but what about passing data between classes that have nothing to do with each other (would the below example be worthy of using extends)? class Dog { private $secretVar; public function getSecretVar() { $this->secretVar = 'psst... only for rainbow!'; return $this->secretVar; } } class Rainbow { public function __construct(Dog $Dog) { print_r($Dog->getSecretVar()); } } $Dog = new Dog(); $Rainbow = new Rainbow($Dog); // ... classes that don't need the $secretVar How would you encapsulate $secretVar for only classes Dog and Rainbow? As of now, anyone can call getSecretVar(), and I'm having a hard time allowing that to happen as it seems to defeat the whole point of encapsulation.

    Read the article

  • Did C++11 address concerns passing std lib objects between dynamic/shared library boundaries? (ie dlls and so)?

    - by Doug T.
    One of my major complaints about C++ is how hard in practice it is to pass std library objects outside of dynamic library (ie dll/so) boundaries. The std library is often header-only. Which is great for doing some awesome optimizations. However, for dll's, they are often built with different compiler settings that may impact the internal structure/code of a std library containers. For example, in MSVC one dll may build with iterator debugging on while another builds with it off. These two dlls may run into issues passing std containers around. If I expose std::string in my interface, I can't guarantee the code the client is using for std::string is an exact match of my library's std::string. This leads to hard to debug problems, headaches, etc. You either rigidly control the compiler settings in your organization to prevent these issues or you use a simpler C interface that won't have these problems. Or specify to your clients the expected compiler settings they should use (which sucks if another library specifies other compiler settings). My question is whether or not C++11 tried to do anything to solve these issues?

    Read the article

  • problems with openGl on eclipse

    - by lego69
    I'm working on Windows XP I have portable version of Eclipse Galileo, but I didn't find there glut so I decided to add it using this link I made all steps and and now I'm trying to compile this code #include "GL/glut.h" #include "GL/gl.h" #include "GL/glu.h" /////////////////////////////////////////////////////////// // Called to draw scene void RenderScene(void) { // Clear the window with current clearing color glClear(GL_COLOR_BUFFER_BIT); // Flush drawing commands glFlush(); } /////////////////////////////////////////////////////////// // Setup the rendering state void SetupRC(void) { glClearColor(0.0f, 0.0f, 1.0f, 1.0f); } /////////////////////////////////////////////////////////// // Main program entry point void main(int argc, char* argv[]) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB); glutInitWindowSize(800,600); glutCreateWindow("Simple"); glutDisplayFunc(RenderScene); SetupRC(); glutMainLoop(); } and I have this errors Simple.o: In function `RenderScene': C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:16: undefined reference to `_imp__glClear' C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:20: undefined reference to `_imp__glFlush' Simple.o: In function `SetupRC': C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:27: undefined reference to `_imp__glClearColor' Simple.o: In function `main': C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:34: undefined reference to `glutInit' C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:35: undefined reference to `glutInitDisplayMode' C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:36: undefined reference to `glutInitWindowSize' C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:37: undefined reference to `glutCreateWindow' C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:38: undefined reference to `glutDisplayFunc' C:/Documents and Settings/Administrator/Desktop/workspace/open/Debug/../Simple.c:42: undefined reference to `glutMainLoop' collect2: ld returned 1 exit status please can somebody help me, thanks in advance

    Read the article

  • Error while compiling ffmpeg during make

    - by Rahul Mehta
    I want to install ffmpeg on ubuntu. and following this article http://pasindudps.blogspot.com/2010/12/compiling-ffmpeg-in-ubuntu-1010.html but when m doing make after config Then go to the ffmpeg folder. cd ffmpeg Start the installation ./configure --enable-gpl --enable-version3 --enable-nonfree --enable-postproc \ --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb \ --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis \ --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab make giving this error /home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_norm_shift' /home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_lps_range' /home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_norm_shift' /home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_mlps_state' /home/reach121/ffmpeg/libavcodec/x86/cabac.h:93: undefined reference to `ff_h264_norm_shift' collect2: ld returned 1 exit status make: *** [ffmpeg_g] Error 1 Please suggest why this error is coming and what to do to solve this problem

    Read the article

  • Incorrect data when passing pointer a list of pointers to a function. (C++)

    - by Phil Elm
    I'm writing code for combining data received over multiple sources. When the objects received (I'll call them MyPacket for now), they are stored in a standard list. However, whenever I reference the payload size of a partial MyPacket, the value shows up as 1 instead of the intended size. Here's the function code: MyPacket* CombinePackets(std::list<MyPacket*>* packets, uint8* current_packet){ uint32 total_payload_size = 0; if(packets->size() <= 0) return NULL; //For now. std::list<MyPacket*>::iterator it = packets->begin(); //Some minor code here, not relevant to the problem. for(uint8 index = 0; index < packets->size(); index++){ //(*it)->GetPayloadSize() returns 1 when it should show 1024. I've tried directly accessing the variable and more, but I just can't get it to work. total_payload_size += (*it)->GetPayloadSize(); cout << "Adding to total payload size value: " << (*it)->GetPayloadSize() << endl; std::advance(it,1); } MyPacket* packet = new MyPacket(); //Byte is just a typedef'd unsigned char. packet->payload = (byte) calloc(total_payload_size, sizeof(byte)); packet->payload_size = total_payload_size; it = packets->begin(); //Go back to the beginning again. uint32 big_payload_index = 0; for(uint8 index = 0; index < packets->size(); index++){ if(current_packet != NULL) *current_packet = index; for(uint32 payload_index = 0; payload_index < (*it)->GetPayloadSize(); payload_index++){ packet->payload[big_payload_index] = (*it)->payload[payload_index]; big_payload_index++; } std::advance(it,1); } return packet; } //Calling code std::list<MyPacket*> received = std::list<MyPacket*>(); //The code that fills it is here. std::list<MyPacket*>::iterator it = received.begin(); cout << (*it)->GetPayloadSize() << endl; // Outputs 1024 correctly! MyPacket* final = CombinePackets(&received,NULL); cout << final->GetPayloadSize() << endl; //Outputs 181, which happens to be the number of elements in the received list. So, as you can see above, when I reference (*it)-GetPayloadSize(), it returns 1 instead of the intended 1024. Can anyone see the problem and if so, do you have an idea on how to fix this? I've spent 4 hours searching and trying new solutions, but they all keep returning 1... EDIT:

    Read the article

  • Best Practice: QT4 QList<Mything*>... on Heap, or QList<Mything> using reference?

    - by Mike Crowe
    Hi Folks, Learning C++, so be gentle :)... I have been designing my application primarily using heap variables (coming from C), so I've designed structures like this: QList<Criteria*> _Criteria; // ... Criteria *c = new Criteria(....); _Criteria.append(c); All through my program, I'm passing pointers to specific Criteria, or often the list. So, I have a function declared like this: QList<Criteria*> Decision::addCriteria(int row,QString cname,QString ctype); Criteria * Decision::getCriteria(int row,int col) which inserts a Criteria into a list, and returns the list so my GUI can display it. I'm wondering if I should have used references, somehow. Since I'm always wanting that exact Criteria back, should I have done: QList<Criteria> _Criteria; // .... Criteria c(....); _Criteria.append(c); ... QList<Criteria>& Decision::addCriteria(int row,QString cname,QString ctype); Criteria& Decision::getCriteria(int row,int col) (not sure if the latter line is syntactically correct yet, but you get the drift). All these items are specific, quasi-global items that are the core of my program. So, the question is this: I can certainly allocate/free all my memory w/o an issue in the method I'm using now, but is there are more C++ way? Would references have been a better choice (it's not too late to change on my side). TIA Mike

    Read the article

  • passing callback function accross windows causing error with ie ...

    - by krul
    I have a problem with IE causing two errors: 1. Object doesn't support this property or method 2. Call was rejected by callee. My Intention: To call window.opener.myObject method that is going to retrieve some data using ajax and pass in callback function that live as nested function in popup window that initiated call that is going to handle response data and modify popup window html accordingly. Here is a scenario: I pull up popup window that handles some specific operation. This popup window calling window.opener.myObject method that using ajax call. I'm passing in popup window function that is going to handle response and it works with ff and safari but not with ie. Here is code sample //RELEVANT SCRIPT ON POPUP WINDOW $('#myButton').live('click', function() { var h = window.opener.myObject, p = { 'p1': 1 }; var responseHandler = function(responseObj) { //in IE we never got here if (!responseObj) { alert('Unexpected error!! No response from server'); return false; } //..handle response }; p.p1 = $('#control').val(); h.executeMethod(p, responseHandler); }); //RELEVANT SCRIPT ON WINDOW OPENER MYOBJECT try { $.ajax({ type: 'POST', async: true, url: url, data: postData, dataType: "json", contentType: 'application/x-www-form-urlencoded; charset=utf-8', success: r, // r here is reference to my responseHandler popup window function error: handleError }); } catch (ex) { alert(ex.message); } Any tips?

    Read the article

  • Passing the Class<T> in java of a generic list?

    - by Rob Stevenson-Leggett
    I have a method for reading JSON from a service, I'm using Gson to do my serialization and have written the following method using type parameters. public T getDeserializedJSON(Class<T> aClass,String url) { Reader r = getJSONDataAsReader(url); Gson gson = new Gson(); return gson.fromJson(r, aClass); } I'm consuming json which returns just an array of a type e.g. [ { "prop":"value" } { "prop":"value" } ] I have a java class which maps to this object let's call it MyClass. However to use my method I need to do this: RestClient<ArrayList<MyClass>> restClient = new RestClient<ArrayList<MyClass>>(); ArrayList<MyClass> results = restClient.getDeserializedJSON(ArrayList<MyClass>.class, url); However, I can't figure out the syntax to do it. Passing just ArrayList.class doesn't work. So is there a way I can get rid of the Class parameter or how do I get the class of the ArrayList of MyClass?

    Read the article

  • Passing huge amounts of data as an hexadecimal (0x123AB...) parameter of a clr stored procedure in s

    - by user193655
    I post this question has followup of This question, since the thread is not recieving more answers. I'm trying to understand if it is possible to pass as a parameter of a CLR stored procedure a large amount of data as "0x5352532F...". This is to avoid to send the data directly to the CLR stored procedure, instead of sending ti to a temporary DB field and from there passing it as varbinary(max) parmeter to the CLR stored procedure. I have a triple question: 1) is it possible, if yes how? Let's say i want to pass a pdf file to the CLR stored procedure (not the path, the full bits that make up the file). Something like: exec MyCLRStoredProcs.dbo.insertfile @file_remote_path ='c:\temp\test_file.txt' , @file_contents=0x4D5A90000300000004000.... --(this long list is the file content) where insertfile is a stored proc that writes to the server path (at file_remote_path) the binary data I pass as (file_contents). 2) is it there corruption risk of adopting this approach (or it is the same approach that sql server uses behind the scenes)? 3) how to convert the content of a file into the "0x23423..." hexadecimal representation

    Read the article

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