Defining own skip and submit button - toloka

Can we define our own skip and submit button instead of using the predefined one? Especially when we only have 1 task per task suit? I just want to change it because in my case there is more preferable variant

Unfortunately, there is no function like this. The Toloka control elements (such as the "send", "quit" buttons, etc.) cannot be changed, but you can modify the task interface.

Related

Rasa threshold implementation

I wanted an implementation where if the confidence of an intent is below say, 0.6 then a particular action to be invoked and perform an API call, from there on I want to be able to either execute custom action or continue with the intent which was resolved in the first place based on some condition.
Probably try take a look into this Rule Policy. You can always modify the action that is specified here and put the conditions that you wish to perform under the same action.

Is it possible to call multiple handler methods on a single submit in atg?

Consider I have one submit button. On clicking submit, it should call both handleAddData() and handleInsertData().
Yes, we can call multiple handlers on single submit, using a component atg.search.formhandlers.MultipleSubmitHelper,
we have to configure - MultipleSubmitHelper component by setting its queryFormHandlers property to an array
Example- queryFormHandlers=/atg/search/formhandlers/QueryFormHandler1,
/atg/search/formhandlers/QueryFormHandler2
A <dsp:input> tag can only be bound to a single element in ATG. That said, you can have 3 handle methods, one which calls both the others (eg. handleCallAddInsertData) and bind your tag to this, still leaving you with the original handleAddData and handleInsertData. Alternatively you can submit your form via Javascript which will in turn call both handle methods.
If, however you need to call them 'both' you probably have a flaw in your design.

Synchronize two input fields , without building an endless loop?

I have two input fields which i would like to sync with each other.
Unfortunately, when I add a ChangeListener to each of the TextFields they will trigger each other,
and so create an andless loop.
Ofcourse I could unregister the Listeners, on every change and them put them back,
but is there any Java native approach?
Maybe something with bindings?
From general reasoning (i.e. not knowing swt or java): you can add a boolean flag (probably your class member) m_enteredChangeListener, temporary setting it to true in one of your handlers (not both), making the same handler do nothing if it's reentered recursively.

Can two panels share a uicontrol in a MATLAB GUI?

I've got a MATLAB GUI that has different aspects of functionality, each with their own panel of uicontrols. When one panel is selected, the other one is set to invisible, and vice-versa. However, they share some of the same inputs in the form of a popup menu. Can I include a 'clone' instance of the menu on the second panel somehow? I'd like to avoid as many redundant callbacks and uicontrols as possible.
I guess if the uicontrol was a direct child of the figure, you may be able to put it in front of everything.
A much simpler solution is to use the same callback for multiple uicontrols. In the property editor, you can modify the callback name and set it to a common callback function. Additionally, you can create a field (e.g. myPopupH) in the OpeningFcn of the GUI, in which you store the handles of the popups that should behave the same way. Then, in the callback, you'd use hObject, i.e. the first input argument, for all the get calls (to access the modified state of the popup-menu), but you'd use handles.myPopupH in all the set calls, so that you can ensure that both popups always have the same state. Thus, the ui-object may be redundant, but all the code (which is much more critical) only exists in a single copy.
One place where I routinely use a single callback for multiple ui elements is the close request function which is accessed from the "Cancel"-button as well as from the "X" that closes the figure, and possibly from one of the "File"-menu items.

How to yield control to a calling method

Say I have a Task object, with an Execute method. This method has one to several steps, each of which requires a user to click a 'Continue' button, e.g. when Execute is invoked, the Task tells it's container (a Windows form in this case) to display an introductory message, and wait for a button click, before continuing with step 2, notifying the user that what is taking place and performing some work.
I don't want the controller to have to be aware of the steps in the task, either implicitly, through e.g. calling Execute(Steps.ShowIntro), Execute(Steps.PerformTask) etc. or explicitly, with more than one Execute method, e.g. ExecuteIntro(), ExecuteTask(), etc.
Currently I'm using a Phase enumeration to determine which action to carry out when the Continue button is clicked:
show phase 1 intro.
set current_phase = PhaseOne.
on continue_button click
switch current_phase
case PhaseOne:
show phase 1 'Now doing:' message.
execute phase 1 task.
show phase 2 intro.
set phase to PhaseTwo.
case PhaseTwo:
show phase 2 'Now doing:' message.
execute phase 2 task.
show phase 3 intro.
set phase to PhaseThree.
Why don't you simply implement as many classes with Execute method as steps and put instances of those classes in the queue.
By pressing "Continue" you will take another instance of the class with Execute and call it.
class Task
method execute()
foreach task in queue execute task
method addSubTask( task )
add task to queue
class ShowIntroSubTask extends Task
class ExecuteIntroSubTask extends Task
Mykola's answer sounds good, but if you'd like an alternative, consider passing in a ConfirmContinuation callback, which the Execute could use as needed (e.g. on step transitions). If you wanted to keep things abstract, just call it something like NextStep and leave the semantics up to the container.