The tag has no wiki summary.

learn more… | top users | synonyms

4
votes
2answers
131 views

In Python, is there any difference (apart from a few listed exceptions) between classes and dictionaries?

My logic goes like this: def A(val): return {'a':val} print(A(7)['a']) is the same as class A: def __init__(self, val): self.a = val print(A(7).a) Obviously, there are problems ...
-3
votes
1answer
67 views

Understanding searching through dicts in python [closed]

I'm trying to understand the differences between dict, dict.items and dict.iteritems. I know that items returns a list of all the items, while iteritems returns an iterator, which for large lists can ...
25
votes
4answers
14k views

Why store a function inside a python dictionary?

I'm a python beginner, and I just learned a technique involving dictionaries and functions. The syntax is easy and it seems like a trivial thing, but my python senses are tingling. Something tells me ...
5
votes
5answers
9k views

Efficient methods for storing tens of millions of objects for querying, with a high number of inserts per second?

This is basically a logging/counting application that is counting the number of packets and counting the type of packet, etc. on a p2p chat network. This equates to about 4-6 million packets in a 5 ...
0
votes
0answers
34 views

I have URL and ID pairings, and I send the URLs to an API which it returns in no specific order. How should I pair them back up?

This is a programming problem that I haven't came across yet and I want to make sure I'm tackling it in an efficient manner. I have an array of dictionaries, with each dictionary consisting of a ...
0
votes
2answers
213 views

Critique the Structure of my Horse Racing Betting Platform

I am creating a program (mostly just for fun) that displays live prices for horse racing markets and the prices that several models predict they should be. I am very interested in the optimal way to ...
3
votes
2answers
2k views

Efficient solution for dictionary updates

Let's start with the problem: There is a large dictionary X that contains {key, value} pairs, i.e.: X = [{100, 10}, {101, 0}, {103, 0}, {106, 2}, {110, 1}] Every t seconds, X has to be updated ...
0
votes
3answers
210 views

Class or Dictionary

I want to create a immutable Scale class in C#. public sealed class Scale { string _Name; string _Description; SomeOrderedCollection _ScaleValueDefinitions; Unit _Unit // ...
0
votes
1answer
124 views

Algorithm for compression of a dictionary (words and definitions)

The theoretical situation is this: Let's say that we have a digital dictionary (by which I mean a traditional list of words and definitions, not an associative array). For the sake of simplicity, ...
0
votes
1answer
645 views

Fast lookup hash map implementations

I'm in the process of implementing a programming language on top of LLVM. For my polymorphic system, I'm looking for suggestions for a ultra-fast dictionary. I am not concerned with insert time, as ...
3
votes
2answers
479 views

History of Associative Array?

In quite a lot of modern scripting languages (e.g. Perl, Python, Ruby, PHP, Lua, JavaScript), associative arrays are supported as a primitive or first-class data type (with various names like map, ...
5
votes
2answers
335 views

What is a good way to keep track of strings for dictionary lookups?

I am working through the Windows 8 app tutorial. They have some code about saving app data like so: private void NameInput_TextChanged(object sender, TextChangedEventArgs e) { ...
4
votes
2answers
422 views

What are the relative advantages of dictionaries versus databases?

I have an environment that supports both dictionaries (json style) and databases (not relational or anything, just formatted data by row and column). My application doesn't really need database ...
6
votes
3answers
7k views

Practical size limits of a Hashtable and Dictionary in c#

What are the practical limits for the number of items a C# 4 Dictionary or Hashtable can contain and the total number of bytes these structures can reasonable contain. I'll be working with large ...
3
votes
2answers
2k views

Should I use a Class or Dictionary to Store Form Values

I am working on a C# .NET Application, where I have a Form with lots of controls. I need to perform computations depending on the values of the controls. Therefore, I need to pass the Form values to a ...