Questions tagged [search]
This tag is for questions about search algorithms, tools, and technologies.
379
questions
1
vote
2
answers
116
views
Search a unique list and search a larger list to set dictionary with keys of binary values
I would like to search a list of unique values and create a dictionary with those unique values as keys, and a binary list for whether those values occur.
I have successfully solved this, but would ...
0
votes
2
answers
231
views
SQL Server Multi Term Wildcard Search on Multiple Fields with Ranking
I've built up this search query for searching airport locations on multiple fields, but I don't particularly like the way it works in practice. Even though it is fairly cool. I'll be reverting back to ...
4
votes
1
answer
4k
views
Filtering parent and children elements of list of dictionaries
I have a list of dictionaries and its elements has id and parent_id fields.
Main purposes:
If the parent_id field of an element is defined, it should be returning the rest of elements except itself.
...
2
votes
1
answer
95
views
Which is the best approach for searching the dictionary items?
We can search for the list of dictionaries using the below some approaches, Can one please help me, which one is the memory efficient approach to use?
Provided that:
...
3
votes
3
answers
499
views
Case insensitive sub-string search
I found myself in a need of a function that checks whether a string is a sub-string of another string, in a case-insensitive manner. I found that there's no standard function to do this, so I wrote my ...
4
votes
1
answer
254
views
QuickSearch for files and directories
I have a project where I need to search for directories and files. In fact I'm searching for paths in other projects. I don't want to just find files but I also want to exclude some directories or ...
2
votes
1
answer
1k
views
Searching for an object with spectific property, using user input
I have just started my adventure with C#. Below you can find a code written for my school assigment.
The homework task had 3 major elements:
building a class book
creating a metod for changing the ...
2
votes
0
answers
262
views
Search GitHub users when text field changes in Kotlin Android app
Problem: Search for users by their name using the GitHub API (sorted by the number of followers) and display the results in a RecyclerView.
Implementation: Hitting the GitHub API every time when user ...
2
votes
2
answers
222
views
A linear search implementation for any data type in C
I performed an "experiment" to test my understanding of pointers in C. I decided to write a linear search function that can work on any array provided there is an existing function to compare the ...
20
votes
2
answers
3k
views
Search a big (13 GB) Outlook PST file
I have an Outlook PST file of a pretty big size (13 GB). For some indexing purpose I needed to scan through the full PST file to get all the PR_SEARCH_KEY and then ...
7
votes
1
answer
4k
views
Approximate string search in Python
I have a long text (about 6,000,000 chars) and a short text (about 6,000 chars). The long text contains the short text, but not exactly - a small number of words are missing, abbreviated or just ...
3
votes
2
answers
234
views
Variadic function to find the first matching (string) argument in a larger array
Playing around with parsing a data buffer I wrote a small search function to find the first complete match out of a set of (string) arguments.
The (simplified) buffer class with the find function:
<...
3
votes
2
answers
346
views
Is given pattern a subString of given input string? KMP implementation
My implementation of Knuth Morris Pratt algorithm. Looking forward for code review comments. Let me know of there is a better way to implement this algorithm.
...
4
votes
1
answer
969
views
Smalltalk (Squeak) - String parsing
I'm learning Smalltalk programming as I think its way ahead as an OOP programming tool. I would appreciate feedback regarding my coding of the following problem. I have a sequence of letters ...
3
votes
1
answer
154
views
Multi search bar
This searches within three search engines. I would like if you could tell me any ways to make this better:
...
3
votes
1
answer
109
views
Slow execution time of search algorithm
I have solved a problem of a game named 'Set'.
The full problem is detailed on it's website: https://www.urionlinejudge.com.br/judge/en/problems/view/1090
However my code for the search algorithm is ...
7
votes
2
answers
1k
views
Find and rename all png files
I have such problem : find all png files to disk and rename them as I did:
...
5
votes
1
answer
120
views
Selecting site to browse in python
This code is for part of my first major contribution to open-source, for the socli project. The purpose is to allow the user to select a site from the stack exchange network to browse and fill two ...
3
votes
2
answers
2k
views
Find all occurrences of all permutations of a shorter string within a longer string
Input is two strings, the first string being the long string and the second smaller string being the permuted string.
The output should return the starting indices of all occurrences as well as the ...
1
vote
1
answer
151
views
Searching an entire workbook for keywords and then printing the results on another worksheet
I made a search page at the beginning of a work book. This page has a drop down that allows you to choose what category to search in, then you type your phrase or keyword into the search box and it ...
3
votes
1
answer
2k
views
Parsing a Conditional statement with Python
Recently I built a Usenet newsreader in Python and for that I built a keyword search which supports AND and OR functionalities (e.g., python AND django should bring up articles containing both. I ...
0
votes
1
answer
1k
views
Searching of Word documents
I have a website that offers to search documents from local hearings conducted, stored on a network file server. I need to take in the search term and search a bunch of .docx (roughly 4500) files. ...
3
votes
0
answers
244
views
Fastest way to build string feature vectors Python
I have a list of strings to search along with a list of words and want to produce boolean feature vectors indicating presence of each word within the strings. What is the fastest way to build these ...
7
votes
1
answer
65
views
Search table without repetitive for loops
I have an astropy table with a column containing datetime.datetime instances. I want to isolate the rows of this table that correspond to a user specified year, ...
8
votes
1
answer
13k
views
A* Search on 'Map of Romania' (Russel and Norvig ch3) in Python 3
I've implemented A* search using Python 3 in order to find the shortest path from 'Arad' to 'Bucharest'. The graph is the map of Romania as found in chapter 3 of the book: "Artificial Intelligence: A ...
0
votes
1
answer
746
views
Speed up search/replace in VBA Word
I have a word document with 450 pages (and growing) in witch I make a search and replace (linking referencies) after inserting new text. Unfortunately this procedure is very slow.
Have you any ...
5
votes
1
answer
8k
views
Python 3 - Get n greatest elements in dictionary
Given an dictionary with lists as values this piece of code is dedicated to find the n keys with the longest lists as values. It works, but there has to be a more elegant solution.
...
2
votes
1
answer
199
views
Read CSV files and find the same values on the specific columns
I created a simple command line application to read CSV files in a specific folder and find the same values on the specify column which exists on all files. (Here's the complete source code.)
Here's ...
4
votes
1
answer
553
views
Functionally find the index of the minimum value in an array
I come from a C#/JavaScript/TypeScript background and am learning F# by implementing fundamental algorithms. This is finding the minimum value in an array:
...
1
vote
0
answers
1k
views
Excel VBA - searching PDF using FindText three times per doc
It takes a very long time for some files to be searched. I need to do this with 1000+ PDFs. It seems to be held up during the FindText operation. Any suggestions?
...
2
votes
2
answers
331
views
Binary search to identify duplicate user names
I am trying to implement the code described this post about how Reddit identifies duplicate user names (I do believe it is called binary search). Just to clarify, this is mainly for me figuring out ...
-2
votes
1
answer
99
views
Search function for a trie tree
I have made a search function that seems to work for passing the tester. I am just unsure if it will always be without errors. Can someone tell me if they see any flaws in the logic, and if so, where ...
2
votes
1
answer
52
views
Show all full/partial search matches in the first worksheet from other worksheets
Search and display all instances of a full/partial match in the first worksheet from all the other worksheets in the workbook after running a macro to clear formatting of previous search results.
I ...
10
votes
2
answers
491
views
Naive implementation of KMP algorithm
After reading this answer to the question "High execution time to count overlapping substrings", I decided to implement the suggested Knuth-Morris-Pratt (KMP) algorithm. I used the pseudo-code listed ...
5
votes
2
answers
2k
views
Phone number to words based on the dictionary
This is the problem:
Given a 10 digit phone number, you must return all possible words or combination of words from the provided dictionary, that can be mapped back as a whole to the number.
...
7
votes
1
answer
6k
views
Binary Search in Haskell
I have been trying to pick Haskell back up so I decided to try to implement binary search as practice. I am aware that binary search in Haskell in inefficient because Haskell's lists are implemented ...
5
votes
2
answers
130
views
Creates a class that searches for the elements in a list that contain a sequence
Not sure what I should write here. The code should be self-explanatory.
...
2
votes
1
answer
121
views
Javascript module for sorting and searching
Here is a vanilla JS module that I wrote for sorting and searching an array.
I would appreciate feedback on the design of the module as I'm new to writing javascript in modules and don't know if I'm ...
10
votes
1
answer
533
views
Javascript/Typescript anagram String search
I've created a random word generator which allows me to create random words/anagrams.
Then I've created Anagram search app to find the angarams when user start typing in inbox.
Could you review ...
1
vote
1
answer
107
views
Searching a string with text search
say that:
var stringToTest = "Hello i am walking"
And
var searchText = "Hello walking"
I have the following ...
2
votes
1
answer
2k
views
Search for layers in Adobe Illustrator by name
I am looking for some advice on some speed increases on my Adobe Illustrator (AI) script. Just so you know, the script runs fine and is at a decent speed (couple seconds to maybe a minute max for ...
2
votes
2
answers
107
views
Search through each file in a directory, list number of instances of searched string
I am trying to open each file listed in Sheet2 Column A, search for a string of text located in Sheet3 Cell B1, list the number of instances this string appears in each particular file in Sheet3, and ...
2
votes
1
answer
65
views
Finding a path across a grid after randomly filling some proportion of it
Essentially, we must be able to get from one side of the grid to the opposite side of the grid. My code tests for up to down and left to right.
However, this is painfully slow and I'm wondering if ...
3
votes
0
answers
131
views
Filtering search results for apartment and car rentals
I am developing an app which is somewhat similar to airbnb. There are two search function, one for searching apartment and other for searching car rental. When searching apartment, the result page ...
0
votes
3
answers
162
views
Find the smallest 3 numbers from a total of 5000 numbers
Today was my interview. The question which was asked was:
Give an efficient solution to search smallest 3 numbers from a given
array.
The array contains unsorted numbers which can also ...
1
vote
1
answer
3k
views
Ice Cream Parlor
Each time Sunny and Johnny take a trip to the Ice Cream Parlor, they
pool together m dollars for ice cream. On any given day, the parlor
offers a line of ...
1
vote
3
answers
2k
views
Missing Numbers
Numeros, the Artist, had two lists A and B, such that B was a
permutation of ...
1
vote
1
answer
3k
views
Search function for books
I was making a library program for trying to practice C++. I wanted to use a vector to store all the books, the books being a struct to hold the general things the books would have.
...
2
votes
3
answers
2k
views
Fast find exist in list or not
I want to determine whether or not the selected element exists in the list. This is the current procedure that I'm using for finding the element exist in a list or array. Is there any fast procedure ...
5
votes
1
answer
159
views
Text search in Python
Whilst self-studying algorithms, I came across the Karp-Rabin rolling hash search algorithm here. I decided to have a go at implementing it in Python:
For ease of reading; the data-structure ...