#toRead
📚 A case against syntax highlighting
by Linus Åkesson
http://www.linusakesson.net/programming/syntaxhighlighting/
📚 A case against syntax highlighting
by Linus Åkesson
http://www.linusakesson.net/programming/syntaxhighlighting/
“Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods. I grew up and today I use monochromatic numerals.”
— Rob Pike
— Rob Pike
“No syntax highlighting isn’t really what I wanted, I wanted nearly none. Still like string backgrounds to be tweaked and comments to be faded.”
― Robert Melton
― Robert Melton
#regex
Regex Cheatsheet
All the rules apply to all of the three languages: #Python, #Perl (PCRE) and #JavaScript, unless stated otherwise.
Source: debuggex.com
Basics
Quantifiers
⚠️ Default is greedy. Append ? for reluctant.
Groups
Python and PCRE:
PCRE only:
Character Classes
Assertions
Python and PCRE:
PCRE:
Flags
Python and PCRE:
JavaScript only:
Special Characters
JavaScript and PCRE:
Hexadecimal character YY (
Replacement
Python only:
JavaScript only:
Escapes
PCRE only:
POSIX Classes
PCRE only:
Regex Cheatsheet
All the rules apply to all of the three languages: #Python, #Perl (PCRE) and #JavaScript, unless stated otherwise.
Source: debuggex.com
Basics
.: Any character except newlinea: The character aab: The string aba|b: a or ba*: 0 or more a's\: Escapes a special characterQuantifiers
*: 0 or more+: 1 or more?: 0 or 1{2}: Exactly 2{2, 5}: Between 2 and 5{2,}: 2 or more(,5}: Up to 5 (Python only)⚠️ Default is greedy. Append ? for reluctant.
Groups
(...): Capturing group(?:...): Non-capturing group\Y: Match the Y'th captured groupPython and PCRE:
(?P<Y>...): Capturing group named Y(?P=Y): Match the named group Y(?#...): CommentPCRE only:
(?>...): Atomic group(?|...): Duplicate group numbers(?R): Recurse into entire pattern(?Y): Recurse into numbered group Y(?&Y): Recurse into named group Y\g{Y}: Match the named or numbered group Y\g<Y>: Recurse into named or numbered group YCharacter Classes
[ab-d]: One character of: a, b, c, d[^ab-d]: One character except: a, b, c, d[\b]: Backspace character\d: One digit\D: One non-digit\s: One whitespace\S: One non-whitespace\w: One word character\W: One non-word characterAssertions
^: Start of string$: End of string\b: Word boundary\B: Non-word boundary(?=...): Positive lookahead(?!...): Negative lookaheadPython and PCRE:
\A: Start of string, ignores m flag\Z: End of string, ignores m flag(?<=...): Positive lookbehind(?<!...): Negative lookbehind(?()|): ConditionalPCRE:
\G: Start of matchFlags
i: Ignore casem: ^ and $ match start and end of linePython and PCRE:
s: . matches newline as wellx: Allow spaces and commentsL: Locale character classesu: Unicode character classes(?iLmsux): Set flags within regexJavaScript only:
g: Global MatchSpecial Characters
\n: Newline\r: Carriage return\t: Tab\YYY: Octal character YYY\xYY: Hexadecimal character YYJavaScript and PCRE:
\0: Null character\cY: Control character YHexadecimal character YY (
\uYY for JavaScript and \x{YY} for PCRE)Replacement
Python only:
\g<0>: Insert entire match\g<Y>: Insert match Y (name or number)\Y: Insert group numbered YJavaScript only:
$$: Inserts $$&: Insert entire match$`: Insert preceding string$': Insert following string$Y: Insert Y'th captured groupEscapes
PCRE only:
\Q..\E: Remove special meaningPOSIX Classes
PCRE only:
[:alnum:]: Letters and digits[:alpha:]: Letters[:ascii:]: Ascii codes 0 - 127[:blank:]: Space or tab only[:cntrl:]: Control characters[:digit:]: Decimal digits[:graph:]: Visible characters, except space[:lower:]: Lowercase letters[:print:]: Visible characters[:punct:]: Visible punctuation characters[:space:]: Whitespace[:upper:]: Uppercase letters[:word:]: Word characters[:xdigit:]: Hexadecimal digits#toRead
📚 Writing a TextMate Grammar
by Matt Neuburg
https://www.apeth.com/nonblog/stories/textmatebundle.html
📚 Writing a TextMate Grammar
by Matt Neuburg
https://www.apeth.com/nonblog/stories/textmatebundle.html
Why returns a causal link.
How returns a causal tree, which is comprised of causal links.
How returns a causal tree, which is comprised of causal links.
#AI
AI-completeness
The most difficult problems are informally known as AI-complete or AI-hard, by analogy with NP-complete and NP-hard in complexity theory, implying that the difficulty of these computational problems is equivalent to that of solving the central artificial intelligence problem—making computers as intelligent as people, or strong AI. Since many AI problems have no formalisation yet, conventional complexity theory does not allow the definition of AI-completeness. To call a problem AI-complete reflects an attitude that it would not be solved by a simple specific algorithm. They include:
• Computer vision (and subproblems such as object recognition)
• Natural language understanding (and subproblems such as text mining, machine translation, and word sense disambiguation)
• Dealing with unexpected circumstances while solving any real world problem, whether it's navigation or planning or even the kind of reasoning done by expert systems.
• Peer Review
• Bongard problems
• Automatic speech recognition
AI-completeness
The most difficult problems are informally known as AI-complete or AI-hard, by analogy with NP-complete and NP-hard in complexity theory, implying that the difficulty of these computational problems is equivalent to that of solving the central artificial intelligence problem—making computers as intelligent as people, or strong AI. Since many AI problems have no formalisation yet, conventional complexity theory does not allow the definition of AI-completeness. To call a problem AI-complete reflects an attitude that it would not be solved by a simple specific algorithm. They include:
• Computer vision (and subproblems such as object recognition)
• Natural language understanding (and subproblems such as text mining, machine translation, and word sense disambiguation)
• Dealing with unexpected circumstances while solving any real world problem, whether it's navigation or planning or even the kind of reasoning done by expert systems.
• Peer Review
• Bongard problems
• Automatic speech recognition
#HCI
Baby duck syndrome
- denotes the tendency for computer users to "imprint" on the first system they learn, then judge other systems by their similarity to that first system. The result is that "users generally prefer systems similar to those they learned on and dislike unfamiliar systems". The issue may present itself relatively early in a computer user's experience, and it has been observed to impede education of students in new software systems or user interfaces.
Baby duck syndrome
- denotes the tendency for computer users to "imprint" on the first system they learn, then judge other systems by their similarity to that first system. The result is that "users generally prefer systems similar to those they learned on and dislike unfamiliar systems". The issue may present itself relatively early in a computer user's experience, and it has been observed to impede education of students in new software systems or user interfaces.
#Design
Software archaeology
- is the study of poorly documented or undocumented legacy software implementations, as part of software maintenance. It includes the reverse engineering of modules, and the application of a variety of tools and processes for extracting and understanding program structure and recovering design information.
Software archaeology
- is the study of poorly documented or undocumented legacy software implementations, as part of software maintenance. It includes the reverse engineering of modules, and the application of a variety of tools and processes for extracting and understanding program structure and recovering design information.
#toRead #AI
📚 Index of Bongard Problems
by Mikhail Bongard, Douglas Hofstadter, Harry Foundalis, ...
http://www.foundalis.com/res/bps/bpidx.htm
📚 Index of Bongard Problems
by Mikhail Bongard, Douglas Hofstadter, Harry Foundalis, ...
http://www.foundalis.com/res/bps/bpidx.htm
Language processing terminology
Source code: a program written in a high-level language.
Preprocessor: does macro-processing, augmentation, file inclusion, language extension, etc.
Compiler: compiles the program and translates it to assembly program i.e. low-level language.
Assembler: translates assembly language programs into an object file, a.k.a. machine code, which contains a combination of instructions and data.
Linker: links and merges various object files together in order to make an executable file. All these files might have been compiled by separate assemblers. The major task of a linker is to search and locate referenced module/routines in a program and to determine the memory location where these codes will be loaded, making the program instruction to have absolute references.
Loader: loads executable files into memory and executes them. It calculates the size of a program and creates memory space for it. It initializes various registers to initiate execution. It is a part of the operating system.
Interpreter versus compiler:
An interpreter reads, converts, and executes one statement at a time. A compiler reads, converts, and executes the whole source code at once. If an error occurs, an interpreter stops execution and reports it. A compiler reads the whole program even if it encounters errors.
Cross-compiler: runs on one platform and is capable of generating executable code for another one is called a cross-compiler.
Source-to-source compiler: takes the source code and translates it into the source code of another programming language.
Source code: a program written in a high-level language.
Preprocessor: does macro-processing, augmentation, file inclusion, language extension, etc.
Compiler: compiles the program and translates it to assembly program i.e. low-level language.
Assembler: translates assembly language programs into an object file, a.k.a. machine code, which contains a combination of instructions and data.
Linker: links and merges various object files together in order to make an executable file. All these files might have been compiled by separate assemblers. The major task of a linker is to search and locate referenced module/routines in a program and to determine the memory location where these codes will be loaded, making the program instruction to have absolute references.
Loader: loads executable files into memory and executes them. It calculates the size of a program and creates memory space for it. It initializes various registers to initiate execution. It is a part of the operating system.
Interpreter versus compiler:
An interpreter reads, converts, and executes one statement at a time. A compiler reads, converts, and executes the whole source code at once. If an error occurs, an interpreter stops execution and reports it. A compiler reads the whole program even if it encounters errors.
Cross-compiler: runs on one platform and is capable of generating executable code for another one is called a cross-compiler.
Source-to-source compiler: takes the source code and translates it into the source code of another programming language.
Ambiguity := one source code having more than one acceptable target codes.