Stepfunction map with condition [closed] - amazon-web-services

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 2 years ago.
Improve this question
Is there is any possibility to run the was step function map Iterator based on the condition Am going to invoke the lambda and based on the result I have to choose the input item of the iteration meaning if there is an array of 0-3 items once the first item executes with lambda then based on the result it should execute 1st index or 2nd index item.

The other option is to create a while loop like this:
Set a variable to track your index (pos = 0)
Do whatever you want to do inside your iteration also you could use some condition, if you want to process each item conditionally
increase your index ( pos++)
If your index is less that your items count go to step1.
This way you have access to the result of previous iteration, so you can fine tune your condition.

Related

How to return all value out the for loop in golang [closed]

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 10 months ago.
Improve this question
In python I can return how value what I append in the array
valuesinPy= []
for i range(len(value)) :
valuesinPy.append(value[i])
return valuesinPy
It's able to return all value I want to append in golang
valueappend =make(map[strig]string)
for i :=range value{
valueappend['abs']=value[i]
}
return valueappend
it's all same
But the value return same I got confused
Problem fix
I use the map [string]interface{}{} I less one struct of slice
valueappend:=map[string]interface{}{}
for i :=range value{
valueappend= append(valueappend, map[string]interface{}{
"valueIwant append" value[i] :
}
}
return valueappend
One issue I can see is that the key you are using is same in all iterations of the loop
valueappend['abs']=value[i]
This will overwrite all previous values and you will only have the last one in the loop be saved. In the end you will get a map with just one value. I'm guessing that's not what you want here. Use can use a unique key for each iteration as follows, or something else along the same line
for i := range value {
valueappend[i]=value[i]
}
#范紀予 please add more info and clarify what you are trying to achieve here.
You'll probably need to change the value of the map each time you go through the loop, or else every value from value[i] will keep writing to that same field in the map, leaving with the last value of i as your only value in the map

ABAP free internal table [closed]

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
The answer to the question below is given as 2. Why does refresh delete only the first row? Is it not expected that it deletes all rows of an internal table?
What will be output by the following code?
DATA: BEGIN OF itab OCCURS 0, fval type i, END OF itab.
itab­-fval = 1. APPEND itab.
itab­-fval = 2. APPEND itab.
REFRESH itab.
WRITE: /1 itab­-fval.
A: 1
B: 2
C: blank
D: 0
Answer: B
If the code did not contain any syntax errors, e.g. the missing '-' when assigning the value 2 and when writing the value, then B is the correct answer but not for the reason you state. It is not that the REFRESH only removes the first line from the table, it is because REFRESH does not clear the header line of the table. So after the REFRESH the header line still has the latest assigned value which is 2. This can be easily ascertained when running the program in the debugger.
Note that the use of internal table with header lines is obsolete, as mentioned in SAP help.
You can use a clear command to clear the header line.
REFRESH itab.
CLEAR itab.

Choosing random event with different probabilities [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I need help creating a general function or pseudocode that chooses a single event from a group events who all have different probabilities.
Ex.
event 1 = 45%
event 2 = 15%
event 3 = 50%
event 4 = 35%
event 5 = 50%
The simplest solution would be to sum and normalize the ranges (as an example, the sum of the values is 195, your first event would get the range [0, 45/195=0.23[, the second one [0.23, 0.23+0.076=0.31], and so on), then extract a number from [0,1[ and look to what range it belongs.

What can I use as data structure for Ranking in C++? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have data-set with these attributes:
UserID (int)
Group (int)
Score (int)
I want to evaluate ranking:
All Ranking by score
Group ranking in user's group by score
What should I do?
Use a linear array of structure which contains the data set and an array of size equal to the number of groups.
Sort the structure array based on score to get overall rank and use the second array to keep count of the number of structures of each group to assign group rank to each data set.
struct user
{
int userID , group , score;
int totalRank , groupRank;
}
Take arrays as:
user list[100];
int groupCount[10]; //Assuming there will be maximum 10 groups

IF ELSE in display column tag in struts2 [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
Hi i am using display column tag in struts2.
And want to format row on basis of data...
For example column hs boolean value.
If value is true i want display row in red font.
else in black font.
So how can i implement if else condition in display column tag in struts2?
I have check on net, bt solutions given ar
Can anyone give me code example for the same???
thanks in advance.
Please check this and link for Example
<s:if test="%{column ==true}">
// do stuff to change row color
</s:if>
<s:else>
// do stuff to change black font
</s:else>