### Regular expression to match digits and basic math operators

I need a regular expression that will match 0-9, (,),+,-,* and /.

I need a regular expression that will match 0-9, (,),+,-,* and /.

I can't understand why Python doesn't have a sign function. It has an abs builtin (which I consider sign's sister), but no sign. In python 2.6 there is even a copysign function (in math), but no...

And here we are for another question. After the previous one, i finally completed the kDop system and everything related. (Hierarchycal tree of kDop, etc..) Everything works fine. Now i want to...

I am new to this forum and not a native english speaker, so please be nice! :) Here is the challenge I face at the moment: I want to calculate the (approximate) relative coordinates of yet unknown...

I have a rotation quaternion and want to extract the angle of rotation about the Up axis (the yaw). I am using XNA and as far as I can tell there is no inbuilt function for this. What is the best...

My kids have this fun game called Spot It! The game constraints (as best I can describe) are: It is a deck of 55 cards On each card are 8 unique pictures (i.e. a card can't have 2 of the same...

In PHP (or any similar language), is there a better alternative to: if(x >= 200 && x <= 299){ return 'ok'; } My goal is to validate if a number is in the range of the 2xx code (for HTTP...

What I would like to have is the almost opposite of Number.prototype.toPrecision(), meaning that when i have number, how many decimals does it have? E.g. (12.3456).getDecimals() // 4

Why does Python give the "wrong" answer? x = 16 sqrt = x**(.5) #returns 4 sqrt = x**(1/2) #returns 1 Yes, I know import math and use sqrt. But I'm looking for an answer to the above.

Using, amongst other sources, various posts here on Stackoverflow, I'm trying to implement my own PHP classier to classify tweets into a positive, neutral and negative class. Before coding, I need...

What is going on?? Testing out sin and cos functions to find out why I get so beautiful positioning on the wrong places when outputting my coordinates into a SVG file. So I made this test code,...

I have dynamically generated lines that animate and I want to detect when a lines hits another. I'm trying to implement some basic linear algebra to obtain the equation of the lines and then...

I was wondering about how can one find the nth term of fibonacci sequence for a very large value of n say, 1000000. Using the grade-school recurrence equation fib(n)=fib(n-1)+fib(n-2), it takes...

I have three numbers x, y , z. For a range between numbers x and y. How can i find the total numbers whose % with z is 0 i.e. how many numbers between x and y are divisible by z ?

I have a Vector A defined as : (Ao+tâAd) I also have a Cone with vertex (cone tip) V, axis direction D, base radius R and height H. How can I find the points of intersection between the vector...

Quite often I use values between 0.0 and 1.0 to hold progress, or transparancy, or other things that can go from none to full. A percentage if you will. I don't want to call it a percentage...

I am working in Blender and so I wanted to use a bump map I found on the internet. The image is here. However, when I tried to use it, Blender crashed. I am assuming that happened because of the...

I'm attempting to code the pagerank algorithm from scratch, so far I have constructed the stochastic matrix G and now I am trying to find the limiting probability. The limiting probability is...

I need to skew a 2d polygon shape in arbitrary direction (2d). Doing it in X axis looks like this: float skewAngle; glm::mat4 skewMatrix; skewMatrix[1][0] = ...

I am using Angular 9, All code is working fine in chrome but not in IE11 , I am no where using any Regex and mostly I am using back tics. Below error is coming in Polyfills-es5.js as on page...

I tried running the python code in IDLE to import compare_ssim with this command line, from skimage.measure import compare_ssim: code for importing compare_ssim from keras.layers import Input,...

I have a dataset like below. In this dataset, there are different colored thermometers, and given a 'True' or reference temperature, how different they measure according to some measurement...

Using JNI, or Java Native Interface, it is possible to use c++/c types and functions in Java. I want to do something similar with Python. There are many libraries for executing Python code from...

I am attempting to Verify and Publish a smart contract that I have deployed to the rinkeby network using hardhat and hardhat-etherscan. When I am running the verify script I am getting an error. I...

It will print 88.89 to the console because, 88.888 with a hundredths place rounding precision equals 88.89. How do I make "b" equal to the value of "a" rounded to the hundredths place. (e.g....

I am looking for a function to make the list as unsorted as possible. Preferably in Python. Backstory: I want to check URLs statuses and see if URLs give a 404 or not. I just use asyncio and...

I don't know if this is possible, but I am trying to take the image of a custom outdoor football field layout and have the players' GPS coordinates correspond to the image xand y position. This...

I would like to draw where something where the mouse is, after a set of transformations. It is not about the drawing itself, it's getting the point in xyz when a certain transformation is applied....

I'm working on a statistics project involving cards and shuffling, and I've run across an issue with random number generation. From a simple bit of math there are 52! possible deck permutations,...

Firstly, I'm using this approximation of a natural log. Or look here (4.1.27) for a better representation of formula. Here's my implementation: constexpr double eps = 1e-12; constexpr double...