Questions tagged [searching]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
38
votes
2answers
1k views

Documentation searches hang frequently: Anyone else dealing with this?

I've been struggling with a number of hangs, dynamic timeouts, and outright crashes when using the search/documentation center in version 9. I've tried uninstalling/reinstalling and clearing ...
24
votes
1answer
996 views

Strategies for solving problems involving searches

As an example of a search-oriented problem, consider finding all constrained $n$-colorings of a graph. An "$n$-coloring" associates one of $n \ge 1$ colors to each vertex in such a way that no edge ...
22
votes
2answers
4k views

Determine whether some expression contains a given symbol

Given a symbol t and an expression expr, how can I determine whether or not the symbol t ...
20
votes
1answer
897 views

NotebookFind and String Pattern Expressions

Is there a way that NotebookFind can be used to match string pattern expressions rather than just strings? The documentation for ...
18
votes
2answers
1k views

How can I get Google search results with Mathematica?

I am trying to write a function that, starting from a string, returns the Google search hits on that string (the format and other stuff, I still have to decide). I have looked around and have found ...
15
votes
2answers
554 views

How to find a specific error message?

Is there a way to find an existing error message in the System` context, that is used for a certain case? I want to include a message in a custom function that ...
12
votes
2answers
1k views

Efficiently searching a list for the position of the closest number to a specified number

Searching by closest and position I wasn't able to find an answer—but found Nearest by guessing. Nearest, however, returns ...
12
votes
0answers
210 views

Is it possible to search the web by image from Mathematica?

Is it possible to perform a web search based on an image input? There are several services that provide this: Google, Bing, TinEye, and maybe others. I am not sure which can be accessed ...
11
votes
2answers
401 views

Position and string patterns

I am trying to get Position work with patterns. I have the following code: ...
11
votes
3answers
266 views

Basic Search Functionality

Let say I have three blocks of text like the following. {"first block of text with random content","different block of text","1 2 3 4"} Now let's say I want to ...
11
votes
1answer
1k views

Is there a built-in function to do binary search?

Is there a built-in function to do binary search? Say, given a list (sorted) and a number, find the position which keeps the listed sorted when the number is inserted. I know that ...
10
votes
3answers
743 views

Extracting values with multiple keys

I want to extract sorted data from a huge database based upon two (or more) keys in a very timely manner. Here is a reproducible toy example for two keys only: ...
10
votes
1answer
329 views

How can I implement my own documentation search function?

The current documentation search doesn't allow for very sophisticate searching, can I write my own function to search through the docs?
9
votes
4answers
959 views

Searching a phrase in all *.nb files

I have so many *.nb files in a folder. In one of them I have written a phrase, unfortunately I cannot remember that file. I am searching about it and the file in ...
9
votes
2answers
2k views

Find file names in directory

I am trying to find the list of any file in any directory of a given name (by in the directory, I mean directly in the directory, so in a directory which is in the directory would not count). For the ...
8
votes
3answers
2k views

Find the position of a string element, knowing only part of the string

I have a list, e.g.: list = {1, 2, 3, "Element 1", 4, 5, "Element 2", "Something else 1", "etcetera"} Now, I want all elements starting with ...
8
votes
3answers
2k views

Finding all of the words containing certain letters

Is there a fast method to find all of the words containing the letters: {a, e, i, o, u, y}? I created an algorithm, but it takes more than 11 seconds to find all of ...
8
votes
2answers
559 views

Finding all sets of elements with two common elements in a large dataset

I have a very large network of atoms ($\approx 10^6$ atoms) with fixed positions that resemble a cellular structure: I have two files including: fixed locations of each atom set of points which ...
8
votes
1answer
278 views

Using Mathematica to find an alternative continued fraction for $\zeta(5)$

Given the Riemann zeta function $\zeta(n)$. I. $x=\zeta(3)$ Using Euler's continued fraction formula, we can form $\zeta(3)$'s cfrac as, $$Ax+B = \cfrac{1}{v_1 - \cfrac{1^6}{v_2 - \cfrac{2^6}{...
7
votes
9answers
1k views

Find the smallest positive integer that satisfies a certain condition

I know Mathematica is really powerful when it comes to functional operations like applying a list of tasks to a list of variables. Sometimes I feel like it isn't the most powerful tool when it comes ...
7
votes
4answers
562 views

Find elements of array with largest absolute value

I am wondering how to do in Mathematica the following: Given as an input a large array, I want to output a list of top $n$ entries with largest absolute value + their location within the array. ...
7
votes
3answers
265 views

Find sublists in a list by contents, then union them

I want to find two sublists in a list by an element they contain, and then union them, keeping them in the list. I have this code that seems to do the job, but it seems rather clunky. Is there a ...
7
votes
1answer
138 views

How to cache results of WebImageSearch?

Every call to WebImageSearch costs money (wolfram service credits), thus, I would like to page through results without having to redownload them. Given the ...
7
votes
2answers
166 views

How to find alignments of interlocking shapes?

I'm searching for the ways to align interlocking shapes, that is, finding the locations and rotations that maximize the arc length at which they touch. For simplicity, I'm assuming 'shapes' are one ...
7
votes
2answers
147 views

Display Documentation From Function

I would like a documentation function that works like that following. doc["search terms"] and it displays the list of search terms. And then ...
6
votes
4answers
298 views

Searching for an unordered triple in a list of triples

I have a list of triples which looks like this T = {{7, 1, 2}, {7, 2, 3}, {7, 3, 8}, {7, 1, 6}}; (I have suppressed a few triples for clarity. My real list is ...
6
votes
2answers
491 views

Interactive grid

I would like to create an interactive grid, whereby one number from a grid is selected by the cursor ("3" in the example below), and all other numbers in the grid are highlighted that are related to ...
6
votes
1answer
174 views

Searching for literal strings with TextSearch

The documentation indicates that TextSearch can be used to look for a "literal string" inside documents, but it appears Mathematica may be applying a regex-style ...
6
votes
1answer
134 views

TextSearch Function

I am trying to use the new text search function to help me look through a directory of files for string that I chose. Essentially I've got a large list of notebooks and don't want to manually look ...
5
votes
3answers
645 views

Working with deep lists

I want to store parameters value such that the function that depends on those parameters. For example, let's say I have a function that depends on three arguments: f(x;a,b), where a and b are ...
5
votes
3answers
676 views

Determine if a variable appears in an expression or not?

Consider an arbitrary expression expr. This expression may contain arbitrary data, like integers, variables, implicit functions etc. Now, I would like to determine ...
5
votes
2answers
287 views

Implementing a Better Grep Command

In Working With String Patterns, Wolfram documentation yields a simple Grep function: ...
5
votes
4answers
422 views

Find permutation index

Firstly I wanted to find all the non-negative integer solutions for the following equation given the value of $k_{max}$ $$ k_1 +k_2 +k_3+k_4 = k_{max} $$ For this I use the following code:- ...
5
votes
1answer
93 views

How to speed up a text search widget?

I have an InputField that searches a predefined list for matching strings and displays them in a TextGrid. But when the list is ...
5
votes
1answer
99 views

Code/Exp Search Documentation Center Mathematica

I have added several of my own applications to my Mathematica documentation center. Currently Mathematica uses followings notebook options to help the user search for specific functions. ...
5
votes
1answer
199 views

Is is possible to use regular expressions in the search and replace diaglog?

I find myself wanting to be able to do regular expression search and replaces in the Mathematica gui over and over again. Using a regex capable editor (such as vim), I could do something like: ...
4
votes
3answers
391 views

How to find the position of the smaller element in the list

x = {4, 1, 2, 5, 6, 7} y = {1, 2, 4, 5, 6, 9} There are two lists x and y. How to find out these positions of the elements in list x are smaller than those in ...
4
votes
4answers
179 views

How can one efficiently find the (x,y) values of the rectangles that enclose a chosen % of nonrandom data points in mathematica?

A half hour of searching for answers did not give useful results. This is typical data: I need to find the (x,y) values of at least 6 rectangles with one corner at (0,0) and the opposite corner at (...
4
votes
2answers
235 views

Speeding up Position for finding the indices of a small number of integer elements in a large matrix

I have a large $100 \times 4000$ element matrix composed of integer elements, testMatrix, and I was to use Position to find the ...
4
votes
3answers
150 views

Find non-case sensitive string in a mixed list of elements?

Consider an example list with mixed element types, e.g.: list = { 1.234 , a[2] , {"Abc" , 4/5} , "acb" }; I would like to have a function that finds the position ...
4
votes
1answer
74 views

Why does documentation search fail on substrings?

For example many times I have to type the full string exactly which defeats the point of a search, so perhaps this is a bug?
4
votes
1answer
184 views

Searching for closest entry in a table

I have a large table of triplets whose structure is: list=Table[{a,b, RandomReal[]}, {a,1,100}, {b,1,100}] I would like to search through the list by looking ...
4
votes
3answers
87 views

Subsequence Search

I need to parse some xml code. I need to extract some values withing pattern elements. I made an example of my trouble. Here is some complicated xml list: ...
4
votes
1answer
159 views

Most efficient searching algorithm in a table

I am completely new in Mathematica (and in data analysis in general) and I find it really useful, although I still do not use it properly. I have the following question related to data manipulation: ...
4
votes
1answer
301 views

For loop to perform a shooting search in NDSolve

First comes the disclosure: I am very new to Mathematica and not so much a numerical guy in general. I am having a hard time using the for loop routine in Mathematica the correct way as well as ...
4
votes
2answers
253 views

Limit FindMinimumCostFlow function to one vertex per path

I want find a set of paths through a graph that maximise flow and minimise cost set on each Edge. However, I have an additional constraint where each Vertex can only be visited once. Mathematica has ...
4
votes
1answer
200 views

Searching Notebooks for String Patterns using Workbench v2

The Workbench webpage describing new features in version 2 lists the ability to "Search notebook documents with the Mathematica pattern search utility" under the heading Mathematica Front End ...
4
votes
0answers
122 views

Extracting names (surname & family name) from unstructured text files

This question is about finding names of people in a text without knowing these people. There are some rules we can use to detecting names in a text A name consist always of two or more words (...
4
votes
0answers
96 views

Can BreadthFirstScan be modified?

I would like to obtain a "slick" implementation of A*-search algorithm on Graph objects, using the built-in BreadthFirstScan (if that is possible at all). I noticed that BreadthFirstScan is static in ...
3
votes
2answers
320 views

How to rewrite this function to be faster: Find sub-matrixes of boolean board which imply a given boolean pattern

I have Boolean matrix A (called "board") and Boolean matrix B with smaller dimensions (called "pattern"). I am trying to find sub-matrixes C of A such that C has same dimensions as B, and TableImplies[...