Questions tagged [searching]

The tag has no usage guidance.

36
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
974 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 ...
20
votes
2answers
3k 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 ...
18
votes
1answer
799 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 ...
17
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 ...
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 ...
11
votes
3answers
255 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
2answers
497 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 ...
10
votes
2answers
322 views

Position and string patterns

I am trying to get Position work with patterns. I have the following code: ...
10
votes
1answer
313 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?
10
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 ...
9
votes
4answers
716 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
627 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: ...
9
votes
0answers
129 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 ...
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
544 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 ...
7
votes
2answers
1k 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 ...
7
votes
1answer
129 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
142 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
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 ...
6
votes
4answers
277 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
449 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
143 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
2answers
148 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 ...
6
votes
1answer
125 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 ...
6
votes
1answer
176 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}{...
5
votes
3answers
644 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
454 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
4answers
344 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
64 views

Filling and transferring water between containers to obtain a desired volume

A classic class of math puzzles involves two irregular containers, $A$ and $B$, having known volumes $V_A$ and $V_B$ and an infinite source of water (from a spigot, say). You can fill either ...
5
votes
1answer
72 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
87 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
157 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
4answers
169 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
224 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
1answer
73 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
177 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
1answer
152 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
279 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
246 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
194 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
90 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
313 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[...
3
votes
3answers
89 views

Find element in a list matching a pattern (using wildcards)

Somehow, I did not manage to find anything related to that. Suppose, in my Global list of variables, I would like to make a search such that I obtain all the ...
3
votes
2answers
236 views

Obtaining the position in a list where the i^th element is bigger than the (i+1)^th element

My question is very simple but I am not able to find the optimal solution. What I am trying to do is to have a function that give me the position in a list at which the value at position ...
3
votes
3answers
170 views

Quickly plotting (number of events) vs. (time) for a very large number of events encoded as pairs of real numbers representing start and end times

I have an array that looks like the following: exampleArray = {{t1,r1},{t2,r2},{t3,r3},{t4,r4},{t5,r5},...}; Where each pair of real numbers $(t_k,r_k)$ ...
3
votes
3answers
107 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 ...
3
votes
3answers
71 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: ...
3
votes
1answer
265 views

WolframConnector - getting credentials for GoogleCustomSearch

I need to fill in the information for the WolframConnector in the panel shown below which is activated by running the command: ...