FAQ Database Discussion Community


expected expression before ' '

c,structure,typedef
file.h typedef struct xyz{ unsigned int a; }__attribute__ ((packed,aligned(1))) abc,*ptr; file.c volatile unsigned int *add; add = &abc; ERROR : Expected Expression before 'abc' Can anybody help with this?...

Express and Angular directory structure

angularjs,node.js,express,directory,structure
I want to build a website with Express and Angular (no SQL) so I started wondering what is the right structure for this kind of app. For Angular there is a directory structre I really like from here: app/ ----- shared/ // acts as reusable components or partials of our...

Structure Array not printing correctly | C++

arrays,char,structure
This is the structure struct Student{ char firstName[MAX_LEN + 1]; char lastName[MAX_LEN + 1]; float gpa; }; So let me say that StudentList1 has the correct data. count Struct1 is how many names are entered. Student StudentList1[10]; int count5 = 0, countfName = 0, countlName = 0; while(count5 < countStruct1)...

In C++11, why does int16_t have a size of 4 when declared after a float inside a struct?

c++11,alignment,structure,sizeof,uint16
I have a data structure like this: struct mystruct { float f; int16_t i; }; sizeof(int16_t) gives 2, but sizeof(mystruct) gives 8 instead of 6. Why is that? How can I declare an int16_t variable of 2 bytes inside my data structure?...

Printing an Array of a Structure

c,arrays,printing,struct,structure
I have written a program in C that sorts car records by year & prints them, model & prints them, and the finds and prints the duplicates. However, the only time any records print is in the duplicate function. Otherwise, the outputs are totally blank... I have tried compiling in...

Localization in the hmc structure

xml,properties,localization,structure,hybris
I have a problem. I have this part of hmc.xml structure: <type name="Order" mode="append"> <!-- LOLLO --> <organizer> <search mode="append"> <condition attribute="versionID" operator="is null" /> </search> <editor mode="append"> <tab name="positions_and_prices" position="0" mode="append"> <section name="original_totals" position="1" mode="append"> <listlayout> <attribute name="subTotalOriginal" descriptionattribute="currency" labelwidth="530" width="124">...

Most efficient way to implement table with multiple column?

java,data,structure
I am attempting to create a table with multiple column such as The initial implementation I thought was is that use Hashtable with key being "String" and value being "List" of String. But is this the most efficient way? I would be accessing data entry a lot and I am...

Using different structure alignment settings

c,visual-studio,structure,memory-alignment
What are the problems of mixing (Visual Studio) C/C++ projects which have different structure alignment options set? I know that I can obviously set the options differently in different projects, but does this have an affect on the behaviour of the output library/application? Say I have a library, with structure...

Hierarchical reusable control in Angularjs

javascript,html,angularjs,structure
I'm learning angularjs and I'm a bit troubled regarding the re-usability of custom controls. I have a custom control which I want to re-use in the following scenarios: Scenario 1: The custom control has a controller with scope variables that I want to use in another controller. In this case...

Can't Access Declared Structure with an Object

c#,oop,structure
I am using a Structure shown below public struct TPCANMsg { /// <summary> /// 11/29-bit message identifier /// </summary> public uint ID; /// <summary> /// Type of the message /// </summary> [MarshalAs(UnmanagedType.U1)] public TPCANMessageType MSGTYPE; /// <summary> /// Data Length Code of the message (0..8) /// </summary> public byte LEN;...

c segmentation fault due to duplicacy in structure in functions

c,function,memory,segmentation-fault,structure
The program works fine for the first time , but if we want to add the details of another book, it gives segmentation fault after I enter the first attribute int main() { float count_tot=0,profit_tot=0; char option='y'; fflush(stdin); struct book b; while(option!='n') { b=getinput(); display(b); b.need= calcneed(b); b.profit=calcprofit(b); printf("Need To...

dput structure not loading properly

r,structure
I have downloaded this data file https://www.sugarsync.com/pf/D315881_05804680_037112 (from this question: http://stats.stackexchange.com/questions/148065/what-do-the-the-lsmeans-from-lsmeans-package-in-r-represent-when-calculated-ov) which contains dput output and opened it in geany text editor. From here I copied the entire structure and tried to paste it on the R command prompt. But it is not getting pasted properly and breaking at one...

How to initialize nested structures in C++

c++,nested,structure
i was trying to perform stack functions using nested structures. But i am facing problem initializing the stack. its the problem with the initialize function of LinkList structure in the code given below. Please help and let me know what can i do to run this code completely. thanks in...

Swift structures properties is the same type as structure it self. Recursion?

swift,structure,static-members,getter
Please help me to understand the following Swift construction: struct UIViewAnimationOptions : RawOptionSetType { init(_ rawValue: UInt) init(rawValue rawValue: UInt) static var LayoutSubviews: UIViewAnimationOptions { get } static var AllowUserInteraction: UIViewAnimationOptions { get } static var BeginFromCurrentState: UIViewAnimationOptions { get } static var Repeat: UIViewAnimationOptions { get } static var...

error: cannot allocate an object of abstract type

c++,structure
As much as I want to create an MVCE of this problem...I really can't. I am using an open source fluid flow solver called Palabos with its dev guide also available . It is based on generic structures and mpi. Probably the best available open source solver of its kind...

Inputing info from a structure to an array

c++,arrays,structure
Been trying to figure out how to input information into an array and output it from structured variables. I can input and output the information easy without using arrays, however I am trying have a list of workers inputed from the keyboard. I also need to calculate the wage earned...

Why padding in structures is required? [duplicate]

c++,c,structure
This question already has an answer here: Why isn't sizeof for a struct equal to the sum of sizeof of each member? 8 answers structure padding and structure packing 5 answers We know that the correct order of declaring variables in structures changes the size of a structure also...

How to avoid structure padding?

c,memory-management,structure,padding
I'm curious to know about how #pragma will help to avoid stucture padding (please give me one programme to understand it). By default compilers will allocate memory in an aligned manner. So by avoiding structure padding what will be the benifit programmer will get? When is it neccessary to avoid...

What do different icons and symbols in Android Studio's Structure sidebar mean?

android,android-studio,structure,legend,sidebar
When I click on 'Structure' sidebar in Android Studio, it displays the contents of the current class. However there are certain icons & symbols used to indicate different members, e.g., a circle with letter m for methods, etc. Where do I get the complete list and the details for all...

Struct or class for internationalized name object in .NET?

c#,class,internationalization,coding-style,structure
I've got a Person class and I currently try to add name attributes, either as class or as struct. Background is, thought in global dimensions, not every person's name must consist of given name and family name. So I decided to make it more atomic and create a new general...

why i get same values inside hash table?

c,hash,structure,dynamic-memory-allocation
I created hash table to insert my values . But when I insert more than one value I got same values inside all fields . my code is here : create a structure for both user and hashtable struct UserNode { char *username; char *password; }; struct HashTable { int...

Pointers: Expression is not assignable

c,function,pointers,structure
I'm writing a function whose purpose is to change the value of struct variables. I'm getting error messages that say the expressions toward the end of my first function are not assignable. How, then, do I have the function change the values of the daate structure? Here's my code: #include...

C - cast void* to structure in thrd_create()

c,multithreading,casting,structure
I know there's a lot of answered questions about casting void* to struct but I can't manage to get it work the right way. Well I want to create a thread which will play music in background. I have a structure which gather the loaded music file array and the...

How to get index of list of list

r,data,structure
The following code library(gplots) mydata <- mtcars hclustfunc <- function(x) hclust(x, method="complete") distfunc <- function(x) dist(x,method="euclidean") # Compute cluster d.mydata <- distfunc(mydata) fit.mydata <- hclustfunc(d.mydata) full_dend <- as.dendrogram(fit.mydata) full_dend[] Produce this list of list: [[1]] [[1]][[1]] # <--- How to access this [1] 31 attr(,"members") [1] 1 attr(,"height") [1] 0...

I am stuck on my programming project

structure,control
A large company pays its salespeople on a commission basis. The salespeople receive $200 per week plus 9% of their gross sales for that week. For example, a salesperson who sells $5000 worth of merchandise in a week receives $200 plus 9% of $5000, or a total of $650. Your...

Matlab: How to plot data from n number of structures

matlab,dynamic,structure,field
I am working on a matlab script that has the following structures: Parameters1, Parameters2, Parameters3 etc until ParametersN. I would like to access two fields within each structure (e.g. x and y) so that I can plot the data. I would like to overlay the x and y data from...

Very simple hash table inquisition

c,data,structure,hashtable
If the index for a hash table is calculated by using some integer value returned from a hash() function % TABLE_SIZE, doesn't that mean the only possibly index values are 0-9, since the range of the return value for the modulo operator is [0, 9]? I know this is really...

How to add data dynamically in structure which is a Pointer to an array of pointers

c++,arrays,pointers,struct,structure
I have two structure as below: typdef struct abc { int id; char name; }s_abc,*lpabc; typdef struct result { int acc_no; lpabc *details; }s_res; I need to dynamically add the data within the structure result which points out to an array of pointers ie: struct abc The structure abc could...

C++ Using Pointers with structures in functions

c++,function,pointers,struct,structure
I am working on a project in which I am supposed to organize a customer’s bank account information using structures and pointers. I am getting an error in the initialize_CD_account function. The error message says "uninitialized local variable 'a' used" I don't know what the problem is, any help is...

How to extract business logic in this example

design-patterns,logic,structure
The following method filters a data collection based on order statuses. Im wondering what would be the best way to extract the business logic held within about the order statuses. For example, say the order statuses were to change down the line i.e. ('in_transit', 'at_courier') then this method, and associated...

How to return an array of structs to Console Application from Class Library

c++,arrays,dll,structure
I have a Structure :- Test.h typedef struct employees { char* name[5]; int empi_id; }; Test.cpp I created a function where I need store the values within these structure. int Disp() { employees e[5]; e[0].empi_id=10; e[1].empi_id=100; e[2].empi_id=500; e[3].empi_id=1000; e[4].empi_id=5000; return 0; } TestDll.cpp Console Application: void main() { LoadLibrary(("TestDll.dll")); int...

Why isn't scanf( ) waiting for input from keyboard?

c,printf,structure,scanf,fflush
I have below C code. #include<stdio.h> int main() { //Declaring structure book. struct book { char name; float price; int pages; }; struct book b[5]; int i; //Below loop takes the info if 5 books from user for (i=0; i<5; i++) { printf("Enter name, price, and pages: "); fflush( stdin...

C++ header file parsing

c++,parsing,header,structure
I need to parse a header file. My goal is to search the specific structure from the header file and extract the values and offsets of the structure variables. Can any one please suggest the best way for parsing the header file by omitting the comments and how to parse...

C - Popping last item from linked lists

c,list,pointers,structure
I am learning linked lists and they are causing me a lot of troubles. I am calling the function with this call: pop(&list); ANd here's the code: void pop(NODE** first) { if(*first != NULL && first!= NULL){ NODE* ptr = *first; while(ptr->next->next != NULL){ ptr = ptr->next; } free(ptr->next); ptr->next...

What is the optimal number of lines of code per file in node.js? [closed]

node.js,performance,structure
I know this is a slightly subjective question, but I would appreciate insight from experienced web app engineers. I am currently working on a medium size webapp in node.js with a REST API/Single Page App type of architecture. On the server side I am always struggling to know when it...

How to implement variables in a structure in c?

c,variables,structure
THIS IS NOT THE COMPLETE PROGRAM struct p { int a; int b; int c; }; void main() { int op,i,j,to,from,a,b,c; struct p pr[3]; clrscr(); for(i=1;i<4;i++) { pr[i].a=0; pr[i].b=0; pr[i].c=0; printf("P%d %d %d %d\n",i,pr[i].a,pr[i].b,pr[i].c); } do{ printf("\nEnter the option you want to execute:\n1. Internal Event\n2. Send Message \n3. Exit \n\n");...

Structure packing duplicity

c++,structure,memory-alignment,preprocessor-directive,compiler-options
I am writing code to a specification which defines structures without packing, for example: struct LASHeader_1p2 { char FileSig[4]; //= "LASF"; // 4 unsigned __int16 FileSource; // 2 6 unsigned __int16 Reserved_Unused; // 2 8 unsigned __int32 Project_ID_Data1; // 4 12 unsigned __int16 Project_ID_Data2; // 2 14 unsigned __int16 Project_ID_Data3;...

undefined variable in matlab for a strcture

matlab,function,variables,structure
this is kind of lame but i am not able to remove this error. i have a function where i supply the name of a component which is an element inside the structure add_strcut. so add_strcut has data_a , data_b etc. and data_a has the field 'ode'. and again 'ode'...

Structure C++ meaning stuck

c++,structure
This is really question on C++ language, what does SNeuron(int NumInputs); mean inside the structure? I'm not c++ programer and this construction inside structure looks strange to me. Can anybody explain it what it could be for? I already tried google. struct SNeuron { //the number of inputs into the...

Can't sort array of structures alphabetically

c,arrays,sorting,struct,structure
I am trying to sort strings in an array of structures alphabetically then print, but my code doesn't work. I've been trying to figure out why for the past few hours, but can't figure it out. I'm sure its probably something super obvious, but I've only been programming for a...

Trouble with c++ function style [closed]

c++,function,structure
#include <iostream> #include <iomanip> using namespace std; //Function prototypes int getDays(); double getDepartureTime(); double getArrivalTime(); double getAirfareFees(); double getRentalFees(); int getMileageFees(); double getParkingFees(int days); double getTaxiFees(int days); double getRegistrationFees(); double getHotelExpenses(int days); double getBreakfastExpenses(int days, double dTime, double aTime); double getLunchExpenses(int days, double dTime, double aTime); double getDinnerExpenses(int days, double...

Nested structures with loadlibrary Matlab

matlab,pointers,structure,loadlibrary
I'm interfacing Matlab and C-code in order to be able to directly use some C-functions in Matlab. I know the prototype of these functions but the code inside could change. In order to interface it all, I use loadlibrary and calllib in Matlab and I don't want to use MEXFiles....

How to copy a structure(which is a structure within structure) and fill it in the array of structure in C++

c++,arrays,pointers,structure,cen-xfs
I have a structure which a structure within structure as shown in this following question : How to dynamically fill and display the structure which is a pointer to pointer of arrays in C++ implementing xfs I need to fetch the values of the above structure to another structure that...

What does the value `/W` mean in PDF `/Tabs` key?

pdf,format,structure
According to the PDF 1.7 specifications, a PDF may only have the values /R, /C and /S on the /Tabs key of a page object (see PDF reference Page 145, Table 3.27). I have a PDF in front of me that fails in PDF structure preflight with a value /W...

C++ Calculating wage earned and overtime using a structure.

c++,structure
I am trying to figure out what is wrong with my code. I must use a structure to prompt the user for a workers idNumber, hoursWorked, and hourlyWage. I have the idNumber, hoursWorked, and hourlyWage working well, however the problem lies in my calc function. I cannot figure out how...

Rails: tools for auto-building existing project features/structure

ruby-on-rails,schema,structure
I need to create new version of my current project - take all features and rewrite it, add new features. What tools or gems do we have for Rails project to build for me some kind of catalogue of existing features? Maybe in form of models and associations between it...

Structure Array arguments in C

c,arrays,pointers,structure
I'm pretty new to C and am taking a class right now and having difficulty with a project. We have a structure in this project called a Symbol. We also have a structure in this project called a Node. Nodes have an array of Symbols. All I'm trying to do...

merge structure field cells in matlab

matlab,merge,structure,field
I want to merge structure fields in case I do partial computations, to later fill up the whole structure field cells. The results are put into cells according to index into the cell, like this: for i=3:4; results1.index{i}=i; results1.sqr{i}=i*i; end for i=1; results2.index{i}=i; results2.sqr{i}=i*i; end giving, respectively: results1 = index:...

Structure for Classes containing Lists of Instantiated classes to be stored in Dictionary

c#,list,class,dictionary,structure
For my example classes to be stored are lets say: class Race { public string Name { get; set; } public DateTime Date { get; set; } public List<Competitor> Competitors = new List<Competitor>(); } class Competitor { public string Name { get; set; } public List<Stats> SomeData = new List<Stats>():...

How not to get lost in implementation of '<' for multi-variable structures

c++,operator-overloading,structure
Similarly to Preferred implementation of '<' for multi-variable structures I'm implementing a less-than operator for a structure with multiple values. I'm not worrying about using equality or less than operators, lets assume all the members correctly implement both. My structure has four fields and the operator is already getting quite...

Find item in array of structure

arrays,vb.net,search,structure
I have a question. Imagine that in vb.net, fill a array of structure with a lot of items. For example, here I declare the structure called Persons: Public structure Persons Dim name as string Dim age as integer End structure Then, I declare a variable that is a array of...

Structuring parent and sub classes references

java,object,reference,structure,parent
I'd like to create multiple parents, each parent contains multiple children. The problem is that i want only one parent for each set of children, and each of the children must know about their parent and vice versa. Set of children share one instance of the parent - it's methods...

What is the appropriate use case in a REST API to use the ? Question Mark for parameters?

api,rest,structure
On this REST tutorial site, When, if ever, is it appropriate to put something like http://dev.m.gatech.edu/developer/USER_NAME/api/WIDGET_NAME/test?query=someparam instead of http://dev.m.gatech.edu/developer/USER_NAME/api/WIDGET_NAME/test/someparam or http://dev.m.gatech.edu/developer/USER_NAME/api/WIDGET_NAME/test/someparam/var1/param/var2/param ? I've seen various things on SO....

Random number from given numbers in structure C

c,pointers,structure
I have my structure set up like this struct judges { char surname[20]; int id; struct judges *wsk; } How can I get random number from given IDs? Like for example, I add 3 judges with IDs 3, 7, and 253, is there a way to get random number only...

Error in getting input in structure using gets()

c,arrays,structure,gets
I am making a program to take input in teacher structure but there is unknown run time error , here is the code - #include <stdio.h> #include <conio.h> struct Teacher { char Name[30]; char Qualifications[20]; int experience_year; }th[10]; void teacher() { int t,i; printf("Enter how many teachers are in department\n");...

SQL Server table manipulation

sql-server,table,structure,pivot,pivot-table
I am really new here. Currently working on SQL Server 2012. I have table A of the following structure (records are a subset of the full data table): CREATE TABLE [dbo].[TABLE_A]( [ASSET ID] [float] NULL, [TASK ID] [float] NULL, [IN_YEAR ] [float] NULL, [IN_WEEK] [float] NULL, [FLAG] [nvarchar](1) NULL )...

Passing dynamic array of structs to GPU kernel

c++,cuda,structure,dynamic-memory-allocation
I try to pass my dynamic array of structs to kernel but it doesn't works. I get - "Segmentation fault (core dumped)" My code - EDITED #include <stdio.h> #include <stdlib.h> struct Test { unsigned char *array; }; __global__ void kernel(Test *dev_test) { } int main(void) { int n = 4;...

JsTree with custom json data

javascript,jquery,json,structure,jstree
I have this structure in json I can not be modified by request. { "allowedUrls": [ { "url": "http://www.google.com" } ], "id": 1, "name": "Redirection Rule", "redirectActivation": { "frequency": 1, "trigger": 1 }, "redirectSet": { "httpDestination": "Redirect Url", "responseCode": 301 } } I need to use this structure to populate...

Pointer to pointer in struct C++

c++,c,pointers,structure
Here is the structure typedef struct PSetting { unsigned char Level; unsigned int Mall; unsigned int Many; WCHAR* Name; // optional } PSetting; PSetting p; p.Name = L"NewName"; p.Level = 5; p.Mall= 0; p.Mall= 0; I am required to create a member for the structure and pass it to this...

ZF2 directory structure for lots of applications

php,zend-framework,zend-framework2,directory,structure
I'm learning ZF2 and I need some help. I am working in a company which has an intranet. We have lots of applications like newsletter, HR, website control, helpdesk, etc. Is it correct to put all the applications in the same ZF2 directory structure as if they were modules? Like...

Is there any tool that can help me analyze the class structure of my objective-c project? [closed]

ios,class,import,structure,clear
I got a terrible legacy IOS project recently. I want to clear those redundant classes that will not be executed in the whole project anymore. It there any tool that can help me doing this? What I image is there can have some tools help me locate those redundant #import...

Are For loops evil in R?

r,loops,for-loop,structure
I've heard that you're not meant to force a procedural programming style onto R. I'm finding this pretty hard. I've just solved a problem with a for loop. Is this wrong? Is there a better, more "R-style" solution? The problem: I have two columns: Col1 and Col2. Col1 contains job...

Is there a way to combine several different conditionals with a shared statement?

c,syntax,logic,structure,conditional-statements
Is there a way to combine several different conditionals with a shared statement? For example: int a; ... if (a == 1){ foo; ... return K1; } else if (a == 2){ foo; ... return K2; } ... else if (a == i){ foo; ... return Ki; } Is there...

AngularJS: Triangular three way binding — Project Structure

angularjs,structure
I am currently working out an admin interface with a Live Preview and I am still not 100% on how to structure it properly. My page basically consists out of two parts. The Admin Interface and the Live Preview. Obviously, the Admin Interface fills some variables with data and the...

Binary Tree - Pointers as Parameters

c,pointers,tree,structure,treenode
Hello everyone thank you for your time. So today I started reading about binary trees. I decided to give it a try on my own using recursive functions but Im not sure if Im using the correct pointers.(Im obviously not because of errors but I don't see what to change...a...

How to sort a structure array

arrays,matlab,structure,cell-array
How do I sort the oo structure array alphabetical order by item name. oo = struct('Item', {'Quill','Ink Pen', 'Pencil'}, 'Cost', {10, 2, 1}) I tried using the sort() function but it didn't work? Thank you....

Write dynamically allocated structure to file

c,io,structure
Suppose we have following structure: struct Something { int i; }; If I want to write in a file any data of this type(dynamically allocated), I do this: struct Something *object = malloc(sizeof(struct Something)); object->i = 0; // set member some value FILE *file = fopen("output_file", "wb"); fwrite(object, sizeof(struct Something),...

The h1 in the structure of a page

html,html5,structure,semantics
(I am not sure if this is the right place to ask this question, if not please suggest the appropriate forum) I have a very simple structure in the page: <nav> <h2>Menu</h2> <ul> <li>first</li> <li>second</li> </ul> </nav> <h1>This is the h1</h1> <p>This is a paragraph</p> <h2>This is the h2</h2> <p>This...

Pointers: “Expected identifier before '(' token”

c,arrays,pointers,structure
Project: Source to Destination Fare Matrix Language: C. Rationale: This is for a school exercise. My output is past a day's due and all the problem is this one kind of line of code that I have no clue what the problem is about. Objective: To make a program that...

Using Cell Array Contents to Create Struct Entries

matlab,structure,cell-array
Say that I have two cell arrays, A and B, that contain string values. I wish to populate a struct S such I generate every possible combination of S.valueinA.valueinB = 1. I am currently trying to accomplish this with two nested for-loops that iterate through every possible combination and wanted...

Working with coordinates x y

c++,function,structure,coordinates,circle
I need to read from a file coordinates of points. The file looks like this: x0 y0 x1 y1 .... Then find center and diameter of the smallest enclosing circle. But I stucked in the beginning. I don't know how to hold coordinates and decided to choose array of structures....

How to add a Field in structure array?

arrays,matlab,structure,cell
I have a cell array that has 'Player' {1x3 cell} 'Position' {1x3 cell} I would like to create a structure array using this. The field names are supposed to be 'Player' and 'Position'. I can't use struct() to create it. This is what I tried for ii = 1:length(sparta) kra...

Re-model the shape of my data.frame/excel spreadsheet

r,data.frame,structure,gsub,stringr
this is my first question on this forum. I would like to re-model the structure of my dataset. I would like to split the column "Teams" into two columns. One with the hometeam and another with the awayteam. I also would like to split the result into two columns. Homegoals...

Reconstructing an Index in C

c,data,structure,strtok
I have a program that reads in a giant text file of lines in this format, and I need to construct a data structure from this text file. microfinance 5 41 5 1650 2 1667 1 1811 1 1988 5 subminiature 1 432 1 The number 1st number after the...

avoid raw generic type in inheritance/delegation structure

java,generics,structure,delegation
My problem is quite complex and hard to explain, so I built a smaller example. It's still complex, but let me try my best... You can download the full example here: https://mega.co.nz/#!400lSbqa!NoyflWYk6uaQToVDEwXyn22Bdcn_6GdTxB6dPUfU5FU I recommend importing this into your favourite IDE and playing around. Imagine you are programming a multiplayer game....

Access Struct in C++?

c++,matrix,structure
I have a problem in c++ the teacher asking us to display a field of structures that contains n=100 students. Is this the right way to do it ? #include <iostream> #include <math.h> using namespace std; struct Students{ string name; int id; int mark1; int mark2; int mark3; }; int...

Display not showing in data structure output

java,data,structure
public class Link { public static void main(String[] args) { LinkList theLinkedList = new LinkList(); theLinkedList.insertFirstRequest(3); theLinkedList.insertFirstRequest(6); theLinkedList.insertFirstRequest(10); theLinkedList.insertFirstRequest(20); theLinkedList.display(); } int floorRequested; Link next; Link(int floorRequested) { this.floorRequested = floorRequested; } public void display() { System.out.println("Floor req: " + floorRequested); } } class LinkList { public Link firstRequest; LinkList()...

Cycle through List and Ordering

c,arraylist,linked-list,structure
I want to create a linked list. The user adds numbers and the idea is that the numbers are inserted to the list in descending order. Here goes what I did, but when rearranging, it just orders the first number... int addInputNumber(numberList **node){ numberList *temp; int userInput; temp = (numberList*)malloc(sizeof(numberList));...

What is the significance of union in this code, what is the disadvantage if structure?

c,structure,unions
struct queue_entry_s { odp_buffer_hdr_t *head; odp_buffer_hdr_t *tail; int status; enq_func_t enqueue ODP_ALIGNED_CACHE; deq_func_t dequeue; enq_multi_func_t enqueue_multi; deq_multi_func_t dequeue_multi; odp_queue_t handle; odp_buffer_t sched_buf; odp_queue_type_t type; odp_queue_param_t param; odp_pktio_t pktin; odp_pktio_t pktout; char name[ODP_QUEUE_NAME_LEN]; }; typedef union queue_entry_u { struct queue_entry_s s; uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct queue_entry_s))]; } queue_entry_t; typedef struct queue_table_t {...

Lots of small mysql table or one big table

mysql,sql,database,performance,structure
I have a forum where i have properties like - > follow,voteup,votedown,report,favorite,view etc for each thread,answers,comments. Which approach will be performance wise faster and better ? I am expecting billions of favorite,views etc....just like youtube Approach One Make one big table counter counter_id | user_id | object_id | object_type |...

Should I initialize DOMdocument in the model or controller

oop,model-view-controller,structure,pip,domdocument
I have recently built a script that uses DOMdocument to generate an XML feed of posts from a CMS. I have this working but I would like to integrate this further as an MVC app. As a base structure I am using PIP. I like how bare bones it is...

Memory Allocation Problems with structure

c++,memory-management,structure
Why does the provided code crash at the following line? data *fillA = (data*)calloc(matrixa->nzmax, sizeof(data)); #include <iostream> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <algorithm> #include <time.h> using namespace std; struct csr { int rows; int cols; int nzmax; int *rowPtr; int *colInd; double *values; }; struct...

C structure initialization before using it?

c,initialization,structure
I do not understand why i have to initialize my structure before using it, i get this error in my code, i know it works if i use pointers or if i initialize the structure members, but why it does not work in this way ? #include <stdio.h> typedef struct...

OpenCL - need to recommended structure

c++,structure,opencl
I have two files each one has 10000 points each point has two double number X and Y. What we need is operation on all of these points, so we have 10000 0000 operations (10000 X 10000). First Question: What the structure do you recommend? I mean which variable I...

Implementing a class structure for one-to-many relationship. Swift

class,swift,structure,one-to-many
Basically I am trying to implement a class for a Person and Person's pets. In it's very simple form Person class and Pet class would be like this: class Person { var email : String! var name : String! var pets : [Pet]! init(userName: String) { email = userName //...

Trying to understand R structure: what does a dot in function names signify?

r,function,structure
I am trying to learn how to use R. I can use it to do basic things like reading in data and running a t-test. However, I am struggling to understand the way R is structured (I am have a very mediocre java background). What I don't understand is the...

Error while calling a function

c,function,structure
On running this program i am getting error [Error] type of formal parameter 1 is incomplete on dev cpp i am calling the function assign through main and i am getting the above mentioned error. #include <stdio.h> void assign(struct username i); void show1(struct username i); struct username { char name[30];...

Firebase data structure with cyclic dependency

android,database-design,structure,firebase
I'm currently discovering Firebase and trying to evaluate it for further projects. At the moment, i'm testing with a very simple "Todo list" app where lists can be shared with friends. I've read the Doc about flattening data structure to avoid complexity and I came up with the following structure:...

What is the internal structure of a Windows shortcut?

windows,hex,structure,shortcut
3 HDD in one computer: 2 with Windows XP, 1 with Windows 7, sequentially load the operating system from each of them. I discover that some working shortcuts (not all) which created in first XP don't work in second XP and Windows 7 (not available for viewing the object for...

Function that return a structure that contains a pointer to array in C

c,arrays,structure
First few parts of code: typedef struct { double sr, med; int **t; }wynik; wynik calc(int *t[], int size) { int i, *niep = NULL, j = 0, k = 1, sum = 0; int *sorted = (int*)malloc(size*sizeof(int)); wynik out; //coping, sorting for (i = 0; i < size; i++)...

Liferay Velocity Structure and Template. Repeatable Fields

templates,liferay,structure,velocity
I am using a structure a little like this with levelOne and levelTwo both being repeatable. levelOne levelTwo levelThree When using a foreach loop to display the data I can only seem to find the first instance of levelTwo and levelThree. I have tried an absolute ton of methods to...

Symfony2 how to structure a project when there is a lot of entity?

symfony2,structure,project-organization
I have a project that is split in several parts, because i have a lot of entity(and all the controllers and forms which come with them), but they are in relation, and my question is, how do I have to structure my project does I need to have one bundle...

Passing an Array of Structures

c,arrays,structure
How can I pass an array of structures? So far I have this which is global: typedef struct _line { float val1; int val2; } line; Then I read data from a file into this structure struct _line* read_file() { typedef struct _line *Lines Lines *array = malloc(num_lines * sizeof(Lines));...

Inconsistent Data in variable

c++,pointers,structure
#include<iostream> #include<conio.h> using namespace std; struct node { node *next; node *prev; node *fnext; node *fprev; int device_number; int inode_number; int ref_count; bool locked; }; node* Create(int inum,int dnum) { node A; A.next=A.prev=A.fnext=A.fprev=NULL; A.inode_number=inum; A.device_number=dnum; A.ref_count=0; A.locked=false; return &A; } class Sample { public: Sample() { node*A= Create(0,0); cout<<A->device_number<<A->inode_number; Pass(A);...

ColdFusion: Query VS Structures

performance,optimization,coldfusion,structure,cfquery
Currently, I've a query inside a loop as below. <cfloop query="Superquery"> <cfquery datasource="mysource" name="getData"> SELECT col1, Col2 FROM myData where col1 = #Superquery.IDCol# </cfquery> <!--- Some Processing ---> </cfloop> The query doesn't return much data. In some cases, it returns less than 100 rows & in some it can return...

Incomplete printing in C

c,structure
#include<stdio.h> #define max 3 struct t { char ch; char cH; int i; }; int main() { struct t test[max]; int count=0,in=0; while(count < max) { printf("Enter small char\n"); scanf("%c",&test[count].ch); getchar(); printf("Enter big char\n"); scanf("%c",&test[count].cH); getchar(); printf("Enter number\n"); scanf("%i",&test[count].i); count++; } for(in=0;in<count;in++) { printf("%c %c %i\n",test[in].ch,test[in].cH,test[in].i); //printf("line%10i\n",in); } return 0;...

What is the algorithm to calculate some values padding?

file,structure,padding,reverse-engineering
I reversing some game file to translate it and already understand everything, aside of how to determine some blocks padding. For example, I have this in one file (two entries by 36 byte each and then zero padding. 96 bytes total): 01 08 01 80 00 00 00 09 00...

Why is the Stack not passing the input form the command line

c,pointers,types,stack,structure
How can I find where the error is? It prints out nested incorrect, I think that it is not pushing anything into the stack, but the peek function is giving an error. I am really confused as to why vim doesn't highlight any errors and it still compiles. #include <stdio.h>...

The most occuring number in structure(array)

c++,c,arrays,structure
I cant find out whats wrong with this part of my program, i want to find out most occuring number in my structure(array), but it finds only the last number :/ void Daugiausiai(int n) { int max = 0; int sk; for(int i = 0; i < n; i++){ int...

How to dynamically fill the structure which is a pointer to pointer of arrays in C++ implementing xfs

pointers,structure,xfs,cen-xfs
Structure 1: typedef struct _wfs_cdm_cu_info { USHORT usTellerID; USHORT usCount; LPWFSCDMCASHUNIT * lppList; } WFSCDMCUINFO, * LPWFSCDMCUINFO; Structure 2: typedef struct _wfs_cdm_cashunit { USHORT usNumber; USHORT usType; LPSTR lpszCashUnitName; CHAR cUnitID[5]; CHAR cCurrencyID[3]; ULONG ulValues; ULONG ulInitialCount; ULONG ulCount; ULONG ulRejectCount; ULONG ulMinimum; ULONG ulMaximum; BOOL bAppLock; USHORT usStatus; USHORT...