new

Can I use apply() with constructor to pass arbitrary number of parameters

I've got a function wich can accept a varible number of parameter with a rest operator. I want create an object passing the argument collected with the rest operator directly to a constructor without create an object and call an initializing function and without passing the entire array but the parameters ah I do with apply() function...

C++ new operator inheritance and inline data structures

I have a (C++) system that has many classes that have variable storage (memory) requirements. In most of these cases, the size of the required storage is known at the creation of the object, and is fixed for the lifetime of the object. I use this, for instance, to create a "String" object that has a count field, followed directly by th...

Behaviour difference Dim oDialog1 as Dialog1 = New Dialog1 VS Dim oDialog1 as Dialog1 = Dialog1

VB.Net 2005 I have a now closed Dialog1. To get information from the Dialog1 from within a module I need to use Dim oDialog1 as Dialog1 = New Dialog1. VB.Net 2008 I have a still open Dialog1. To get information from the Dialog1 from within a module I need to use Dim oDialog1 as Dialog1 = Dialog1. VB.Net 2005 does not compile using Di...

Placement new and non-default constructors.

Can I call the C++ placement new on constructors with parameters? I am implementing a custom allocator and want to avoid having to move functionality from non-default constructors into an init function. class CFoo { public: int foo; CFoo() { foo = 0; } CFoo(int myFoo) { foo = myFoo; } }; CFo...

How to open a popup window from a webpage on iphone

Hi, I'm trying to open a popup window (to display another webpage) from my webpage on click of a hyperlink. I'm not able to achieve this on iPhone. I was wondering if there is any way to do this? Any pointer will be helpful. Thanks in advance. ...

c++ cpp conversion from 'myItem*' to non-scalar type 'myItem' requested

i have this code struc MyItem { var value MyItem* nextItem } MyItem item = new MyItem; And I get the error: "c++ cpp conversion from 'myItem*' to non-scalar type 'myItem' requested" Compiling with g++ Any ideas? Thanks! ...

Dynamic Linq Select concatenation

I have a dynamic select statement thus: "new(PurchaseOrderID as ID_PK, PContractNo + GoodsSupplier.AssociatedTo.DisplayName as Search_Results)" As can be seen I wish to concatenate the 'PContractNo' and 'GoodsSupplier.AssociatedTo.DisplayName' fields into one returned field named 'Search_Results'. It is important that these two fields ...

What is this second new?

What is the second line? (Seen while answering another question.) int * x = new int [1] ; int * y = new (x) int; After the second line x and y have the same value (point to a same place). What's the difference between y = x and the second line? Is it like a constructor or something? ...

Print in new line, java

Hi, I have following code : System.out.println(" | 1 2 3 4 5 6 7 8 9"); System.out.println("----------------------------"); System.out.println(""); I use println to create a new line. Is it possible to do the same using \n or \r? I tried to add \n to the second println statment and continue printing with the prin...

TextCtrl -> Truncate a float in Erlang

My last question leads me to this one: wxTextCtrl:setValue( TcGrossProfit, io_lib:format("~.2f",[NewGrossProfit])), generates an error from wxTextCtrl, with a bad arg. I know this is the culprit NewGrossProfit = 5.45333, io_lib:format("~.2f",[NewGrossProfit]) Thanks for the last one, hope this one's easier -B EDIT Last Questi...

What do braces after C# new statement do?

Given the code below, what is the difference between the way position0 is initialized and the way position1 is initialized? Are they equivalent? If not, what is the difference. class Program { static void Main(string[] args) { Position position0 = new Position() { x=3, y=4 }; Position position1 = new Position(...

How can I insert data from one sheet to another sheet using POI?

How can I insert data from one sheet to another sheet using POI? I have a template and have a default sheet, What I want to do is to create a new sheet to insert another data when my previous work sheet have reach a maximum rows in excel of 65536. ...

What pre-requisite knowledge is required for developing android apps, Iphone etc?

I am looking forward to start a mobile application development business and wish a to have direct knowledge of the technologies that run behind the cool apps. Being new to the programming / development world...pls suggest if it is better to learn .Net or Java before learning about Android SDK, iOS SDK etc? ...

C++ object created with new, destroyed with free(); How bad is this?

Hello, all. I am working on modifying a relatively large C++ program, where unfortunately it is not always clear whether someone before me used C or C++ syntax (this is in the electrical engineering department at a university, and we EEs are always tempted to use C for everything, and unfortunately in this case, people can actually get ...