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

Functions in construct statement

I am just coding something and wanted to know how I can include a function in a construct. if (!formatPhone($phone) && !empty($phone)) { $e = 1; $e_message .= '
  • The phone number is invalid, please use the format (000) 000-0000.
  • '; }…
    ATLChris
    • 3,198
    • 7
    • 39
    • 65
    0
    votes
    1 answer

    Get Language from construct in laravel

    i'm trying to get selected language in my construct to use in any function in that class: my route: Route::group(['prefix' => 'admin', 'middleware' => ['AdminMiddleWare','auth','localization']], function(){ Route::get('/',…
    behzad
    • 55
    • 2
    • 12
    0
    votes
    1 answer

    need help on Unity: parameter doesn't exist in current Construct Context

    I was going to practice how to create Inventory, but it seems it won't read the parameter from the other script. I'm working on my training based on my tutorial, here's how the code goes: public class ItemCatalogue : MonoBehaviour { public…
    0
    votes
    1 answer

    Get called function from parent __construct

    is there any smart solution to get the called method from parents __construct? example: call_user_func_array([$childrenController, $indexMethod], array()); I want to know that $indexMethod got called, but I try to get this information while I am…
    spyro95
    • 136
    • 9
    0
    votes
    3 answers

    Fetch data in codeigniter construct function

    I try to fetch data from database in codeigniter construct function but getting undefined method error controller- class Welcome extends CI_Controller function…
    0
    votes
    0 answers

    How to extend classes in purchased product (Multiscraper) built on Codeigniter 2.1.3

    I hope my question is specific enough, even though most of you may be unfamiliar with Multiscraper (MS), you are probably familiar with Codeigniter (CI). MS is basically built on CI 2.1.3, and is a webpage scraper for various shopping carts. I will…
    conanDrum
    • 215
    • 2
    • 7
    0
    votes
    1 answer

    Library construct, struct("string"/anythingElse) issue

    Construct is a parsing library to parse hex datas. After reading the data, you first have to define the map and then parse it. You can find an example below; .... data, addr = self.s.recvfrom(1024) c = Struct("sync"/Int16ul, "ID"/Float32l) x =…
    M.Emin
    • 63
    • 7
    0
    votes
    3 answers

    How to get construct.GreedyRange to give back a Byte?

    Okay, suppose I have this working exactly as expected: from enum import IntEnum from contstruct import * class Char(IntEnum): START = 0xAB STOP = 0xBC ESC = 0xCD MAPPING = Mapping(Byte, {x: x+1 for x in Char}) SLIP = GreedyRange( …
    Sean McVeigh
    • 569
    • 3
    • 18
    0
    votes
    1 answer

    C++ node assign error: Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)

    I am learning DSA , Linked List , new to C++. My linked list is of exception. Error Info: It is much longer than it should be. Here is my code: define struct ListNode // Definition for singly-linked list. struct ListNode { int val; …
    black_pearl
    • 2,549
    • 1
    • 23
    • 36
    0
    votes
    0 answers

    Send and save data to php with construct2

    Im trying the past 2 weeks to send and save data to a php but with no luck. So, my goal is , to give the ability to users have download my app from playstore to can vote if they agree or not for something in the app. To do that i put a yes sigh and…
    Savvas Ant
    • 25
    • 5
    0
    votes
    1 answer

    New construct 2.9 syntax for struct staticfield data type

    I had this, using construct 2.5.2: something=Struct("somename", Bytes("version",4), StaticField("somefieldname",32) ) myVar=something.parse('John') myVar.version=struct.pack('
    BitQuestions
    • 651
    • 7
    • 14
    0
    votes
    1 answer

    Fatal error: Using $this when not in object context - Dokan Wordpress Plugin

    I am receiving this error when using this code in my wordpress theme´s function.php It seems the code has two parts, i think the last one must be inside the "construct function" but i don't know how to do it. function order_email_include_saler_name(…
    Voltaki
    • 115
    • 7
    0
    votes
    1 answer

    Parsing index lists with construct

    Lets say a file format is defined like this: size (uint32) some_list[size] (uint32) size_indexes (uint32) other_list[size_indexes] (uint32) So there is a list some_list containing some integers and then there is another list other_list containing…
    reox
    • 5,036
    • 11
    • 53
    • 98
    0
    votes
    1 answer

    laravel factory adapter pattern

    I'm implementing adapter pattern on Laravel 5.5. Questions: I have already using DI in adapter. Why errors show that too few arguments have been passed in constructor. The constructor should be created automatically, right? The error enter image…
    PH.Chen
    • 59
    • 1
    • 2
    • 8
    0
    votes
    0 answers

    If date falls within alternate weekly range in php

    I'm trying to use PHP to find out which alternate week (A or B) today's date falls into and then output something for A and something for B. Here's an example of a Monday A and B output but I can't figure out how to find out out which one is in the…
    James
    • 1
    • 1