Saturday, November 21, 2020

get current connection string- cute

 select

    'data source=' + @@servername +

    ';initial catalog=' + db_name() +

    case type_desc

        when 'WINDOWS_LOGIN' 

            then ';trusted_connection=true'

        else

            ';user id=' + suser_name()

    end

from sys.server_principals

where name = suser_name()

Tuesday, October 27, 2020

Sunday, October 18, 2020

number of cores

 wmic cpu get numberofcores/format:list

Friday, March 27, 2020

Cannot connect to packages feed

we had a file that didn't have an extension

Tuesday, February 11, 2020

UIPath Best Practices


Things that we have learned over time

 

·        Always use descriptive variables and parameters (I don’t care about length if it makes it easier to read what is happening). Use camel case.
·        Name the activities with a helpful name, remove meaningless boilerplate
·        Whenever logic is not obvious – add an annotation
·        Add comments for warnings to other developers
·        Group activities with properly named sequences
·        Rename the outermost sequence that is automatically generated with a name showing that it is the top level, otherwise variable scope is confusing
·        Remove default parameters (only use default parameters for initial testing), if the value is always the same use variables
UIPath says there are 2 ways of looking at this, but I have found this to be a source of bugs
·        Parameters should have IN_, OUT_, INOUT_ prefix so there won’t be confusion with variables
·        No Hardcoded values (e.g. locations on spreadsheet)
To search for hardcoded values, you can do a search on numbers 1,2,3, etc.
·        If you copy and rename a XAML file, go into the file with notepad++ and change the original name that is stuck in the code
·        Try to have the expected process in the left pane of an IF statement
·        Don’t store workflows under the root
·        Use folders to group functionality
·        Soft close applications and then only kill if the process is still there

UIPath Suggestions


·        Don’t use hardcoded delays
I believe there is a time and place for small delays. Code to check for existence of elements can clutter the code. Also there are less obvious things that we can wait for like a change in value
·        When using typeinto use emptyField
·        Use simulated click
UIPath’ s reason is for attended solutions. We have found that this helps for forms off-screen. However, this won’t always work and testing must be done (sometimes the program is handling onKeyDown events etc.)
·        Use flowcharts instead of nested if’s