Questions tagged [operator-keyword]
In several languages, the operator keyword is used to identify methods which will be used in operator overloading.
2,700
questions
-1
votes
2
answers
93
views
java and Arithmetic Operators and Increment [duplicate]
It is one of the simple operations and I do not understand why and I just save it, but this bothers me, so I want to understand why?
int a = 2;
int b = 4;
int c = 10;
a = b++;
System.out.println(a);
a ...
0
votes
1
answer
34
views
Mendix Java ERROR: operator does not exist: bigint = character varying Hint: No operator matches the given name and argument types
After upgrading to v9 in Mendix, one of our Java actions is causing an error.
The error can be seen below:
ERROR: operator does not exist: bigint = character varying
Hint: No operator matches the ...
-2
votes
0
answers
30
views
How to overload(override) cin operator >>? [duplicate]
I want to design that something particular character entered, console output "good"
string x
int y
cin>>x
cin>>y
in this program, if (x and y are all) == "0", i want to ...
0
votes
0
answers
13
views
How to express the fact that one property occurs in one path before another property in CTL?
I would like to express the fact that there is a path where the "p" property occurs before the φ goal, in CTL as shown in the following figure.
For this I thought of the formula ∃(∃◇p U ∃◇φ ...
2
votes
1
answer
28
views
Generic type BoundedComponent struct
I want to do a struct for boundedElements like number that has a max and min value. However I'm stuck on how to do this.
Here is an example of a property. The setfield method is just a method to set a ...
0
votes
1
answer
53
views
Orion-ld fails to establish a connection with the MongoDB Community Operator due to a connection string issue
I am attempting to connect Orion-LD to the MongoDB Community Operator in a Kubernetes (k8s) environment, but I am encountering the following error:
time=Friday 06 Oct 15:25:17 2023.339Z | lvl=WARN | ...
0
votes
0
answers
26
views
What will the output of -22 % 5 in python [duplicate]
I tried this in python its output is 3 but how?
It's answer should be -2.
result = -22 % 5
print(result)
.
0
votes
1
answer
39
views
Why won't my bool variable change its value
So, i'm having a hard time with this code i wrote. The way it should be working is switching the bool is_on variable between True and False, and while is_on is True, it keeps printing some text. ...
0
votes
1
answer
23
views
Error in angle_model$edd : $ operator not defined for this S4 class
This seem to be a recurrent error message but solutions seem to be rather case specific for what I'm seeing (I'm starting with R so every step is difficult for me still). I'm following the script for ...
0
votes
0
answers
50
views
(a>b)||(a<b) - or logical operator - what does it do?
I'm struggling to understand what the following command is checking.
(a>b)||(a<b)
I have defined a as 8 and b as 3. The returning result is TRUE.
Is this checking whether
a>b is true; or
a ...
0
votes
1
answer
41
views
How to collect only logs for an operator setup?
I am trying to assist a customer in enabling only log collection for their kubernetes setup. We have documentation that shows this for a Helm chart, but with the operator, I'm not certain where this ...
0
votes
1
answer
55
views
Airflow 2.5.3 - invalid source format 'parquet' is not valid value
I'm migrating to Composer version 2.4.1 and AIrflow 2.5.3. Some DAGS that I use the BigQueryCreateExternalTableOperator are returning an error when creating the external table, I am passing the file ...
-4
votes
2
answers
152
views
Making integer caculator using operator overloading but not work [closed]
I'm making integer calculator using C++.
Why is the following not working?
#include <iostream>
#include <string>
using namespace std;
class Number {
int i;
public:
Number(int i) ...
0
votes
1
answer
53
views
Option Strict On prohibits operands of type Object for operator '&' in vb.net
I have an error in the code below if I make the strict option to ON but if I make it OFF then the error does not appear. How can I use without error with the strict option being on?
Thanks
Dim Invno ...
0
votes
0
answers
19
views
Regarding implicit conversion to byte and compiler errors with byte addition [duplicate]
byte b = (int) 10; // Does not throw a compiler error
byte b1 = 10;
byte b2 = 20;
byte b3 = b1 + b2; // throwing Compiler error
Why does the compiler give an error on line no 4 and not on line no 1.
...
1
vote
0
answers
62
views
ostream operator<< resolution fails when used from different namespaces
I made overload for ostream operator<< for std::vector in namespace printable.
As far as I understand, ADL will not see this overload implicitly, because std::vector is not a member of printable,...
2
votes
5
answers
288
views
Unpack / pack operator
I'm looking to find various ways that a packing / unpacking operator is implemented. As an example:
*[1,2,3] --> 1,2,3 (one array scalar value unpacked to three values)
*1,2,3 --> [1,...
0
votes
1
answer
132
views
Bitnami Grafana-operator persistence problem
I am trying to deploy bitnami/grafana-operator to AKS with persistence. I want to be able to create Dashboards in UI and they to be persistent. I am using Helm chart, where the persistence.enabled is ...
0
votes
3
answers
45
views
using typeof operator in string interpolation to check data type of variable when running the code output is not coming correct
let num = 1
let st = 'data'
console.log(typeof `${num}`, typeof `${st}`)
the output of the first variable should be number but it's printing string when I am using string interpolation console....
0
votes
0
answers
54
views
Can operator overloading solve the compiler error when calling a function with pointers to a vector of vectors in C++?
#include <string.h>
#include <vector>
#include <iomanip>
using namespace std;
void JoinRows(double *C, double *A, int nrows, int ncols, double *B, int mcols);
// Function to join ...
0
votes
1
answer
56
views
Airflow operator to run multiple Big Query Job
I'm trying to run an IF ELSE statement in Airflow that involves delete and insert of dataset based on the what is the current month.
I have tried to use BigQueryInsertJobOperator but it doesn't allow ...
0
votes
0
answers
15
views
MSVC natstepfilter - how to exclude "operator new"?
I have custom global new operator (without any namespace):
void* operator new(size_t nSize)
{ ... }
I am trying to exclude it from debugging by using .natstepfilter file:
<StepFilter xmlns="...
0
votes
0
answers
55
views
I have a question about C Operator Precedence and Associativity. Newbie. Help me [duplicate]
I am a newbie to C programming. Now, I am trying to understand the topic "C Operator Precedence and Associativity". Especially, I would like to pay attention to the order of evaluation with ...
0
votes
1
answer
35
views
How to make an addition with types byte and short
I saw in previous questions that it is impossible to make a direct addition without a cast but...
How do you explain that this following tip works?
byte startValue = 2;
byte addingValue1 = 7;
byte ...
-3
votes
1
answer
202
views
In javascript, is "0" falsy or truthy? [duplicate]
In JS, it's not clear if '0' is truthy or falsy.
So, we have :
Boolean('0') == true, because it's a non-empty string.
But: ('0' == false)
The brain-itching starts from here :
(!'0' == false)
And then ...
0
votes
1
answer
29
views
why does java cant figure out data type of "result2" without type casting it as it figure out datatype of "result1"? [duplicate]
int result1 = 10;
result1 -= 5.5;// due to compound assignment this will not cause error and result will be 4
System.out.println(result1);
int result2 = 10;
result2 = (int) (result - ...
0
votes
1
answer
255
views
Aiflow: how to delete file on SFTP using Apache Ariflow operator?
Is there any way to delete specific file on SFTP server using Apache Airflow Operator.
I checked SFTPOperator but it support only put/get operations. If not how I can create my own custom operator and ...
0
votes
1
answer
44
views
Java: instanceof doesn't compile [duplicate]
I'm a newbie to Java and want to write a method checking if this object is of a sub class of given class <p_SuperClassName>.
Eclipse denies compilation of the following code giving the message ...
0
votes
0
answers
49
views
Error in R "$ operator is invalid for atomic vectors" despite using $ on the code
I used Spotify API to extract data about BTS.
library(Rspotify)
library(spotifyr)
library(magrittr)
library(igraph)
library(dplyr)
library(knitr)
library(ggplot2)
library(ggridges)
library(httpuv)
...
1
vote
1
answer
113
views
How does this function change a constant reference?
I can't work this simple problem out.
I have a class called Directory, and I am having a problem with operator overloading.
The Class:
class Directory
{
private:
std::string path;
...
1
vote
3
answers
94
views
Derive operators from a "base" operator - Speed penalty
My professor stated, that one could derive "all" operators for an iterator from a single "base" operator without a speed penalty due to inlining.
He stated:
// To implement ==, != ,...
2
votes
2
answers
238
views
The new operator return value in C#
In C#, a new operator can be used to init an object of specific type (class). For example, consider we have a Person class, the following code create an object instance from Person class:
Person ...
1
vote
0
answers
69
views
Does Bash execute commands sequentially or in parallel when operators(and, or) exist?
I understand when commands with pipes, they are executed in parallel by bash.
( cat sth | grep ho | cat )
But when the commands with '&&' or '||' operators, I thought the commands are executed ...
0
votes
0
answers
16
views
Simplify condition with && operator
I'm kind of too stupid at the moment to simplify a certain condition.
I've been sitting there for two hours now and just don't understand why these two pieces of code don't do the same thing:
...
2
votes
1
answer
455
views
Concatenate conditions with array formula and sumif in google sheets
I'm trying to make a sumifs with an array formula using sumif like this
=arrayformula(if(len(B2:B)=0;;sumif(DATOS!B:B&DATOS!S:S&DATOS!A:A;B3:B&T2&11;DATOS!G:G)))
The formula works ...
0
votes
2
answers
53
views
About an order of calling overloaded functions of operator []
I was making my own bound-checking array class, but I got a problem that it is unable to call the appropriate overloaded function when using the operator [].
The first overloaded operator [] is for ...
1
vote
1
answer
126
views
python operator overloading implement: __ge__ using __gt__ and __eq__
I am overloading the operator methods.
Is it ok to implement __ge__ using __gt__ and __eq__ ?
Why is it good/bad practice ?
def __gt__(self, other):
pass
def __eq__(self, other):
pass
def __ge__(...
0
votes
0
answers
27
views
why does var++ not work but var + 1 works in the following code I wrote? [duplicate]
This function is supposed to output 0 if value passed in is larger than 100 and return (value+1) if the value passed in is lesser than 100.
const counterFunc = (counter) => (counter>100 ? ...
-2
votes
2
answers
2k
views
Is there a spread operator for golang structs [duplicate]
Have the following structs where PostInput is a param for a createPost function.
type PostInput struct {
Title String
Content String
}
type PostInputWithTime struct {
Title String
Content ...
0
votes
1
answer
96
views
C++ Template function chagneable return type
I have the template struct
template <class T>
struct Vector2
{
T x, y;
};
with the following function overloading the + operator
template <typename T1, typename T2>
Vector2 operator+(...
0
votes
3
answers
52
views
APL2, order of processing each operator arguments
Assuming the user function:
∇ f b
[1] b
∇
and the following is executed:
f¨1 2 3
Three lines will display, 1 digit per line. In APLX the order is 1 2 3.
Is there any APL2 guarantee the order the ...
0
votes
1
answer
85
views
PHP shorthand for combination of ?? and ?: operators?
is there any "beautiful" shorthand in PHP to use ?? and ?: operators together?
I often check something for array keys to exist and to "evalutate to TRUE" in web apps, e.g. for ids, ...
1
vote
1
answer
223
views
The differences of move and la in MIPS?
I'm a beginner of the MIPS. In my opinion, in MIPS move means transfer the value of a register to another, la means transfer the address of a register to another. But the result of the code really ...
1
vote
0
answers
199
views
Macbook and iMac Assignment Operator (<-) Shortcut (Option with -) Not Working in RStudio
"-" with the "option" key (refers ALT key) had been used as the assignment operator. Since RStudio became POSIT the combination of these buttons not just working in RStudio. But ...
0
votes
1
answer
78
views
Postgres error when using this query:- postgres ERROR: could not identify an ordering operator for type record
While running the following query Im getting this error
Message: Summary: ERROR: could not identify an ordering operator for type record Hint: Use an explicit ordering operator or modify the query. ...
-2
votes
1
answer
86
views
how does "is" identity operator work in python?
here is my code
x = 5
y = 5
print(x is y)
print(id(x))
print(id(y))
and the output is
True
1903991482800
1903991482800
I don't know why x and y have the same location here
please help me illustrate ...
1
vote
0
answers
33
views
Is there a keyboard shortcut for the R internal pipe operator |>? [duplicate]
For the pipe operator, %>%, I can set a shortcut. Can I also set a shortcut for |> as well?
Thank you!
0
votes
0
answers
31
views
The operator+ overloading unwanted side effect [duplicate]
Tried to overload operator+ but looks like there is an unwanted side effect, it modifies one of the arguments. How am I supposed to do it?
#include <iostream>
#include <string>
#include &...
0
votes
1
answer
221
views
JS three dot operator in Array [duplicate]
I am wondering what does this three dot operator do in this case:
const csv = [
columns
...data
].map((row) => {
return Object.values(row).join(",&...
0
votes
0
answers
44
views
I can't redefine operator[] for const structure [duplicate]
A have the following code:
struct abc {
abc(int a) : a(a) {}
int operator [] (int t) {
return t;
}
int a;
};
int main()
{
abc const abc1(25);
int c = abc1[...