Functional Programming Examples for Practice

Functional Programming. Part II:

The Essence of Functional Programming: Practical Implementation

Part I has discussed the functional programming paradigm in general, with its concepts, differences from the declarative paradigm, and advantages and disadvantages. Though all of this is hard to implement in one language, it is possible to write a program in any programming language using functional style. Here we will observe the practical side of functional programming and try to implement its concepts in Python in simple examples. Continue reading

Solution of Differential Equation for a Tank Problem

A tank contains 2,500 liters of water in which 5 kg of salt is dissolved at the initial time. The solution drains from the tank at a rate of 100 l/min and another water solution (with 10 g of salt per 1 l of water) enters the tank at the same rate. Assume that the solution is well stirred (the salt concentration is the same everywhere in the tank). What is the equation for finding the amount of salt at any time? Draw the plot. Determine the time when there will be 20 kg of salt in the tank. Continue reading

Solving IP Address Conflict Sample

An IP address conflict occurs when two computers in a network are assigned the same IP address. When this happens, it renders one or both computers unable to connect to a network resource or perform other network operations. Almost all operating systems notify the user via pop-up notification when an IP conflict is detected with another computer. This network problem, although rare, is a very real issue to end-users and network administrators. Continue reading