Google Calendar API. Search Events by multiple extendProperty Private by Or Condition - events

In this post:
- https://developers.google.com/calendar/extended-properties I see:
"You can repeat these fields multiple times and the constraints are OR'ed together, so events only need to match one of the constraints to be returned. The following example finds events with either the private property petsAllowed=yes or isOutside=yes:"
But when I post array private key on Events.List. It must match all.
- https://developers.google.com/calendar/v3/reference/events/list
"Extended properties constraint specified as propertyName=value. Matches only private properties. This parameter might be repeated multiple times to return events that match all given constraints."
How can I search with conditon "Or"?

Related

Can validations be group with When for a FluentValidation RuleBuilder?

Here is an hypothetical example of some existing code using a FluentValidations RuleBuilder. Note that the first two validations use the same condition. Is it possible to group them together with When? It does not seem to be available directly off of the RuleBuilder instance but is there another approach?
return ruleBuilder
.NotEmpty().WithMessage("This field is required")
.When(someConditionIsTrue)
.Matches(new Regex("^(\\d{5})", RegexOptions.Compiled, _timeLimit))
.WithMessage("Must be a valid postal code.")
.When(someConditionIsTrue)
.MaximumLength(10).WithMessage("Text must be 10 characters or less");

Sorting an Acumatica data view on a string field, but using binary collation

I have overridden the APPrintChecks data view to sort by Vendor Code. But since the client's VendorCodes are all numeric, they would like to see the checks sorted so that, for example, VendorCode '357' is printed before VendorCode '10021'.
Any ideas on how I can accomplish that?
public class APPrintChecks_Extension : PXGraphExtension<APPrintChecks>
{
//change sort from Vendor Name to Vendor Code
[PXFilterable]
public PXFilteredProcessingJoin<APPayment, PrintChecksFilter,
InnerJoin<Vendor, On<Vendor.bAccountID, Equal<APPayment.vendorID>>>,
Where<boolTrue, Equal<boolTrue>>,
OrderBy<Asc<Vendor.acctCD, Asc<APPayment.refNbr>>>> APPaymentList;
}
As per suggestion in the comments, I would first check if there is another numeric/date field you can sort on such as BAccountId or CreatedDate. If this will not do, you will need to find a more creative way to fix it such as:
Changing Vendor Code Numbering Sequence to include leading zeros,
example: 0000357, 001021
Adding a custom field (which is stored in the database) and setting this custom field in the graph to include the leading zeros. Example
add field UsrVendorCode of type string where you add the leading
zeros in an event (of the Vendor Graph) such as RowPersisting.
Adding a calculated database field to add leading zeros and adding this as a custom field (extension of Vendor) in Acumatica (not sure
whether this is fully supported by Acumatica since it requires
modifications in DB)

How to dynamically create bindings using "Declarables" in RabbitMQ Spring Framework

My code gets user's input which is a list of routing keys and use them to bind a queue with an exchange. I use Declarables to generate the bindings for each routing key. The problem is, the number of routing keys that the user inputs varies each time. Considering the list of routing keys are on an array, how to bind a queue to the exchange with those routing keys. Below is my current code.
#Bean
public Declarables bindings() {
return new Declarables(
BindingBuilder.bind(queue()).to(exchange()).with(routingKey[0]),
BindingBuilder.bind(queue()).to(exchange()).with(routingKey[1]),
BindingBuilder.bind(queue()).to(exchange()).with(routingKey[2])
);
}
EDIT - adding exact use case for more clarity:
I'm using rabbitmq event exchange plugin to consume internal events(https://www.rabbitmq.com/event-exchange.html). I'm creating a queue and binding it with an exchange(amq.rabbitmq.event) that is created by the plugin. Different types of events can be consumed by binding respective routing keys.
I get the list of routing keys from the user each time and bind it to the exchange amq.rabbitmq.event and consume respective events(e.g. queue.created, user.authentication.success, etc). User adds all the routing keys as a comma separated value in application.properties file. I parse it and add these values to an array and create bindings for all the elements(routing keys) in this array. The size of this list is not constant. User may input 3 routing keys or 5 or a different number of keys each time and I have to create a binding for each of the routing key.
In the code above, bindings are created for 3 routing keys(routingKey[0], routingKey[1] & routingKey[2]). What if user inputs more than 3 routing keys and how to create bindings for all of them.
the number of routing keys that the user inputs varies each time.
It's not clear from your description whether you need a variable number of routing keys statically or dynamically.
You can use RabbitAdmin.declareBinding(...) to declare bindings at runtime (dynamically).
However, this should NOT be used within a #Bean definition.
EDIT
Based on your updated description; Spring will automatically convert a comma-delimited list to a List.
routing.keys=foo,bar,baz
#Bean
public Declarables bindings(#Value("${routing.keys}") List<String> keys) {
return new Declarables(keys.stream()
.map(key -> BindingBuilder.bind(queue()).to(exchange()).with(key))
.collect(Collectors.toList()));
}

GetStateByPartialCompositeKey by a specific key not working

Currently I'm working with Hyperledger chaincode,
I have a problem with the method "GetStateByPartialCompositeKey".
They index consists of 3 parts (key1~key2~key3).
If i try GetStateByPartialCompositeKey(index, key1) , it works perfectly.
But If I try to search for another key, like GetStateByPartialCompositeKey(index, key3), nothing is returned. Although the key is actually saved. How do I solve this problem?
Refer: https://godoc.org/github.com/hyperledger/fabric/core/chaincode/shim#ChaincodeStub.GetStateByPartialCompositeKey
As mentioned in the description of the method, "This function returns an iterator which can be used to iterate over all composite keys whose prefix matches the given partial composite key."
This method needs to have the prefix i.e. the first half of the composite key to match. Even though the method name may state partial key, it only works with the prefix of the composite key and not any part of it.

Smartgwt : localfiltering on a selectItem

I have a Rpc Datasource providing a list of objects. I have two selectItem databound to this datasource but each showing a different attribute.
For one of these attributes I have a duplicate value which are enabled by design.
However in the SelectItem related to this field I would like to remove duplicate to simplify the user choice(reduce the list length and also it seems strange to have double values..)
I think I can arrived to do it using lodal filtering but I cannot find the point to start to write the right citeria.

Resources