After a lot of thought and consideration, and Google-ing, I'm hell-bent on creating my own SaveFileDialog.
But I do not know where to start and since I haven't seen anything around the web, I would like to know if anybody has done this before, and what I should look into, or how I might go about doing this? Any help would be greatly app...
I'm trying to write a memory profiler and so far have been able to get my custom functions to work for malloc, free, new and delete.
I tried using __FILE__ and __LINE__ to log the originator inside the overloaded new method, but (as expected) it just gives the details of where the overloaded function is.
Is there a way to get the details...
I understand how the "new" keyword can hide methods in a derived class. However, what implications does it have for classes that implement interfaces that use the keyword?
Consider this example, where I decide to expand an interface by making its properties read/write.
public interface IReadOnly {
string Id {
get;
}
}
pub...
hi
i have old code which didnt use TDD
now i want to write a test for a function which looks like this
function somefunction($someargs){
// do a few checks on $someargs
$database = new DB_PG();
$result = $database->select($query);
// do some changes on result
return $result;
}
since im not much expirienced with ph...
I am trying to get SSE functionality in my vector class (I've rewritten it three times so far. :\) and I'm doing the following:
#ifndef _POINT_FINAL_H_
#define _POINT_FINAL_H_
#include "math.h"
namespace Vector3D
{
#define SSE_VERSION 3
#if SSE_VERSION >= 2
#include <emmintrin.h> // SSE2
#if SSE_VERSION >= 3
#inc...
I have written the following function that permits creation of singleton classes from given classes:
function SingletonFrom(Constructor) {
return function() {
var self = arguments.callee;
if (self._instance === undefined) {
switch (arguments.length) { // this is ugly
case 0: self._instanc...
Hi I am trying to create a new branch using the API, and have used both PendBranch() and CreateBranch(). The problem with CreateBranch() is it commits immediately and I want to be able to add comments as the branch is checked in. So, I what I did is shown below.
Basically I get all the information like server item and local item to be ...
I have a class like this
MyClass : BaseClass
string new FirstName
When I try to serialize this class I get the following error message
Member SQLClientAdapter.Columns of type hides base class member Adapter.Columns of type
...Use XmlElementAttribute or XmlAttributeAttribute to specify a new name.
The recomendation did not work. ...
I think the following code will make the question clear.
// My class
var Class = function() { console.log("Constructor"); };
Class.prototype = { method: function() { console.log("Method");} }
// Creating an instance with new
var object1 = new Class();
object1.method();
console.log("New returned", object1);
// How to write a factory wh...
On Linux, malloc doesn't necessarily return a null pointer if you're out of memory. You might get back a pointer and then have the OOM killer start eating processes if you're really out of memory. Is the same true for c++'s operator new or will you get the bad_alloc exception?
...
Possible Duplicate:
( POD )freeing memory : is delete[] equal to delete ?
Does delete deallocate the elements beyond the first in an array?
char *s = new char[n];
delete s;
Does it matter in the above case seeing as all the elements of s are allocated contiguously, and it shouldn't be possible to delete only a portion of the ...
Hi all,
I need to add a new row in the tableview when i select a row in the table.
Am i suppose to use the following method???
- (void)insertRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
What shoud i write inside the method to add a new row.?
Please do help me,
Thanks in advance
Shibin....
What exactly is the new keyword in JavaScript? Javascript is not a object oriented programming languges and thebefore there are no classes, so it's probably not for creating instances of objects...
...
I have a couple Asp.net pages that use a few database connections - the problem is when these two pages are separately loaded they crash all the other .asp pages but none of the .aspx pages.
I get this error however for the asp pages that don't load: HTTP/1.1 New Session Failed
...
I'm using Qt Creator 4.5 with GCC 4.3 and I'm having the following problem that I am not sure is Qt or C++ related: I call a function with a char * as an input parameter. Inside that function I make a dynamic allocation and I assign the address to the char *. The problem is when the function returns it does not point to this address any...
Hello. I have $data as JSON encoded data and I have this string:
$new_data = "color:'red'";
that needs to be added to $data so that I can read it from it as a json string.
How can I achieve this ?
Thank you.
...
I extend the Order Class generated by activerecord:
public partial class Order
{
private string _refCustomer;
public string RefCustomer {
get { return _refCustomer; }
set{_refCustomer =value;}
}
}
Then, I tried to populate Order's data:
var info = (from o in db.Orders
join...
Hello!
I'm having prblems with my C++/openGL program.
at some point of code, like these(it's a constructor):
MyObject(MyMesh * m, MyTexture* t, float *c=NULL, float *sr=NULL, int sh=100){
texture=t;
mesh=m;
subObjects=NULL;
texCoords=NULL;
if (texture!=NULL){
texCoords=new float[mesh->numSurfacePoints*2];
the new throws an std::bad...
I've debugged my other problem back, to the MyMesh constructor. In this code:
if (hollow) {
numTriangles = n*8;
triangles=new MyTriangle[numTriangles];
if (smooth) numSurfacePoints=n*8;
else numSurfacePoints=n*12;
surfacePoints=new SurfacePoint[numSurfacePoints];
}else {
numTriangles = n*4;
triangles=new MyTr...
Hello,
i just want to create new folders in the documents folder of my iPhone app
does anybody know how to do that ?
appreciate your help!
...