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

Stuff that inspire you to create.

See also: ▙ @LitMind
Download Telegram
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.
Chinese room thought experiment
#John_Searle

Suppose that artificial intelligence research has succeeded in constructing a computer that behaves as if it understands Chinese. It takes Chinese characters as input and, by following the instructions of a computer program, produces other Chinese characters, which it presents as output. Suppose that this computer performs its task so convincingly that it comfortably passes the #Turing_test: it convinces a human Chinese speaker that the program is itself a live Chinese speaker. To all of the questions that the person asks, it makes appropriate responses, such that any Chinese speaker would be convinced that they are talking to another Chinese-speaking human being.

Strong AI versus Weak AI
Does the machine literally "understand" Chinese? Or is it merely simulating the ability to understand Chinese?

Searle then supposes that he is in a closed room and has a book with an English version of the computer program, along with sufficient paper, pencils, erasers, and filing cabinets. Searle could receive Chinese characters through a slot in the door, process them according to the program's instructions, and produce Chinese characters as output. If the computer had passed the Turing test this way he would do so as well, simply by running the program manually.

There is no essential difference between the roles of the computer and him in the experiment. Each simply follows a program, step-by-step, producing a behavior which is then interpreted as demonstrating intelligent conversation. However, he would not be able to understand the conversation.

“I don't speak a word of Chinese.” — #John_Searle

Therefore, it follows that the computer would not be able to understand the conversation either.

Without "understanding", we cannot describe what the machine is doing as "thinking" and, since it does not think, it does not have a "mind" in anything like the normal sense of the word. Therefore, he concludes that "strong AI" is false.
Everything is better with customization.