The Real Difference between Integers and Floating-Point

Differences between LISP 1.5 and Common Lisp, Part 1:

[Edit: I didn't mean to put a colon in the title.]
In this post we'll be looking at some of the things that make LISP 1.5 and Common Lisp different. There isn't too much surviving LISP 1.5 code, but some of the code that is still around is interesting and worthy of study.
Here are some conventions used in this post of which you might take notice:
Sources are linked sometimes below, but here is a list of links that were helpful while writing this:
The differences between LISP 1.5 and Common Lisp can be classified into the following groups:
  1. Superficial differences—matters of syntax
  2. Conventional differences—matters of code style and form
  3. Fundamental differences—matters of semantics
  4. Library differences—matters of available functions
This post will go through the first three of these groups in that order. A future post will discuss library differences, except for some functions dealing with character-based input and output, since they are a little world unto their own.
[Originally the library differences were part of this post, but it exceeded the length limit on posts (40000 characters)].

Superficial differences.

LISP 1.5 was used initially on computers that had very limited character sets. The machine on which it ran at MIT, the IBM 7090, used a six-bit, binary-coded decimal encoding for characters, which could theoretically represent up to sixty-four characters. In practice, only fourty-six were widely used. The repertoire of this character set consisted of the twenty-six uppercase letters, the nine digits, the blank character '', and the ten special characters '-', '/', '=', '.', '$', ',', '(', ')', '*', and '+'. You might note the absence of the apostrophe/single quote—there was no shorthand for the quote operator in LISP 1.5 because no sensical character was available.
When the LISP 1.5 system read input from cards, it treated the end of a card not like a blank character (as is done in C, TeX, etc.), but as nothing. Therefore the first character of a symbol's name could be the last character of a card, the remaining characters appearing at the beginning of the next card. Lisp's syntax allowed for the omission of almost all whitespace besides that which was used as delimiters to separate tokens.
List syntax. Lists were contained within parentheses, as is the case in Common Lisp. From the beginning Lisp had the consing dot, which was written as a period in LISP 1.5; the interaction between the period when used as the consing dot and the period when used as the decimal point will be described shortly.
In LISP 1.5, the comma was equivalent to a blank character; both could be used to delimit items within a list. The LISP I Programmer's Manual, p. 24, tells us that
The commas in writing S-expressions may be omitted. This is an accident.
Number syntax. Numbers took one of three forms: fixed-point integers, floating-point numbers, and octal numbers. (Of course octal numbers were just an alternative notation for the fixed-point integers.)
Fixed-point integers were written simply as the decimal representation of the integers, with an optional sign. It isn't explicitly mentioned whether a plus sign is allowed in this case or if only a minus sign is, but floating-point syntax does allow an initial plus sign, so it makes sense that the fixed-point number syntax would as well.
Floating-point numbers had the syntax described by the following context-free grammar, where a term in square brackets indicates that the term is optional:
float: [sign] integer '.' [integer] exponent [sign] integer '.' integer [exponent] exponent: 'E' [sign] digit [digit] integer: digit integer digit digit: one of '0' '1' '2' '3' '4' '5' '6' '7' '8' '9' sign: one of '+' '-' 
This grammar generates things like 100.3 and 1.E5 but not things like .01 or 14E2 or 100.. The manual seems to imply that if you wrote, say, (100. 200), the period would be treated as a consing dot [the result being (cons 100 200)].
Floating-point numbers are limited in absolute value to the interval (2-128, 2128), and eight digits are significant.
Octal numbers are defined by the following grammar:
octal: [sign] octal-digits 'Q' [integer] octal-digits: octal-digit [octal-digit] [octal-digit] [octal-digit] [octal-digit] [octal-digit] [octal-digit] [octal-digit] [octal-digit] [octal-digit] [octal-digit] [octal-digit] octal-digit: one of '0' '1' '2' '3' '4' '5' '6' '7' 
The optional integer following 'Q' is a scale factor, which is a decimal integer representing an exponent with a base of 8. Positive octal numbers behave as one would expect: The value is shifted to the left 3×s bits, where s is the scale factor. Octal was useful on the IBM 7090, since it used thirty-six-bit words; twelve octal digits (which is the maximum allowed in an octal number in LISP 1.5) thus represent a single word in a convenient way that is more compact than binary (but still being easily convertable to and from binary). If the number has a negative sign, then the thirty-sixth bit is logically ored with 1.
The syntax of Common Lisp's numbers is a superset of that of LISP 1.5. The only major difference is in the notation of octal numbers; Common Lisp uses the sharpsign reader macro for that purpose. Because of the somewhat odd semantics of the minus sign in octal numbers in LISP 1.5, it is not necessarily trivial to convert a LISP 1.5 octal number into a Common Lisp expression resulting in the same value.
Symbol syntax. Symbol names can be up to thirty characters in length. While the actual name of a symbol was kept on its property list under the pname indicator and could be any sequence of thirty characters, the syntax accepted by the read program for symbols was limited in a few ways. First, it must not begin with a digit or with either of the characters '+' or '-', and the first two characters cannot be '$'. Otherwise, all the alphanumeric characters, along with the special characters '+', '-', '=', '*', '/', and '$'. The fact that a symbol can't begin with a sign character or a digit has to do with the number syntax; the fact that a symbol can't begin with '$$' has to do with the mechanism by which the LISP 1.5 reader allowed you to write characters that are usually not allowed in symbols, which is described next.
Two dollar signs initiated the reading of what we today might call an "escape sequence". An escape sequence had the form "$$xSx", where x was any character and S was a sequence of up to thirty characters not including x. For example, $$x()x would get the symbol whose name is '()' and would print as '()'. Thus it is similar in purpose to Common Lisp's | syntax. There is a significant difference: It could not be embedded within a symbol, unlike Common Lisp's |. In this respect it is closer to Maclisp's | reader macro (which created a single token) than it is to Common Lisp's multiple escape character. In LISP 1.5, "A$$X()X$" would be read as (1) the symbol A$$X, (2) the empty list, (3) the symbol X.
The following code sets up a $ reader macro so that symbols using the $$ notation will be read in properly, while leaving things like $eof$ alone.
(defun dollar-sign-reader (stream character) (declare (ignore character)) (let ((next (read-char stream t nil t))) (cond ((char= next #\$) (let ((terminator (read-char stream t nil t))) (values (intern (with-output-to-string (name) (loop for c := (read-char stream t nil t) until (char= c terminator) do (write-char c name))))))) (t (unread-char next stream) (with-standard-io-syntax (read (make-concatenated-stream (make-string-input-stream "$") stream) t nil t)))))) (set-macro-character #\$ #'dollar-sign-reader t) 

Conventional differences.

LISP 1.5 is an old programming language. Generally, compared to its contemporaries (such as FORTRANs I–IV), it holds up well to modern standards, but sometimes its age does show. And there were some aspects of LISP 1.5 that might be surprising to programmers familiar only with Common Lisp or a Scheme.
M-expressions. John McCarthy's original concept of Lisp was a language with a syntax like this (from the LISP 1.5 Programmer's Manual, p. 11):
equal[x;y]=[atom[x]→[atom[y]→eq[x;y]; T→F]; equal[car[x];car[Y]]→equal[cdr[x];cdr[y]]; T→F] 
There are several things to note. First is the entirely different phrase structure. It's is an infix language looking much closer to mathematics than the Lisp we know and love. Square brackets are used instead of parentheses, and semicolons are used instead of commas (or blanks). When square brackets do not enclose function arguments (or parameters when to the left of the equals sign), they set up a conditional expression; the arrows separate predicate expressions and consequent expressions.
If that was Lisp, then where do s-expressions come in? Answer: quoting. In the m-expression notation, uppercase strings of characters represent quoted symbols, and parenthesized lists represent quoted lists. Here is an example from page 13 of the manual:
λ[[x;y];cons[car[x];y]][(A B);(C D)] 
As an s-expressions, this would be
((lambda (x y) (cons (car x) y)) '(A B) '(C D)) 
The majority of the code in the manual is presented in m-expression form.
So why did s-expressions stick? There are a number of reasons. The earliest Lisp interpreter was a translation of the program for eval in McCarthy's paper introducing Lisp, which interpreted quoted data; therefore it read code in the form of s-expressions. S-expressions are much easier for a computer to parse than m-expressions, and also more consistent. (Also, the character set mentioned above includes neither square brackets nor a semicolon, let alone a lambda character.) But in publications m-expressions were seen frequently; perhaps the syntax was seen as a kind of "Lisp pseudocode".
Comments. LISP 1.5 had no built-in commenting mechanism. It's easy enough to define a comment operator in the language, but it seemed like nobody felt a need for them.
Interestingly, FORTRAN I had comments. Assembly languages of the time sort of had comments, in that they had a portion of each line/card that was ignored in which you could put any text. FORTRAN was ahead of its time.
(Historical note: The semicolon comment used in Common Lisp comes from Maclisp. Maclisp likely got it from PDP-10 assembly language, which let a semicolon and/or a line break terminate a statement; thus anything following a semicolon is ignored. The convention of octal numbers by default, decimal numbers being indicated by a trailing decimal point, of Maclisp too comes from the assembly language.)
Code formatting. The code in the manual that isn't written using m-expression syntax is generally lacking in meaningful indentation and spacing. Here is an example (p. 49):
(TH1 (LAMBDA (A1 A2 A C) (COND ((NULL A) (TH2 A1 A2 NIL NIL C)) (T (OR (MEMBER (CAR A) C) (COND ((ATOM (CAR A)) (TH1 (COND ((MEMBER (CAR A) A1) A1) (T (CONS (CAR A) A1))) A2 (CDR A) C)) (T (TH1 A1 (COND ((MEMBER (CAR A) A2) A2) (T (CONS (CAR A) A2))) (CDR A) C)))))))) 
Nowadays we might indent it like so:
(TH1 (LAMBDA (A1 A2 A C) (COND ((NULL A) (TH2 A1 A2 NIL NIL C)) (T (OR (MEMBER (CAR A) C) (COND ((ATOM (CAR A)) (TH1 (COND ((MEMBER (CAR A) A1) A1) (T (CONS (CAR A) A1))) A2 (CDR A) C)) (T (TH1 A1 (COND ((MEMBER (CAR A) A2) A2) (T (CONS (CAR A) A2))) (CDR A) C)))))))) 
Part of the lack of formatting stems probably from the primarily punched-card-based programming world of the time; you would see the indented structure only by printing a listing of your code, so there is no need to format the punched cards carefully. LISP 1.5 allowed a very free format, especially when compared to FORTRAN; the consequence is that early LISP 1.5 programs are very difficult to read because of the lack of spacing, while old FORTRAN programs are limited at least to one statement per line.
The close relationship of Lisp and pretty-printing originates in programs developed to produce nicely formatted listings of Lisp code.
Lisp code from the mid-sixties used some peculiar formatting conventions that seem odd today. Here is a quote from Steele and Gabriel's Evolution of Lisp:
This intermediate example is derived from a 1966 coding style:
DEFINE(( (MEMBER (LAMBDA (A X) (COND ((NULL X) F) ((EQ A (CAR X) ) T) (T (MEMBER A (CDR X))) ))) )) 
The design of this style appears to take the name of the function, the arguments, and the very beginning of the COND as an idiom, and hence they are on the same line together. The branches of the COND clause line up, which shows the structure of the cases considered.
This kind of indentation is somewhat reminiscent of the formatting of Algol programs in publications.
Programming style. Old LISP 1.5 programs can seem somewhat primitive. There is heavy use of the prog feature, which is related partially to the programming style that was common at the time and partially to the lack of control structures in LISP 1.5. You could express iteration only by using recursion or by using prog+go; there wasn't a built-in looping facility. There is a library function called for that is something like the early form of Maclisp's do (the later form would be inherited in Common Lisp), but no surviving LISP 1.5 code uses it. [I'm thinking of making another post about converting programs using prog to the more structured forms that Common Lisp supports, if doing so would make the logic of the program clearer. Naturally there is a lot of literature on so called "goto elimination" and doing it automatically, so it would not present any new knowledge, but it would have lots of Lisp examples.]
LISP 1.5 did not have a let construct. You would use either a prog and setq or a lambda:
(let ((x y)) ...) 
is equivalent to
((lambda (x) ...) y) 
Something that stands out immediately when reading LISP 1.5 code is the heavy, heavy use of combinations of car and cdr. This might help (though car and cdr should be left alone when they are used with dotted pairs):
(car x) = (first x) (cdr x) = (rest x) (caar x) = (first (first x)) (cadr x) = (second x) (cdar x) = (rest (first x)) (cddr x) = (rest (rest x)) (caaar x) = (first (first (first x))) (caadr x) = (first (second x)) (cadar x) = (second (first x)) (caddr x) = (third x) (cdaar x) = (rest (first (first x))) (cdadr x) = (rest (second x)) (cddar x) = (rest (rest (first x))) (cdddr x) = (rest (rest (rest x))) 
Here are some higher compositions, even though LISP 1.5 doesn't have them.
(caaaar x) = (first (first (first (first x)))) (caaadr x) = (first (first (second x))) (caadar x) = (first (second (first x))) (caaddr x) = (first (third x)) (cadaar x) = (second (first (first x))) (cadadr x) = (second (second x)) (caddar x) = (third (first x)) (cadddr x) = (fourth x) (cdaaar x) = (rest (first (first (first x)))) (cdaadr x) = (rest (first (second x))) (cdadar x) = (rest (second (first x))) (cdaddr x) = (rest (third x)) (cddaar x) = (rest (rest (first (first x)))) (cddadr x) = (rest (rest (second x))) (cdddar x) = (rest (rest (rest (first x)))) (cddddr x) = (rest (rest (rest (rest x)))) 
Things like defstruct and Flavors were many years away. For a long time, Lisp dialects had lists as the only kind of structured data, and programmers rarely defined functions with meaningful names to access components of data structures that are represented as lists. Part of understanding old Lisp code is figuring out how data structures are built up and what their components signify.
In LISP 1.5, it's fairly common to see nil used where today we'd use (). For example:
instead of
(LAMBDA () ...) 
or (PROG NIL ...)
instead of
(PROG () ...) 
Actually this practice was used in other Lisp dialects as well, although it isn't really seen in newer code.
Identifiers. If you examine the list of all the symbols described in the LISP 1.5 Programmer's Manual, you will notice that none of them differ only in the characters after the sixth character. In other words, it is as if symbol names have only six significant characters, so that abcdef1 and abcdef2 would be considered equal. But it doesn't seem like that was actually the case, since there is no mention of such a limitation in the manual. Another thing of note is that many symbols are six characters or fewer in length.
(A sequence of six characters is nice to store on the hardware on which LISP 1.5 was running. The processor used thirty-six-bit words, and characters were six-bit; therefore six characters fit in a single word. It is conceivable that it might be more efficient to search for names that take only a single word to store than for names that take more than one word to store, but I don't know enough about the computer or implementation of LISP 1.5 to know if that's true.)
Even though the limit on names was thirty characters (the longest symbol names in standard Common Lisp are update-instance-for-different-class and update-instance-for-redefined-class, both thirty-five characters in length), only a few of the LISP 1.5 names are not abbreviated. Things like terpri ("terminate print") and even car and cdr ("contents of adress part of register" and "contents of decrement part of register"), which have stuck around until today, are pretty inscrutable if you don't know what they mean.
Thankfully the modern style is to limit abbreviations. Comparing the names that were introduced in Common Lisp versus those that have survived from LISP 1.5 (see the "Library" section below) shows a clear preference for good naming in Common Lisp, even at the risk of lengthy names. The multiple-value-bind operator could easily have been named mv-bind, but it wasn't.

Fundamental differences.

Truth values. Common Lisp has a single value considered to be false, which happens to be the same as the empty list. It can be represented either by the symbol nil or by (); either of these may be quoted with no difference in meaning. Anything else, when considered as a boolean, is true; however, there is a self-evaluating symbol, t, that traditionally is used as the truth value whenever there is no other more appropriate one to use.
In LISP 1.5, the situation was similar: Just like Common Lisp, nil or the empty list are false and everything else is true. But the symbol nil was used by programmers only as the empty list; another symbol, f, was used as the boolean false. It turns out that f is actually a constant whose value is nil. LISP 1.5 had a truth symbol t, like Common Lisp, but it wasn't self-evaluating. Instead, it was a constant whose permanent value was *t*, which was self-evaluating. The following code will set things up so that the LISP 1.5 constants work properly:
(defconstant *t* t) ; (eq *t* t) is true (defconstant f nil) 
Recall the practice in older Lisp code that was mentioned above of using nil in forms like (lambda nil ...) and (prog nil ...), where today we would probably use (). Perhaps this usage is related to the fact that nil represented an empty list more than it did a false value; or perhaps the fact that it seems so odd to us now is related to the fact that there is even less of a distinction between nil the empty list and nil the false value in Common Lisp (there is no separate f constant).
Function storage. In Common Lisp, when you define a function with defun, that definition gets stored somehow in the global environment. LISP 1.5 stores functions in a much simpler way: A function definition goes on the property list of the symbol naming it. The indicator under which the definition is stored is either expr or fexpr or subr or fsubr. The expr/fexpr indicators were used when the function was interpreted (written in Lisp); the subr/fsubr indicators were used when the function was compiled (or written in machine code). Functions can be referred to based on the property under which their definitions are stored; for example, if a function named f has a definition written in Lisp, we might say that "f is an expr."
When a function is interpreted, its lambda expression is what is stored. When a function is compiled or machine coded, a pointer to its address in memory is what is stored.
The choice between expr and fexpr and between subr and fsubr is based on evaluation. Functions that are exprs and subrs are evaluated normally; for example, an expr is effectively replaced by its lambda expression. But when an fexpr or an fsubr is to be processed, the arguments are not evaluated. Instead they are put in a list. The fexpr or fsubr definition is then passed that list and the current environment. The reason for the latter is so that the arguments can be selectively evaluated using eval (which took a second argument containing the environment in which evaluation is to occur). Here is an example of what the definition of an fexpr might look like, LISP 1.5 style. This function takes any number of arguments and prints them all, returning nil.
The "f" in "fexpr" and "fsubr" seems to stand for "form", since fexpr and fsubr functions got passed a whole form.
The top level: evalquote. In Common Lisp, the interpreter is usually available interactively in the form of a "Read-Evaluate-Print-Loop", for which a common abbreviation is "REPL". Its structure is exactly as you would expect from that name: Repeatedly read a form, evaluate it (using eval), and print the results. Note that this model is the same as top level file processing, except that the results of only the last form are printed, when it's done.
In LISP 1.5, the top level is not eval, but evalquote. Here is how you could implement evalquote in Common Lisp:
(defun evalquote (operator arguments) (eval (cons operator arguments))) 
LISP 1.5 programs commonly look like this (define takes a list of function definitions):
DEFINE (( (FUNCTION1 (LAMBDA () ...)) (FUNCTION2 (LAMBDA () ...)) ... )) 
which evalquote would process as though it had been written
(DEFINE ( (FUNCTION1 (LAMBDA () ...)) (FUNCTION2 (LAMBDA () ...)) ... )) 
Evaluation, scope, extent. Before further discussion, here the evaluator for LISP 1.5 as presented in Appendix B, translated from m-expressions to approximate Common Lisp syntax. This code won't run as it is, but it should give you an idea of how the LISP 1.5 interpreter worked.
(defun evalquote (function arguments) (if (atom function) (if (or (get function 'fexpr) (get function 'fsubr)) (eval (cons function arguments) nil)) (apply function arguments nil))) (defun apply (function arguments environment) (cond ((null function) nil) ((atom function) (let ((expr (get function 'expr)) (subr (get function 'subr))) (cond (expr (apply expr arguments environment)) (subr ; see below ) (t (apply (cdr (sassoc function environment (lambda () (error "A2")))) arguments environment))))) ((eq (car function 'label)) (apply (caddr function) arguments (cons (cons (cadr function) (caddr function)) arguments))) ((eq (car function) 'funarg) (apply (cadr function) arguments (caddr function))) ((eq (car function) 'lambda) (eval (caddr function) (nconc (pair (cadr function) arguments) environment))) (t (apply (eval function environment) arguments environment)))) (defun eval (form environment) (cond ((null form) nil) ((numberp form) form) ((atom form) (let ((apval (get atom 'apval))) (if apval (car apval) (cdr (sassoc form environment (lambda () (error "A8"))))))) ((eq (car form) 'quote) (cadr form)) ((eq (car form) 'function) (list 'funarg (cadr form) environment)) ((eq (car form) 'cond) (evcon (cdr form) environment)) ((atom (car form)) (let ((expr (get (car form) 'expr)) (fexpr (get (car form) 'fexpr)) (subr (get (car form) 'subr)) (fsubr (get (car form) 'fsubr))) (cond (expr (apply expr (evlis (cdr form) environment) environment)) (fexpr (apply fexpr (list (cdr form) environment) environment)) (subr ; see below ) (fsubr ; see below ) (t (eval (cons (cdr (sassoc (car form) environment (lambda () (error "A9")))) (cdr form)) environment))))) (t (apply (car form) (evlis (cdr form) environment) environment)))) (defun evcon (cond environment) (cond ((null cond) (error "A3")) ((eval (caar cond) environment) (eval (cadar cond) environment)) (t (evcon (cdr cond) environment)))) (defun evlis (list environment) (maplist (lambda (j) (eval (car j) environment)) list)) 
(The definition of evalquote earlier was a simplification to avoid the special case of special operators in it. LISP 1.5's apply can't handle special operators (which is also true of Common Lisp's apply). Hopefully the little white lie can be forgiven.)
There are several things to note about these definitions. First, it should be reiterated that they will not run in Common Lisp, for many reasons. Second, in evcon an error has been corrected; the original says in the consequent of the second branch (effectively)
(eval (cadar environment) environment) 
Now to address the "see below" comments. In the manual it describes the actions of the interpreter as calling a function called spread, which takes the arguments given in a Lisp function call and puts them into the machine registers expected with LISP 1.5's calling convention, and then executes an unconditional branch instruction after updating the value of a variable called $ALIST to the environment passed to eval or to apply. In the case of fsubr, instead of calling spread, since the function will always get two arguments, it places them directly in the registers.
You will note that apply is considered to be a part of the evaluator, while in Common Lisp apply and eval are quite different. Here it takes an environment as its final argument, just like eval. This fact highlights an incredibly important difference between LISP 1.5 and Common Lisp: When a function is executed in LISP 1.5, it is run in the environment of the function calling it. In contrast, Common Lisp creates a new lexical environment whenever a function is called. To exemplify the differences, the following code, if Common Lisp were evaluated like LISP 1.5, would be valid:
(defun weird (a b) (other-weird 5)) (defun other-weird (n) (+ a b n)) 
In Common Lisp, the function weird creates a lexical environment with two variables (the parameters a and b), which have lexical scope and indefinite extent. Since the body of other-weird is not lexically within the form that binds a and b, trying to make reference to those variables is incorrect. You can thwart Common Lisp's lexical scoping by declaring those variables to have indefinite scope:
(defun weird (a b) (declare (special a b)) (other-weird 5)) (defun other-weird (n) (declare (special a b)) (+ a b n)) 
The special declaration tells the implementation that the variables a and b are to have indefinite scope and dynamic extent.
Let's talk now about the funarg branch of apply. The function/funarg device was introduced some time in the sixties in an attempt to solve the scoping problem exemplified by the following problematic definition (using Common Lisp syntax):
(defun testr (x p f u) (cond ((funcall p x) (funcall f x)) ((atom x) (funcall u)) (t (testr (cdr x) p f (lambda () (testr (car x) p f u)))))) 
This function is taken from page 11 of John McCarthy's History of Lisp.
The only problematic part is the (car x) in the lambda in the final branch. The LISP 1.5 evaluator does little more than textual substitution when applying functions; therefore (car x) will refer to whatever x is currently bound whenever the function (lambda expression) is applied, not when it is written.
How do you fix this issue? The solution employed in LISP 1.5 was to capture the environment present when the function expression is written, using the function operator. When the evaluator encounters a form that looks like (function f), it converts it into (funarg f environment), where environment is the current environment during that call to eval. Then when apply gets a funarg form, it applies the function in the environment stored in the funarg form instead of the environment passed to apply.
Something interesting arises as a consequence of how the evaluator works. Common Lisp, as is well known, has two separate name spaces for functions and for variables. If a Common Lisp implementation encounters
(lambda (f x) (f x)) 
the result is not a function applying one of its arguments to its other argument, but rather a function applying a function named f to its second argument. You have to use an operator like funcall or apply to use the functional value of the f parameter. If there is no function named f, then you will get an error. In contrast, LISP 1.5 will eventually find the parameter f and apply its functional value, if there isn't a function named f—but it will check for a function definition first. If a Lisp dialect that has a single name space is called a "Lisp-1", and one that has two name spaces is called a "Lisp-2", then I guess you could call LISP 1.5 a "Lisp-1.5"!
How can we deal with indefinite scope when trying to get LISP 1.5 programs to run in Common Lisp? Well, with any luck it won't matter; ideally the program does not have any references to variables that would be out of scope in Common Lisp. However, if there are such references, there is a fairly simple fix: Add special declarations everywhere. For example, say that we have the following (contrived) program, in which define has been translated into defun forms to make it simpler to deal with:
(defun f (x) (prog (m) (setq m a) (setq a 7) (return (+ m b x)))) (defun g (l) (h (* b a))) (defun h (i) (/ l (f (setq b (setq a i))))) (defun p () (prog (a b i) (setq a 4) (setq b 6) (setq i 3) (return (g (f 10))))) 
The result of calling p should be 10/63. To make it work, add special declarations wherever necessary:
(defun f (x) (declare (special a b)) (prog (m) (setq m a) (setq a 7) (return (+ m b x)))) (defun g (l) (declare (special a b l)) (h (* b a))) (defun h (i) (declare (special a b l i)) (/ l (f (setq b (setq a i))))) (defun p () (prog (a b i) (declare (special a b i)) (setq a 4) (setq b 6) (setq i 3) (return (g (f 10))))) 
Be careful about the placement of the declarations. It is required that the one in p be inside the prog, since that is where the variables are bound; putting it at the beginning (i.e., before the prog) would do nothing because the prog would create new lexical bindings.
This method is not optimal, since it really doesn't help too much with understanding how the code works (although being able to see which variables are free and which are bound, by looking at the declarations, is very helpful). A better way would be to factor out the variables used among several functions (as long as you are sure that it is used in only those functions) and put them in a let. Doing that is more difficult than using global variables, but it leads to code that is easier to reason about. Of course, if a variable is used in a large number of functions, it might well be a better choice to create a global variable with defvar or defparameter.
Not all LISP 1.5 code is as bad as that example!
Join us next time as we look at the LISP 1.5 library. In the future, I think I'll make some posts talking about getting specific programs running. If you see any errors, please let me know.
submitted by kushcomabemybedtime to lisp [link] [comments]

Trying to get a head start on my A-level course

Hi everyone, I am making the transition from high school to college and I've picked computer science as one of my options. Unfortunately I did not do this subject at high school level and due to quarantine I want to get a head start with some basic programming just to be prepared. The language the course uses is C# and Unity so any advice on where to start with the basics would be greatly appreciated!
Edit: pasted the course components on here
Component 01 – Computer Systems This component will introduce students to the internal workings of the Central Processing Unit (CPU), the exchange of data and will also look at software development, data types and legal and ethical issues. It will also offer the opportunity for students to analyse and design algorithms, and to study different types of software together with the methodologies that are used to develop them. This component involves advanced mathematics, including the representation and normalisation of floating-point numbers, the simplification of Boolean expressions, the use of two’s complement to represent numbers in binary, and using rules to derive or simplify Boolean expressions.
Component 02 – Algorithms and Programming This component will incorporate and build on the knowledge and understanding gained in component 01. In addition, you will study:
This component focuses heavily on the reading and writing of complex algorithms including Dijkstra’s shortest path algorithm and the A* algorithm. Again, Mathematics is a feature of this unit, including the use of Big-O notation to assess the complexity, in terms of time and space, of an algorithm.
Component 03 – Programming Project Students will be expected to analyse, design, develop, test, evaluate and document a program written in C# using the Unity development environment. The underlying approach to the project is to apply the principles of computational thinking to a practical coding problem. Students are expected to apply appropriate principles from an agile development approach to the project development. This project is independent, meaning students will need to debug their program and spend time focused on the development of a complex piece of software.
submitted by matusz019 to computerscience [link] [comments]


Boolean data type

From Wikipedia, the free encyclopedia Jump to navigation Jump to search
In computer science, the Boolean data type is a data type that has one of two possible values (usually denoted true and false) which is intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with conditional) statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false. It is a special case of a more general logical data type (see probabilistic logic)—logic doesn't always need to be Boolean.



In programming languages with a built-in Boolean data type, such as Pascal) and Java), the comparison operators such as > and ≠ are usually defined to return a Boolean value. Conditional and iterative commands may be defined to test Boolean-valued expressions.
Languages with no explicit Boolean data type, like C90 and Lisp), may still represent truth values by some other data type. Common Lisp uses an empty list for false, and any other value for true. The C programming language uses an integer) type, where relational expressions like i > j and logical expressions connected by && and || are defined to have value 1 if true and 0 if false, whereas the test parts of if , while , for , etc., treat any non-zero value as true.[1][2] Indeed, a Boolean variable may be regarded (and implemented) as a numerical variable with one binary digit (bit), which can store only two values. The implementation of Booleans in computers are most likely represented as a full word), rather than a bit; this is usually due to the ways computers transfer blocks of information.
Most programming languages, even those with no explicit Boolean type, have support for Boolean algebraic operations such as conjunction (AND , & , * ), disjunction (OR , | , + ), equivalence (EQV , = , == ), exclusive or/non-equivalence (XOR , NEQV , ^ , != ), and negation (NOT , ~ , ! ).
In some languages, like Ruby), Smalltalk, and Alice) the true and false values belong to separate classes), i.e., True and False , respectively, so there is no one Boolean type.
In SQL, which uses a three-valued logic for explicit comparisons because of its special treatment of Nulls), the Boolean data type (introduced in SQL:1999) is also defined to include more than two truth values, so that SQL Booleans can store all logical values resulting from the evaluation of predicates in SQL. A column of Boolean type can also be restricted to just TRUE and FALSE though.

ALGOL and the built-in boolean type

One of the earliest programming languages to provide an explicit boolean data type is ALGOL 60 (1960) with values true and false and logical operators denoted by symbols ' ∧ {\displaystyle \wedge } 📷' (and), ' ∨ {\displaystyle \vee } 📷' (or), ' ⊃ {\displaystyle \supset } 📷' (implies), ' ≡ {\displaystyle \equiv } 📷' (equivalence), and ' ¬ {\displaystyle \neg } 📷' (not). Due to input device and character set limits on many computers of the time, however, most compilers used alternative representations for many of the operators, such as AND or 'AND' .
This approach with boolean as a built-in (either primitive or otherwise predefined) data type was adopted by many later programming languages, such as Simula 67 (1967), ALGOL 68 (1970),[3] Pascal) (1970), Ada) (1980), Java) (1995), and C#) (2000), among others.


The first version of FORTRAN (1957) and its successor FORTRAN II (1958) have no logical values or operations; even the conditional IF statement takes an arithmetic expression and branches to one of three locations according to its sign; see arithmetic IF. FORTRAN IV (1962), however, follows the ALGOL 60 example by providing a Boolean data type (LOGICAL ), truth literals (.TRUE. and .FALSE. ), Boolean-valued numeric comparison operators (.EQ. , .GT. , etc.), and logical operators (.NOT. , .AND. , .OR. ). In FORMAT statements, a specific format descriptor ('L ') is provided for the parsing or formatting of logical values.[4]

Lisp and Scheme

The language Lisp) (1958) never had a built-in Boolean data type. Instead, conditional constructs like cond assume that the logical value false is represented by the empty list () , which is defined to be the same as the special atom nil or NIL ; whereas any other s-expression is interpreted as true. For convenience, most modern dialects of Lisp predefine the atom t to have value t , so that t can be used as a mnemonic notation for true.
This approach (any value can be used as a Boolean value) was retained in most Lisp dialects (Common Lisp, Scheme), Emacs Lisp), and similar models were adopted by many scripting languages, even ones having a distinct Boolean type or Boolean values; although which values are interpreted as false and which are true vary from language to language. In Scheme, for example, the false value is an atom distinct from the empty list, so the latter is interpreted as true.

Pascal, Ada, and Haskell

The language Pascal) (1970) introduced the concept of programmer-defined enumerated types. A built-in Boolean data type was then provided as a predefined enumerated type with values FALSE and TRUE . By definition, all comparisons, logical operations, and conditional statements applied to and/or yielded Boolean values. Otherwise, the Boolean type had all the facilities which were available for enumerated types in general, such as ordering and use as indices. In contrast, converting between Boolean s and integers (or any other types) still required explicit tests or function calls, as in ALGOL 60. This approach (Boolean is an enumerated type) was adopted by most later languages which had enumerated types, such as Modula, Ada), and Haskell).

C, C++, Objective-C, AWK

Initial implementations of the language C) (1972) provided no Boolean type, and to this day Boolean values are commonly represented by integers (int s) in C programs. The comparison operators (> , == , etc.) are defined to return a signed integer (int ) result, either 0 (for false) or 1 (for true). Logical operators (&& , || , ! , etc.) and condition-testing statements (if , while ) assume that zero is false and all other values are true.
After enumerated types (enum s) were added to the American National Standards Institute version of C, ANSI C (1989), many C programmers got used to defining their own Boolean types as such, for readability reasons. However, enumerated types are equivalent to integers according to the language standards; so the effective identity between Booleans and integers is still valid for C programs.
Standard C) (since C99) provides a boolean type, called _Bool . By including the header stdbool.h , one can use the more intuitive name bool and the constants true and false . The language guarantees that any two true values will compare equal (which was impossible to achieve before the introduction of the type). Boolean values still behave as integers, can be stored in integer variables, and used anywhere integers would be valid, including in indexing, arithmetic, parsing, and formatting. This approach (Boolean values are just integers) has been retained in all later versions of C. Note, that this does not mean that any integer value can be stored in a boolean variable.
C++ has a separate Boolean data type bool , but with automatic conversions from scalar and pointer values that are very similar to those of C. This approach was adopted also by many later languages, especially by some scripting languages such as AWK.
Objective-C also has a separate Boolean data type BOOL , with possible values being YES or NO , equivalents of true and false respectively.[5] Also, in Objective-C compilers that support C99, C's _Bool type can be used, since Objective-C is a superset of C.

Perl and Lua

Perl has no boolean data type. Instead, any value can behave as boolean in boolean context (condition of if or while statement, argument of && or || , etc.). The number 0 , the strings "0" and "" , the empty list () , and the special value undef evaluate to false.[6] All else evaluates to true.
Lua) has a boolean data type, but non-boolean values can also behave as booleans. The non-value nil evaluates to false, whereas every other data type always evaluates to true, regardless of value.


Tcl has no separate Boolean type. Like in C, the integers 0 (false) and 1 (true - in fact any nonzero integer) are used.[7]
Examples of coding:
set v 1 if { $v } { puts "V is 1 or true" }
The above will show "V is 1 or true" since the expression evaluates to '1'
set v "" if { $v } ....
The above will render an error as variable 'v' cannot be evaluated as '0' or '1'

Python, Ruby, and JavaScript

Python), from version 2.3 forward, has a bool type which is a subclass) of int , the standard integer type.[8] It has two possible values: True and False , which are special versions of 1 and 0 respectively and behave as such in arithmetic contexts. Also, a numeric value of zero (integer or fractional), the null value (None ), the empty string), and empty containers (i.e. lists), sets), etc.) are considered Boolean false; all other values are considered Boolean true by default.[9] Classes can define how their instances are treated in a Boolean context through the special method __nonzero__ (Python 2) or __bool__ (Python 3). For containers, __len__ (the special method for determining the length of containers) is used if the explicit Boolean conversion method is not defined.
In Ruby), in contrast, only nil (Ruby's null value) and a special false object are false, all else (including the integer 0 and empty arrays) is true.
In JavaScript, the empty string ("" ), null , undefined , NaN , +0, −0 and false [10] are sometimes called falsy (of which the complement) is truthy) to distinguish between strictly type-checked and coerced Booleans.[11] As opposed to Python, empty containers (arrays , Maps, Sets) are considered truthy. Languages such as PHP also use this approach.

Next Generation Shell

Next Generation Shell, has Bool type. It has two possible values: true and false . Bool is not interchangeable with Int and have to be converted explicitly if needed. When a Boolean value of an expression is needed (for example in if statement), Bool method is called. Bool method for built-in types is defined such that it returns false for a numeric value of zero, the null value, the empty string), empty containers (i.e. lists), sets), etc.), external processes that exited with non-zero exit code; for other values Bool returns true. Types for which Bool method is defined can be used in Boolean context. When evaluating an expression in Boolean context, If no appropriate Bool method is defined, an exception is thrown.


Main article: Null (SQL) § Comparisons with NULL and the three-valued logic (3VL)#Comparisonswith_NULL_and_the_three-valued_logic(3VL))
Booleans appear in SQL when a condition is needed, such as WHERE clause, in form of predicate which is produced by using operators such as comparison operators, IN operator, IS (NOT) NULL etc. However, apart from TRUE and FALSE, these operators can also yield a third state, called UNKNOWN, when comparison with NULL is made.
The treatment of boolean values differs between SQL systems.
For example, in Microsoft SQL Server, boolean value is not supported at all, neither as a standalone data type nor representable as an integer. It shows an error message "An expression of non-boolean type specified in a context where a condition is expected" if a column is directly used in the WHERE clause, e.g. SELECT a FROM t WHERE a , while statement such as SELECT column IS NOT NULL FROM t yields a syntax error. The BIT data type, which can only store integers 0 and 1 apart from NULL, is commonly used as a workaround to store Boolean values, but workarounds need to be used such as UPDATE t SET flag = IIF(col IS NOT NULL, 1, 0) WHERE flag = 0 to convert between the integer and boolean expression.
In PostgreSQL, there is a distinct BOOLEAN type as in the standard[12] which allows predicates to be stored directly into a BOOLEAN column, and allows using a BOOLEAN column directly as a predicate in WHERE clause.
In MySQL, BOOLEAN is treated as an alias as TINYINT(1)[13], TRUE is the same as integer 1 and FALSE is the same is integer 0.[14], and treats any non-zero integer as true when evaluating conditions.
The SQL92 standard introduced IS (NOT) TRUE, IS (NOT) FALSE, IS (NOT) UNKNOWN operators which evaluate a predicate, which predated the introduction of boolean type in SQL:1999
The SQL:1999 standard introduced a BOOLEAN data type as an optional feature (T031). When restricted by a NOT NULL constraint, a SQL BOOLEAN behaves like Booleans in other languages, which can store only TRUE and FALSE values. However, if it is nullable, which is the default like all other SQL data types, it can have the special null) value also. Although the SQL standard defines three literals) for the BOOLEAN type – TRUE, FALSE, and UNKNOWN – it also says that the NULL BOOLEAN and UNKNOWN "may be used interchangeably to mean exactly the same thing".[15][16] This has caused some controversy because the identification subjects UNKNOWN to the equality comparison rules for NULL. More precisely UNKNOWN = UNKNOWN is not TRUE but UNKNOWN/NULL.[17] As of 2012 few major SQL systems implement the T031 feature.[18] Firebird and PostgreSQL are notable exceptions, although PostgreSQL implements no UNKNOWN literal; NULL can be used instead.[19]

See also

Data typesUninterpreted
Related topics


  1. "PostgreSQL: Documentation: 10: 8.6. Boolean Type". Archived from the original on 9 March 2018. Retrieved 1 May 2018.

Navigation menu






Edit links

submitted by finnarfish to copypasta [link] [comments]

The Big Yoink: A Smol Detective Story, Chapter 15

Standard Disclaimer: I do not take credit for the setting, this story is set in the They Are Smol universe, written by our very own u/tinyprancinghorse.
TPH has a Website, a Patreon, and also a Discord if you need more smol shenanigans.
The first Smol Detective story can be read starting Here.
There will be some spoilers/references of the first SD story in this one, so consider yourself duly warned.
First Chapter
Previous Chapter
Next Chapter

In the previous chapter:
There was Preparation.
Bgrarh, James Bgrarh.
The Floofdinos do something Stupid.

In this chapter:
Oscar has a Chat.
Ter'yeik makes a Delivery.

Maria half expected that she and her compatriots would be put through some tedious security screening. But instead of walking through a scanner or getting frisked, they were met at the huge doorway by Nerlharg. The Dorarizin wasn't wearing power armor this time; he was clad in a knee-length outfit that looked like a Mandarin's robes.
Nerlharg pulled a small flat tablet out of his pocket. "[Welcome! Just before we start, I'll need to scan anything you're carrying.]"
The Jornissians shrugged and presented their holographic prop swords. Nerlharg waved the tablet near them and nodded. "[Fine. And that?]" He pointed at the guitar case slung on Oscar's back.
Oscar slid the case off of his shoulder. "Scan away. Just be careful, this thing's older than me." He set down the case and unzipped it to reveal the instrument within.
Nerlharg chuckled. "[I assure you our security scans aren't that strong.]" He swept the tablet over the guitar. "[And this is also fine. Is that real wood?]"
"You better believe it," replied Oscar.
"[I look forward to hearing what it sounds like. His Excellency bids you all welcome. Unfortunately, we cannot permit the security drones indoors.]" He pointed at the hovering spheres near each human.
"This is a hell of a time to find that out," said Oscar. His jaw set as he glared at Nerlharg.
Rgrarshok looked pretty pissed as well. "[I assure you that these only use nonlethal protection methods. Scan them yourself if you don't believe me.]"
Nerlharg looked very apologetic. "[It is out of my hands. [Sssnnathor] does not want them admitted into such a large party. He's worried about them deploying a net or taser by accident, what with so many bodies moving around.]"
Oscar and Rgrarshok shared a long look. Maria knew that the Captain was asking the human do you want to go through with this? without saying a word. Finally Oscar shrugged in a sure, let's go for it manner.
Maria kind of wished she'd gotten a chance to throw in her two cents as well; she hoped that the big lug wasn't being cavalier about her safety. Or his, for that matter.
"[Very well,]" said Rgrarshok. "[We'll program them to remain here. Will that be acceptable?]"
Nerlharg nodded with a slight smile.
"[Good. What time do we start?]" asked the Captain.
"[In [one hour]. In the meantime, [Sssnnathor] requests the honor of your presence among our guests.]"
Maria groaned inside. The last thing she wanted to do was make small talk with a bunch of fearsome aliens who were, oh by the way, a bunch of criminal assholes as well.


Much to Oscar's annoyance, one hour became two. On top of that, their presence at the tyrant's party wasn't a simple case of 'walk around, mingle a bit, then go do the show'. No, from the outset Sssnnathor was determined to keep them circulating among the considerable number of well-dressed party-goers. But Oscar didn't let the outward civilized veneer fool him for a second.
He was glad Myyreh wasn't there. The poor girl would have been crawling right out of her fur to see him in the midst of so many untrained xenos. At least they were polite enough to keep their distance when asked.
Right now he was holding a drink of some fruity-tasting cocktail. At least the glass was human-sized. He was chatting with a gray-furred Dorarizin who was wearing what looked like a frock coat with a lacy 'ruff' that accented the alien's mane. Several other huge xenos hovered around them, clearly waiting for their turn to talk to the human. In the meantime, Oscar kept himself facing the Dorarizin so that the nanocams in his suit could get a good look.
"Got a positive ID on him!" said Egrwreh's voice in his ear. "Ghranzor-of-Ahnz, known trafficker in small arms, suspected of Green smuggling as well."
Oscar nodded, both in response to the information as well as to a question from Ghranzor.
"[So you are enjoying your stay thus far?]"
"I sure am, sir. Didn't think I'd get to go this far into space, let alone meet so many people!"
Ghranzor gave a little bow and motioned to the several-foot gap between them. "[I'm pleased to hear that. I feared that you were overly paranoid about us, given how much personal space you requested.]"
Oscar shrugged. "I gotta admit I'm a little worried. Can't be too safe, right?" He caught a nearby Karnakian's eyes and winked. "Remember what happened the first time we tried to shake hands with y'all." He used his free hand to mime pulling his other arm off.
The Karnakian floofed out her neck feathers in anger. "[Really! It was an honest accident!]"
Oscar waved his free hand. "Relax, I'm just kidding ya!"
The Karnakian subsided and let forth a little trilling, forced laugh of her own.
Oscar motioned with his glass overhead, where the party's main source of light floated. The hologram consisted of two bright suns floating in the atrium's center. Around both suns coiled a massive, scaled body that endlessly moved in a figure-eight formation like the living representation of infinity. Another coil emerged from the huge figure to reach out and circle another, smaller blue-white sphere which floated near the larger figure-eight. There was no real head or tail that Oscar could see, just an impression of never-ending sinewy strength.
"What's that?" he asked.
He heard Sssnnathor's smooth hiss-purr behind him. "[That, [human], is Sotek-Who-Circles-The-World.]"
Oscar turned casually to face the tyrant, and noted how everyone around Sssnnathor stood with a slight bow to their head. Not wanting to stand out, he followed suit.
"[Oh, please, you all honor me too much,]" said Sssnnathor. Oscar picked his head back up and saw the Jornissian looking up at the hologram. Oscar was still figuring out Jornissian facial expressions, but judging by the tilt of Sssnnathor's hood he could swear the tyrant had a look of longing.
Sssnnathor pointed at the encircled binary star system. "[Sotek coils the earth and sky in himself. He holds all fire in the sky, and lets out just enough of it to warm the world.]"
"Huh, neat. Sort of a sun god, then?"
"[Not just that. A god who encompasses eternity. He lives forever.]"
"Hey, who wouldn't want that?" replied Oscar as he took a casual sip of his fruity-stuff. It was time to do a little fishing and see if he could draw Sssnnathor out as to his true intentions.
Sssnnathor slithered towards Oscar with a gleam in his eyes. "[That's exactly what I say! Everyone desires eternal life, even if they're too craven to admit to it!]"
The surrounding courtiers moved away, and from their startled body language Oscar got the sense that this passion was not something they were used to.
"[Those fools in the Senate refuse to see the truth,]" continued Sssnnathor. "[The universe is unimaginably old compared to even a few thousand [years] of existence. Why not at least give us the option?]"
There was no Junior to give a warning noise, so Oscar raised a hand. "That's close enough, sir."
The statement snapped the tyrant out of his trance. He chuckled and motioned with his snout at Oscar. "[It's a pity you have to resort to such coddling just to have a chance at a any life, let alone an eternal one.]"
"Times change, sir. Sure we're fragile and endangered now, but we won't be forever. And I dunno, a thousand years or so sounds like a pretty good run to me."
"[Of course you say that now, you're barely out of a clutch! But a thousand [years] from now, I wager you'd be very receptive to living a thousand [years] more.]"
Oscar gave a noncommittal shrug. "[Maybe. I guess I'll cross that bridge when I come to it."
"[The [powers that be] won't let you,]" replied Sssnnathor. "[After all, they threw me out for daring to even think of the possibility.]"
The tyrant's hood flattened out in anger, and those around the pair drew back in fear of being the recipient of some of that wrath. Oscar figured he should get the conversation back to light and fluffy.
"That's a shame, sir. Still, looks like you're doing all right for yourself, eh?" Oscar grinned and waved his glass in general at the huge atrium.
Sssnnathor's hood relaxed and he gave a Jornissian shrug. "[I suppose I am.]" He looked at the fearful faces around him and gave a wide, fanged smile. "[Please, everyone, drink! Smile! This is supposed to be a party!]"
Before anyone else could chime in, Captain Rgrarshok moved her way into the circle around Oscar. She kept glancing off into the distance in irritation as she moved.
"[Sorry to stick my paw in, sir, but my performers need to make their way backstage,]" she said.
"[Of course they do,]" said Sssnnathor. "[I look forward to the performance. I'm sure we all do, yes?]"
Amid the hasty assurances and declarations that followed, Rgrarshok gave another irritated glare. Oscar followed her direction of interest and saw...
Bgrarh-of-Arhraz stood a ways away, also ringed in by partiers. He gestured casually with one paw as he chatted with a female Dorarizin. His deep blue eyes twinkled as he talked. The alien wolf-woman looked about ready to bear his pups, judging by the way she stared at him.
She wasn't the only one. Among the circle of people surrounding him were quite a few females (some not even Dorarizin) who looked at him with equal entrancement.
Oscar heard a faint grinding noise and realized it was the Captain's teeth. He decided to draw fire for his friend. "Er, boss, want me to go fetch him?"
Rgrarshok drew in and let out a deep breath. "Yes, please do."
Oscar grinned in general at those around him and gave Sssnnathor a bow. "Sorry folks, sorry sir. The show must go on!"
As he trotted away, Oscar heard Sssnnathor say something to Rgrarshok about an announcement. Fortunately the surrounding crowd parted as he called out "Make way, please!". The sycophants around Bgrarh at first looked annoyed at hearing his call, then they looked a lot more interested as they laid eyes on Oscar.
"'scuse the interruption, Bennie. The boss wants us backstage."
"[Of course!]" replied Bgrarh. He reached over, picked up the paw of the Dorarizin facing him, and gave the back of her paw a gentle kiss. "[It's terribly unfortunate we have to part, my dear. But duty calls.]"
The kissee stared after them like a poleaxed steer as Bgrarh and Oscar walked away.


Rgrarshok-of-Ngraz took another deep breath to calm herself as she strode towards the stage. It was set in the geometric center of the soaring atrium, consisting of knee-high circular platform that was expansive enough for all of the acts. The partygoers were already crowded around the stage perimeter but parted to make way for her. Along the far side of the stage was a temporary domed hut that acted as the backstage area.
Both the stage and hut were supplied by Sssnnathor, which meant the latter was certainly bugged. She'd impressed on the whole team that there was to be absolutely no breaking of their cover until they were all back on safe ground.
Her face remained impassive as she berated herself. Why was she getting so worked up over Bgrarh's antics? The specialist could be a little annoying at times, but he was always a loyal pack member. He was just acting a part, not really flirting.
But the knowledge still didn't calm the little churn of unexpected jealous anger in her gut. She'd been on the cusp of striding into the middle of that circle and showing that hussy of a female who was the real Alpha. Bgrarh was hers.
Rgrashok slowed as she neared the stage. Sssnnathor was already coiled up in the middle of it, and he lifted his upper body to tower over them all. As he held up his arms the crowd quieted.
"[My friends, you gladden my heart by your presence. I have enjoyed my time here during the past [sixty years], and I look forward to many more such celebrations. But that is not the only reason to throw a party. As you may have heard, I've recently come into possession of an artifact which has a long and storied history among our [Karnakian] brethren. I've taken great pains to display it with the reverence due its status. It is my pleasure to present to you all...the Sacred Claw of [Ta'irrl'qc]!]"
Sssnnathor gestured to his right, and the partygoers on that side parted as a smooth polished stone plinth rose up out of the marble-tiled floor. The plinth's top split open and folded back down along itself to reveal the artifact that Rgrarshok and her crew had been chasing this entire time.
The Claw was polished, nut-brown sickle shape which lay on a blue velvet cushion. At its root were embedded emeralds and rubies that sparkled in the light from Sotek's hologram above them.
As the crowd gave the appropriate oohs and aahs, Rgrarshok had a fleeting notion of simply grabbing Sssnnathor and holding him hostage while the team escaped with the Claw. But no, that would put the [humans] in unnecessary danger. Instead she made sure to smile and applaud along with everyone else.
Sssnnathor nodded to her and slithered his way back off of the stage. He coiled himself possessively around the Claw's plinth with a very satisfied expression on his face.


"[I don't believe it,]" whispered Tk'rii'na.
"[Don't even think it,]" said Resh'skk.
Maria didn't like the way the Karnakian's fore-claws twitched as he peeked out the ajar door. It looked like Tk'rii'na was getting ready to do something really stupid. She walked up beside him and placed a hand on his arm.
"Hey, Tarky? Relax. We'll..." she glanced around the hut and tried to choose words that wouldn't blow their cover to anyone listening in. "I know you're worried about the performance, but you'll do great."
"[But it's right there.]"
Frick chose that moment to try and pull Tk'rii'na away. "[Let me see!]"
Tarky pushed back against the tug, resulting in a brief round of the two raptors squawking and slapping at each other.
"Both of you COOL IT!" hissed Maria. She glared up at Tk'rii'na. "You remember you swore to protect me? That includes not putting us in danger by causing a scene!"
Tk'rii'na hung his head. "[You're right. I'm sorry. I shall cool it.]"
He looked so literally crestfallen that Maria's anger evaporated. She patted his arm. "No harm done."


Rgrarshok strode into the middle of the stage, turned, and bowed deeply to the assembled throng. "{We thank you all humbly for your attention. The Company of the Long Dance of Fghrealh is pleased to bring to you a wide range of entertainment from around the galaxy. Including that of our newest comrades, the tiny-chompers!}"
That last part drew a nice round of applause.
"{We shall begin shortly, starting with an amazing display of [Karnakian] congretory singing!}"
Rgrarshok spun and walked towards the hut. Its door slid open and Rgarshok ducked inside. It was a small windowless space with a few tables along one curved wall and another door at the rear. The hut was made even more claustrophobic by the presence of the performers.
Rgrarshok raised a curious ear at seeing a few feathers on the floor near the entrance door. She glared back up at the four Karnakians. "{Is there a problem?}"
"[No, just nerves before the show,]" replied Maria. "[Right, guys?]"
A big paw touched Rgrarshok's shoulder, and she turned to see Bgrarh giving her a wide smile that she found herself automatically returning. She just couldn't stay mad at him.
"{Are you ready for our performance, darling?}" he asked.
She put her stoic 'Captain in Charge' face back on. "{I am, just don't draw too much attention to yourself.}" That warning should be sufficiently vague to throw off any listeners.
Bgrarh moved close and slipped an arm around her waist. "{And what if I want the attention of somebody in particular?}"
Rgrarshok blinked as a welter of conflicting emotions ran through her. Bgrarh was a pack member; he was also strong, smart, and athletic. In ordinary circumstances his advances would be welcome to any pack's Alpha. But hers wasn't a normal pack and she wasn't just the Alpha, she was the Captain. She had to set herself apart, be a strong leader for them all...but his eyes were so deep and pretty, and he smelled so nice...
She leaned in towards his face. "{Not now, Bgrarh. We have a show to do.}"
Bgrarh didn't lose that infuriating and adorable grin. "{And after the show?}"
"{We'll see.}"
Rgrarshok gently peeled his arm off of her and cleared her throat. "{Singers, you're up.}"
She stood aside as the Karnakain quartet moved towards the entrance. Rgarshok noted with amusement that there was now a lot less glaring between the two pairs of guards than when they'd first come on board her ship. Now they all just looked nervous at the prospect of that most dreaded of things, Screwing Up.


Ter'yeik put on his best disarming smile as he pushed a big wheeled tub towards the service entrance. This was no grand archway, it was instead a smaller square portal guarded by one bored-looking Jornissian in low-profile armor. A rifle leaned against the wall next to the guard, within easy reach.
A voice hissed out from under the tub's cover, a voice just barely audible to him. "|Stop smiling, you idiot! Look bored and put-upon!|"
He did as The Silken Feather instructed and slouched a bit as he continuted pushing. The Jornissian looked just as bored as he held up a hand. "[Hold up. You with the catering crew?]"
"|Yeah, we had a last-minute menu change. [Sssnnathor] wanted some namptha soup added.|"
The guard held his rifle at the ready as he coiled himself up higher, now looking a lot less bored and more ready to dispense some violence. "[We weren't told.]"
Ter'yeik kept his feathers from trembling with a supreme effort and tried his best to sound peeved. "|Really? That's typical. I get a work order, bust my tail making this stuff, and the Diarchy-cursed paperwork gets lost! What am I supposed to do with [two hundred gallons] of namptha soup? I sure as hell can't eat it!|"
Unbidden, the guard reached forward and plucked the cover off of the tub. Ter'yeik froze as the Jornissian gazed on the sight within. It was a sea of red, with white spheres floating here and there within it. "[Hmm. That does look tasty.]" His tongue flicked out and back in. "[Smells good, too.]"
Ter'yeik flattened his crest in mock distress. "|Listen, can you just check again for the work order?|"
The guard nodded and tilted his head as he checked his implant. "[Huh! Whaddya know, there it is. Musta got held up in the system for a bit.]" He stood aside and waved at the entrance. "[You know where to go?]"
Ter'yeik managed to keep his voice from squeaking as he replied. "|Yep! To the right, isn't it?|"
The hallway beyond the entrance was metallic and utilitarian, its walls bearing the scars from many years of heavy equipment moving through it. Ter'yeik waited until he was well out of sight of the door before breathing out a huge sigh of relief. He reached forward and took the cover off of the tub again. This time, instead of being full of soup it was full of Silken Feather, crammed awkwardly around a small pot of red-and-white soup.
"|Now aren't you glad you let me have my hacking and holo toys?|" she asked as she uncoiled herself and stood up out of the tub. She shrugged her shoulders, then flexed her neck. "|Ooof. Not my most comfortable entrance ever, but I've had worse.|"
"|I was wondering why you insisted we stop off to buy that stuff,|" said Ter'yeik. "|I didn't think about the smell.|"
The Silken Feather reached forward and patted the side of his snout like he was a mere hatchling. "|That's why I'm the master thief and you are not.|" She concentrated, and her appearance suddenly shifted into that of a mottled gray Karnakian.
Ter'yeik started back. "|Wait, what's this all about?|"
"|I'm not about to go walking around wearing my own face. [Sssnnathor's] security team knows what I look like.|"
A low, powerful moan drifted down the hallway towards them. The moan rapidly rose in pitch, followed closely by another moan whose harmonies worked in counterpoint with the first.
"|Ah, it sounds like the show has started!|" said The Silken Feather. She stepped out of the tub and held out her arm to Ter'yeik. "|Shall we?|"
He stared in confusion at the proffered limb. "|What?|"
"|In order to steal the Claw we need to see where it is, silly. Therefore you and I need to crash the party.|"
"|We can't go walking in there! I thought we were going to do more sneaking around.|"
"|There's no time for stealth. Besides, there's plenty of people milling around, we'll just blend right in. A confident attitude is the best disguise. Trust me and above all act casual.|"
After another moment of hesitation, Ter'yeik took her arm.


Nerlharg-of-Aergh nodded along with the song as he stalked through the party. Most of the crowd was pushed in around the stage, but there were a few stragglers circulating around the food and drink tables.
The melodic structure was odd but interesting, even if the words were now a jumbled mess to his translator. He made a mental note to look up other examples of Karnakian congretory singing and see how this compared.
Nerlharg's nose twitched as a scent hit his nostrils that he wouldn't expect to encounter at a party. It was the smell of a Karnakian in the grip of mortal fear, a scent he knew well thanks to his experiences in Sssnnathor's employ.
He kept his expression neutral as he turned to scan the nearby partygoers. In the distance, the four Karnakians' crests bobbed in time with their singing. Closer to him was another pair of Karnakians. One of the pair was a mottled gray alien standing arm-in-arm with a cream-colored one. He discreetly sniffed again. The lighter of the pair was definitely the source of the fear.
"[Doesn't it sound marvelous, dear?]" exclaimed the darker Karnakian in a low, throaty voice. Something about that voice sounded familiar to Nerlharg.
"{Yes darling, quite nice,]" said the lighter-colored raptor. His voice had a little squeak in it as he fidgeted his claws together.
Nerlharg sidled up next to them and cleared his throat. Upon making that sound he got another spike of fear-scent up his nose.
"{Pardon me, but I'm not familiar with congretory singing. Is this a good example of it?}"
The darker Karnakian shrugged her crest. "[It's a little unusual compared to the norm, since you have the pairs alternating instead of all singing together. But it's still quite lovely.]"
Nerlharg was sure she was deliberately pitching her voice lower. More to the point, he was pretty sure he'd heard her voice before. He nodded aimiably at the pair and strolled off. As he did so, the fear-scent subsided.
He reached out with his implant to Sssnnathor. "{Pardon the intrusion, Excellency. We have a situation. I believe I've spotted the Claw's thief among the guests.}"
The distant coiled-up figure of the tyrant didn't twitch, and his subvocal response was nothing but amused. "[Trying to steal back her stolen property, eh? I suppose she doesn't lack for bravery. I imagine these entertainers are in on her scheming as well.]"
"{That is also my assessment, Excellency. Shall I arrest them all?}"
"[No, let's let the show finish. Although, I supposed if you get a chance during the performance to grab them, take it. But I want the [humans] unharmed, understand?]"
"{Of course. What about the others?}"
"[Capture them if you can, but don't worry too much about their health. If they resist too much, go ahead and shoot them.]"
Nerlharg cut the connection and sighed. Tiny-chompers were so notoriously fragile that even grabbing them too fast could seriously injure them. Not to mention they were in the midst of their friends. He'd have to get creative on this one.


Maria Vargas strode out into the center of the stage with Coleridge's words fixed firmly in her brain. She told herself that this was just a simple recitation, nothing at all to worry about. By this point she could do the damn poem in her sleep.
She reached the center, took a deep breath, raised her eyes...
And froze.
A sea of gleaming eyes stared back at her, eyes that were every color of the rainbow. Those eyes were attached to huge forms sporting far too many claws and fangs. Her hind-brain shrieked at her to flee, that she was a mouse under the gaze of far too many predators.
She glanced to her left, and saw Sssnnathor staring at her intently with a silvery gaze. Next to his head was the Claw, the thing that had brought her to this moment of danger. Neither sight helped her nerves, and she could feel her heart hammer faster.
Maria faced back to the crowd and tried to swallow, but it felt like she had a golf ball lodged in her throat. She wetted her lips and closed her eyes, which helped a little.
"It is..." she began with a raspy, choked voice. She paused and told herself that even with no drone Reshy was watching over her. That knowledge helped slow her heart even more.
Maria opened her eyes and this time deliberately kept her eyes unfocused on the crowd in front of her. As far as she was concerned, the assembled crowd was nothing but a blur of color. She cleared her throat, and when she spoke again the rasp was gone.
"It is an ancient Mariner, And he stoppeth one of three..."
Once Maria started speaking, instinct kicked in and the words flowed easily. As the poem wound on and the ship in the tale went through first storms and then ice, she began to half-notice the crowd instead of treating them like a backdrop. Their rapt expressions emboldened her, and by the time she hit the part where the Mariner's becalmed ship ran into the ghostly hulk captained by Death himself she knew she had them.
"...A sadder and a wiser man, He rose the morrow morn."
After Maria finished, there was a moment of silence.
"[Amazing!]" Sssnnathor called out. His exclamation seemed to break the logjam, and the crowd followed suit with a chorus of various whoops and trills. Maria ignored the pounding of her heart as she smiled, bowed, and left the stage. She did her best to keep the wobble out of her knees.
Hrathra'sstah gripped Maria's shoulder after she re-entered the hut. Hrathra's face was still set in its ususal intense glare, but from the set of her hood Maria knew that her boss was ecstatic. "[Excellent job!]"
"Thanks, boss." Maria stared at the floor and all but panted.
"[Are you all right?]"
"I'm good, I got a bit of stage fright there. Just need a while to calm myself down."
Hrathra gave her shoulder a squeeze and moved off. The crew was busy getting the Captain and Bgrarh ready, so for the moment all eyes were off her.
Not getting stared at anymore helped, but Maria really needed some alone time. While everyone was looking the other way she ducked out of the hut's rear door.
There was nothing behind the hut but a short 'alleyway' between the temporary structure and the sloping wall of Sssnnathor's pyramid. Maria leaned forward, placed her forehead on the wall's smooth cement-like surface, and let out another shaky breath. After a little moment of doing nothing but paying attention to her breathing, she stood up again.
She was feeling a lot calmer now, an emotion that lasted for all of ten seconds before she felt the faintest whisper of air and realized she was no longer alone.
Maria spun around towards the hut and drew in a breath to yell just as an invisible paw clamped tight over her mouth.


Oscar peered out through the half-open door to the stage. Bgrarh and the Captain whirled in a complicated dance that he could barely follow. It looked a little like a waltz but with a lot more airborne bits to it. To his uneducated eye it looked amazing, and the Captain actually looked happy, something that Oscar had never seen before.
He turned away and picked up the guitar. It was about as well-tuned as he could get it, but fiddling with it gave him something to take his mind off of his nerves. He'd done a few open-mic nights back on Earth, but this was something much more serious.
Plus there was the whole threat of being found out and getting involved in a huge firefight.
Oscar peeked back out again, this time scanning the crowd instead of paying attention to the dance. It looked like they were digging it, just like they'd dug Maria's recitation.
Speaking of which, where was she? He turned away from the stage door and looked around the hut. He did a circuit of the place, dodging around the Jornissian and Karnakian forms. He didn't ask anyone if they'd seen Maria; that might trigger a freak-out, especially in Resh'ssk. There was no need to worry anyone just yet.
As he walked by the rear entrance, he heard Maria's quiet voice. "Oscar? Can you come out here, please?"
The others were busy prepping, and didn't notice as Oscar set his guitar down and cracked open the door to poke his head out.
Maria leaned casually against the sloping wall across from the door, staring off into the distance.
"What's up?" he asked.
She didn't answer. Oscar glanced to each side and saw nothing. His brow wrinkled as he moved himself all the way out of the door and approached her. "Maria? Are you okay?"
She ignored him and continued to stare off, unmoving and silent. It wasn't until Oscar got within a few feet of her that he realized just how unmoving she was.
As unmoving as if she was a hologram.
On pure instinct Oscar threw his arm up to ward off anyone trying to get him in a choke-hold from behind. He managed to get his sleeve up in front of his face before his world went dark and he found himself unable to move.


"[I'm getting a strange reading from the drones onboard the Claw,]" said Egwreh's voice in Tk'rii'na's ear. "[Plus the telemetry from the [humans] is looking oddly muted.]"
He and Irr''kttz turned from watching the dance onstage. The Karnakians known as 'Tarky' and 'Frick' to their [human] friends both scanned the hut in increasing panic.
"|I don't see [Oscar] or [Maria].|" said Tk'rii'na.
Both saw at the same time that the rear door was now open. After one quick glance at each other, they sprinted as one for the back door.
In true Karnakian fashion neither bothered to open it. The temporary structure shook as the entire rear of the hut all but evaporated, sending chunks of composite ricocheting off of the rear wall and onto the surprised guests.
Irr''kttz pointed. "|THERE! I see them!|"
Tk'rii'na followed the claw with his eyes and saw two faint whirls of familiar sparkly light floating in the middle of the air. There was nothing visible around the pair of sparkly souls as they rapidly approached a side exit.


Onstage, the pair of whirling Doaraizin spun to a sudden halt as the resounding crunch of the Karnakian's dynamic exit sounded through the atrium. Rgrarshok ignored the bits of former hut bouncing off of her skull.
"{REPORT!}" she barked. She saw guards here and there among the party starting to stand up straight, but she ignored them for now. She glanced around in rising panic, and realized she saw no sign of Sssnnathor.
The plinth that had once held the Claw was now empty.
Irr''kttz's voice yelled in her ear. "[THERE! I see them!]"
Tk'rii'na sounded a lot calmer. "[I see them too, they've been wrapped in optical camo. Heading for the exit to your right, Captain.}"
"[Got it,]" said Rgrarshok. She and Bgrarh exchanged one look, to which he gave a Dorarizin nod.
"{[Calvinball],}" they said simultaneously.
Bgrarh sprinted for the hut just as Rgrarshok charged towards the edge of the stage nearest the indicated exit. The confused murmuring of the crowd now became earnest screaming at the sight of the rampaging Captain.
The trigger-word also reactivated the drones hovering near the far-off main entrance. Each immediately locked onto the telemetry readings from their respective [human]; rather than waste time maneuvering through the doorway they both 'decided' that the quickest route between them and their charges was a straight line. Two loud bangs sounded from the main entrance as each drone smashed its way into the atrium.
In the middle of her icy rage, Rgrarshok noted the trajectory of the two drones. Following that line, she caught the merest hint of a pair of heat-shimmers in the air; several panicked partygoers bounced off of the cloaked figures as they sprinted for the side-exit.
Rgarshok leapt off of the stage as the crowd beneath her parted with great alacrity to get the hell out of her way. As she landed in a crouch, a lone Dorarizin guard pushed out of the mob to block her way. He thrust a shock-baton at her chest which she didn't even try to block. The armor did its job, hardening with the impact and allowing the baton to skate off to the side.
Rgrarshok shoved herself upright as she grabbed the guard's weapon-arm. He was wearing low-profile armor as well, so instead of wasting time punching at him she settled for a overhand throw that flung the guard away with a wet crunch that signaled a ruined shoulder.
The Captain continued to push forward, but couldn't go fast enough through the panicked mob. Rgarshok decided that now was not the time to play nice and began throwing people out of her way. Even a Jornissian or two found themselves the target of her flinging. The only good news was that the drones had reached the doorway and now hovered in the path of the cloaked goons carrying the tiny-chompers. They each projected a targeting grid, trying to lock onto the cloaked goon without hurting the tiny-chompers...
Both two drones sparked and fell to the floor with smoking holes drilled neatly in each of them. Two more Dorarizin in full armor and wielding rifles stepped over the wrecked machines.
The guards parted to let the heat-shimmers pass between them, then stepped back together and came running towards Rgrarshok. Her attackers didn't use their guns for their intended purpose, instead they used the long weapons as clubs to smack aside the partygoers as they moved towards her.
Rgarshok roared in rage and charged.
submitted by Frank_Leroux to HFY [link] [comments]

My Observations on Skill Speed/Spell Speed

So, this is my first time doing a Reddit post ever and I may be doing this completely wrong, but here goes.
So I was wondering how much SS affects the casts and recasts of things so I did some rudimentary tests. Now, I do realize Dervy has a skill speed formula and I find him to be an authority on the stat side of FFXIV. Also, I may be ridiculously behind on all this as I'm not around the social media scene very much (unless you count FFXIV) so I don't know if this has all already been stated.
Anyway, what I found is that at level 60, every 200/3 points of SS, not including the base amount of 354, accounts for about a 1% reduction to the cast/recast time. That's 66.6 repeating, by the way. For a super simple example, if you had 600 bonus SS (or 954 SS total), your cast/recast time is reduced by 9%. So, your 2.5s recast would be 2.275s. I think it also floors it for the tooltip, so it would show as 2.27s instead of 2.28s. If you are a healer, your Cure or Physic would have a 1.82s cast time. And so on and so on.
Of course, this is just what it looks like. So far, I have been able to reliably figure out how long everything is pretty accurately from this.
Additionally, the way this interacts with say Greased Lightning, Huton, or Presence of Mind is multiplicative. What this means is just like how buffs stack multiplicatively, so does SS and Attack Speed. So, If I had this 9% reduction and I used Presence of Mind (a 20% AS buff if I remember correctly), it wouldn't drop my cast/recast time by 29% from the total. Instead it will multiply and give less than that. So you'll only really get a 27.2% reduction total. Using the earlier example, this means your recast time will be 1.82s and your Cure would have a cast time of 1.45s (1.456 floored).
Think of the example like this for the Presence of Mind example: (Base Cast or Recast Time) * (.91) * (.80)
From the looks of things, Skill Speed and Spell Speed are calculated the same way. If this makes sense, then you should be able to figure out how fast you gonna be going when you doing the things.
To wrap it all up, to find out your actual times do this:
And that's it! I hope this all makes sense and that it helps! Of course, if anyone finds something wrong about it feel free to leave a comment and I'll get to it maybe. I'll try to pay attention to the Reddit more. :D
Thanks for reading! Sine Kang (Coeurl)
PSS. Also, no matter how many stacks of Greased Lightning you have, it counts as one buff, I think.
EDIT: So it's been pointed out that instead of 66.6, the value is probably closer to 66. I still want to run more tests though, but using either should still give a pretty close representation of the times.
EDIT 2: So as it turns out, my current gear would contain the value that destroys my formula working pretty well for non-2.50s GCDs. According to both my and Krindor's value, with 443 total SpSp, my 3.00s and 6.00s GCDs were off by a hundredth. Plugging in both 66 and (200/3), both the thousandth and ten-thousandth place ended up being 9 (it was like 2.9599 for both values). So instead of flooring down like I expected, it was instead actually rounded up.
If I remember correctly from the little bit of coding knowledge I have, most programming code only handle float values to certain decimal points, so it may be a problem with the computer rounding to a certain place during the calculation that causes the calculation to slightly buff the number. Something about significant digits and binary and whatever other nonsense.
Or, it could be that maybe it's not a perfect 3.00s and 6.00s I should put in. Or that the value is slightly off. OR, I could just be stupid and have absolutely no clue as to what is going on.
Either way, being a ten-thousandth place off isn't really a HUGE deal, but it bugs me nonetheless. I'll continue to experiment where I can, though.
submitted by SelfInsertion to ffxiv [link] [comments]

Critique my study guide please!

Hi I 19f left school when I was 14 recently dropped from community college because my financial aide wouldn't go through. My credit is bad I, have no co-signers so no loans. I only have a part time job, so basically can't afford college. Recently I got into coding, basically I just watch tutorials on YouTube and decided I really wanted to learn. Spent some time reading on different sites and came up with a study guide to learn what I may have learned had I stayed in school. I know the list is but I plan to spend three years on it, I know others have learned how to code in months but I don't think that would be me. I would love some feedback please and thank you. (Please excuse any typos it's only a rough copy)
Study Guide!!!
(Spend 1 week on each individual subject, 8 hours a day, 30 minutes of studying, 5 minute break repeat)
(Full course completion should take 2 years and 6 months)
(Once finished, spend next 6 months freelancing and building a porfolio on github)
Actual studying:
-Watch a video on each individual subject (possibly 2hrs.)
-Go through course work on codeacademy (and various other sites) on each individual subject (2hrs.)
-Read a book on each individual subject (3hrs.)
-Write out questions on paper on each individual subject as you go along (Review questions at a later date)
-Make flashcards on each individual subject (Review at a later date)
-Go through Google course on various subjects (1hr.)
1.Semantic HTML. 2.Be able to explain the CSS Box Model. 3.Benefits of CSS preprocessors 4.CSS Media Queries to target different devices and write responsive CSS. 5.Bootstrap
(JavaScript): 6.Understand how to work with the DOM. Also know what JSON is and how to manipulate it. 7.Important language features such as functional composition, prototypal inheritance, closures, event delegation, scope, higher-order functions. 8.Asynchronous control flow, promises, and callbacks. 9.Learn how to properly structure your code and modularize parts of it, things like webpack, browserify, or build tools like gulp. 10.Know how to use at least one popular framework 11.jQuery code 12.Some knowledge on testing frameworks and why they’re important 13.Learn about some important new ES6 features
(Back-End Language): 14.Node.js 15.Ruby 16.Python 17.Java 18.PHP
(Databases & Web Storage): 19.Understand the benefits of relational data, e.g. SQL. 20.Learn about NoSQL databases, e.g. MongoDB. 21.Understand which would be better in certain situations. 22.Know how to connect a database with your chosen back-end language (e.g. Node.js + MongoDB). 23.Understand the benefits of in-memory data stores like Redis or memcached. 24.Web storage to store sessions, cookies, and cached data in the browser. 25.Scaling databases, ACID, and ORM (all optional).
(HTTP & REST): 26.What is REST and why is it important in regards to the HTTP protocol and web applications. 27.Best practices for designing a RESTful API. POST/GET requests. 28.Learning how to use Chrome DevTools can be extremely helpful. 29.What are SSL Certificates. 30.HTTP/2 & SPDY (optional). 31.WebSockets, Web Workers, and Service Workers (all optional).
(Web Application Architecture): 32.learn how to architect your web applications efficiently: 33.Learn about common platforms as a service, e.g. Heroku and AWS. 34.Performance optimization for applications and modern browsers. 35.Learn what a web application architecture should include. 36.Designing Web Applications by Microsoft. 37.MVC. 38.Most importantly, try to work on projects with people, look at codebases of popular projects on GitHub, and learn as much as you can from senior developers.
(Git): 39.update parts of the code 40.make fixes 41.change other people’s code without breaking things 42.Learn the concept behind Git and play around with it yourself. 43.learn some common git commands you’ll likely use
(Basic Algorithms & Data Structures): 44.Improve your Algorithms & Data Structure Skills Article 45.Study hash tables and try to understand them on a deeper level. 46.Understand how trees and graphs can be beneficial as data structures. 47.Understand the basics of Big-O analysis 48.Know when to use an object vs an array and understand the trade-offs. 49.Learn why caching is so important when working with a large amount of data. Also learn the pros and cons of in-memory vs disk storage. 50.Learn the difference between queues and stacks. 51.Learn how to visualize and conceptionalize code
(What every programmer should know): 52.Desktop Scripting 53.Server-side scripting 54.Web frameworks 55.Web APIs 56.Command Line Scripting 57.Add-ons
(Important topics of number theory every programmer should know): 58.Number theory [Number Theory]: Modular arithmetic, Fermat’s theorem, Chinese remainder theorem(CRT), Euclidian method for GCD, Logarithmic Exponentiation, Sieve of Eratosthenes, Euler’s totient function. 59.Graph algorithms [graph theory]: Breadth first search(BFS), Depth first search(DFS), Strongly connected components(SCC), Dijkstra, Floyd-Warshall, Minimum spanning tree(MST), Topological sort. 60.boolean logic, boolean algebra 61.What does O(n) mean? 62.The compound interest formula 63.matrix/linear algebra, numerical analysis 64.The statistics behind A/B testing 65.numerical approximation of a derivative, integral, differential equation 66.Read "numerical recipes in C"
(For programmers in Artificial Intelligence and Machine Learning area): 67.knowledge of Matrix (mathematics) calculations 68.Numerical analysis is a must 69.Basic understanding of Differential equation and Integral equation 70.High School Algebra 71.Information Systems and Databases: Set Theory
(Gaming): 72.Basic principles of Nim game, Grundy numbers, Sprague-Grundy theorem. 73.Vector Analysis/Mathmatics 74.Discrete Mathematics 75.Solid Geometry 76.Linear Algebra 77.Calculus (Read the use of Newton's Method of Approximation in Quake)
(Textual Analysis): 78.Discrete Mathematics 79.Recurrence Relations 80.GraphTheory
(Business Intelligence and Statistical Analysis): 81.Statistics 82.Set Theory
(Optimization): 83.Graph Theory 84.Linear Algebra 85.Operations Research topics
(Precise Computation): 86.Calculus and other advanced fields. 87.Arithmetic. 88.Basics of data representation - number bases, two's complement, floating point, etc. 89.Graph theory, because almost all modern programs have some kind of graph as their main data structure. 90.Induction, because its vital to be able to reason about recursion and this is how you do it. 91.Finite state machines. 92.Computability and intractability - the proof of the halting theorem and that SAT is NP-complete and what these imply.
(Other): 93.Greedy [goal programming, simplex algorithm, multi-criteria decision analysis]: Standard problems such as Activity selection. 94.Search techniques [lineavector algebra[2]]: Binary search, Ternary search and Meet in the middle. 95.Data structures (Basic) [graph theory]: Stacks, Queues, Trees and Heaps. 96.Data structures (Advanced)[more graph theory]: Trie, Segment trees, Fenwick tree or Binary indexed tree(BIT), Disjoint data structures. 97.Strings [set theory]: Knuth Morris Pratt(KMP), Z algorithm, Suffix arrays/Suffix trees. These are bit advanced algorithms. 98.Computational geometry [computational geometry]: Graham-Scan for convex hull, Line sweep. 99.Basic formal type theory. No need to get carried away, but familiary with the Hindley-Milner type system covariance and contravariance helps to understand even languages like C++ and Java whose type systems are much less formal 100.Basic graph theory 101.Recursive reasoning 102.You have to know about probabilistic and statistical methods to suggest the best possible correction and to even understand popular algorithms like the Viterbi or Baum Welch algorithms, and also for natural language processing and machine learning applications 103.Dynamic programming [self-similarity, finite subdivision rules, nonlinear equations]: Standard dynamic programming problems such as Rod Cutting, Knapsack, Matrix chain multiplication etc. 104.Lamba Calculus 105.Propositional Logic
(Software engineering): 106.Object oriented analysis & design 107.Software quality factors 108.Data structures & algorithms 109.Big-O notation: Big-O notation indicates the performance of an algorithm/code section. Understanding it is very important for comparing performances. 110.UML notation 111.Software processes and metrics 112.Design patterns 113.Operating systems basics 114.Computer organization basics 115.Network basics 116.Requirement analysis 117.Software testing 118.Dependency management 119.Continuous integration 120.ORM (Object relational mapping) 121.DI (Dependency Injection) 122.Version controlling systems 123.Internationalization (i18n) 124.Architectural patterns 125.Writing clean code
submitted by Yourconnect_ to learnprogramming [link] [comments]

3.6 Release of Python (Part 1)


This is a long doc covering every changes in python 3.6.If you do not know anything about the commands do not read this!

Manuel and other things of Python 3.6

Python 3.6

What’s New In Python 3.6

Editors: Elvis Pranskevichus [email protected], Yury Selivanov [email protected] This article explains the new features in Python 3.6, compared to 3.5. Python 3.6 was released on December 23, 2016.

Summary – Release highlights

New syntax features:
New library modules:
CPython implementation improvements:
Significant improvements in the standard library:
Security improvements:
*On Linux, os.urandom() now blocks until the system urandom entropy pool is initialized to increase the security. See the PEP 524 for the rationale.
Windows improvements:

New Features

PEP 498: Formatted string literals

PEP 498 introduces a new kind of string literals: f-strings, or formatted string literals. Formatted string literals are prefixed with 'f' and are similar to the format strings accepted by str.format(). They contain replacement fields surrounded by curly braces. The replacement fields are expressions, which are evaluated at run time, and then formatted using the format() protocol:
name = "Fred">>> f"He said his name is {name}."'He said his name is Fred.'>>>
width = 10>>> precision = 4>>> value = decimal.Decimal("12.34567")>>> f"result:
{value:{width}.{precision}}" # nested fields'result: 12.35'

PEP 526: Syntax for variable annotations

PEP 484 introduced the standard for type annotations of function parameters, a.k.a. type hints. This PEP adds syntax to Python for annotating the types of variables including class variables and instance variables:
primes: List[int] = []
captain: str # Note: no initial value!
class Starship:
stats: Dict[str, int] = {} 
Just as for function annotations, the Python interpreter does not attach any particular meaning to variable annotations and only stores them in the annotations attribute of a class or module. In contrast to variable declarations in statically typed languages, the goal of annotation syntax is to provide an easy way to specify structured type metadata for third party tools and libraries via the abstract syntax tree and the annotations attribute.
Tools that use or will use the new syntax: mypy, pytype, PyCharm, etc.

PEP 515: Underscores in Numeric Literals

PEP 515 adds the ability to use underscores in numeric literals for improved readability. For example:
Single underscores are allowed between digits and after any base specifier. Leading, trailing, or multiple underscores in a row are not allowed.
The string formatting language also now has support for the '_' option to signal the use of an underscore for a thousands separator for floating point presentation types and for integer presentation type 'd'. For integer presentation types 'b', 'o', 'x', and 'X', underscores will be inserted every 4 digits:
'{:_}'.format(1000000)'1_000_000'>>> '{:_x}'.format(0xFFFFFFFF)'ffff_ffff'

PEP 525: Asynchronous Generators

PEP 492 introduced support for native coroutines and async / await syntax to Python 3.5. A notable limitation of the Python 3.5 implementation is that it was not possible to use await and yield in the same function body. In Python 3.6 this restriction has been lifted, making it possible to define asynchronous generators:
async def ticker(delay, to):
"""Yield numbers from 0 to *to* every *delay* seconds.""" for i in range(to): yield i await asyncio.sleep(delay) 
The new syntax allows for faster and more concise code.

PEP 530: Asynchronous Comprehensions

PEP 530 adds support for using async for in list, set, dict comprehensions and generator expressions:
result = [i async for i in aiter() if i % 2]
Additionally, await expressions are supported in all kinds of comprehensions:
result = [await fun() for fun in funcs if await condition()]

PEP 487: Simpler customization of class creation

It is now possible to customize subclass creation without using a metaclass. The new init_subclass classmethod will be called on the base class whenever a new subclass is created:
class PluginBase:
subclasses = [] def __init_subclass__(cls, **kwargs): super().__init_subclass__(**kwargs) cls.subclasses.append(cls) 
class Plugin1(PluginBase):
class Plugin2(PluginBase):
In order to allow zero-argument super() calls to work correctly from init_subclass() implementations, custom metaclasses must ensure that the new classcell namespace entry is propagated to (as described in Creating the class object).

PEP 487: Descriptor Protocol Enhancements

PEP 487 extends the descriptor protocol to include the new optional set_name() method. Whenever a new class is defined, the new method will be called on all descriptors included in the definition, providing them with a reference to the class being defined and the name given to the descriptor within the class namespace. In other words, instances of descriptors can now know the attribute name of the descriptor in the owner class:
class IntField:
def __get__(self, instance, owner): return instance.__dict__[] def __set__(self, instance, value): if not isinstance(value, int): raise ValueError(f'expecting integer in {}') instance.__dict__[] = value # this is the new initializer: def __set_name__(self, owner, name): = name 
class Model:
int_field = IntField() 

PEP 519: Adding a file system path protocol

File system paths have historically been represented as str or bytes objects. This has led to people who write code which operate on file system paths to assume that such objects are only one of those two types (an int representing a file descriptor does not count as that is not a file path). Unfortunately that assumption prevents alternative object representations of file system paths like pathlib from working with pre-existing code, including Python’s standard library. To fix this situation, a new interface represented by os.PathLike has been defined. By implementing the fspath() method, an object signals that it represents a path. An object can then provide a low-level representation of a file system path as a str or bytes object. This means an object is considered path-like if it implements os.PathLike or is a str or bytes object which represents a file system path. Code can use os.fspath(), os.fsdecode(), or os.fsencode() to explicitly get a str and/or bytes representation of a path-like object. The built-in open() function has been updated to accept os.PathLike objects, as have all relevant functions in the os and os.path modules, and most other functions and classes in the standard library. The os.DirEntry class and relevant classes in pathlib have also been updated to implement os.PathLike. The hope is that updating the fundamental functions for operating on file system paths will lead to third-party code to implicitly support all path-like objects without any code changes, or at least very minimal ones (e.g. calling os.fspath() at the beginning of code before operating on a path-like object). Here are some examples of how the new interface allows for pathlib.Path to be used more easily and transparently with pre-existing code:
import pathlib>>> with open(pathlib.Path("README")) as f:... contents
=>>> import os.path>>>
os.path.splitext(pathlib.Path("some_file.txt"))('some_file', '.txt')>>>
os.path.join("/a/b", pathlib.Path("c"))'/a/b/c'>>> import os>>>

PEP 495: Local Time Disambiguation

In most world locations, there have been and will be times when local clocks are moved back. In those times, intervals are introduced in which local clocks show the same time twice in the same day. In these situations, the information displayed on a local clock (or stored in a Python datetime instance) is insufficient to identify a particular moment in time. PEP 495 adds the new fold attribute to instances of datetime.datetime and datetime.time classes to differentiate between two moments in time for which local times are the same:
u0 = datetime(2016, 11, 6, 4, tzinfo=timezone.utc)>>> for i in range(4):...
u = u0 + i*HOUR... t = u.astimezone(Eastern)... print(u.time(), 'UTC =',
t.time(), t.tzname(), t.fold)...04:00:00 UTC = 00:00:00 EDT 005:00:00 UTC = 01:00:00
EDT 006:00:00 UTC = 01:00:00 EST 107:00:00 UTC = 02:00:00 EST 0
The values of the fold attribute have the value 0 for all instances except those that represent the second (chronologically) moment in time in an ambiguous case.

PEP 529: Change Windows filesystem encoding to UTF-8

Representing filesystem paths is best performed with str (Unicode) rather than bytes. However, there are some situations where using bytes is sufficient and correct. Prior to Python 3.6, data loss could result when using bytes paths on Windows. With this change, using bytes to represent paths is now supported on Windows, provided those bytes are encoded with the encoding returned by sys.getfilesystemencoding(), which now defaults to 'utf-8'. Applications that do not use str to represent paths should use os.fsencode() and os.fsdecode() to ensure their bytes are correctly encoded. To revert to the previous behaviour, set PYTHONLEGACYWINDOWSFSENCODING or call sys._enablelegacywindowsfsencoding().

PEP 528: Change Windows console encoding to UTF-8

The default console on Windows will now accept all Unicode characters and provide correctly read str objects to Python code. sys.stdin, sys.stdout and sys.stderr now default to utf-8 encoding. This change only applies when using an interactive console, and not when redirecting files or pipes. To revert to the previous behaviour for interactive console use, set PYTHONLEGACYWINDOWSSTDIO.

PEP 520: Preserving Class Attribute Definition Order

Attributes in a class definition body have a natural ordering: the same order in which the names appear in the source. This order is now preserved in the new class’s dict attribute. Also, the effective default class execution namespace (returned from type.prepare()) is now an insertion-order-preserving mapping.

PEP 468: Preserving Keyword Argument Order

**kwargs in a function signature is now guaranteed to be an insertion-order-preserving mapping.

New dict implementation

The dict type now uses a “compact” representation based on a proposal by Raymond Hettinger which was first implemented by PyPy. The memory usage of the new dict() is between 20% and 25% smaller compared to Python 3.5. The order-preserving aspect of this new implementation is considered an implementation detail and should not be relied upon (this may change in the future, but it is desired to have this new dict implementation in the language for a few releases before changing the language spec to mandate order-preserving semantics for all current and future Python implementations; this also helps preserve backwards-compatibility with older versions of the language where random iteration order is still in effect, e.g. Python 3.5). (Contributed by INADA Naoki in bpo-27350. Idea originally suggested by Raymond Hettinger.) PEP 523: Adding a frame evaluation API to CPython While Python provides extensive support to customize how code executes, one place it has not done so is in the evaluation of frame objects. If you wanted some way to intercept frame evaluation in Python there really wasn’t any way without directly manipulating function pointers for defined functions. PEP 523 changes this by providing an API to make frame evaluation pluggable at the C level. This will allow for tools such as debuggers and JITs to intercept frame evaluation before the execution of Python code begins. This enables the use of alternative evaluation implementations for Python code, tracking frame evaluation, etc. This API is not part of the limited C API and is marked as private to signal that usage of this API is expected to be limited and only applicable to very select, low-level use-cases. Semantics of the API will change with Python as necessary.

PYTHONMALLOC environment variable

The new PYTHONMALLOC environment variable allows setting the Python memory allocators and installing debug hooks. It is now possible to install debug hooks on Python memory allocators on Python compiled in release mode using PYTHONMALLOC=debug. Effects of debug hooks: Newly allocated memory is filled with the byte 0xCB Freed memory is filled with the byte 0xDB Detect violations of the Python memory allocator API. For example, PyObject_Free() called on a memory block allocated by PyMem_Malloc(). Detect writes before the start of a buffer (buffer underflows) Detect writes after the end of a buffer (buffer overflows) Check that the GIL is held when allocator functions of PYMEM_DOMAIN_OBJ (ex: PyObject_Malloc()) and PYMEM_DOMAIN_MEM (ex: PyMem_Malloc()) domains are called. Checking if the GIL is held is also a new feature of Python 3.6. See the PyMem_SetupDebugHooks() function for debug hooks on Python memory allocators. It is now also possible to force the usage of the malloc() allocator of the C library for all Python memory allocations using PYTHONMALLOC=malloc. This is helpful when using external memory debuggers like Valgrind on a Python compiled in release mode. On error, the debug hooks on Python memory allocators now use the tracemalloc module to get the traceback where a memory block was allocated. Example of fatal error on buffer overflow using python3.6 -X tracemalloc=5 (store 5 frames in traces):
Debug memory block at address p=0x7fbcd41666f8: API 'o'
4 bytes originally requested The 7 pad bytes at p-7 are FORBIDDENBYTE, as expected. The 8 pad bytes at tail=0x7fbcd41666fc are not all FORBIDDENBYTE (0xfb): at tail+0: 0x02 *** OUCH at tail+1: 0xfb at tail+2: 0xfb at tail+3: 0xfb at tail+4: 0xfb at tail+5: 0xfb at tail+6: 0xfb at tail+7: 0xfb The block was made by call #1233329 to debug malloc/realloc. Data at p: 1a 2b 30 00 
Memory block allocated at (most recent call first):
File "test/", line 323
File "unittest/", line 600
File "unittest/", line 648
File "unittest/", line 122
File "unittest/", line 84
Fatal Python error: bad trailing pad byte
Current thread 0x00007fbcdbd32700 (most recent call first):
File "test/", line 323 in test_hex
File "unittest/", line 600 in run
File "unittest/", line 648 in call
File "unittest/", line 122 in run
File "unittest/", line 84 in call
File "unittest/", line 122 in run
File "unittest/", line 84 in call
(Contributed by Victor Stinner in bpo-26516 and bpo-26564.)

DTrace and SystemTap probing support

Python can now be built --with-dtrace which enables static markers for the following events in the interpreter: * function call/return * garbage collection started/finished * Line of code executed.
This can be used to instrument running interpreters in production, without the need to recompile specific debug builds or providing application-specific profiling/debugging code. More details in Instrumenting CPython with DTrace and SystemTap.
The current implementation is tested on Linux and macOS. Additional markers may be added in the future.
(Contributed by Łukasz Langa in bpo-21590, based on patches by Jesús Cea Avión, David Malcolm, and Nikhil Benesch.)

Other Language Changes

Some smaller changes made to the core Python language are: A global or nonlocal statement must now textually appear before the first use of the affected name in the same scope. Previously this was a SyntaxWarning.
It is now possible to set a special method to None to indicate that the corresponding operation is not available. For example, if a class sets iter() to None, the class is not iterable. (Contributed by Andrew Barnert and Ivan Levkivskyi in bpo-25958.)
Long sequences of repeated traceback lines are now abbreviated as "[Previous line repeated {count} more times]" (see traceback for an example). (Contributed by Emanuel Barry in bpo-26823.)
Import now raises the new exception ModuleNotFoundError (subclass of ImportError) when it cannot find a module. Code that currently checks for ImportError (in try-except) will still work. (Contributed by Eric Snow in bpo-15767.)
Class methods relying on zero-argument super() will now work correctly when called from metaclass methods during class creation. (Contributed by Martin Teichmann in bpo-23722.)

New Modules


The main purpose of the new secrets module is to provide an obvious way to reliably generate cryptographically strong pseudo-random values suitable for managing secrets, such as account authentication, tokens, and similar. Warning Note that the pseudo-random generators in the random module should NOT be used for security purposes. Use secrets on Python 3.6+ and os.urandom() on Python 3.5 and earlier.

Improved Modules


Exhausted iterators of array.array will now stay exhausted even if the iterated array is extended. This is consistent with the behavior of other mutable sequences. Contributed by Serhiy Storchaka in bpo-26492.


The new ast.Constant AST node has been added. It can be used by external AST optimizers for the purposes of constant folding. Contributed by Victor Stinner in bpo-26146.


Starting with Python 3.6 the asyncio module is no longer provisional and its API is considered stable. Notable changes in the asyncio module since Python 3.5.0 (all backported to 3.5.x due to the provisional status): * The get_event_loop() function has been changed to always return the currently running loop when called from couroutines and callbacks. (Contributed by Yury Selivanov in bpo-28613.) * The ensure_future() function and all functions that use it, such as loop.run_until_complete(), now accept all kinds of awaitable objects. (Contributed by Yury Selivanov.) * New run_coroutine_threadsafe() function to submit coroutines to event loops from other threads. (Contributed by Vincent Michel.) * New Transport.is_closing() method to check if the transport is closing or closed. (Contributed by Yury Selivanov.) * The loop.create_server() method can now accept a list of hosts. (Contributed by Yann Sionneau.) * New loop.create_future() method to create Future objects. This allows alternative event loop implementations, such as uvloop, to provide a faster asyncio.Future implementation. (Contributed by Yury Selivanov in bpo-27041.) * New loop.get_exception_handler() method to get the current exception handler. (Contributed by Yury Selivanov in bpo-27040.) * New StreamReader.readuntil() method to read data from the stream until a separator bytes sequence appears. (Contributed by Mark Korenberg.) * The performance of StreamReader.readexactly() has been improved. (Contributed by Mark Korenberg in bpo-28370.) * The loop.getaddrinfo() method is optimized to avoid calling the system getaddrinfo function if the address is already resolved. (Contributed by A. Jesse Jiryu Davis.) * The loop.stop() method has been changed to stop the loop immediately after the current iteration. Any new callbacks scheduled as a result of the last iteration will be discarded. (Contributed by Guido van Rossum in bpo-25593.) * Future.set_exception will now raise TypeError when passed an instance of the StopIteration exception. (Contributed by Chris Angelico in bpo-26221.) * New loop.connect_accepted_socket() method to be used by servers that accept connections outside of asyncio, but that use asyncio to handle them. (Contributed by Jim Fulton in bpo-27392.) TCP_NODELAY flag is now set for all TCP transports by default. (Contributed by Yury Selivanov in bpo-27456.) * New loop.shutdown_asyncgens() to properly close pending asynchronous generators before closing the loop. (Contributed by Yury Selivanov in bpo-28003.) * Future and Task classes now have an optimized C implementation which makes asyncio code up to 30% faster. (Contributed by Yury Selivanov and INADA Naoki in bpo-26081 and bpo-28544.)


The b2a_base64() function now accepts an optional newline keyword argument to control whether the newline character is appended to the return value. (Contributed by Victor Stinner in bpo-25357.)


The new cmath.tau (τ) constant has been added. (Contributed by Lisa Roach in bpo-12345, see PEP 628 for details.)
New constants: cmath.inf and cmath.nan to match math.inf and math.nan, and also cmath.infj and cmath.nanj to match the format used by complex repr. (Contributed by Mark Dickinson in bpo-23229.)


The new Collection abstract base class has been added to represent sized iterable container classes. (Contributed by Ivan Levkivskyi, docs by Neil Girdhar in bpo-27598.)
The new Reversible abstract base class represents iterable classes that also provide the reversed() method. (Contributed by Ivan Levkivskyi in bpo-25987.)
The new AsyncGenerator abstract base class represents asynchronous generators. (Contributed by Yury Selivanov in bpo-28720.)
The namedtuple() function now accepts an optional keyword argument module, which, when specified, is used for the module attribute of the returned named tuple class. (Contributed by Raymond Hettinger in bpo-17941.)
The verbose and rename arguments for namedtuple() are now keyword-only. (Contributed by Raymond Hettinger in bpo-25628.)
Recursive collections.deque instances can now be pickled. (Contributed by Serhiy Storchaka in bpo-26482.)


The ThreadPoolExecutor class constructor now accepts an optional thread_name_prefix argument to make it possible to customize the names of the threads created by the pool. (Contributed by Gregory P. Smith in bpo-27664.)


The contextlib.AbstractContextManager class has been added to provide an abstract base class for context managers. It provides a sensible default implementation for enter() which returns self and leaves exit() an abstract method. A matching class has been added to the typing module as typing.ContextManager. (Contributed by Brett Cannon in bpo-25609.)


The datetime and time classes have the new fold attribute used to disambiguate local time when necessary. Many functions in the datetime have been updated to support local time disambiguation. See Local Time Disambiguation section for more information. (Contributed by Alexander Belopolsky in bpo-24773.)
The datetime.strftime() and date.strftime() methods now support ISO 8601 date directives %G, %u and %V. (Contributed by Ashley Anderson in bpo-12006.)
The datetime.isoformat() function now accepts an optional timespec argument that specifies the number of additional components of the time value to include. (Contributed by Alessandro Cucci and Alexander Belopolsky in bpo-19475.)
The datetime.combine() now accepts an optional tzinfo argument. (Contributed by Alexander Belopolsky in bpo-27661.) decimal
New Decimal.as_integer_ratio() method that returns a pair (n, d) of integers that represent the given Decimal instance as a fraction, in lowest terms and with a positive denominator:
Decimal('-3.14').as_integer_ratio()(-157, 50)
(Contributed by Stefan Krah amd Mark Dickinson in bpo-25928.)


The default_format attribute has been removed from distutils.command.sdist.sdist and the formats attribute defaults to ['gztar']. Although not anticipated, any code relying on the presence of default_format may need to be adapted. See bpo-27819 for more details.
The upload command now longer tries to change CR end-of-line characters to CRLF. This fixes a corruption issue with sdists that ended with a byte equivalent to CR. (Contributed by Bo Bayles in bpo-32304.)


The new email API, enabled via the policy keyword to various constructors, is no longer provisional. The email documentation has been reorganized and rewritten to focus on the new API, while retaining the old documentation for the legacy API. (Contributed by R. David Murray in bpo-24277.) The email.mime classes now all accept an optional policy keyword. (Contributed by Berker Peksag in bpo-27331.)
The DecodedGenerator now supports the policy keyword.
There is a new policy attribute, message_factory, that controls what class is used by default when the parser creates new message objects. For the email.policy.compat32 policy this is Message, for the new policies it is EmailMessage. (Contributed by R. David Murray in bpo-20476.)


On Windows, added the 'oem' encoding to use CP_OEMCP, and the 'ansi' alias for the existing 'mbcs' encoding, which uses the CP_ACP code page. (Contributed by Steve Dower in bpo-27959.)


Two new enumeration base classes have been added to the enum module: Flag and IntFlags. Both are used to define constants that can be combined using the bitwise operators. (Contributed by Ethan Furman in bpo-23591.)
Many standard library modules have been updated to use the IntFlags class for their constants. The new value can be used to assign values to enum members automatically:
from enum import Enum, auto>>> class Color(Enum):... red = auto()...
blue = auto()... green = auto()...>>> list(Color)[, , ] faulthandler
On Windows, the faulthandler module now installs a handler for Windows exceptions: see faulthandler.enable(). (Contributed by Victor Stinner in bpo-23848.)


hook_encoded() now supports the errors argument. (Contributed by Joseph Hackman in bpo-25788.)


hashlib supports OpenSSL 1.1.0. The minimum recommend version is 1.0.2. (Contributed by Christian Heimes in bpo-26470.)
BLAKE2 hash functions were added to the module. blake2b() and blake2s() are always available and support the full feature set of BLAKE2. (Contributed by Christian Heimes in bpo-26798 based on code by Dmitry Chestnykh and Samuel Neves. Documentation written by Dmitry Chestnykh.)
The SHA-3 hash functions sha3_224(), sha3_256(), sha3_384(), sha3_512(), and SHAKE hash functions shake_128() and shake_256() were added. (Contributed by Christian Heimes in bpo-16113. Keccak Code Package by Guido Bertoni, Joan Daemen, Michaël Peeters, Gilles Van Assche, and Ronny Van Keer.)
The password-based key derivation function scrypt() is now available with OpenSSL 1.1.0 and newer. (Contributed by Christian Heimes in bpo-27928.)


HTTPConnection.request() and endheaders() both now support chunked encoding request bodies. (Contributed by Demian Brecht and Rolf Krahl in bpo-12319.)

idlelib and IDLE

The idlelib package is being modernized and refactored to make IDLE look and work better and to make the code easier to understand, test, and improve. Part of making IDLE look better, especially on Linux and Mac, is using ttk widgets, mostly in the dialogs. As a result, IDLE no longer runs with tcl/tk 8.4. It now requires tcl/tk 8.5 or 8.6. We recommend running the latest release of either.
‘Modernizing’ includes renaming and consolidation of idlelib modules. The renaming of files with partial uppercase names is similar to the renaming of, for instance, Tkinter and TkFont to tkinter and tkinter.font in 3.0. As a result, imports of idlelib files that worked in 3.5 will usually not work in 3.6. At least a module name change will be needed (see idlelib/README.txt), sometimes more. (Name changes contributed by Al Swiegart and Terry Reedy in bpo-24225. Most idlelib patches since have been and will be part of the process.)
In compensation, the eventual result with be that some idlelib classes will be easier to use, with better APIs and docstrings explaining them. Additional useful information will be added to idlelib when available.


Import now raises the new exception ModuleNotFoundError (subclass of ImportError) when it cannot find a module. Code that current checks for ImportError (in try-except) will still work. (Contributed by Eric Snow in bpo-15767.)
importlib.util.LazyLoader now calls create_module() on the wrapped loader, removing the restriction that importlib.machinery.BuiltinImporter and importlib.machinery.ExtensionFileLoader couldn’t be used with importlib.util.LazyLoader. importlib.util.cache_from_source(), importlib.util.source_from_cache(), and importlib.util.spec_from_file_location() now accept a path-like object.


The inspect.signature() function now reports the implicit .0 parameters generated by the compiler for comprehension and generator expression scopes as if they were positional-only parameters called implicit0. (Contributed by Jelle Zijlstra in bpo-19611.)
To reduce code churn when upgrading from Python 2.7 and the legacy inspect.getargspec() API, the previously documented deprecation of inspect.getfullargspec() has been reversed. While this function is convenient for single/source Python 2/3 code bases, the richer inspect.signature() interface remains the recommended approach for new code. (Contributed by Nick Coghlan in bpo-27172)


json.load() and json.loads() now support binary input. Encoded JSON should be represented using either UTF-8, UTF-16, or UTF-32. (Contributed by Serhiy Storchaka in bpo-17909.) logging
The new WatchedFileHandler.reopenIfNeeded() method has been added to add the ability to check if the log file needs to be reopened. (Contributed by Marian Horban in bpo-24884.)


The tau (τ) constant has been added to the math and cmath modules. (Contributed by Lisa Roach in bpo-12345, see PEP 628 for details.)


Proxy Objects returned by multiprocessing.Manager() can now be nested. (Contributed by Davin Potts in bpo-6766.)


See the summary of PEP 519 for details on how the os and os.path modules now support path-like objects.
scandir() now supports bytes paths on Windows.
A new close() method allows explicitly closing a scandir() iterator. The scandir() iterator now supports the context manager protocol. If a scandir() iterator is neither exhausted nor explicitly closed a ResourceWarning will be emitted in its destructor. (Contributed by Serhiy Storchaka in bpo-25994.) On Linux, os.urandom() now blocks until the system urandom entropy pool is initialized to increase the security. See the PEP 524 for the rationale.
The Linux getrandom() syscall (get random bytes) is now exposed as the new os.getrandom() function. (Contributed by Victor Stinner, part of the PEP 524)


pathlib now supports path-like objects. (Contributed by Brett Cannon in bpo-27186.) See the summary of PEP 519 for details.


The Pdb class constructor has a new optional readrc argument to control whether .pdbrc files should be read.


Objects that need new called with keyword arguments can now be pickled using pickle protocols older than protocol version 4. Protocol version 4 already supports this case. (Contributed by Serhiy Storchaka in bpo-24164.)


pickletools.dis() now outputs the implicit memo index for the MEMOIZE opcode. (Contributed by Serhiy Storchaka in bpo-25382.)


The pydoc module has learned to respect the MANPAGER environment variable. (Contributed by Matthias Klose in bpo-8637.)
help() and pydoc can now list named tuple fields in the order they were defined rather than alphabetically. (Contributed by Raymond Hettinger in bpo-24879.)


The new choices() function returns a list of elements of specified size from the given population with optional weights. (Contributed by Raymond Hettinger in bpo-18844.)


Added support of modifier spans in regular expressions. Examples: '(?i:p)ython' matches 'python' and 'Python', but not 'PYTHON'; '(?i)g(?-i:v)r' matches 'GvR' and 'gvr', but not 'GVR'. (Contributed by Serhiy Storchaka in bpo-433028.)
Match object groups can be accessed by getitem, which is equivalent to group(). So mo['name'] is now equivalent to'name'). (Contributed by Eric Smith in bpo-24454.)
Match objects now support index-like objects as group indices. (Contributed by Jeroen Demeyer and
Xiang Zhang in bpo-27177.)


Added set_auto_history() to enable or disable automatic addition of input to the history list. (Contributed by Tyler Crompton in bpo-26870.)


Private and special attribute names now are omitted unless the prefix starts with underscores. A space or a colon is added after some completed keywords. (Contributed by Serhiy Storchaka in bpo-25011 and bpo-25209.)


The shlex has much improved shell compatibility through the new punctuation_chars argument to control which characters are treated as punctuation. (Contributed by Vinay Sajip in bpo-1521950.) site
When specifying paths to add to sys.path in a .pth file, you may now specify file paths on top of directories (e.g. zip files). (Contributed by Wolfgang Langner in bpo-26587). sqlite3
sqlite3.Cursor.lastrowid now supports the REPLACE statement. (Contributed by Alex LordThorsen in bpo-16864.)


The ioctl() function now supports the SIO_LOOPBACK_FAST_PATH control code. (Contributed by Daniel Stokes in bpo-26536.)
The getsockopt() constants SO_DOMAIN, SO_PROTOCOL, SO_PEERSEC, and SO_PASSSEC are now supported. (Contributed by Christian Heimes in bpo-26907.)
The setsockopt() now supports the setsockopt(level, optname, None, optlen: int) form. (Contributed by Christian Heimes in bpo-27744.)
The socket module now supports the address family AFALG to interface with Linux Kernel crypto API. ALG*, SOL_ALG and sendmsg_afalg() were added. (Contributed by Christian Heimes in bpo-27744 with support from Victor Stinner.)
New Linux constants TCP_USER_TIMEOUT and TCP_CONGESTION were added. (Contributed by Omar Sandoval, issue:26273).


Servers based on the socketserver module, including those defined in http.server, xmlrpc.server and wsgiref.simple_server, now support the context manager protocol. (Contributed by Aviv Palivoda in bpo-26404.)
The wfile attribute of StreamRequestHandler classes now implements the io.BufferedIOBase writable interface. In particular, calling write() is now guaranteed to send the data in full. (Contributed by Martin Panter in bpo-26721.)


ssl supports OpenSSL 1.1.0. The minimum recommend version is 1.0.2. (Contributed by Christian Heimes in bpo-26470.)
3DES has been removed from the default cipher suites and ChaCha20 Poly1305 cipher suites have been added. (Contributed by Christian Heimes in bpo-27850 and bpo-27766.)
SSLContext has better default configuration for options and ciphers. (Contributed by Christian Heimes in bpo-28043.)
SSL session can be copied from one client-side connection to another with the new SSLSession class. TLS session resumption can speed up the initial handshake, reduce latency and improve performance (Contributed by Christian Heimes in bpo-19500 based on a draft by Alex Warhawk.)
The new get_ciphers() method can be used to get a list of enabled ciphers in order of cipher priority. All constants and flags have been converted to IntEnum and IntFlags. (Contributed by Christian Heimes in bpo-28025.)
Server and client-side specific TLS protocols for SSLContext were added. (Contributed by Christian Heimes in bpo-28085.)


A new harmonic_mean() function has been added. (Contributed by Steven D’Aprano in bpo-27181.)


struct now supports IEEE 754 half-precision floats via the 'e' format specifier. (Contributed by Eli Stevens, Mark Dickinson in bpo-11734.)


subprocess.Popen destructor now emits a ResourceWarning warning if the child process is still running. Use the context manager protocol (with proc: ...) or explicitly call the wait() method to read the exit status of the child process. (Contributed by Victor Stinner in bpo-26741.) The subprocess.Popen constructor and all functions that pass arguments through to it now accept encoding and errors arguments. Specifying either of these will enable text mode for the stdin, stdout and stderr streams. (Contributed by Steve Dower in bpo-6135.)


The new getfilesystemencodeerrors() function returns the name of the error mode used to convert between Unicode filenames and bytes filenames. (Contributed by Steve Dower in bpo-27781.) On Windows the return value of the getwindowsversion() function now includes the platform_version field which contains the accurate major version, minor version and build number of the current operating system, rather than the version that is being emulated for the process (Contributed by Steve Dower in bpo-27932.)
submitted by Marco_Diaz_SVFOE to EasyLearnProgramming [link] [comments]

Floating Point Binary Tutorial Fixed vs Floating Point Representation Revision - Number Representation - Binary to Decimal Floating Point Representation - , ()

A floating-point number, however, cannot exist in a computer that uses binary (1s and 0s). Don’t be silly! So, the floating-point number is cleverly faked. Using the same 32 bits, a floating-point value of 13.5 might look like this: Binary floating-point arithmetic holds many surprises like this. The problem with “0.1” is explained in precise detail below, in the “Representation Error” section. See The Perils of Floating Point for a more complete account of other common surprises. As that says near the end, “there are no easy answers.” In order to get the actual binary representation, you will first need to typecast the floating point number into an array of integers. You can then feed this array into an auto-indexed for loop. In each iteration of the loop, an integer is converted to a Boolean array with the "Number to Boolean Array" function found in the Boolean palette. When writing a number in single or double precision, the steps to a successful conversion will be the same for both, the only change occurs when converting the exponent and mantissa. First we must understand what single precision means. In floating point representation, each number (0 or 1) is considered a “bit”. Number system in Computer Science comprises different types of representation of a given number, namely binary, decimal, hexadecimal and octal. Binary: Numbers that have base 2 and are represented

[index] [4124] [9716] [6871] [25835] [19259] [13721] [16700] [4184] [25422] [7357]

Floating Point Binary Tutorial

topic of this lecture of digital logic and design (DLD) is binary data representation in computer. how we represent binary data in computer. how can we write text in computer with the help of ... 1. Comparison between Fixed Point and Floating Point Numbers 2. Signed Binary representation - Sign Magnitude, One's Compliment and Two's Compliment Number representation (with Example) Floating Point Numbers ... Fixed Point and Floating Point binary numbers - Duration: 18:49. ... Decimal to IEEE 754 Floating Point Representation - Duration: 9:27. Computer Organization & Architecture Floating Point Representation - Single Precision ( 32 Bit ) - Double Precision ( 64 Bit ) Best Binary Options Strategy 2020 - 2 Minute Strategy LIVE TRAINING! - Duration: 43:42. BLW Online Trading 130,811 views. ... Will it Float? - Duration: 16:40. Marty T 95,830 views. New;

Flag Counter