29 novembre, 2019

shellcheck, un aiuto per gli script


A me l'ha detto Greg (rockz! 💥) che glielo aveva detto Sylvia (rockz! 💥) che shellcheck di Vidar Holen, koalaman, rockz! 💥 (anche se non c'è su Twitter).

Io che sono pasticcione (molto più di Greg) di solito ricorro a set -x ma shellcheck è molto meglio: mi dice cosa non va, e la sa lunga! 💥

L'installazione è semplicissima (basta seguire la dritta del README.md) per 'buntu:
sudo apt-get install shellcheck
ed è pronta, da testare (in casi come questo manco di fantasia ho prodotto solo test.shck):

#/bin/bash
echo "test di shellcheck"
k = 5
echo $k
r=(( k + 2 ))
echo $r


ed ecco:


Uh! ottimo. E --ovviamente-- con il click con il tasto destro del mouse sui link della wiki attivo lo spiegone nel browser, nessuna scusa anche per quelli come me 🙂

Inoltre, come se tutto questo non bastasse, il linguaggio di shellcheck è Haskell, se avessi tempo... magari quando sarò vecchio 🤪
🔴

28 novembre, 2019

Visto nel Web - 452

Mentre (momentaneamente) non piove vi racconto quello che ho wisto nel Web.


Impressione mia o Elon #Musk sta prendendo la via di Howard Hughes?protagonisti
::: Lord_Hanmar ::: futurepundit

New Linux/Windows Malware Allows Arbitrary Execution of Shell Commands
privacy, sicurezza, spionaggio, virus
::: Slashdot

ICANN can still block the deal to sell off the .org top level domain
Web, Internet
::: Senficon ::: libreitalia

But how to build a company culture?
lavoro
::: fchollet

"Unix was a very small...So it was very beneficial to a lot of people, especially at universities, because it was very hard to teach computing from an IBM end-user point of view. That was the origin of the so-called Unix culture." Ken Thompson, 1999 IEEE Computer interview
storia
::: unix_byte

A Real-Life Tesla Study Shows Durability of EV Batteries
energia
::: Slashdot

Japanese Hotel Room Costs $1 a Night -- If You'll Livestream Yourself
se vero: mah...
economia, lavoro
::: Slashdot

“Una notizia non piace, o infastidisce? Basta chiamarla ‘fake news’, e diventa legittimo criminalizzarla, reprimendo insieme la libera stampa e la libertà di espressione di tutti”. Attenzione a pretendere una pericolosa “verità di Stato”
disinformazione, fake news, bufale | politica
::: vitalbaa

awesome
umorismo
::: omgubuntu

What Tech Skills Do Employers Want? SQL, Java, Python, and AWS
lavoro
::: Slashdot

“The era of black box machine learning is behind us” (Is it? 🤔)
artificial intelligence
::: fabiochiusi

The Trump administration is choosing to act against the consensus of the scientific community. The EPA’s Strengthening Transparency in Regulatory Science rule needs to be viewed against the backdrop of this reality
ambiente, ecologia
::: nature


Un’intera pagina sul @Corriere per magnificare il futuro degli spazi di coworking. Non menziona neanche una volta il totale crash di WeWork, leader mondiale del settore. L’incultura del lavoro in Italia passa dalla scarsissima informazione dei media
lavoro | disinformazione, fake news, bufale | giornali, stampa
::: valeriodeste

Praticamente Tiktok, 110 anni fa
storia | umorismo
::: disinformatico

NextCloud Linux Servers Targetted by NextCry Ransomware
privacy, sicurezza, spionaggio, virus | frodi
::: Slashdot

Impossibile starci. Impossibile non esserci
Facebook
::: mante

Preferisco Twitter a #instagram per tre buone ragioni
umorismo
::: Santas_Official

Non ho resistito...
tecnologia | umorismo
::: Jessica97737031

Stadia Works on Ubuntu (Well, Kinda)
games
::: dcavedon

Geeks Successfully Transport a 50-Year-Old IBM Mainframe to Former UK Top Secret Mi6 Base
storia | hardware
::: Slashdot

Do AI Deserve the Same Rights as Animals?
artificial intelligence
::: Slashdot

Price of Bitcoin Plummets Below 'Psychological' $7,000 Level After China Promises Crackdown
blockchain e crypto*
::: slashdot

Even After 22 Trillion Digits, We’re Still No Closer To The End Of Pi
matematica
::: FiveThirtyEight


Quando il corriere ti fa firmare sul palmare
umorismo
::: Sfigosauro

Good thread on the recent ICANN .org fiasco
Web, Internet
::: FrankPasquale

Quei 25 milioni tolti al reddito di cittadinanza per il software voluto da Mimmo Parisi (peccato che, pare, lui ne sia anche il produttore)
politica
::: Davni10

If we fail to defend the free and open web, we risk a digital dystopia of entrenched inequality and abuse of rights.

We must act now. Join me in backing the Contract for the Web — a global plan of action for the #WebWeWant. @webfoundation
Web, Internet
::: timberners_lee ::: AgostinelliAldo ::: MIT_CSAIL ::: skdh ::: francesca_bria

Mozilla's Annual Buyer's Guide Rates Amazon and Google Security Cameras 'Very Creepy'
privacy, sicurezza, spionaggio, virus
::: Slashdot

Per i fan di una legge contro le fake news in Italia: ecco che succede dove, come a Singapore, c'è. Il governo impone, chi parla ubbidisce. Questa sì che è libertà di espressione online!
Web, Internet | #Marattin, marattinate, pensate farlokke | politica
::: fabiochiusi

Dear @Google, So Long, and Thanks for All the Fish
Google
::: santinialberto

Borrowing periodizing terminology from feminist theory, @FrankPasquale brilliantly distinguishes between waves 1 & 2 of algorithmic accountability. Example of wave 2 approach. Ban facial recognition. Don't aspire to make it more inclusive
algoritmi, codice | riconoscimento facciale
::: EvanSelinger

sqlite3 — Embedded Relational Database
Python
::: pymotw

The #copyright fight between rightholders and Google is back — only this time, the action is in Luxembourg
copyright e brevetti | social media
::: LauKaya

Intel and MediaTek Partner on 5G Laptops for 2021
5G | hardware
::: Slashdot


Concurrency on the JVM
My first contribution to @97_Things has been just published
linguaggi di programmazione
::: mariofusco

Lenovo Enters the SBC Market with Leez LP710 RK3399 Board: It’s always interesting to look into mainline Linux changelog either to find out about new software features, but also new hardware platform. And earlier today, I wrote about Linux 5.4 release
hardware | Linux
::: linuxdevices

Linux Kernel 5.4 Released, This is What's New
Linux
::: omgubuntu

La strategia comunicativa di Facebook è la stessa da anni. Chiamano “errore”, a cose fatte, la scelta elementare di un algoritmo rozzo. Così tutti possono continuare a pensare che là dietro esistano esoteriche intelligenze che tutto comprendono, alle quali affidarci con fiducia
Facebook
::: mante

Zorin OS 15 Lite Linux Distro Can Rejuvenate Your Aging Windows PC
Linux distro
::: Slashdot

The German conservative party (@CDU) joins @fsfe's #publicmoneypubliccode mission, stating that "all publicly funded software should serve the citizens". Yeah
open source
::: NeoTheThird

Bringing hardware to life with AI & IoT. Last century electricity disrupted every single industrial vertical on the planet. This century software will do the same
artificial intelligence | Internet of things
::: RichRogersIoT

A “chameleon app” looks like a friendly app while it’s being reviewed, and then morphs into a malicious program once installed on someone’s phone
privacy, sicurezza, spionaggio, virus
::: IEEESpectrum

Memory parallelism: AMD Rome versus Intel
hardware
::: lemire

90% of Americans think AI will destroy at least half of all jobs - but 91% say they don't think it will impact theirs
artificial intelligence | lavoro
::: MIT_CSAIL

We officially announced our new ASCII 2.1 point release today, with updated iso installers, desktop live and minimal live
sistemi operativi
::: DevuanOrg ::: BrucePerens


The RIPE NCC Has Run Out of IPv4 Addresses
Web, Internet
::: Slashdot ::: mapogli ::: xmau

Now reading: "What can be done? Digital Media Policy Options for Europe (and beyond)". A new and timely report, by @risj_oxford, @UtrechtUni and @STGEUI
privacy, sicurezza, spionaggio, virus
::: MediaEu

Brussels is considering establish “effective liability if damage is caused by AI applications,” according to internal doc. The rules could be a “directive” setting out policy principle, country will translate into nat law
artificial intelligence | lavoro
::: maria_axente

Facebook in Francia ha un account parodia su Twitter certificato
social media
::: davcarretta

Thankfully every time I've made something that didn't exist before, I've ignored these kind of opinions, as I don't work for a "will be standardized" company 😅 Don't stop at mainstream hype, and do have fun experimenting or creating new things, even if it's just you using it 😉
linguaggi di programmazione
::: WebReflection

I wrote an 8k word doc on machine learning systems design
machine learning
::: chipro

Il #SoftwareLibero guadagna l'appoggio della Facoltà di Scienze e Tecnologie Informatiche della Libera #Università di Bolzana: delibera in favore del progetto FUSS.
open source
::: WikimediaItalia

ArchLinux and Manjaro (which is still ArchLinux but easier for new comers) dominating the gaming on Linux share!
games
::: WebReflection

UN Secretary-General António #Guterres: The world's next major conflict will start in cyberspace, there is a risk of a #decoupling between China Internet and US Internet
cyberwar
::: LalaHu9

Amazon Brings Alexa To AWS IoT Core Devices
Internet of things
::: Slashdot

Amazing .. historians uncover Pierre de Fermat's LaTeX source code
umorismo
::: InertialObservr

A different kind of interview, by my friend and former coworker Anthony Kosner
protagonisti
::: gvanrossum


90% of the 151 people arrested in Brazil using face recognition technologies are black. Coincidence or the algorithms are racist?
algoritmi, codice | odio, razzismo, discriminazioni
::: SurveilSouth

#OTD in 1915, #AlbertEinstein submitted his final version of the General Theory of Relativity to the Prussian Royal A, complete with the field equations that define how the f. of gravity arises from the curvature of space and time by matter and energy
scienza
::: Nereide

The California DMV Is Making $50 Million a Year Selling Drivers' Personal Info
privacy, sicurezza, spionaggio, virus
::: Slashdot

Really fast parsing of streams of JSON documents with simdjson, it can be 8 times faster than RapidJSON+getline, and solves a harder problem
programming, codice, snippet
::: lemire

AMD Launches Threadripper 3970X, 3960X and Smokes Intel's New 18-Core CPU
hardware
::: Slashdot ::: PatrickMoorhead

Okay universe, but tomorrow, compilers
cit.
::: wilbowma

Smartphone Videos Can Now Be Analyzed To Locate a Shooter
privacy, sicurezza, spionaggio, virus
::: Slashdot

A journalist (@drzax) monitored their devices and found 72% of traffic was tracking-related, with 46 different servers contacted on the second night while they slept. Averaged across a week, how frequently were their devices transmitting?
privacy, sicurezza, spionaggio, virus
::: Snowden ::: Snowden

This is a subtweet about root cause analysis
programming, codice, snippet
::: ReinH

A clean code base is not only faster to work with, it is more fun. And motivated developers tend to create better products faster, which in turn makes both customers and developers happier
programming, codice, snippet
::: RichRogersIoT

US Police Already Using 'Spot' Robot From Boston Dynamics In the Real World
robots, automazione, droni
::: Slashdot


US Tech Sector Skews Younger Than the Workforce As a Whole, Study Finds
lavoro
::: Slashdot

I often think the climate denial campaign is the biggest cover-up in history. And the most consequential one. It's a pretty dramatic story. Wish more journalists were interested in covering it! So much for "boring" climate change
ambiente, ecologia
::: leahstokes

This week's @fstackbulletin contains an amazing recommendation: Elixir in Action by @sasajuric. Kudos to the guys for this great pick 🚀 Read the email in the browser
linguaggi di programmazione
::: dottorblaster

Google Fires 4 Workers Active in Labor Organizing
lavoro
::: fabiochiusi ::: katecrawford

The China Cables reveal how the system is able to amass vast amounts of intimate personal data through warrantless manual searches, facial recognition cameras, and other means to identify candidates for detention
privacy, sicurezza, spionaggio, virus
::: fabiochiusi

In a world first, the Finnish government has started issuing a logo to IoT products that meet the information security requirements set by @CERTFI. Great initiative
Internet of things
::: mikko

The EU doesn’t have a sense of its disinformation problem — this report suggests the policy changes it can make
privacy, sicurezza, spionaggio, virus
::: fabiochiusi

They found that not only did users not change their ideology in response to IRA tweets, they also showed no change in their degree of partisanship, political engagement, or anger at the other side
privacy, sicurezza, spionaggio, virus
::: fabiochiusi

According to @Deeptracelabs 96% of #deepfake videos currently online are pornographic in nature. Many of these are related to gender-based violence #GBV, targeting women and vulnerable persons #16DaysOfActivism
deepfake
::: CHR_HumanRights

Ma tu pensa che c’è un tizio che riesce a sbarcare il lunario con ‘ste cazzate. Meglio, probabilmente ci diventa ricco
disinformazione, fake news, bufale | politica
::: marcocattaneo

Food production has been one of humanity's largest impacts on the environment
ambiente, ecologia
::: OurWorldInData


Safeguarding User Freedoms in Implementing Article 17 of the Copyright in the Digital Single Market Directive
copyright e brevetti | censura
::: CBlengio

in general, no credible evidence exists to support speculation about big fake news/Russia effects in 2016
disinformazione, fake news, bufale
::: fabiochiusi

Oggi su @valigiablu c'è un mio approfondimento su profilo e storia di #PhineasFisher o #HackBack, che dopo aver colpito aziende e governi ora vuole reclutare altri con una sorta di bug bounty cybercriminale
frodi
::: carolafrediani

Si torna a parlare di voto elettronico. Dopo che tanti altri Paesi del mondo lo hanno testato e bocciato. Tranne l'Estonia, ma il suo modello non è applicabile in Italia
privacy, sicurezza, spionaggio, virus | politica
::: MsmDimarco

La Casaleggio "è il problema numero uno, anche se non il solo, nel modo in cui i 5s funzionano", spiega Lamberts: "vogliamo che i partiti siano in modo democratico. I legami tra il M5S e la Casaleggio è abbastanza strano"
privacy, sicurezza, spionaggio, virus | politica
::: davcarretta

Guarda caso TikTok è cinese. Guarda caso
social media
::: yoshi979

Appena pubblicato l'ennesimo rapporto dell'ONU #UNEP su #emissiongap
ambiente, ecologia
::: cmnit

Cloudflare architecture and how BPF eats the world
cloud
::: brendangregg

What is China’s digital currency plan?
blockchain e crypto* | Cina
::: AleColarizi

In occasione della giornata internazionale contro la violenza sulle donne, rilanciamo le storie di chi sta cambiando la società, l'economia e la visione del mondo. #donne #finanza #etica #parità #gendergap #opportunità #25nov #lavoro #diritti
economia, lavoro | ambiente, ecologia | lavoro
::: Valori_it

So we have a “faster” algorithm to do multiplications. You would think that faster would mean “runs in less time”, but no. It is faster according to some model. That’s not what faster ought to mean! Should say “better computational complexity” if honest
algoritmi, codice
::: lemire


Finnish company we wrote about in January in our "Automating Society" report discontinued its activity after we sent questions to the country's ombudsman, @minruc reports
automazione
::: algorithmwatch

This is the most comprehensive guide I've seen for #k8s. It explains stack setup, functions, toolsets, workflow automation and even provides relatable use cases for hosting containerized applications
cloud
::: zuphzuph

Are electric vehicles really so climate friendly?
lo diventeranno sempre di più
energia | ambiente, ecologia
::: MauroV1968

A galactic algorithm is one that runs faster than any other algorithm for problems that are sufficiently large, but where "sufficiently large" is so big that the algorithm is never used in practice
algoritmi, codice
::: lemire

The Media’s Coverage of AI is Bogus. Claims that machine learning can predict sexuality, psychosis, and more are greatly overblown
machine learning
::: skdh

The Filmmaking Tech Behind 'The Mandalorian' Is Straight Out of the Star Wars Universe
innovazioni, futuro
::: Slashdot

La nostra capacità di attenzione è di nove secondi: come quella dei pesci rossi
Web, Internet | media
::: phretor

New Ruby Magic: Configurable Ruby Modules - The Module Builder Pattern
linguaggi di programmazione
::: AppSignal

Un esempio di come la creatività lotti con la censura nel 2019
censura
::: fabiochiusi

India's Ominous Future: Too Little Water, or Far Too Much
ambiente, ecologia
::: Slashdot

Cina | Tecnologia, distopie e rassicurazioni
dati, raccolta | tecnologia | Cina
::: ilmanifesto


Big Calculator: How Texas Instruments Monopolized Math Class
hardware
::: RadioProzac

To navigate the challenges raised by #AI, we must listen to the next generation
artificial intelligence
::: BKCHarvard

Microsoft does not always put its A team on the software updates
umorismo
::: lemire

Hier, lors du conseil municipal de #Marseille, @CPozmentier a détaillé les avancée de l'Observatoire Big Data de la Tranquillité Publique, un projet de police prédictive sans précédent en France
privacy, sicurezza, spionaggio, virus
::: technopolice_fr

Some HPE SSDs Fail After 3 Years and 9 Months, Company Warns
hardware | bug
::: Slashdot

Quanto costa un minuto di speech dell’Ad di #Huawei ad una convention aziendale? C’è una piccola società milanese che fattura appena 2 milioni che se lo può permettere di averlo come ospite. Indovinate quale? E soprattutto perché se lo può permettere? #Cina #viadellaseta
economia, lavoro | politica | Cina
::: BiondoNik

YouTube is now surfacing fact checks at the top of search in Brazil, the second country where this is happening after India
disinformazione, fake news, bufale
::: Mantzarlis

La terza stagione
#Marattin, marattinate, pensate farlokke
::: giannigipi ::: raistolo ::: evaristegal0is

Nigeria’s ‘fake news’ bill could jail people for lying on social media. Critics call it censorship
censura
::: _arianna

Energy consumption of (#AI) code is an increasing problem. Such approaches are important to measure and raise awareness. #responsibleAI is also reliable, emission conscious, develelopment
artificial intelligence | energia
::: vdignum

Building Your First Program Synthesizer
language Racket
::: SIGPLAN Blog

OpenMoji is an Open Source Emoji Set That Looks Awesome
applicazioni, programmi
::: dcavedon


Tips for #Java API
linguaggi di programmazione
::: mariofusco

Agda: strong support for generating the text with interactive commands, lots of short Unicode identifiers
linguaggi di programmazione
::: samth

I like the new Xmas "slug hunting" activity 👍
Twitter
::: WebReflection ::: HDblog ::: Dio

Members of the European Parliament were…highly susceptible to the influence of business interests, until public salience of information privacy increased owing to Edward @Snowden’s revelations
Edward Snowden
::: WolfieChristl

Microsoft Says 'Nobody's Asking For VR' -- Sony and Fans Fire Back
virtual reality
::: Slashdot

I bet you M. C. Escher would have loved JavaScript
linguaggi di programmazione
::: jviide

Amazon's Ring Planned Neighborhood 'Watch Lists' Built On Facial Recognition
riconoscimento facciale
::: Slashdot

Transport Canada Official Says 737 MAX MCAS System 'Has To Go'
privacy, sicurezza, spionaggio, virus
::: Slashdot

Indiana Manipulated Report On Amazon Worker's Death To Lure HQ2, Report Says
lavoro | economia, lavoro
::: Slashdot

Here a brief @slashdot post with relevant links about the machine-id privacy breach and the patch by @katolazwhich is now shipped with @DevuanOrg ASCII 2.1 point release
bug
::: jaromil

TIL GHC made a change to Arrow notation way back in 7.8 that basically destroyed the usability of one of its major features, and apparently Arrows are so maligned that nobody noticed or complained
programmazione funzionale
::: lexi_lambda


Given the novelty of the technology as well as the lack of experience and detailed studies on the impact of facial recognition technologies, multiple aspects are key to consider before deploying such a system in real life applications
riconoscimento facciale
::: fabiochiusi

EU’s #ePrivacy regulation is being subverted by publishers who want their “right” to use tracking cookies enshrined in law
copyright e brevetti
::: glynmoody

#Pythagoras tree (fractal)
matematica
::: Nereide ::: Matem@ticaMente

Facebook Was Mystery Firm Bidding Against Google To Buy Fitbit, Report Says
Facebook | Google
::: Slashdot

"Euclid’s Elements": the text of all 13 Books is complete, with all of the figures illustrated using the Geometry Applet
matematica | manuali, how to
::: Nereide

Facebook’s only Dutch factchecker quit over inability to fact-check politicians and ads. “The ‘final straw’ ... was when Facebook again pushed the factcheckers to reverse rulings against the far-right Freedom party (PVV) and FvD party”
Facebook | ad, pubblicità | politica
::: JaneLytv

It's Way Too Easy To Get a .gov Domain Name
privacy, sicurezza, spionaggio, virus
::: Slashdot

Altair version 3.3 released! This includes a number of bug fixes and enhancements, and will be the last release to support Python 2
Python
::: jakevdp

Xiao Bing è riuscita a conquistare il cuore del pubblico e ad allarmare nello stesso tempo l’establishment letterario. Ed è animata dall’intelligenza artificiale
artificial intelligence | Cina
::: simopieranni

Right-to-Repair Groups Don't Buy Apple's Answers To Congress
hardware | Apple
::: Slashdot

26 novembre, 2019

Bash scripts - cose che devo ricordarmi - 4


Ci sono cose che è bene ricordarsi per quando vengono a taglio (si capisce o è dialettale?), oggi continuo da qui.

La gestione delle stringhe

Sì, si può fare anche con Bash ma ci sono alcune particolarità come raccontate qui. Roba che provo a riassumere per vedere se ho capito.

Raccolgo le funzioni che mi sembra possano servire in un unico file st_def, questo:

# funzioni per la gestione delle stringhe

# st_len = lunghezza
#   st_len st (anche con spazi)         
function st_len {
    s="$*"
    echo ${#s}
}

# st_before = stringa prima di parole
#   st_before st w
function st_before {
    s="$1"
    w="$2"
    echo -n ${s%%$w*}
}

#
st_after = stringa dopo di parole
#   st_after st w

function st_after {
    s="$1"
    w="$2"
    echo -n ${s#*$w}
}


# st_index = posizione di parole nella stringa
#            per congruenza con st_len parte da 1
#   st_index st w
 

function st_index {
    s="$1"
    w="$2"
    s=${s%%$w*}
    echo $(( ${#s} + 1 ))
}


# st_insert = (st-base, sr-da ins, pos)
#             inserisce parole alla posizione pos
#             per congruenza con st_len parte da 1
#   st_insert st w pos

function st_insert {
    s="$1"
    w="$2"
    p=$3
    echo ${s:0:p}$w${s:p}
}

# st_subst = estrae p caratteri da inizio parola
#   st_subst st w p

function st_subst {
    s="$1"
    w="$2"
    p=$3
    t=${s%%$w*}
    #echo $s '-' $w '-' $t
    i=$(( ${#t} + 1 ))
    r=${s:$i-1:$p}
    echo $r
}

# st_zap = cancella zap nella stringa
#   st_zap st w

function st_zapst {
    s="$1"
    w="$2"
    p=$3
    t=${s%%$w*}
    i=${#t}   
    q=$(( i + p  ))
    r=${s:0:$i}${s:$q}
    echo $r
}


OK, posso passare ai test delle funzioni, nell'ordine con cui compaiono nella libreria (si può chiamare libreria? io intanto lo faccio).

Lunghezza della stringa (t-len):

#!/bin/bash

. st_def

echo $*
L=$(st_len "$*")
echo 'L='$L

test:

$ bash t-len 1234 6789 abcd f
1234 6789 abcd f
L=16

$


Parte della stringa fino a una (o più parole) (t-before):

#!/bin/bash

. st_def

t='inizio _p oi_ fine'
w=' _p oi'
echo $t
echo $w
res=$(st_before "$t" "$w")
echo '*'$res'*'

test:

$ bash t-before
inizio _p oi_ fine
_p oi
*inizio*
$


Parte della stringa dopo a una (o più parole) (t-after):

#!/bin/bash

. st_def

t='inizio _p oi_ fine'
w=' _p oi_ '
echo $t
echo $w
res=$(st_after "$t" "$w")
echo '*'$res'*'


test:

$ bash t-after
inizio _p oi_ fine
_p oi_
*fine*
$


Posizione di una parola all'interno di una stringa (t-index):

#!/bin/bash

. st_def

t='1234 6789 abcd'
w=' 6'
echo $t '--' $w
p=$(st_index "$t" "$w")
echo $p
w=' a'
echo $t '--' $w
p=$(st_index "$t" "$w")
echo $p
w='manca'
echo $t '--' $w
p=$(st_index "$t" "$w")
echo $p


test:

$ bash t-index
1234 6789 abcd -- 6
5
1234 6789 abcd -- a
10
1234 6789 abcd -- manca
15
$


Nota: se la parola cercata manca la funzione restituisce la lunghezza della stringa (bug?); forse sarebbe meglio se restituisse 0 o -1.

Insetimento di stringa alla posizione data (t-insert):

#!/bin/bash

. st_def

st='1234567890abcdef'
w=' _ otto _ '
p=8
echo $st
res=$(st_insert "$st" "$w" $p)
echo $res


test:

$ bash t-insert
1234567890abcdef
12345678 _ otto _ 90abcdef
$


Estrarre la sub-stringa lunga n caratteri dalla stringa (t-subst):

#!/bin/bash

. st_def

st='579 1234567890abcdef'
w='78'
p=4
echo $st
res=$(st_subst "$st" "$w" $p)
echo $res


test:

$ bash t-subst
579 1234567890abcdef
7890
$


Cancellare parte di una stringa (t-zap):

#!/bin/bash

. st_def

st='1234567890abcdef'
w='78'
p=4
echo $st
res=$(st_zapst "$st" "$w" $p)
echo $res


test:

$ bash t-zap
1234567890abcdef
123456abcdef
$


OK. Serve? forse, forse invece è solo per vedere che si può fare, educational. Ricordando che c'è sempre Python (e tanti altri linguaggi).
🔴

24 novembre, 2019

Visto nel Web - 451

Mentre piove, tanto, ecco cosa ho wisto nel Web.


They’re not exploiting data. They’re exploiting peopleprivacy, sicurezza, spionaggio, virus | ditte
::: StefSimanowitz

Ctrl-labs CEO: We'll Have Neural Interfaces In Less Than 5 Years
innovazioni, futuro
::: Slashdot

SQUID is a #drone developed by @Caltech and @NASAJPL that is ballistically launched from a cannon and then unfolds and transitions to stable flight
i robot che non mi piacciono; a meno che...
::: IEEESpectrum

+++ Ciascuno di noi è l'alfa e l'omega di Twitter
Twitter
::: goldbergvariaz

Microsoft is Testing Gmail Integration in Outlook.com
applicazioni, programmi
::: Slashdot

The man who oversaw the Top Secret investigation into my work in exposing the NSA's unconstitutional system of mass surveillance now believes "we are in a better place" because I came forward. He disputes the methods, but admits it was net-good. In another decade, I'll be home
Edward Snowden
::: Snowden

Google Earth Gets Content Creation Tools For Geography-Focused Presentations
tool, componente software
::: Slashdot

Tides are predictable and powerful. Now, a bright yellow buoy stationed off the coast of Oahu is ready to harness ocean waves as a power source
energia
::: IEEESpectrum

Most assuredly, in 10 years, AI will eliminate the job of coding in the very same way as did compilers the last 50 years
ovviamente da seguire il link
artificial intelligence
::: Grady_Booch

Intel is still struggling with the truth about its processor security flaws
hardware
::: lucaferrari15

Amazon and Code.org Tap Lil Nas X and Katy Perry To Teach Children To Code
scuola, educazione, cultura
::: Slashdot

“We now create more data every 48hrs than we did from the dawn of civilization to 2003.” @RVAwonk - “Forget the cliché ’if it’s free, you’re the product.’ You’re the abandoned carcass. The product derives fm the surplus ripped from yr life” @shoshanazuboff
dati, raccolta
::: StefSimanowitz


Amazon's Cloud Gaming Service Could Arrive Next Year With Twitch Integration
games
::: Slashdot

SpaceX's Prototype Starship Rocket Partially Bursts During Testing In Texas
spazio, esplorazione
::: Slashdot

5 Reasons Software Engineers are Artists
programming, codice, snippet
::: RichRogersIoT

Super cool. I used to be skeptical about blackbox testing because I had a real thing for precisely modeling the semantics of everything, but if you accept that real software is an unknowable mystery, then this is really The Way
sulla fiducia, non ancora visto
programming, codice, snippet
::: jeanqasaur

System76 Will Start Designing and Building Its Own Linux Laptops Beginning January 2020
hardware
::: slashdot

Trump hosted a secret dinner with Mark Zuckerberg Peter Thiel last month. This was the 2nd time time Zuck met with Trump in October, and it took place right as Zuck defended Facebook’s decision to let politicians buy the right to lie on its platform
Facebook | politica
::: RVAwonk ::: fabiochiusi ::: mat

- save me
umorismo
::: IrenaBuzarewicz

New York City Automated Decision Systems Task Force Report
artificial intelligence | automazione
::: fabiochiusi

so apparently the Linux mascot was almost a cool fox girl and everyone seems to have forgotten about her, so naturally i drew her!
storia | Linux
::: cathodegaytube

In the past year, 93% of people living in countries where federal elections were held were targeted by online interference at the hands of their own governments and/or other domestic operatives. Free and fair elections were the exception, not the rule
privacy, sicurezza, spionaggio, virus | politica
::: RVAwonk

Wondering if my keyboard is a she or a he or a they 🤔
un problema; io ce l'ho dai tempi dei/delle BBS
gender, discriminazioni
::: Gianlucadfiore


Interesting to see the notion of “bio power” applied to surveillance capitalism
privacy, sicurezza, spionaggio, virus
::: fabiochiusi

sometimes there is a need to state the obvious again & again: The @creativecommons licenses are not intended to put restrictions on works in the #publicdomain
open source
::: paul_keller

Trump 2020 is lobbying Facebook hard against changing the way ad targeting and custom audiences work (which would likely make their CPMs rise, and/or break some of their targeting tools)
Facebook | politica
::: kevinroose ::: ewarren

Sperimentazione in un ospedale di Baltimora: se arriva un ferito gravissimo, gli sostituiscono il sangue con una soluzione salina e lo raffreddano per due ore, in cui i chirurghi possono provare a salvarlo. Poi lo scaldano e lo rianimano
innovazioni, futuro
::: andcapocci

hink about this: we have fucked up copyright laws only to save fucking Mikey Mouse from the public domain
copyright e brevetti
::: thek3nger

We are not looking at a dystopian world because AI and data science are *already* widely used to build a dystopian (unfair, unjust, violent, oppressive, invasive, ...) present. The problem with AI is not robots taking over the world. Is increasing inequality
artificial intelligence
::: ipnosimmia

TUG is now a @github organization
programming, codice, snippet
::: TeXUsersGroup

a new JavaScript Sorcery post: The second part of our series about the history of JavaScript Errors
linguaggi di programmazione
::: AppSignal

Welcome to the future of the Internet in Iran: a “legal VPN”-based caste system
censura
::: fabiochiusi

Ok maxi down di Netflix, pare globale o comunque sovranazionale
Web, Internet
::: suzukimaruti

Interessante come “scrivere articoli di giornale” sia considerata la più umana e meno robotica delle attività, quando in realtà — pur se in certi campi specifici ed entro precisi paletti — è automatizzata eccome. E senza rimetterci granché
artificial intelligence
::: fabiochiusi


I know this is probably an extremely hot take, but my primary takeaway from studying Haskell effect systems intensely for the past couple months is that monads probably aren’t worth it
programmazione funzionale
::: lexi_lambda ::: PaniczGodek ::: lexi_lambda

Kubernetes for Full-Stack Developers
Should I stand in a queue for 30 minutes at this #Kubecon booth to get a Kubernetes book or should I leverage this excellent online resource?
applicazioni, programmi
::: rasharm_

Cloud computing: a story of incentives
cloud
::: lemire

It seems that I wrote yet another monad tutorial. Can you forgive me, the Internet?
descrizione inusuale (secondo me) ma ... OK, riporto
programmazione funzionale
::: PaniczGodek

Some years ago, @Cambridge_Uni put the papers of Sir Isaac #Newton online for the 1st time, including his own annotated copy of #PrincipiaMathematica, with notes and calculations in his handwriting revising the book and answering critics
storia
::: Nereide

Bill Gates Says Open Research Beats Erecting Borders in AI
open source | artificial intelligence
::: Slashdot

At #CyberwarCon, Google reveals new details about Russia’s GRU hackers known as Sandworm, including their role in French Election hacking, ongoing watering hole attacks, and perhaps most surprising, Android malware
cyberwar
::: a_greenberg

Inside Apple's iPhone Software Shakeup After Buggy iOS 13 Debut
bug | Apple
::: Slashdot ::: federighiOS

tep by step guide on how to integrate #Alexa with your #arduino #iot project
hardware
::: mastrolinux

Cyber security e asset strategici. Il piano del governo presentato a Milano
privacy, sicurezza, spionaggio, virus
::: phretor

“Everyone believes that their job will be the last job to be automated.” — R. David Edelman, director of MIT’s Project on Technology, Economy & National Security talks to Spectrum about AI’s coming impact on employment
robots, automazione, droni
::: IEEESpectrum


#Socialcommerce, Asia batte Silicon Valley con 10anni di vantaggio
economia, lavoro
::: LalaHu9

Tech twitter can be wonderful, but it’s also quite the bubble. Remember that the majority of developers aren’t on this platform! They’re not using, or possibly even aware of, this year’s newest popular platform or library. It can be easy to lose that perspective
Twitter | tecnologia
::: laurieontech

Twitter Says It Will Let All Users Hide Replies To Tweets
Twitter
::: Slashdot

Google Shakes Up Its 'TGIF' -- and Ends Its Culture of Openness
Google
::: Slashdot

To make progress on hard problems, stop caring what anyone thinks. Progress often depends on crazy people taking a first step into the unknown, disbelieved and disapproved by almost everyone else
innovazioni, futuro
::: fchollet

Google & Facebook have established control over the primary channels that most of the world relies on to engage with the internet. These platforms are no longer ‘optional’ in many societies, & using them is a necessary part of participating in modern life
Web, Internet | Facebook | Google
::: StefSimanowitz

Apple Pulls All Customer Reviews From Online Apple Store
è un bug o sono i bugs?
Apple
::: Slashdot

T-Mobile Reveals Data Breach Affecting Prepaid Customers
privacy, sicurezza, spionaggio, virus
::: Slashdot

Russia Bans Sale of Gadgets Without Russian-Made Software
censura
::: Slashdot

Finland Has an App Showing Shopping's True Carbon Footprint
ambiente, ecologia
::: Slashdot

More fun at Tesla Design Studio as we wait for the Cybertruck announcement #tesla #TeslaCyberTruck #Cybertruck @Tesla
umorismo
::: slashdot ::: slashdot ::: skdh


The Downside of Tech Hype - It makes it harder for scientists, engineers and policy makers to understand how technology is changing and make good decisions
tecnologia
::: skdh

Current status
umorismo
::: mariofusco

Saying cyber 3 times in front of a mirror will create a new blockchain start-up looking for funding
cit.
::: malwareunicorn ::: fchollet

To protect our core human values in the digital age – dignity, autonomy, privacy – there needs to be a radical overhaul of the way Big Tech operates, and to move to an internet that has human rights at its core
Web, Internet | privacy, sicurezza, spionaggio, virus
::: fabiochiusi

Yes that’s me. (In Dutch)
protagonisti
::: gvanrossum

Bold Space Mission To Bring Back Rocks From Mars Takes Shape
spazio, esplorazione
::: Slashdot

“All this hate and violence is being facilitated by a handful of internet companies that amount to the greatest propaganda machine in history” - Not sure at all the is actually the case (not even in what sense: Goebbels, anyone?), but it does show what @kevinroose is arguing here
odio, razzismo, discriminazioni
::: fabiochiusi

About the Init Systems GR, a letter to @debian and to all those who care https
Linux
::: jaromil

Tesla Cybertruck
tecnologia
::: mante ::: antirez ::: fabiochiusi ::: mante ::: Anthony ::: cedricgirard1 ::: TrumpDraws ::: nerdist ::: flglmn ::: umanesimo

Ehm ehm carissimi colleghi, NON "secondo lui" bensì secondo Garante Privacy che per questo l'ha sanzionata: “La piattaforma Rousseau non gode delle proprietà richieste a un sistema di e-voting”
privacy, sicurezza, spionaggio, virus | politica
::: OGiannino

'Not cool': telescope faces interference from space-bound satellites
spazio, esplorazione | scienza
::: skdh


Furto dati alla Pubblica Amministrazione, arrestato un hacker. Operazione della Polizia postale
privacy, sicurezza, spionaggio, virus
::: phretor

What can artificial intelligence do for physics? And what will it do *to* physics?
artificial intelligence | machine learning
::: skdh

Our special issue on 'Automation, Algorithms & News' is out in Digital Journalism
algoritmi, codice | novità | giornali, stampa
::: neilthurman

Are Neural Networks About to Reinvent Physics?
neural networks
::: PhilosophyMttrs

Technologies VS Clients
umorismo
::: garabatokid

Oxford Dictionaries Declares 'Climate Emergency' the Word of 2019
ambiente, ecologia
::: Slashdot

One-Third of Tropical African Plant Species at Risk of Extinction
ambiente, ecologia
::: Slashdot

As protests continue in Hong Kong, fears of online censorship have grown
censura
::: IEEESpectrum

We uncovered 2 Facebook pages managed from Ukraine that support Marine Le Pen and Jean-Luc Mélenchon – leaders of 2 major French political parties (far-right and far-left). They contain a substantial amount of disinformation
Facebook | disinformazione, fake news, bufale
::: DisinfoEU

I’ve been getting to work on something kind of neat for work recently: an `Arrow` that implements automatic incrementalization of Haskell functions. It’s kind of like `make`, but with ordinary Haskell values as dependencies and products rather than external resources
programmazione funzionale
::: lexi_lambda

Il “crimine” di Julian Assange: aver portato alla luce i crimini di guerra Usa
Julian Assange
::: ilmanifesto


AT&T Promises Low-Band 5G for 5 Cities in Weeks, 15 by Early 2020
5G
::: Slashdot

1.2 Billion Records Found Exposed Online in a Single Server
privacy, sicurezza, spionaggio, virus
::: Slashdot

Facebook Built a Facial Recognition App That Let Employees Identify People By Pointing a Phone at Them
riconoscimento facciale
::: Slashdot

Sacha Baron Cohen Gave the Greatest Speech on Why Social Networks Need To Be Put On Check
disinformazione, fake news, bufale | social media
::: Slashdot

DOD Joins Fight Against 5G Spectrum Proposal, Citing Risks To GPS
5G
::: Slashdot

Federal Court Approves First 'Pirate' Site Blockade In Canada
pirateria
::: Slashdot

Write tests devs .... write tests! types *alone* won't help you create better software
programming, codice, snippet
::: WebReflection

KiCad joins the Linux Foundation
Linux
::: kicad_pcb

I really enjoy the new Pokémon
games
::: thek3nger

NYC Creates a High-Level Position To Oversee Ethics In AI
artificial intelligence | etica
::: Slashdot

Why the Electric-Car Revolution May Take a Lot Longer Than Expected
energia
::: Slashdot


Groq Announces World’s First Architecture Capable of 1,000,000,000,000,000 Operations per Second on a Single Chip
hardware
::: skdh

Ok, this is devastating. It seems that almost the whole database of People Data Labs, a MASSIVE data broker who claims to have detailed profiles on 1.5 billion people, was left open on the Internet
privacy, sicurezza, spionaggio, virus
::: WolfieChristl

Alphabet's Loon Balloons Will Provide Internet To Remote Parts of the Amazon Next Year
Web, Internet
::: Slashdot

Aside from #ICANN allowing this corporate capture as regulator, #ISOC is clearly not acting in the public interest either by deciding to sell the .org domain. If you feel that the commercialization of the Internet has gone too far, this right here is what drives it.
Web, Internet
::: Senficon

Together with the @wef, @sciam convened an international Steering Group of leading #technology experts and engaged in an intense process to identify this year's “Top 10 Emerging Technologies”
tecnologia | innovazioni, futuro
::: Nereide

Corporations see the brain as key arena for profit. To say the least, this could be a boon for surveillance capitalism & authoritarian dictatorships
artificial intelligence | politica | etica
::: EvanSelinger

Volkswagen Axes All Non-Electric Racing Programs Worldwide
energia
::: Slashdot

Escludere dal portafoglio degli investimenti le compagnie del comparto #fossile. È l’indicazione dell’ente europeo incaricato di stilare le linee guida per il settore della finanza responsabile
politica | ambiente, ecologia | economia, lavoro
::: Valori_it

I agree with this. I would like to see more pirates 🏴 and projects being run by anonymous people. Problem is, it's hard to raise money without a face
programming, codice, snippet | open source
::: Alexintosh

Facebook Teams With Microsoft On Visual Studio Code's Remote Extensions
applicazioni, programmi | programming, codice, snippet
::: Slashdot