Questions tagged [operators]
Operators are symbols that occur in nearly all programming and coding languages, used for performing calculations, comparisons, and assignments of data. Use this tag for any questions relating to operators, in any language, including things such as syntax, behaviour and use.
operators
735
questions with no upvoted or accepted answers
7
votes
1
answer
2k
views
prometheus loop over values of range or instant vector and apply functions
Assuming I have a promQL returning a range or an instant vector:
range vector -> metric[1h] or instance vector -> increase(metric[1h])
Is there a way to convert range into instant vector and/or vice ...
7
votes
1
answer
6k
views
Angular 6 unit test rxjs 6 operator tap unit test interceptor
Since I update my code to the new Rxjs 6, I had to change the interceptor code like this:
auth.interceptor.ts:
...
return next.handle(req).pipe(
tap((event: HttpEvent<any>) => {
...
7
votes
1
answer
8k
views
passing a stringstream to istream using operator >>
I am trying to pass a stringstream into an object(class) that has an overloaded extraction operator >> that is declared and defined. For example, the declaration for the overloaded extraction ...
6
votes
0
answers
441
views
Swift operator defined in multiple libraries; "ambiguous"
I am have to external libraries I am using in an iOS project
pod 'SQLite.swift', '~> 0.10.1'
pod 'ObjectMapper', '~> 1.3'
In a class, I am trying to use both:
import Foundation
import SQLite
...
5
votes
1
answer
325
views
C# 7.2 use of "in parameter" for operators
In C# 7.2, we saw the introduction of the in modifier for method parameters to pass read-only references to objects. I'm working on a new .NET Standard project using 7.2, and out of curiosity I tried ...
5
votes
0
answers
199
views
Rotation of a volume tensor in tensorflow
I'm trying to apply a rotation to a 4 dimensional tensor in Tensorflow. I have a tensor of dimension (batch_size, x_length, y_length, z_length) and I've a rotation matrix (3,3), how can I apply a ...
5
votes
4
answers
3k
views
How do you define an operator in prolog to make a list?
I want to define an operator "++>" in a way so that typing "a ++> b" will make a list of [a,b].
I've written the following code, but it doesn't appear to do the job.
++>(X,Y) :-
[X,Y].
:- op(...
4
votes
0
answers
861
views
using stream operator<< with std::endl in c++
I am trying out the following C++ class for using the stream operator << to log contents from this answer:
class Log
{
public:
Log()
: m_filename( "dafault.log" )
{}
...
4
votes
0
answers
243
views
Trouble with operator overloading and inferred types in Swift
Literals
Swift has a couple of literals that can be used to initialize different types without explicitly calling their initializer. For example,
let x = 5 // x is now an Int
...
4
votes
1
answer
621
views
Very automatic operator generator in C++
C++ has a nice idiom that allows one to write classes that automatically fulfill certain relations between operators. For example this allows to define operator== and not bother to defined operator!= ...
4
votes
1
answer
4k
views
How to select all elements of a list at a particular nested Level?
Or put it differently: How can I use the [[ operator in a nested list?
You can consider this as a follow-up question on this one, when I asked how to determine the depth level of a list. I got some ...
3
votes
0
answers
260
views
Prolog operators = is =:= == \+
Im making a list to remember the different operators
I was wondering:
A) is the list correct so far?
B) is there an opposite of the "is" operator?
% Does it unify??
a(X, Y):- X = Y.
% X = ...
3
votes
0
answers
262
views
Streaming pipeline on Apache Flink runner (parallelism and grouping of tasks written using Apache Beam)
I am already having a stream pipeline written in Apache beam. Earlier I was running the same in Google Dataflow and it used to run like a charm. Now due to changing business needs I need to run it ...
3
votes
0
answers
69
views
Different results for postfix operator (x++) in PHP and JavaScript
I'm learning web development, and I got puzzled by the strange behavior of a certain code in JavaScript and PHP.
JavaScript
n = 10
n = n - n++
console.log(n) // outputs 0
PHP
$n = 10;
$n = $n - $n++;
...
3
votes
0
answers
100
views
Does a '+' before the first column is ignored or has an impact?
This is not really a problem but just want to not stay in ignorance if this operator may have an impact of a query.
To make it simple, I had a query like :
SELECT 'A', + 'B'
The expected result was '...