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

Python. How to deal with No module named 'construct' when installing pykeepass?

I am trying to install pykeepass library on my python environment. I have successfully installed all the other pip libraries I need to work with, but can't seem to install this one. I use python with a software I work with. The python is installed…
Oskars
  • 407
  • 4
  • 24
2
votes
3 answers

"Could not execute Model_Hotel::__construct()" with mysql_fetch_object, properties remain uninitialized

I'm running PHP 5.3.6 with MAMP 2.0.1 on Mac OS X Lion and I'm using Kohana 3.1.3.1. I try to override the __set() and __get() methods of the standard Kohana ORM module with my own methods. Some of my models extend my class which extends the ORM…
Claudio Albertin
  • 2,076
  • 4
  • 18
  • 20
2
votes
4 answers

Inheritance problem: calling parent construct function in subclass

I have a class named Display which extends class Layout, which extends class DOMDocument. I get: Fatal error: Call to a member function loadHTMLFile() on a non-object. Code as follows: In index.php : $dom = new Display(); $dom->displayData(); In…
CMS scripting
  • 669
  • 1
  • 7
  • 13
2
votes
2 answers

Problem while initializing attribute in constructor c++

While i try to debug ERROR appear : "Unhandled exception at 0x5784F2F6 (ucrtbased.dll) in Final project.exe: An invalid parameter was passed to a function that considers invalid parameters fatal." Tried every thing can't figure out how to solve…
2
votes
1 answer

How to proxy JavaScript creation primitive

I want to do something when creating a string, for example: String = new Proxy(String, { construct: (t, a) => { return { a: 123 } } }) console.log(new String('q')) // { a: 123 } However, if you use primitives, it doesn't…
hby
  • 65
  • 6
2
votes
4 answers

PHP: How to call private values of parent construct in child construct?

I want to be able to set a private attribute's value in the parent constructor, and call the value in a child's constructor or method. For example:
user614972
2
votes
2 answers

Java equivalent of Python's "construct" library

Is there a Java equivalent of Python's "construct" library? I want to write "structs" like so: message = Struct("message", UBInt8("protocol"), UBInt16("length"), MetaField("data", lambda ctx: ctx["length"]) ) It doesn't have to…
someguy
  • 7,144
  • 12
  • 43
  • 57
2
votes
1 answer

python, windows 7: ImportError: cannot import name X

I'm working with two files: construct\core.py and USBtransport.py. Below is the relevant code from both files: construct\core.py: class Range(Subconstruct): __slots__ = ["min", "max"] def __init__(self, min, max, subcon): …
jackl
  • 21
  • 3
2
votes
1 answer

Send interface to constructor PHP

I have downloaded an example for a payment connection. No i am trying to use it, but the constructor want's to get the interface when i declare ClassName But i have no idea how to do that. I tried $interface = CallbackInterface::class; $interface…
user1664803
  • 293
  • 1
  • 7
  • 22
2
votes
2 answers

From JS to PHP; yet another CORS issue (seems to be)

Good morning community, currently Im writing a plugin (account managing for a dev-tool called "Construct 2" (scirra.com)) in Javascript which uses a PHP backend and communicates with it via AJAX. When the backend script only contains simple tasks,…
2
votes
1 answer

How to make phpspec evaluate my constructor

public function __construct(RequestSchemaInterface $requestSchema) { $this->schema = $requestSchema->getSchema(); } When I run phpspec for Builder then $this->schema is always null. In normal call it sets schema. I got let implemented function…
nomysz
  • 187
  • 1
  • 9
2
votes
1 answer

CodeIgniter website skeleton

I was coding PHP using controll based on adress and GET method with index.php?site=filename. Then i was including existing filename.php in content div. That was simply but effective. Also i has got notification div where i included file with data…
Bejkrools
  • 1,129
  • 2
  • 17
  • 38
2
votes
0 answers

Google play APK - You uploaded an APK that is not zip aligned.

I've created a web-browser using construct 2 application and once i have finished it and had an executable .apk file, i tried to upload it to google play but it always gives me this error, "You uploaded an APK that is not zip aligned. You will need…
2
votes
2 answers

My code with str_replace don't work

why this code isn't working? I was trying to rename, switch location and other, but it seems to be str_replace bug. It would be nice, if somebody told me, what's wrong... This is my…
Michał Poreda
  • 97
  • 1
  • 2
  • 8
2
votes
1 answer

What's the terminology for this C construct: 'int myInt = ( { int x=42; x; } );'?

I've just been shown a very neat C trick: int myInt = ( { int x=42; x; } ); // sets myInt to 42 This is very useful for writing macros. But what exactly is going on here? Could someone pick this line apart and isolate/identify the mechanisms?
P i
  • 29,020
  • 36
  • 159
  • 267
1 2
3
15 16