Questions tagged [find]

This tag has multiple meanings. Please DO NOT use this tag if you're just trying to find something.

find is:

  1. a filesystem search tool on various flavors of *nix,
  2. a filesystem search tool on various flavors of DOS and Windows,
  3. the name of a jQuery method,
  4. the name of a family of methods in ActiveRecord,
  5. a function in the C++ standard library,
  6. a method of strings in Python,
  7. a method of Matcher Class in Java.
  8. a method in many different NoSQL's to find documents in a collection.
11183 questions
3
votes
3 answers

CakePHP find returns results with missing fields

I need to get my User info and when I call $this->User->find('first', array('conditions' => array('User.id' => $user_id))); the result contains just some of the fields. I've currently updated database schema. On dev server it runs fine and returns…
Elwhis
  • 1,241
  • 2
  • 23
  • 45
3
votes
2 answers

How to add header to huge amount of files (empty/non-empty)

I need to add header (single line) to huge (>10k) number of text files. Let as assume that the variable $HEADER does contain appropriate header. The command find -type f -name 'tdgen_2012_??_??_????.csv' | xargs sed -i "1s/^/$HEADER\n/" does work…
Jiří Polcar
  • 1,192
  • 9
  • 15
3
votes
1 answer

Matlab, finding common values in two array

I want to find common values in two arrays(For example if A=[1 2 3 4 5 6] and B=[9 8 7 6 3 1 2] the result is ans=[1 2 3 6]).Is there any method without using loop? Thanks
Fatime
  • 197
  • 1
  • 5
  • 15
3
votes
4 answers

How to read/get the CSS background color of a row in a gridview

I have set the background-color of a row via CSS $("#gv tr:has(td)").each(function () { $(this).css({ "background-color": "green" }); }) After this , certain rows have been added How can I loop through the rows and only again find…
Peter PitLock
  • 1,823
  • 7
  • 34
  • 71
3
votes
3 answers

How to make find -name to return error if no file found

I have tried really hard but could not figure out a way to print an error if find -name \"filename" does not find any file. The code I am using so far is as follows: char *argv[]; argv[0]="find"; argv[1]="-name"; …
husnain
  • 31
  • 1
  • 2
3
votes
3 answers

Getting prop('tagName') problems in jQuery

Having a bit of trouble with some strange setups I encountered while working on a bookmarklet for work purposes. I need it to be able to find all the video embeds on a page and process the information to generate JSON code to be inserted in our…
Dadan Perez
  • 31
  • 1
  • 4
3
votes
2 answers

BASH find -name (read variable)

I'm new to bash and have encountered a problem i can't solve. The issue is i need to use find -name with a name defined as a variable. Part of the script: read MYNAME find -name $MYNAME But when i run the script, type in '*sh' for read, there are 0…
user2171053
3
votes
2 answers

Matlab, find index of minimum value with the condition that it must be negative

In a given array, I need to find the index of the minimum value in an array, but only if it is negative. For example : [1, 2, 3, 4] would return no indices and [1, 4, -7, -2] would return 3 I was thinking that it must be simple with the find()…
Gradient
  • 2,253
  • 6
  • 25
  • 36
3
votes
1 answer

doctrine2: select error

I get the following fatal error while calling find method of entityRepository in a custom entityRepository class Fatal error: Uncaught exception 'Doctrine\ORM\OptimisticLockException' with message 'Cannot obtain optimistic lock on unversioned entity…
Factory Girl
  • 910
  • 4
  • 18
  • 29
3
votes
1 answer

Where to patch Rails ActiveRecord::find() to first check collections in memory?

For somewhat complicated reasons, I would like to create something that works like this: # Controller: @comments = @page.comments # comments are threaded # child comments still belong to @page ... # View: @comments.each_root { display @comment…
Sai
  • 6,919
  • 6
  • 42
  • 54
3
votes
2 answers

Unix display info about files matching one of two patterns

I'm trying to display on a Unix system recursively all the files that start with an a or ends with an a with some info about them: name, size and last modified. I tried find . -name "*a" -o -name "a*" and it displays all the files okay but when I…
3
votes
3 answers

UNIX script - find files - show dates

I am running the following command: find . -atime -30 However in the output, I would like it to display the time stamp of access time. Also would like it to show the user that accessed the file if at all possible. Can you help? Thanks.
Thomas Pollock
  • 405
  • 1
  • 3
  • 11
3
votes
2 answers

BinarySearch how to find the value in the array between the two neighbors?

I have a sorted array double. The goal is to Find the index in the Array. Which contains the value of <= the value of search. For example the array contains numbers {0, 5, 12, 34, 100} with index range [0 .. 4]. Search for the value=25. And I want…
Mixer
  • 1,292
  • 3
  • 22
  • 41
3
votes
1 answer

CakePHP find items without HABTM relationship record

Simply put: Tags HABTM Documents Is there a way to find all Tags that don't have a Document associated? I've started with this: $freeTags = $this->Tag->find('all', array( 'conditions' => array( ), 'contain' =>…
Elwhis
  • 1,241
  • 2
  • 23
  • 45
3
votes
2 answers

cmake find_path/find_library failed check

I'm using CMake 2.8.2 version. The project is using lots of external files and custom libraries (unavailable through find_package) and there is a long cascade of elements like the one below: find_path(XXX_INCLUDE_DIR XXX.h /XXX/include) if…
ducin
  • 25,621
  • 41
  • 157
  • 256