An economist’s view on AI

Michaela Schmöller, writes in „Secular stagnation: A false alarm in the euro area?“ for the Bank of Finland

It is important to note that productivity growth evolves in a two-stage process: the initial invention of new technologies through research and development, subsequently followed by technological diffusion, i.e. the incorporation of these new technologies in the production processes of firms. As a result, even though many important technology advances may have been invented in recent times, they will only exert an effect on output and productivity once firms utilise these technologies in production. Potential productivity gains from technologies that have yet to be widely adopted may be sizable. A central example is the field of artificial intelligence in which future productivity gains may be considerable once AI-related technologies diffuse to the wider economy. (…)

AI may represent — as did the steam engine, the internal combustion engine and personal computers — a general purpose technology, meaning that it is far-reaching, holds the potential for further future improvements and has the capability of spurring other major, complementary innovations over time with the power of drastically boosting productivity. Incorporating AI in production requires substantial changes on the firm-level, including capital stock adjustments, the revision of internal processes and infrastructures, as well as adapting supply and value chains to enable the absorption of these new technologies. Consequently, this initial adjustment related to the incorporation of general purpose technologies in firms‘ production may take time and may initially even be accompanied by a drop in labour productivity before delivering positive productivity gains.


How to Export Your Mozilla Firefox History as a Dataframe in R

The goal of this post is to export a Mozilla Firefox Browser history and import in R as a dataframe.

Browser history data

Firefox saves your browsing history in a file called places.sqlite. This file contains several tables, like bookmarks, favicons or the history.

To get a dataframe with visited websites, you need two tables from the sqlite file:

  1. moz_historyvisits: it contains all websites you visited with time and date. All websites have an id instead of a readable URL.
  2. moz_places: it contains the translation of the websites id and its actual URL.

More on the database schema:

Import the data into R

sqlite files can be imported with the package RSQLite.

First, find the places.sqlite on your computer. You can get the path, by visiting about:support in Firefox and looking for the Profiles directory.

library(RSQLite)
library(purrr)
library(here)

# connect to database
con <- dbConnect(drv = RSQLite::SQLite(), 
                 dbname = "path/to/places.sqlite",
                 bigint="character")

# get all tables
tables <- dbListTables(con)

# remove internal tables
tables <- tables[tables != "sqlite_sequence"]
# create a list of dataframes
list_of_df <- purrr::map(tables, ~{
  dbGetQuery(conn = con, statement=paste0("SELECT * FROM '", .x, "'"))
})
# get the list of dataframes some names
names(list_of_df) <- tables

Extract browser history

Next, we extract the two tables with the information we need, join them and keep only the visited url, the time and the URL id.

There are two caveats:

  1. The timestamps are saved in the PRTime format, which is basically an unix timestamp and you have to convert it in a human-readable format
  2. Extract the domain of a URL using the urltools package, e.g. getting twitter.com instead of twitter.com/cutterkom
library(urltools)
# get the two dataframes 
history <- list_of_df[["moz_historyvisits"]]
urls <- list_of_df[["moz_places"]]

df <- left_join(history, urls, by = c("place_id" = "id")) %>% 
  select(place_id, url, visit_date) %>% 
  # convert the unix timestamp
  mutate(date = as.POSIXct(as.numeric(visit_date)/1000000, origin = '1970-01-01', tz = 'GMT'),
  # extract the domains from the URL, e.g. `twitter.com` instead of `twitter.com/cutterkom`
         domain = str_remove(urltools::domain(url), "www\\."))

Lesenswertes: Strategie, Software, Männer

Was ist Strategie? – Essay von Wolf Lotter in der Brandeins

“Für die Entwicklung einer Strategie zählt das Wahrscheinliche, das, was aller Voraussicht nach eintreten kann. Und das muss man vorsichtig denken. Denn die Gegenwart verläuft nicht in gerader Linie weiter in die Zukunft, wie Planer das gern hätten. Doch bestimmte Systeme, Kulturen, Ordnungen legen – zumal für Kenner und Profis – bestimmte Verhaltensweisen nahe. Und man kann nach menschlichem und fachlichem Ermessen vorhersehen, wie sich ein Teil des Systems verhält, wenn man auf eine bestimmte Weise darauf einwirkt. Strategien haben ein Ziel mit einem Weg und mehreren Ausweichrouten.”

The Coming Software Apocalypse

Was ist einer der größten Unterschiede zwischen einer mechanischen Maschine und einem Computer? Die Komplexität von Code ist unsichtbar.

„The software did exactly what it was told to do. In fact it did it perfectly. The reason it failed is that it was told to do the wrong thing. Software failures are failures of understanding, and of imagination.“

  • Software-Entwickler arbeiten nicht direkt daran, ein Problem zu lösen, sondern schreiben Anweisungen für eine Maschine.
  • „The programmer, staring at a page of text, was abstracted from whatever it was they were actually making.“
  • Die größere Herausforderung als ein fehlerfreier Code sei es, die Anforderungen korrekt festzulegen.
  • Der Fall, bei dem Toyota-Autos einfach immer weiter beschleunigten: Es stellte sich heraus, dass es zehn Millionen Fälle geben kann, in denen das Fahrzeug nicht aufhört schneller zu werden.
  • Was es deshalb braucht: Neue Ansätze des Programmierens. Einige davon werden im Text erklärt.

Männliches Selbstbild in der Krise: Wir brauchen einen Feminismus für Männer

Nicht der Mann ist das Problem, sondern das Verständnis davon, was ein Mann zu sein hat.

Leaflet.js-Macher Vladimir Agafonkin: „hey front-end guy! make a map“

Zur Zeit findet die FOSS4G statt: Ein Treffen von Leuten, die mit Karten und Geoinformationssystemen auf Open Source Basis arbeiten:

The annual FOSS4G conference is the largest global gathering focused on open source geospatial software. FOSS4G brings together developers, users, decision-makers and observers from a broad spectrum of organizations and fields of operation.

Gestern hat dort Vladimir Agafonkin, der Entwickler von Leaflet.js einen Vortrag gehalten. Der Titel: „How Simplicity Will Save GIS„.

Er erzählt darin, wie er als 22-Jähriger ohne viel Ahnung von Geoinformationssystemen, kurz GIS, mit Leaflet angefangen hat: „Born as a protest against bloat, clutter and complexity.“

Ab der Hälfte der Folien, bekommt man den Eindruck, dass Agafonkin eine Motivationsrede gehalten haben musste. Ein schlauer Spruch nach dem anderen, aber nicht uninteressant.

Heute und morgen gibt es Livestreams von FOSS4G, gegen 17 Uhr deutscher Zeit geht’s los.

Gibt es einen Unterschied zwischen simplicity und minimalism?

Although I sometimes use the terms ‘minimal’ and ‘simple’ as if they were interchangeable, by definition, minimalism actually refers to the paring down of elements to get to the essence of a thing. This doesn’t mean you practise minimalist design simply by removing ornamentation; it means you ensure that every part of the design works together to the point where nothing else can be added or removed to improve it. It’s not easy to do well

Aus: Five killer ways to use minimalism