Questions tagged [operation]
734 questions
4
votes
3 answers
Cancellable set of asynchronous operations with progress reporting in iOS
Suppose that I use another SDK (which I do not have control of) with an API that imports 1 file asynchronously, and calls a completion callback on completion.
The following is an example API.
func importFile(filePath: String, completion: () ->…

Dj S
- 10,232
- 1
- 21
- 24
4
votes
4 answers
Wrong multiplication in PHP
I'm trying to do a simple operation of two numbers but the operation returns a wrong result.
The number are for example 46.29 and 10. The first one in the $a variable and the second one in the $b variable.
Process
echo $a * $b
returns 460
echo 10…

crasholino
- 727
- 1
- 8
- 13
4
votes
2 answers
Combine Set, Clear and Toggle in one line of C
I am trying to combine three bit operations in one line of C. For a 8 bit char, I have to set bits 2, 4, 6; clear bits 1, 3, 7 and toggle bit 0 and 5 all in one line code of C. I could do these in three line but I cannot combine these. Below is…

Aurora427
- 53
- 3
4
votes
2 answers
How to convert Values from to type in a Deedle frame?
I need to perform something like:
var myTotal = myFrame.Sum();
However, the values are string type and I get an error.
How could I convert the values of the frame to a double type?
I'm using only 3 decimals "0.000", is there anything more practical…

Jorge Thomas
- 127
- 5
4
votes
3 answers
in typeclasses, how to vary operations, with extra parameters?
In a Scala typeclass, there will be a trait on which operations are defined, e.g. NumberLike with plus() and minus(), Transformer with transform(), or AddressLabelMaker with toLabel(). It's then possible to extend the trait with typeclass…

James McCabe
- 1,879
- 2
- 15
- 22
4
votes
3 answers
Operator associativity in C specifically prefix and postfix increment and decrement
In C operation associativity is as such for increment, decrement and assignment.
2. postfix ++ and --
3. prefix ++ and --
16. Direct assignment =
The full list is found here Wikipedia Operators in C
My question is when we have
int a,…

PJT
- 3,439
- 5
- 29
- 40
4
votes
4 answers
Is a query with table separated by comma a cross join query?
I know some of SQL but, I always use join, left, cross and so on, but in a query where the tables are separated by a comma. It's looks like a cross join to me. But I don't know how to test it (the result is the same with the tries I made).
SELECT…

Michel Ayres
- 5,891
- 10
- 63
- 97
4
votes
4 answers
Fastest way to split a word into two bytes
So what is the fastest way to split a word into two bytes ?
short s = 0x3210;
char c1 = s >> 8;
char c2 = s & 0x00ff;
versus
short s = 0x3210;
char c1 = s >> 8;
char c2 = (s << 8) >> 8;
Edit
How about
short s = 0x3210;
char* c = (char*)&s; //…

Jonas
- 1,019
- 4
- 20
- 33
4
votes
3 answers
Why it is not possible to increment and then pass the value in set method by ++
I have a line of code that works like this,
mrq.setId((mrq.getId()+1));
But, When I tried to write it like this,
mrq.setId((mrq.getId()++));
It doesn't work, The error is, Invalid argument ot the operation ++/--
What is the technical reason behind…

TeaCupApp
- 11,316
- 18
- 70
- 150
3
votes
5 answers
php: performing math inside of an "echo". also passing variable name to a function
I'm building a table (tho not using ) and populating it with data from mysql. I have the following code to build the "table":
$NYC = // data from mysql, working fine
$NYC_min = 300;
switch($cou_mun){
case "New York":
$NYC++;
…