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
2 answers

How to make a if and else in alternative function in OPL?

I want to make if the earn value is not same with the plan then choose alternative 2, if same then choose alternative 1. I used tuple mode to determine the 2 alternative in OPL using CP(constraint programming) I still stuck until this part **subject…
Beta
  • 1
  • 1
0
votes
1 answer

Using Lisp: Write a Common Lisp function named myList which creates the following list and returns it

This was the list given: (4 (7 22) "art" ("math" (8) 99) 100) but I'm still having trouble coming up with the correct code in order to answer this problem all I have come up with is (defund myList() (4 (7 22) "art" ("math" (8) 99 100) ) but…
0
votes
1 answer

concatenating android canvas

I am looking for an example for constructing a canvas with multiple bitmaps(kind of in a grid pattern). would I need to create a single bitmap that holds all of the other bitmaps on top or can I just place each bitmap "into" the canvas (similar to…
gardian06
  • 1,496
  • 3
  • 20
  • 34
0
votes
1 answer

Would the C++11 targeted constructor allow me to safely initialize derived class from template constructor?

I have a variety of objects created from template class bar (below). Each object has a data member with different data type (eg std::string, bool, int, etc.) I have a set of current defaults of each of the derived/templated types in a static array…
SMGreenfield
  • 1,680
  • 19
  • 35
0
votes
4 answers

Multiple calling constructor will change the member pointer address in C++

I write a program to check the init process of class creation, and found calling the constructor multiple times changed the member pointer address. Look at following snippet. #include using namespace std; class FF { public: FF(){ …
Jiancong
  • 67
  • 1
  • 7
0
votes
1 answer

DefaultConstructionHeuristicPhase - workingScoreHolder holds invalid score of not accepted move

I build a VRP solution based on optaplanner 7.4.1. using a default construction heuristic "FIRST_FIT_DECREASING". In the ConstructionHeuristicDecider I can see now, that at the end of method decideNextStep a step is chosen and handed back to the…
0
votes
1 answer

Tools for Java template-based String construction

I am trying to refactor some legacy code. The task here is to construct lengthy messages/strings based on some pre-defined template that looks like this: field1,8,String filed2,5,Integer field3,12,String ...... Then I am handed a java object that…
Hua
  • 666
  • 2
  • 9
  • 21
0
votes
2 answers

migrating from calloc() to new

I came across a large pod struct, in which I wanted to add a std::vector member. struct LargePodStruct { float x,y,z; int *arr; int sz; ... // dozens of primitive types std::vector the_new_vector; }; In order to…
Grim Fandango
  • 2,296
  • 1
  • 19
  • 27
0
votes
0 answers

A list in a class seems to be static?

In a Python class I wrote the following method: class user(): address_list = [] def __init__(self): self.address_list.append("a") When I use it as this: ur1 = user() ur1.address_list.append("b") ur2 =…
0
votes
1 answer

php how to ensure that parent class gets constructed

What is the best way to ensure that parent class allways gets constructed, since we can easily override constructors without having to call them at all. Also: is this bad practice? abstract class A { // make it final to ensure parent constructor is…
fabio
  • 2,269
  • 5
  • 22
  • 34
0
votes
3 answers

SomeInterface > Java - how use this construction correctly?

First of all I have following class: public class Pair { public K key; public V value; public Pair (K key, V value){ this.key = key; this.value = value; }} and an interface: public interface Generator { public T next ();} The…
0
votes
1 answer

Diffrent outputs caused by a " irrelevant " statement in graph construction (symbolic style programs ) in tensorflow

I have a basic issue about the symbolic style programs in tensorflow, below are codes ( tensorflow 0.12 ): import numpy as np import tensorflow as tf import sys x = tf.placeholder(tf.float32, 1) y = 1 z = x + y * 2 # x = z with tf.Session() as…
Paul
  • 21
  • 3
0
votes
0 answers

Minimum Variance portfolio optimisation using NLOPTR

I am using SLSQP function in NLOPTR for portfolio construction using 34 low volatility stocks. The stocks are not important. What I am trying to do is being able to impose a minimum weight and a maximum weight to each stock. The hin function,…
0
votes
0 answers

How to create words construction

I am trying to create some words construction using custom template, for example I need something like this: and I don't really know best way to doing this, I want to create labels rotate and place it same as image looks like, but I am sure it is…
Eugene
  • 145
  • 1
  • 10
0
votes
1 answer

Text to speak causing application to crash (Android studio)

I'm guessing it's an error with the initiation/construction, but the parameters seem to be the correct ones and I can't find any other issues. Here's the entire activity code. The text to speech methods and the method that calls it are at the very…
user5330423