Questions tagged [construct]

Construct is a powerful declarative parser for binary data.

It is based on the concept of defining data structures in a declarative manner, rather than procedural code: Simple constructs can be combined hierarchically to form increasingly complex data structures. It's the first library that makes parsing fun, instead of the usual headache it is today. Official documentation: https://construct.readthedocs.io

239 questions
2
votes
1 answer

Ignore default constructor and use constructor with parameters in Java

I am not very well rounded in Java, which is why I am asking this question that is probably very stupid sounding. Nonetheless, I am trying to figure out how to ignore a class's default construct method, and use a construct method with parameters…
Zack
  • 1,615
  • 18
  • 26
2
votes
1 answer

Why does my dojo.domConstruct.create command not work?

i want to create a div with the id divNodes1 as a child of a div with the id mobileView. i tried this: alert("before"); var divNodesName = dojo.domConstruct.create("div",{ id: "divNodes1" }, "mobileView"); alert("after"); it fires the "before"…
user2219190
  • 157
  • 2
  • 13
2
votes
1 answer

In C++ templates how do I construct an element of unknown type (T)?

I've been given a template problem where you have to make an element of type T, construct it and then add it to an array. I'm not sure how to do the construct part. Do we just do T element; or T element = T();
user2312638
  • 443
  • 2
  • 6
  • 17
2
votes
3 answers

php parent constructor in Exception Class

So I was reading the PHP manual again and saw a comment on the code of a custom exception to call the parent Exception constructor and do not understand the purpose of this. Here is the code: class MyException extends Exception { // Redefine…
Robert
  • 10,126
  • 19
  • 78
  • 130
2
votes
1 answer

Build tree from edges

I have the edges and i want to build a tree with it. The problem is that i can construct my tree structure only when edges are in specific order. Example of orders: (vertex, parent_vertex) good: bad: (0, ) <-top (3, 2) (1, 0) …
mirt
  • 1,453
  • 1
  • 17
  • 35
1
vote
1 answer

X and Y axis doesn' t work on Bada 2.0

I' ve downloaded an example app from Bada documentation, DigitalLocker, and I' ve done and I' m doing some test, I had some problems, but with some help I solved, now I have another problem with X and Y axis in Item forms (personalIdItem, webacco,…
Mitro
  • 1,230
  • 8
  • 32
  • 61
1
vote
3 answers

php oop construct optional parameters syntax error

I'm learning php oop, going through books etc and having a go at my own. In my __construct I have a number of parameters that have default values (in fact all of them do). However when I try to write code to create a new object I'm having syntax…
Ray
  • 3,018
  • 8
  • 50
  • 91
1
vote
2 answers

Assigning a class variable in class definition versus at class instantiation

What are the ramifications of assigning a class variable when defining the class versus in the class constructor? Is the variable assigned in the class definition accessible by all class instances? Example of assignment at instantiation: class…
1
vote
0 answers

doctrine entity __constructor() never called?

Is there no __constructor() to run on an entity class i doctrine (symfony 5)? I'm trying to initialize some default values for my entity, and then override them with parameters from the services.yaml file if they are present there. But commenting…
Matt Welander
  • 8,234
  • 24
  • 88
  • 138
1
vote
1 answer

problem using Uniprot SPARQL endpoint and CONSTRUCT

From SPARQLwrapper I can successfully query and return results using SPARQL select. When I try to use the CONSTRUCT example from the website I get and error "ExpatError: no element found: line 1, column 0" I've tested my code with a dbpedia…
scuffster
  • 51
  • 1
1
vote
1 answer

Echo inside __construct()

How to read variable inside __construct()? Here's the sample code: class Sample { private $test; public function __construct(){ $this->test = "Some text here."; } } $sample = new Sample(); echo $sample->test; What is wrong with…
Ryan
  • 1,783
  • 8
  • 27
  • 42
1
vote
1 answer

Construct (give its value) an object outside its initialize in c++

I make a fraction class, but I want to assign its value to another fraction, usually, I have to do this: fraction a; a.setNumerator=(1); a.setDenominator(2); b=a; //b is already intialized above This is long so I made a temporary function like…
KhiemGOM
  • 69
  • 8
1
vote
1 answer

Unresolved external symbol of constructer when using STL vectors

So, I have a pretty simple project in VS2019 that includes three files: a.h #pragma once class A { public: A(); }; a.cpp class A { public: A() {} }; main.cpp #include #include "a.h" int main() { std::vector va; …
1
vote
0 answers

Empty group by and nested construct

I have two questions regarding (i) group by clauses and (ii) nested construct SPARQL queries. (i) Is it possible to formulate a SPARQL query with an empty GROUP BY clause i.e. something like GROUP BY (), where the keyword "GROUP BY" appears in the…
user13863639