Which tool can I use to find values of any variable in an equation? - variables

What tool can I use to find values of any variable in an equation with multiple variables without having to rewrite the equation to get the values of each variable? I know the solver of HP calculators, but I would like a different ferment.
I would like a tool that solves for variables in an equation without having to manipulate the equation to get each variable in that equation.
Thanks!

Related

Why each exponential operator print a different result

My group was writing a code when a problem gives us an exponential formula. One member used ^ as exponential operator, and the other used **. Then, each method returned a different value:
Im not trying to know which one is correct, but i would like to know why each operator retrieved a different value. What is the difference between the mathematical logic behind each of them.
I would like to know why these two operators, which essentialy have the same utility, retrieved different values.

Multi-Value Prometheus Query Grafana

I'm using Grafana plus Prometheus queries to create dashboards in Grafana for Kubernetes. I take the name of the nodes (3 in this case) in a variable and then I pass this values to other query to extract the IPs of the machines. The values extracted are correct. I have the multi-value option enabled.
The problem comes with the query sum(rate(container_cpu_usage_seconds_total{id="/", instance=~"$ip_test:10250"}[1m])) and more than one IP because it only takes one of them. In other query it works but I think it is possible because the other query has not the :10250 after the variable.
My question, do you know any way to concatenate all the ip:port? E.g.: X.X.X.X:pppp|X.X.X.X:pppp
Try it like this:
sum(rate(container_cpu_usage_seconds_total{id="/", instance=~"($ip_test):10250"}[1m]))
From multiple values formating documentation, Prometheus variables are expanded as regex:
InfluxDB and Prometheus uses regex expressions, so the same variable
would be interpolated as (host1|host2|host3). Every value would also
be regex escaped if not, a value with a regex control character would
break the regex expression.
Therefore your variable ip_test = ['127.0.0.1', '127.0.0.2',...] is supposed to be transformed into: (127\.0\.0\.1|127\.0\.0\.2).
This means that your expression =~$ip_test:10250 should be transformed into =~"(127\.0\.0\.1|127\.0\.0\.2):10250" so you don't need the multiple expansion you are asking for.
The reason it is not working is that either the documentation is incorrect or there is a bug in Grafana (tested with version v6.7.2). From my tests, I suspect, the Prometheus expansion doesn't expand with the enclosing () and you end up with the expression =~"127\.0\.0\.1|127\.0\.0\.2:10250" - which is not what you want.
The workaround is to use the regex notation =~"${ip_test:regex}:10250".

Parsing a large value that includes 3 smaller values of scientifc notation

I'm using VB.Net 2013 and really could use some help. Perhaps I have been staring at it too long. I am presented with a value from a variable. The specific value is this
3.190E+01+3.366E+01+8.036E+00
The value is actually 3 smaller values in scientific notation as follows
3.190E+01
3.366E+01
8.036E+00
I need to get the individual values into individual variables. Once I have the individual values I need to calculate the notation of each value so 3.190E+01 is equivalent to 3.190*10^1 and 8.036E+00 is equivalent to 8.036*10^0. I can probably figure out the last part of this question if I can just get the individual values. The caveat is that the numbers will vary in size and the scientific notation part will not always be the same. I do believe it will always be E+XX though so possible to use some regex stuff that I don't fully understand.
Thank you, I look forward to your help and it is very much appreciated.

VBA Variable Definition - Which Data Type Should I use?

I am new to programming and would like to know when writing code how I should define my variables. I understand that I should use strings for words etc., but when using numbers with decimal points for calculations such as multiply or divide, should I use Single, Double etc.??
VB can use and VBS can only use Variants. These datatypes don't require declaration as they autoconvert. EG x = "27.5" will work if y = x / 55. You don't need to think about datatypes.
Variants are slower. For small programs this is irrelevent. Although be careful in loops. They can always be coerced.
Using Variants leads to a clean programming style where program logic rather than binary implementation is front and centre.
In VB you mostly use COM which uses Variants.
If you're new to programming, suggest keeping it simple and use Double. Double is the native type for most math functions. It can tend to be faster, but these days, all the numeric types seem to have the same performance.
Single is useful for conserving space when you don't need extra precision. Single would be okay, too, but better to stick with one type and use it consistently.

DB2 SQL z/OS - variable equivalent of a hex constant

I'm trying to extract data (using SPUFI) from a DB2 table to a file, with one of the output fields converting a decimal field to the same format as a COBOL comp field.
So e.g. today's date (20141007) would be ..ëõ
The SQL HEX function converts 20141007 to 013353CF, and doing a SELECT of x'013353CF' gives me the desired result, but obviously that's a constant, I'm trying to find an equivalent function.
Basically an inverse of the HEX function.
I've come across a couple of suggestions using user defined functions. Problem is, we've only recently upgraded to DB2 10 and new function mode isn't enabled yet, which means I don't have access to any control functions in a UDF.
I suspect I'm out of luck, but wondering if anyone has any suggestions.
I appreciate this is completely the wrong tool for the job, and would be easier to just write a COBOL program to do it, but various constraints are preventing that. I'm limited to just SQL functions and possibly JCL).
I thought I had a solution using a recursive UDF to get around the lack of control functions, but that's not allowed either.