Articles on Trending Technologies

Technical articles with clear explanations and examples

How to create a triangle using Python for loop?

Sravani S
Sravani S
Updated on 17-Jun-2020 6K+ Views

There are multiple variations of generating triangle using numbers in Python. Let's look at the 2 simplest forms:for i in range(5):    for j in range(i + 1):       print(j + 1, end="")    print("")This will give the output:1 12 123 1234 12345You can also print numbers continuously using:start = 1 for i in range(5):    for j in range(i + 1):       print(start, end=" ")       start += 1    print("")This will give the output:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15You can also print these numbers in reverse using:start = 15 for i in range(5):    for j in range(i + 1):       print(start, end=" ")       start -= 1    print("")This will give the output:15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

Read More

Connectionless Services

Arushi
Arushi
Updated on 17-Jun-2020 5K+ Views

A Connectionless service is a data communication between two nodes where the sender sends data without ensuring whether the receiver is available to receive the data. Here, each data packet has the destination address and is routed independently irrespective of the other packets. Thus the data packets may follow different paths to reach the destination. There’s no need to setup connection before sending a message and relinquish it after the message has been sent. The data packets in a connectionless service are usually called datagrams.Protocols for connectionless services are −Internet Protocol (IP)User Datagram Protocol (UDP)Internet Control Message Protocol (ICMP)Connectionless services ...

Read More

Reference Models in Computer Network

Paul Richard
Paul Richard
Updated on 17-Jun-2020 25K+ Views

In computer networks, reference models give a conceptual framework that standardizes communication between heterogeneous networks.The two popular reference models are −OSI ModelTCP/IP Protocol SuiteOSI ModelOSI or Open System Interconnection model was developed by International Standards Organization (ISO). It gives a layered networking framework that conceptualizes how communication should be done between heterogeneous systems. It has seven interconnected layers.The seven layers of the OSI Model are a physical layer, data link layer, network layer, transport layer, session layer, presentation layer, and application layer. The hierarchy is depicted in the following figure −TCP / IP PROTOCOL SUITETCP stands for Transmission Control Protocol, while ...

Read More

How do I run two python loops concurrently?

Lakshmi Srinivas
Lakshmi Srinivas
Updated on 17-Jun-2020 899 Views

You will need to use a multiprocessing library. You will need to spawn a new process and provide the code to it as an argument. For example,from multiprocessing import Processdef loop_a():    for i in range(5):       print("a") def loop_b():    for i in range(5):       print("b") Process(target=loop_a).start() Process(target=loop_b).start()This might process different outputs at different times. This is because we don't know which print will be executed when.

Read More

The Data Link Layer of OSI Model

Vikyath Ram
Vikyath Ram
Updated on 17-Jun-2020 2K+ Views

The data link layer (Layer 2) converts the raw transmission facility provided by the physical layer to a reliable and error-free link.The main functions of the data link layer are as follows −It breaks up the stream of bits into data frames having sizes from a few hundred to a few thousand bytes.It ensures distribution of the frames to the different systems. For this, it adds a header to the frame containing the address of the sender and the receiver.In case of reliable connection, this layer ensures that the receiver sends an acknowledgement frame. In absence of acknowledgement frames, frame ...

Read More

How to handle exception inside a Python for loop?

Arjun Thakur
Arjun Thakur
Updated on 17-Jun-2020 3K+ Views

You can handle exception inside a Python for loop just like you would in a normal code block. This doesn't cause any issues. For example,for i in range(5):    try:       if i % 2 == 0:          raise ValueError("some error")       print(i) except ValueError as e:    print(e)This will give the outputsome error 1 some error 3 some error

Read More

Set blue outlined Bootstrap 4 Button

Ricky Barnes
Ricky Barnes
Updated on 17-Jun-2020 161 Views

To set blue outlined Bootstrap 4 button, use the .btn-outline-primary class.Add a blue outline to a button −   Blue outline You can try to run the following code to implement the btn-outline-primary class in Bootstrap −ExampleLive Demo       Bootstrap Example                             Bootstrap 4     You can see blue outline below:     Blue outline

Read More

Bootstrap 4 Button .btn-outline-light class

Ricky Barnes
Ricky Barnes
Updated on 17-Jun-2020 208 Views

Use the btn-outline-light class in Bootsrap 4 to set light grey outlined button.To include it on the web page, set it as a class in the element as shown in the following code snippet −Let us see an example to implement the btn-outline-light class −ExampleLive Demo       Bootstrap Example                         Demo Button   Below is a light grayed outline button:       Sample  

Read More

Align gathered items from the start in Bootstrap 4

Ricky Barnes
Ricky Barnes
Updated on 17-Jun-2020 146 Views

To align gathered items from the start, use the .align-content-start class in Bootstrap 4.Set the items as shown below −   Work 1   Work 2   Work 3   Work 4   Work 5   Work 6 You can try to run the following code to implement the align-content-start in Bootstrap 4 −ExampleLive Demo       Bootstrap Example                             Align Flex Items           Work 1       Work 2       Work 3       Work 4       Work 5       Work 6       Work 7       Work 8       Work 9       Work 10       Work 11       Work 12       Work 13       Work 14        

Read More

bg-light class for Bootstrap 4 cards

Ricky Barnes
Ricky Barnes
Updated on 17-Jun-2020 461 Views

To set a light grey background for the Bootstrap 4 cards, use the bg-light class.Use “card bg-light” like any other class in Bootstrap −   Image Editor The above gives a light grey background to the Bootstrap card.Let us see an example of the card-light class −ExampleLive Demo       Bootstrap Example                             Web Tools           Image Editor             Image Optimizer      

Read More
Showing 45411–45420 of 61,248 articles
Advertisements