The TimescaleEdit method allow to set parameters such as the level of zoom for example:
TimescaleEdit Enlarge := TheValue
But what instruction (and which syntax) should be used to GET the value set ?
Thanks for your help.
I tried in the immediate window, different codes but none of them is operating, returning various erros.
I'm expecting a numeric value.
Related
I have a model in AMPL. This model must run three times and in each iteration the result must redefine the size of a previously defined set.
Example:
set item := 1..12;
...
var out{other_set} >=0 integer;
The model would run and get me the solution in out. Then I want to redefine the item set as:
set item := 1..out.
Is this possible?
In page 462 of the manual I found this:
Recursive definitions of indexed sets are allowed, so long as the assigned
values can be computed in a sequence that only references previously computed values.
Am I right in thinking this is what I want?
Thanks
You can assign a new value to a set. To do so first make sure that it doesn't have a := in the declaration. You can replace it with the default clause:
set item default 1..12;
Then use the let statement to assign the new value:
let item := 1..out;
Note that in your example out is indexed over a set so you'll need to provide a subscript out[...].
I am very new to using Robot Framework, and I am using the RIDE development environment. I am trying to obtain a value from an element on a website, and then set a variable with that value. The keyword Get Value only accepts one argument from what I can see, and I cannot find any documentation explaining how to do this. This question is similar to another SO question but I am unclear on how to assign this data to a variable.
Any help is greatly appreciated!
--edit--
here is the element that i am trying to obtain data from:
<div class="highlight-box animate ng-binding" animate-change="master.user.balance.toFixed(2)" id="header-balance">
0.00
</div>
I tried setting the variable like this:
#{balance} get value header-balance
as suggested, and it didnt throw any errors, but then when I tried to use the variable with an input text:
input text Textbox-1 #{balance}
it threw an error saying that input text requires two arguments. I took this to mean that the variable did not contain anything, regardless of being set in the last line.
To set a variable with the value obtained, just add the variable name as first element in your statement. Something like:
${variable} = Get Value id=my_element
My question is this:
How can I use SUBSET (a discontinuous set) to refer to an index location in another set as opposed to an actual value? I see that ord() can be used to return the position of a value in a set, but I want the reverse of this...
my reason for needing this:
I have a model in which some of the set and data statements are roughly:
set ALL_TIME := {0..20000};
param DATA {ALL_TIME}; #read from file in later data statement;
set myTIME := {0...1000};
I am looping over the myTIME set and each time solving the model and then incrementing the start and end by 1: {1..1001}, {2..1002}, {3..1003}, etc.
I have another discontinuous set being read in from a file that looks something like this (yes below is bad syntax, the "...." is just there to mean that the pattern continues until it hits 1000 so I don't have to type it all) :
set SUBSET := {6,7,8,9,10, 16,17,18,19,20, 26,27.....}
Once myTIME increments such that it no longer contains "6", I get a subscript undefined error from a constraint which I understand to be because myTIME in this case is {7..1007} and thus in the following, tSUB=6 causes ALPHA[6] and is undefined:
subject to CONSTRAINT {tSUB in SUBSET}:
ALPHA [tSUB] = ALPHA[last(tSUB)];
What I want is to be able to use SUBSET to always refer to the same index location of ALPHA, DATA, etc.
So:
SUBSET[0] (which equals 6) should always be the 6th value of for example DATA:
{tSUB in SUBSET}: DATA[tSUB]. when tSUB is 0, I want the 6th value of DATA.
(I am new to Ampl and have a hard time wrapping my head around how indexing and sets work - if anything didn't make sense, please ask and I'll try to clarify. If you think it would be more helpful to see my actual code I'll try to sanitize the company data out and post it). Also, some of the code bits above have abysmal syntax. They are not copied from my code, just approximated to try to explain my problem. :)
You can get i-th member of set S with member(i, S), where i is a 1-based index and S is an ordered set. This is described in section 5.6 Ordered sets of the AMPL book.
I am trying to accomplish the following use case on Apache Zeppelin:
When I write an sql query, for example
%sql SELECT * FROM table1 WHERE column1 = ${column1=1,1|2|3|4}
I get a combo box displayed with these values (1,2,3,4) as options.
What I want to do is populate this list with all distinct values available for this column (or as a matter of fact any other set of values which I might want to take from another paragraph in form of a variable). So currently I am stuck at how to use some variables defined in one paragraph inside an sql statement in another paragraph ?
Diving into the code, I saw that inside the Zeppelin-interpreter, a file called Input.java checks for a pattern ${someColumn=someValues}, fills up the combo-box options and then creates a simple query, and hence I have dropped the idea of populating it by running a query in the same paragraph.
I'm using a Scala variable from one paragraph to Shell Script in another paragraph. Here's the answer.
In Scala Cell
%spark2
val myVal = "test-value-across-paragraphs"
z.put("objName", myVal)
In Shell Cell
%sh
echo {objName}
This requires object interpolation to be enabled which can be done by setting the value of the property zeppelin.shell.interpolation to true. Check Apache Zeppelin for further help.
Update May 19, 2019
The above procedure may not work in Zeppelin 2.2 but obviously works in Zeppelin 2.3. Also in 2.3, the value of interpolation can be changed from the sh.config cell.
%sh.conf
zeppelin.shell.interpolation true
You can use ZeppelinContext to accomplish this, as it enables you to use put() and get() to set and retrieve objects between paragraphs.
Quoting the example from the linked page, note that the z object is the default instance of ZeppelinContext:
// Put object from scala
%spark
val myObject = ...
z.put("objName", myObject)
# Get object from python
%spark.pyspark
myObject = z.get("objName")
I am using JasperStudio 5.6.0.final and the report is not generated dynamically from java code.
I have a problem with getting single value from parameter.
In the report I have a parameter A of a type List.
It is not a problem to use it in a clause as IN statement:
AND $X{IN, USER.ID_USER, A}
But I have a problem to get a single value from that list.
I know that my List has always 10 values.
So I want to use it in query, but I don't know how to write the statement:
AND USER.ID_USER = *first_value_of_list_A*
e.g.
AND USER.ID_USER = $P!{Atrybuty}.get(1)
doesn't work
I tried also to assign parameter value to a variable, but as I know it isn't possible to use variables in queryString.
So my question: How to get single value from parameter List in queryString.
What you need to do for this is use
AND $X{IN, USER.ID_USER, A}
Set A type as Collection and that will allow you to even have a single selection or multi selection or just a single value.
Hope that this helps.