find

STL algorithms and const_iterators

Hello, Today I wrote a small predicate to find matching symbols in a container. But I'm faced to a problem: I want to use this predicate in a std::find_if call inside a const-method of a class, searching in a container that is a member of this class. But I just noticed that neither std::find nor std::find_if are able to operate on con...

Faster search for files in Netbeans

Is there an existing plugin or tweak that speeds up the "Go To File" search in Netbeans ? Compared to Eclipse, Netbeans search is way too slow specially if one has multiple large size projects. I know I can use Ctrl+O for "Go To Type" but often I need to search for other file types like XMLs, property files etc. across thousands of file...

Conditions with Bind Variables and Optional Parameters

Let's say I have a form where users can search for people whose name starts with a particular name string, for example, "Mi" would find "Mike" and "Miguel". I would probably create a find statement like so: find(:all, :conditions => ['name LIKE ?', "#{name}%"]) Let's say the form also has two optional fields, hair_color and eye_color ...

Find text in element and addClass to Parent

HTML: <table> <tr> <td> <a href="#" class="nav">link</a> <td> </tr> </table> I want to: FIND TEXT 'link' in a.nav and ADD ID "abc" to 'table'. Tried this but it doesn't work: $('table>tbody>tr>td>a.nav:contains("Forum Index")').parents('table').attr('id', 'newID'); (tbody because most browsers add it automatically) ...

Windows 7 Batch: Find /i

Hello, I have a windows batch file in Windows 7 which does something with find. it starts with this: find /i /c.... But it says something like find /i is no medium or so. Then it just gives a list of every single file in the C:\ directory. Is there any new replacement for Windows 7? EDIT: If i hit find /? in cmd, it gives fi...

jQuery Find not working for :first

I am trying to find some child a elements within a ul parent. But, I need to only find the first a. Here is what I am using $('div.item a').click(function() { $(this).parent().next('ul.subItems').find('a:first').addClass('selected'); }); HTML: <div class="item"><a id="main5830" href="http://www.mysite.com"&gt;Test&lt;/a&gt;&lt;/...

Disabling display of full file path in VS2008 Find Results window

In Visual Studio 2008, in the Find Results window, how do I not show the full path of the file name where the match was found? The thing that I'm trying to get around is where most of the window is just displaying a long path rather than the chunk of text where the match was found. ...

applescript + shell script problem

I'm writing a script to keep track of missing frames in a render (thousands of image files). to find the numbered frames in the sequence I do this: set thecontents to every paragraph of (do shell script "while IFS= read -r -d '' file; do echo \"$file\"|sed -E \"s|.*[^[:digit:]]0*([[:digit:]]+)\\..*|\\1|\" ; done< <(find \"" & thefolderP...

How to find directories with the name of specific length

How could I find directories with the name of specific length? For example, I have bunch of directories which have length of the name equal to 33 chars ('a92e8cc611fdebcca3cf2fc8dc02c918', 'c442fb3f46d6c8bd17d27245290a9512' and so on). Does find utility accepts condition in form of the 'wc -c'? Or maybe some other utilities should be pi...

How to execute a command with one parameter at a time in the *nix shell?

Some commands like svn log, for example will only take one input from the command line, so I can't say grep 'pattern' | svn log. It will only return the information for the first file, so I need to execute svn log against each one independently. I can do this with find using it's exec option: find -name '*.jsp' -exec svn log {} \;. Ho...

find, replace and escape string linux

I'm trying find all instances of a string and replace them, the original string looks like this: <li><a href="#" onclick="alert('soon!');">Some Text Here</a></li> the replacement looks like this: <li><a href="<?php print $somevar;?>/some.php">Something new</a></li> What would be a good way to do this in the CLI Thanks ...

Checking existence of a file given a directory format in perl

I am struggling with a method of walking a directory tree to check existence of a file in multiple directories. I am using Perl and I only have the ability to use File::Find as I am unable to install any other modules for this. Here's the layout of the file system I want to traverse: Cars/Honda/Civic/Setup/config.txt Cars/Honda/Pathfi...

Bash command to recursively list files but sorting by classification

I often use the excellent find program in Bash to list files with certain filters. For example, in a Subversion (SVN) working copy, I sometimes wish to recursively list all files but excluding the .svn subdirectories as follows: find . -name '.svn' -prune -o -type f -print Today, I wanted to do something similar, but I also wanted to ...

Win32 newbie: Firefox-like find bar

Firefox has this nice find-a-text-on-the-page dialog, which is non-modal and shows up at the bottom of the window. How to do something similar using just Win32? I guess there has to edit control but do I have to position it manually on parent window WM_SIZE? How do I dismiss the dialog, i.e. how to make it disappear? ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix' find command, with which I can find the location of a file in a repository. I know there is svn list, but this gives me a list of all the files in a directory. I want to find the directory a file is in. ...

Find and Add line in text file from batch

I would like to know if anyone can help me with this. I would like to search a text file for a certain line of text, add a new line under the specific line then add text to the new line. I will be using this to edit the firefox.js file to add the line of text to add support for Iprism. It will run on XP and Windows 7 machines. I would l...

Using DISTINCT in a CakePHP find function

Hello, I am writing a CakePHP 1.2 app. I have a list of people that I want the user to be able to filter on different fields. For each filterable field, I have a drop down list. Choose the filter combination, click filter, and the page shows only the records that match. In people_controller, I have this bit of code: $first_names = ...

JQuery select the next element

Hey, I am trying to use JQuery to select the next element in a set of elements with the same class. Here is the HTML setup: <div class="sameClass selected"> <p>Text in here</p> </div> <div class="differentClass"> <p>Text in here </div> <div class="sameClass"> <p>Text in here</p> </div> When I have the first div with the class ...

Don't show uninteresting files in Emacs completion window

How do I prevent Emacs from showing me all the files I'm not interested in (such as ~ backup files, .pyc files, or .orig files) when I: C-x C-f TAB ? It is working in one respect: if I know the file I want to open begins with foo and I type foo TAB then the mini-buffer correctly autocompletes all the way to foo.py. It correctly ignored ...

How to change out-of-focus text selection color in Xcode?

Okay, I'll bite. I've got really pleasant code/window colors set up in Xcode. Ordinarily, my selection color is very visible. When I am doing a project search and iterating through the results, however, the results list stays in focus and the found text remains out of focus, using a different background color. This color is extremely h...