#header-inner {background-position: right !important; width: 100% !important;}

12/14/12

Tail Call

In computer science, a tail call is a subroutine call that happens inside another procedure as its final action; it may produce a return value which is then immediately returned by the calling procedure. The call site is then said to be in tail position, i.e. at the end of the calling procedure. If any call that a subroutine performs, such that it might eventually lead to this same subroutine being called again down the call chain, is in tail position, such a subroutine is said to be tail-recursive. This is a special case of recursion.

Tail calls are significant because they can be implemented without adding a new stack frame to the call stack. Most of the frame of the current procedure is not needed any more, and it can be replaced by the frame of the tail call, modified as appropriate (similar to overlay for processes, but for function calls). The program can then jump to the called subroutine. Producing such code instead of a standard call sequence is called tail call elimination, or tail call optimization.

For example, with Tail Call Optimization, following:

call factorial (3)
 call fact (3 1)
  call fact (2 3)
   call fact (1 6)
    call fact (0 6)
    return 6
   return 6
  return 6
 return 6
return 6

might be optimized into the more efficient variant, in terms of both space and time:

call factorial (3)
 call fact (3 1)
 replace arguments with (2 3), jump to "fact"
 replace arguments with (1 6), jump to "fact"
 replace arguments with (0 6), jump to "fact"
 return 6
return 6

12/12/12

Cryptographic Hash function.

A cryptographic hash function is a hash function; that is, an algorithm that takes an arbitrary block of data and returns a fixed-size bit string, the (cryptographic) hash value, such that an (accidental or intentional) change to the data will (with very high probability) change the hash value. The data to be encoded are often called the "message," and the hash value is sometimes called the message digest or simply digest.

The ideal cryptographic hash function has four main properties:

it is easy to compute the hash value for any given message
it is infeasible to generate a message that has a given hash
it is infeasible to modify a message without changing the hash
it is infeasible to find two different messages with the same hash

Cryptographic hash functions have many information security applications, notably in digital signatures, message authentication codes (MACs), and other forms of authentication.

They can also be used as ordinary hash functions, to index data in hash tables, for fingerprinting, to detect duplicate data or uniquely identify files, and as checksums to detect accidental data corruption.

Indeed, in information security contexts, cryptographic hash values are sometimes called (digital) fingerprints, checksums, or just hash values, even though all these terms stand for functions with rather different properties and purposes.

12/11/12

Integrating 3D Shapes.

Any 3D Shape can be Integrated (it's volume measured).

Just draw it, then visit each pixel inside it's bound, adding it's value (for example 0 if black, 1 if white) to the result value.

Network Theory

Network Theory is an area of computer science and network science and part of graph theory.

It has application in many disciplines including statistical physics, particle physics, computer science, biology, economics, operations research, and sociology.

Network theory concerns itself with the study of graphs as a representation of either symmetric relations or, more generally, of asymmetric relations between discrete objects.

Applications of network theory include logistical networks, the World Wide Web, Internet, gene regulatory networks, metabolic networks, social networks, epistemological networks, etc.

12/3/12

Simple Context Free Grammar Parser

Finite State Automaton can parse words into Tokens, using Regular Expression mechanisms. Then it can parse Tokens into productions (treating each token as letter in a word).

Complex instructions (such as brackets or expressions) can also be parsed this way... just find them using regular expressions, then strip them from token chain and continue processing.

Assignment operations can be done by finding operator and operands, then passing them for further processing.

and so on..

Or...

Create instruction graph (graphical representation of grammar), then join them into one larger part. You can use flow net to process them concurrently, thus quicker.


This allows to build data structure (for example Abstract Syntax Tree), which can be used to generate output (for example code in target language).

12/2/12

Properties of Stitie Machine.

Stitie Machine is Computer Program with Mathematical and Artistic properties. (See Shapes & Forms).

It's about solving riddle. Let's look at it like this:

If we arrange computers (or objects, nodes in graph) in computer memory (or in internet) into 3D Space, connect them as in Stitie Machine (See Stitie Machine post for Stitie Cube illustration), then we can solve problem of delivering information into one or more destinations (points in 3D space, or nodes in graph) optimally.

Using Mathematical Apparatus we can check how securely and how quick information flows from point A to point(s) B,C.... in space. We can know how securely and how quick Lotus transmits information (check properties of Lotus Transmission). And we can (Mindfully) Visualize it to see.

What about Art? It's a way to express... we can model Forms that will appear in computer memory (or in the Internet), give them a go (let them work). Then we can (Mindfully) Image them to display (in any form, including Visual Image, Sound, Combination of such, and so on...) to perceive how such forms appear in computer memory.

Imagine Airplane, covered with network of tiny computers. Such distributed machine would not only automatically detect and visualize failures in network (we know which nodes do not respond), but also lend it's computing power to solving important problems as they arise.

Psychologists might also try to decipher what people think about symbols (for example 3D Forms) in computer memory (that can appear on computer screen).

Stitie Machine can also execute code at each (or any) point in such network.

See also: How to map The Internet in 3D model.