Questions tagged [structure]

-2

votes
2

answer
26

Views

Display some characters in a new file

I want to read 'c' and 'Hello world!!' but i see just the hexadecimal part. Here the structure : typedef struct step { int n; char l; char c[25]; } toto; int fd = open('one-structure.yolo', O_CREAT | O_WRONLY, 777); toto some; some.n = 212347;...
Lu-6
0

votes
0

answer
10

Views

In PYCHARM imports work fine but give me an error while running the module from CLI

I am newbie to programming. I am importing a function from a.py to b.py (i.e from pkg.subpkg1.a import func) but it give me an error (ModuleNotFoundError: No module named 'pkg') directory structure: root-dir /pkg /subpkg1 a.py /subpkg2 b.py
Abdullah
1

votes
1

answer
601

Views

How validate data from post in restful api

I need to validate some data before insert into the database, for that i create a little service that return invalid fields from an entity. It works ok when validating single entities. class EntityValidator { protected $validator; public function __construct(ValidatorInterface $validator) { $this->v...
fajuchem
1

votes
1

answer
846

Views

Net core MVC clean architecture without repository pattern

I'm trying to create a MVC application in net core 2.1 using the eshoponweb example application. Ive read that in entity Framework core there's no great benefit of putting a repository layer in and to just use the ef dbcontext directly. How would I do this in a clean architecture scenerio. In the ex...
JimmyShoe
1

votes
4

answer
192

Views

Python code structure for class organization

In Java the code is structured in packages with you each class in a separate file. Is there any similar practice in python? Is it better to have each class in a different python file and have them import each other or should I just dump my code(all my classes) in a single file?
A.D
1

votes
1

answer
129

Views

Fasm declare structure in stack

I cant declate the structure in the stack rightly in fasm for some reason. Here is the problem, let's say i have this structure: struct IMAGE_SECTION_HEADER _Name db IMAGE_SIZEOF_SHORT_NAME dup (?) union PhysicalAddress dd ? VirtualSize dd ? ends VirtualAddress dd ? SizeOfR...
StrawberryMilk
1

votes
0

answer
53

Views

PHP building directory structure image and css errors

Sorry If this is basic but its really holding back my learning of correctly building a directory structure and I just cant figure out how to fix the problem. Consider the following structure: My Problem Whenever I create a file in the directory other than src my images and css paths gets messed up i...
Marilee
1

votes
0

answer
33

Views

Is it acceptable if two services interact with each other in Angular 2 application?

I have two services, for example: RoomService import { Injectable } from '@angular/core'; import { Room } from './room.model'; @Injectable() export class RoomService { ... getRoom(): Room { return room; } ... } EventService import { Injectable } from '@angular/core'; import { Event } from './event.m...
Andrey Pilyushkin
1

votes
1

answer
504

Views

2D Image to 3D world Coordinates

We crawled a set of images from the Google Street View (GSV) API. I want to estimate the 3D World coordinate from 2D Image given the following: 1. The GPS location (i.e., latitude and longitude) of the camera capturing the image Conversion of GPS coordinates to translation matrix: Used 2 types of co...
fararjeh
1

votes
1

answer
56

Views

Writing data from a structure to a file in c#

So I am currently attempting to write data from a structure to a binary file and am not having a ton of luck, I was just wondering if anyone could point me in the right direction of what I may need to implement as most of what I've tried and researched has been unsuccessful. Below is very basic skel...
sidelaunch
0

votes
1

answer
28

Views

Manipulating pointer to array of pointers

Trying to write a C snippet to store and retrieve an array of structure pointers. I have copied my snippet bellow. What I am trying to do here- method Xos_get_cb_info_from_handle() should return the pointer to the base address of the structure localclient.exit_cb. Which seem to work. After getting t...
Amit Kulkarni
1

votes
1

answer
805

Views

How to use `index.js` in a Node.js when creating an Express service?

Hi I am structuring my Node.js project based on this, like so: Root product name index.js: (contains requires for the product and the main export) productName.js: contains application logic test test1.js test2.js ... Now I have two questions What should logically go in index.js? At the moment I hav...
AKMorris
1

votes
0

answer
269

Views

Redux and ducks folder structure - nested folders?

I've implemented ducks in my React-Redux project and I followed the guidelines from here: https://medium.freecodecamp.org/scaling-your-redux-app-with-ducks-6115955638be One of the things I haven't quite figured out is if nested folders is supported by this. I need this because in my app, I have man...
Android Noob
1

votes
1

answer
35

Views

Code a directory structure from scratch (imaginary files / folders etc.) in python?

Tell me if this has already been answered!!! Background info: Hello, I am Max, 14 years old and from Germany. Currently I am working on the mechanic for a little game I want to code in Python, just to learn the language and get comfortable with it. In The game you have to find and delete a imagina...
Lume
1

votes
2

answer
110

Views

getattr on a ctypes structure returns a handle and not a value

The below code snippet seems to be returning a handle instead of a value while getting the c_int attribute of my ctypes structure. How can the method get_val be changed to return the value of either o_num or o_str? import ctypes class my_struct(ctypes.Structure): _fields_=[('o_num',ctypes.c_int),('o...
RogerLePatissier
1

votes
0

answer
196

Views

Ionic framework: Structuring custom service providers

I've been doing tons of research to find out what's the wise way to structure Ionic project. Currently, I'm focusing on Building A Serverless API using Firebase Cloud Functions One thing that came up to my mind was the following command below seems to make a structure of service providers unsustaina...
JeffMinsungKim
1

votes
1

answer
83

Views

Code Structure for Very Simple c++ Text Adventure

I'm trying to write a simple text adventure game in c++ but as its now getting longer I am looking for advice on how to structure my code better. The game is very simple, its really more of a chance for me to play with c++ as I am relatively new to it. I print a block of text to the terminal, ask t...
Andrew
1

votes
1

answer
181

Views

RAWINPUT RAWHID Structure in C# Byte Array

I am trying to read data from HID devices using: uint dwsize = 0; //RAWINPUT input = new RAWINPUT(); uint result = GetRawInputData(lParam, RID_INPUT, IntPtr.Zero, ref dwsize, Marshal.SizeOf(typeof(RAWINPUTHEADER))); //_rawBuffer = new RAWINPUT(new RAWINPUTHEADER(), new RAWDATA(new RAWKEYBOARD(), ne...
Ian.V
1

votes
0

answer
70

Views

Binary Search Output Issue in Inventory Program c++

I am having issues with binary search function within my homework (I am completely done with it except for this one issue). The program allows a user to manage the inventory of a small store that sells various products of any type. It will first read the inventory from a text file named “inventory...
Kelby Webster
1

votes
1

answer
85

Views

How to be a bit more efficient with Sapper?

Currently using Sapper to create a design system app. I have a heirachy of folders which create the app through the routes folder. The folder structure looks something like this: design-foundations - interactions -- buttons -- inputs - components -- header Here is a look at my design-foundations/int...
Justin
1

votes
3

answer
117

Views

How to search in vector of structure by a structure attribute?

I have a Vector of structure that is sorted on based of a variable. For ex: struct Client { string name; int sm_index; int client_id; int user_id; Client(string str, int x, int y, int c) : name(str), sm_index(x), client_id(y),user_id(c){} } Sorted on based of sm_index How can i find and fetch the...
Vishal Bhatia
1

votes
1

answer
834

Views

Angular and Express - File structure

I've read a lot of articles and post about the correct structure of angular and express. I just want to know, should I use the same node_modules folder to angular/express, or should I separete them ? My structure is somthing like this: application -- here I have the front end(angular) server -- here...
Brandon Aguilar
1

votes
0

answer
413

Views

Having an Error: Element ref was specified as a string (container) but no owner was set. HOW do I solve?

I am attempting to build the correct react project structure to use to build a temperature converter. problem - I keep getting the following error each time I attempt to render JSx via a class component: Error: Element ref was specified as a string (container) but no owner was set. This could happ...
iivri andre
1

votes
2

answer
69

Views

Recursing android device using c# and shell32

As I want to recurse the complete structure of any folder I am using Shell32, which can connect to lettered drives c:\;d:\ etc and connected devices that do not have letters such as an Android tablet. My problem is that I cannot extract the Folder from FolderItem to recurse. Thanks. Using Shell32; /...
user3535647
1

votes
2

answer
74

Views

How can i structure my Messenger Chatbot in NodeJS?

I'm currently working on a NodeJS powered Messenger Chatbot, using Wit.ai and Firebase, hosted on Heroku. I've followed an udemy course to learn the basics about chatbots and I've made a decent chatbot imo. But, as I'm adding new features, I don't really know how to correctly structure and organize...
Clément Jolliet
1

votes
1

answer
69

Views

How to store millions of children in 100 parents in mongoDB

I am developing a Node.js server that will add children to 100 different parents every 60 seconds. The parents are 100 different markets: and the children are timestamps containing some data in them: ...millions of more timestamps Timestamps will be more than millions in the database. I am thinking...
Mr. Blockchain
1

votes
2

answer
65

Views

Deleting structure from head(or maybe duplicates?) yields weird text when printing

I'm currently learning C, and my assignment is to create a structure that holds in records, and I am supposed to use linked-list. One of my functions is to delete a record by entering the last name. Code stops working after I use fgets(no crash just stops). struct students { char firstname[21]; char...
Hele
1

votes
0

answer
53

Views

Embedding of mutually dependent structures/interfaces

I have 3 structures that are similar about 70%. So I'd like to extract some common part and create some extensions with specific methods and fields. Final structure will work as follows: method .Start() from Common is called Start() calls method .Name() from specific part the latter return a string...
Eugene Lisitsky
1

votes
0

answer
60

Views

How to access a structure in a variable whose name is in a string

struct Rigs { char ip[16]; char outlet[3]; }; int main { char user_choice[4]; scanf('%s', user_choice); char target[7]; sprintf(target, 'Rig%s', user_choice); struct Rigs Rig201; strcpy(Rig201.ip, '192.168.1.98'); strcpy(Rig201.outlet, '11'); printf('Target's Address Found At: %s\n Rig's Outlet i...
Virosa
1

votes
2

answer
29

Views

How to insert a Structure into a node of a LinkedList using C?

so I'm trying to enter the information of a Student, including first name, last name, score, and zip code, into a single node. I would then be able to insert the info of another student into the next node, and so on, and be able to access them. The part I'm having issues with is adding lastname, sco...
Vester
1

votes
0

answer
167

Views

Cython macro definition in structure

I'm using Cython to import a structure to python from C while there are some macro definitions which include functions. I just don't how to realize the structure in Cython. typedef struct _SparMat { int m, n; int *rvec; int *ridx; double *rval; int *cvec; int *cidx;...
Icy
1

votes
0

answer
46

Views

MySQL Keywords as column name

Scenario I have a MYSQL table with a column called text. I've only recently realized that TEXT is in fact a MYSQL keyword, but I haven't had any problems using that column name. Background I've already noticed from the MYSQL documentation that there is a difference between reserved words and keyword...
E. Villiger
1

votes
1

answer
140

Views

Averaging SIFT features to do pose estimation

I have created a point cloud of an irregular (non-planar) complex object using SfM. Each one of those 3D points was viewed in more than one image, so it has multiple (SIFT) features associated with it. Now, I want to solve for the pose of this object in a new, different set of images using a PnP alg...
John Bent
1

votes
1

answer
227

Views

size of a field in an structure

Is there a way to get the size of a field in a structure? For instance, $bits does not work. any other approach? localparam L_DATA_BITS = $bits(pkt_char_t.length); typedef struct packed { logic [15:0] checksum; logic [3:0] offload_flags; logic length_err; logic [13:0] length;...
Mike J
1

votes
2

answer
42

Views

nodejs circular module app structure

I have 3 files in the following structure: root.js mod1.js mod2.js mod1.js and mod2.js are both required / instantiated in root.js and both mod1.js and mod2.js require('root.js'); So that I can perform callbacks to public functions in root.js... The issue I'm having is that const root = require('roo...
Darcey
1

votes
0

answer
82

Views

Elegence and terseness with structure-of-arrays as opposed to array-of-structs

Suppos I need to hold some data consisting of n Foo's, n Bars and n Bazs. The elements of corresponding indices are related, so you can also think of this data as n triplets of Foo, Bar andBaz`. The first description of the data is a 'structure of arrays', the second is an 'array of structures'; you...
einpoklum
1

votes
0

answer
19

Views

using Exomisere structure to modify an MVStore

i am currently trying to figure out how i can append my own data to the MVStore that the Exomiser uses. https://github.com/exomiser/Exomiser.git So the MVStore is accessed like MVMap alleleMap = mvStore.openMap('alleles'); So i tried to rebuild the Allelekey and Property classes but there are so mu...
radtke de
1

votes
1

answer
53

Views

sum matlab arrays within cell structure

I have a 221 x 24 cell array, S. Within each array is another array consisting of several different fields (let's just say A, B, C, and D), whereby each field (A, B, C, D) are a 50 x 50 array. I want to sum only the A's, B's, C's, and D's within each column of array S. For example: S{1,1}.A + S{2,1}...
Micheal Simpson
1

votes
1

answer
306

Views

eigenvalue decomposition of structure tensor in matlab

I have a synthetic image. I want to do eigenvalue decomposition of local structure tensor (LST) of it for some edge detection purposes. I used the eigenvaluesl1 , l2 and eigenvectors e1 ,e2 of LST to generate an adaptive ellipse for each pixel of image. Unfortunately I get unequal eigenvalues l1 , l...
bahar
1

votes
0

answer
42

Views

GCC end-aligned structure

I am working on a memory allocator. Each allocated buffer starts on an 8-byte boundary and each is preceded by a header for managing the allocation (the header is immediately before the 8-byte-aligned buffer). The header looks like: struct header { uint32_t hword32; void *hpointer; }; Ass...

View additional questions