initializing thread to new thread c++

I have a not initializated thread "thr", and i wanna initalize it to new thread thr=std::thread(&Engine::thread); But i get error C2672: "std::invoke". I tried to replace &Engine::thread with this->thread, but gets another error C3867: "En...
more »

2017-09-05 18:09 (0) Answers

why is an identical array not equivalent?

e.g. $ node > [1, 2, 3] == [1, 2, 3] false Apologies if I am using "identical" and "equivalent" incorrectly. console.log([1, 2, 3] == [1, 2, 3]); I ask, because I am used to languages such as Ruby $ irb irb(main):001:0> [1,2...
more »

2017-08-08 21:08 (3) Answers

Is an operator or syntax?

I've heard ... referred to both as 'spread syntax' and 'the spread operator', with the latter being a lot more popular. The URL of the relevant MDN documentation suggests that it was initially referred to as the spread operator but later changed to s...
more »

2017-07-05 21:07 (2) Answers

Equals support for self-built Fraction class

class Fraction: """Class for performing fraction arithmetic. Each Fraction has two attributes: a numerator, n and a deconominator, d. Both must be integer and the deonominator cannot be zero.""" def __init__(self,n,d): """Per...
more »

2017-05-16 15:05 (3) Answers

PDO value from db is not equal to string

This is what I am trying to do check if the logged user is following the current user page $donearray = "userpage"; $username = $_SESSION['username']; $sql1 = "SELECT * FROM follow WHERE follower = :usr"; $stmt1 = $conexao_pdo->prepare...
more »

2017-05-05 22:05 (1) Answers

Replacement for > and < operator

Is there a replacement for the greater/less than operator (<,>)? I am trying to sort my array on descending order here but i cannot use the operators in the environment i am working in. Here is the code that i use to order my array with strings...
more »

2017-05-04 16:05 (3) Answers

Templates, no matching function for call to error

I've made a code which works just fine but one line. It causes me problems. On the line where it says k = Money<double>().increment (k,m); // this should've printed 6.25 it just doesn't work. When you comment it out and run the code... everythi...
more »

2017-04-28 20:04 (2) Answers

User Defined Operator VBA

Is it possible to define a custom operaotr in VBA? I am not seeing any documentation on it. I know I could write a function but I was wondering about using an operator and whether or not that would have any performance benefits. ...
more »

2017-04-27 18:04 (1) Answers

Javascript regex OR |

I'm currently searching how to write correctly a regex for this application : 1 - A number without "." with a length of 1 to 5 digits => /^(\d{1,5})$/ 2 - A number with "." with a length of 1 to 5 digits before the "." and 1 to 4 digits after the "."...
more »

2017-04-19 10:04 (5) Answers

Greater and less than operator in a URL

Hello everyone i have a db.json file which i run in http://localhost:3004 The format is like this: [ { "Symbol": "AAPL", "prodType": "STK", "Market": "Symbol Industries Inc", "Country": "US", "Quantity": 10, "NominalValue":...
more »

2017-02-18 20:02 (0) Answers

Escaping closure for operators in Swift

How can I store the function used to evaluate an operator in a variable in Swift? Neither Int.< nor Int.`<` seem to compile for me. For alphanumeric function names, this works just fine: extension Comparable { static func lessThan(_ lhs:...
more »

2017-02-09 02:02 (1) Answers

Trouble with increment operator

This is the exemplar code that I encountered in entry level Computer Programming course: #include <stdio.h> int main() { int l = 20, m = 10; int z; z= l++ || m++; printf("z = %d l = %d m = %d\n", z, l, m); } The code ...
more »

2017-02-06 12:02 (3) Answers

Haskell - Generalized Composition

I've been trying to implement a generalized composition operator <$.$> such that: f <$.$> g1 <$.$> g2 <$.$> .. <$.$> gn = \x1 x2 .. xn -> f (g1 x1) (g2 x2) .. (gn xn) It /should/ be possible to implement this with...
more »

2017-02-02 04:02 (0) Answers