lookup

Sparsely populated lookup table in SQL

I'm trying to write a lookup method for determining a SMS message to send to a user based on a few parameters associated with the user/system. We will have a default message that will be used as a last resort, but there are multiple ways to override the message by various parameters. Here is what I have so far for the lookup query - ar...

Loading a lookup table from a database into a C# program - data structure?

I have a table full of id's,categories and weights that I need to reference in my program as I read in records that contain those categories. What is the most efficient method to read those from a database and put into a structure that I can reference? The ID's (and possibly the names) would be unique Data might look like: ID,Category...

How do I pass a list of Qs to filter for OR lookups?

How do I pass a list of Qs to filter for OR lookups? Something like: q_list = [Q(xyz__isnull=True), Q(x__startswith='x')]? Without a list I would do: Model.objects.filter(Q(xyz__isnull=True) | Q(x__startswith='x')) ...

How to lookup a url on a page

I'm new to Regular Expressions and things like that. I have only few knowledge and I think my current problem is about them. I have a webpage, that contains text. I want to get links from the webpage that are only in SPANs that have class="img". I go through those steps. grab all the SPANs tagged with the "img" class (this is the har...

Dynamic creation of new lookup tables based on values in main data table

I am working on an application which accepts any uploaded CSV data, stores it alongside other datasets which have been uploaded previously, and then produces output (CSV or HTML) based on the user selecting which columns/values they want returned. The database will be automatically expanded to handle new/different columns and datatypes ...

Python: How to extract variable name of a dictionary entry?

I'm wondering how I would go about finding the variable name of a dictionary element: For example: >>>dict1={} >>>dict2={} >>>dict1['0001']='0002' >>>dict2['nth_dict_item']=dict1 >>>print dict2 {'nth_dict_item': {'0001': '0002'}} >>>print dict2['nth_dict_item'] {'001': '002'} How can I go about making...

Cache lookup performance

We have a big winforms C# application, that's basically a frontend for some databases (CRUD stuff) and I'm trying to implement some in memory cache for business objects. Something like: List<Customer> customerCache; // Loaded during app. startup I've already created some code to keep the cache up-to-date with the database. This code...

best practices with code or lookup tables

[UPDATE] Chosen approach is below, as a response to this question Hi, I' ve been looking around in this subject but I can't really find what I'm looking for... With Code tables I mean: stuff like 'maritial status', gender, specific legal or social states... More specifically, these types have only set properties and the items are not...

Is this lookup method possible in Access VBA?

I'm using Access 2007 connecting to a MS SQL db through ODBC. I have a table called 'bases' it looks like this: Name ID Site -------------------- Home 1 111 Work 2 111 Car 3 111 Castle 4 111 Store 1 222 Rest 2 222 Now the tricky part is that the only part of this tabl...

Function template declaration order affects visibility (sometimes).

I'm trying to create a function: template <typename T> void doIt( T*& p ) { if ( !p ) { return; } T& ref = *p; getClassName( ref ); } where the behavior varies according to the type of p passed in. In particular, the version of getClassName called should depend upon the type of p. In the following example, I can successfully ...

What is a practical way to model lookup tables in Domain Driven Design (DDD)?

I'm just learning DDD (Eric Evans book is open in front of me) and I've come across a problem that I can't find an answer for. What do you do in DDD when you're just trying to get a simple list of lookup records? Ex. EmployeeID: 123 EmployeeName: John Doe State: Alaska (drop-down) County: Wasilla (drop-down -- will be filtered based on...

How can I write a SQL select statement to include a lookup from another table?

I'm copying data from one database to another and massaging the data while I'm at it. Both databases have tables called Clients and Jobs. However, in database "Alpha" the Jobs table does not have a relationship to the Clients table, where database "Epsilon" does. Alpha's Jobs table just has the Clients name in an nvarchar column. I...

Modal popup search window to replace dropdown control ASP.NET

I'm looking for the simplest way of popping a modal search window on top of an ASP.NET 3.5 application to look up values for a field. I've got a screen for users to add courses; users need to be able to choose an instructor by searching for instructors in a popup. So - the popup would have a textbox and a gridview with results; clicking...

How can I get SSIS Lookup transformation to ignore alphabetical case?

Hopefully this is easy to explain, but I have a lookup transformation in one of my SSIS packages. I am using it to lookup the id for an emplouyee record in a dimension table. However my problem is that some of the source data has employee names in all capitals (ex: CHERRERA) and the comparison data im using is all lower case (ex: cherrer...

Java hashmaps without the value?

Let's say I want to put words in a data structure and I want to have constant time lookups to see if the word is in this data structure. All I want to do is to see if the word exists. Would I use a HashMap (containsKey()) for this? HashMaps use key->value pairings, but in my case I don't have a value. Of course I could use null for t...

Which is faster to find an item in a hashtable or in a sorted list?

Which is faster to find an item in a hashtable or in a sorted list? ...

How to make an Access TextBox, with a Numberic Value, Equal to DLookup with the TextBox as the Criteria

I really have no idea why this doesn't work, but I am trying to get the following to work: If Me.Text1 = DLookup("Field1", "Test1_Table", "Test1_Table.Field1= _ & Me.Text1") Then MsgBox "It works" Else End If The above code is a test code for a larger project that I am working on, so the table and field names are just for test...

Algorithm/steps to find Longest Prefix search in Patricia Trie

Hello, I am implementing Patricia tries for IP prefix lookup, I could get the code working for complete key match, but facing problems with prefix search, when there are keys which are prefixes of other keys, like: 1.2.3.0 1.2.0.0 Can anyone help me with the algorithm for prefix searches in the above case Should I consider these as ...

How can I create objects with reference using instantobjects framework programmaticaly in Delphi code

I am a experimenting with instantobjects. I have two simple classes tband and tcountry both are defined as stored. tband has a properts named tcountry referencing the tcountry class/table. (country is the lookup table). When creating a new band I want the user to be able to select the country in the form from a list/combo and then save t...

Accessing list data from a different site in Sharepoint Designer workflow

Does anyone know if it is possible to Lookup list data from a different site when creating a workflow with Sharepoint Designer 2007? The Define Workflow Lookup dialog only allows you to pick from lists in the current Sharepoint site you are creating the workflow in. Ideally I'd like to be able to pick from a list in the parent site, or a...