Archivio autore: juhan

Visto nel Web – 346

Tempi difficili, i disperati nel mare e adesso anche l’Europa che tenta di censurare Internet (ho lasciato tanti links per darmi coraggio) e poi — insomma ecco cosa ho wisto nel Web.

Microsoft Program Manager Mistakenly Tweets Office 365 Will Be Rewritten in JavaScript
linguaggi di programmazione
::: Slashdot

Happy birthday to IBM! 107 years old today
storia
::: RichRogersIoT ::: RichRogersIoT

Eric Raymond Shares ‘Code Archaeology’ Tips, Urges Bug-Hunts in Ancient Code
privacy, sicurezza, spionaggio, virus
::: Slashdot

‘Open Source Security’ Loses in Court, Must Pay $259,900 To Bruce Perens
open source
::: Slashdot

Facebook and Google must do more to support Wikipedia
Web, Internet
::: emenietti

une violation de copyright -> compte extrèmement populaire suspendu. Réaction disproportionnée, tolérance zéro, droits de la défenses inexistants. Belle application du futur article 13 et de ses atteintes à la liberté d’expression #CensorshipMachine #SaveYourInternet
copyright e brevetti
::: Pyb75

Elixir per idioti /4, definire moduli e funzioni
linguaggi di programmazione
::: dottorblaster

Timely, a secure time series database. From the NSA
open source
::: mikko

Facebook doesn’t want you or Congress to learn what’s it’s discovered happening inside its platform. Hmm wonder why
Facebook
::: chrisinsilico

Deepin 15.6 Released, Features New App Menu, Dark Mode, & More
distro
::: dcavedon

Microsoft’s failed attempt on Debian packaging
bug
::: nixcraft

Cr3dOv3r v0.3 – Know The Dangers Of Credential Reuse Attacks
privacy, sicurezza, spionaggio, virus
::: xKaliSec

I just published “Perché ho deciso di lasciare Twitter e Facebook”
doh! la stessa cosa che ho fatto questa mattina, prima di leggere questo post; e sì, i social troppo seguiti mi rendono depresso
social media
::: AlfonsoFuggetta ::: MartaEcca

Gmail Proves That Some People Hate Smart Suggestions
tip, suggerimenti
::: Slashdot

Trust in the news media dips lowest in Spain, France, the UK and Italy
media
::: pewresearch

Fears mount over WhatsApp’s role in spreading fake news
caos informativo, fake news, bufale
::: fabiochiusi

Gaming Companies Remove Analytics App After Massive User Outcry
privacy, sicurezza, spionaggio, virus
::: Slashdot

Write fast apps with Pronghorn, a Java framework
linguaggi di programmazione
::: cialunet

5 open source alternatives to Dropbox
open source
::: cialunet

@Microsoft explicitly and proudly supporting ICE is shocking
privacy, sicurezza, spionaggio, virus
::: yonatanzunger

On The Sad State of Macintosh Hardware
hardware | ditte
::: nicolaiarocci

Censorship 2.0 is based on the idea that there are three ways of achieving the government’s desire to keep information from the public – fear, friction and flooding
censura
::: fabiochiusi

By requiring Internet platforms to perform automatic filtering all of the content that their users upload, Article 13 takes an unprecedented step towards the transformation of the Internet (…) into a tool for the automated surveillance and control of its users
censura
::: fabiochiusi ::: fabiochiusi ::: _C4C_ ::: creativecommons ::: communia_eu ::: communia_eu ::: communia_eu ::: UBports ::: communia_eu ::: fabiochiusi ::: fabiochiusi ::: communia_eu ::: communia_eu ::: _C4C_ ::: cdteu ::: jimmy_wales ::: WikimediaItalia ::: SebJabbusch ::: EFF ::: wikimediapolicy ::: UgoMattei ::: TI_EU ::: Senficon ::: fabiochiusi ::: communia_eu ::: LIBEReurope ::: EFF ::: communia_eu ::: Senficon ::: DiEM_25 ::: communia_eu ::: Slashdot ::: communia_eu ::: communia_eu ::: fabiochiusi ::: DiEM_25 ::: jaromil ::: Senficon ::: creativecommons ::: yoshi979 ::: eduint ::: laura_nobilis ::: mante ::: UBports ::: WikimediaItalia ::: LIBEReurope ::: valigiablu ::: fabiochiusi ::: Senficon ::: mtorchiano

Rails is the most popular web framework in Silicon Valley by job openings
linguaggi di programmazione
::: epfl_exts

HackUp is a Desktop Hacker News Client for Linux
Web, Internet
::: cialunet

Discover why and how @SWHeritage is an essential infrastructure in the scholarly ecosystem
storia
::: moraneottilia ::: carlopiana ::: nayafia

How to Install Deepin Desktop Environment on Ubuntu 18.04
tools, componenti software
::: omgubuntu

LibreOffice’s user interface is as simple or as flexible as you want. Looking for something minimal?
applicazioni, programmi
::: libreoffice

YouTube Videos From Some High-Profile Channels Have Disappeared
social media
::: Slashdot

75% of Malware Uploaded on ‘No-Distribute’ Scanners Is Unknown To Researchers
privacy, sicurezza, spionaggio, virus
::: Slashdot

Plasma 5.13 is here: faster and sleeker; more control (stop & start media playing in browsers from the desktop, open & close vaults from KDE Connect, easily configure external monitors); more beautiful (blurs, transparencies, improved icon integration)
tools, componenti software
::: kdecommunity

Introducing Brown Water Python: Better Docs for the Python tokenize Module
Python
::: asmeurer

Hewlett-Packard Fourier Analyzer 5451A
storia
::: Rainmaker1973

The ‘World’s Worst’ Smart Padlock Is Even Worse Than Previously Thought
privacy, sicurezza, spionaggio, virus
::: Slashdot

Android Messages Will Now Let You Send Texts From Your Computer
dispositivi mobili
::: Slashdot

HPE Announces World’s Largest ARM-based Supercomputer
hardware
::: Slashdot

iOS 12 Will Automatically Share Your iPhone Location With 911 Centers
privacy, sicurezza, spionaggio, virus
::: Slashdot

the complete text of “Functional Data Structures”
programmazione funzionale | manuali, how to
::: plragde

how I use Wireshark
debug
::: b0rk

When I was 13, I lived in rural Montana, and learned C by checking out books from a public library 80 km away
programming, codice, snippet
::: jdegoes

Roaring Bitmaps in JavaScript
linguaggi di programmazione
::: lemire

The Ultimate List of Python YouTube Channels
Python | manuali, how to
::: nicolaiarocci

Forty percent of those surveyed had deleted at least one social media account in the past year because of privacy concerns and 62 percent wanted more regulation of such platforms
privacy, sicurezza, spionaggio, virus
::: fabiochiusi

Theorem Proving for All (Haskellers): math equational proofs are expressed as Haskell functions!
programmazione funzionale
::: nikivazou

Doing some research: if you are in tech and received any education (a degree, bootcamp, course, etc.) in computer science, IT, web development, design and so on, did it include ethics as a subject?
scuola, educazione
::: fox

Draft rewrite of @pyramidlang ‘s EVM generator in (untyped) StackLisp
language Racket
::: TheMichaelBurge

Starting today, schools can access our enterprise-level software and features for free by joining the new @GitHubEducation program
scuola, educazione | programming, codice, snippet
::: github

My answer to Which type of programming would you prefer? Object oriented or functional programming? Why?
non semplice, anzi… però ci sono cose in cui mi ritrovo
linguaggi di programmazione | programmazione funzionale
::: PaniczGodek

Opening the doors of the Software Heritage archive
storia
::: OpenSourceOrg

Amazon Brings Alexa To Hotels
Web, Internet
::: Slashdot

Most used hacking techniques
privacy, sicurezza, spionaggio, virus
::: xKaliSec

China-based Campaign Breached Satellite Operators, Defense Contractors and Telecommunications Companies in US: Symantec
privacy, sicurezza, spionaggio, virus
::: Slashdot

Happy #FreeBSDDay everyone!
sistemi operativi
::: freebsdfndation

Learning operating system development using Linux kernel and Raspberry Pi
sistemi operativi
::: b3h3m0th

Microsoft Employees publish Open Letter To Protest Work With ICE
privacy, sicurezza, spionaggio, virus
::: sheeraf

BOLT – a Binary Optimization and Layout Tool – to help you optimize the performance of your Linux binaries
programming, codice, snippet
::: fbOpenSource

Sul plurale degli anglicismi: conoscenza dell’inglese o ignoranza dell’italiano?
io spero che Licia (che seguo su Twitter e raccomando) non scopra mai il mio blog 😐
Web, Internet
::: terminologia

OpenBSD Disables Intel CPU Hyper-Threading Due To Security Concerns
privacy, sicurezza, spionaggio, virus
::: Slashdot

Mosh: the mobile shell
#mob
::: nicolaiarocci

The @RemminaProject is moving to #gitlab , please don’t use anymore the #github repository
open source
::: RemminaProject

I wanted something better than “You’ll get used to the parentheses”
language Racket
::: alamajesse

Tito Livio Burattini e il mistero della calcolatrice
storia
::: Mr. Palomar

Cool analysis of programming language & JavaScript framework trends using a contingency table
vecchio, non se ancora valido ma intrigante
linguaggi di programmazione
::: drdavidawheeler

Gäel Duval, who created Mandrake Linux, is now working on anopen-source version of Android named ‘eelo’ (say it with a French accent) to get around Google’s @Microsoft-like grip on hardware vendors
dispositivi mobili
::: upFronteZine

I have a better idea: instead of charging users for subscribing to Facebook groups
Facebook
::: evgenymorozov

using Node.js johnny-five and raspi-io modules on a Raspberry Pi running @ArchLinuxARM it now trivial at all, if you don’t know what misses. Here a quick guide to bring you there, using the gorgeous @adafruit 128×32 PiOLED up and running in a few commands
sistemi operativi | hardware
::: WebReflection

we give you a fake cookie for leaving your workstation without locking it!
privacy, sicurezza, spionaggio, virus
::: Sipu79

In retrospect, this whole Cambridge Analytica scandal looks like free PR for Facebook
Facebook
::: evgenymorozov

Facebook Will Harass You Mercilessly If You Try To Break Up
Facebook
::: Slashdot

Facebook is starting to let Group admins charge $4.99 to $29.99 per month for access to special sub-Groups full of exclusive posts
Facebook
::: fabiochiusi

Facial recognition is increasingly penetrating our lives, but there is still time to prevent it from worsening social inequalities
privacy, sicurezza, spionaggio, virus
::: medialab

Rust 1.27 is here! SIMD, “dyn Trait” and book search, among other improvements!
linguaggi di programmazione
::: rustlang

Ransomware Update: Viruses Targeting Business IT Servers
privacy, sicurezza, spionaggio, virus
::: FinCyber

Fake Fortnite Android Apps Spread Across Internet
games
::: Slashdot

Facebook is now employing natural learning processing systems to detect duplicate fake news stories on the platform that fact-checkers have already debunked
caos informativo, fake news, bufale
::: fabiochiusi

Algeria shuts down internet to prevent cheating during high school exams
Web, Internet
::: helminoman

This is what happens when speech gets outsourced to Twitter and Facebook — FB blocks news stories because they look like ads, Twitter blocks people for linking to a news story
social media
::: mathewi

This writeup of my #LibrePlanet2018 keynote on @boingboing is more eloquent and concise than the talk
open source
::: makoshark

The US Startup Is Disappearing
economia
::: Slashdot

Nintendo and Microsoft Team Up To Promote Cross-Play, While Sony Remains Silent
games
::: Slashdot

A really neat way of building web UIs that communicate ‘work in progress’ — web components that render like hand drawings, and different every time!
Web, Internet
::: _wilfredh

How Twitter Made the Tech World’s Most Unlikely Comeback
Twitter
::: Slashdot

Ananny suggested that Facebook share the algorithms used by its machine learning systems, what data those systems are trained on, & whether systemic errors have been identified within them
Facebook
::: ananny

Employee activism keeps spreading in tech—now Amazon employees are calling on the company to stop selling Rekognition to law enforcement and to boot Palantir from AWS
ditte
::: kateconger ::: Matt_Cagle

How to implement laziness in #Java
linguaggi di programmazione
::: java

A first look at desktop metrics
Ubuntu
sistemi operativi | distro
::: cialunet

Here’s my write up on interactive Altair charts
Python
::: mkudija

“A Case Study in Not Being A Jerk in Open Source”, wherein I rewrite a Linus Torvalds email to be half as long, still clear and forceful, with none of the insults
how to
::: garybernhardt

Maurizio Ferraris, che da tempo porta avanti la sua idea dell’importanza centrale delle registrazioni documentali nell’evoluzione delle società umane, ha scritto un breve saggio sull’era documediale
Web, Internet
::: cmnit

Meanwhile #riotta è ancora lì da oggi pomeriggio che cerca d’inventarsi fonti
caos informativo, fake news, bufale
::: mazzettam

China Will Partly Lift Internet Censorship For One of Its Provinces To Promote Tourism
censura
::: Slashdot

automatic heap layout manipulation and arrangement for memory corruption exploitation
privacy, sicurezza, spionaggio, virus
::: _argp

Facebook Messenger Kids App Is Expanding
social media
::: Slashdot

Lingua italiana, così evolve sui social network
social media
::: cmnit

cargo-edit 0.3 is out – and very close to a perfect `cargo add foo` experience!
linguaggi di programmazione
::: killercup

Good scoop from @Kantrowitz on Facebook building a red team to go and look for the bad shit before it happens
Facebook
::: sheeraf

How to Do Code Reviews Like a Human
programming, codice, snippet
::: wallingf

Red Hat Changes Its Open-Source Licensing Rules
distro
::: Slashdot

Annunci

AI, innovazioni e blockchain – 27

Ecco qui a lista del venerdì (uh! la rima?) 💥

The CIA ‘Can Neither Confirm Nor Deny’ It Has Documents on Satoshi Nakamoto
blockchain e crypto*
::: Slashdot

There’s more than one kind of qubit—in fact, there are at least six or seven, and about half are now being considered for various forms of quantum computing
quantum computing
::: IEEESpectrum

Very little is known about AutoLab AI, a startup working on the “future of autonomous manufacturing.” But one recent report says it has 400 employees and a big pile of cash
automazione
::: IEEESpectrum

Intelligenza artificiale, 52 persone nella task force per l’#etica della @EU_Commission tra cui 4 italiani
artificial intelligence
::: annamasera

Elon Musk’s Boring Company wins a major contract to install an underground rapid-transit link that will whisk passengers from downtown Chicago to O’Hare Airport
innovazioni, futuro
::: IEEESpectrum ::: emenietti

Self-Driving Cars Likely Won’t Steal Your Job (Until 2040)
automazione
::: Slashdot

DeepMind Self-training Computer Creates 3D Model From 2D Snapshots
artificial intelligence
::: Slashdot

Anti-electricity cartoon from 1900
innovazioni, futuro
::: 2x2sometimes5

Alphabet wouldn’t say how its new computer vision system might be used commercially, but @pross356 sees potential for surveillance, self-driving cars, and home robots
artificial intelligence | robots | privacy, sicurezza, spionaggio, virus
::: IEEESpectrum

So proud of my former PhD student now Professor of AI Olga Russakovsky @Princeton ! This is a great story of her journey, including her work in ML fairness, @ai4allorg and more ❤
prof Fei-Fei –se posso permettermi– compila meglio i tweets; ma OK 😋💥
artificial intelligence
::: drfeifei

why we should be excited for robots to take our bullshit jobs
robots
::: ericallenbeen

Come garantire che la tecnologia sia al servizio dell’uomo e della società?
innovazioni, futuro
::: valigiablu

Over the last 6 months, Bitcoin has lost 2/3 of it’s dollar value
blockchain e crypto*
::: mikko

The larger credit for the deep learning revolution has always [gone] to faster & larger computers, & … larger datasets. But if you ask researchers…in the field of #MachineLearning, they will point to the real hero of the revolution: open access
machine learning | open source | media
::: petersuber

He’s focused on creating new digital tokens — crypto coins that are offered through ICOs. Thus his interest in the ‘deplorables coin
Steve Bannon
blockchain e crypto*
::: FrankPasquale

We haven’t yet solved even 10% of the problems we could solve with existing AI/ML techniques
artificial intelligence
::: fchollet

We see the future of financial services taking place on open and permissionless ledgers, with technologies like digital assets, currencies and Blockchains and we are very actively exploring what this may mean for Fidelity
blockchain e crypto*
::: RichRogersIoT

Rise of the machines: has technology evolved beyond our control? – abridged excerpt from @jamesbridle’s ‘New Dark Age’
innovazioni, futuro
::: fabiochiusi

An AI determined this to be the most likely final #WorldCup18 bracket
artificial intelligence
::: MIT_CSAIL

Venmo Is Going All In On Mobile Payments
dispositivi mobili
::: Slashdot

Agree with the sentiment, but undermined democracy, discrimination/bias, or wealth inequality have been flourishing, particularly in the US, without the “help” of AI
artificial intelligence
::: marcelsalathe

Norway Tests Tiny Electric Plane, Sees Passenger Flights by 2025
innovazioni, futuro
::: Slashdot

A Visual Introduction to Machine learning — Part II is finally here! Hope you enjoy learning about Bias and Variance
machine learning
::: r2d3us

the number of bicycles entering the city center each day vs. the number of cars
innovazioni, futuro
::: awalkerinLA

Google Is Training Machines To Predict When a Patient Will Die
machine learning
::: Slashdot

President Trump Directs Pentagon To Create New ‘Space Force’ Military Branch
politica
::: Slashdot

Kickstarter Bets On ‘Wired’ Arduino-Compatible IoT Platform
Internet of things
::: Slashdot

IBM has developed a debating AI system
artificial intelligence
::: rasmus_kleis

e-Lite News: Presentation: “Easing IoT Development for Novice Programmers Through Code Recipes”
Internet of things
::: fulcorno

Emerging Trends in Financial Services: IoT, AI and Blockchain
Internet of things | blockchain e crypto*
::: cialunet

Nature just published a major feature on researchers working on bias in machine learning
machine learning
::: katecrawford

In the future, the cost of a product may need to include annual security updates and patches
Internet of things
::: IEEESpectrum

Humans Can Now Correct Robots With Brainwaves
robots
::: Slashdot

Facebook Is About To Bring The Hammer Down On Overseas Fake News Operators
caos informativo, fake news, bufale | Facebook | machine learning
::: fabiochiusi

Sweet, il Lisp e le parentesi

Io Twitter lo lovvo, assay ❤️ e quando trovo roba che m’ispira poi ne scrivo qui sul blog. Come il recente post Ricorsività e specialità.

Devo vedere Sweet concludevo e allora ecco cosa ho trovato.

La home di Sweet su SourceForge lo presenta come Readable Lisp/S-expressions with infix, functions, and indentation, brought to you by dwheeler.

Uh! chi è l’autore? Eccolo: David A. Wheeler, trovato via Twitter dove posta poco ma rockz! 💥

Le caratteristiche del progetto sono:

  • Infix notation, e.g., {3 + 4} in addition to (+ 3 4)
  • Optional traditional function notation, e.g., f(...) in addition to (f ...)
  • Optional indentation support greatly reduces the need for parentheses
  • Works on any data or program (it is general and homoiconic)

Poi c’è la pagina della Wiki, dice tutto (ahemmm…) e riporta un esempio molto simile a quello di Michael da cui sono partito nel post precedente.

La versione ortodossa della funzione fattoriale:

(define (factorial n)
  (if (<= n 1)
    1
    (* n (factorial (- n 1)))))

e quella Sweet:

define factorial(n)
  if {n <= 1}
    1
    {n * factorial{n - 1}}

Tolte tutte le parentesi tonde tranne quelle per il passaggio degli argomenti. Uso delle graffe per la notazione infissa.

È più leggibile? forse, dipende dall’abitudine.
Personalmente penso a come costruisco una funzione Lisp (in realtà per me Racket) dal di dentro, le parentesi le apro sempre in copia, così () e sulla carta. Poi nell’ambiente DrRacket, ma anche tanti altri editors, viene indicata la corrispondente aperta/chiusa.

Anche sulla notazione infissa rispetto alla prefissa sono indeciso:

ecco, non è la notazione cui siamo abituati, quella che ci insegnano nella scuola; invece:

😉 Che poi è questione di convenzione, esempio:

e

e anche

Ammetto che dc oggi è solo una provocazione. O no? le calcolatrici HP, la mitica 11c.

Concordo con Jesse Alama, qui (non ho trovato il cinguettio cui si riferisce), e qui, con un opportuno adattamento: sed 's/God/FSM/'.

cit. & loll – 101

La solita rassegna, cit.osa e lollosa come  non mai  al solito 😜

My open source projects are normally of inestimably better quality than the code I write when I have managers constantly asking if it’s done yet
::: bodil

tiny brain: “let’s use machine learning”
::: emilyst

Read other people’s code and ‘steal’ the good parts
::: CodeWisdom

Customer Rewards
::: xkcd

The power of symbols!
::: vardi

A large part of being a programmer
::: ScribblingOn

Soooooo many cool languages
::: lunaryorn

The new New Yorker cartoon
::: MarkDiStef

When interviewing at a company, can I ask to look at some of their code?
::: lynncyrin

The Boy Scout Rule
::: RichRogersIoT

New programmers are often uncertain if they will ever be good enough
::: mpjme

Companies rarely die from moving too fast
::: RichRogersIoT

I knew it was only a matter of time until I was introduced to the wonderful world of CSS
::: asmeurer

If books had a 280 character limit
::: PreetBharara

1/ The scooter startups are way more important than you think
::: andrewchen

buzzwords unite!
::: jeffbigham

Awww 🙂 It’s a privilege to be advisor of amazing students like you, Justin! I learn new things everyday from you and my other students! ❤
certi prof! 💥❤️😁
::: drfeifei

The Peter Principle Revisited
::: JohnDCook

The most important single aspect of software development
::: CodeWisdom

It’s rarely good to ask “how could things get any worse?” around an engineer
notevole tutto il thread
::: yonatanzunger

A real craftsman doesn’t complain about his tools
::: sgoguen

adding the full javascript library to use one function
::: kvlly

password requirements
::: lindseybieda

No one will ever complain that
::: RichRogersIoT

You young whippersnapper! When I was your age, I wrote entire applications in 48K of RAM and they responded instantly
::: burgerbecky

I forced a bot to watch over 1,000 hours of television and then asked it to write an episode of its own
::: peterseibel

Smart vs. hard is a false dichotomy
::: mmay3r

“Cosa c’è nel mio iphone”
::: Genjuro75

The company that sent me the pictured fingerprint lock has provided the security quote of the year
::: LockPickingLwyr

I bet if Socrates were alive today
::: existentialcoms

I have been writing software for damn near 20 years
::: kscottz

Most of the interesting, useful, and thoughtful work in the world
::: practicingdev

Have never met a Marxist who didn’t attend a private school
alle volte il muschio di Elona (il traduttore lo chiama così) e i suoi amici non sono come vorrei; c’è però tutto il thread
::: clairlemon

So I recently completed a physical pentest. Was going to live tweet it
::: TinkerSec

when you need a calculator when working on the command line, what program do you open?
::: pgbovine

Rolling your own encryption
::: MisterCh0c

Computer programming has always been a self-taught
::: CodeWisdom

Me trying to learn a new programming language or operating system
::: nixcraft

My advice to programmers
::: vaurorapub

Thank you for all of your feedback
::: JonyIveParody

Half of engineering is how to make the thing work well
::: dan_abramov

It is kind of amazing that Elon Musk
non so se è davvero divertente; io in questo momento, depresso, penso di sì
::: robertwiblin

Once I loved Twitter at early morning, before the Italians woke up, when mostly Americans were tweeting
::: Gianlucadfiore

“I wanted something better than “You’ll get used to the parentheses”. The standard explanation is “homoiconicity”
::: alamajesse

Lo abbiamo trovato!UNO!1! Clicca qui!!!1!!11
::: DavidPuente ::: laura_nobilis

Woman Who Doesn’t Use Facebook Completely Out Of Touch With Friends’ Prejudices
the Onion, nèh!
::: TheOnion

This software is written in C
::: hdevalence

#MondayMotivaton
::: lizardbill

#microsoft is using ai
::: thecrazyprogrmr

Asking what is the best programming language is like asking what is the best chess move
::: CompSciFact

Functional programming serenity prayer
::: alamajesse

The test didn’t fail. The *product* failed
::: RichRogersIoT

Can car manufacturers survive the cost of including seatbelts and airbags?
::: v0max

maybe about once a week I give some thought to the reality
::: Aelkus

on the cover of the latest TIME Magazine
::: mikkotweets2013

Wonderful cartoonist @tomgauld teaches us new terminology for the digital age
::: simongerman600

Lab Assistant Wanted
::: newscientist

Blockchains and Haskell programmers
::: runarorama

Definition: A “set” is a collection of objects
::: FactsOfMath

Calcoli al volo

when you need a calculator when working on the command line, what program do you open?” ci chiede Philip Guo, qui.

Uh! intrigante 💥😁 Prima di dire cosa uso io sento le risposte, prevedo cose impreviste 👽 e interessanti 😁

Jphn Regehr va sul difficile gdb, il debugger di Gnome.

Mate Soos dice IPython (mi sa che devo approfondire) e bc (anche questo da approfondire) dentro gli scripts bash.

Hal Daumé III dice, oltre a IPython, ghci. Uh! Haskell:

* cl-calc $ gi
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Prelude> 3 + 5
8
Prelude> 3 + (4 * 5)
23
Prelude> 3 + 4/3 * 5
9.666666666666666

gi è un alias personale, da über-pigrolazy:

* cl-calc $ alias gi
alias gi='ghci'

Funziona, devo lanciare GHCi, non posso (o non so come fare) a eseguirlo direttamente nel terminale. Per IPython c’è una dritta di Vegard Stikbakke sulla configurazione da valutare se si prevede di adottarlo.

Rich Felker (di cui dovrei approfondire la conoscenza) va direttamente con bash, senza trascurare FTW. OT ma ci cuole, imho: recentemente mi hanno suggerito Terminologia etc. utile anche in questo caso.

* cl-calc $ echo $(( 3 + 5 ))
8
* cl-calc $ echo $(( 3 + (4*5) ))
23
* cl-calc $ echo $(( 3 + 4 * 5 ))
23
* cl-calc $ echo $(( 3 + 4/3 * 5 ))
8

OOPS! non funziona la divisione. Cioè si ma solo per interi con troncamento quindi 4/3 vale 1.

Anticamente (diciamo 50 anni fa) il problema era noto e aveva una soluzione empirica, lavorare sui centesimi, ne parla anche Rich. Vediamo se mi ricordo come facevo:

* cl-calc $ echo $(( 7 / 3 ))
2

è impreciso, opero così:

* cl-calc $ echo $(( 700 / 3 ))
233

da leggersi come 2.33 come 700 stava per 7; opero sui centesimi; casi simili sono quelli dei decimi, millesimi e altri a piacere. OK, il nome corretto è “a virgola fissa” (se ricordo bene, è passato un po’ di tempo (e di moda)).

C’è chi ha sempre Emacs aperto p.es. Daniel Dunbar. Sì, la soluzione per quelli che hanno visto la luce (almeno limitatamente al ‘puter) e sanno che Emacs è un OS, non un editor.

Per altri c’è Google

Chris Palmer (uno da approfondire) è per expr, una versione sua modificata che purtroppo non ci mostra. La versione bare ha l’usuale problema di dover escapare i caratteri speciali:

* cl-calc $ expr 3 + 5
8
* cl-calc $ expr 3 + 5 * 4
expr: errore di sintassi
* cl-calc $ expr "3 + 5 * 4"
3 + 5 * 4
* cl-calc $ expr 3 + 5 \* 4
23

e vale solo per gli interi:

* cl-calc $ expr 3 + 5 \* 4/3
expr: argomento non intero

Altre risposte, c’è chi usa Octave, chi questa:

Brendan Dolan-Gavitt (uh! 👽) è un nerd serio:

* cl-calc $ awk 'END { print sqrt(2) }' /dev/null
1.41421
* cl-calc $ awk 'END { print 2 + 3 * 4  }' /dev/null
14
* cl-calc $ awk 'END { print 2 + 3 * 4/5  }' /dev/null
4.4

Contrariamente a quel che ne pensa il prof (sì è prof) il metodo potrebbe essere sviluppato.

Salto chi dice cose com R o CL. Stephen Checkoway (RTs of cats are endorsements) propone la costruzione di una funzione (richiede Perl) e un alias per lanciarla. Funziona, eccone una versione semplificata, in forma di script (sc-ev):

#!/bin/bash

eval_helper() {
    bc -ql <<< "$@"| perl -pe 's/(\.[^0]+)0+$|\.0+$/$1/'
}

eval_helper "$@"
* cl-calc $ bash sc-ev "12 - 2 * 3"
6
* cl-calc $ bash sc-ev "12 - 2 / 3"
11.33333333333333333334

Stephen usa anche calc, devo parlarne.

Kristopher Micinski (anche lui prof, anche lui da approfondire) sgrida un po’ tutti, anche me suppongo.

Salto risposte varie, sensate e no, imho e arrivo a Sam King: dc, but seems like I should check out bc.

* cl-calc $ dc -e "2k 3 4 5 / + p"
3.80

I macisti hanno i loro tools, salto. C’è chi usa irb (Ruby), MatLab (versione onero$a di Octave), R (già detto) e Python.

* cl-calc $ py3 -c "print(3 + 5)"
8
* cl-calc $ py3 -c "print(3 + 5/2)"
5.5

sì ho l’alias (anche se in questo caso non serve):

* cl-calc $ alias py3
alias py3='python3 -q'

Noto che nessuno ha nominato Excel (è, per qualcuno, quasi un OS, come Emacs) merito di Twitter che ti consente di scegliere i tweeps giusti e con il passaparola il loro numero tende a crescere esponenzialmente.

La mia soluzione? calc.

* cl-calc $ calc "3 + 4 * 5 / 6"
	6.33333333333333333333
* cl-calc $ calc "pi = 4 * atan(1); 2 * pi * 10"
	62.8318530717958647696
* cl-calc $ calc "pi = 4 * atan(1); pi * 10^2"
	314.159265358979323848

Le virgolette? non sono necessarie se non si lasciano spazi:

* cl-calc $ calc 4 * 5
Missing operator

Error in commands
* cl-calc $ calc 4*5
	20

Ricorsività e specialità

Dell’ottimo Michael Burge 💥 non so molto; lo si trova su Twitter, ha un blog pieno di cose troppo nerdose per me. È nuovo, giovane immagino e per me un maestro. Ecco un suo tweet, muto, cioè subito via con il codice.

Ma funzionerà? mi sembra troppo semplice, forse è meta…

Non resta che provare

* rec $ ghci
GHCi, version 8.0.2: http://www.haskell.org/ghc/  :? for help
Prelude> fibs = 0 : 1 : zipWith (+) fibs (tail fibs)
Prelude> fibs !! 8
21
Prelude> fibs !! 12
144
Prelude> fibs !! 0
0

La prima riga definisce la funzione fibs che crea la lista infinita dei numeri di Fibonacci fornendo i valori dei primi 2 e definendo il valore del successivo come (+) dei valori della lista stessa. !! estrae l’elemento indicato nella lista. Semplice vero? l’ho capita anch’io. E siccome Haskell è lazy –OK, non voglio ripetermi.

OK, ma io preferisco Racket allora ecco. È comodo eseguirlo nel suo ambiente di sviluppo, DrRacket, perché devo caricare il linguaggio lazy:

Ma io sono della vecchia scuola, quella della REPL e allora ecco…

* rec $ racket
Welcome to Racket v6.11.
> (require lazy)
> (define fibs (cons 0 (cons 1 (map + fibs (rest fibs)))))
> (displayln (list-ref fibs 8))
21
> ^D
* rec $

OK. È la tradudione letterale del programma Haskell. Più verboso. Ma Michael (lo sapete che si è fatto un linguaggio tutto suo, Pyramid) non si ferma qui, va oltre. Per procedere devo acquisire il modulo sweet-exp e qui è comodo davvero DrRacket operando da menu: File/Install Package...

Fatto e allora (questa volta la REPL non basta):

Nota: il tweet contiene un errore, manca la parentesi aperta prima di +.

Nota per me: devo informarmi su Sweet, non sono l’unico anche Jesse 💥

Come se non bastasse ecco William 💥

Sì, avendo tempo ci sarebbe da vedere anche Cur.

Visto nel Web – 345

Stanco (la politica) e così-così (la salute) ma intanto eco cosa ho wisto nel Web.

Defying Skeptics, Twitter Stock Surges 60% in 2018
social media
::: Slashdot

Unresolved Login Issue Prevented Florida ‘Concealed Weapon’ Background Checks For Over a Year
privacy, sicurezza, spionaggio, virus
::: Slashdot

Node.js Creator Blasts Node.js, Offers a Secure TypeScript-Based Alternative
linguaggi di programmazione
::: gdi2290

Saving and scraping a website with Puppeteer
linguaggi di programmazione
::: daw985

Lawrence Lessig Criticizes Proposed 140-Year Copyright Protections
copyright e brevetti
::: Slashdot

the declining geopolitical power of US tech
innovazioni, futuro | politica
::: evgenymorozov

Should Developers Abandon Agile?
programming, codice, snippet
::: Slashdot

Mark Zuckerberg and the 2012 Facebook Moscow Hack
Facebook
::: Slashdot

Science and Technology links (June 9th, 2018)
novità
::: lemire

Github and Open-source Is a Boon for the Underprivileged
open source
::: amasad

Systemd-Free Devuan 2.0 ‘ASCII’ Officially Released
sistemi operativi
::: Slashdot

Nice introduction to Rust that even shows how it compiles down to assembly
manuali, how to | linguaggi di programmazione
::: _wilfredh

My faith in the overall goodness of the tech industry, already shaken by a cold hard look inside the world of advertising technology, had drowned
innovazioni, futuro
::: Symbo1ics

The One-Name Email, a Silicon Valley Status Symbol, Is Wreaking Havoc
Web, Internet
::: Slashdot

Microsoft is Working on its Own Game Streaming, Netflix-Like Service
games
::: Slashdot

Apple will transform, and take full control of, the Mac platform
sistemi operativi
::: AngelLamuno

Digital IDs Needed To End ‘Mob Rule’ Online, Says UK’s Security Minister
Web, Internet
::: Slashdot

How Microsoft’s Windows Red Team Keeps PCs Safe
privacy, sicurezza, spionaggio, virus
::: Slashdot

First impressions about #GraalVM
Web, Internet | linguaggi di programmazione
::: myfear

Launching a web server with python’s SimpleHTTP module is a convenient way for transfering files from a remote location
linguaggi di programmazione
::: daw985

Il #digitale può incidere pesantemente sulla comunicazione politica e quindi sulla #democrazia
Web, Internet
::: giacomodotta ::: buzzico

America Unveils the World’s Fastest Supercomputer (And Yes: It Runs Linux)
sistemi operativi
::: cialunet

Microsoft To Stop Offering Support For Windows 7, Windows 8.1, Old Surface Devices in Forums
sistemi operativi
::: Slashdot ::: Slashdot

Il corso di Tecniche di Programmazione si avvia alla conclusione. #Java #JavaFX #SQL #algoritmi #ricorsione #simulazioni
programming, codice, snippet
::: fulcorno

Net Neutrality Repeal Is Official
Web, Internet
::: Slashdot

Roaring Bitmaps are now available in Node for JavaScript programmers (npm install roaring)
anche per Python
linguaggi di programmazione
::: lemire ::: lemire

Four Years On, Developers Ponder The Real Purpose of Apple’s Swift Programming Language
linguaggi di programmazione
::: Slashdot

I like that Git doesn’t try to hide its underlying object model
tools, componenti software
::: lunaryorn

thanks to GDPR millions of users of the Spanish football app “La Liga” learnt that the app can spy on bars and customers, using microphones and GPS tracking, to detect unlicensed broadcasting of matches
privacy, sicurezza, spionaggio, virus
::: F_Kaltheuner ::: Slashdot

Tanzania Orders All Unregistered Bloggers To Take Down Their Sites
censura
::: Slashdot

My article DasBetterC is now trending on the 2nd page of Hacker News
linguaggi di programmazione
::: WalterBright

Inventor Says Google Is Patenting His Public Domain Work
open source
::: Slashdot

This is *the* issue: “This is a scientific issue, not an ideological one, so we need to treat it scientifically. It’s not enough to look at correlations: We need to set up randomized experiments and actually test for causation”
Facebook
::: fabiochiusi

Theorem Proving for All (Haskellers): math equational proofs are expressed as Haskell functions!
programmazione funzionale
::: nikivazou

Un po’ di rassegna stampa su ‘Persuasori Social’, il progetto realizzato con @nexacenter, @CRiformaStato e Fondazione P&R su trasparenza e democrazia nelle campagne politiche digitali
social media
::: fabiochiusi

It is time for the EP to #SaveYourInternet – here’s why @EP_Legal should oppose upload filters (#DeleteArt13) and the press publishers’ right (#SaveTheLink) in next week’s vote
copyright e brevetti
::: cdteu ::: Aokamidu ::: fcouchet ::: Slashdot

Net neutrality is officially dead. Here’s how you’ll notice it’s gone
Web, Internet
::: Slate

It’s a personal computer if you are willing to put your grocery list on it, carry it into the grocery store and out of it again with two bags of groceries — Alan Kay (1986)
storia
::: Symbo1ics

% of US teens who say they use
social media
::: MonicaRAnders

65 yrs ago this month Sister Mary Keller received what many view as the 1st CS PhD, and she also helped develop BASIC
storia
::: MIT_CSAIL ::: wallingf

hn commenter on the Torvalds/Tanenbaum microkernel debate
dissento ma riporto; o è una pèrovocazione?
sistemi operativi
::: johnregehr

The issue goes far beyond what Cambridge Analytica may have done in 2016. We need to confront that this kind of surveillance/data infrastructure is ripe for use, misuse and abuse
Facebook
::: zeynep

KDE Plasma 5.13 Released
tools, componenti software
::: Slashdot

Wifite 2. A complete re-write of wifite, a Python script for auditing wireless networks
applicazioni, programmi
::: xKaliSec

JavaScript Zero : Real JavaScript and Zero Side-Channel Attacks
linguaggi di programmazione
::: xKaliSec

OnionHarvester – A small TOR Onion Address harvester for checking if the address is available or not
applicazioni, programmi
::: xKaliSec

Ever wanted to warp your data the same way that Jet warps your perception? Now you can! Introducing `makeitpop`
linguaggi di programmazione
::: choldgraf

Andiamo a caccia di profili falsi su #Facebook e #Instagram. Ecco una piccola guida per riconoscerli
social media
::: SergioGridelli

Le video-lezioni del corso di Tecniche di Programmazione #TdP2018 sono disponibili
programming, codice, snippet
::: fulcorno

So often in open source we see the finished product rather than the process…
Jake rockz 💥👽💥
linguaggi di programmazione
::: jakevdp

#daleggere perché queste strategie comunicative sono usate anche da alcuni abili politici italiani
caos informativo, fake news, bufale | media
::: terminologia

JavaScript is like leaded gasoline; toxic, bad for everyone, but readily available and with few alternatives
linguaggi di programmazione
::: migueldeicaza

Facebook confirms that it tracks how you move mouse on the computer screen
Facebook
::: aral ::: cstross ::: accessnow

We launched copyrightforeducation.eu #FixCopyright
copyright e brevetti
::: communia_eu

Wow, #numba and @ApacheArrow powered StringArray factor 13 smaller in memory and factor 2 faster group by on strings in #pandas
linguaggi di programmazione
::: sebineubauer

Laptops With 128GB of RAM Are Here
hardware
::: Slashdot

70+ led by the founding fathers of Internet and the web join their voices to ours asking #EU to delete the badly broken Art. 13 of the #EU copyright directive: it’s time to listen!
copyright e brevetti
::: rdicosmo ::: _C4C_

Britain’s Dixons Carphone Discovers Data Breach Affecting 5.9 Million Payment Cards
privacy, sicurezza, spionaggio, virus
::: Slashdot

A team of academics, funded by an $8.9m @IESResearch grant, have used the online platform to anonymously collect the clicks and keystrokes of 200,000 Fla. students. The goal: teach the software to pinpoint when kids feel happy, bored, or engaged
privacy, sicurezza, spionaggio, virus
::: BenjaminBHerold

The highly-rated cross platform open source file manager Double Commander is back as a Project of the Week!
open source
::: sourceforge

‘Netflix and Alphabet Will Need To Become ISPs, Fast’
Web, Internet
::: Slashdot

The feature rich remote desktop client from RemminaProject is now available for #Ubuntu as a Snap!
applicazioni, programmi
::: cialunet

online copy (hopefully legal) of the third edition of Zobel’s Writing for Computer Science
manuali, how to
::: johnregehr

China’s Surveillance State Will Soon Track Cars
privacy, sicurezza, spionaggio, virus
::: Slashdot

React on Repl.it just got a whole lot faster with preboot
Web, Internet | programming, codice, snippet
::: replit

Please join us in celebrating the grand opening of the @SWHeritage archive!
storia
::: GoogleOSS

Bash tips for everyday at the command line
tip, suggerimenti
::: cialunet

build.rs is a handy Rust pattern for compile-time code generation
linguaggi di programmazione
::: _wilfredh

Video Lectures of Ambient Intelligence #AmI2018 @AmI_course are available for downloading
programming, codice, snippet
::: fulcorno

SoK: Systematic overview of C++ sanitizers w emphasis on sec issues [tools viz sec vul coverage, performance, compatibility, trade-offs; ASan most popular: mem safety exploitability focus, scales to real life, compiler integration]
programming, codice, snippet
::: daniel_bilar

Apple just closed the loophole that let police get into locked iPhones
privacy, sicurezza, spionaggio, virus
::: MIT_CSAIL

Another Day, Another Intel CPU Security Hole: Lazy State
hardware | privacy, sicurezza, spionaggio, virus
::: Slashdot

On The Sad State of Macintosh Hardware
hardware
::: Slashdot

Cops Are Confident iPhone Hackers Have Found a Workaround to Apple’s New Security Feature
privacy, sicurezza, spionaggio, virus
::: Slashdot

WebAssembly with #nim #wasm
linguaggi di programmazione | Web, Internet
::: arialdomartini

Google is a monopoly because we’ve allowed it to become one. And the first answer for how to rein in this digital giant is also the best: break it up
Google
::: BostonGlobe

JS is not worse than …
linguaggi di programmazione
::: WebReflection

avidemux is a free video editor to cut, filter, and encode projects
applicazioni, programmi
::: sourceforge

Adobe is Reviving the Stunning Lost Fonts of the Bauhaus
tools, componenti software
::: Slashdot

This isn’t even close to satire, it’s just true
social media
::: SarahJamieLewis

For organizations that were hoping to see a decline in #malware #threats, there is no sign that #cryptomining malware will be going away anytime soon. In fact, cryptomining malware continues to dominate among #hackers
privacy, sicurezza, spionaggio, virus
::: ictlc

This would break the internet. Imagine YouTube Content ID, but for everything: blog comments, tweets, Github commits, Instagram photos, replies to newspaper articles, rental listings, dating profiles. This is being proposed in the EU. #Article13
copyright e brevetti
::: torproject

Dear @EPPGroup, you care about quality education in Europe. Support it during this week’s vote. The exception in art 4 should (1) be mandatory (2) enable cross border sharing (3) have no license override (4) have no forced remuneration. #FixCopyright
copyright e brevetti
::: communia_eu

jp is a tool for making dead simple terminal plots from JSON (or CSV) data. Bar charts, line charts, scatter plots, histograms and heatmaps are supported
applicazioni, programmi
::: bitfield

The PDF file format was published on June 15, 1993 by @Adobe, and is 25 years old today
applicazioni, programmi | storia
::: mikko

After 7 years of “relentless growth in the use of social media for news”, writes @risj_oxford’s Digital News Report 2018, “now, in many countries, growth has stopped or gone into reverse”
social media
::: fabiochiusi

Let’s code a TCP/IP stack
Web, Internet
::: b3h3m0th

Protests greet Brussels copyright reform plan
copyright e brevetti
::: communia_eu

Facebook’s longtime head of policy and comms steps down
Facebook
::: fabiochiusi

Facebook to meet GOP leaders to hash out censorship complaints
Facebook
::: fabiochiusi

Emojis, Java and Strings
linguaggi di programmazione
::: lemire

Presto potrete avere #Windows10 sul vostro smartphone #Huawei con #Android
dispositivi mobili | sistemi operativi
::: WindowsBlogIta

After having refused any compromise throughout the #copyright negotiations, @AxelVossMdEP is now unsure if he has a majority. It’s not too late for him to endorse our @GreensEP alternative proposals that will help rightsholders and #SaveYourInternet!
copyright e brevetti
::: Senficon

We introduce you to the ‘Magic 10’: The 10 MEPs who have the power to #SaveYourInternet from the #Copyright #CensorshipMachine. Convince them to be a hero not a zero: make them #DeleteArt13 on 20 June! saveyourinternet.eu #FixCopyright
copyright e brevetti
::: _C4C_

You can now interactively generate plots (or any type of media) on @replit. This is 🔥🔥🔥 for anyone doing ML or stats
programming, codice, snippet
::: amasad

Some Prominent Tech Companies Are Paying Big Money To Kill a California Privacy Initiative
privacy, sicurezza, spionaggio, virus
::: Slashdot

Salviamo il copyright e uccidiamo internet con filtri preventivi? La riforma UE e un dibattito di cui i giornali italiani (e non solo) si sono dimenticati
copyright e brevetti
::: AlessLongo

My answer to What are some interesting things you could say about Lisp?
lisp(s)
::: PaniczGodek

If we know enough about what you say and do, your psychome will seemingly predict your response to a sales pitch, propaganda, or any stimulus
ad, pubblicità
::: medialab

Science and Technology links (June 15th, 2018)
novità
::: lemire

The famous feature-filled scientific plotting package gnuplot is back as a Project of the Week!
linguaggi di programmazione
::: sourceforge

17 Backdoored Images Downloaded 5 Million Times Removed From Docker Hub
privacy, sicurezza, spionaggio, virus
::: Slashdot

US Files Criminal Charges Against Theranos’s Elizabeth Holmes, Ramesh Balwani
frodi
::: Slashdot ::: voxdotcom

Inside the Private Event Where Microsoft, Google, Salesforce and Other Rivals Share Security Secrets
privacy, sicurezza, spionaggio, virus | ditte
::: Slashdot

Data Propria, run by Cambridge Analytica alumni, working on Trump 2020 campaign
privacy, sicurezza, spionaggio, virus
::: 221Boy

Le meraviglie della ricorsività
language Racket | func
::: TheMichaelBurge

A #Marketing Site Deleted Almost 6,000 Articles After It Was Caught Stealing Fact-Checks And Plagiarizing
caos informativo, fake news, bufale
::: RadioProzac

More and more experts warn of the dangers of #Article13 upload filters
copyright e brevetti
::: communia_eu

The list of organisations and individual experts opposing the #CensorshipMachine is amazing. Read below the different groups sounding the alarm and trying to #SaveYourInternet
copyright e brevetti
::: edri

Sound of Science: … Sci-Hub, in the world of scientific and technical information is the total disruption, the outsider arriving and the platform giving access to the documents much faster than legal platforms
media
::: Sci_Hub

TIO – try it online

La serendipità 😁 Capita che devi convertire uno script (scritto in Basic per Windows) in Python (per Windows e Linux, funziona ovunque) quando mancano le conoscenze (ahemmm… dimenticato; come passa il tempo!) e l’autore originale non è più qui e non si trova e allora googli disperatamente, chissà…

Vero che c’è repl.it ma trovato TIO.

TIO is a family of online interpreters for an evergrowing list of practical and recreational programming languages.
[…]
TIO hosts 195 practical and 316 recreational programming languages, for a total of 511 languages.

Da provare. Poi in realtà nel  nostro  mio caso l’evoluzione è stata diversa ma –come detto– TIO è da provare. Non con tutti i linguaggi, un paio (abbondante) può bastare, anzi l’interesse è per uno solo: il Basic.

A seguito di un approfondito brainstorming (t > 1 min.) la scelta è caduta sul crivello di Eratostene. Invece di scrivere il codice, non che non sia alla mia portata ma la laziness ereditata con Haskell, sono ricorso a Rosetta Code.

TIO funziona perfettamente, almeno per script non troppo grandi. I test effettuati li riporto con qualche nota. Inizio con Python 3:

def eratosthenes2(n):
    multiples = set()
    for i in range(2, n+1):
        if i not in multiples:
            yield i
            multiples.update(range(i*i, n+1, i))

print(list(eratosthenes2(100)))

Inserito il codice in Code e lanciato con il pulsante Execute the program nel campo Output è comparso immediatamente il risultato

[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]

Le indicazioni del campo Debug mi informano che l’esecuzione è avvenuta sotto time in ambiente Linux (credo, almeno da me sarebbe così) con numeri troppo piccoli per avere qualche significato. Vero che il problema era molto piccolo.

Io vengo da lontano (come viaggiatore nel tempo) e visto che Rosetta e TIO propongono il Fortran (90, ma per il 77 basta cambiare l’indentazione e modificare le dichiarazioni iniziali):

program sieve

  implicit none
  integer, parameter :: i_max = 100
  integer :: i
  logical, dimension (i_max) :: is_prime

  is_prime = .true.
  is_prime (1) = .false.
  do i = 2, int (sqrt (real (i_max)))
    if (is_prime (i)) is_prime (i * i : i_max : i) = .false.
  end do
  do i = 1, i_max
    if (is_prime (i)) write (*, '(i0, 1x)', advance = 'no') i
  end do
  write (*, *)

end program sieve

ottenendo

2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97

Ma si cercava per il Basic. Rosetta ha diversi codici per questo linguaggio che ha avuto un’evoluzione maggiore di qualunque altro, Lisp compreso. È finito che ne ho modificato una versione sensata, con un bug mysteryoso. Cioè essere partito con il Fortran ho considerato che l’indice dell’array partisse da 1 anziché 0. In realtà anticamente per le versioni Microsoft c’era la direttiva option base 1, usata abitualmente da quelli come me. Il codice è risultato questo:

limit = 100
dim flags(101)
for n = 2 to sqr(limit)
  if flags(n) = 0 then
    for k = n * n to limit step n
      flags(k) = 1
    next k
  endif
next n

for n = 2 to limit
  if flags(n) = 0 then
    print n, " "
  endif
next n

Tutto OK 😋

Per finire visto che avevamo (ero con Edo, un giovane molto promettente) sentito anche un capo, senior, anche lui partito con il Fortran ma poi finito su altre strade, da statistici. Insomma Rosetta e TIO forniscono J, evoluzione di APL e allora ecco:

sieve=:verb define
  seq=: 2+i.y-1  NB. 2 thru y
  n=. 2
  l=. #seq
  whilst. -.seq-:prev do.
     prev=. seq
     mask=. l{.1-(0{.~n-1),1}.l$n{.1
     seq=. seq * mask
     n=. {.((n-1)}.seq)-.0
  end.
  seq -. 0
)

Inserendo sieve 100 nel campo Input si ottiene –mysteryosamente– il risultato previsto.

Se dovessi dire la verità, solo la verità, tutta la verità Vostro Onore dovrei riportare altre prove ma il post diventerebbe troppo lungo e poi non sono pertinenti con il caso in esame. Piuttosto MY-BASIC… da indagare, prossimamente… forse… 👽

AI, innovazioni e blockchain – 26

Periodo travagliato, Python (2.7) e la politica. Ma tanto: 1) sono fuori; e 2) sono vecchio. CMQ ecco qua 😁💥

Algorithms don’t make things fair. They repeat our past practices, our patterns. They automate the status quo
algoritmi, codice
::: TEDTalks

#forzaEuropa #EU #AI #HPC #supercomputing #digitaleconomy
innovazioni, futuro
::: cmnit

Researchers explore whether robots can become useful sacred objects
robots
::: IEEESpectrum

La fin du mythe technologique américain. Nouveau billet de Evgeny Morozov
innovazioni, futuro
::: mdiplo

Google Promises Its AI Will Not Be Used For Weapons
Google | artificial intelligence
::: Slashdot ::: mikko ::: drfeifei

Countries might be looking to Estonia for advise on how to improve their cybersecurity infrastructure
blockchain e crypto*
::: formicablu

Blockchain’s Once-Feared 51% Attack Is Now Becoming Regular
blockchain e crypto* | frodi
::: Slashdot

a good illustration of why natural language is so hard for computers (and humans)
programming, codice, snippet
::: AuerbachKeller

Chatbots didn’t just take on one difficult problem and fail: they took on several and failed all of them. 70% are failing to fulfil simple user requests
Web, Internet
::: glovink

First 3D Printed Houses For Rent Will Be Built In the Netherlands This Year
innovazioni, futuro
::: Slashdot

Currently, the amount of #bitcoin held for investment is equal to the amount of bitcoin held for transactions and speculation
blockchain e crypto*
::: cburniske

Who’s right, Elon Musk or Mark Zuckerberg? Is supersmart artificial intelligence a potential threat to humans, or a boon?
artificial intelligence
::: nytimes

I’m expecting blockchain to change how we do elections in approximately the same way the Segway changed the nature of cities
blockchain e crypto*
::: mattblaze

In-Vivo Networking, from @fadeladib and the @SignalKinetics group, enables remotely charged, battery-free implants that could be used to monitor and treat medical conditions
innovazioni, futuro
::: medialab

How Bitcoin made right-wing conspiracy theories mainstream
blockchain e crypto*
::: FrankPasquale

US ebike industry grew between 50%-70% YoY
innovazioni, futuro
::: JeffStefanis

People are kicking Starship Technologies’ food delivery robots
robots
::: MFordFuture

Bitcoin Tumbles Most in Two Weeks Amid South Korea Hack
blockchain e crypto*
::: Slashdot

Intel’s director of quantum hardware explains the company’s two competing quantum computing technologies
quantum computing
::: IEEESpectrum

It’s happening faster than expected: Next year, people will spend more time online than they will watching TV
Web, Internet
::: Schuldensuehner

Bitcoin uses “naive” Merkle trees which don’t disambiguate leaf nodes from interior nodes. I’ve long wondered if this is exploitable, and it turns out the answer is yes
privacy, sicurezza, spionaggio, virus | blockchain e crypto*
::: bascule

What’s the argument against Europe – not individual nation states! – embracing technological sovereignty?
innovazioni, futuro
::: evgenymorozov

Challenges faced while training an AI to combat abuse
artificial intelligence
::: elie

This is huge: “Skip will back, financially and otherwise, local organizations such as the San Francisco Bicycle Coalition focused on initiatives like adding more bike lanes”
innovazioni, futuro
::: michalnaka

I think @lemire is a bit too optimistic in his predictions here, and the order of technological development appears to be a little out of order
virtual reality
::: ArmchairEgghead

Wells Fargo Bans Cryptocurrency Purchases On Its Credit Cards
blockchain e crypto*
::: Slashdot

Apple’s App Store Officially Bans Cryptocurrency Mining
blockchain e crypto*
::: Slashdot

Sweden Tries To Halt Its March To Total Cashlessness
innovazioni, futuro
::: Slashdot

Tesla’s Autopilot To Get ‘Full Self-Driving Feature’ In August
automazione
::: Slashdot

Ten years in, nobody has come up with a use for blockchain. Interesting reading
blockchain e crypto*
::: mariofusco

In this Q&A, Bill Joy talks about why he focuses on the “big hard aggressive goals” or BHAGs
io Bill Joy l’ho scoperto (anni ’80) leggendo il manuale di vi (adesso vim); roba sua
innovazioni, futuro
::: IEEESpectrum

Wireless smart-health system uses AI to sense movement through walls
artificial intelligence
::: MIT_CSAIL

Com’è che il Nuovo che Avanza assomiglia sempre irresistibilmente al Vecchio Stravisto?
innovazioni, futuro
::: AleGuerani

Solar Has Overtaken Gas, Wind As Biggest Source of New US Power
innovazioni, futuro
::: Slashdot

Top 4 open source augmented reality SDKs
augmented reality
::: cialunet

Bitcoin’s Price Was Artificially Inflated Last Year, Researchers Say
blockchain e crypto* | economia
::: Slashdot

People kicking these food delivery robots is an early insight into how cruel humans could be to robots
robots
::: FrankPasquale

The camera-ready version of Neural Kernel Network (NKN). If you’ve ever worried about how to choose the kernel function for Gaussian Processes. This is the paper for you. Let data take the call!
artificial intelligence
::: Guodzh

The narrative that automation will lead to mass unemployment and inequality is false
robots
::: rooseveltinst

The startup that launched four satellites without permission in January has filed a new application
innovazioni, futuro
::: IEEESpectrum

Today, we’re announcing a Google AI research center in Africa, which will open later this year in Accra, Ghana. We’ll bring together top machine learning researchers and engineers in this new center dedicated to AI research and its applications
artificial intelligence
::: black_in_ai

China’s Ambitions To Power the World’s Electric Cars Took a Huge Leap Forward This Week
innovazioni, futuro
::: Slashdot

To build a successful #drone entertainment company you need really fault-tolerant drones that won’t injure spectators
innovazioni, futuro
::: Electric_Genie

Building an IoT device (part I)
Internet of things
::: nicolaiarocci

cit. & loll – 100

Anche se –OK, niente– ecco le cose cit.ose e lollose del Web 😊

Breve storia informatica triste
::: Genjuro75

Code is not a collection of keystrokes
::: RichRogersIoT

remember a pedestrian truth
::: counternotions

today is a good day
::: ManishEarth

thinking maybe i need a break from twitter
::: yungbiryanii

One core principle for building a welcoming programming community is a focus on “yes, and” as opposed to a “no, but” culture
::: amasad

I’ve given up on prioritizing
::: AstroKatie

In the age of YouTube you can be a nerd in anything without spending a fraction of the time that you used to have to
::: amasad

Sometimes software does exactly what it is told to do
::: manisha72617183

First LOL today
::: lilianedwards

Coming soon: my blockchain-based compiler suite
::: wallingf

Alex Camilleri – Malmo

Sometimes out of the blue the coffee shop plays Pavarotti singing Nessun Dorma
::: jakevdp

I’m very proud of my Github contributions chart!
::: xima

I realized our research group has two slogans
::: jeanqasaur

When a man only got his letters in the morning he was pretty safe from surprises for the rest of the day
::: mattthomas

Libri in realtà aumentata? Il progetto #eMooks
::: SergioGridelli

Initialization in Modern C++
::: timur_audio

The cleaner and nicer the program, the faster it’s going to run
uh! leggere il thread
::: CodeWisdom

There is no limit to the amount of machinery
::: jdegoes

Lambda Calculus is unambiguous, but can be interpreted in many ways
eh???
::: Cronokirby

Bennet, casse automatiche (con scanner portatile)
::: fulcorno

About 1,000 instructions is a reasonable upper limit
::: CompSciFact

A program is much like clay
::: dukecrawford

Oh god, that is too close for comfort
::: codepo8

I won’t hire a plumber without seeing some of the public toilets they’ve unclogged in their spare time, for fun
::: lizardbill

The maxim is to always optimize your code for reading (in the future)
::: djspiewak

Correct brace style
::: TheMichaelBurge

C++03: void foo() const volatile;
::: jfbastien

Real footage of everyone who buys a raspberry pi
::: GidgetNomates

My pregnant wife texted me a selfie in a new dress and asked “Does it make my butt look big?”
::: billingsley313

I spend most of my day working with tools that weren’t even in science fiction novels twenty-five years ago
::: JohnDCook

l’eredità più importante di Elon Musk e #SpaceX
::: a_a_f_t

Programmers’ Hardest Tasks
::: RichRogersIoT

I always enjoy event parking in the Netherlands
::: ow

Anna spesso gioca a scrivere lettere casuali sulla tastiera del server di casa
::: orporick

Arrays do start at 1. Ask any …
::: sethohio

Haskell is
::: CodeWisdom

Computer Assitance for the Modern Novelist
::: tomgauld

Il lanciafiamme di Elon Musk è in arrivo
::: outpump ::: Genjuro75

trains so busted time isn’t even numbers anymore
::: itsa_talia

Senza parole, immagini
::: RoweBraxton

If I had to write a 100% honest resume
::: lizardbill

Then along came C, which seemed to break all the rules of advances in programming languages of abstraction, abstract data types, and so on. It was almost like ASM to academics. It was cringe-worthy
::: stevesi

First do it
::: CodeWisdom

This program simplifies images into primitive shapes
::: Rainmaker1973

tfw you solve a bug
::: noopkat

Only God and I knew
::: farbodsaraf

Turing test
::: newscientist

Most of use who started coding in the 80s started with BASIC
::: hisham_hm