Skip to content

Instantly share code, notes, and snippets.

@GeorgeHernandez
Last active December 15, 2022 23:53
Show Gist options
  • Save GeorgeHernandez/ae5db4f53fc93972517b3c79764b4f9c to your computer and use it in GitHub Desktop.
Save GeorgeHernandez/ae5db4f53fc93972517b3c79764b4f9c to your computer and use it in GitHub Desktop.
Notes on beginnings, endings, and everything in between with a computing emphasis.

Start to Finish

Beginnings

  • The Big Bang.
  • "In the beginning" - Genssis 1:1
  • Birth.
  • Many works start with a Title and a Byline.
  • A Paragraph is a self-contained unit of discourse. In Vim a paragraph begins after each empty line. This is also the case in regular English but sometimes an empty line is replaced with indentation of the 1st line of the paragraph.
  • In computers a magic number is a distinct value or sequence of characters that has particular meaning, often to identify a file format. Some magic numbers include:
    • GIF files start with either
      • "GIF89a" (47 49 46 38 39 61) or
      • "GIF87a" (47 49 46 38 37 61)
    • JPEG files start with FF D8.
    • PDF files start with "%PDF" (25 50 44 46)
    • PNG files start with \211 PNG \r \n \032 \n (89 50 4E 47 0D 0A 1A 0A)
    • Shell scripts start with "#!" (23 21) aka a shebang.
    • Some Unicode files have magic numbers
      • UTF-16 have a BOM of either FE FF for big endian or FF FE for little endian.
      • Some UTF-8 files start with EF BB BF.
    • Zip files start with "PK" (50 4B), the initials of Phil Katz, the author of PKZip.
  • The top of most of my HTML 5 documents SHOULD be: <!DOCTYPE html><html lang="en"><head><meta charset="utf-8">.
  • In computer programming, a sigil is a symbol affixed to a variable name, and sometimes provides info about the variable's data type, scope, etc. E.g.
    • $foo where `$' is the sigil.
    • In Linux:
      $ printf "Open issues: %s\nClosed issues: %s\n" "34" "65"
      Open issues: 34
      Closed issues: 65
  • In computer language design, stropping is a method of explicitly marking letter sequences as having a special property, such as being a keyword, or a certain type of variable or storage location, and thus inhabiting a different namespace from ordinary names ("identifiers"), in order to avoid clashes. E.g.
    • In C#, any variable names may be prefixed with "@". This is mainly used to allow the use of variable names that would otherwise conflict with keywords, e.g. string @public = "foo"; The same is achieved in VB.Net and T-SQL by enclosing the name in square brackets, as in [end].
  • In computer programming, symbols may be affixed to literals to indicate special processing. E.g. In C# a @ may be prefixed to a raw string
    "The Windows path is C:\\Foo\\Bar\\Baz\\"
    @"The Windows path is C:\Foo\Bar\Baz\"
  • In computing and telecommunication, an escape character is a character that invokes an alternative interpretation on the following characters in a character sequence. E.g.
    console.log("Using \\n \nWill shift the characters after \\n one row down")

Everything in between

  • In computers word is a natural unit of data and is most commonly 16 bits or 2 bytes.
  • In regular expressions and Vim: A word is series of word characters ([A-Za-z0-9_] or \w). It is bounded by non-word characters ([^A-Za-z0-9_] or \W). In Vim a WORD is bounded by whitespace ([ \t\r\n\v\f] or \s). E.g.
    This "stuff" is not-so difficult!
    wwww  wwwww  ww www ww wwwwwwwww
    WWWW WWWWWWW WW WWWWWW WWWWWWWWWW
    
  • Documents or transmission often have at least 2 sections: A header (with meta data) and a body (with data). E.g.
    • HTML:
        <html>
          <head>...</head>
          <body>...</body>
        </html>`
    • A transmission with control characters:
      • SOH (01) Start of Header
      • STX (02) Start of Text, i.e. the body.
      • ETX (03) End of Text. Frequently an error-checking checksum would come just before ETX.
      • EOT (04) End of Transmission
  • There are many paired enclosures: "...", '...', (...), {...}, [...], [[...]], etc. Kudos to Bash for its use of "fi" in its if statements. Dare I randomly use START and TRATS?
    if [ $1 -ge 18 ]; then
      echo "You may go to the party.";
    elif [ $2 == 'yes' ]; then
      echo "You may go to the party but be back before midnight.";
    else
      echo "You may not go to the party.";
    fi
  • YAML documents MUST start sub documents with a line with ---, and MAY end sub documents with ....
  • Data often comes as delimter-separted values (DSV). E.g.
  • "Life is what happens when you're busy making other plans." – John Lennon. = Past, Present, Future.

Endings

  • Many English sentences end with a period (.). In Vim sentence ends at a '.', '!' or '?' followed by either the end of a line, or by a space or tab. 2 spaces after a sentence was common practice in the days of typewriters. 2 spaces after sentences persists as an option in computering, e.g. vim and fmt.
  • In computer programming, a statement is a syntactic unit of an imperative programming language that expresses some action to be carried out. The syntax of statements depends on the language, but the most common end of statement (EOS) is a semicolon (;).
  • In computers a newline (aka line break, next line (NEL), end of line (EOL)) is a control character or sequence of control characdters signifying the end of a line of text. The most common EOLs are
    • LF (\n or 0A) for Unix, Linux, macOS, etc.
    • CR LF (\r\n or 0D 0A) for Windows, DOS, etc
    • CR (\r or 0D) for Commodore etc.
  • In computers there is frequently no end-of-file (EOF) indicator, but it is good practices to end all files with a new line so that if you concatenate files, they have some separation.
  • Death.
  • Heat death of the universe and other theories on the ultimate fate of the universe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment