lookup

Fastest way to find an item in a list?

I have an unsorted list of strings. I can place these items in an array, List, SortedList, whatever. I need to find the fastest way of looking up a string in this list. Am I better off dumping the list into an array, sorting it, then implementing binary search? Or does the framework provide a way to do this? Thanks P.S. Using VS200...

Replace Strings with IDs in Excel

I have a Microsoft Excel worksheet that has hundreds of rows of items. The category column in this items worksheet is filled with category names, which are duplicated since it's a many-to-one relationship of items to categories. I would like to replace these category strings with IDs from a second worksheet that has a unique list of th...

What is the Fastest Way to Check for a Keyword in a List of Keywords in Delphi?

I have a small list of keywords. What I'd really like to do is akin to: case MyKeyword of 'CHIL': (code for CHIL); 'HUSB': (code for HUSB); 'WIFE': (code for WIFE); 'SEX': (code for SEX); else (code for everything else); end; Unfortunately the CASE statement can't be used like that for strings. I could use the straight IF ...

A dictionary object that uses ranges of values for keys

Hey all, I have need of a sort of specialized dictionary. My use case is this: The user wants to specify ranges of values (the range could be a single point as well) and assign a value to a particular range. We then want to perform a lookup using a single value as a key. If this single value occurs within one of the ranges then we w...

Speclialized hashtable algorithms for dynamic/static/incremental data

I have a number of data sets that have key-value pattern - i.e. a string key and a pointer to the data. Right now it is stored in hashtables, each table having array of slots corresponding to hash keys, and on collision forming a linked list under each slot that has collision (direct chaining). All implemented in C (and should stay in C)...

PHP - How can I lookup the Zip Code using the City & State

I need to lookup the Zip Code for a list of addresses (which include the city/state). Is there a master zip code list for download (that is free) or are there any web services that will return the full postage info for an address. Ie, lookup query: 386 Bread & Cheese Hollow Rd, Northport, NY ====> 386 Bread And Cheese Hollow Rd, Northpo...

DataValue of Lookup field is always null.

Hey guys, I'm using MS CRM 4 in IE8. On the Order Product form, I am attempting to use the OnChanged event of the Quantity field do give some feedback to the user based on the current value of the Product lookup field. My problem is that no matter what I do, the DataValue property of the field is always null. Here's the javascript I'...

Counting sentences: Database (like h2) vs. Lucene vs. ?

Hi all, I am doing some linguistic research that depends on being able to query a corpus of 100 million sentences. The information I need from that corpus is along the lines: how many sentences had "john" as first word, "went" as second word and "hospital" as the fifth word...etc So I just need the count and don't need to actually retri...

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 ? ...

How to build up a lookup table in microcontroller?

Hi, I am so confused about how to build up a 3-dimension lookup table. Is the template as follows: create a 3 dimensional array to store data. Then create linked list. Then create function 'insert' to put all the data into the array? As some book said, linked list should be static const, is it need to create another function to expand th...

What would cause a Fuzzy Lookup to return a Null set of values from the reference table?

I'm doing a fuzzy lookup on a view of a table which does a fine job returning similarities with the occasional exception, and I can't seem to figure out what is causing the problem. Every so often, the comparison will come up with null values from the lookup view, even though the values exist in both the view and the original table and t...

Using Perl to select 1 from@db_link where db_link comes from each entries of a lookup table

I want to read a table in oracle which contains database links for checking availabilty of each database link and return only the bad results for each database link and error message. I want to fetch this lookup table into an array, and pass the entries of db_link to a select from dualQdb_link, test all the entries of lookup to test fo...

Initialising Lookup<int,string>

Hi all how do i declare a new lookup class for a property in the object intialiser routine in c#? eg new Component() { ID = 1, Name = "MOBO", Category = new Lookup<int,string>} the category bit always get a compile error thanks ...

Using NHibernate with lookup tables

If you have a set of tables in the database that strictly consist of a string description and an ID, what is the best way to load these via NHibernate? So suppose I have a Sandwich class, and a sandwich has a meat, a cheese, and a vegetable, where those three things are lookup tables in the DB. It seems to be the most conformant to NHi...

Problem on jboss lookup entitymanager

I have my ear-project deployed in jboss 5.1GA. From webapp i don't have problem, the lookup of my ejb3 work fine! es: ShoppingCart sc= (ShoppingCart) (new InitialContext()).lookup("idelivery-ear-1.0/ShoppingCartBean/remote"); also the iniection of my EntityManager work fine! @PersistenceContext private EntityManager manager; Fr...

SSIS LookUp Issue

I am trying to migrate 6 lacks records and i am using lookup to identify the new records.. But it is inserting the records, even it is present in my table. If less records it is working fine.... Any help please suggest me.. ...

Creating "lookup" values in Core Data

Hi everyone, I have a Core Data entity which needs a gender property. I just need one of two, the standard male or female values. What's the best practice for this in Core Data? In the .NET world with databases I would've created a Gender table, with foreign key in the child table. I'm still getting my head around Core Data right now -...

Optimizing for speed - 4 dimensional array lookup in C

I have a fitness function that is scoring the values on an int array based on data that lies on a 4D array. The profiler says this function is using 80% of CPU time (it needs to be called several million times). I can't seem to optimize it further (if it's even possible). Here is the function: unsigned int lookup_array[26][26][26][26]; ...

SSRS 2008 Need to lookup customer name with largest order

Hi, I'm creating an SSRS report which contains a table of orders, grouped by day. Now I can easily get the max order value for the day and put it in the group header by using the SSRS MAX() function. However, I also want to get the corresponding customer name who placed this order, and place this in the group header too. We can assume...

sharepoint list relationship question

I have two custom lists in sharepoint with a one to many relationship on a column in both lists. So list A has text column 1 and list B has a lookup column 1' on list A's column 1. I want to display the rows in list A, where column 1 has a match on column 1' and a 2nd column in list B with a specific text string. I have Sharepoint Des...