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

define R objects in a list based on column names in a dataframe

I have a data frame df with column names x1, x2, x3, etc. df <- data.frame(x1 = rnorm(100), x2=rnorm(100),x3=rnorm(100)) I would like to create an R object that is a list that looks like: my.list <- list(y, N = length(y), x1 = x1, …
colin
  • 2,606
  • 4
  • 27
  • 57
0
votes
1 answer

How can I construct a jQuery getScript?

I've made a JavaScript code that is way to big for easy copy-paste. Therefore, it would be perfect to use jQuery's getScript to make it smaller. I'm having a hard time to get it to work. I tought it maybe could be some spesial way to construct the…
0
votes
1 answer

Best way to connect classes

So, I'm not using any framework, developing a system on MVC architecture using PHP and have several components. One of them is Sanitize, for filtering vars. The problem that I came into is, how to better sanitize the vars? Easier to show in an…
KeyBi
  • 130
  • 5
0
votes
1 answer

How to call another class construct method in to a construct method?

I like to call FPDF Construct class in Invoice class construct method. How can i call construct method of FPDF cass into Invoice class? Invoice Class: public function __construct($size='A4',$currency='$',$language='en') { $this->columns …
fsuuaas
  • 165
  • 7
0
votes
5 answers

Why is this returning a null arraylist?

I want to create two constructors, one that creates a Human with an age and a name, and one that uses the first constructor to create a human with a random age and name. I create an array of names [Name1, Name2,...,Name9] and pick out a random name,…
armara
  • 535
  • 3
  • 17
0
votes
1 answer

Packing structs together

I have few structs composed with python construct(headers and messages). I can send each of them into tcp socket, but failing to unite them together for sending. #!/usr/bin/env python2.7 import socket import sys from construct…
Ambrase
  • 57
  • 1
  • 10
0
votes
1 answer

Unity - Cannot generate random number within a class construct

I have been trying to create my own class using C# in Unity but I've come across a small issue. Within my PlayerClass construct I want to generate a string of six random numbers using Random.Range (0, 9) use as a reference number. Currently, the…
TommyE
  • 338
  • 4
  • 7
  • 18
0
votes
1 answer

PHP $_GET request inside class construct, not working

This code doesn't work. The $_GET variables are set, but this code always returns $model, $manufacturer, etc, as being empty. What am I doing wrong?
moatist
  • 198
  • 1
  • 13
0
votes
1 answer

Virtuoso VECSL Error from DBpedia endpoint on SPARQL CONSTRUCT query

When I run this query: CONSTRUCT { ?band a dbo:Band ; foaf:name ?name; dbp:website ?website ; dbo:abstract ?abstract ; dbo:genre ?genre; dbo:image ?image; dbp:currentMembers ?member…
Kebby
  • 15
  • 4
0
votes
3 answers

Laravel 5.4 If statement doesn't work in __construct()

Basically this is my __construct of my controller. When non-logged user try go access routes in this controller he is basically redirected to login route. So far so good - if condition is working, redirect is working, route is working. So next I try…
0
votes
0 answers

Blank sides because of Spyropress's ___construct error

My Webspace-Provider just switched to php7 which leads to many blank sides on my webpage. Error when in Debug-Mode: "The Called Constructor Method For WP_Widget In SpyroPress_Widget_Contact_Us Is Deprecated Since Version 4.3.0! Use __construct()" I…
Terba
  • 57
  • 1
  • 3
  • 11
0
votes
1 answer

Get city names from dbpedia with ARC2 using CONSTRUCT

I am trying to fill my rdf with Spanish city names from Dbpedia But... nothing is extracted. I do it with the ARC2 library 'my_db', 'db_user' =>…
elka
  • 25
  • 3
0
votes
2 answers

Redirecting to a certain controller function if validation failed in codeigniter

I am trying to redirect to controller index if not authorized the access to other functions within same controller. According to my coding it is looking like infinite loop. Please help me to do that. class Customer_Dashboard extends CI_Controller { …
Gayan Fernando
  • 581
  • 1
  • 7
  • 23
0
votes
0 answers

PHP PDO - making a class for the connection

I've done a recipe_book with PDO, but not in an object oriented way. Now, I have to do it using objects.. (I do not have much experience with PHP in an object oriented way). Basically, I am just trying to create my Connection class, but I guess I am…
eve_mf
  • 795
  • 3
  • 12
  • 36
0
votes
1 answer

How to construct data structure with variable size elements

I am trying to construct the structure with variable size of the element value from class val : from construct import * TEST = Struct("test", UInt8("class"), Embed(switch(lambda ctx: ctx.class) { 1:…
vijay kumar kdp
  • 37
  • 1
  • 10