Questions tagged [find-occurrences]
435 questions
2
votes
0 answers
Collect search occurrences with rscopus in r?
I have to make a lot of queries on Scopus. For this reason I need to automatize the process.
I have loaded "rscopus" Package and I wrote this code:
test <- generic_elsevier_api(query = "industry",
type = c("abstract"),…

Silvia
- 405
- 4
- 17
2
votes
2 answers
How to count occurrences from two lists of words to determine language in use?
I want to find out the language used from a web page. Here I guess based on some of the words that come in the keyword list.
This script I get from http://www.kangsigit.com/2017/08/php.deteksi-bahasa.html
How this code works is just matching words…

GeeJhon
- 67
- 6
2
votes
4 answers
Occurence of a element in unsorted array by O(n)
This is driving me nuts:(
Problem statement:
An unsorted array is inputed.Next the user gives a collection of numbers and the program should print the occurrence of the given number in that array.
This should run at O(n) time…

Vivek
- 322
- 3
- 14
2
votes
1 answer
Calendar. Recurrent event occurrence. How to check if start date matched on pattern?
If I use google library google-rfc-2445 (to calculate occurrences)
String sRule = "RRULE:FREQ=YEARLY;COUNT=3;INTERVAL=2;BYMONTH=5;BYMONTHDAY=22,23,24,25,26,27,28;BYDAY=MO";
LocalDateIterable localDateIterable = LocalDateIteratorFactory
…

Sergii
- 7,044
- 14
- 58
- 116
2
votes
3 answers
Fast way of counting number of occurrences of a word in a string using Java
I want to find number of times a word appears in a string in a fast and efficient way using Java.
The words are separated by space and I am looking for complete words.
Example:
string: "the colored port should be black or white or brown"
word:…

Alisa
- 2,892
- 3
- 31
- 44
2
votes
3 answers
how to count and print out only duplicates?
I know how to go through whole array, but I only need number of duplicate occurrences. I'm at beginners level, so just basic use of loops and arrays.
int[] array = {12, 23, -22, 0, 43, 545, -4, -55, 43, 12, 0, -999, -87};
for (int i = 0; i <…

SeeSee
- 57
- 7
2
votes
5 answers
Counting number of character occurrences per line
I have a file that looks like this: ( Note : A*, B*, C* are placeholders). The file is delimited by ;
AAAA;BBBB;CCCCCCCC;DD;EEEEEEEE;FF;
AAA1;BBBBB;CCCC;DD;EEEEEEEE;FFFFF;
AAA3;BB;CCCC;DDDDDDDDD;EEEEEEE;FF;
I m trying to write a small script that…

onlyf
- 767
- 3
- 19
- 39
2
votes
4 answers
How to count occurrences in an array of objects by date
I'm searching a powerful solution in TypeScript or JavaScript to count occurrences in an array of object. I'd like to do that by Date. (I need it to create some charts)
For example, i have this array :
var arr = [
{date: Wed Jan 20 2016
…

Vincent
- 33
- 5
2
votes
1 answer
Counting occurence of a word in a text file using R
I try to create a function which returns the number of occurence of a word in a text file.
For this, I create a List which contains all the words of a text. (a, c,, c , d, e, f are here in the example words)
[[1]]
[1] a
[2] f
[3] e …

Fish
- 131
- 2
- 10
2
votes
1 answer
Rolling window or occurrences for 2D matrix in Numpy per row?
Looking for occurrences of a pattern on each row of a matrix, I found that there was not clear solution to do it on python for very big matrix having a good performance.
I have a matrix similar to
matrix = np.array([[0,1,1,0,1,0],
…

iblasi
- 1,269
- 9
- 21
2
votes
1 answer
Aggregate dataframe by user, keeping rows for each user prior to first occurrence of treatment
There are similar problems to mine elsewhere on this site, but none of the answers encompass everything I need to do.
I have a dataframe that I'm trying to change into time varying. Subjects in the study can change from non-treatment to…

Lb93
- 191
- 1
- 12
2
votes
1 answer
Finding occurrences of specific word line by line from text file
I'm trying to read out my text file line by line
FILE *infile;
char line[1000];
infile = fopen("file.txt","r");
while(fgets(line,1000,infile) != NULL)
{
//....
}
fclose(infile);
And then I need to find a specific word, for example "the", and…

jLynx
- 1,111
- 3
- 20
- 36
2
votes
2 answers
Split CSV to Multiple Files Containing a Set Number of Unique Field Values
As a beginner of awk I am able to split the data with unique value by
awk -F, '{print >> $1".csv";close($1)}' myfile.csv
But I would like to split a large CSV file based on additional condition which is the occurrences of unique values in a…

Francis
- 6,416
- 5
- 24
- 32
2
votes
3 answers
How many times "-" at beginning of string (before alphabet letter)
I'm having trouble knowing how many times that the - character is in front of my string.
Some examples:
$string = "-Lorem Ipsum"; // 1
$string = "--Lorem Ipsum"; // 2
$string = "---Lorem Ipsum"; // 3
$string = "--Lorem-Ipsum"; // 2
But how can…

nielsv
- 6,540
- 35
- 111
- 215
2
votes
4 answers
Count consecutive occurence of element in collection
What is the idiomatic way to get something like that?
(fn [coll] (function body) [1 0 -1 -1 -1 0 0 0 0 1 1 1 1 1 0 1 -1])
-> [1 1 3 2 1 4 3 2 1 5 4 3 2 1 1 1 1]
I can only do this in this way.
(fn [coll]
(loop [i 0 r []]
(if (< i (count…

Ribelo
- 205
- 2
- 8