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

Stuff that inspire you to create.

See also: ▙ @LitMind
Download Telegram
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.
TCL (transform, clipping, and lighting)
A term used in #graphics

• Transformation
Producing a two-dimensional view of a three-dimensional scene

• Clipping
Drawing only the parts of the scene that are present in the picture

• Lighting
Altering the color of the various surfaces of the scene on the basis of lighting information
Virtual function
A member function that you expect to be redefined in derived classes.
~ MSDN, #CPP

Virtual function or method
A function or method whose behaviour can be overridden within an inheriting class by a function with the same signature to provide the polymorphic behavior.
~ Wikipedia
#Python
Attribute versus Property
An attribute with a __get__, __set__, or __delete__ method is a property.

Properties
Are created by putting the @property decorator above a method defenition. This means that when the instance attribute with the same name as the method is accessed, the method will be called instead.
#Python
Classes
A class is a new type of object which can have instances.

An instance has:
• Attributes — for maintaining its state, defined by its constructor
• Methods — for modifying its state, defined by its class

🔥 Methods are actually attributes. More specifically, class attributes.

Definition
class ClassName:
classAttribute = value
def __init__(self, a):
self.a = a


⚠️ All methods must have self as their first parameter.
⚠️ Instances inherit class attributes upon construction.

Instantiation
x = ClassName(a)

⚠️ Classes are created at runtime and can be modified after creation.

Terminology
• base class = parent class
• derived class = child class
• derive = inherit
• attribute = data member
• method = function member


Inheritance
• Multiple base classes are allowed.
• The derived class can override any methods of its base classes. i.e. all member functions are virtual and can be overridden.

class Pizza(Food):

Polymorphism
• A method can call the method of a base class with the same name.

Incapsulation
• members are normally public except Private Variables
The Jack human simulation system
Conceived as an ergonomic assessment and virtual human prototyping system, Jack was developed at the University of Pennsylvania in the 80s & 90s for for #NASA. It soon gathered funding from the U.S. Navy, U.S. Army, U.S. Air Force and other government and corporate users for their own applications.
#ergonomics

In 1996 the software was split off as a separate private company and is now sold by #Siemens as an ergonomic human simulation toolkit called Tecnomatix Jack.

H-Anim (Humanoid Animation)
An ISO standard for humanoid modeling and animation, H-Anim defines a specification for defining interchangeable human figures so that those characters can be used across a variety of 3D games and simulation environments.

Developed in the late 1990s, it was significantly influenced by the Jack human modeling.
#animation #graphics #ergonomics #gameIndustry

Inverse kinematics
Is the mathematical process of recovering the movements of an object in the world from some data such as films of those movements or films of the world seen from a camera making those movements.
#robotics #animation

The roots of most modern human animation inverse kinematics systems, including those integrated with #Autodesk's 3ds max and #Maya, can be traced to the research and development done for the Jack system.