Articles on Trending Technologies

Technical articles with clear explanations and examples

How to use Boto3 to paginate through all triggers present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 269 Views

Problem Statement: Use boto3 library in Python to paginate through all triggers from AWS Glue Data Catalog that is created in your account Approach/Algorithm to solve this problem Step 1: Import boto3 and botocore exceptions to handle exceptions. Step 2: max_items, page_size and starting_token are the optional parameters for this function max_items denote the total number of records to return. ...

Read More

Python Program to Find Nth Node in the Inorder Traversal of a Tree

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 289 Views

Finding the nth node in inorder traversal of a binary tree is a common problem in tree algorithms. Inorder traversal visits nodes in the order: left subtree → root → right subtree. This article demonstrates how to find the nth node efficiently using a binary tree class with inorder traversal methods. Understanding Inorder Traversal In inorder traversal, nodes are visited in this sequence: Traverse the left subtree Visit the root node Traverse the right subtree For a binary search tree, inorder traversal gives nodes in sorted order. Binary Tree Implementation Here's a complete ...

Read More

How to use Boto3 to paginate through all tables present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 913 Views

AWS Glue Data Catalog stores metadata about your data sources. When you have many tables, pagination helps retrieve them efficiently without overwhelming your application. The boto3 library provides built-in pagination support for AWS Glue operations. Understanding Pagination Parameters The pagination configuration accepts three optional parameters: max_items: Total number of records to return across all pages page_size: Number of records per page (default is 100) starting_token: Token from previous response to resume pagination Setting up AWS Glue Client First, create a boto3 session and Glue client. Ensure your AWS credentials and region are configured ...

Read More

Python Program to Convert a given Singly Linked List to a Circular List

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 423 Views

A singly linked list can be converted to a circular linked list by making the last node point to the head node instead of None. This creates a circular structure where traversal can continue indefinitely. Node and LinkedList Structure First, we define the basic node and linked list classes ? class Node: def __init__(self, data): self.data = data self.next = None class LinkedList_struct: def __init__(self): ...

Read More

How to use Boto3 to paginate through table versions of a table present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 334 Views

Problem Statement: Use boto3 library in Python to paginate through table versions of a table from AWS Glue Data Catalog that is created in your account. Approach/Algorithm to solve this problem Step 1: Import boto3 and botocore exceptions to handle exceptions. Step 2: max_items, page_size and starting_token are the optional parameters for this function, while database_name and table_name are required. max_items denotes the total number of records to ...

Read More

Python program to find Tuples with positive elements in List of tuples

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 657 Views

When it is required to find tuples that have positive elements from a list of tuples, list comprehension along with the all() function can be used. This approach checks if all elements in each tuple are non-negative. Syntax result = [tuple for tuple in list_of_tuples if all(element >= 0 for element in tuple)] Example The following example demonstrates how to filter tuples containing only positive elements ? my_list = [(56, 43), (-31, 21, 23), (51, -65, 26), (24, 56)] print("The list is:") print(my_list) my_result = [sub for sub in my_list ...

Read More

Python program to find tuples which have all elements divisible by K from a list of tuples

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 962 Views

When it is required to find tuples that have all elements divisible by a specific value 'K', list comprehension along with the all() function can be used. The all() function returns True only when all elements in the tuple satisfy the divisibility condition. Example Let's find tuples where all elements are divisible by K ? my_list = [(45, 90, 135), (71, 92, 26), (2, 67, 98)] print("The list is:") print(my_list) K = 45 print("The value of K has been initialized to") print(K) my_result = [sub for sub in my_list if all(ele % K ...

Read More

Python program to Sort Tuples by their Maximum element

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 358 Views

When it is required to sort tuples based on their maximum element, we can define a function that uses the max() method to find the highest element in each tuple. The sort() method can then use this function as a key to sort the list of tuples. Method 1: Using Custom Function with sort() We can create a helper function to extract the maximum value from each tuple − def get_max_value(my_val): return max(my_val) my_list = [(4, 6, 8, 1), (13, 21, 42, 56), (7, 1, 9, 0), (1, 2)] print("The ...

Read More

Consecutive Nth column Difference in Tuple List using Python

AmitDiwan
AmitDiwan
Updated on 25-Mar-2026 242 Views

When working with lists of tuples, you may need to find the consecutive differences between elements in a specific column. This can be achieved by iterating through the list and using the abs() method to calculate absolute differences. The abs() method returns the absolute (positive) value of a number, while append() adds elements to a list. Example Let's find the consecutive differences in the second column (index 1) of a tuple list ? my_list = [(67, 89, 32), (11, 23, 44), (65, 75, 88)] print("The list is:") print(my_list) print("The value of k has ...

Read More

How to use Boto3 to paginate through security configuration present in AWS Glue

Ashish Anand
Ashish Anand
Updated on 25-Mar-2026 273 Views

In this article, we will see how to paginate through security configuration present in AWS Glue using Boto3. AWS Glue security configurations define encryption settings for data at rest and in transit. Problem Statement Use boto3 library in Python to paginate through security configurations from AWS Glue Data Catalog that are created in your account. Understanding Pagination Parameters The pagination function accepts three optional parameters ? max_items − Total number of records to return. If available records exceed this limit, a NextToken is provided for resuming pagination. page_size ...

Read More
Showing 1–10 of 61,303 articles
« Prev 1 2 3 4 5 6131 Next »
Advertisements