Visto nel Web – 349

A luglio cala il numero di segnalazioni per wisto nel Web ma aumenta la temperatura, fa caldo, troppo.

newLISP has an approach to cons that I haven’t seen before
uh! altri che conoscono newLISP; e sanno che non è un vero Lisp
lisp(s)
::: _wilfredh

Why Warren Buffett Is Poorer Than Mark Zuckerberg
protagonisti
::: Slashdot

Is C++ a ‘Really Terrible Language’?
sì, abbastanza (imho)
linguaggi di programmazione
::: Slashdot

Amazon Has Already Become Something of a Corporate Boogeyman — and Now It Could Be Bringing Its Industry Disruption To Advertising
ditte
::: Slashdot

Il copyright non è un diritto, è una minaccia per il futuro dell’Umanità
copyright e brevetti
::: dcavedon

Whilst JSON does not support comments, today I learnt that npm reserves the key “//” for you to add comments to the top level object in package.json
linguaggi di programmazione
::: _wilfredh

Huge high five to Microsoft Research for releasing Open Data Datasets. Not just quirky little things either: e.g. there’s a 10 GB dual-word embedding set from Bing searches. Bravo @Microsoft
open source
::: _brohrer_

Using Racket’s redex library to implement my EVM decompiler. It works like an attribute grammar combined with inference rules
programming, codice, snippet | language Racket
::: TheMichaelBurge

Firefox and the 4-Year Battle To Have Google To Treat It as a First-Class Citizen
Google
::: Slashdot

Use Alias in Bash Script
da me non funziona; chissà dove|cosa sbaglio
tip, suggerimenti
::: Connor Johnson

Writing an Interpreter in Python with PLY
linguaggi di programmazione
::: Connor Johnson

Perhaps they should call it “Haskell for Java programmers”
programming, codice, snippet
::: PaniczGodek

Meet the woman who decides what Google’s emoji look like
Web, Internet
::: emenietti

5 Firefox extensions to protect your privacy
privacy, sicurezza, spionaggio, virus
::: cialunet

Elixir per idioti /5, pipe operator e pipeline di funzioni
linguaggi di programmazione
::: dottorblaster

Owning an iPhone is the Number-One Way To Guess if You’re Rich or Not, Research Finds
sì, anche qui, per tutto Apple
ditte
::: Slashdot

Piaget’s Constructivism, Papert’s Constructionism: What’s the difference?
scuola, educazione
::: LearnReimagined

Minimal Ubuntu, on public clouds and Docker Hub
sistemi operativi
::: cialunet

Meet CIMON, an AI Assistant for Astronauts Running on Ubuntu
applicazioni, programmi
::: dcavedon

#Python 3.8 also includes a proposal for None-aware operators such as those found in C#
cose come queste mi fanno sentire troppo vecchio
Python
::: anthonypjshaw

Android developer? Install the Snap of androidstudio in seconds to level up your #Ubuntu development workstation and access the fastest tools for building apps on every type of Android device
dispositivi mobili | programming, codice, snippet
::: cialunet

Reverse Engineering resources
programming, codice, snippet
::: xKaliSec

SymPy 1.2 has been released
Python
::: SymPy

Google May Have To Make Major Changes To Android in Response To a Forthcoming Fine in Europe
Google
::: Slashdot

Top Communications Union Joins Group Pushing for Facebook’s Breakup
Facebook
::: Slashdot

Vim users, now you can
quando io usavo vi era molto più elementare, forse dovrei aggiornarmi
applicazioni, programmi
::: igor_chubin

Decisions to embrace nonfree and private development tools undermine credibility in advocating for software freedom and compromise developers’ and users’ in ways that should be rejected
open source
::: downey

an excellent post on implementing if-let and when-let macros
lisp(s)
::: _wilfredh

We flocked to programming languages that united us across operating systems, but now they divide us across package management systems. Python and JavaScript worlds both guilty of this
mica capito! sono vecchio.
linguaggi di programmazione
::: ivanov

How Fracking Companies Use Facebook Surveillance To Ban Protest
Facebook | frodi
::: Slashdot

UN resolution declares online freedom a human right
Web, Internet
::: thenetmonitor

Dopo lo stop ai signori del copyright, il Parlamento europeo ferma le tech company americane: no al trasferimento dei dati dei cittadini
privacy, sicurezza, spionaggio, virus
::: valigiablu

We see this regularily. Attackers are moving on from traditional financial targets; from hacking online banks and online stores to hacking crypto exchanges and token wallets. This makes a lot of sense from the attacker’s point of view
privacy, sicurezza, spionaggio, virus
::: mikko

China Internet Report 2018
Web, Internet
::: Slashdot

Algorithm was able to identify Twitter users with 96.7 per cent accuracy using publicly available metadata
privacy, sicurezza, spionaggio, virus
::: JohnDCook

Lua 5.3.5 released
linguaggi di programmazione
::: LuaLang

YouTube Is Fighting Conspiracy Theories With ‘Authoritative’ Context and Outside Links
caos informativo, fake news, bufale
::: Slashdot

I just published “Direttiva europea sul copyright: fatti e opinioni”
copyright e brevetti
::: xmau

6 IDEs you need to know about
programming, codice, snippet
::: cialunet

Nel 2012 Facebook comprò #Instagram per un miliardo di dollari. A sei anni dall’acquisto, il valore del social è di 100 miliardi
Facebook
::: SergioGridelli

Is iOS 11.4 Draining Your iPhone’s Battery? You’re Not Alone
hardware
::: Slashdot

I’m a monorepo proponent, this is a valuable war story
programming, codice, snippet
::: wesmckinn

Little Python command-line trick that I use very often
Python | Web, Internet
::: jakevdp

This is what spurred the ICO to action, a year before Cambridge Analytica burst onto global stage. But it was built on collective work of journalists, academics & o/s investigators
privacy, sicurezza, spionaggio, virus
::: carolecadwalla

Orlando Police Decide To Keep Testing Controversial Amazon Facial Recognition Program
privacy, sicurezza, spionaggio, virus
::: Slashdot

Facebook fined £500k for lack of transparency and failing to protect users’ information
Facebook
::: fabiochiusi ::: krishgm ::: chrisinsilico

A Russian internet company with links to the Kremlin was among the firms to which Facebook gave an extension which allowed them to collect data on unknowing users of the social network after a policy change supposedly stopped such collection
privacy, sicurezza, spionaggio, virus | Facebook
::: donie

#DropboxPaper is getting cooler and cooler. I enjoy it very much. But it really needs some desktop offline application
Web, Internet | programming, codice, snippet
::: thek3nger

Browsh is the Text-based Web Browser You’ve Been Dreaming Of
Web, Internet
::: dcavedon

Excerpt from ‘Valley of Genius. The Uncensored History of Silicon Valley’ by Adam Fisher > “Google Was Not a Normal Place”: Brin, Page, and Mayer on the Accidental Birth of the Company that Changed Everything
protagonisti
::: fabiochiusi

VC Market Is on Pace for Strongest Year Since Dot-Com Era
economia
::: Slashdot

Access To Major Airport’s Security System Offered on Dark Web for $10
privacy, sicurezza, spionaggio, virus
::: Slashdot

Hacker Steals Military Docs Because Someone Didn’t Change a Default FTP Password
privacy, sicurezza, spionaggio, virus
::: Slashdot

Java, C, and C++ are the most popular programming languages in the world, says the Tiobe Index
linguaggi di programmazione
::: MIT_CSAIL

#Infographic: Ubuntu connects everything
pubblicità?
distro
::: cialunet

Chinese Mobile Phone Cameras Are Not-So-Secretly Recording Users’ Activities
privacy, sicurezza, spionaggio, virus
::: Slashdot

Battling Fake Accounts, Twitter to Slash Millions of Followers
Twitter | caos informativo, fake news, bufale
::: fabiochiusi

India just approved net neutrality rules that ban “any form” of data discrimination
Web, Internet
::: verge ::: Slashdot

AV1 is Well On Its Way To Becoming a Viable Alternative To Patented Video Codecs, Mozilla Says
open source
::: Slashdot

Google Quietly Enables ‘Site Isolation’ Feature for 99% of Chrome Desktop Users
privacy, sicurezza, spionaggio, virus
::: Slashdot

Every programming language should have a “version” syntax. This lets the language and libraries change without breaking everyone’s code
linguaggi di programmazione
::: TheMichaelBurge

New Spectre 1.1 and Spectre 1.2 CPU Flaws Disclosed
bug | hardware
::: Slashdot

RSS Has Already Won
social media
::: Slashdot

Facebook has launched its new data-sharing agreement with academics. The first dataset is one petabyte of links to intentionally false news stories. “The anonymized data will include age, gender, and political views of the people who clicked those links”
caos informativo, fake news, bufale
::: sheeraf

Until just now, Facebook would profile users who it thought had an interest in “treason”, putting them at risk in a nation like Russia, experts say
Facebook
::: alexhern

Pretty new to Twitter, don’t really have followers (nor do I really care to). I primarily use this to follow new people and learn
💥 lo spirito giusto 😁
Twitter
::: sailorvenusaurr

Not enough positive press is given to companies like @RedHat that successfully employ widespread telecommuting and flexible workplace arrangements for its employees. This does work at scale & is a viable alternative to the trend of colocation. Less cars/traffic and happier people
distro
::: tdnjunisco

An introduction to Go arrays and slices
linguaggi di programmazione
::: cialunet

Walmart’s Newly Patented Technology For Eavesdropping On Workers Presents Privacy Concerns
economia
::: Slashdot

Microsoft is Updating Windows Notepad Application For the First Time in Years
applicazioni, programmi
::: Slashdot

Simone e André Weil

Python library to fix Unicode problems
Python
::: TeXtip

Higher Order Functions Considered Unnecessary for Higher Order Programming
un paper vecchio che qualcuno rilancia; perché?
programming, codice, snippet
::: Lambda the Ultimate

Security alerts are now available in Python. Get notified when we detect a vulnerability in one of your dependencies
Python
::: github

I have posted two manuscripts to my website. If you like PL things that I like, you should look
programmazione funzionale
::: wilbowma

Chan Zuckerberg Initiative Claims It Has Enabled Its Partners To ‘Double the Number of Black and Latinx Students and Girls Taking AP Computer Science’
Facebook
::: Slashdot

What brought you to Lisp?
lisp(s)
::: alamajesse

10 golden rules for becoming a better programmer
programming, codice, snippet
::: ThePracticalDev

Twitter rimuove gli account sospetti, inutilmente e vi spiego perché con Franco Sala
Twitter | caos informativo, fake news, bufale
::: DavidPuente

Gawker.com Sold To Bleacher Report Co-Founder Bryan Goldberg In Bankruptcy Auction
Web, Internet
::: Slashdot

Yes. With a news feed algorithm of even modest complexity, Facebook is kingmaking
Facebook
::: zittrain

The guy who is shepherding Donald Trumps’ Supreme Court nominee through the Senate is also the guy leading Facebook’s internal review to study political bias on its platform
Facebook | politica
::: samstein

Find Snap Apps Faster Using This Online Store
Ubuntu
::: dcavedon

Amazon has more than twice as much of the online retail market as its next 10 competitors combined
ditte
::: mims

Microsoft Calls on Congress To Regulate Face Recognition
privacy, sicurezza, spionaggio, virus
::: Slashdot

PC Market Sees Its First Growth Quarter in Six Years
hardware
::: Slashdot

Save this statement from Facebook: “We just don’t think banning Pages for sharing conspiracy theories or false news is the right way to go”
caos informativo, fake news, bufale | Facebook
::: edmundlee ::: Slashdot

Amazon Plans To Challenge Cisco in Networking Market With Much Cheaper Switches, Report Says
hardware
::: Slashdot

Compromised JavaScript Package Caught Stealing npm Credentials
privacy, sicurezza, spionaggio, virus
::: Slashdot

we released mypy 0.620 today. It adds support for dataclasses, a major redo of overloads, support for partial packages, and more
Python
::: gvanrossum

The #SciPy2018 attendees pay homage to the great @gvanrossum and wish him a relaxing vacation!
protagonisti | Python
::: gilforsyth

Why The Web 3.0 Matter and you should know about it. The change to a new paradigm shift called decentralize web is happening and it will solve a lot of problems #web3 #permissionlessweb #ethereum #anti-censorshipweb #newinternet
Web, Internet
::: ZagoMatteoGian

Non comprate Mac usati
hardware
::: Genjuro75

Today would have the 100th birthday of MIT’s Jay Forrester, who first proposed the idea of magnetic core memory, the predecessor to semiconductors
storia
::: MIT_CSAIL

Perché il ciclo for di Python è speciale

Il titolo avrebbe dovuto essere “perché range(start, end) non comprende end?” ma si sarebbe perso il riferimento a for.

Forse lo sanno tutti, forse qualcuno l’ha scoperto da poco, altri ancora forse no. E perché?  Sto dicendo del ciclo for in Python.

Nella riscrittura di in Python di un programmino Basic c’è stata un po’ di confusione sugli indici di arrays e contatori di cicli.

Utilizzo MY-BASIC di Wang Renxin per visualizzare il ciclo for come lo intende il Basic, in tutte le sue varianti e incarnazioni, in particolare nel mio caso si tratta di VB, Visual Basic.

run e bye sono estensioni di MY-BASIC, il comando mb invece è un alias mio ma l’esempio –minimo– illustra come il Basic gestisce il ciclo, in particolare il ciclo comprende il limite finale, 5 in questo caso. Lo stesso comportamento lo troviamo nel linguaggio da cui il Basic deriva, il Fortran (dove il ciclo si chiama do). L’istruzione può prevedere un passo per l’indice, così:

OK? Ma questa è un’eccezione, dal C in poi il ciclo for ha una sintassi diversa, per esempio con nodejs (un sapore di JavaScript) posso scrivere:

Ovviamente si può scrivere <= al posto di < comprendendo così il limite superiore. Con C e C++ la sintassi è la stessa, migliora solo l’istruzione di scrittura, printf() e/o cout <<.

Il for per Python è diverso, funziona con le liste:

Potrei usare una lista di numeri:

Per creare una lista di numeri, come quelle che si trovano di solito nei cicli for esiste la funzione range().

The range type represents an immutable sequence of numbers and is commonly used for looping a specific number of times in for loops.

Come si vede il limite finale non è mai compreso. Per cui il ciclo iniziale (quello dei numeri da 1 a 5) sarà:

Visto 6 e non 5.

C’è un potivo per tutto ciò, il BDFL (emerito da due giorni) Guido la sa lunga:

in questo modo la lunghezza (len()) della lista è uguale al limite superiore del range(). Altre cosa da ricordare (già usata implicitamente ma è bene ricordarla per quelli come me che vengono dal Fortran) è che gli indici partono da 0, zero.

Questo è spiegato più in dettaglio qui.

E per chi vuole saperne di più passo la parola a EDW, qui: Why numbering should start at zero.

Grazie Guido 💥

Ieri Guido van Rossum ha comunicato che non farà più il capo di tutti i pythonisti. La speranza è che continui a seguire, anche se non al timone, rockz! 💥 assay 👽‼️

End of an era! Thanks for everything you did, @gvanrossum, it was an honor collaborating with you. Let’s hope the Python projects finds a way to govern itself effectively. A no-BDFL model is working for other porjects, hopefully it will for this one to.

La rassegna delle prime reazioni, altre seguiranno senz’altro, e –come dicono a Piobes (pron. piubes)– tomorrow is another day! e the show must go on ma assolutamente non frankly my dear, I don’t give a damn .

Transfer of pywer.

Armin Ronacher’s Thoughts.
il titolo migliore, imho.

As you can tell from my online nickname, python means a lot to me.

Wow, big news. Guido van Rossum is stepping down from leading Python development.

Python Language Founder Steps Down.

I’m sorry, I’m not allowed to argue any more.

Thanks for all the support (email and Twitter).

Running a community around a big open source project can be a thankless job. If you use open source tools, make sure you appreciate the maintainers who make it possible.

I don’t ever want to have to fight so hard for a PEP and find that so many people despise my decisions.

The PSF and Pythonistas everywhere are deeply grateful for all he has done creating Python and guiding it for so long.

Grateful for Guido van Rossum @gvanrossum’s leadership of Python, which has changed AI and software engineering.

Python is the reason I started programming.

AI, innovazioni e blockchain – 30

Si continua anche con questo caldo afoso impossibile: the show must go on (A. Lincoln).

Google’s Controversial Voice Assistant Could Talk Its Way Into Call Centers
artificial intelligence
::: Slashdot

DeepMind’s AI Agents Exceed ‘Human-Level’ Gameplay In Quake III
artificial intelligence
::: Slashdot

Scientists Break Quantum Entanglement Record At 18 Qubits
quantum computing
::: Slashdot

If your field’s goal is to make machines that can do everything people can do, you should think a fair amount about the societal implications of actually succeeding at that goal
robots
::: Miles_Brundage

It’s cheaper & easier to get humans to behave like robots than it is to get machines to behave like humans
robots
::: FrankPasquale

he immense contrast between Europe’s and China’s tech strategies. The short version: Europe’s myopic approach will ruin it
innovazioni, futuro
::: evgenymorozov

Kenya To Use Alphabet’s Balloons For Rural Internet
Web, Internet
::: Slashdot

Quantum computing funding, an alliance for open source smart cities, and more news
quantum computing
::: cialunet

Ultimately, only high-end products will stand a chance. If providers compromise user experience, consumers and regulators will reject them. Around 2020, we’ll likely have two to three large players and a few more local ones per country
innovazioni, futuro
::: michalnaka ::: la Stampa

Interesting detail: 5 parcel delivery services have established a „micro hub“ for last mile delivery by cargo bike
innovazioni, futuro
::: wgreiner

A smart self-opening trash can
come le porte del supermarket, dai, è vecchia
automazione
::: Rainmaker1973

A summary of AI strategies adopted by various countries
artificial intelligence
::: ylecun

The Geopolitics of Artificial Intelligence
artificial intelligence
::: evgenymorozov ::: mcsetty

The Australian government offers an example of what not to do while attempting a digital transformation, a recent report suggests
innovazioni, futuro
::: IEEESpectrum

Controversial Police Facial Recognition Test Fails to Recognize Anyone in London
privacy, sicurezza, spionaggio, virus
::: Slashdot

The motto of the new absolutism: “algorithmic governance”
privacy, sicurezza, spionaggio, virus | censura
::: FrankPasquale

Surgical Robots Cut Training Time Down From 80 Sessions To 30 Minutes
robots
::: Slashdot

Hanno votato a favore della direttiva sul copyright
censura
::: mante

Why bitcoin uses so much energy
blockchain e crypto*
::: RadioProzac

Must read > Making artificial intelligence socially just: why the current focus on ethics is not enough
artificial intelligence
::: fabiochiusi

The rise of ‘pseudo-AI’: how tech firms quietly use humans to do bots’ work
caos informativo, fake news, bufale | robots
::: laura_nobilis

Sergey Brin Says Google ‘Failed To Be on the Bleeding Edge’ of Blockchain
Google | blockchain e crypto*
::: Slashdot

Ubiquitous facial recognition will lead to mass street-level surveillance that will disproportionately harm people who already face daily discrimination. Civil society & others must continue to fight” it
privacy, sicurezza, spionaggio, virus
::: FrankPasquale

To survive Industry 4.0, think beyond the digital
innovazioni, futuro
::: cialunet

Deep Learning: A Critical Appraisal
devo ancora leggerlo; per adesso fiducioso del segnalatore
deep learning
::: marcodelmastro

Half of ICOs Die Within Four Months After Token Sales Finalized
blockchain e crypto*
::: Slashdot

This robot can navigate over large obstacles without flipping over, climb vertically up closely spaced walls, and “crawl” through narrow gaps
robots
::: IEEESpectrum

Far from fearing robot world domination, many in the AI research community are concerned that continued over-hyping of the field may eventually disappoint and lead to another AI nuclear winter
robots | artificial intelligence
::: fabiochiusi

These ads look like normal in-feed ads at first, but they include a “Tap to try it on” option, which opens up the AR capabilities. And of course if you like the way it looks in AR, you can go ahead and buy the product
Facebook | augmented reality
::: fabiochiusi

In 30 years we’ll look back and say Geoffrey Hinton is the Einstein of deep learning & this thing we’re calling AI
deep learning
::: RichRogersIoT

Ex-Apple Worker Charged With Stealing Self-Driving Car Trade Secrets
frodi | automazione
::: Slashdot

Young kids interface naturally—and often beneficially—with voice-activated technology, but some experts are worried it’s teaching them bossy, entitled habits, reports
innovazioni, futuro
::: medialab

Experiments performed with a team of nano quadrotors at the GRASP Lab, University of Pennsylvania
innovazioni, futuro
::: Rainmaker1973

This is an important nugget buried at the bottom of this piece on totalitarian policing tech in China. Right now, AI is still very much focused on the performativity and normalization of AI applications – until the tech catches up to claims
uh! 😯😯😯
artificial intelligence | politica
::: jathansadowski

Big data, human social behavior, and the future of smart cities
bigdata
::: medialab

Joe Chambliss (@NASA_Johnson): in 1993 Congress approved the ISS plan by just 1 vote (216-215)!
mica facile costruire il futuro
innovazioni, futuro
::: a_a_f_t

Last month, Facebook released the code for a new deep learning program called DensePose that can use images of people to make 3D models of their bodies and how they move
deep learning
::: IEEESpectrum

cit. & loll – 104

Anche con il caldo afoso che sembra proprio estate ecco qua

If a more-experienced dev can’t explain their code to you, they’re the one with the problem – not you
::: sarahmei

Purtroppo causa colleghi
::: zenfunkpanda

You know, when I was a kid…
::: asmeurer

Testers don’t break your code
::: RichRogersIoT

Cambridge Analytica didn’t convince decent people to become racists
::: callmeike

Non facciamoci illudere dal fatto che siamo amanti di smartphone, Smart tv e gadget simili. È solo trastullo epidermico
::: AlfonsoFuggetta

(psst: peggiorare)
::: 2x2sometimes5

Fascinating visualisation of how people interpret probabilistic terms
scorrere tutto il thread
::: tanayj

The downfall of Twitter started when
::: Gianlucadfiore

Fonti attendibili riferiscono che Muhammad ibn Musa al-Khwarizmi, già noto da tempo per i suoi scritti radicali e rivoluzionari, sia riuscito ad infettare la quasi totalità di pc e server con procedure sospette (anche ricorsive). Perché nessuno ne parla?
::: orporick

90% of all code comments
::: carterwickstrom

Internet is getting older
::: mikko

This ad’s fucking awesome really
::: BenYorkshire90

Pen & paper is still the most underrated tool
::: RichRogersIoT

Just because the computers keep getting bigger and more powerful
::: jessfraz

If size mattered
::: RichRogersIoT

Nowadays, the most common language on the web
::: mikko

It’s not that I hate math
::: TheeDianaDeath

The “Bash Fibonacci” sequence
::: TheMichaelBurge

Si risparmierebbero milioni di ore di lavoro se la gente imparasse a usare il tasto TAB
::: cesco_78

I bought my boss two copies of The Mythical Man Month
::: RichRogersIoT

#editing
come quando scrivi una funzione tua quando c’è un API a una chiamata di distanza
::: SnoozeInBrief

Le dita dei clienti che hanno toccato il monitor del mio Mac
::: marco_big_

Grande Fratello
::: woke8yearold

If it runs Emacs, it’s a computer
::: mintrod

The word “cyberspace” was coined in a sci-fi short story published #otd in 1982
::: MIT_CSAIL

I just released my first OSS project: Classic Finder. It’s a clone of the classic MacOS Finder, written on the modern Mac dev-stack to run on your modern Mac!
bravo Ben 💥😁
::: captainflotsam

Maserati also makes cars
::: asymco ::: asymco

P=NP stand for
::: GalaxyKate

Bunny says
::: Ballartaesputo

The next best thing to having good ideas
::: CodeWisdom

Machine Learning is the future
::: thecrazyprogrmr

Monad is a _simple_ abstraction. The biggest problem is abusing “simple” to mean “already familiar
::: paul_snively

One day, systems using Artificial Intelligence will be creating CAPTCHAs
::: mikkotweets2013

In API doc, do not include ‘negative’ examples in your code
::: wallingf

Un sogno di prima del Web (sì, anch’io)
::: marcoscan

The key to becoming an experienced software developer
::: RichRogersIoT

Pessimists make good programmers
::: RichRogersIoT

Fixing a bug in production
::: darylginn

I’m not entirely sure that people realize that Google
::: Gianlucadfiore

One of the best programming skills you can have is knowing
::: CodeWisdom

The only easy day
non sempre
::: alienoid

Languages shape the way we think
::: CodeWisdom

never say that again….
::: thecrazyprogrmr

#NikolaTesla! Fun fact: his statue in Silicon Valley radiates free WiFi
::: MIT_CSAIL

Elimina le righe duplicate, ma tieni le vuote

È fattibile uno script che dato un file di testo faccia come da titolo? Uh! vediamo 😯

Un compito semplice e conosciutissimo –anche da me– esegue la prima parte, eccolo:

#!/usr/bin/awk -f

!a[$0]++

Funziona perfettamente, esempio:

Proprio OK, eliminate tutte le doppie.
Ma a me servirebbe un’altra cosa: le righe vuote voglio tenerle tutte. Questo mi serve per le raccolte di Visto nel Web, AI e innovazioni e cit. e loll. dove le righe vuote separano le descrizioni dei link. OK, dovrei riscrivere tutto ma adesso va di moda –funzionalmente– essere lazy… 😉

AWK è uno dei miei linguaggi preferiti da sempre; appena misi le mani su un ‘puter Unix feci le fotocopie dei manuali di sh, vi, sed e AWK. Per Fortran e C avevo già tutto, cioè no, qualcosa: il K&R troppo sintetico, il TAB da aggiustare per il Fortran, le opzioni di compilazione, mica c’era Stak Overflow allora 😐 E neanche il Web. E anche i BBS sarebbero venuti dopo (con l’accoppiatore acustico (modem) a 2400 BPS). OK, sono OT 😐

Non so se la soluzione cui sono giunto sia bella, ma mi sembra funzioni e per adesso è questa (ndtv0):

#!/usr/bin/awk -f

{ if  ($1 ~ /^\#:/ || $0 == "")
  { print }
  else
  { { if (!a[$0]++) print }
  }
}

A dirla tutta c’è una riga vuota di troppo ma questo non da fastidio al mio caso. Questo però è solo il primo passo. Devo salvare l’output in un file e confrontarlo con quello di input. Se i due coincidono lo cancello altrimenti cancello l’originale (no, lo rinomino con estensione .bak) e rimonimo l’output con il nome dell’originale (file ndtv1).

#!/bin/bash

ndtv0 $1 > $1".tmp"
diff -s $1 $1".tmp"
R=$?
if [ $R == 1 ]; then
  echo "aggiorno"
  mv $1 $1".bak"
  mv $1".tmp" $1
else
  rm $1".tmp"
fi

Ripetendo il comando il file dovrebbe già essere OK:

OK, non resta che abilitare ndtv0 e ndtv1 (dopo averlo spostato in ~/bin o in un’altra dir presente in $PATH).

Ma è una cosa tutt’altro che finita. Nello script AWK ho inserito di tenere le righe delle categorie, quelle che iniziano con #: (notare che # è speciale e dev’essere baskslashato).

Il file risultante da questo filtro potrà risultare con righe fuori posto, come le due righe vuote consecutive dell’esempio. Ma qui continuo con un linguaggio normale (Python in questo caso) e il lavoro diventa più normale, noioso. Un collega di una volta (quasi 30 anni fa) dissente dal mio insistere con roba tipo AWK. Sono vecchio (ma anche lui, anagraficamente). Forse è arrivata per me l’ora di smettere, anche perché i blog sono passati di moda 😐

Visto nel Web – 348

OK, rinviata la censura europea del Web, giornalisti (quasi tutti, ottime le eccezioni) ed editori piangono inconsolabili, un sakko di link sull’argomento. Ma ho anche wisto altro nel Web.

ComputerWorld Says Newest Windows 10 ‘Isn’t Ready for Prime Time’
sistemi operativi
::: Slashdot

June 30, 1948, Bell Labs held a press conference in New York City to announce to the world that we had invented the transistor
storia
::: BellLabs

Thousands of Uber Drivers Scammed Out of Millions of Dollars
privacy, sicurezza, spionaggio, virus
::: Slashdot

One Misplaced Line of JavaScript Caused the Ticketmaster Breach
privacy, sicurezza, spionaggio, virus
::: Slashdot

Is Google’s Promotion of HTTPS Misguided?
a lot of the web consists of archives
Web, Internet | privacy, sicurezza, spionaggio, virus
::: Slashdot

In software dev we are the victims of our success
da approfondire
programming, codice, snippet
::: amasad

Data From Open-Source Ancestry Site Leads to More Arrests
privacy, sicurezza, spionaggio, virus
::: Slashdot

La raccolta dei nostri dati come forma di controllo sociale. Ecco perché è fondamentale la regolamentazione
dati, raccolta
::: DottEmanueleT

“Lisp – a Language for Stratified Design” by Harold Abelson and Gerald Jay Sussman
storia | lisp(s)
::: thelittlelisper

Ten days after launching in Poland, #ApplePay has vastly outpaced #GooglePay uptake
economia
::: appleinsider

#art13 of the new #copyright directive and the new #censorship machine, for dummies
censura
::: InnoGenna ::: demartin ::: valigiablu ::: communia_eu ::: N4ik3 ::: Bennetto90 ::: zacchiro ::: emenietti ::: Wikipedia ::: annamasera ::: WikimediaItalia ::: craaash80 ::: TristeMietitore ::: dcavedon ::: suzukimaruti ::: TuxmAL ::: i ::: azuech ::: fabiochiusi ::: WikimediaItalia ::: xmau ::: communia_eu ::: Slashdot ::: mante ::: SWHeritage ::: melhagemann ::: WikimediaItalia ::: mmasnick ::: WikimediaItalia ::: WikimediaItalia ::: EFF ::: rasmus_kleis ::: carloalberto ::: WikimediaItalia ::: Senficon ::: wikimarcok ::: carloalberto ::: mante ::: communia_eu ::: ryanmerkley ::: derobbio ::: scapiba ::: WikimediaItalia ::: maurorizzi_mr ::: r_lab ::: WikimediaItalia ::: Senficon ::: Senficon ::: SergioGridelli ::: MCPievatolo ::: r_lab ::: communia_eu ::: fabiochiusi ::: fabiochiusi ::: fabiochiusi ::: tobie ::: glynmoody ::: silviamajo ::: communia_eu ::: communia_eu ::: fabiochiusi ::: zacchiro ::: Senficon ::: mante ::: fabiochiusi ::: valigiablu ::: emenietti ::: disinformatico ::: fabiochiusi ::: OpenRightsGroup ::: Agenzia_Ansa ::: fabiochiusi ::: _juhan ::: Senficon ::: communia_eu ::: fabiochiusi ::: peppeliberti ::: _juhan ::: fabiochiusi ::: slashdot ::: davidakaye ::: jimmy_wales ::: Senficon ::: cmnit ::: fabiochiusi ::: cristigalas ::: zacchiro ::: Senficon ::: cmnit ::: timberners_lee ::: LGuibault ::: communia_eu ::: EFF ::: WikimediaItalia ::: WikimediaItalia ::: zacchiro ::: rasmus_kleis ::: zacchiro ::: lucasofri ::: fabiochiusi ::: reesmarc ::: madbob ::: lmisculin

A fun quiz on eval() in JS, and corner cases of its behaviour. I’ve seen some of the gotchas before, but I still don’t envy JS implementors
me: You got 8/11 correct!
linguaggi di programmazione
::: _wilfredh ::: MauroV1968

‘Why You Should Not Use Google Cloud’
ditte
::: Slashdot

Twitter Will Show Who Pays For Ads and How Much They Spend
social media | ad, pubblicità
::: Slashdot

#hyperHTML styleguide is out
linguaggi di programmazione
::: santinialberto

Why should I learn Racket? How is it different/unique/better than other languages? Are there operations which can only be performed in Racket? How fast is it compared to Java/Haskell/Clojure/Lisp, etc.?
language Racket
::: gknauth

70 years ago this week Claude Shannon ushered in the field of information theory with his paper “A Mathematical Theory of Communication”
storia
::: MIT_CSAIL

This weekend, the @racketlang package index crossed the 1000-package mark!
language Racket
::: samth

Amazon’s Alexa is Getting Clobbered
smart assistant
::: Slashdot

Predicting the truncated xorshift32* random number generator
programming, codice, snippet
::: lemire

Visual augmentation of source code editors: A systematic review
tools, componenti software
::: _wilfredh

Adding dragon emoji as semicolons in node.js or the typescript compiler
programming, codice, snippet | 😉
::: _wilfredh

There are 100M lines of code in the average modern car. This should terrify any experienced programmer
programming, codice, snippet
::: RichRogersIoT

SUSE Linux Sold For $2.5 Billion
sistemi operativi | economia
::: Slashdot

Newer Diameter Telephony Protocol Just As Vulnerable As SS7
privacy, sicurezza, spionaggio, virus
::: Slashdot

System F-word
è serio: now that I have your attention…
programmazione funzionale
::: Iceland_jack

I was at the Usenix that celebrated Unix 25th anniversary in Boston. Dennis was there, and Maddog has just given Linus an Alpha computer to port Linux to. I was a kid and now feel like an old man
protagonisti | storia
::: migueldeicaza

The Unix operating system turns 50 in July 2019. Please RT the #unix50th tag to spread awareness, & tell us why Unix is important to you
sistemi operativi
::: DoctorWkt

NASA researchers recently created a model that analyzes various weather factors that lead to the formation & spread of fires. The Global Fire Weather Database (GFWED) is the first fire prediction model to include satellite–based precipitation measurements
programming, codice, snippet
::: Rainmaker1973

Da ieri #Ivrea è patrimonio Unesco, qualche tempo fa su @LaStampa raccontai di quando la Olivetti inventò il pc e conquistò New York
storia
::: nadiaferrigo

Facebook chiude tbh, app che aveva comprato appena otto mesi fa
Facebook
::: emenietti

In a widening probe, four federal agencies are now looking into Facebook’s role in Cambridge Analytica, including SEC
privacy, sicurezza, spionaggio, virus | Facebook
::: lizzadwoskin

The concept of re-decentralizing the web is now mainstream
Web, Internet
::: timberners_lee

So far, there have been 13 incidents of lynching related to rumours circulated through WhatsApp about suspected child lifters and kidnappers – resulting in the murders of 27 people, in less than two months
social media | dispositivi mobili | caos informativo, fake news, bufale
::: fabiochiusi ::: Slashdot

Imagine for a minute. Julian Assange in political captivity for 6 years
#web
::: JulianAssange

Ubuntu Studio Have Released a Free Guide to Audio Production on Linux
applicazioni, programmi | manuali, how to
::: dcavedon

Tired of bloated resource hungry GUI music players? moc is a nice TUI/console music player with many options, controls
da provare
applicazioni, programmi
::: climagic

Mi sono immerso nelle tecnologie che vogliono decentralizzare il web. L’evoluzione dell’“hypermedia browser/editor”
Web, Internet
::: ORARiccardo

Per le vedove di Wikipedia. Per cercare informazioni su qualcosa esiste sempre il “vecchio metodo”. Motore di ricerca e spulciare siti. Lo abbiamo fatto per anni
io invece sono wikipedista; non esclusivo ma parto spesso di lì
Web, Internet
::: twlayos

Study Finds That a Large Number of Popular Android Apps Secretly Cast the Screen To Third Parties, But They Don’t Listen To Conversations
privacy, sicurezza, spionaggio, virus
::: Slashdot

Linux Users Face a Growing Number of Cryptojacking Threats
privacy, sicurezza, spionaggio, virus
::: LinuxFansclub

Copying Photos Found on Internet is Fair Use, Virginia Federal Court Rules
copyright e brevetti
::: Slashdot

While technology experts and scholars have concerns about the current and future impact of the internet, they also tend to report their own experience of digital life as positive
Web, Internet
::: fabiochiusi

Barcelona

This is the first sensible reason for why Google killed Reader
Web, Internet
::: lilianedwards

South Korea Cuts Its Work Limit From 68 Hours a Week To 52
economia
::: Slashdot

Juggalos Figured Out How To Beat Facial Recognition
privacy, sicurezza, spionaggio, virus
::: Slashdot

One of my favorite little Python tidbits is that zip() is its own inverse
Python
::: jakevdp

Malware Authors Seem Intent on Weaponizing Windows SettingContent-ms Files
privacy, sicurezza, spionaggio, virus
::: Slashdot

A Bloatless Web
Web, Internet
::: WebReflection

A fascinating review of exactly why most people find dynamic languages easier to use than statically typed languages, with specific examples in Rust, Python and more
linguaggi di programmazione
::: pat_shaughnessy

Excellent talk by Douglas Croxkford about what parts of the language should we fix in the next programming language. Many of his suggestions are already there in #clojure
lisp(s)
::: viebel

Google has confirmed that private emails sent and received by Gmail users can sometimes be read by third-party app developers, not just machines
privacy, sicurezza, spionaggio, virus
::: fabiochiusi

5 anni da “data journalist”. Qualche considerazione (e un po’ di ottimismo)
media
::: RadioProzac

ssg: static site generator with rsync and lowdown
Web, Internet
::: jpmens

array conversion
linguaggi di programmazione
::: WebReflection

Learn Python with Visual Studio
Python
::: nicolaiarocci

L’informazione online italiana sta diventando un unico grande clickbait, fatto di “ecco” e compagnia. Ed evidentemente funziona
media
::: lucasofri

NeXTCUBE was manufactured 1990-1993: 25 MHz Motorola 68040 processor, 16-64 Mb RAM, and famous PostScript display. Run NeXTSTEP, UNIX based on Mach kernel blended with 4.3BSD
storia
::: unix_byte

ggplot2 3.0.0 now on CRAN. Headline features are tidy eval, sf support, position_dodge2(), & viridis
linguaggi di programmazione
::: hadleywickham

“The individual was incredibly empowered,” the web’s inventor, @timberners_lee, says of a decentralised web. “That feeling of individual control, that empowerment, is something we’ve lost”
Web, Internet
::: webfoundation

Is Facebook a Publisher? In Public it Says No, But in Court it Says Yes
Facebook
::: Slashdot

Algebraic Query Language (AQL): schemas as categories, DB instances as functors, provable data migration as functor composition
linguaggi di programmazione
::: KenScambler

How to get an instant answer to any question on (almost) any programming language from the command line
devo provarlo
Web, Internet
::: igor_chubin

“Cambridge Analytica non ha convinto della gente di buon senso a diventare razzista: ha convinto i razzisti a diventare elettori.” Breve saggio illuminante di Cory Doctorow (@doctorow): Zuckerberg e l’incoscienza morale
Facebook | privacy, sicurezza, spionaggio, virus
::: disinformatico

I always wondered why ad targeting was so bad. Now that some online services allow you to see the info used to target ads, I can see why!
ad, pubblicità | privacy, sicurezza, spionaggio, virus
::: danluu

Jack Dorsey privately met with Trump aides in DC to apologize for the platform’s liberal bias while the family separation horror at the border was unfolding. He lacks judgement
Twitter | protagonisti
::: Pinboard

Per l’Accademia delle Scienze di Torino abbiamo creato una teca digitale a prova di futuro con @internetarchive e tecnologie standard
Web, Internet
::: AlessioMelandri

French ministry of research published today an ambitious plan for #openscience at #liber2018 : open access, open data, and support of @SWHeritage, universal software source code library of Alexandria
open source
::: SWHeritage

►#UBports | A #mobile version of the #Ubuntu Operating System
dispositivi mobili | sistemi operativi
::: AnonymousVideo

A thorough study of over 17 thousand Android apps reveals that there is no evidence that apps are secretly turning a phone’s microphone on to spy on device owners
dispositivi mobili
::: mikko

An Employee of NSO Group, Which Sells Powerful Spyware, Allegedly Stole Company’s Tools For Personal Profit
privacy, sicurezza, spionaggio, virus
::: Slashdot

First up: The Intel 4004 was the world’s first microprocessor on a single chip. Intended as a quick side-venture to make some money for then-fledging Intel, this project almost crashed and burned due to a lack of staff
storia
::: IEEESpectrum

Questa la sobria analisi di Repubblica sulle ragioni del voto di oggi a Bruxelles
caos informativo, fake news, bufale | KittyPaka! questa sarebbe la stampa seria
::: mante

The World’s Largest Phone Network China Mobile Censors Content — Even in the United States
privacy, sicurezza, spionaggio, virus
::: Slashdot

Found an excellent Bash resource. One of the many unlikely things I tend to think: being super proficient with Bash is extremely significant developer productivity boost. 🏎
manuali, how to
::: brianleroux

Net Neutrality Makes Comeback in California; Lawmakers Agree To Strict Rules
Web, Internet
::: Slashdot

How quickly can you compute the dot product between two large vectors?
programming, codice, snippet
::: lemire

Apple’s App Store Celebrates 10th Anniversary
ditte
::: Slashdot

Vue.js: the good, the meh, and the ugly
linguaggi di programmazione
::: WebReflection

Elegant Python code for a Markov chain text generator
Python
::: elibendersky

La verità, vi prego, sull’articolo 11
ottimo il Mantellini; merita una segnalazione qui invece di perdersi nella lunghissima (troppo? no, devo festeggiare) lista sul voto del Parlamento europeo
censura
::: DanieleOppo

Pandas 0.23.2 is out
Python
::: TomAugspurger

A new algorithm developed by @Harvard researchers solves optimization problems exponentially faster than previous algorithms
programming, codice, snippet
::: IEEESpectrum

Mark Zuckerberg Becomes World’s Third-Richest Person
protagonisti
::: Slashdot

HTC Had Its Biggest Drop In Sales In More Than Two Years
ditte
::: Slashdot

Sergio Gridelli

Science and Technology links (July 6th, 2018)
novità
::: lemire

I think you might enjoy reading @BigMeanInternet’s “The Singular Pursuit of Comrade Bezos”
protagonisti
::: gittaca

A Universal Bundle Loader
linguaggi di programmazione
::: WebReflection

Twitter Suspended 70 Million Accounts In Past Two Months, Says Report
Twitter | privacy, sicurezza, spionaggio, virus
::: Slashdot

I giornali e lo stop alla riforma UE sul copyright
giornalisti e editori italiani si sa che spesso, praticamente sempre, quasi tutti…
censura | caos informativo, fake news, bufale | media
::: L_Capotorto

What happens if you do a survey on Mechanical Turk asking programmers what semantics they expect of their languages?
programming, codice, snippet
::: _wilfredh

Google AdSense Banned a Random Webpage About a 32-Year-Old Bill Because It Was About Sexual Abuse
Google
::: Slashdot

Why Sci-Hub is illegal, and what you can do about it
Web, Internet
::: Sci_Hub

Enrico Mentana annuncia la nascita di un quotidiano digitale formato da soli giovani – contrattualizzati – scelti da lui e con qualche “vecchio” come tutor (a titolo gratuito)
media | Web, Internet
::: chedisagio

Strict new internet laws in #Tanzania and #Uganda are driving content creators offline
censura
::: accessnow

e, pi, una volta e adesso

Dave ci ricorda che approfittando delle feste –OK, leggete qui.

Io non solo non ho partecipato, neanche commentato. A dire il vero non avrei potuto, non c’ero ancora. Ma rimedio subito.

Oggi è facilissimo, viene aggratiss, per esempio con bc:

Le ultime 2 cifre possono essere non precise per problemi di arrotondamento, se del caso basta aumentare il numero di cifre richieste, attraverso la varialibe scale. Non ci sono problemi, l’hardware non è quello di Von Neumann, per esempio per 4000 cifre uso lo script pi.bc:

scale=4000
pi=4*a(1)
print pi
print "\n"
quit

e è nella funzione e(), avendo visto che la precisione non è un problema uso quella di default (20 cifre caricando la libreria matematica con -l)

Con Python basta installare uno dei moduli per la precisione arbitraria. Anzi probabilmente non è necessario se si usa SciPy/NumPy &co ma oggi un modo alternativo, più sexy, via mpmath installabile con pip3 install mpmath. seguendo le dritte di Fredrik Johansson qui, 100 mpmath one-liners for pi ecco:

OK, è una collaborazione, largo ai giovani!

AI, innovazioni e blockchain – 29

Per adesso scampata la censura del Web ma la Stampa Seria non demorde, ritenterà a settembre; intanto ecco qua 😋

oggi sono con i giggini

A new supercomputer in Japan could reach exascale speeds around 2021
innovazioni, futuro
::: IEEESpectrum

128TB SD Cards Are Coming
hardware
::: Slashdot

SpaceX Will Send an AI Robot To Join Astronauts On ISS
robots
::: Slashdot

Neural networks are just ways of transforming high dimensional things into low dimensions such that you can apply a linear model
artificial intelligence
::: alex_peys

L’esperimento social-e prosegue. Sto rispondendo a ogni tweet di Salvini e Di Maio
web-bot
::: discordoconme

🤖Ready to build your first robot?🤖
robots
::: cialunet

Uber Could Resume Testing of Its Self-Driving Vehicles this Summer
automazione
::: Slashdot

#Smartcities, un mercato da 2 miliardi. Gli investimenti x i servizi digitali dei centri urbani si moltiplicano. Opportunità per migliorare il benessere ma i pericoli dello strapotere delle corporation non mancano
innovazioni, futuro
::: soli1964

Microsoft Details Secret ‘Pocketable’ Surface Device
dispositivi mobili
::: Slashdot

This spider-like vehicle can handle extremely rough terrain
innovazioni, futuro
::: IntEngineering

DARPA Invests $100 Million In a Silicon Compiler
innovazioni, futuro
::: Slashdot

Bitcoin Drops Below $6,000, An 8-Month Low
me n’ero accorto di già
blockchain e crypto*
::: Slashdot ::: _juhan

Massive New ‘Salesforce Tower’ Light Sculpture: AI, Ubuntu, Fog, and a MacBook
artificial intelligence | sistemi operativi
::: Slashdot

San Jose May Start Cracking Down On Rampant Use of Scooters
innovazioni, futuro
::: Slashdot

Lime is raising a $300m round at a $1.1 billion valuation from GV and Alphabet
innovazioni, futuro
::: michalnaka

Google and Nasdaq Pursuing Nano-Second Precision In Network Time Protocol
innovazioni, futuro
::: Slashdot

I don’t always agree with Bitcoin maximalists. I’m pro-crypto in the broad sense, including BTC & much more. But I am glad that maximalists exist, because the most intolerant minority wins… and they will relentlessly fight any perceived attack on Bitcoin
blockchain e crypto* | economia
::: balajis

Ross Ulbricht went to prison for life. He created the world’s first anonymous digital market with cryptocurrency. His project was the reason Bitcoin is where it is today. The state crushed him. Remember his noble example and pure sacrifice. We are in one boat with one mission
innovazioni, futuro | blockchain e crypto*
::: AmirPolyteknik

IBM’s new #AI chip can perform all three of today’s main flavors of deep learning: convolutional neural networks, multilayer perceptrons, and long short-term memory
hardware
::: IEEESpectrum

Economists Worry We Aren’t Prepared For the Fallout From Automation
robots | economia
::: Slashdot

Ho appena pagato la metro con Apple Pay. Che figata!
innovazioni, futuro
::: AlfonsoFuggetta

As Cryptocurrency Values Plummet, Graphics Card Pricing Improves Dramatically
blockchain e crypto* | hardware
::: Slashdot

Exec Accused of Stealing Waymo’s Trade Secrets Starts New Self-Driving Company
automazione
::: Slashdot

Chinese AI Beats 15 Doctors In Tumor Diagnosis Competition
artificial intelligence
::: Slashdot

Honda is teaching its robots to take longer and faster steps to recover from shoves
robots
::: IEEESpectrum

What happens when popularity decides what gets top billing on search and social algorithms? When it comes to health information, the results can be tragic. I wrote about keyword voids, recommendations, and paid promotion of misinformation
algoritmi, codice
::: noUpside

Those who have read my tweets before would guess that I think this article is close to reality. Self-driving cars are headed toward an AI roadblock
automazione
::: rodneyabrooks

Open source money: Bitcoin, blockchain, and free software
blockchain e crypto*
::: cialunet

These are the slides I presented on “blockchain governance” at Zcon
blockchain e crypto*
::: nic__carter

Se puoi descrivere il tuo mestiere solo con una parola, è molto probabile che prima o poi una macchina, un algoritmo o un sistema di AI lo farà al posto tuo
artificial intelligence
::: SergioGridelli

Sostituire i TABs e i caratteri non-ASCII

A volte il testo preso dal Web o da altri posti ancora non è come lo vorremmo. Capita che contenga caratteri strani, per esempio TABs, caratteri Unicode (a volte sono OK, a volte no, per esempio nel codice apici e virgolette devono essere quelli classici anche se meno belli), λ (OK ma non nella REPL di Racket (sì, questo solo per me)). Ecco il terminale è uno di quelli che certe cose proprio non le accetta.

Vero che in (quasi) qualsiasi editor si può fare ma se del caso…

Comincio con TAB, serve come base poi generalizzabile (file stab):

#!/bin/bash

if [ -z $1 ]; then
  echo 'uso:' $0 '[sost-char] file'
  exit 2
elif [ -z $2 ]; then
  SOST=' '
  PROC=$1
else
  SOST=$1
  PROC=$2
fi

sed "s/\t/$SOST/g" $PROC

Lanciato senza opzioni esce con un messaggio:

È richiesto il nome del file preceduto opzionalmente con il carattere (o i caratteri) che sostituiranno il TAB.

OK? C’è (ancora, pare che adesso Windows 10 sia sulla buona strada) chi preferisce Python. Si può fare; anzi lo script risulta simile (stab.py):

#!/usr/bin/python3

import sys, re

if len(sys.argv) == 1:
  print ('uso:', sys.argv[0], '[sost-char] file')
  exit(2)
elif len(sys.argv) == 2:
  sost = ' '
  proc = sys.argv[1]
else:
  sost = sys.argv[1]
  proc = sys.argv[2]

with open(proc, 'r') as f:
  txt = f.readlines()

for st in txt:
  print(re.sub('\t', sost, st), end='')

È possibile evitare l’uso delle espressioni regolari (modulo re che ho preferito per uniformità con lo script seguente): basta sostiture l’ultimo ciclo for con

for st in txt:
  print(st.replace('\t', sost), end='')

Generalizzando arrivo ad andare alla ricerca di tutti i caratteri fuori dalla sequenza ASCII. Ho copiato in un file un paio di tweets (dimenticando di salvare il nome degli autori) contenenti citazioni quotate. Nel primo si usano le virgolette che si trovano nella stampa tedesca, nel secondo no, roba corrente ontehtoobz. Ho aggiunto un paio di emoji, ormai hanno invaso il Web. Poi passo a evidenziali:

Questo è lo script fuori.py:

#!/usr/bin/python3

import sys, re

if len(sys.argv) == 1:
  print ('uso:', sys.argv[0], '[sost-char] file')
  exit(2)
elif len(sys.argv) == 2:
  sost = '_'
  proc = sys.argv[1]
else:
  sost = sys.argv[1]
  proc = sys.argv[2]

with open(proc, 'r') as f:
  txt = f.readlines()

for st in txt:
  print(re.sub(r'[^\x00-\x7f]', sost, st), end='')

Procedo come per il TAB ma con sed ci sono problemi, dovuti alla tabella caratteri caricata se abbiamo capito bene. Ancora da indagare (e risolvere), materia per un prossimo post.

OK, 😁⭕