How do I call for a max in an array(pascal) - max

I tried:
Writeln(max(vaMonth[j,k]));
But it wont just give the maximum value. Instead I get: Illegal Qualifier.
All I want is that it writes the max value in within my array...

The array needs to be float or integer.
Maybe the following links may help you:
http://www.freepascal.org/docs-html/rtl/math/maxvalue.html
http://www.freepascal.org/docs-html/rtl/math/maxintvalue.html

Related

Error(-17994): Invalid arguments for lr_save_string

I am trying to get the random value from list of data. But I am geting the error(-17994).
web_reg_save_param("c_Log",
"LB=LogNumber:",
"RB=\"",
"Ordinal=All",LAST);
lr_save_string(lr_paramarr_random("c_Log"),"randomValue");
If this is the precise ordering in your code then your pseudo array is unlikely to have any values in it until the next page/HTTP request is made. You would be attempting a random assignment of an empty set.
Try setting your lr_save_string() after the next page load when the c_log array is likely to have some values seeded, assuming the expected page loads correctly
web_reg_save_param(...);
web_url(...);
lr_save_string(...);

IMPORTXML value returned price NOT as number - need help to convert

Not an expert in Google sheet so would appreciate if someone can help me solve this:
trying to do some work on crypto pricing.
I extract the actual price this way
CELL I2 has something like https://coinmarketcap.com/currencies/AAVE
If I use formula =IMPORTXML(I2,"//div[#class='priceValue ']")
It will return the price value of the I2 crypto in this case for example $320.12
It seems the 320.12 is text and I could not convert to number using VALUE(I2)
I need to use this 320.12 to calculate ...
for example I try to multiply the 320.12 by the quantity and I get the error: Function MULTIPLY parameter 1 expects number values. But '$320.12' is a text and cannot be coerced to a number.
Appreciate the help
use:
=1*REGEXEXTRACT(IMPORTXML(I2, "//div[#class='priceValue ']")&"", "\d+.\d+|\d+")
No the value is a number formatted in $, you can use it ... see https://docs.google.com/spreadsheets/d/1cgb8D01AR7Zy6FVjYcVtJkNk1lEtRC7V_UvjcF283qA/edit?usp=sharing

how to convert hash+string to number in free marker

I'm struggling to convert hash+string to number in free marker. How I can resolve this issue:
<#assign varnetweight = varitem.varquantity * example.examplevar />
or "*" right-hand operand: Expected a number, but this has evaluated to a hash+string (wrapper: com.netledger.templates.model.StringModel):
The error message is quite clear: you need two numbers for your multiplication.
I tested your configuration with https://try.freemarker.apache.org/:
This configuration is working as you access a number with example.examplevar.
Here you don't access a number but another data structure that cannot be resolved to a number:
So please provide your complete data for us to see why it is wrong. Or maybe this already helps you.

Why can't see full pointer array value after passing into a function [duplicate]

If you have a statically allocated array, the Visual Studio debugger can easily display all of the array elements. However, if you have an array allocated dynamically and pointed to by a pointer, it will only display the first element of the array when you click the + to expand it. Is there an easy way to tell the debugger, show me this data as an array of type Foo and size X?
Yes, simple.
say you have
char *a = new char[10];
writing in the debugger:
a,10
would show you the content as if it were an array.
There are two methods to view data in an array m4x4:
float m4x4[16]={
1.f,0.f,0.f,0.f,
0.f,2.f,0.f,0.f,
0.f,0.f,3.f,0.f,
0.f,0.f,0.f,4.f
};
One way is with a Watch window (Debug/Windows/Watch). Add watch =
m4x4,16
This displays data in a list:
Another way is with a Memory window (Debug/Windows/Memory). Specify a memory start address =
m4x4
This displays data in a table, which is better for two and three dimensional matrices:
Right-click on the Memory window to determine how the binary data is visualized. Choices are limited to integers, floats and some text encodings.
In a watch window, add a comma after the name of the array, and the amount of items you want to be displayed.
a revisit:
let's assume you have a below pointer:
double ** a; // assume 5*10
then you can write below in Visual Studio debug watch:
(double(*)[10]) a[0],5
which will cast it into an array like below, and you can view all contents in one go.
double[5][10] a;
For,
int **a; //row x col
add this to watch
(int(**)[col])a,row
Yet another way to do this is specified here in MSDN.
In short, you can display a character array as several types of string. If you've got an array declared as:
char *a = new char[10];
You could print it as a unicode string in the watch window with the following:
a,su
See the tables on the MSDN page for all of the different conversions possible since there are quite a few. Many different string variants, variants to print individual items in the array, etc.
You can find a list of many things you can do with variables in the watch window in this gem in the docs:
https://msdn.microsoft.com/en-us/library/75w45ekt.aspx
For a variable a, there are the things already mentioned in other answers like
a,10
a,su
but there's a whole lot of other specifiers for format and size, like:
a,en (shows an enum value by name instead of the number)
a,mb (to show 1 line of 'memory' view right there in the watch window)
For MFC arrays (CArray, CStringArray, ...)
following the next link in its Tip #4
http://www.codeproject.com/Articles/469416/10-More-Visual-Studio-Debugging-Tips-for-Native-De
For example for "CArray pArray", add in the Watch windows
pArray.m_pData,5
to see the first 5 elements .
If pArray is a two dimensional CArray you can look at any of the elements of the second dimension using the next syntax:
pArray.m_pData[x].m_pData,y
I haven't found a way to use this with a multidimensional array. But you can at least (if you know the index of your desired entry) add a watch to a specific value. Simply use the index-operator.
For an Array named current, which has an Array named Attribs inside, which has an Array named Attrib inside, it should look like this if you like to have to position 26:
((*((*current).Attribs)).Attrib)[26]
You can also use an offset
((*((*current).Attribs)).Attrib)+25
will show ne "next" 25 elements.
(I'm using VS2008, this shows only 25 elements maximum).

How to sort the top n value and saving them in a metrix with others turning zero in Tensorflow?

In Tensorflow,for example :[6,3,1,5,8,2,4]
if I use the tf.gather and the tf.nn.top_k to get the top 3 in the metrix
the result will be [6,5,8]
However what I want is [6,0,0,5,8,0,0]
plz help me!
Maybe I get a solution,
first use the tf.nn.top_k to get the top 3's index and the values.
second use the tf.sparse_to_dense,and use the index and the values to fill.

Resources