lookup-tables

@DBColumn in Lotus Notes

Hi everyone, I've been tasked with learning Lotus Domino Designer - not sure what I did in a previous life, but it must have been pretty bad... - and was wondering how to do a lookup on a database to get some values for selections. As this information could potentially be used in a lot of the applications, I'd prefer it only to be in t...

FluentNHibernate Lookup Table

This is possibly an easy one that I can't seem to get past. I've created a "Product" class which has a list of "Accessories". Each "Accessory" is just another product referenced by a lookup table. Table setup: Product ------- ProductID int Name varchar(200) AccessoryProduct ---------------- ID int ParentProductID int ChildProductID i...

Example using OpenXML with Parent Child Relationship and Associated Lookup Tables

I have an XML document that is loaded into a column of a table of the XML data type. Is there any good examples showing how to insert using a store procedure and OpenXML into a parent tables with primary key and also into a child table with it's associated foreign key? Both the Parent and Child have relationships to lookup tables. The ...

XML and Inserting into Parent Child tables with Related Lookup Tables

The FuelPathwayCode and PhysicalPathwayCode go into Parent table and transaction-item elements goes into the Child table. Parent table has a primary key and the child table has the related foreign key. The Parent table has FuelNameID and PhysicalPathwayID columns that are related to two lookup tables: FuelName and PhysicalPathway. Th...

Making a perfect hash (all consecutive buckets full), gperf or alternatives?

Let's say I want to build a perfect hash table for looking up an array where the predefined keys are 12 Months, thus I would want hash("January")==0 hash("December")==11 I run my Month names through gperf and got a nice hash function, but it appears to give out 16 buckets(or rather the range is 16)! #define MIN_HASH_VALUE 3 #define M...

Php - Insert Autoincrement Value - For Parent/Child Tables - Concurrency Problem

Consider a simple schema of one to many relationship. Parent Table's Id is referenced in the Child table. In php I want to insert a row into the table using the statement mysql_query($query). Then I will get the id of the last inserted row by using mysql_insert_id(). Then i will use this id to insert the another row into the child's tab...

What is the most efficient way to do look-up table in C#

What is the most efficient way to do look-up table in C# I have a look-up table. Sort of like 0 "Thing 1" 1 "Thing 2" 2 "Reserved" 3 "Reserved" 4 "Reserved" 5 "Not a Thing" So if someone wants "Thing 1" or "Thing 2" they pass in 0 or 1. But they may pass in something else also. I have 256 of these type of things and maybe 200 of them...

Java DirectColorModel vs. IndexColorModel when dealing with alphas

I have a BufferedImage that I get that has an IndexColorModel. I then wish to apply an AffineTransform with AffineTransformOP in order to create a transformed version of displayImage. Here's a code snippet: int type = isRGB() ? AffineTransformOp.TYPE_BILINEAR : AffineTransformOp.TYPE_NEAREST_NEIGHBOR; AffineTransformOp op = new Affine...

How to Manage User Modifiable Lookup Tables

There is a table in our database that acts very much like a standard lookup table (ID, Description). However, this particular one is not static, the client wants the ability to add entries on the fly. Some entries that will come pre-populated are "special" in that there will be code that checks for them (various business rules). Norma...

what webserver / mod / technique should I use to serve everything from memory?

I've lots of lookuptables from which I'll generate my webresponse. I think IIS with Asp.net enables me to keep static lookuptables in memory which I can use to serve up my responses very fast. Are there however also non .net solutions which can do the same? I've looked at fastcgi, but I think this starts X processes, of which anyone c...

Why store lookup values (combobox values) in the database instead of having them on the html page ?

What are the typical arguments in support of storing combo-box values (static lookup values (strings etc.) for an application) in database vs storing them right into the html page itself ? ...

Difference between a db view and a lookuptable

When I create a view I can base it on multiple columns from different tables. When I want to create a lookup table I need information from one table, for example the foreign key of an order table, to get customer details from another table. I can create a view having parameters to make sure it will get all data that I need. I could also...

Computing unique index for every poker starting hand

As there are 52 cards in a deck we know there are 52 choose 2 = 1326 distinct matchups, however in preflop poker this can be bucketed into 169 different hands such as AK offsuit and AK suited as whether it is A hearts K hearts or A spade K spades it makes no difference preflop. My question is, is there a nice mathematical property in whi...

Compile-time lookup array creation for ANSI-C?

A previous programmer preferred to generate large lookup tables (arrays of constants) to save runtime CPU cycles rather than calculating values on the fly. He did this by creating custom Visual C++ projects that were unique for each individual lookup table... which generate array files that are then #included into a completely separate A...

Django: Setting up database code tables (aka reference tables, domain tables)?

Often times applications will need some database code tables (aka reference tables or domain tables or lookup tables). Suppose I have a model class called Status with a field called name that could hold values like: Canceled Pending InProgress Complete Where and at what point would I setup these values in Django? Its like a one time...

Creating a list of symbols in latex

I'm trying to get an auto generated list of symbols in my latex project. Here is the macro that I have so far... \newcommand{\addsymbol}[3]{% \symboldisplay{#1}{#2}\\% \setelem{#3}{#1} } \newcommand{\symboldisplay}[2]{% $#1$ \parbox{5in}{\dotfill #2}% } \def\setelem#1{\expandafter\def\csname myarray(#1)\endcsname} \def\dispsymbol...

JPA Lookup Hierarchy Mapping

Given a lookup table: | ID | TYPE | CODE | DESCRIPTION | | 1 | ORDER_STATUS | PENDING | PENDING DISPOSITION | | 2 | ORDER_STATUS | OPEN | AWAITING DISPOSITION | | 3 | OTHER_STATUS | OPEN | USED BY OTHER ENTITY | If I have an entity: @MappedSuperclass @Table(name="LOOKUP") @Inheritance(strategy=In...

Implementing a runtime Look Up Table in C#

Hey all, I'm currently working on a robot interface GUI, using C#. The robot has two sensors, and two powered wheels. I need to let the user the option to load a Look Up Table (LUT) during runtime, one for each sensor, that will tell the robot what to do according to the sensor's reading. I think the best way to do it is using a .csv fil...

Lookup tables in C++

I have to implement small multimage graphic control, which in essence is an array of 9 images, shown one by one. The final goal is to act as minislider. Now, this graphic control is going to receive various integer ranges: from 5 to 25 or from 0 to 7 or from -9 to 9. If I am going to use proportion - "rule of three" I am afraid is no...

What's the best way to do a lookup table in C?

I am working on an embedded C project. I have an LCD display and for each character there is a 5x7 dot matrix. To display a specific character you have to shift in 5 bytes that correlate with the dots to turn on. So I need to make some kind of look-up table with a key where I can pass in an ASCII character, and get an array of 5 bytes re...