Questions tagged [operand]
177 questions
1
vote
1 answer
Trying to define a == and != operator for my struct, but I keep getting the "Operator `==' cannot be applied to operands..."
I am trying to implement cartesian 2D integer coordinate system. I have managed to get +, -, * and / operators working. However, after implementing the == operator in the same way I am getting errors.
My struct is defined as follows:
public struct…

Hazz
- 29
- 3
1
vote
2 answers
use greater than operand in angularjs controller
Data in my controller
$scope.data = [{
"F": "1,26,000"
}];
$scope.data2 = [{
"F": "26,000"
}];
this is my data in my controller now i want to use if else condition here
if…
user6656728
1
vote
2 answers
Why is a Nonetype being returned?
I'm fairly new to Python. I am making a generator that gives a bakery estimates on how much it would take to host an event if they were making cupcakes. Something goes wrong around here though
Batches = print("Batches of Cupcakes:", math.ceil(People…

Jevon Jackson
- 39
- 1
- 1
- 3
1
vote
1 answer
How does gdb use register as address and display offset content?
In gdb:
p $ebp #will print content pointed by ebp
p 4$ebp # gdb says this is illegal operand.
I wish to show 4 bytes after the address pointed by ebp, and display an int. How to specify this command in gdb?

Troskyvs
- 7,537
- 7
- 47
- 115
1
vote
2 answers
Java - Add Support in a Class to Allow Multiplying
In programs such as Unity3D that have Vector2/Vector3's etc (I use C# coding in the program), you can multiply Unity's Vector objects by a float simply using the '*' operand and no explicit methods. Eg:
Vector2 oldVector = new Vector2(10f,…

SchoolJava101
- 609
- 1
- 5
- 8
1
vote
2 answers
Python TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
Hi I have a kNN implementation in Python and I am getting some syntax errors given below. The code is given later in the post.
Traceback (most recent call last):
File "C:\Users\user\Desktop\knn test\knn.py", line 76, in
main()
…

The_Cook
- 57
- 3
- 9
1
vote
1 answer
Count word in text column in MySQL
This question is about MySQL Query.
I have three tables:
brand (consists of: text)
englishkeyword (consists of ID, word)
englishkeywordmodel (consists of: ID, score)
I want to count how many words in 'text' with the word which is already…

razin kac
- 83
- 1
- 9
1
vote
2 answers
C++ overloading operators,constructors and more
I've created my own four methods to handle strings as numbers:
std::string addStrings(std::string,std::string);
std::string subtractStrings(std::string,std::string);
std::string multiplyStrings(std::string,std::string);
std::string…

ESipalis
- 381
- 4
- 17
1
vote
1 answer
Indirect Addressing Mode
I am currently trying to solve a problem where I am given these criteria:
I believe that I have some of the answers correct but I am confused because the question mentions nothing about an address being stored at address 10 so how can indirect…

Bob
- 23
- 1
- 5
1
vote
1 answer
TypeError - cannot multiply 'float' by 'NoneType'
I have a function which defines an integral.
An array A[i,j] is later defined by multiplying said function by 0.5/pi.
I get the error:
TypeError: unsupported operand type(s) for *: 'float' and 'NoneType'
Clearly this is because I am multiplying…

Doug Fox
- 23
- 1
- 1
- 6
1
vote
2 answers
unsupported operand type(s) for +: 'int' and 'tuple'
I need to complete a task where I am given a list of names and grades for each name and I need to sort these out by highest to lowest grade. However if two names have the same grades then sort those names out in alphabetical order. This is the…

Classydogg
- 61
- 1
- 8
1
vote
1 answer
what does it mean when a function is used as left operand in C++
I'm working with NS2 that is in C++ language.
I see the following code that I cannot understand it !!!!
ch->size() += IP_HDR_LEN;
thanks for your help...

Masoud Nazari
- 476
- 2
- 6
- 17
1
vote
1 answer
ML. "Unzipping" list of tuples.
So I have this list of tuples(n=2), witch I'm supposed to "unzip" and by that create a new list like so: for list of tuples like this val it = (1,"one") :: (2,"two") :: nil : (int,string) alterlist, the unzip function will create a list like so…

Bob Sacamano
- 699
- 15
- 39
1
vote
1 answer
Bad operand type for unary string -:str while drawing a picture
I am trying to draw a picture for a homework in my computer science class.
#==================================
#Program Purpose: Drawing
#
# @Author: Morgan White
# @Version: January 26th, 2013
#==================================
print( …

user3238097
- 13
- 2
1
vote
1 answer
Buggy IF statement
I have a buggy IF statement. I am trying to check if the touch is within a certain area. However, it seems to be creating an invisible touch box for the sprite, a never ending touch box to it's right and off the screen. The left and top area work…

Muffin
- 33
- 6