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
-1
votes
1 answer

Format a date inside a class with construct

I'm having some issues with the next problem. I have a function to get all the dates from a SQL table. And I would like to change those dates format to a dd/mm/YY style. I think I should do it through a __construct function, but I'm not able to…
Gekyzo
  • 41
  • 5
-1
votes
2 answers

Use function and static method

In a table class I want to use simple functions but also static functions, how can I do? Here is my current code (which does not work) In my controller, I just want to do: Table::get('posts') which directly invokes the function…
Darkh
  • 19
  • 8
-1
votes
2 answers

Misplaced construct in homework

I do all my programming assignments in eclipse first before putting them in putty and submitting them to our teacher. In eclipse, I have this strange error in one of my methods. it says "Syntax error on token(s), misplaced construct(s)." public…
Mike
  • 59
  • 4
  • 11
-1
votes
1 answer

PHP - Is there anyway to set error reporting levels such that single-statement inline clauses are flagged, at least with a warning

I've searched for this but it is a difficult issue to concisely search. I believe in strict language requirements and error/warning reporting. I run PHP with All and Strict error reporting enabled. If a error or warning is generated, I fix the…
SimonT
  • 486
  • 1
  • 4
  • 16
-1
votes
2 answers

Word meaning the arrangement of sounds or syllables to form words?

See Title. An answer would also satisfy: Syntax is to Sentence as ______ is to Word? Or, in more code-friendly terms Syntax is to Function Logic as ______ is to Construct Logic? (idk, I tried)
SnSation
  • 73
  • 4
-2
votes
1 answer

usage of using keyword in struct C++

I created an exception like this in my header_file run.h struct invalid_assignment : std::runtime_error { using std::runtime_error::runtime_error; }; I dont understand the using std::runtime_error::runtime_error; part. This looks unecessary.
awwd
  • 19
  • 5
-2
votes
4 answers

call the construct class again trough another function of the class in PHP?

I want to call the __construct function again in my class something like this: class user{ function __construct($ID = null) { if($ID){ //code } function findUser() { //code …
Mars
  • 4,197
  • 11
  • 39
  • 63
-2
votes
1 answer

Do I need to provide a constructor for all possible combinations of input parameters?

I have to write some code, but I don't know, how to do it in the easiest way. In my program there are: Class P Class HP: public P Class CP: public P and class M I have to write M construct with will be able to handle the diffrent combination of…
Marianx
  • 31
  • 5
-2
votes
1 answer

php parrent::__construct and oop

hey I am fairly new to oop and while learning i got to a problem that tortures me more than 2 hours. could you please tell me why this-> flavor do not get "grape" value?
funny
  • 83
  • 1
  • 14
-3
votes
1 answer

How to draw a brick (Rectangle) on Java?

I'm doing an assignment. This is the first part of the assignment: Drawing a single brick These are the steps to draw a brick: Construct a new Rectangle object. Set the position of your rectangle according to the coordinates that were passed in as…
J.Doe
  • 47
  • 1
  • 6
-4
votes
2 answers

Storing things for use later?

Is there any way that I could create a class in which something entered would be stored and be able to used later? For example Coins class will construct a coin that has a name and a value. It will also have necessary accessor methods. Your Purse…
-4
votes
3 answers

Java misplaced constructs

I recently installed eclipse on my mac and I was fooling around with it in class. I keep getting misplaced construct errors on my first print line and a bunch on syntax error on my main declaration. I'm not really sure whats up. import static…
Blank1268
  • 123
  • 3
  • 7
  • 14
-5
votes
4 answers

Is this a constructor (C++)

I saw this code on internet today: #include using namespace std; class Test { private: int x; int y; public: Test (int x = 0, int y = 0) { this->x = x; this->y = y; } Test setX(int a) { x = a; return *this; } Test setY(int b) {…
Souradeep
  • 31
  • 1
  • 3
-6
votes
1 answer

How to you solve this code

my code is this I have to manipulate stored data in the array to print individual elements of the array .ie the third and fifth team members names public class project { public static void main(String[]args) { String[]players =…
JINX
  • 5
  • 2
1 2 3
15
16