structure

compilation error: request member in something not a structure of union

Hi everybody, I'm having the above error request member rv in something not a structure of union. I've googled it and several answers told me it's when working with a pointer but tries to access it as a struct, where I should be using -> instead of . int foo(void * arg, struct message * msg) { struct fd_info * info = (struct som...

Best database (mysql) structure for this case:

we have three types of data (tables): Book (id,name,author...) ( about 3 million of rows) Category (id,name) ( about 2000 rows) Location (id,name) ( about 10000 rows) A Book must have at least 1 type of Category (up to 3) AND a Book must have only one Location. I need to correlate this data to get this query faster: Se...

"do it all" page structure and things to watch out for?

I'm still getting my feet wet in PHP (my 1st language) and I've reached the competency level where I can code one page that handles all sorts of different related requests. They generally have a structure like this: (psuedo code) <?php include 'include/functions.php'; IF authorized IF submit (add data) ELSE IF update (update data)...

How to access a structure member in a function that get it as void* type?

I want to have a function that accepts different type of structures as argument. So, since I don't have a specific type, I have to use void*. Now question is: when I pass a structure to this function, how can I access a known member of this structure inside the function? Specifically, I know that all structures have str1 as a member and...

How can I declare and initialize an array of pointers to a structure in C?

I have a small assignment in C. I am trying to create an array of pointers to a structure. My question is how can I initialize each pointer to NULL? Also, after I allocate memory for a member of the array, I can not assign values to the structure to which the array element points. #include <stdio.h> #include <stdlib.h> typedef str...

passin structure form VC++ to C#

Hi, im using C# dll in VC++ application.I have somedetails in VC++ like PageNumer pageTitle PageDesc BoxDetail I have to pass this to C# Dll. So i made one structure in VC++,then i pas that to C#.But i could't do that.Pls help mw. VC++ Function: struct SCS3OverVwPg { __int32 iOvrPgNo; char sOvrPgTitle[30]; //OverView Pa...

Question on passing a pointer to a structure in C to a function?

Below, I wrote a primitive singly linked list in C. Function "addEditNode" MUST receive a pointer by value, which, I am guessing, means we can edit the data of the pointer but can not point it to something else. If I allocate memory using malloc in "addEditNode", when the function returns, can I see the contents of first->next ? Second ...

How to organize product catalog site in Drupal 6?

Hello there, please advice me how to organize product catalog site with such structure (this is pages which should be in site map): - Home page - About Us -- Team -- Contacts - Products -- Category --- Product ---- Overview ---- Photo gallery ---- Variants -- Category --- Subcategory --- Product ---- Overview ---- Photo gallery ---- Var...

how to 'scale' these three tables?

I have the following Tables: Players id playerName Weapons id type otherData Weapons2Player id playersID_reference weaponsID_reference That was nice and simple. Now I need to SELECT items from the Weapons table, according to some of their characteristics that i previously just p...

structured vs. unstructured data in db

the question is one of design. i'm gathering a big chunk of performance data with lots of key-value pairs. pretty much everything in /proc/cpuinfo, /proc/meminfo/, /proc/loadavg, plus a bunch of other stuff, from several hundred hosts. right now, i just need to display the latest chunk of data in my UI. i will probably end up doing some ...

How to best structure a website in Liferay Portal

Hi, I am working on a project involving Liferay Portal and I was hoping to get some input on how to properly utilize community and organizations in the site structure. I have so far been frustrated with the lack of documentation on this subject, and Liferay's internal forum seems to be all but dead. Can someone point me in the right dire...

Exception on malloc for a structure in C

Hi all, I have a structure defined like so: typedef struct { int n; int *n_p; void **list_pp; size_t rec_size; int n_buffs; size_t buff_size } fl_hdr_type; and in my code I Have a function for initlialization that has the following fl_hdr_type *fl_hdr; fl_hdr = malloc(sizeof(fl_hdr_type) + (buff_size_n * rec_size_n)); where ...

An array of structures in C...

For the life of me I can't figure out the proper syntax for creating an array of structures in C. I tried this: struct foo { int x; int y; } foo[][] = { { { 1, 2 }, { 4, 5 }, { -1, -1 } }, { { 55, 44 } { 100, 200 }, } }; So for example foo[1][0].x == 100, foo[0][1].y ==...

How can I turn the structure of an XML file into a folder structure using ANT

I would like to be able to pass an XML file to an ANT build script and have it create a folder structure mimicking the nodal structure of the XML, using the build files parent directory as the root. For Example using: <root> <folder1> <folder1-1/> </folder1> <folder2/> <folder3> <folder3-1/> </fold...

Easy way to observe user activity - how improve my database structure.

Welcome, I need some advise to improve perfomence my web application. In the begin I had this structure of database: USER -id (Primary Key) -name -password -email .... PROFILE -user Primary Key, Foreign Key (USER) -birthday -region -photoFile ... PAGES -id (Primary Key) -u...

Structure for Django methods that span different models

I have two models (say A and B) which are independent and have independent methods. I want to add some methods that operate on both models though. for example, addX() will create an object from both models A and B. What's the best way to structure code in this situation, since it doesnt make sense to have the method belong to either o...

Printing values of all fields in C++ structure

Say a simple structure struct abc { int a; char b; } I got some value in a variable defined as its structure and now I want to print below a = [some value] b = [some character] What is the best way to achieve this for an arbitrary structure without having to write a dump...(...) function for each of the structure I en...

Need to work out database structure

Hi, Just need a little kickstart with this. I have Mysql/PHP, and I have 5,000 products. I have 30 companies I need to store some data for those 30 companies for each product as follows: a) prices b) stock qty I also need to store data historically on a daily basis. So the table... It makes sense that the records will be the ...

how to pass structure variables

Am having a set of structure variable in one form, i want to use that structure variable as a global variables. i need to use those structure variable in through out my whole application, how to use structure as global variable?? am using C#.. ...

c++ tables of unions and structures

I was told to write a program, that creates a union and structure, then creates two-element arrays of unions and structures and fills their fields. I have created a union and a structure, but how to fill their fields in arrays ? #include <iostream> #include <stdlib.h> #include <stdio.h> using namespace std; union complex; union comple...