Questions tagged [remove-if]

Common Lisp 'remove-if' function.

Common Lisp 'remove-if' function.

It's signature is:

remove-if test sequence &key from-end start end count key => result-sequence

CLHS: remove-if

201 questions
1
vote
1 answer

Delete some entries of a list or array in bash

I want to apply a function, of Python, to all files in sub-directories of a given directory. In bash, .sh file, I list all files like so: dir_list=() while IFS= read -d $'\0' -r file ; do dir_list=("${dir_list[@]}" "$file") done < <(find…
OverFlow Police
  • 861
  • 6
  • 23
1
vote
2 answers

Using jq to remove items from an array based on values elsewhere in the input

I'm new to jq and trying to wrap my head around doing a few things that I thought were going to be straightforward. Any ideas on how to improve this would be greatly appreciated. Given this input: { "source": { "items": [ {…
user774031
  • 346
  • 3
  • 9
1
vote
0 answers

Dropzone event before removing a file

In dropzone we have a removedFile event, which is fired after file is removed. What I need is an event that is fired before file is removed, so that I can trigger removal from server and if it succeeds then will remove a file from dropzone,…
Suren Aznauryan
  • 984
  • 10
  • 24
1
vote
1 answer

reference to nonstatic member function must be called with remove_if in c++

I can use the remove_if function with the test() function below. However, when I try to pass an object to remove_if, I get the error mentioned in this post's title. I personally think the error has something to do with variable/function scope. my…
girvain
  • 19
  • 1
  • 5
1
vote
1 answer

Calling a Non-Static function as Predicate?

I would like to use a function that is not static as a predicate. Unfortunately I recieve an error complaining about it being non-static and I am unsure how to approach this. Error: error: call to non-static member function without an object…
Potion
  • 785
  • 1
  • 14
  • 36
1
vote
1 answer

How to properly Use remove_if?

I am attempting to use the remove_if for an array. The array contains objects of songs which contain 2 string properties (artist and title). I have a bool equals operator but have issues with implementation. Below is my Song equals operator: bool…
Potion
  • 785
  • 1
  • 14
  • 36
1
vote
2 answers

Remove elements in a string separated by commas in groovy

I am building a string in this way: def presentationType = "${feedDisplayType}, ${moduleType}, ${cellType}" What happens is that sometimes the variables has null values, and the resulting string is showing this null values, I have to avoid show…
rasilvap
  • 1,771
  • 3
  • 31
  • 70
1
vote
2 answers

Drop an element from a list (drop row from list of lists)

I have a 2d array like this one: list_of_data = [ ['Joe', 4, 4, 4, 5, 'cabbage', None], ['Joe', 43, '2TM', 41, 53, 'cabbage', None], ['Joe', 24, 34, 44, 55, 'cabbage', None], ['Joe', 54, 37, 42, 85, 'cabbage', None], ['Tom', 7,…
TJE
  • 570
  • 1
  • 5
  • 20
1
vote
5 answers

Determine empty

I would like to determine when the
    tag is empty after removing
  • tags. Can someone help me? There is a html code: $(document).on('click', '.close', function(e) { $(this).parent().fadeOut("normal", function() { $target.remove(); …
1
vote
6 answers

How do I remove the beginning elements of my array only if the first element satisfies a condition?

In Ruby, let's say I have an array of ordreed, unique numbers [0, 1, 2, 4, 6, 8, 10] If the first element of the array is zero, how do I remove all the elements from teh beginning of the array that are consecutive, starting wiht zero? That is, in…
user7055375
1
vote
1 answer

Best way to remove cache entry based on predicate in infinispan?

I want to remove few cache entries if the key in the cache matches some pattern. For example, I've the following key-value pair in the cache, ("key-1", "value-1"), ("key-2", "value-2"), ("key-3", "value-3"), ("key-4", "value-4") Since cache…
Sri
  • 4,613
  • 2
  • 39
  • 42
1
vote
1 answer

Remove-if-not in Racket

In Common Lisp there is a famous built-in function called remove-if-not. I could not find this on Racket`s documentation. Did I miss something? Does Racket offer this function with a different name?
user7120460
1
vote
0 answers

How to retrieve a String from a different class file and then add that String to an Array then remove certain words if they appear more than once

I've been stuck on this problem for a few days and can't find any answers to this question. It's slowly driving me insane. I need to make a two methods, one that add that word to the Array Word[] words and one that removes it if the word occurs more…
Alex
  • 11
  • 2
1
vote
1 answer

Gathering elements in range of Min and Max values from a list in Scheme

I am new to Scheme and not currently using (Racket version), therefore I do not have such built in functions as filter and etc. My task for now is to get elements out of my inputted list, and take out of it only those that are above my MinValue and…
Sparrow
  • 17
  • 6
1
vote
4 answers

In C++, removing an object from a list

I'm writing a program which is more or less like this : #include list things; class MyClass { // some stuff void remove() { things.remove_if(THING_IS_ME); } }; What do I need to write instead of THING_IS_ME? In…
interstar
  • 26,048
  • 36
  • 112
  • 180