Find the first and second largest number in a series – without using arrays or functions

This is just a revision of my school memories. Language used is Java.





import java.util.Scanner;

public class testmain {
public static void main(String[] args) {

int large = 0; // there is a possible logic error, ignore
int slarge = 0; // there is a possible logic error, ignore

Scanner scanner = new Scanner(System.in);
System.out.println("Enter the number of elements");
int N = scanner.nextInt();

for (int c = 0;c<N;c++) {
int num = scanner.nextInt();

if (num > large) {
large = num;
}

if (num != large && num > slarge) {
slarge = num;
}

}
System.out.println(
"Largest = " + large +
"\nSecond Largest = " + slarge
);
}
}

Power Automate: Send daily bugs report in Microsoft Teams from Azure DevOps Boards

You can simply change same to send a mail notification too, instead of Teams.

Sample output on Teams:

image

Development Steps:

Step 01 – Create query in Azure DevOps board for Bugs

I would start with a Recurrence Trigger (schedule). Check always the Time zone of the trigger will happen on GMT.

Step 01 – Schedule

I would start with a Recurrence Trigger (schedule). Check always the Time zone of the trigger will happen on GMT.

image_thumb[2]

Step 02 – Initialize Azure DevOps URL (optional)

I am using this url for hyper linking in the output, which can be considered optional.

image

Step 03– Get bug list from DevOps boards

I suggest you to create a ‘query’ first which returns filtered ‘bug’ results. Below is the query have created and saved for this example blog.

image

Next, get the results from this query:

image

Step 04 – HTML’ize

I wanted to format the Bugs list content as a table and, MS Teams message supports HTML. So I will create a header and assign it to a new variable.

image

Step 05– Convert rows to HTML rows

Next step creates each row from DevOps boards query to corresponding <TR>s. You can choose to omit or add any columns as per your requirement.

image

Step 06 – Close HTML table

Once the rows are added to HTML table, I would close it and add also any footer notes.

image

Step 07– Post message in Teams

Finally, send the message to Teams. I have used a group chat in my case. Additionally I am using a ‘condition’ component also to check if the list is empty so it can directly ‘terminate’ the flow instead of posting an empty table in Teams.

image

Flow view:

This is what my simple Power Automate flow looks like:

image

Power Automate: Send daily status post in Microsoft Teams from a SharePoint List

Assuming you have a “List” in SharePoint and you want to post a summary/or list as-it-is to a chat group in Microsoft Teams. You can simply change same to send a mail notification too, instead of Teams.

Output in Teams:

image

Development Steps:

Step 01 – Schedule

I would start with a Recurrence Trigger (schedule). Check always the Time zone of the trigger will happen on GMT.

image

Step 02 – Get list items from SharePoint

Choose the site address and list name

image

Step 03 – HTML’ize

I wanted to format the SharePoint List content as a table and, MS Teams message supports HTML. So I will create a header and assign it to a new variable.

image

Step 04 – Convert SharePoint rows to HTML rows

Next step creates each row from SharePoint to corresponding <TR>s. You can choose to omit or add any columns as per your requirement.

image

Step 05 – Close HTML table

Once the rows are added to HTML table, I would close it and add also any footer notes.

image

Step 06 – Post message in Teams

Finally, send the message to Teams. I have used a group chat in my case.

image

Flow view:

This is what my simple Power Automate flow looks like:

image