Questions tagged [predicate]
A Predicate is a method which represents a set of criteria and decides for a given object if these criteria are fulfilled or not. In computer languages a Predicate is expressed as a function which takes a single object as input parameter and returns a boolean value.
predicate
1,932
questions
0
votes
0
answers
45
views
Understanding multiple CTE filtering when used in a view
This is the same question as Understanding multiple CTE filtering when used in a view. inPostgreSQL, but for SQL Server and with reproduction code.
An ex colleague of mine has written many highly ...
0
votes
1
answer
44
views
Twostate predicate cannot prove parameter is allocated
Inside of a loop after an array of booleans have been allocated, the invariant allocated(sieve) reports true however, attempting to assert the Preserved predicate on the sieve array after an ...
1
vote
0
answers
14
views
mcfunction command that doesn't work on a chest_minecart but work perfectly on player
I'm new to mcfunction and in the making of datapacks in Minecraft 1.20 and I've got an issue with the GUI I made.
I'm trying to make a menu, where if the predicate I made is true then an item in the ...
0
votes
0
answers
22
views
How do I create a List Section based on an empty related field in SwiftData?
I have three models in SwiftData - a parent Event related to Group and Item. I have a list of all Items by Group that belong to a specific Event. But I can't figure out how to list the Items that ...
0
votes
0
answers
27
views
In swift, one predicate in a compound predicate is causing an exception: 'unimplemented SQL generation for predicate : (altWords CONTAINS[c] "a")'
I have a compoundPredicate:
searchPredicate = NSCompoundPredicate(orPredicateWithSubpredicates: [greekKeyPredicate, englishKeyPredicate, wordNumberPredicate, altWordsPredicate, wordImagePredicate])
...
0
votes
0
answers
16
views
Springboot javax Predicates with JSON array
I've the table "vwt" in the database with a json column, named "tasks". The "tasks" column is structured like this:
[
{
"data":{
"...
1
vote
1
answer
89
views
Getting a compiler error trying to write a complicated Predicate - Scenario 2
This is an additional scenario for the question and answer covered here.
Sample code is available here.
Original problem was related to this predicate:
let aPred = #Predicate<Event> {
...
2
votes
1
answer
175
views
Getting a compiler error trying to write a complicated Predicate
I know there are similar questions out there, like this one for example Combining Predicate in SwiftData but all that looks unnecessary complex to me and I find it difficult to believe that there is ...
0
votes
0
answers
38
views
Join LinqKit.PredicateBuilder across different Tables C#
I am trying to use LinqKit.PredicateBuilder to return if I should display a certain food drink item.
My setup is, I have a FoodDrinkType table, FoodDrinkLink table, Enquiry table, EnquiryVenue table.
...
0
votes
0
answers
31
views
How much exact are the operations in CGAL function "halfspace intersection with constructions"
I want to compare my own algorithm with CGAL's halfspace intersection algorithm in terms of their speed performance. Since I did my own operations with double, I obtain inexact constructions of points ...
1
vote
2
answers
81
views
How to group enum members but keep match exhaustivity check
In Rust is there a way to "group" enum members in a way that I can get a predicate function AND use that predicate in a match statement?
Let's say I have this enum:
enum Number {
One,
...
2
votes
0
answers
83
views
Why autoboxing does not work with Predicate [closed]
I have this code:
System.out.println(test( (int i) -> i == 5) ); // Error here
System.out.println(test( (Integer i) -> i == 5) ); // No error here
private static boolean test(Predicate<...
0
votes
0
answers
82
views
How to replace a triple for loop using the Java 8 streams API
I’m trying to navigate over 3 lists (nested triple for loop) and set some values based on a match. Below is a class representation and also the triple for loops I’m iterating over and doing the ...
1
vote
1
answer
124
views
How to create "ENDSWITH" predicate for SwiftData @Query?
I can create all kinds of predicates fine, but I'm not sure what can I use for implement "ENDSWITH"?
extension Filter {
var predicate: Predicate<WordModel>? {
switch self {...
1
vote
1
answer
245
views
SwiftData predicate when a relationship is optional
Consider the following relationship in SwiftData:
@Model
class Category: Decodable, Identifiable {
var id: Int
var title: String
@Relationship var questions = [Question]()
}
@Model
...