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++; …
Jakob Jingleheimer
  • 30,952
  • 27
  • 76
  • 126
3
votes
1 answer

How to handle user-defined data structure in Fortran90?

in my program I defined a data type called Lyapunov_orbit that contains 8 fields, then I used it to read data from external .txt file (see below where I report only a few lines for convenience because the file has about 4000 lines). I need to…
3
votes
2 answers

Can asynchronous operations be used with `progress` on OperationQueue?

Starting in iOS13, one can monitor the progress of an OperationQueue using the progress property. The documentation states that only operations that do not override start() count when tracking progress. However, asynchronous operations must override…
John Slade
  • 219
  • 1
  • 8
3
votes
3 answers

How to negate a positive integer in C without * or - operators?

Hello I am trying to write a function for my lab which requires me to negate a positive number with restricted operators. The operators allowed are: ! ~ & ^ | + << and >>. My initial approach was to double x using addition: x + x and then…
3
votes
1 answer

Python float operations give complex result

eq = (((1 - (2 * normal_rpm - s8) ** s1) * s2 * math.sin(normal_rpm ** s3 / s4) * (1 - math.sin((normal_rpm + s5) ** (2) + 5) + s6) / (s7))) + 0.67 is my formula for this variable, where the S variables are floats. this sometimes returns a result…
3
votes
1 answer

How to define operations of an STFP Operator on Airflow?

class SFTPOperation(object): PUT = 'put' GET = 'get' operation=SFTPOperation.GET, NameError: name 'SFTPOperation' is not defined I have defined operators here but I can't find anything on the internet related to operations class…
Raj
  • 585
  • 4
  • 16
  • 28