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

Variables in __construct() when called by mysqli_fetch_object

I've got a class 'Event' which I am creating objects from via mysqli_fetch_object. The __construct() function is running and the objects variables are being set but they aren't set within the __construct() function. I am using the following line to…
N1AK
  • 11
  • 1
1
vote
1 answer

How to use the passed arguments in OOP perl?

another question. I have this constructor: sub constructor { my $class = shift; my $point = { year => 2013, month = 'june', @_, }; bless $point,$class; } So if I instantiate that: my $object = Exercises -> constructor (year => 2012,day =>…
Belmark Caday
  • 1,623
  • 3
  • 21
  • 29
1
vote
4 answers

Java: Constructing a Map from a single expression?

I wonder why there's no way to construct a map with values in a single expression. Or is it? I'd expect new HashMap().add(key, value).add(key, value)...; I can't find anything like that even in Commons Collections. Did I miss some way in JDK or…
Ondra Žižka
  • 43,948
  • 41
  • 217
  • 277
1
vote
1 answer

Java Syntax error on token(s), misplaced construct(s)

im doing a java vending machine os and I've just imported my original project into eclipse and added a guy page and since then its been throwing errors everywhere no mater what i do, can i get some help? the main error now is 'Syntax error on…
Technosasquach
  • 13
  • 1
  • 1
  • 3
1
vote
1 answer

php - construct by both parent and child

I want to make such thing in php: I want to have the parent class named "item", and a bunch of child classes like "sword", "armor" etc. I can call simply: $some_sword = new sword($id) ; But I also want to do sth like this: $some_sword = new…
1
vote
1 answer

Adding multiple search variables to construct

I'm writing a search engine and at the moment it searches for only the keywords that are submitted with a heap of other information. How can I ask it to look in other areas? This is what I have: $construct .= "keywords LIKE '%$search_each%'"; This…
Mike
  • 13
  • 3
1
vote
3 answers

redirect is not working in codeigniter _construct function

I am facing a problem using redirect in _construct function, In timesheet controller I wrote the following code and I am getting an error in the browser " This problem can sometimes be caused by disabling or refusing to accept …
Hriju
  • 728
  • 1
  • 16
  • 27
1
vote
2 answers

Why __construct method don't work in User Entity in FOSUserBundle?

I am using the FOSUserBundle. This is the User Entity: namespace Shop\UserBundle\Entity; use FOS\UserBundle\Entity\User as BaseUser; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity * @ORM\Table(name="fos_user") */ class User extends…
melnikoved
  • 111
  • 1
  • 10
1
vote
1 answer

NodeJS: extend Class and __construct method

Im migrating my system from PHP to NodeJS, and I have the following doubt: In PHP, I have the class class Users extends Groups { function __construct(){ parent::__construct(); //do something } } But, how to do the same in…
Marcelo Rodovalho
  • 880
  • 1
  • 15
  • 26
1
vote
1 answer

python construct for protocol parsing

I am trying to mix up the power of twisted Protocol with the ductility of construct, the declarative binary data parser. So far, my MessageReceiver protocol accumulates the data coming from the tcp channel in the following way: def…
autholykos
  • 836
  • 8
  • 14
1
vote
2 answers

__construct($foo = NULL) is not working

I have strange problem. This is just constructor method of class, not worth to show other code, anyway, look at this code: Class xy { public $x = 10; public $y = 10; public function __construct($x = NULL, $y = NULL) { …
Rozkalns
  • 510
  • 2
  • 6
  • 26
0
votes
2 answers

Which aspects of the JAVA conditional operator construct are described formally, and which are described informally

This question on my courswork that I could not understand. Q. The JAVA Language Specification (3rd Edn.) is available for browsing or downloading at java.sun.com/docs/books/jls/. Locate the section of it that describes the so-called conditional…
Mujtaba Alboori
  • 395
  • 1
  • 7
  • 20
0
votes
5 answers

Re-writing without using unique construct in SQL

Using the schemas member(memb_no, name, age), book(isbn, title, authors, publisher), and borrowed(memb_no, isbn, date), I have the following query. Only problem is I'm not supposed to use the unique construct. How can I re-write this without using…
Bryan
  • 2,951
  • 11
  • 59
  • 101
0
votes
1 answer

Can I use two constructor method in PHP?

I have two php files: main.class.php form.class.php in these files there are two class that have same name as their file name and class form extends from main class main class has a constructor How can I set a constructor method for class form?
Soroush Khosravi
  • 180
  • 1
  • 2
  • 13
0
votes
1 answer

PascalString() missing 1 required positional argument: 'encoding'

PascalString() missing 1 required positional argument: 'encoding' I am trying to run constructs.py but it just shows an error and I don't know how to fix it This isn't my script constructs.py from construct import ( Array, Bytes, …
MadDemon
  • 3
  • 3