Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

what is the best language to do this in?

Name: Anonymous 2010-01-14 19:13

I have a set of data:
Sally has attribute A and attribute B
Bob has attribute D and attribute R
John has attribute S and attribute T
Melissa has attribute G and attribute M

etc.  There are over 300 names and 21 different attributes (let's call them A, B, ..., T, U) in varying combinations.

I want to pick out a set of 5 names with 2 attributes each that fit in a pattern of (for example) A,B,C,D,E,F,H,I,J,K

What's the best way to go about this?  I'm programming language neutral, though I do have some experience in bash, python and perl.  It would have to take input from a text file (either tab delimited or csv) and output which names to pick and what their attributes are.

Name: >>15 2010-01-15 12:58

On the other hand, that code might not do exactly what the OP wanted as I didn't understand the problem fully. In that example the search is inclusive(OR), but the OP might have wanted something like AND instead. Of course such a thing would be trivial to implement as well (one line change to lookup-persons-with-attributes to use set-intersection instead of appending). If one wants to limit the number of results, either have the loop break early, or just subseq the final result (another line of code tops).

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List