find

moving files recurisively on linux

find ./dir -type f -iname "*.t[argz]*[bz2]" -print | xargs mv --target-directory=dir seems to fail on file that has spaces in the name. how to improve it? or alternative? thanks for answer below: my mv doesn't support --null or -0, I'm using cygwin: $ mv --help Usage: mv [OPTION]... [-T] SOURCE DEST or: mv [OPTION]... SOURCE... DIR...

Searching c++ std vector of structs for struct with matching string

I'm sure I'm making this harder than it needs to be. I have a vector... vector<Joints> mJointsVector; ...comprised of structs patterned after the following... struct Joints { string name; float origUpperLimit; float origLowerLimit; }; I'm trying to search mJointsVector with "std::find" to locate an individual joint...

XCode find caller functions

Hi! how do i find in XCode all caller functions of a specific function? Thanks!x ...

jquery Find ID of dynamically generated tr tag

i have a table with tr containing 10 td elements. The tr are generated dynamically. For eg <tr id = "<?php echo $count; ?>" > <td>name </td> <td>info </td> ... ... <td><a href="delete.php">delete</a></td> </tr> What i wish to do is when i click on delete link , using ajax go to delete page do the needful and then without page refres...

Find a specific class in a file using reflection?

I googled and someone found the answer and linked but it was dead. How can i find a specific class in a specific file? The poster i found ask that question and found how to do it in a namespace but i would like to find one specific to a file. This question is to answer my other question but now that i thought of this i would like to know...

How can I find and replace text in XML using Perl?

My XML file looks something like this: <doc> <RU1> <conf> <prop name="a" val="http://a.org/a.html&gt; </conf> </RU1> <RAU1> <conf> <prop name="a" val="http://a.org/a.html&gt; </conf> </RAU1> <RU2> <conf> <prop name="a" val="http://a.org...

PHP: get current array key?

$array = ( array('1231415'=>array('foo'=>'bar', 'test'=> 1)), array('32434'=>array('foo'=>'bar', 'test'=> '0')), array('123244'=>array('foo'=>'bar', 'test'=> 0)), array('193928'=>array('foo'=>'bar', 'test'=> 1)) ); I have an array that has (many) random keys, the ID number. I need to test each array within if 'test' = ...

How can I combine record results in Rails?

So I have two separate queries: tagged_items = Item.tagged_with(params[:s], :on => :tags) searched_items = Item.find(:all, :conditions => ["MATCH(title) AGAINST (? IN BOOLEAN MODE)", "*#{params[:s]}*"]) The first tagged_items is using the acts_as_taggable_on plugin to find all the items tagged with XYZ. The second, searched_items, is...

shell Find question

Hi sorry for asking simple shell question again but my TA in school doesnt check the school forum so I never get any answer, please help me again, thanks anyways: I am trying to use array to store a list of file names using the Find command, but for some reason the array fail to work in the bash used by the school, my program works on ...

Find and Hide element (jQuery)

<a href="#">Hide Me</a> How do I find a link with text "hide" in it. I know how to find links by attributes but can't figure out how to find link by its text. ...

Find and Replace

I have a table that I screen scraped using the jQuery load function, the function returns a table with text and graphics. The website I scraped from uses relative paths for their images so when I return the code to my page the images are not showing up. I have been looking for a jQuery function to find the tag and either update it to ad...

Filtered tasklist piped into find doesn't show console output?

Windows XP Pro This shows output in the console: dir | find " free" This doesn't: tasklist | find "Image Name" This does: tasklist | find /C "Image Name" And this does write the expected line into the file: tasklist | find "Image Name" > foo.txt What causes that? ...

tricky string matching

I want to find the first index of substrings in a larger string. I only want it to match whole words and I'd like it to be case-insensitive, except that I want it to treat CamelCase as separate words. The code below does the trick, but it's slow. I'd like to speed it up. Any suggestions? I was trying some regex stuff, but couldn't f...

Selecting and Displaying Columns from Associated Tables in Rails

I am working on developing a skeleton of what to eventually become an administration dashboard. One of the things the dashboard will eventually have to do is allow users to search for users of a game and view information about them. The information about them in question is in different table so naturally I have had to employ associati...

PHP: How do I check the contents of an array for my string?

Hi, I a string that is coming from my database table say $needle. If te needle is not in my array, then I want to add it to my array. If it IS in my array then so long as it is in only twice, then I still want to add it to my array (so three times will be the maximum) In order to check to see is if $needle is in my $haystack array, do...

Best way to handle list.index(might-not-exist) in python?

I have code which looks something like this: thing_index = thing_list.index(thing) otherfunction(thing_list, thing_index) ok so that's simplified but you get the idea. Now thing might not actually be in the list, in which case I want to pass -1 as thing_index. In other languages this is what you'd expect index() to return if it couldn...

find all subversion working copies on machine

How could I use find unix utility to find all working copies on the machine? For example, I can use find / -name .svn -type d command, but it outputs all redundant results (a lot of subfolders), while I need only parent directory of working copy to be shown. There is related question, but it does not really help in my case: http://stac...

Jquery - How to find an element using class and attribute.

I am trying to figure out the most efficient way to find my element. Following i smy structure: <div class="a" customattrib="2"> in order to find this element can I do something like : $("div.a [customattrib='2']") This does not seem to work, is there another way to do this? Without the class I am able to get the value but I do no...

Find if the element contains x but not y (jQuery)

<div> <p><a href="#">link</a> some text</p> <p><a href="#">link</a></p> <p><a href="#">link</a> some text</p> <p><a href="#">link</a></p> </div> I want to find (and addClass to) the <p> tags that DO NOT contain text, directly inside itself or its children. ...

using mdfind how can I append an mv command to the result and escape spaces?

Using apple os 10.5.x I am trying to hunt down font files and move them on client workstations. So far I have: mv $(mdfind -onlyin ~/Desktop/fontRm/ "kMDItemContentType == '*ont*'" | sed -e 's/ /\\ /g') /Users/chrihopk/Desktop/target/ I'm struggling with getting the sed command to escape the spaces before the mv command executes. Tha...