A circuit switching network has a guaranteed bandwidth, since the entire established circuit is dedicated to the communication between the two parties. The disadvantage of this is that the resource (the bandwidth) is not guaranteed to be fully utilised
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Lossless reading of a file (line-separators are preserved). | |
| * May temporarily require memory several times the size of the | |
| * file. For a short time the raw file contents (a byte array), | |
| * and the decoded characters reside in memory simultaneously. | |
| * It is safest to apply to files that you know to be small | |
| * relative to the available memory. | |
| * @param path the absolute path of the file. | |
| * @param encoding the charset with which the bytes in the file | |
| * should be decoded. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE MultiWayIf #-} | |
| data Algae = A | B deriving (Show, Eq) | |
| algae :: [Algae] -> [Algae] | |
| algae = concatMap (\c -> if | |
| | c == A -> A:[B] | |
| | c == B -> [A]) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE MultiWayIf #-} | |
| data Variables = Zero | One | LB | RB deriving (Show, Eq) | |
| -- LB and RB symbolises left and right brackets, i.e. [, ] | |
| pythagoras = concatMap (\c -> if | |
| | c == Zero -> One : [LB, Zero, RB, Zero] | |
| | c == One -> One : [One] | |
| | c == LB -> [LB] | |
| | c == RB -> [RB]) |
The most common functions in a protocol should handle
- The dialogue, who gets to send in which order
- The addressing, how to broadcast one's identity and the identity of one's intended recipient.
- Frame-format, how information (data) is packaged (framed)
- Error-handling
The different layers that make up the internet protocol stack are
- Application
- Transport
- Network
- Link
- Physical
Computer communication and computer networking (Datakommunikation och datornät, DOD)
Within computer networking one often speaks of a layered architecture.
- Question 1.1 What does one mean by this term, i.e. layered architecture?
Answer: With a layered architecture one is referring to a system that is modularized in such a way that the system is composed in layers where each layer provides a
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Provides the necessary interface for a typesafe heterogeneous | |
| * container, where the key and the return type is parametrized. | |
| * | |
| * A parametrized key is used to insert and retrieve values. By | |
| * utilising the generic type system the type of the value returned is | |
| * guaranteed to be the same as its key. | |
| * | |
| * The parametrized return value is to allow for a facsimile to a | |
| * builder pattern, leading to brevity of expression for adding |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [n, difference] = decimal_expansion_difference(target, actual, pertinent_digits) | |
| %DECIMAL_EXPANSION_DIFFERENCE Inspect differing digits in decimal expansion | |
| % | |
| % INPUT: | |
| % target the target value. | |
| % actual the computed value, its distance must be < 1 away from target. | |
| % If violated you will incur an assertion error. | |
| % pertinent_digits an upper bound for beyond which we stop caring about the amount | |
| % of differing digits in the decimal expansion. | |
| % |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| data D0L m a = D0L { axiom :: m a | |
| , rules :: a -> m a | |
| } | |
| appliedTo :: Monad m => (a -> m b) -> m a -> m b | |
| appliedTo = flip (>>=) | |
| eval :: Monad m => D0L m a -> D0L m a | |
| eval (D0L axiom rules) = D0L (rules `appliedTo` axiom) rules |
OlderNewer