Un po’ di quirks con Python

Recentemente un tweet intercettato via un retweet di qualche tweep mi ha coinvolto in discussioni senza troppo senso ma –credo– da riportare.

KDnuggets visualizza una serie di tricks dichiarando che Most of the tricks and tips are taken from PyTricks and a few blogs.

Ecco ‏PyTricks di Max, brennerm. L’unico Max Brenner trovato su Twitter è una catena di bar, non credo sia chi sto cercando.

Ma mai disperare, una rapida googlata ed eccolo, qui. C’è –c’era– anche su Twitter ma sembra sia stata solo una prova, 42 tweets, l’ultimo vecchio di un anno.

OK, torno ai suggerimenti Python. L’inizio è stato l’inversione della stringa:

>>> st = '0123456789'
>>> rst = st[::-1]
>>> st
'0123456789'
>>> rst
'9876543210'

Con due giovani promesse della CS (ragazzi dovreste bloggare, imho) abbiamo cercato di mettere i valori appropriati nei camp i(start e stop) lasciati ai valori di default senza riuscirci. Perché pare che davvero non si può, vedi qui.

In Python c’è il metodo reverse() per le sequenze mutabili (ma le stringhe sono immutabili).

>>> ls = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
>>> sl = ls.reverse()
>>> sl
>>> ls
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]

uh! non quello che mi aspettavo (RTFM!): The reverse() method modifies the sequence in place for economy of space when reversing a large sequence. To remind users that it operates by side effect, it does not return the reversed sequence.

Altro trick intrigante è la trasposizione di una matrice. Max riporta:

>>> original = [['a', 'b'], ['c', 'd'], ['e', 'f']]
>>> transposed = zip(*original)
>>> print(list(transposed))
[('a', 'c', 'e'), ('b', 'd', 'f')]
>>> transposed
<zip object at 0x7f150fbd4448>

che, ovviamente, funziona. Il guaio è che che il codice non dice tutto quel che vorrei.

>>> orig = [['a', 'b'], ['c', 'd'], ['e', 'f']]
>>> trans = [*zip(*orig)]
>>> trans
[('a', 'c', 'e'), ('b', 'd', 'f')]

Ecco mancava un *: An asterisk * denotes iterable unpacking. Its operand must be an iterable. The iterable is expanded into a sequence of items, which are included in the new tuple, list, or set, at the site of the unpacking. [qui]. Conviene anche ripassare qui.

Mi sa che è da vedere anche zip(). Qui, qui, qui e qui.
Ovviamente dopo la documentazione ufficiale (già detto RTFM?), qui.

Ci sono altri suggerimenti, interessanti quelli sui dizionari; ma anche altri. Tutti.

Maxima – 49 – Valutazione – funzioni e variabili per la valutazione – 1

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.145.

Funzioni e variabili per la vautazione

'
The single quote operator ' prevents evaluation.

Applied to a symbol, the single quote prevents evaluation of the symbol.

Applied to a function call, the single quote prevents evaluation of the function call, although the arguments of the function are still evaluated (if evaluation is not otherwise prevented). The result is the noun form of the function call.

Applied to a parenthesized expression, the single quote prevents evaluation of all symbols and function calls in the expression. E.g., '(f(x)) means do not evaluate the expression f(x). 'f(x) (with the single quote applied to f instead of f(x)) means return the noun form of f applied to [x].

The single quote does not prevent simplification.

When the global flag noundisp is true, nouns display with a single quote. This switch is always true when displaying function definitions.

See also the quote-quote operator ''

Applied to a symbol, the single quote prevents evaluation of the symbol.

(%i1) aa: 1024;
(%o1)                                1024
(%i2) aa^2;
(%o2)                               1048576
(%i3) 'aa^2;
                                        2
(%o3)                                 aa
(%i4) ''%;
(%o4)                               1048576

Applied to a function call, the single quote prevents evaluation of the function call.

The result is the noun form of the function call.

(%i5) x0: 5;
(%o5)                                  5
(%i6) x1: 7;
(%o6)                                  7
(%i7) integrate (x^2, x, x0, x1);
                                      218
(%o7)                                 ---
                                       3
(%i8) 'integrate (x^2, x, x0, x1);
                                    7
                                   /
                                   [   2
(%o8)                              I  x  dx
                                   ]
                                   /
                                    5
(%i9) %, nouns;
                                      218
(%o9)                                 ---
                                       3

Applied to a parenthesized expression, the single quote prevents evaluation of all symbols and function calls in the expression.

(%i10) aa: 1024;
(%o10)                               1024
(%i11) bb: 19;
(%o11)                                19
(%i12) sqrt(aa) + bb;
(%o12)                                51
(%i13) '(sqrt(aa) + bb);
(%o13)                           bb + sqrt(aa)
(%i14) ''%;
(%o14)                                51

The single quote does not prevent simplification.

(%i15) sin (17 * %pi) + cos (17 * %pi);
(%o15)                                - 1
(%i16) '(sin (17 * %pi) + cos (17 * %pi));
(%o16)                                - 1

Maxima considers floating point operations by its in-built mathematical functions to be a simplification.

(%i17) sin(1.0);
(%o17)                        0.8414709848078965
(%i18) '(sin(1.0));
(%o18)                        0.8414709848078965

When the global flag noundisp is true, nouns display with a single quote.

(%i19) x:%pi;
(%o19)                                %pi
(%i20) bfloat(x);
(%o20)                        3.141592653589793b0
(%i21) sin(x);
(%o21)                                 0
(%i22) noundisp;
(%o22)                               false
(%i23) 'bfloat(x);
(%o23)                            bfloat(%pi)
(%i24) bfloat('x);
(%o24)                                 x
(%i25) 'sin(x);
(%o25)                                 0
(%i26) sin('x);
(%o26)                              sin(x)
(%i27) noundisp: true;
(%o27)                               true
(%i28) 'bfloat(x);
(%o28)                           'bfloat(%pi)
(%i29) bfloat('x);
(%o29)                                 x
(%i30) 'sin(x);
(%o30)                                 0
(%i31) sin('x);
(%o31)                              sin(x)

''
The quote-quote operator '' (two single quote marks) modifies evaluation in input expressions.

Applied to a general expression expr, quote-quote causes the value of expr to be substituted for expr in the input expression.

Applied to the operator of an expression, quote-quote changes the operator from a noun to a verb (if it is not already a verb).

The quote-quote operator is applied by the input parser; it is not stored as part of a parsed input expression. The quote-quote operator is always applied as soon as it is parsed, and cannot be quoted. Thus quote-quote causes evaluation when evaluation is otherwise suppressed, such as in function definitions, lambda expressions, and expressions quoted by single quote '.

Quote-quote is recognized by batch and load.

See also ev, the single-quote operator ', and nouns.

Applied to a general expression expr, quote-quote causes the value of expr to be substituted for expr in the input expression.

(%i1) expand ((a + b)^3);
                            3        2      2      3
(%o1)                      b  + 3 a b  + 3 a  b + a
(%i2) [_, ''_];
                                3    3        2      2      3
(%o2)            [expand((b + a) ), b  + 3 a b  + 3 a  b + a ]
(%i3) [%i1, ''%i1];
                                3    3        2      2      3
(%o3)            [expand((b + a) ), b  + 3 a b  + 3 a  b + a ]
(%i4) [aa : cc, bb : dd, cc : 17, dd : 29];
(%o4)                          [cc, dd, 17, 29]
(%i5) foo_1 (x) := aa - bb * x;
(%o5)                        foo_1(x) := aa - bb x
(%i6) foo_1 (10);
(%o6)                             cc - 10 dd
(%i7) ''%;
(%o7)                                - 273
(%i8) ''(foo_1 (10));
(%o8)                                - 273
(%i9) foo_2 (x) := ''aa - ''bb * x;
(%o9)                        foo_2(x) := cc - dd x
(%i10) foo_2 (10);
(%o10)                               - 273
(%i11) [x0 : x1, x1 : x2, x2 : x3];
(%o11)                           [x1, x2, x3]
(%i12) x0;
(%o12)                                x1
(%i13) ''x0;
(%o13)                                x2
(%i14) '' ''x0;
(%o14)                                x3

Applied to the operator of an expression, quote-quote changes the operator from a noun to a verb (if it is not already a verb).

(%i1) foo (x) := x - 1729;
(%o1)                         foo(x) := x - 1729
(%i2) declare(foo, noun);
(%o2)                                done
(%i3) foo(100);
(%o3)                              foo(100)
(%i4) ''foo(100);
(%o4)                               - 1629

Per riprodurre il codice del manuale ho dovuto definire la funzione foo prima di dichiararla noun.

The quote-quote operator is applied by the input parser; it is not stored as part of a parsed input expression.

(%i7) [aa : bb, cc : dd, bb : 1234, dd : 5678];
(%o7)                        [bb, dd, 1234, 5678]
(%i8) aa + cc;
(%o8)                               dd + bb
(%i9) display (_, op (_), args (_));
                                  _ = cc + aa

                                op(cc + aa) = +

                           args(cc + aa) = [cc, aa]

(%o9)                                done
(%i10) ''(aa + cc);
(%o10)                               6912
(%i11) display (_, op (_), args (_));
                                  _ = dd + bb

                                op(dd + bb) = +

                           args(dd + bb) = [dd, bb]

(%o11)                               done

Quote-quote causes evaluation when evaluation is otherwise suppressed, such as in function definitions, lambda expressions, and expressions quoted by single quote '.

(%i1) foo_1a (x) := ''(integrate (log (x), x));
(%o1)                      foo_1a(x) := x log(x) - x
(%i2) foo_1b (x) := integrate (log (x), x);
(%o2)                  foo_1b(x) := integrate(log(x), x)
(%i3) dispfun (foo_1a, foo_1b);
(%t3)                      foo_1a(x) := x log(x) - x

(%t4)                  foo_1b(x) := integrate(log(x), x)

(%o4)                             [%t3, %t4]
(%i5) integrate (log (x), x);
(%o5)                            x log(x) - x
(%i6) foo_2a (x) := ''%;
(%o6)                      foo_2a(x) := x log(x) - x
(%i7) foo_2b (x) := %;
(%o7)                           foo_2b(x) := %
(%i8) dispfun (foo_2a, foo_2b);
(%t8)                      foo_2a(x) := x log(x) - x

(%t9)                           foo_2b(x) := %

(%o9)                             [%t8, %t9]
(%i10) F : lambda ([u], diff (sin (u), u));
(%o10)                   lambda([u], diff(sin(u), u))
(%i11) G : lambda ([u], ''(diff (sin (u), u)));
(%o11)                        lambda([u], cos(u))
(%i12) '(sum (a[k], k, 1, 3) + sum (b[k], k, 1, 3));
(%o12)                sum(b , k, 1, 3) + sum(a , k, 1, 3)
                           k                  k
(%i13) '(''(sum (a[k], k, 1, 3)) + ''(sum (b[k], k, 1, 3)));
(%o13)                    b  + a  + b  + a  + b  + a
                           3    3    2    2    1    1

😯

Maxima – 48 – Operatori – operatori definiti dall’utente – 2

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.142.

matchfix(ldelimiter, rdelimiter)
matchfix(ldelimiter, rdelimiter, arg_pos, pos)
Declares a matchfix operator with left and right delimiters ldelimiter and rdelimiter.

The delimiters are specified as strings.

A “matchfix” operator is a function of any number of arguments, such that the arguments occur between matching left and right delimiters. The delimiters may be any strings, so long as the parser can distinguish the delimiters from the operands and other expressions and operators. In practice this rules out unparseable delimiters such as %, ,, $ and ;, and may require isolating the delimiters with white space. The right delimiter can be the same or different from the left delimiter.

A left delimiter can be associated with only one right delimiter; two different matchfix operators cannot have the same left delimiter.

An existing operator may be redeclared as a matchfix operator without changing its other properties. In particular, built-in operators such as addition + can be declared matchfix, but operator functions cannot be defined for built-in operators.

The command matchfix(ldelimiter, rdelimiter, arg_pos, pos) declares the argument part-of-speech arg_pos and result part-of-speech pos, and the delimiters ldelimiter and rdelimiter.

“Part of speech”, in reference to operator declarations, means expression type. Three types are recognized: expr, clause, and any, indicating an algebraic expression, a Boolean expression, or any kind of expression, respectively. Maxima can detect some syntax errors by comparing the declared part of speech to an actual expression.

The function to carry out a matchfix operation is an ordinary user-defined function.

The operator function is defined in the usual way with the function definition operator := or define. The arguments may be written between the delimiters, or with the left delimiter as a quoted string and the arguments following in parentheses. dispfun(ldelimiter) displays the function definition.

The only built-in matchfix operator is the list constructor [ ]. Parentheses ( ) and double-quotes " " act like matchfix operators, but are not treated as such by the Maxima parser.

matchfix evaluates its arguments. matchfix returns its first argument, ldelimiter.

Delimiters may be almost any strings.

(%i1) matchfix ("@@", "~");
(%o1)                                 @@
(%i2) @@ a, b, c ~;
(%o2)                             @@a, b, c~
(%i3) matchfix (">>", "<<"); 
(%o3)                                  >>
(%i4) >> a, b, c <<; 
(%o4)                              >>a, b, c<< 
(%i5) matchfix ("foo", "oof"); 
(%o5)                                   foo 
(%i6) foo a, b, c oof; 
(%o6)                             fooa, b, coof 
(%i7) >> w + foo x, y oof + z << / @@ p, q ~; 
                            >>z + foox, yoof + w<<
(%o7)                       ----------------------
                                   @@p, q~

Matchfix operators are ordinary user-defined functions.

(%i8) matchfix ("!-", "-!");
(%o8)                                 !-
(%i9) !- x, y -! := x/y - y/x;
                                           x   y
(%o9)                          !-x, y-! := - - -
                                           y   x
(%i10) define (!-x, y-!, x/y - y/x);
                                           x   y
(%o10)                         !-x, y-! := - - -
                                           y   x
(%i11) define ("!-" (x, y), x/y - y/x);
                                           x   y
(%o11)                         !-x, y-! := - - -
                                           y   x
(%i12) dispfun ("!-");
                                           x   y
(%t12)                         !-x, y-! := - - -
                                           y   x

(%o12)                              [%t12]
(%i13) !-3, 5-!;
                                       16
(%o13)                               - --
                                       15
(%i14) "!-" (3, 5);
                                       16
(%o14)                               - --
                                       15

nary (op)
nary (op, bp, arg_pos, pos)
An nary operator is used to denote a function of any number of arguments, each of which is separated by an occurrence of the operator, e.g. A+B or A+B+C. The nary("x") function is a syntax extension function to declare x to be an nary operator.

Functions may be declared to be nary. If §§declare(j, nary); is done, this tells the simplifier to simplify, e.g. j(j(a,b),j(c,d)) to j(a, b, c, d).

nofix (op)
nofix (op, pos)
nofix operators are used to denote functions of no arguments. The mere presence of such an operator in a command will cause the corresponding function to be evaluated.

For example, when one types "exit;" to exit from a Maxima break, "exit" is behaving similar to a nofix operator. The function nofix("x") is a syntax extension function which declares x to be a nofix operator.

postfix (op)
postfix (op, lbp, lpos, pos)
postfix operators like the prefix variety denote functions of a single argument, but in this case the argument immediately precedes an occurrence of the operator in the input string, e.g. 3!. The postfix("x") function is a syntax extension function to declare x to be a postfix operator.

prefix (op)
prefix (op, rbp, rpos, pos)
A prefix operator is one which signifies a function of one argument, which argument immediately follows an occurrence of the operator. prefix("x") is a syntax extension
function to declare x to be a prefix operator.

Maxima – 47 – Operatori – operatori definiti dall’utente – 1

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.140.

infix (op)
infix (op, lbp, rbp)
infix (op, lbp, rbp, lpos, rpos, pos)
Declares op to be an infix operator. An infix operator is a function of two arguments, with the name of the function written between the arguments. For example, the subtraction operator - is an infix operator.

infix(op) declares op to be an infix operator with default binding powers (left and right both equal to 180) and parts of speech (left and right both equal to any).

infix(op, lbp, rbp) declares op to be an infix operator with stated left and right binding powers and default parts of speech (left and right both equal to any).

infix(op, lbp, rbp, lpos, rpos, pos) declares op to be an infix operator with stated left and right binding powers and parts of speech lpos, rpos, and pos for the left operand, the right operand, and the operator result, respectively.

“Part of speech”, in reference to operator declarations, means expression type. Three types are recognized: expr, clause, and any, indicating an algebraic expression, a Boolean expression, or any kind of expression, respectively. Maxima can detect some syntax errors by comparing the declared part of speech to an actual expression.

The precedence of op with respect to other operators derives from the left and right binding powers of the operators in question. If the left and right binding powers of op are both greater the left and right binding powers of some other operator, then op takes precedence over the other operator. If the binding powers are not both greater or less, some more complicated relation holds.

The associativity of op depends on its binding powers. Greater left binding power (lbp) implies an instance of op is evaluated before other operators to its left in an expression, while greater right binding power (rbp) implies an instance of op is evaluated before other operators to its right in an expression. Thus greater lbp makes op right-associative, while greater rbp makes op left-associative. If lbp is equal to rbp, op is left-associative.

If the left and right binding powers of op are both greater the left and right binding powers of some other operator, then op takes precedence over the other operator.

(%i1) :lisp (get '$+ 'lbp)

100
(%i1) :lisp (get '$+ 'rbp)

134
(%i1) infix ("##", 101, 101);
(%o1)                                 ##
(%i2) "##"(a, b) := sconcat("(", a, ",", b, ")");
(%o2)              (a ## b) := sconcat("(", a, ",", b, ")")
(%i3) 1 + a ## b + 2;
(%o3)                              (a,b) + 3
(%i4) infix ("##", 99, 99);
(%o4)                                 ##
(%i5) 1 + a ## b + 2;
(%o5)                              (a+1,b+2)

Greater lbp makes op right-associative, while greater rbp makes op left-associative.

(%i6) infix ("##", 100, 99);
(%o6)                                 ##
(%i7) "##"(a, b) := sconcat("(", a, ",", b, ")")$

(%i8) foo ## bar ## baz;
(%o8)                           (foo,(bar,baz))
(%i9) infix ("##", 100, 101);
(%o9)                                 ##
(%i10) foo ## bar ## baz;
(%o10)                          ((foo,bar),baz)

Maxima can detect some syntax errors by comparing the declared part of speech to an actual expression.

(%i11) infix ("##", 100, 99, expr, expr, expr);
(%o11)                                ##
(%i12) if x ## y then 1 else 0;

incorrect syntax: Found ALGEBRAIC expression where LOGICAL expression expected
ifSpacexSpace##SpaceySpacethenSpace
             ^
(%i12) infix ("##", 100, 99, expr, expr, clause);
(%o12)                                ##
(%i13) if x ## y then 1 else 0;
(%o13)                      if (x,y) then 1 else 0

Visto nel Web – 357

Post lungo, dopo l ferie quante cose ho wisto nel Web 💥

Apart from the money, following the data was always the royal road to proof of collusion. And if this involves #CambridgeAnalytica it will prove that #Trump #Russia #Brexit was part of the same overall plan
frodi | privacy, sicurezza, spionaggio, virus | Facebook
::: peterjukes

Former Reddit CEO Decries ‘Rage-Induced Interactions’ on Facebook and Twitter
social media
::: Slashdot

How Do Spectre/Meltdown Fixes Affect The Linux Kernel?
bug | hardware
::: Slashdot ::: Slashdot

who pays to educate developers?
programming, codice, snippet | scuola, educazione
::: b0rk

Interactive reagent snippets
programming, codice, snippet
::: headwinds

Good news in the Google ANS patent saga: this week, USPTO issued a non-final rejection of all claims
copyright e brevetti
::: rygorous

Possibly the biggest / most important change is the addition of ColumnTransformer to handle heterogeneous pandas dataframes. Right now you need to provide a callable (or list) to say what columns are, say, categorical. Next up: providing robust mechanisms in sklearn
Python
::: amuellerml

This article uses the concept of ‘platformed racism‘ to explore the tension between how platforms afford and govern emoji, and how users appropriate them to engage in racist discourse
social media | odio, razzismo, discriminazioni
::: Info_Activism

How Linux’s Kernel Developers ‘Make C Less Dangerous’
sistemi operativi | linguaggi di programmazione
::: Slashdot

How Can We Fix The Broken Economics of Open Source?
open source
::: Slashdot

Building a Discord bot with Node.js and Repl.it
programming, codice, snippet
::: SvenKauber

Two-thirds of India’s Smartphone Market, the Second Largest in the World, is Now Run by Chinese Handset Makers
economia
::: Slashdot

Le plan national pour la Science Ouverte est en ligne
open source
::: rdicosmo

This classic paper on operator precedence parser is very elegant, and nice to implement. Wish more modern papers were so straight forward!
programming, codice, snippet | storia
::: deplinenoise

Roger Waters + Syd Barrett

Is Windows Coming To Chromebooks?
sistemi operativi
::: Slashdot

Study of 299 US adults shows that when people are exposed to tweets containing “fake news”, their ability to tell real from fraudulent stories decreases
disinformazione, fake news, bufale | Twitter
::: mediagazer

Revenue from games, 2017
games
::: spectatorindex

Ecco il secondo numero della mia newsletter domenicale Guerre di Rete, inviata stamattina
novità
::: carolafrediani

Google introduces Tink—a multi-language, cross-platform cryptographic library to help developers ship secure cryptographic code
privacy, sicurezza, spionaggio, virus
::: manisha72617183

Science and Technology links (September 1st, 2018)
novità
::: lemire

Notizie a mano libera: è un troll russo? No, è G.A. Stella sul Corriere della Sera
media | disinformazione, fake news, bufale
::: MCPievatolo

Twitter struggles to ship new features. The big issue is that Twitter can be very, very different things to different users, yet everybody uses the exact same app
Twitter
::: fchollet

India Pushes Back Against Tech ‘Colonization’ by Internet Giants
Web, Internet
::: Slashdot

This probably surprises exactly nobody
ditte | economia | politica
::: laura_nobilis

Android: AT USB
dispositivi mobili
::: SiamoGeek

Hollywood formalizes support for open source in filmmaking
open source
::: cialunet

Bullet, China’s Latest Messaging App, Pops Shots at Top Local Rival WeChat
social media
::: Slashdot

Dal blog → Di compleanni, blogging e social networking
social media
::: dottorblaster

Wikileaks, scompare in Norvegia il socio di Assange. La polizia apre un’indagine
Web, Internet | privacy, sicurezza, spionaggio, virus
::: la Stampa

Germany, Seeking Independence From US, Pushes Cyber Security Research
privacy, sicurezza, spionaggio, virus
::: Slashdot

Gruppi Whatsapp chiusi a scuola: sbagliato vietare la tecnologia anziché governarla
social media
::: guidoscorza

In less than 10 days MEPs will vote on whether to ban memes and institute censorship online. We must stop this
copyright e brevetti | censura
::: stephenfry ::: communia_eu

My answer to How would you design the perfect programming language?
l’esempio in Scheme funziona con Racket con una modifica sostituire is i <= n) con (<= i n) e ricordare che ;else è un commento (anche se viene evidenziato)
programming, codice, snippet
::: PaniczGodek

CIDER 0.18 (Saigon) is out! It’s one of the biggest and baddest releases ever, so you should definitely check it out (or avoid it forever 😉 )!
programmazione funzionale
::: bbatsov

Google’s Doors Hacked Wide Open By Own Employee
privacy, sicurezza, spionaggio, virus
::: Slashdot

Jack Dorsey has personally weighed in on content decisions at Twitter and overruled staff to keep Alex Jones and reinstate Richard Spencer’s account
Twitter
::: Techmeme

Tracktion T7 Digital Audio Workstation is Now Free to Download
applicazioni, programmi
::: dcavedon

What a waste of time. You should do like in Italy. We abolished facts and now major newspaper are free to finally write every crap comes to the reporter mind
disinformazione, fake news, bufale | media
::: thek3nger

After Making Skype Convoluted and Difficult To Use, Microsoft is Now Rolling Out Features To Restore Simplicity
Web, Internet
::: Slashdot

Le chercheur en informatique @rdicosmo s’interroge @AutourQuestion : « Pourquoi une bibliothèque universelle des logiciels ? »
storia
::: RFI

Trump’s attacks on platform companies plays into widespread distrust among right-wing voters not only of news media, but also news found via social media and search engines
social media | media | politica
::: rasmus_kleis

Prominent video game-violence researcher loses another paper to retraction
games
::: RetractionWatch

How LLVM Optimizes a Function
programming, codice, snippet
::: johnregehr

Unpaid and Abused: Moderators Speak Out Against Reddit
social media
::: Slashdot

Why I love Xonsh
Python
::: cialunet

Radical open-access plan could spell end to journal subscriptions
media | scuola, educazione | open source
::: marcelsalathe ::: johncarlosbaez ::: Slashdot

The BeOS filesystem
storia
::: fogus

Dash to Dock v64 Released with Support for GNOME 3.30
Ubuntu
::: dcavedon

Using TinyTeX from a Flash Drive
applicazioni, programmi
::: marcoscan

Google isn’t just a search engine – it’s a literal extension of our mind
Google
::: Info_Activism

Facebook’s social media monopoly in a nutshell
Facebook
::: n_srnck

How many primes can you find by truncating the digits of pi?
Python | matematica
::: AlgebraFact

Some of the links here I know to be useful
Python
::: ehud

New post: The right level of abstraction
bello; complesso
programmazione funzionale
::: JohnDCook

Now you can access cheat.sh from VSCode
tools, componenti software
::: igor_chubin

Google Wants To Kill the URL
spoiler: OK, forse, ma nessuno ha idea di con cosa sostruirlo
Web, Internet
::: Slashdot ::: gmerigo

Per-core frequency scaling and AVX-512: an experiment
programming, codice, snippet
::: lemire

It seems like most live programming environments are dynamically typed
linguaggi di programmazione
::: stevekrouse

there’s a whole book about computing before computers, and it’s freely available online
storia
::: random_walker ::: random_walker

The big problems with online information warfare
Web, Internet
::: carljackmiller

Sources detail Sheryl Sandberg’s expanding role at Facebook following its delayed response to the Cambridge Analytica scandal, which she saw as a disaster
Facebook
::: Techmeme

Ah, clever. Keep trying the PIN codes, but never click Cancel
privacy, sicurezza, spionaggio, virus
::: mikko

Wikimedia Warns EU Copyright Reform Threatens the ‘Vibrant Free Web’
copyright e brevetti
::: Slashdot ::: WikimediaItalia ::: Gianlucadfiore ::: zacchiro ::: mante ::: CreateRefresh ::: jgbarah ::: communia_eu ::: communia_eu

[3] #Google ha rilasciato gratuitamente un tool di intelligenza artificiale che aiuterebbe i moderatori nell’individuare contenuti pedopornografici.A leggere le reazioni degli esperti i risultati del suo utilizzo sembrano lusinghieri
Web, Internet
::: guidoscorza

MikroTik Routers Are Forwarding Owners’ Traffic To Unknown Attackers
privacy, sicurezza, spionaggio, virus
::: Slashdot

The Best New Features in GNOME 3.30
sistemi operativi
::: dcavedon

Python 3.7 packages for all supported platforms & packages of the Anaconda Distribution Repository are now available
Python
::: anacondainc

Mobile Spyware Maker mSpy Leaks Millions of Sensitive Records
privacy, sicurezza, spionaggio, virus
::: Slashdot

How markets coopted free software’s most powerful weapon
open source | economia
::: PeerProd

Measuring context switching and memory overheads for Linux threads
programming, codice, snippet
::: elibendersky

periodic reminder that afaik there’s only one good freely available introduction to static analysis
programming, codice, snippet
::: johnregehr

Pythonista @jordibagot explores asynchronous development in Python using Trio in stead of asyncio and discovered it is way easier to use
Python
::: elementsinter

Mark Zuckerberg: Protecting democracy is an arms race. Here’s how Facebook can help win it
Facebook
::: fabiochiusi ::: fabiochiusi

8 great Python libraries for side projects
Python
::: cialunet

Visual & Functional Code, Haskell’s GHC runtime system @luna_language
programmazione funzionale
::: Data_Science_PY

As Facebook prepares for US midterm elections I trust we can expect same level of vigilance in Europe (~370m users) and India (~241m) as in US (~240m)
Facebook | privacy, sicurezza, spionaggio, virus
::: rasmus_kleis

Twitter’s @Jack wants a set of metrics to define and measure conversational “health” on the platform
Twitter
::: fabiochiusi ::: fabiochiusi

Facebook now linked to violence in the Philippines, Libya, Germany, Myanmar, and India
Facebook | odio, razzismo, discriminazioni
::: mathewi

More Than 1 In 4 American Users Have Deleted Facebook, Pew Survey Finds
Facebook
::: Slashdot ::: marcelsalathe ::: fabiochiusi

Much of the stress attributed to digital technology comes from passive use of the technology rather than the technology itself
tecnologia
::: JohnDCook

So, programmers, you know those systems that have been maintained for TOO LONG? that are just too expensive (in terms of technical debt) to replace, that are just hacks on hacks on hacks at this point, are a never ending maintenance nightmare that can’t be killed?
programming, codice, snippet
::: Foone

Facebook, Twitter Execs Admit Failures, Warn of ‘Overwhelming’ Threat To Elections
Twitter | Facebook
::: Slashdot

Interesting short article by Alan Kay arguing that the problem with the web is that users can’t modify the pages they interact with
Web, Internet | programming, codice, snippet
::: _wilfredh

We’ve got BIG NEWS. We gave Tor Browser a UX overhaul
privacy, sicurezza, spionaggio, virus
::: torproject

Which Web browser do you use on #Linux
Web, Internet
::: latestlinuxnews

Please. Stop. Thinking. That. Machine. Learning. Can. Be. Neutral.
tecnologia | Web, Internet | Twitter
::: thek3nger ::: thek3nger

Benin Becomes the Latest African Nation Taxing the Internet; Citizens and Advocates Denounce the Move
Web, Internet
::: Slashdot

BitTorrent Embraces Streaming Torrents, Takes uTorrent Web Out of Beta
Web, Internet
::: Slashdot

I’ve been working on a new Python sampling profiler and it’s finally ready for people to start using
Python
::: benfrederickson

How to write a parser in Go
linguaggi di programmazione
::: Gianlucadfiore

Oh wow someone implemented a Blockchain in @replit and published it embedded on @ThePracticalDev
programming, codice, snippet
::: amasad

Google wants websites to adopt AMP as the default for building webpages
Web, Internet | Google
::: Gianlucadfiore

This kind of thinking by @Jack might be what caused Twitter’s share price to fall more than Facebook and Google during the Senate hearing
Twitter
::: CharlieBeckett

Ci risiamo: @r0gue_0 sostiene di aver bucato di nuovo la piattaforma Rousseau
privacy, sicurezza, spionaggio, virus
::: valigiablu ::: jacopo_iacoboni ::: cynicalsecurity

3 top open source JavaScript chart libraries
linguaggi di programmazione
::: cialunet

Twitter agrees to abuse-transparency reports, civil rights audit
Twitter
::: fabiochiusi ::: fabiochiusi

Fabulous article on benchmarking JIT optimised VMs: performance can vary massively, warmups can be unpredictable, optimisation sometimes hurts perf and you may not even reach a steady state
programming, codice, snippet
::: _wilfredh

La campagna “#Contributopia” lanciata da #Framasoft per fornire applicazioni e piattaforme alternative (e, ovviamente, libere e #opensource)
open source
::: sdallagata

Japan is truly the place where ancient design traditions are preserved for the benefit of future generations. This (recently updated) page shows a mastery of Netscape 1.0 era 90s web design that is second to none
storia | Web, Internet
::: cheapogreg

Il legame tra attenzione logica della nostra mente, algoritmi, diffusione di disinformation o semplice propaganda
disinformazione, fake news, bufale
::: jacopo_iacoboni

The cycle of disruption in the Chinese internet space is getting much, much faster
social media
::: fabiochiusi

The August release of the Python Extension for @code is now available
Python
::: pythonvscode

Questo tweet ha ricevuto due like e un retweet ma Twitter ha deciso di non mostrarli nelle icone. Appena scrivi contro il governo shadowbanning (versione leggera) immediato
Twitter | censura
::: real_fabristol

DOJ: We Will Examine Social Media Firms That ‘May Be Hurting Competition’
social media
::: Slashdot

You have to present a report written with Writer?
applicazioni, programmi
::: libreoffice

Adding peephole optimization to GCC
programming, codice, snippet
::: matt_dz

Internet shutdowns and deliberate slowdowns are becoming more common
censura
::: InternetFF

#GNU #Emacs is so much more than just a text editor, and now, you can get the most recent guide to this essential #freesoftware work flow environment. Get the brand new 18th edition of the Emacs manual from the GNU store today
open source | applicazioni, programmi
::: fsf

section 1 of “Type Systems” is the best description of type checking and its goals that I am aware of
programming, codice, snippet
::: johnregehr

Alex Jones has been permanently suspended from Twitter for abusive behavior
Twitter
::: Gizmodo ::: jacopo_iacoboni

Say #pisQAnon to your favorite @casaleggio ‘s puppet ! … or ask about #Lanzalone , #ILVA , #Ponte #Morandi, #WTF you want
privacy, sicurezza, spionaggio, virus
::: r0gue_0

Professor Who Coined Term ‘Net Neutrality’ Thinks It’s Time To Break Up Facebook
Facebook
::: Slashdot

Icelanders Seek To Keep Remote Nordic Peninsula Digital-Free
Web, Internet
::: Slashdot

Scipy lecture notes new release: an open online book (also in PDF) on the scientific and data ecosystem in Python
Python
::: GaelVaroquaux

I thought Zuckerberg said in 2017 that the idea of Russian interference was “crazy”
Facebook
::: IlvesToomas

Google Dataset Search
Web, Internet
::: epfl_edcb

Google can track surfing habits without need for HTTP cookies
privacy, sicurezza, spionaggio, virus
::: Gianlucadfiore

Quaternions were invented in 1843. They became a mandatory examination topic in Dublin, and in some US universities they were the only advanced math taught! But then came Gibbs, the first US math Ph.D., who chopped the quaternion into its scalar and vector parts
storia | innovazioni, futuro
::: johncarlosbaez

Privacy Issues and Solutions for Consumer Wearables
privacy, sicurezza, spionaggio, virus
::: ieeeitpro

Practical Common Lisp was the book that opened my eyes to the world of *interesting* programming languages. Before then, I just saw Java, Python, Ruby, C# all as slightly different takes on the same idea. PCL blew me away
certo, studiato, ottimo
lisp(s)
::: acid2

Casaleggio ha 72 ore di tempo per comunicare il data breach all’Authority italiana per la privacy (articolo 33 del GDPR)
privacy, sicurezza, spionaggio, virus
::: jacopo_iacoboni

My favorite example of how informationally toxic YouTube’s algorithm is this
disinformazione, fake news, bufale
::: chrislhayes

On compositionality
ahemmm… confesso che devo ancora connettere
programming, codice, snippet
::: Lambda the Ultimate

How do you determine what model data has?
dati, raccolta
::: JohnDCook

If I draw N uniformly-distributed numbers between 0 and N, sort them, then compute the N-1 intervals between them, those intervals appear to be exponentially distributed. Is there any straightforward proof of this?
dati, raccolta
::: jakevdp

AVX-512: when and how to use these new instructions
programming, codice, snippet
::: lemire

Python enters the TIOBE index top 3 for the first time
Python
::: ThePSF

Playlisp: a programming language for Spotify playlists generation
Python
::: thek3nger

Tesla Shaken by Executive’s Quick Exit and Elon Musk’s Pot Smoke – genius move by @elonmusk to drive down share prices for private take over at lower cost?
protagonisti | economia
::: marcelsalathe ::: Slashdot

Scott Myers feels unable to continue evaluating errata for his books, citing C++ complexity as one of the reasons
linguaggi di programmazione
::: elibendersky

A growing range of useful collection data types for Pharo
linguaggi di programmazione
::: _wilfredh

I wouldn’t underestimate the resources being poured into command lines, given that they’re what most FLOSS hackers use daily
io sono sempre più per la CLI, come se fossi tornato al 1980
programming, codice, snippet
::: msimoni

I’m so tired about developers so careful for their logical choices, ignoring the huge amount of side effects TypeScript or any transpiled language implicitly has
linguaggi di programmazione
::: WebReflection

Alibaba’s Jack Ma, China’s Richest Man, To Retire From Company He Co-Founded
protagonisti
::: Slashdot ::: emenietti ::: la Stampa ::: RaiNews24

In Belgium, scientific papers that originate from public funds can now all be made public in open access, regardless of any contract with publishers. It is written in the law. And retroactive
copyright e brevetti
::: glouppe

Wi-Fi Gets More Secure: What You Need to Know About WPA3
privacy, sicurezza, spionaggio, virus
::: Gianlucadfiore

Apple is talking to big newspapers about joining its subscription service
media
::: emenietti

al TG1 hanno detto che hanno identificato un sospetto di furto confrontando l’immagine presa da una telecamera con un database di foto di 16 MILIONI DI PERSONE ??
privacy, sicurezza, spionaggio, virus
::: quinta

WARNING — No.1 Adware Removal Tool (Paid) On #Apple App Store Caught Spying On Mac Users
privacy, sicurezza, spionaggio, virus
::: TheHackersNews

Even if you don’t go to any of these sites, the researchers found that they have “an outsized influence” on the mainstream Web and public conversation: “People are likely being influenced by them even if they don’t realize it”
disinformazione, fake news, bufale | odio, razzismo, discriminazioni
::: drewharwell

Peter Norvig has put his #Lisp book (one of my all-time favorite programming books) “Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp” online
lisp(s)
::: RainerJoswig

Science and Technology links (September 8th, 2018)
novità
::: lemire

Google Slammed Over Chrome Change That Strips ‘www’ From Domain URLs
Google
::: Slashdot

Maxima – 46 – Operatori – operatori di assegnamento – 2

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.138.

:=
The function definition operator.

f(x_1, ..., x_n) := expr defines a function named f with arguments x_1, ..., x_n and function body expr. := never evaluates the function body (unless explicitly evaluated by quote-quote ''). The function body is evaluated every time the function is called.

f[x_1, ..., x_n] := expr defines a so-called array function. Its function body is evaluated just once for each distinct value of its arguments, and that value is returned, without evaluating the function body, whenever the arguments have those values again. (A function of this kind is commonly known as a “memoizing function”.)

f[x_1, ..., x_n](y_1, ..., y_m) := expr is a special case of an array function.

f[x_1, ..., x_n] is an array function which returns a lambda expression with arguments y_1, ..., y_m. The function body is evaluated once for each distinct value of x_1, ..., x_n, and the body of the lambda expression is that value.

When the last or only function argument x_n is a list of one element, the function defined by := accepts a variable number of arguments. Actual arguments are assigned one-to-one to formal arguments x_1, ..., x(n - 1), and any further actual arguments, if present, are assigned to x_n as a list.

All function definitions appear in the same namespace; defining a function f within another function g does not automatically limit the scope of f to g. However, local(f) makes the definition of function f effective only within the block or other compound expression in which local appears.

If some formal argument x_k is a quoted symbol, the function defined by := does not evaluate the corresponding actual argument. Otherwise all actual arguments are evaluated.

See also define and ::=.

:= never evaluates the function body (unless explicitly evaluated by quote-quote).

(%i1) expr : cos(y) - sin(x);
(%o1)                           cos(y) - sin(x)
(%i2) F1 (x, y) := expr;
(%o2)                          F1(x, y) := expr
(%i3) F1 (a, b);
(%o3)                           cos(y) - sin(x)
(%i4) F2 (x, y) := ''expr;
(%o4)                     F2(x, y) := cos(y) - sin(x)
(%i5) F2 (a, b);
(%o5)                           cos(b) - sin(a)

f(x_1, ..., x_n) := ... defines an ordinary function.

(%i6) G1(x, y) := (print ("Evaluating G1 for x=", x, "and y=", y), x.y - y.x);
(%o6) G1(x, y) := (print("Evaluating G1 for x=", x, "and y=", y),
                                                                 x . y - y . x)
(%i7) G1([1, a], [2, b]);
Evaluating G1 for x= [1, a] and y= [2, b]
(%o7)                                  0
(%i8) G1([1, a], [2, b]);
Evaluating G1 for x= [1, a] and y= [2, b]
(%o8)                                  0

f[x_1, ..., x_n] := ... defines an array function.

(%i9) G2[a] := (print ("Evaluating G2 for a=", a), a^2);
                                                            2
(%o9)            G2  := (print("Evaluating G2 for a=", a), a )
                   a
(%i10) G2[1234];
Evaluating G2 for a= 1234
(%o10)                              1522756
(%i11) G2[1234];
(%o11)                              1522756
(%i12) G2[2345];
Evaluating G2 for a= 2345
(%o12)                              5499025
(%i13) arrayinfo (G2);
(%o13)                    [hashed, 1, [1234], [2345]]
(%i14) listarray (G2);
(%o14)                        [1522756, 5499025]

f[x_1, ..., x_n](y_1, ..., y_m) := expr is a special case of an array function.

(%i15) G3[n](x) := (print ("Evaluating G3 for n=", n), diff (sin(x)^2, x, n));
                                                            2
(%o15) G3 (x) := (print("Evaluating G3 for n=", n), diff(sin (x), x, n))
         n
(%i16) G3[2];
Evaluating G3 for n= 2
                                       2           2
(%o16)                lambda([x], 2 cos (x) - 2 sin (x))
(%i17) G3[2];
                                       2           2
(%o17)                lambda([x], 2 cos (x) - 2 sin (x))
(%i18) G3[2](1);
                                  2           2
(%o18)                       2 cos (1) - 2 sin (1)
(%i19) arrayinfo (G3);
(%o19)                         [hashed, 1, [2]]
(%i20) listarray (G3);
                                       2           2
(%o20)               [lambda([x], 2 cos (x) - 2 sin (x))]

When the last or only function argument x_n is a list of one element, the function defined by := accepts a variable number of arguments.

(%i21) H ([L]) := apply ("+", L);
(%o21)                      H([L]) := apply("+", L)
(%i22) H (a, b, c);
(%o22)                             c + b + a

local makes a local function definition.

(%i23) foo (x) := 1 - x;
(%o23)                          foo(x) := 1 - x
(%i24) foo (100);
(%o24)                               - 99
(%i25) block (local (foo), foo (x) := 2 * x, foo (100));
(%o25)                                200
(%i26) foo (100);
(%o26)                               - 99

Maxima – 45 – Operatori – operatori di assegnamento – 1

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.135.

:
Assignment operator.

When the left-hand side is a simple variable (not subscripted), : evaluates its right-hand side and associates that value with the left-hand side.

When the left-hand side is a subscripted element of a list, matrix, declared Maxima array, or Lisp array, the right-hand side is assigned to that element. The subscript must name an existing element; such objects cannot be extended by naming nonex-istent elements.

When the left-hand side is a subscripted element of an undeclared Maxima array, the right-hand side is assigned to that element, if it already exists, or a new element is allocated, if it does not already exist.

When the left-hand side is a list of simple and/or subscripted variables, the right-hand side must evaluate to a list, and the elements of the right-hand side are assigned to the elements of the left-hand side, in parallel.

See also kill and remvalue, which undo the association between the left-hand side and its value.

Assignment to a simple variable.

(%i1) a;
(%o1)                                  a
(%i2) a : 123;
(%o2)                                 123
(%i3) a;
(%o3)                                 123

Assignment to an element of a list.

(%i4) b : [1, 2, 3];
(%o4)                              [1, 2, 3]
(%i5) b[3] : 456;
(%o5)                                 456
(%i6) b;
(%o6)                             [1, 2, 456]

Assignment creates an undeclared array.

(%i7) c[99] : 789;
ARRSTORE: use_fast_arrays=false; allocate a new property hash table for $C
(%o7)                                 789
(%i8) c[99];
(%o8)                                 789
(%i9) c;
(%o9)                                  c
(%i10) arrayinfo (c);
(%o10)                         [hashed, 1, [99]]
(%i11) listarray (c);
(%o11)                               [789]

Multiple assignment is carried out in parallel. The values of a and b are exchanged in this example.

(%i12) [a, b] : [33, 55];
(%o12)                             [33, 55]
(%i13) [a, b] : [b, a];
(%o13)                             [55, 33]
(%i14) a;
(%o14)                                55
(%i15) b;
(%o15)                                33

::
Assignment operator.

:: is the same as : except that :: evaluates its left-hand side as well as its right-hand side.

(%i16) x : 'foo;
(%o16)                                foo
(%i17) x :: 123;
(%o17)                                123
(%i18) foo;
(%o18)                                123
(%i19) x : '[a, b, c];
(%o19)                             [a, b, c]
(%i20) x :: [11, 22, 33];
(%o20)                           [11, 22, 33]
(%i21) a;
(%o21)                                11
(%i22) b;
(%o22)                                22
(%i23) c;
(%o23)                                33

::=
Macro function definition operator. ::= defines a function (called a “macro” for historical reasons) which quotes its arguments, and the expression which it returns (called the “macro expansion”) is evaluated in the context from which the macro was called. A macro function is otherwise the same as an ordinary function.

macroexpand returns a macro expansion (without evaluating it). macroexpand(foo (x)) followed by ''% is equivalent to foo(x) when foo is a macro function.

::= puts the name of the new macro function onto the global list macros. kill, remove, and remfunction unbind macro function definitions and remove names from macros.

fundef or dispfun return a macro function definition or assign it to a label, respectively.

Macro functions commonly contain buildq and splice expressions to construct an expression, which is then evaluated.

A macro function quotes its arguments, so message (1) shows y - z, not the value of y - z. The macro expansion (the quoted expression ‘(print ("(2) x is equal to", x))) is evaluated in the context from which the macro was called, printing message (2).

(%i24) x: %pi$

(%i25) y: 1234$

(%i26) z: 1729 * w$

(%i27) printq1 (x) ::= block (print ("(1) x is equal to", x),
               '(print ("(2) x is equal to", x)))$

(%i28) printq1 (y - z);
(1) x is equal to y - z
(2) x is equal to %pi
(%o28)                                %pi

Ci devo pensare su 😯; OK, richiede una pausa tipo “stai fermo un giro” al Gioco dell’Oca 😋

An ordinary function evaluates its arguments, so message (1) shows the value of y - z. The return value is not evaluated, so message (2) is not printed until the explicit evaluation ''%.

(%i30) x: %pi$

(%i31) y: 1234$

(%i32) z: 1729 * w$

(%i33) printe1 (x) := block (print ("(1) x is equal to", x),
               '(print ("(2) x is equal to", x)))$

(%i34) printe1 (y - z);
(1) x is equal to 1234 - 1729 w
(%o34)                    print((2) x is equal to, x)
(%i35) ''%;
(2) x is equal to %pi
(%o35)                                %pi

macroexpand returns a macro expansion.

macroexpand(foo(x))
followed by ''% is equivalent to foo(x) when foo is a macro function.

(%i36) x: %pi$

(%i37) y: 1234$

(%i38) z: 1729 * w$

(%i39) g (x) ::= buildq ([x], print ("x is equal to", x))$

(%i40) macroexpand (g (y - z));
(%o40)                    print(x is equal to, y - z)
(%i41) ''%;
x is equal to 1234 - 1729 w
(%o41)                           1234 - 1729 w
(%i42) g (y - z);
x is equal to 1234 - 1729 w
(%o42)                           1234 - 1729 w

Di nuovo 😯; anzi: pausa 😁

AI, innovazioni e blockchain – 38

OK, settembre, tutto ritorna come al solito, ecco qua 😁

Get ready to rumble! The latest batch of 20 #RaspiBlitz, a full #Bitcoin and #LightningNetwork node running on a Raspberry Pi, is ready to be picked up and plugged in at the #LightningHackday! If you can’t attend in person, you can build one yourself
blockchain e crypto* | hardware
::: fulmolightning

How much does your country invest in R&D?
innovazioni, futuro
::: mikko

John McAfee’s ‘Unhackable’ Bitfi Wallet Got Hacked — Again
privacy, sicurezza, spionaggio, virus
::: Slashdot

Humans To Blame For Most Self-Driving Car Crashes In California, Study Finds
automazione
::: Slashdot

The Computationalist Ethic & the Spirit of Capitalism: “Learning algorithms are creating a new ‘digital iron-cage’ whose bars cannot readily be grasped or bent”
algoritmi, codice
::: FrankPasquale

As our relationship with self-driving technology increases, we need to ensure it is designed around human behaviours and needs.” @JLR_News is testing self-driving pods that visibly signal that they’ve seen pedestrians
automazione
::: medialab

Many engineers expected that someday blazingly fast logic chips would operate using photons rather than electrons. But that hasn’t happened
innovazioni, futuro
::: IEEESpectrum

The era of the celebrity inventor is over
innovazioni, futuro
::: IEEESpectrum

A neuroscientist explains what tech does to the reading brain
Skimming has led, I believe, to a tendency to go to the sources that seem the simplest, most reduced, most familiar, and least cognitively challenging. I think that leads people to accept truly false news without examining it, without being analytical
innovazioni, futuro
::: Mantzarlis

Remember BlackBerry? They died, right? Except, if
automazione
::: mikko

No dai via, a tutto c’è un limite
innovazioni, futuro
::: CriMilitello

Bitcoin and Other Cryptocurrencies Are Useless, The Economist Says
blockchain e crypto*
::: Slashdot

Japan starts space elevator experiments
innovazioni, futuro
::: ScienceTip

Court finds #AI software so bad it’s unconstitutional
artificial intelligence
::: j2bryson

One of the issues that recurs in thinking about Tesla is that tech people don’t really know enough about cars, and car people don’t really know enough about software
innovazioni, futuro
::: dinodaizovi

GlobalFoundries CTO on Why the Company Abandoned the “Bleeding Edge”
innovazioni, futuro | hardware
::: IEEESpectrum

India should be Ground Zero for Bitcoin adoption. Indian households are the largest cohort of gold ownership in the world, ~25k metric tons (~600 tons held by the RBI)
blockchain e crypto*
::: arjunblj

Silicon Valley Wants to Use Algorithms for Debt Collection
algoritmi, codice
::: Info_Activism

Britain Faces an AI Brain Drain as Tech Giants Raid Top Universities
artificial intelligence
::: Slashdot

The Bitcoin Boom Reaches a Canadian Ghost Town
blockchain e crypto*
::: Slashdot

Samsung Says It Will Unveil a Foldable Smartphone this Year
dispositivi mobili
::: Slashdot

Metallic nanoparticles stop faults in DRAM that cause data corruption
hardware
::: IEEESpectrum

It takes a board member of the European Central Bank (!) to state how bad Europe’s tech dependency is
innovazioni, futuro
::: evgenymorozov

Mercedes Unveils First Tesla Rival In $12 Billion Attack
innovazioni, futuro
::: Slashdot

Get Ready For Atomic Radio
innovazioni, futuro
::: Slashdot

New Software Can Predict Landslides Weeks Before They Happen
artificial intelligence
::: Slashdot

I don’t usually listen to podcasts, but when I do, I listen to a guy with a thick German accent talking about consciousness and literature
artificial intelligence
::: gvanrossum

The visionaries of technology think of politics from the point of view of cybernetics: The aim is to avoid ‘disturbances’ & keep the system in balance. Baidu has developed an algorithm that can predict up to 3 hours in advance where a crowd will form
algoritmi, codice | dati, raccolta
::: FrankPasquale

British and Chinese researchers build a quantum computer using photons, which could allow for more qubits
quantum computing
::: IEEESpectrum

Finally: a self-emptying Roomba!
innovazioni, futuro
::: IEEESpectrum ::: IEEESpectrum

Trasporti marittimi, Fincantieri sigla accordo per costruire la prima nave elettrica a guida autonoma
automazione
::: Qualenergiait

‘IMAX Enhanced’ Promises Highest-Quality Image, Sound Experiences For Home Theater Setups
innovazioni, futuro
::: Slashdot

This video shows the rise and fall (and rise and fall and…) of #Bitcoin since 2015
blockchain e crypto*
::: simongerman600

Maxima – 44 – Operatori – operatori per equazioni

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.133.

#
Represents the negation of syntactic equality =.

Note that because of the rules for evaluation of predicate expressions (in particular because not expr causes evaluation of expr), not a = b is equivalent to is(a # b), instead of a # b.

(%i1) a = b;
(%o1)                                a = b
(%i2) is (a = b);
(%o2)                                false
(%i3) a # b;
(%o3)                                a # b
(%i4) not a = b;
(%o4)                                true
(%i5) is (a # b);
(%o5)                                true
(%i6) is (not a = b);
(%o6)                                true

=
The equation operator.

An expression a = b, by itself, represents an unevaluated equation, which might or might not hold. Unevaluated equations may appear as arguments to solve and algsys or some other functions.

The function is evaluates = to a Boolean value. is(a = b) evaluates a = b to true when a and b are identical. That is, a and b are atoms which are identical, or they are not atoms and their operators are identical and their arguments are identical.

Otherwise, is(a = b) evaluates to false; it never evaluates to unknown. When is(a = b) is true, a and b are said to be syntactically equal, in contrast to equivalent expressions, for which is(equal(a, b)) is true. Expressions can be equivalent and not syntactically equal.

The negation of = is represented by #. As with =, an expression a # b, by itself, is not evaluated. is(a # b) evaluates a # b to true or false.

In addition to is, some other operators evaluate = and # to true or false, namely if, and, or, and not.

Note that because of the rules for evaluation of predicate expressions (in particular because not expr causes evaluation of expr), not a = b is equivalent to is(a # b), instead of a # b.

rhs and lhs return the right-hand and left-hand sides, respectively, of an equation or inequation.

See also equal and notequal.

An expression a = b, by itself, represents an unevaluated equation, which might or might not hold.

(%i7) eq_1 : a * x - 5 * y = 17;
(%o7)                           a x - 5 y = 17
(%i8) eq_2 : b * x + 3 * y = 29;
(%o8)                           3 y + b x = 29
(%i9) solve ([eq_1, eq_2], [x, y]);
                               196         29 a - 17 b
(%o9)                 [[x = ---------, y = -----------]]
                            5 b + 3 a       5 b + 3 a
(%i10) subst (%, [eq_1, eq_2]);
          196 a     5 (29 a - 17 b)         196 b     3 (29 a - 17 b)
(%o10) [--------- - --------------- = 17, --------- + --------------- = 29]
        5 b + 3 a      5 b + 3 a          5 b + 3 a      5 b + 3 a
(%i11) ratsimp (%);
(%o11)                        [17 = 17, 29 = 29]

is(a = b) evaluates a = b to true when a and b are syntactically equal (that is, identical). Expressions can be equivalent and not syntactically equal.

(%i12) a : (x + 1) * (x - 1);
(%o12)                          (x - 1) (x + 1)
(%i13) b : x^2 - 1;
                                     2
(%o13)                              x  - 1
(%i14) [is (a = b), is (a # b)];
(%o14)                           [false, true]
(%i15) [is (equal (a, b)), is (notequal (a, b))];
(%o15)                           [true, false]

Some operators evaluate = and # to true or false.

(%i16) if expand ((x + y)^2) = x^2 + 2 * x * y + y^2 then FOO else BAR;
(%o16)                                FOO
(%i17) eq_3 : 2 * x = 3 * x;
(%o17)                             2 x = 3 x
(%i18) eq_4 : exp(2) = %e^2;
                                     2     2
(%o18)                             %e  = %e
(%i19) [eq_3 and eq_4, eq_3 or eq_4, not eq_3];
(%o19)                        [false, true, true]

Because not expr causes evaluation of expr, not a = b is equivalent to is(a # b).

(%i20) [2 * x # 3 * x, not (2 * x = 3 * x)];
(%o20)                         [2 x # 3 x, true]
(%i21) is (2 * x # 3 * x);
(%o21)                               true

Maxima – 43 – Operatori – operatori relazionali e logici

Continuo da qui, copio dal Reference Manual, PDF scaricabile da qui, sono a p.131.

Operatori relazionali

< <= >= >
The symbols <, <=, >= and > represent less than, less than or equal, greater than or equal, and greater than, respectively. The names of these operators are "<", "<=", ">=" and ">", which may appear where the name of a function or operator is required.

These relational operators are all binary operators; constructs such as a < b < c are not recognized by Maxima.

Relational expressions are evaluated to Boolean values by the functions is and maybe, and the programming constructs if, while, and unless. Relational expressions are not otherwise evaluated or simplified to Boolean values, although the arguments of relational expressions are evaluated (when evaluation is not otherwise prevented by quotation).

When a relational expression cannot be evaluated to true or false, the behavior of is and if are governed by the global flag prederror. When prederror is true, is and if trigger an error. When prederror is false, is returns unknown, and if returns a partially-evaluated conditional expression.

maybe always behaves as if prederror were false, and while and unless always behave as if prederror were true.

Relational operators do not distribute over lists or other aggregates.

See also =, #, equal, and notequal.

Relational expressions are evaluated to Boolean values by some functions and programming constructs.

(%i1) [x, y, z] : [123, 456, 789];
(%o1)                           [123, 456, 789]
(%i2) is (x < y); (%o2) true (%i3) maybe (y > z);
(%o3)                                false
(%i4) if x >= z then 1 else 0;
(%o4)                                  0
(%i5) block ([S], S : 0, for i:1 while i <= 100 do S : S + i, return (S));
(%o5)                                5050

Relational expressions are not otherwise evaluated or simplified to Boolean values, although the arguments of relational expressions are evaluated.

(%i6) [x < y, y <= z, z >= y, y > z];
(%o6)           [123 < 456, 456 <= 789, 789 >= 456, 456 > 789]
(%i7) map (is, %);
(%o7)                      [true, true, true, false]

Operatori logici

and
The logical conjunction operator. and is an n-ary infix operator; its operands are Boolean expressions, and its result is a Boolean value.

and forces evaluation (like is) of one or more operands, and may force evaluation of all operands.

Operands are evaluated in the order in which they appear. and evaluates only as many of its operands as necessary to determine the result. If any operand is false, the result is false and no further operands are evaluated.

The global flag prederror governs the behavior of and when an evaluated operand cannot be determined to be true or false. and prints an error message when prederror is true. Otherwise, operands which do not evaluate to true or false are accepted, and the result is a Boolean expression.

and is not commutative: a and b might not be equal to b and a due to the treatment of indeterminate operands.

not
The logical negation operator. not is a prefix operator; its operand is a Boolean expression, and its result is a Boolean value.

not forces evaluation (like is) of its operand.

The global flag prederror governs the behavior of not when its operand cannot be determined to be true or false. not prints an error message when prederror is true. Otherwise, operands which do not evaluate to true or false are accepted, and the result is a Boolean expression.

or
The logical disjunction operator. or is an n-ary infix operator; its operands are Boolean expressions, and its result is a Boolean value.

or forces evaluation (like is) of one or more operands, and may force evaluation of all operands.

Operands are evaluated in the order in which they appear. or evaluates only as many of its operands as necessary to determine the result. If any operand is true, the result is true and no further operands are evaluated.

The global flag prederror governs the behavior of or when an evaluated operand cannot be determined to be true or false. or prints an error message when prederror is true. Otherwise, operands which do not evaluate to true or false are accepted, and the result is a Boolean expression.

or is not commutative: a or b might not be equal to b or a due to the treatment of indeterminate operands.