Questions tagged [operation]
734 questions
3
votes
8 answers
Is a comparison an atomic operation?
Is the following comparison an atomic action? I.e., can it be reduced to a single CPU instruction?
char flag = 2;
for(;;)
{
if (!flag) // <-- this
break;
// sleep
}
Here's what I'm doing:
int main()
{
sf::Mutex Mutex;
char…

Truncheon
- 916
- 2
- 12
- 25
3
votes
4 answers
Unicode - String - list Manipulation
I have a data s = u"[u'38', u'36', u'34', u'32']" which has data type unicode
i want to make this data as simple list of element like s= ['38','36','32'],
i try to use simplejson.loads but its not working simple json work with the ('["s"]') this…

Shashi
- 2,137
- 3
- 22
- 37
3
votes
3 answers
System.out.println behavior when using String and int together
Consider the below code snippet -
public class Student {
public static void main(String args[]) {
int a = 3;
int b = 4;
System.out.println(a + b +" ");
System.out.println(a + b +" "+ a+b);
…

vikash singh
- 1,479
- 1
- 19
- 29
3
votes
2 answers
Is it possible to perform two different "+=" and "-=" operations in one line of code?
I have just started teaching myself java and I was wondering if there is an operation (maybe an "and then" operation) that will allow me to perform two mathematical calculations on the same line. It is important to keep the updated total for the…

Kevin Ocampo
- 101
- 7
3
votes
2 answers
UML: how to represent indirect operation calls in a sequence diagram?
Consider the following classes:
I would like to represent in a sequence diagram the fact that an instance of A first navigates through the b association end to reach a B instance, then navigates through its association c to reach a C instance, then…

Gwendal
- 490
- 3
- 13
3
votes
2 answers
how can I overwrite __mul__ function in python
I wrote a class in python like this
class Vector(object):
def __init__(self, coordinates):
try:
if not coordinates:
raise ValueError
self.coordinates = tuple(coordinates)
self.dimension = len(coordinates)
…

chengjun zhang
- 101
- 1
- 1
- 9
3
votes
1 answer
How to perform focal operation (mean) on raster using 3x3 window in R? I have lat/long values
I have raster and lat/long values, I want to perform focal operation on these points using 3x3 window/kernel. I am new to R.

Gomal Amin
- 31
- 3
3
votes
1 answer
tensorflow graph node names dont match operation names
I am a newer for tensorflow, and I am confused with the graph struction in tensorflow tutorial label_image . Using the code blew:
import tensorflow as tf
with tf.Session() as sess:
with…

fengshuxin
- 61
- 2
3
votes
1 answer
Mathematical operation on captured number that comes after a certain character in R
I have a vector that has elements like this:
x <- c("3434/1233", "3434.332/232.2", "220.23/932.89", "908.11111/9")
I want to replace the numbers after slash with their value multiplied by 60.
So the resulting vector will be:
x.times.sixty <-…

deja
- 33
- 3
3
votes
0 answers
iTunes Store Operation Failed description length, Error ITMS-90046 "Invalid Code Signing Entitlement"
I have no idea how the description length is so long. Inside the Itunes Connect portal, my release descriptions are very short.
How do I change this inside Xcode?
I've tried using the Application Loader and other versions of Xcode but get the same…

Mehul
- 3,033
- 23
- 37
3
votes
1 answer
Check if string is a number
================
| Person |
|--------------|
|- id : String |
|--------------|
================
I have class Person with property id that is String type. I have to check that id is a number that contains 11 digits. I thinking about something…

ulou
- 5,542
- 5
- 37
- 47
3
votes
1 answer
Difference between Pseudo-op and Machine-op?
While studying on Assembly language programming I came across the terms "Pseudo-op" and "Machin-op".I am not sure what is their functionalities and how they differ from each other?

james.bondu
- 1,092
- 2
- 18
- 27
3
votes
3 answers
What operation is called on A in "while A:"?
Lets say I have:
class Bar:
pass
A = Bar()
while A:
print("Foo!")
What operation is then called on A in order to determine the while loop?
I've tried __eq__ but that didn't do much.

Olian04
- 6,480
- 2
- 27
- 54
3
votes
1 answer
Custom gradient for a chain of ops
I've got a chain of standard TensorFlow operations, and I need to specify a custom gradient for this chain as a whole.
Say that, in the example below, these operations are grouped in a single Python function: 'my_op'. What I'm trying to do is to…

njk
- 645
- 2
- 10
- 19
3
votes
4 answers
Use a variable as an operator - Powershell
I startet with Powershell and tried to do a simple calculator.
This is what I have:
Function ReturnRes ($x,$y,$z)
{
$res= [float] $z [float]$y
return $res
}
Write-Host $res
$var1 = Read-Host "Zahl1"
$var2 = Read-Host "Zahl2"
$op = Read-Host…

Gaterde
- 779
- 1
- 7
- 25