Questions tagged [lookup-tables]

A look-up table is an array or matrix of data that contains items that can be searched. Lookup tables may be arranged as key-value pairs, where the keys are the data items being searched (looked up) and the values are either the actual data or pointers to where the data are located.

A look - up table is an array or matrix of data that contains items that are searched. Lookup tables may be arranged as key-value pairs, where the keys are the data items being searched (looked up) and the values are either the actual data or pointers to where the data are located.

798 questions
11
votes
3 answers

Replacing functions with Table Lookups

I've been watching this MSDN video with Brian Beckman and I'd like to better understand something he says: Every imperitive programmer goes through this phase of learning that functions can be replaced with table lookups Now, I'm a C# programmer…
Jamie Dixon
  • 53,019
  • 19
  • 125
  • 162
11
votes
4 answers

Should lookup values be modeled as aggregate roots?

As part of my domain model, lets say I have a WorkItem object. The WorkItem object has several relationships to lookup values such as: WorkItemType: UserStory Bug Enhancement Priority: High Medium Low And there could possibly be more, such as…
Landon Poch
  • 832
  • 1
  • 8
  • 19
10
votes
2 answers

C# is half as slow than Java in memory access with loops?

I have two pieces of code that are identical in C# and Java. But the Java one goes twice as fast. I want to know why. Both work with the same principal of using a big lookup table for performance. Why is the Java going 50% faster than C#? Java…
michael
  • 105
  • 5
10
votes
3 answers

Change an integer into a specific string in a data.frame

I have a data frame with two columns. The second column contains only integers. More precisely it contains 0,1,2,3 and some NA's. Something like this: id1 0 id2 1 id3 0 id4 2 id5 3 id6 1 id7 2 id8 NA What I'm searching for…
Tobias
  • 564
  • 3
  • 13
10
votes
5 answers

How to look up sine of different frequencies from a fixed sized lookup table?

I am sampling a sine wave at 48 kHz, the frequency range of my sine wave can vary from 0 to 20000 Hz with a step of about 100 Hz. I am using a lookup table approach. So I generate 4096 samples for a sine wave for 4096 different phases. I think the…
as3rdaccount
  • 3,711
  • 12
  • 42
  • 62
9
votes
3 answers

Creating a lookup table at compile time

C++ noob here. What's the simplest way to create the array {f(0), f(1), ..., f(1023)} at compile time, given a constexpr f?
Markus O
  • 113
  • 1
  • 4
9
votes
3 answers

Using Look Up Tables in Python

I am using python to automate a piezoelectric droplet generator. For each value of a pulse length, a suitable value of voltage will be there to produce a signal to give away a droplet. This value of voltage keeps changing in every run(for example, +…
Vishvachi Sinha
  • 147
  • 1
  • 4
  • 10
9
votes
3 answers

Best way to flatten/denormalize SQL lookup tables?

I have a bunch of tables like this: Lookup_HealthCheckupRisks ------------ ID Name 1 Anemia 2 Anorexic 3 Bulemic 4 Depression ... 122 Syphilis PatientRisksOnCheckup ------------------ ID CheckupID RiskID 1 11 2 2 11 3 3…
rlb.usa
  • 14,942
  • 16
  • 80
  • 128
8
votes
6 answers

How to declare a static lookup table using C++11

I have C++11 program which needs to pick a value from a range of values. Each of the ranges have an assigned value to pick a value from. Following is my range of values with assigned values for each. 1-10 = 5 11-14 = 13 15-20 = 17 21-28 = 24 29-36 =…
AdeleGoldberg
  • 1,289
  • 3
  • 12
  • 28
8
votes
3 answers

Where to put compile-time-constant arrays?

Say I have an array storing the first 10 primes, like this: const int primes[] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29}; This is all very fine and simple as long as I have 1 .cpp file. However, if I have multiple .cpp files I don't really know where…
Migi
  • 1,112
  • 9
  • 14
8
votes
8 answers

Should I use a code in my lookup table

I am woking on an Orable database and I am adding a couple of lookup tables. The general question is should the lookup table contain a code and a description and the code be the FK back to the main table, or should the lookup table contain only a…
kralco626
  • 8,456
  • 38
  • 112
  • 169
8
votes
3 answers

Implementing a lookup table in Rails

I'm currently using (or trying to use) a lookup table to represent a column that contains an enumerated string. I've had extensive discussions with my team to make sure this is the direction we want to go and have decided to pursue it but…
jaydel
  • 14,389
  • 14
  • 62
  • 98
8
votes
1 answer

Simple constexpr LookUpTable in C++14

I am trying to make a simple LookUpTable based on an array of integers, where the idea is to have it calculated at compile time. Trying to make it possible to use it for any other future tables of various integer types I might have, I need it as a…
David H Parry
  • 299
  • 3
  • 13
8
votes
4 answers

Excel: Find min/max values in a column among those matched from another column

I have a table with two columns, say A:B. I have a separate list (in column D) of all different values in column A. For each target value in column D, I want to find, among all rows whose col A matches the target, the minimum and maximum values in…
7
votes
7 answers

How to determine the accuracy of Pi (π)

Optimizing a game we're developing, we're running into the phase where every CPU cycle won counts. We using radians for position calculations of objects circling around other objects and I want to cut the needless accuracy in my lookup tables. For…
Kriem
  • 8,666
  • 16
  • 72
  • 120
1
2
3
53 54