ComputerScientist
174 subscribers
14 photos
3 files
206 links
▜ The Inventor

Stuff that inspire you to create.

See also: ▙ @LitMind
Download Telegram
DRY vs. WET

Don't repeat yourself

We enjoy typing or Write everything twice

Nile, unlike the river, is definitely DRY.
HTML

Browsers automatically add an empty line before and after a paragraph.

Superscript and subscript

It is not recommended that you use headings just to make the text big or bold, because search engines use headings to index the web page structure and content.

br means new line
hr mean rule

HTML documents consist of nested HTML elements. In the example below, the body element includes the <p> tags, the <br /> tag and the content, "This is a paragraph".
REWRITING THE CHANNEL
#Programming_paradigms : Declarative versus Imperative

#Declarative
All about relations.

Does not state the order in which operations execute.

Focuses on what the program should accomplish without specifying how the program should achieve the result.
Expresses the logic of a computation without describing its control flow.

Common declarative languages include those of database query languages (e.g. #SQL, #XQuery), regular expressions (#Regex), logic programming, functional programming, and configuration management systems.

e.g. #Haskell, #Kanren (a dialect of #Scheme), #Prolog, #Wolfram_Language

#Imperative
Uses statements that change a program's state.
1. they state the order in which operations occur, with constructs that explicitly control that order

Allows side effects, in which state can be modified within one unit of code, and then read inside a different unit of code.

Imperative programming focuses on describing how a program operates.
an imperative program consists of commands for the computer to perform.
Many imperative programming languages (such as #Fortran, #BASIC, and #C) are abstractions of assembly language.
#Programming_paradigms : #Logic programming
Based on formal logic.
Any program is a set of sentences in logical form, expressing facts and rules about some problem domain.
Major logic programming language families include #Prolog, Answer set programming (#ASP) and #Datalog.

In all of these languages, rules are written in the form of clauses:
H if B1 and … and Bn.

H is called the head of the rule and B1, …, Bn is called the body.

Facts are rules that have no body.
Loading images takes time. Using large images can slow down your page, so use them with care.
Microsoft Compiled HTML Help (#chm)
CHM is an #HTML help file for online helps. It is proprietary format from #Microsoft. In CHM file a number of HTML help files are compressed, compiled and indexed. CHM files are used mostly as software manual. #LZX compression technique is used to compress files in CHM format. There is a search option in this file. Moreover multiple CHM files can be added together.

Portable Document Format (#pdf)
PDF is a document file format that contains text, images, data etc. This document type is Operating System independent. It is an open standard that compresses a document and #vector graphics. It can be viewed in web browsers if the PDF plug-in is installed on the browser.
To avoid any confusion while working with #regex, we would use raw strings as r"expression".
Raw strings don't escape anything, which makes use of regular expressions easier.
A List comprehension is a syntactic construct used to create a list:

• based on existing lists.
• in an easy natural way like a mathematician is used to do.
• whose contents obey a simple rule.

en.wikipedia.org/wiki/Set-builder_notation
#Programming_paradigms : #Functional programming

Seeks to use pure functions.

Pure functions:
• have no side effects
• return a value that depends only on their arguments. e.g. sin(x) will, for the same value of x, always return the same result.
• are easier to reason about and test.
• are more efficient. Once the function has been evaluated for an input, the result can be stored and referred to the next time the function of that input is needed, reducing the number of times the function is called. This is called #memoization.
• are less confusing to run in parallel (See #concurrent programming).

Using only pure functions complicates the otherwise simple task of IO since this appears to inherently require side effects.
#Anonymous_functions

While def assigns the created Function object to a variable, lambda creates it on the fly, mostly used when passing a simple function as an argument.

Syntax : consists of the lambda keyword, a list of arguments, a colon, and the expression to be evaluated and returned.
More like the musing of a crazed crazy learning actual programming
Forwarded from Mahdi
A compliment?
#Atomic_operations also linearizable, indivisible or uninterruptible

In #concurrent programming, an operation or set of operations is atomic if it appears to the rest of the system to occur at once without being interrupted.

Atomic operations commonly have a succeed-or-fail definition. They either successfully change the state of the system, or have no apparent effect.
#Redis
“Best DB in the world.” — #TheSemicolon

A database server.
Provides an API which people make modules off of.
Can be used offline.

Offers the redis module for Python.

But needs a server (it's own binary and process).
#Binary_code_compatibility is when systems can run the same #executable, typically #machine_code for a general-purpose computer.

#Source_code_compatibility on the other hand, is when recompilation or interpretation is necessary.

#executable code causes a computer to perform indicated tasks according to encoded instructions as opposed to a data file that must be parsed by a program to be meaningful.

In some contexts a file containing bytecode or scripting language instructions may also be considered executable.

#machine_code means either the assembly code or its binary sequence translation.
#Citron

Types:
Are Object s.
Are not concrete.

Base types:
Are defined in #C or members of the Extensions namespace.
Are not compiled until needed.
Are simply terminal types. (Reflect typeOf: obj will stop going lower when it reaches them)

• Number
• String
• File
• IO
• Boolean
• Array
• Tuple
• Block
• Applicative
Scalable Vector Graphics (#SVG) is an #XML-based vector image format for two-dimensional graphics with support for interactivity and animation.

All major modern web browsers have SVG rendering support.
#Programming_paradigms : #Array_programming (also vector or multidimensional)

Generalizes operations on scalars to apply transparently to vectors, matrices, and higher-dimensional arrays.

Is used in scientific and engineering settings.

e.g. APL, J, Fortran, #Ada, #MATLAB, #Perl Data Language (PDL) and the NumPy extension to #Python.

Vectorized operation
Operations applied at once to an entire set of values like arrays; regardless of whether it is executed on a vector processor or not.

Function rank
Analogous to tensor rank in mathematics
Functions that operate on data may be classified by the number of dimensions they act on.

• Ordinary multiplication, for example, is a scalar ranked function because it operates on zero-dimensional data (individual numbers).

• The cross product operation is an example of a vector rank function because it operates on vectors, not scalars.

• Matrix multiplication is an example of a 2-rank function, because it operates on 2-dimensional objects (matrices).

Collapse operators reduce the dimensionality of an input data array by one or more dimensions. For example, summing over elements collapses the input array by 1 dimension.