Questions tagged [construction]

Use for questions related to building a data structure, such as a heap.

Construction is a concept of Object-Oriented languages.

Objects need to be setup for use:

  • Their member variables need to be allocated
  • Any Object member variables also need to be constructed
  • The Object methods need to be setup for calling

This process is accomplished by construction.

112 questions
0
votes
1 answer

Mesh to mesh. Mesh fitting (averaging). Mesh comparison.

I have 3 sets of point cloud that represent one surface. I want to use these point clouds to construct triangular mesh, then use the mesh to represent the surface. Each set of point cloud is collected in different ways so their representation to…
0
votes
1 answer

java.net.URL bug in constructing URLs?

The construct new URL(new URL(new URL("http://localhost:4567"), "abc"), "def") produces (imho incorrectly) this url: http://localhost:4567/def While the construct new URL(new URL(new URL("http://localhost:4567"), "abc/"), "def") produces the…
George
  • 7,206
  • 8
  • 33
  • 42
0
votes
7 answers

The ** idiom in C++ for object construction

In a lot of C++ API'S (COM-based ones spring to mind) that make something for you, the pointer to the object that is constructed is usually required as a ** pointer (and the function will construct and init it for you) You usually see signatures…
bobobobo
  • 64,917
  • 62
  • 258
  • 363
0
votes
2 answers

construct a matrix in Octave

I have a vector idx = [3; 5; 3; 4; 3; 2; 5; 1]. The number is from 1:k with k = 5. I want to make a "k by m" matrix A (m is the number of elements in the vector idx). Each row of A contains either '0' or '1' with '1' indicated by the index of the…
0
votes
2 answers

Pass a string Recursively without Recreation

I answered a question here: https://stackoverflow.com/a/28862668/2642059 Where I needed to use recurrence to step through a string. I wanted to use a const string& as my parameter on each function, but unless I wanted to reconstruct the string each…
Jonathan Mee
  • 37,899
  • 23
  • 129
  • 288
0
votes
0 answers

Javascript Under Construction page ip redirect?

I am trying to create a site that when I am editing it the user will be redirected because its not on my ip. I have already created a script that should work but don't could someone please give me some pointers? Javascript: netscape =…
Bradley Beeke
  • 163
  • 1
  • 10
0
votes
1 answer

Java - inner private class only to encapsulate construction for outer class

Is this good practice to have class, that is inner class (not static), which only task is to construct and initiate object of outer class (in her constructor)? Lifetime of this class would be equal to lifetime of constructor of outer class. Here is…
Krzysztof Stanisławek
  • 1,267
  • 4
  • 13
  • 27
0
votes
1 answer

Constructing a transfer function

How would I go about creating the below transfer function? It would take two parameters: position of bulge in range (-1.0, +1.0) sharpness of bump That picture only demonstrates movement in the first parameter. I can think of a few possible…
P i
  • 29,020
  • 36
  • 159
  • 267
0
votes
1 answer

C++ using copy-ctor when operator=() is used - exactly how does this work?

What exactly are the rules for C++ converting an operator=() assignment to a construction? Such as Foo foo = bar will actually call Foo's constructor accepting bar as an argument, if it exists. I've googled for how this works but can't seem to find…
Brandon
  • 483
  • 3
  • 12
0
votes
1 answer

Lexical Analyzer: regular expressions implementation via finite automata?

Salutations! While reading chapter 3 of the dragonbook (lexical analysis), I understood pretty much everything (how they specified tokens with regular expressions) till they started talking about finite automata. And it seemed to be a huge part of…
0
votes
1 answer

The process of syntax analysis in compiler construction

I am currently reading the Dragonbook. In chapter 2, it explains the Syntax Analysis process. I'm struggling to understand the entire picture of this process. By reading the book, I'm sometimes confused in what order things in the syntax analyzer…
0
votes
1 answer

Wrong construction or maybe loop crashes?

I am trying to achieve the objectives of my project and connect my modules into window application with buttons. I don't know what am I missing so far but for sure something is wrong, because when my program is running then the main frame is…
Mezulith
  • 33
  • 1
  • 1
  • 9
0
votes
2 answers

C++: How to construct object with two iterators?

I have sample big integer class. It contains dynamic array of digits that comprise the big integer. I would like to construct objects of this class using 2 iterators (begin and end) in order I can pass digits from std::vector or std::list. Some…
nickolay
  • 3,643
  • 3
  • 32
  • 40
0
votes
3 answers

Should I use setValues for all values in a class?

In object oriented programming, is there differences between using constructor or using setValues like method for that. And shouldn't I use setValues method? class Controller{ public: Controller(); Controller(int,int); …
Yavuz
  • 1,257
  • 1
  • 16
  • 32
0
votes
1 answer

Why is a java enum not constructing till after a class callback is hit?

I have an Android class which has a callback from an asynchronous HTTP process, and an enum with a number of status codes in: public abstract class HttpPackage { public enum StatusCode { SUCCESS(0), NOT_FOUND(100), …
Andrew Wyld
  • 7,133
  • 7
  • 54
  • 96