Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
Other than creating a function that puts elements one by one, is there a method that converts Point2f[] to Point[] datatype?
You can use Opencv convertTo method.
cv::Mat A = loadMat("mymat.xml"); // See function loadMat in the question!
A.convertTo(A, CV_64F);
Picked from here. Pick your appropriate data type.
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
Improve this question
So I made a simple c# file reader because I was bored and added an if statement to filter the results. But when I ran it, it gave me more results than I wanted. I was supposed to get
276, 2, and there was only one line inside the file with that value, but I got multiple. I checked the file and it had lines ending with the same value. I tried string.Equals(line, "276, 2") but it gave me the same results. I doubt there isn't something in c# that doesn't solve this issue.
You can use Regex, as it's mentioned in this issue
bool result = Regex.IsMatch(line, "\\b276, 2\\b");
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I want to clear just birkatmankontur list but this code clears all lists in my program
katmankonturlari.Add(ii, birkatmankontur);
katmankonturlari.ToList();
birkatmankontur.Clear();
You probably want something like this:
// Create a shallow copy of birkatmankontur and add it into katmankonturlari
katmankonturlari.Add(ii, birkatmankontur.ToList());
// Clear original birkatmankontur;
// note, that katmankonturlari contains birkatmankontur's copy
birkatmankontur.Clear();
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I've encountered sometimes code like this and I am kind of new to programming. I want to find out what's the meaning behind those objects or data type enclosed in parenthesis.
(int)
(datagridview)
(form)
If you see something like this it's called a cast. It's used to explicitly convert a data type to another data type.
double pi = 3.14159;
int my_int = (int)pi;
See this description on casting for more details.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
So here is what I have
txtFull.Text = txtFirst.Text + ā\nā + txtSecond.Text;
not sure why its not working
You should use the quotes " (Unicode: U+0022) for strings instead of the comma quotation mark ā...ā (Unicode: U+201C and U+201D)
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I have the following regex pattern:
-?\d+(?:\.\d+)?%
Which works really well to match percentages. Now what I need is to be able to get the numerical value of this in a group.
I have tried the following:
(?<percentage>-?\d+(?:\.\d+)?)%
(?<percentage>-?\d+(\.\d+)?)%
(?<percentage>(-?\d+(?:\.\d+)?))%
(?<percentage>(-?\d+(\.\d+)?))%
None of them work and I only get the integer part of the percentile.
How can this be accomplished?
The correct regex is:
(?<percentage>-?(?:\d*\.?\d+|\d+\.?\d*))%
I tried the following examples and they all seemed to work (using the first regex that you tried):
Regex.Match("12%", #"(?<percentage>-?\d+(?:\.\d+)?)%").Groups["percentage"].Value
// 12
Regex.Match("12.345%", #"(?<percentage>-?\d+(?:\.\d+)?)%").Groups["percentage"].Value
// 12.345
Regex.Match("-12.345%", #"(?<percentage>-?\d+(?:\.\d+)?)%").Groups["percentage"].Value
// -12.345
You might note the use of the "#" in front of the regular expression string - maybe that is the issue you are having.