loop programming definition Its best to illustrate the


loop programming definition





It's best to illustrate the operating principle of a loop with a simple Python example. The following small script calculates the sum of the numbers from 1 to 100. We will later introduce a more elegant way to do it. #!/usr/bin/env python 3 n = 100 s = 0 counter = 1 while counter <= n: s = s + counter += 1 print("Sum of 1 until %d: %d" % (n, s)) https: //www. python-course. eu/index. php


States - Καταστάσεις Finite State Machine (FSM) A "Finite State Machine" (abbreviated FSM), also called "State Machine" or "Finite State Automaton" is an abstract machine which consists of a set of states (including the initial state and one or more end states), a set of input events, a set of output events, and a state transition function. A transition function takes the current state and an input event as an input and returns the new set of output events and the next (new) state. Some of the states are used as "terminal states". The operation of an FSM begins with a special state, called the start state, proceeds through transitions depending on input to different states and normally ends in terminal or end states. A state which marks a successful flow of operation is known as an accept state


Unix or Linux pipes applications: Small elements are put together by using pipes. Processes are chained together by their standard streams, i. e. the output of one process is used as the input of another process. To chain processes like this, so-called anonomymous pipes are used. The concept of pipes and pipelines was introduced by Douglas Mc. Ilroy, one of the authors of the early command shells, after he noticed that much of the time they were processing the output of one program as the input to another. Ken Thompson added the concept of pipes to the UNIX operating system in 1973. Pipelines have later been ported to other operating systems like DOS, OS/2 and Microsoft Windows as well. Generally there are two kinds of pipes: • anonymous pipes and • named pipes






How a simple mix of objectoriented programming can sharpen your deep learning prototype





Textual Programming Textual D. E. solver


Lookup Table

Lookup Table




Inheritance - Κληρονομικότητα Ιn defining inheritance hierarchy we define certain restrictions, not all of which are desirable In object-oriented programming, inheritance is the mechanism of basing an object or class upon another object (prototype-based inheritance) or class (class-based inheritance), retaining similar implementation.

Syntax of Inheritance in Python The syntax for a subclass definition looks like this: class Derived. Class. Name(Base. Class. Name): pass



Fork Long before biologists started their research of cloning, computer scientists had a successful history of cloning. They cloned processes, though they didn't call it cloning but forking. Forking is one of the most important aspects of Unix and Linux. When a process forks, it creates a copy of itself. More generally, a fork in a multithreading environment means that a thread of execution is duplicated, creating a child thread from the parent thread. they are identical but can be told apart. The fork operation creates a separate address space for the child. The child process has an exact copy of all the memory of the parent process. The execution of the parent and child process is independent of each other. In computer science the term fork stands for at least two different aspects: • The cloning of a process, as roughly described above. • In software engineering, a project fork happens when developers take a legal copy of source code from one software package and start independent development on it. This way starting a distinct piece of software. Fork in Python The system function call fork() creates a copy of the process, which has called it. This copy runs as a child process of the calling process. The child process gets the data and the code of the parent process. The child process receives a process number (PID, Process IDentifier) of its own from the operating system. The child process runs as an independent instance, this means independent of a parent process. With the return value of fork() we can decide in which process we are: 0 means that we are in the child process while a positive return value means that we are in the parent process. A negative return value means that an error occurred while trying to fork. To be able to fork processes we need to import the os module in Python.


Creating dynamic websites with Python with mod_python and WSGI mod_python is an Apache HTTP Server module. It's purpose is to integrate Python programming with the Apache web server, or in other words a Python language binding for the Apache HTTP Server. The official website of mod_python says that it possible to write "with mod_python web-based applications in Python that run many times faster than traditional CGI and will have access to advanced features such as ability to retain database connections and other data between hits and access to Apache internals. " mod_python has been pronounced dead some years ago. So it didn't look to be a good idea to use it for new projects. It never died, it was only "sleeping". It came to life again in 2013!


- Slides: 37