jeudi 25 juillet 2019

How to check if field on desktop application is empty or filled, and if it's filled mark as exception, and if it's empty proceed?

I am new to UI path and am trying to build a workflow/sequence to check if a field in my desktop application is filled or not.

If the field is empty then I want to proceed with the process, and if it is filled I want it to be marked as an exception.

I currently have it so the flow goes as follows: 1. Identified element 2. used Text Exists activity for that field, and I inputed "" as the Text

What are the next steps?

How do I check the visibillitiy of an element in a if-statement?

im trying to check onCancelListener of my timerpicker-dialog the visibility of an radio-button (rdi_1), and want to setChecked(true) if visibility is VISIBLE.

timePickerDialog.setOnCancelListener(new DialogInterface.OnCancelListener() {
                        @Override
                        public void onCancel(DialogInterface dialogInterface) {

                            if (rdi_1.getVisibility() == View.VISIBLE) {
                                rdi_now.setChecked(true); }
                            rdi_2.setChecked(false);
                        }
                    }

Only rdi_2 gets unchecked

Is there a way to check if all children of an object are active?

I am a beginner C# coder, and I am trying to make a game in Unity. Hence the question: Can I check if all children of an object are active in a scene? I want to use it to check if all enemies are active.

What is difference between if..else and Nil-Coalescing Operator Swift 4

I just want to know what is the difference between if..else and Nil-Coalescing Operator and it's main use.

  • Syntax with Nil-Coalescing Operator.
lblGenres.textColor = genreSelected.contains(indexPath.row) ? colorWithHex(hex: COLORCODE.APP_THEME_COLOR) : colorWithHex(hex: COLORCODE.BLACK_COLOR)

  • if..else statement
if genreSelected.contains(indexPath.row)
{
  lblGenres.textColor = colorWithHex(hex: COLORCODE.APP_THEME_COLOR)
}
else
{
  lblGenres.textColor = colorWithHex(hex: COLORCODE.BLACK_COLOR)
}


Here i get both works properly but with the using of Nil-Coalescing Operator make syntax easy.

  • So i just want to know that, which condition or operator use is good and why?

How to create new variables using loop and ifelse statement

I have a number of variables with the same name but different suffix. For example, var1, var2, var3,var4,var5, var6... and so on. Each of these variables has random sequence of 0, 1, 2. Using these variables, I am trying to create a new variable called "testvariable." If any of the already existing variables has 1, I will give "testvariable" 1. If they have 0 or 2, I will assign 0.

Is there a simple loop and/or ifelse statement I can use to create this variable? My real data is a lot more complex than this, so I don't want to copy and paste each individual variable and values.

Edit: This is for R.

Suppress errors in if statement

I have the following code in which I try to check if the machine obtains it's IP adress from dhcp or if it's static. The code has to work for both ubuntu and sles 12. Now if I'm using the code on sles I get an error that the file is not found which is normal. But I don't want the user to see this message. Is there a way to redirect the output of an if statement? Normal redirection doesn't seem to work.

I already tried putting bash &> /dev/null after the if statement but that doesn't change a thing.

if [[ ! "$(grep "dhcp4: true" /etc/netplan/50-cloud-init.yaml | awk '{print $2}')" == "true" ]] || [[ ! "$(grep 'BOOTPROTO' /etc/sysconfig/network/ifcfg-eth0 | cut -d '=' -f2 | sed "s/'//g" | xargs)" == "dhcp" ]]
then
    # more code...
fi  

If anyone has a better solution to check if the client obtains the IP via dhcp I would appreciate if you let me know.

How to simplify C# code with IF conditions [on hold]

Is there some decision to simplify C# code with many IF conditions? I think many if conditions need many proccess time Here is my code:

public double volume;
public double progressBar;
If(volumeValue >= 10 && volumeValue <20)
{
ProgressBar +=1;
}
If(volumeValue >= 20 && volumeValue <30)
{
ProgressBar +=1;
}
If(volumeValue >= 30 && volumeValue <40)
{
ProgressBar +=1;
}
If(volumeValue >= 40 && volumeValue <50)
{
ProgressBar +=1;
} 
If(volumeValue >= 50)
{
ProgressBar +=1;
}