Questions regarding efficient storing and representing data within a software application.

learn more… | top users | synonyms

-3
votes
2answers
54 views

Methodology of coding, Coding guidlines, conventions [on hold]

I have been coding for 3 years, I learned on my own. I can code just about anything if I have the idea or concept, but my code is kind of "ghetto code". The way a lot of my programs turn out is me ...
1
vote
1answer
32 views

How should data transfer between a client and a web API for normalized data be designed?

I want to design an API backed by some database (doesn't really matter which, but to make the discussion more interesting, let's say it's Mongo - explanation below) which sends data to a client. The ...
4
votes
2answers
112 views

Is it safe in Haskell to save a data structure to a file using “show”, and retrieve it using “read”?

Say I have the following types: type EndsTup = (Int,Int) -- (0-based index from start or end, Frequency) type FreqTup = (Char, [EndsTup], [EndsTup]) -- (Character, Freqs from start, Freqs ...
0
votes
3answers
126 views

Nested maps vs. combined keys

in the project I am currently working on we had three different types of prices depending on the age of the user (adult, child, etc...). So we had on the DB a table looking like this: PRICES type ...
3
votes
2answers
113 views

How can a true Vector be implemented in Haskell?

How could a true Vector type be implemented in Haskell? In order for something to be a Vector, it has to be stored sequentially in memory, with O(1) random access. But Haskell hides its memory ...
1
vote
0answers
59 views

Managing debug information of C program for Debugger

I am not sure if the title is appropriate. I have written a parser for CDB files in C# and ANTLR that creates runtime objects for me such that I can pass it to the TCF Agent which takes care of ...
6
votes
1answer
111 views

Are “skip deltas” unique to svn?

The good folks who created the SVN version control system use a structure they refer to as "skip deltas" to store the revision history of files internally. A revision is stored as a delta against an ...
3
votes
3answers
205 views

Data Oriented Design - impractical with more than 1-2 structure “members”?

The usual example of Data Oriented Design is with the Ball structure: struct Ball { float Radius; float XYZ[3]; }; and then they make some algorithm that iterates a std::vector<Ball> ...
2
votes
1answer
139 views

Is using MultiMaps code smell? If so what alternative data structures fit my needs?

I'm trying to model nWoD characters for a roleplaying game in a character builder program. The crux is I want to support saving too and loading from yaml documents. One aspect of the character's is ...
1
vote
2answers
172 views

Best way of storing a small number of user credentials

I'm working on a messaging application, based on a server/client architecture. Now I am thinking about the way how to store the user credentials. It's not a huge number, just about 20 entries with ...
2
votes
2answers
62 views

Quadtree with duplicates

I'm implementing a quadtree. For those who don't know this data strucutre, I am including the following small description: A Quadtree is a data structure and is in the Euclidean plane what an ...
0
votes
2answers
131 views

How to present a stable data model in a public API that allows internal data structures to be changed without breaking the public view of the data?

I am in the process of developing an application that allows users to write C# scripts. These scripts allow users to call selected methods and to access and manipulate data in a document. This works ...
0
votes
2answers
75 views

Tournament bracket method to put distance between teammates

I am using a proper binary tree to simulate a tournament bracket. It's preferred any competitors in the bracket that are teammates don't meet each other until the later rounds. What is an efficient ...
1
vote
2answers
95 views

High-level strategy for distinguishing a regular string from invalid JSON (ie. JSON-like string detection)

Disclaimer On Absence of Code: I have no code to post because I haven't started writing; was looking for more theoretical guidance as I doubt I'll have trouble coding it but am pretty befuddled on ...
3
votes
2answers
189 views

Data structure for grid with negative indeces

Sorry if this is an insultingly obvious concept, but it's something I haven't done before and I've been unable to find any material discussing the best way to approach it. I'm wondering what's the ...
2
votes
1answer
115 views

Where to implement thread-safety logic for my queue data structure?

I will immediately confess that I do very little multithreading, so questions of style and organization in this domain a little fresh to me. I've written a data structure (in Python, if that matters) ...
0
votes
1answer
116 views

Exercise 3.6: Skiena Algorithm Design Manual

I am preparing for interview and try to solve the exercise problems of the book. 3-6. [5] Describe how to modify any balanced tree data structure such that search, insert, delete, minimum, and ...
2
votes
3answers
125 views

Most efficient way to store this collection of moduli and remainders?

I have a huge collection of different moduli and associated with each modulus a fairly large list of remainders. I want to store these values so that I can efficiently determine whether an integer is ...
1
vote
1answer
37 views

Benefits of caching the count of items in a data structure versus on-demand calculation?

Given a data structure, I want to provide an API method Size which returns the number of items. I am vacillating between 2 approaches: Maintain a count and increment/decrement it in response to ...
9
votes
2answers
1k views

What is the relationship between data structures and algorithms? [closed]

I have been searching for a good online course in data structures but have found that Google also returns results for algorithms courses, which say stuff like: In this course you will learn ...
4
votes
2answers
232 views

Overriding GetHashCode in a mutable struct - What NOT to do?

I am using the XNA Framework to make a learning project. It has a Point struct which exposes an X and Y value; for the purpose of optimization, it breaks the rules for proper struct design, since its ...
-3
votes
1answer
161 views

Does implementing algorithms improve your programming skills? [duplicate]

I have been self studying algorithms and data structures for some time now and currently enjoying it. Whenever I understand an algorithm, I usually try to code them from scratch for fun and I always ...
0
votes
1answer
102 views

Traversing an AST using Visitors

I'm writing a compiler for a C-like language, and I'm looking for an elegant way to traverse my abstract syntax tree. I'm trying to implement the Visitor pattern, although I'm not convinced that I'm ...
2
votes
6answers
1k views

How did programmers implement Linked list ideas before the object oriented paradigm?

Linked lists, as far as I have seen, are largely implemented using object-oriented ideas. (having an object that holds some information and the address of the next link). How were Linked-lists ...
1
vote
3answers
214 views

what is the javascript internal data structure?

Consider a basic js object: var obj={x:1,y:'2'}; Is this stored internally as a hashtable or does js use a different mechanism for key value pairs? If they are hash tables does anyone know how they ...
0
votes
1answer
94 views

What happens to equal elements when inserting into a binary search tree?

Most BST examples show a sample of a BST with unique values; mainly to demonstrate the order of values. e.g. values in the left subtree are smaller than the root, and values in the right subtree are ...
0
votes
0answers
50 views

streaming data in memory aggregation

We have a stream of data we're aggregating stats over and putting into a python dictionary (sent from kafka). Every X time interval, We update our database with these aggregated metrics. This ...
2
votes
5answers
366 views

how to design a stack without using java library or using list [closed]

I have a question how to design a stack without using list or array? This is one question that I want to think about as I want to better understand stack.
0
votes
0answers
50 views

How to store progress of abstract events?

I making a game in node.js. I have players and they can perform a lot of actions. Actions are all coded as functions, and they change certain variables in either User object or other objects that ...
0
votes
1answer
439 views

Is a PHP array an example of a dynamic data structure?

I did my homework, and it says that dynamic data structures are "data structures that change in size as a program needs it to by allocating and de-allocating memory from the heap". So I was ...
2
votes
2answers
425 views

Why does Python use hash table to implement dict, but not Red-Black Tree? [closed]

Why does Python use hash table to implement dict, but not Red-Black Tree? What is the key? Performance?
2
votes
2answers
112 views

Collection vs data structure vs aggregate

I know three terms that have to do with storing objects or data. I'm not sure I understand the exact differences between the terms. Please confirm if what I'm about to write is accurate. A data ...
0
votes
0answers
40 views

What is a good way to store geographical data for distance calculations

What would be the best way to store data in a database for geographical calculations? Say I have an ItemsForSale table paired to a Users table which holds their geo location. I know I can use latitude ...
0
votes
0answers
8 views

Globalizing geographical information in data design

I am building my database/models/viewmodels right now and can't think of a good variable name to define for the equivalent of a "state" in other countries. I currently have Country and City which are ...
-2
votes
1answer
53 views

How to maintain trade off between number of columns in table vs join operations? [closed]

I have learnt that if there are more columns in table, then get those results using join query. How to decide the max number of columns in table? How feasible is "Join Operation" if too many table ...
1
vote
2answers
131 views

What is the underlying mechanism behind va_list and where is it defined?

http://www.cplusplus.com/reference/cstdarg/va_list/ According to the above link, va_list is an argument or parameter used in some macros - va_start, va_arg, va_end. These macros are present in the ...
0
votes
2answers
181 views

Data structures VS Classes and what happens if they merge? [closed]

Alright so I've learned this: Classes have public methods that perform operations on the class's data and they hide away their implementations. Data structures on the other hand, completely expose ...
0
votes
2answers
193 views

Most efficient data structure for implementing inheritance structure without classes

I have a number of types that all relate to each other in terms of them being 'derived' from one another. I'd need a way to do is relationships, which made me initially think of classes, but I ...
0
votes
1answer
48 views

Testing the Consumers of Subclassed Data Structures

PHP's SplQueue does not include a clear() or reset() function to wipe data out of the data structure. My application requires that functionality. This leaves two options: A) Create a subclass of ...
3
votes
4answers
168 views

fast n-gram access data structure

TL;DR Is there a data structure that'd quickly let me match words at any point (e.g., 'foo' matches 'foobar' and 'zoofoo'), and, ideally, returns a list of "characters that show up after the needle" ...
1
vote
1answer
147 views

Chained ruleset parsing and evaluation code: recommendations?

So I have to write a filtering system, which may apply preprocessed ruleset to data - and trigger some actions defined in the ruleset while continuing its evaluation. <ruleset name="1"> ...
0
votes
1answer
45 views

What is the difference between a Splay Tree and an Optimal Binary Search Tree?

Both these trees try to keep the most frequently accessed element at the top. Is there any difference between these two trees?
1
vote
2answers
171 views

Minimize touching the already-working code when a radical change is required

I have a code that highly relies on an Array structure like the following: $array['customer'][$customer_id]['details'][..]; // it goes to about 10 levels deep However, after almost two years ...
0
votes
1answer
53 views

Method to store some site content data, allowing reusability

(Don't believe this is a "best practice" question as I believe there will be a single better choice). I need to choose a data storage option to store specific site data to allow easy management and ...
4
votes
1answer
210 views

Designing storage service data structure for decoupled models sharing same data

Surely most of you remember the Norton Commander application where similar (sometimes the same) data is displayed in separate decoupled views. I'm building a web application that follows the same ...
14
votes
3answers
1k views

How do purely functional programming languages deal with fast changing data?

What data structures can you use so you can get O(1) removal and replacement? Or how can you avoid situations when you need said structures?
1
vote
3answers
291 views

Choice between 1-dimensional and 2-dimensional array

I'm implementing the Chessboard class to represent the chessboard. I've to implement the transformations (reflections and rotations) on the chess board possible. The possible transformations includes ...
1
vote
2answers
146 views

Data retrieval and indexing

I have around 800,000 rows of data stored in the boost shared memory from the database. The data are in the form: Id Color Length Size 1 1 2 ...
1
vote
1answer
157 views

Graph data structures and journal format for mini-IDE

Background: I am writing a small/partial IDE. Code is internally converted/parsed into a graph data structure (for fast navigation, syntax-check etc). Functionality to undo/redo (also between ...
0
votes
1answer
184 views

Find possible variations of one item out of multiple baskets.

I have three baskets of balls and each of them has 10 balls which have the following numbers: Basket 1: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 Basket 2: 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ...