I have a function that takes a pointer to a superclass and performs operations on it. However, at some point, the function must make a deep copy of the inputted object. Is there any way I can perform such a copy?
It occurred to me to make the function a template function and simply have the user pass the type, but I hold out hope that C++ offers a more elegant solution.
Can anybody explain how to free memory of a static member Variable? In my understanding it can only be freed if all the instances of the class are destroyed. I am a little bit helpless at this point...
Some Code to explain it:
class ball
{
private:
static SDL_Surface *ball_image;
};
//FIXME: how to free static Variable?
SDL_Surface* ball::ball_image = SDL_LoadBMP("ball.bmp");
I'm looking to create a simple form with some textfields and a button using the Android SDK. Could someone point out a good example or tutorial for getting started?
Question says it all.
Can someone point me to an example of how they do the alerts at the top when a new message arrives or someone posts to my answers or I just have a notification..
Thanks.
P.s. I would love a JQUERY solution, but can work with just a js solution.
My current process for debugging stored procedures is very simple. I create a table called "debug" where I insert variable values from the stored procedure as it runs. This allows me to see the value of any variable at a given point in the script, but is this is there a better way to debug MySQL stored procedures?
What is the point of having
enum SomeEnum : byte // <----
{
SomeValue = 0x01,
...
}
when you have to make a cast just to assign it to the same type of variable as the enums underlying type?
byte b = (byte)SomeEnum.SomeValue;
Hi, I'm new to *N*X OSes, actually MacOS, and when I try to build sources with make and makefiles, I never can.
I try to run make, even try to run it passing the makefile as an argument, but all I get is "There's nothing for make to do"
Can you point me to a tutorial, reference, or something ?
My C code contains many functions with pointers to different structs as parameters which shouldn't be NULL pointers. To make my code more readable, I decided to replace this code:
if(arg1==NULL || arg2==NULL || arg3==NULL...) {
return SOME_ERROR;
}
With that macro:
NULL_CHECK(arg1,arg2,...)
How should I write it, if the number of args is unknown and they can point to different structs?(I work in C99)
I'm trying to make good on a promise I've made to provide a decent set of documentation for a C# component that I've written.
I've done some googling and found templates for software design at high and low level. The problem is that all of the templates seem to be geared towards a complete system design as opposed to individual components and are consequently overkill.
Can anyone please point me in the direction of a template geared towards component documentation?
Many thanks
I have a PCRE regex that looks like this
s/(<input.+?)alt(=".+?".*?>)/$1title$2/
Can anybody help me with making that work on sed?
Eventually can anybody point me to some guide/blog post/whatever that explains differences between sed regex and PCRE?
I don't now if this title is very clear, but I would like to understand how this is possible :
And how we can have 2 elements on the same row of the listview, and handle different clicks, as the listview deals with handling the click on a child.
Thanks for anyone who could point me in the right direction.
I have some points in 3D but all points are in single plane. It can be any plane. Now I wanted to know the interior angle between any three consecutive points. How can I do so?
For example, I have three points (1,0,0),(0,0,0) and (-1,1,0) then I want the answer as 135 degree. But If I have the third point is (-1,-1,0) then the answer should be 225 degree.
Are there any tools available that can scan multiple .php files and report back duplicated lines/chunks of code?
It doesn't have to be really smart but basically give me a starting point for manual scans to improve the codebase of some of my apps.
http://www.akben.com/The%20Winton%20Group/contact_us.php
I have a set of five divs sitting side to side. The last two move down approximately 20px in IE8 when the page is made smaller from the right hand corner... can anyone point out what I am messing up?
Thank you!
I want to use use share point to access the OCR engine? I downloaded the tessnet2 .dll and Demo application with database but this app. not working properly and cant generate the text which I want please help me any who finding errors in me and say show effert. friends I am just stating with .net.
Given the rise in popularity of C# and others, (which you can point out in the comments) what future does C++ have?
Consider that most OS code is a mix of Asm/C/C++ and a lot of FOSS still use it.
Also consider the upcoming C++0x standard that brings a few changes to the mix.
I essentially want to reconstruct the getTickCount() windows function so I can use it in basic C++ without any non standard libraries or even the STL. (So it complies with the libraries supplied with the Android NDK)
I have looked at
clock()
localtime
time
But I'm still unsure whether it is possible to replicate the getTickCount windows function with the time library.
Can anyone point me in the right direction as to how to do this or even if its possible?
I'm trying to match the point between 2nd and 3rd paragraphs to insert some content. Paragraphs are delimited either by <p> or 2 newlines, mixed. Here's an example:
text text text text
text text text text
<p>
text text text text
text text text text
</p>
<--------------------------- want to insert text here
<p>
text text text text
text text text text
</p>
Hi, I am wondering if anyone has used or read about PHP scripts compiled as a .so extension for Apache... Thing is I think I remember reading about it somewhere but dont know if such a thing exists.
This looks promising, but incomplete and abandoned: http://phpcompiler.org/
Im interested because i think it could improve performance... Perhaps someone could point out a framework or apache extension that does this.
Thanks!!
I'm interested in learning about the alternative patterns to Model-View-Controller, specifically the Model-View-Adapter and Application-View-Controller patterns.
Google results tend to be either a high-level overview or Java-based.
Can anyone either provide, or point me to, an example of these patterns in either PHP, Python or JavaScript?
I am using Htmlunit (browser automation/testing tool) to go through a series of links or perform a set of actions on a page.
At some point after this I want to see the resulting page in a browser (internet explorer or firefox etc.)
How can I do this. ? Thank you Friends...
I have richTextBox1, and here is the contents:
line one from my textbox is this, and i want this to be normal, arial, 8 point non-bold font
line two, i want everything after the | to be bolded... | this is bold
line three: everything in brackets i (want) to be the color (Red)
line 4 is "this line is going to be /slanted/ or with italics
and so on, basically if I know how to do what I mentioned above, I'll know everything I need to know to complete my project. Code examples would be very very much appreciated! :)
I downloaded pidgin source code and i don't know where to start from ..
Can any one pls ;) point the right way to understand that program ?
and also tell how to compile it on windows system .. it has manuals to compile on a Linux system but not windows .