structure

Can i inherit structure in C?if yes how?

Can i inherit structure in C?if yes how? ...

Ideas for Implementing multiple views for the same data

My question is based in structure and architecture really and I'm after ideas on the best way to implement the following: I am using code igniter (although you could presume any MVC framework). I have a custom CMS which allows for the management of 5 different websites. Users log in and switch between these sites. They can add content t...

Optimal C Structure definition

Hi, I was just wondering about the considerations to be followed while packing items (int, float, unions, etc) in a C structure (C struct definition ) that would allow the compiler to further optimize it. I would like to know whether there are any guidelines that one should follow e.g. adding items to the structure in an order that wo...

Save into 1 table or create multiple tables?

Hi, I am in dilemma situation, and do not know which one is better. Lets say I have 100++ (or more) games on my website. I want to store highscore for each game. Should i store all the highscore in 1 table or each game has its own table? Compare: 1 table: 1 table contains a lot of rows(data). Every user play different game will submit ...

Data Structure to store billions of integers

What is the best data structure to store the million/billions of records (assume a record contain a name and integer) in memory(RAM). Best in terms of - minimum search time(1st priority), and memory efficient (2nd priority)? Is it patricia tree? any other better than this? The search key is integer (say a 32 bit random integer). And all...

Design question for an SDL\OpenGL Window & Widget library

I want to design & implement a simple windowing & widget for OpenGL running on top of SDL, much like Agar or GiGi, only much closer tied to SDL & OpenGL. My general problem is this: what is the best design for a windowing system within an OpenGL context?? I want to have windows just for controls, and, if even possible, threaded windows...

Structure padding in C

I've read this about structure padding in C: http://bytes.com/topic/c/answers/543879-what-structure-padding and wrote this code after the article, what should print out size of 'struct pad' like 16 byte and the size of 'struct pad2' should be 12. -as I think. I compiled this code with gcc, with different levels of optimization, even the ...

C - Change all values of an array of structures in one line

I can declare a structure: typedef struct { int var1; int var2; int var3; } test_t; Then create an array of those structs structure with default values: test_t theTest[2] = { {1,2,3}, {4,5,6} }; But after I've created the array, is there any way to change the values in the same way I did above, using only one line, spec...

python ctype recursive structures

I've developped a DLL for a driver in C. I wrote a test program in C++ and the DLL works fine. Now I'd like to interract with this DLL using Python. I've successfully hidden most of the user defined C structures but there is one point where I have to use C structures. I'm rather new to python so I may get things wrong. My approach is t...

Best data structure to represent a game board

Hey, I'm trying to bring a board game to the computer world, and the board consists of 16 spaces, 6 for each side and 4 in the middle. The board is diamond-shaped and two ends represent both team bases. In the game, peices only move foward towards the enemy"s base (with special abilities of course). So here is my question: what do you th...

craigslist’s / kijiji's schema

Hello, I'm curious to find out what kind of database schema craigslist and kijiji uses. They have many categories and cities that grow all the time. The levels also get deeper sometimes (sub-categories, and areas/neighborhoods). The part I don't understand the most is how they manage their categories. What is the database structure be...

How do you structure your reusable libraries?

How do you organize your code so that it can easily be ported across business projects without carrying unnecessary bloat? For example (in .Net), let's say you have the following namespaces: namespace Computers - Hardware - Motherboard - GPU namespace Monitors - Display - Mirrors namespace Peripherals...

How to export the definition of an R object to plain text so that others can recreate it?

Let's say you have this data in R, and you want to post a question on stackoverflow. For others to best help you, it would be nice if they could have a copy of your object (dataframe, vector, etc) to work with. Let's say your data is in a data frame called site.data > site.data site year peak 1 ALBEN 5 101529.6 2 ALBEN 1...

Setting Up A SVN Development Structure

Hi, I am looking to set up our web application shop to start utilzing svn better. Currently we have programmers making changes into trunk which then directly affects production... yes I know - terrible! I want to set up seperate branches so that there is a branch that we use to make fixes. Then we can promote to the QA branch and then...

Difference between library and application code?

This question sprung from a web application, although it should be valid for other types of applications too. I am using MVC. I have both application code (modeles, views, controllers, forms, helpers, etc.) and library code (external libraries and an internal library with self-written database mappers, json converters etc.). I wonder w...

Suggestions for writing a code flowchart

I'm nearing the end of my internship this summer, and I've developed a tool for my mentors that involves primarily PHP, MySQL, JavaScript (jQuery). Does anyone have any templates or suggestions or links on creating an easy to read document showing the code structure of the program and the relationships between the files? These guys are...

Structure memory allocation

struct node{ int data; struct node * next; }; How does the compiler allocate memory for "next" member in when we have not yet allocated memory for the structure "struct node" ...

Database design: merge users from different logging systems (google, facebook, openid ...)

Hallo, I need to merge users from several souces some how, for example facebook, Google, plaxo... Currently I have this structure in my database: USERS_MYSITE mysite_user_id | parameter | value ------------------------------------------ 223 | firstname | Tom 223 | lastname | N. 223 ...

Validate constructor data

A sample class in "C# Class Desing Handbook" (pg 137) does not call the classes validation method for a specific field from inside the classes only constructor. So basically the sample class allows you to create an object with bad data and only throws an error for that data when you call the field's property which does validation on it t...

java cvs,svn file structure

I have recently learnt how to program in java, I was looking at some open source programs from sourceforge.net and after downloading these programs I don't understand the file structure most of the programs follow. Pretty much every program has src,bin,lib etc folders, how do I know the standard way of organizing my program. Is there any...