» Home » find » Page 1
Avoiding making multiple calls to Find.find(“./”) in Ruby
by Steven Weber in Programming Languages

I am not sure what is the best strategy for this. I have a class, where I can search the filesystem for a certain pattern of files. I want to execute Find.find("./") only once. how would I approach this:

def files_pattern(pattern)
Find.find("./") do |f|
if f.include? pattern
@fs << f

Find a C# HTML parser find all <script> and give me the line and position info
by Andrew in C & C++ & C#
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<a href="aaa.asp?id=1"> I want to get this text </a>
var test=function()

CakePHP find command warnings when calling find despite return data correctly
by unadopted in Programming Languages

I'm getting the following errors:

Warning (2): array_keys() expects parameter 1 to be array, null given [CORECakeModelDatasourceDboSource.php, line 2181]

Warning (2): array_filter() expects parameter 1 to be array, null given [CORECakeModelDatasourceDboSource.php, line 2185]

Warning (2): array_values() expects parameter 1 to be array, null given [CORECakeMode

Linux: Using find and grep to find a keyword in files and count occurrences
by pulkizine in Operating Systems

I'm using executing this bash commands inside a search script I've built with php:

find myFolder -type f -exec grep -r KEYWORD {} +
find myFolder -type f -exec grep -r KEYWORD {} + | wc -l
find myFolder -type f | wc -l

The first line gives me back the filenames where KEYWORD was found.

The second line gives me the number of occurrences

How to Create HTML jQuery Find Tool Similar to MS-Word Find
by destrekor in Programming Languages

Someone wants me to create a find tool with jQuery similar to Microsoft Word's find tool -- with Next and Previous buttons. Luckily the HTML content being search should just be a single, small static HTML page. So i doubt there would be server-side involvement.

Are there any jQuery widgets out there that do this kind of thing? Or does someone have examples (or high level descriptio

Rails: Converting from MongoMapper to Mongoid: Why can't I find models by :_id using Model.find?
by ancapdev in Development Tools & Services

On Rails 3.1 with Mongoid 2.4, BSON 1.5

I am having trouble finding a model by :_id using Mongoid's Model.find

Using where:

>> Athlete.where(:_id => BSON::ObjectId.from_string('4f2b22d70f67e90001001edd')).first
=> #<Athlete _id: 4f2b22d70f67e90001001edd, ...>

Using find:

>> Athlete.find('4f2b

jQuery if($(element).find(selector)) stops script on failure to find
by socurious in Programming Languages

as part of a script i am working on i have the following:

{ do stuff }
{ do other stuff }

The idea is that there are two versions of the elements getting looped and I need to distinguish between them (based on content) to determine which actions to take.

This works great if fin

CakePHP find all generates SQL that returns duplicate records (with same ID). Find list does not
by Bado in Databases

So, this code below:

$friends = $this->find('all',
'conditions' => array(
'User.id' => 102
'contain' => 'Profile'

Generates this SQL:

SELECT `User`.`id`, `User`.`sForceId`, `User`.`householdId`,

linux + find mechanism with Irregular Expression (find command) or perl
by baylisscg in Programming Languages

hi dear friends and good morning

The following question may be complicated and critical for my systems

I have 4 Linux machines with cluster

My target is to find all kind of IP address (xxx.xxx.xxx.xxx) in every file in the linux system

remark: need to scan each file in the linux system and verify if the file include IP address if yes need to prin

Find number of distinct values in a specific column in a Rails find
by cerebusPu in Programming Languages

I am doing a find in Rails model as follows:

@jobs = Job.find(:all, :conditions => ["job_id = ?", params[:id]])

The result of this query also brings back data from an associated model JobResponses (there are multiple JobResponses for each Job record). Once I have the JobResponse results I am calculating a number of different averages/medians etc for each set of Job results.


Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .