Questions tagged [reverse-lookup]

Many programming languages feature data structures where unique indexes are associated with a value. Reverse lookup is retrieving the index with which a given value is accessed.

47 questions
1
vote
1 answer

How to do a reverse lookup through a profile in django

So I have a class, Y, that is a profile extending User. I have another class, X, that has a one-to-one relationship with class Y: class X(models.Model): y = models.ForeignKey('class Y') Given that I have access to a user object, how do I get to…
fox
  • 15,428
  • 20
  • 55
  • 85
1
vote
1 answer

Reverse lookup in a json string with key value pairs

I have a Pandas DataFrame, from a source that I can't change, in the following format: import pandas as pd json_str_01 = '''[{"my_key": 1, "my_values": ["3_13"]}, {"my_key": 2, "my_values": ["3_18", "2_12"]}, {"my_key": 3, "my_values": ["2_10",…
Imtiaz
  • 69
  • 1
  • 7
1
vote
1 answer

Django update a Foreign Key model using reverse lookup

I am working on a Django project and stuck at a problem. My models look like this: class Products(models.Model): basket_name = models.CharField(max_length = 5, blank = False) product_name = models.CharField(max_length = 30, blank = False) …
1
vote
4 answers

Reverse lookup Dictionary

I have the following dictionary and I would like to do a reverse lookup. countries_dict = {'Andorra': ('Europe', 'Andorra la Vella'), 'Afghanistan': ('Asia', 'Kabul'), 'Antigua and Barbuda': ('North America', "St.…
Bows
  • 49
  • 6
1
vote
1 answer

How to call Windows gethostbyaddr API using BATCH script

I already have a small script in perl to do reverse lookup, but it is not portable unless the other machine also has perl installed. I want a script that can run on colleagues machines seamlessly and also can be converted into a custom command (by…
Benny
  • 639
  • 3
  • 11
  • 25
1
vote
2 answers

Reverse lookup for loop in R

I have a set of numbers / string that makes other number / string. I need to create a function that gives me a list of the all the numbers / string needed to create that number / string. Consider the following dataset ingredients <- c('N/A', 'cat',…
PDog
  • 143
  • 1
  • 2
  • 11
1
vote
1 answer

Unable to use SUBSTITUTE(ADDRESS(MATCH))) combination as a range in a LOOKUP function in Excel

I have an Excel sheet containing a matrix of [Year & Week number] in rows and [name of Employees] in row1 giving values of available weekly hours. I am able to successfully use the Excel formula =LOOKUP(2,1/((A:A=2018)*(B:B=31)),D:D) at cell F2…
S. Shaw
  • 11
  • 5
1
vote
4 answers

How to get array key by value?

I have array issue. This is my array: $servicesTypes = array ( "hotel" => "HTL", "HTP", "HT", "flight" => "FLT", "m&a" => "APA", "daily_tour" => "TOU", "privat_car" => "PRC", "transfer" =>…
Roi
  • 27
  • 4
1
vote
2 answers

Reverse lookup with non-unique values

What I'm trying to do I have an array of numbers: >> A = [2 2 2 2 1 3 4 4]; And I want to find the array indices where each number can be found: >> B = arrayfun(@(x) {find(A==x)}, 1:4); In other words, this B should tell me: >> for ii=1:4,…
KQS
  • 1,547
  • 10
  • 21
1
vote
3 answers

Reverse lookup for Java Enums with more than one value per key/constant?

With an enum like this one where each key has several values ABBR1("long text 1", "another description 1", "yet another one 1"), ABBR2("long text 2", "another description 2", "yet another one 2"), //and so on... how can I reverse lookup an…
Christian
  • 6,070
  • 11
  • 53
  • 103
1
vote
1 answer

Ruby TCPServer always delay on dns reverse lookup? - how to disable?

I created a TCPServer with ruby gserver. Everytime I connect remotly to the server, it takes 2-4 seconds until connection is established. This is only happen if I connect from remote machine. Connection from same machine has running the service will…
Tom Freudenberg
  • 1,337
  • 12
  • 31
1
vote
1 answer

NoReverseMatch Error: Django-Registration

I have recently downgraded my Django project from 1.5 to 1.4 in order to host my project on an OpenShift server. In the process, I appear to have created a problem for reverse lookups from the django-registration app. Specifically, when I POST data…
nmagerko
  • 6,586
  • 12
  • 46
  • 71
1
vote
3 answers

Using KeyValuePair in VB.NET for a reverse lookup capable dictionary (example hint in C# needs converting)

I'm currently on a VB.NET project and wish to use a KeyValuePair to facilitate a reverse lookup. I've found a great example in C# here: http://www.dreamincode.net/forums/showtopic78080.htm, however I am having a small problem converting to VB.NET…
Topdown
  • 443
  • 1
  • 8
  • 17
0
votes
0 answers

How to reverse Power Apps Text Recognizer

Developing a Power App that will give us the text in a picture. Getting the bounding box records, check. Now trying to figure out how to use a dropdown to chose one of the text/bounding box records, and have the app highlight just that bounding…
T. Hughes
  • 53
  • 6
0
votes
2 answers

How can I find the closest matching value ABOVE the current cell, and return a different column in that same row?

Working in google sheets, I am trying to find the closest matching value ABOVE the current cell and return a different column from that same row. Here is a visual of what I'm trying to achieve: For any row where Column A=x, just return the value in…
kelp
  • 3
  • 2