Die wunderbare Welt von Isotopp
So I am a Windows User now
So I am a Windows User now. I have an old MacBook pro, Late-2013 13" Retina, i7, 16 GB, 1 TB SSD, and the battery is done now, after 7 years. Also, the hardware is aging, and I want it refurbished and upgrade the son’s equipment (which is the previous 2010 MBP I had at that time).
Modern Apple is not my thing. I have a company MBP, 2018 Retina 13" Four-Port, i7, 16 GB, and everything about this device is wrong. I cannot for the life of me type on this keyboard, I accidentally hit functions on the touchbar, and the trackpad is so large that I put my hands on it when I don’t want to. Also, I had to disable the force-touch functionality because otherwise I would open files instead of selecting them. I have to charge it from the right hand side USB-C connector, because otherwise it would get hot and throttle.
How I set up my Python
Because Martin wanted some starting point, here is how I set up my Python. There are a lot of other things one can do, but this is supposed to be just a starting point.
For a new project, make a project directory, usually not with a local git repository.
kk:Python kris$ mkdir project
kk:Python kris$ cd project
kk:project kris$ git init
Initialized empty Git repository in /Users/kris/Python/project/.git/
We need a virtual environment to keep our modules apart from the system python.
Schulen digitalisieren
Da war also ein Artikel bei Golem: Schulen bemühen sich vergeblich um Geld aus dem Digitalpakt .
Die Schulen wollten das Geld nutzen, die Mittel würden aber trotz vieler Einreichungen nicht freigegeben, sagte ein Lehrer und IT-Verantwortlicher eines Berliner Gymnasiums Golem.de.
Das liege daran, sagt der Artikel, daß für Mittel aus dem Digitalpakt eine Minimal-Ausstattung und Anbindung der Schulen gefordert ist, die so oft nicht realisierbar sei. Außerdem
Auf kommunaler Ebene der Schulträger gebe “es kaum IT-Kompetenz. Die Gebäude sind marode, insbesondere die Verkabelung. WLAN scheiterte an 100 MBit/s-Verkabelung und überlasteten Stromkreisen für Power-over-Ethernet-Switches”.
MySQL Window Functions
Two questions from Reddit’s /r/mysql related to Window Functions: How do I make row.numbers happen and Get the difference between two values in different recordings .
One of the new things in MySQL is the implementation of Window Functions. They are related to aggregates, but do not actually lump values together.
To better understand what goes on, let’s create some fake data to work with:
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import MySQLdb as mdb
import MySQLdb.cursors as cursors
from datetime import datetime, timedelta
from random import randint, random
# We have {sensors} sensors, each producing {values} values
# between {minvalue} and {maxvalue}, at a random time after {starttime} plus {delta}
sensors = 3
values = 10
minvalue = 0
maxvalue = 10
starttime = datetime.fromisoformat("2020-01-01 00:00:00")
delta = timedelta(days=31)
script = [
"drop table if exists series",
"create table if not exists series ( id serial, sensor integer not null, checktime timestamp not null, value float )",
]
con = mdb.connect(
host="localhost", user="root", db="kris", cursorclass=cursors.DictCursor
)
cur = con.cursor()
# Create a table
for stmt in script:
cur.execute(stmt)
print(f"{cur._last_executed}")
con.commit()
# insert values
insert_stmt = "insert into series values ( %s, %s, %s, %s)"
for s in range(0, sensors):
print(
f"Sensor {s}: {values} measurements ({minvalue}, {maxvalue}), ({starttime}, {starttime+delta})."
)
for i in range(0, values):
value = random() * maxvalue + minvalue
t = starttime + timedelta(days=randint(0, delta.days))
data = (None, s, t, value)
cur.execute(insert_stmt, data)
con.commit()
This will create test data for a number of fictional sensors sensors. For each sensor, there will be values many readings with a random float value between minvalue and maxvalue. The sensor readings will be taken at a random point in time between starttime and delta days later. In our sample config, that is 3 sensors with 10 readings each, values between 0 and 10, at some random point in time in January 2020.
Export the entire database to CSV
A question from Reddit’s /r/mysql:
Really new to MySQL and had a request to export an entire database to csv for review. I can manually export each table using workbench but there are 10+ tables and 10+ databases so I was looking to export the entire database to csv.
It is likely that you have additional requirements on top of this, so it would be best to script this in a way that would allow for customization.
Pizza, People, Projects and Processes
An older talk from 2 years ago, which for some reason I was not able to find in the blog.
For reasons that do not need exploration at this junction, I had to explain Processes and Process Maturity some time ago, and a colleague asked me to put my thinking into a talk. This talk is likely going to be boring, because you may know most of the subject already. On the other hand, it is good to be on the same page when it comes to models and vocabulary.
Where do the JOINs go?
I was asking on Twitter:
Are you a Developer and understand (Micro-) Services? I am a database person and a bit simple, and I have a genuine Question:
When moving to a services architecture, where do the JOINs go?
I gave the following context:
A simple shop
So you sell stuff, that is, you have an orders table o with an oid, which stores a customer id cid from a customers c table, and an article id aid, from an articles table a and a count cnt.
Sonos just got complicated
So this morning the 08:10 alarm in the living room did not go off. It was set to remind the son that it is time to get going for school. We noticed in time, but when I looked into the “Why?” things got interesting. That alarm is a chime from the household Sonos system, and when I investigated, I got this:
Sonos did the split and upgraded/rebranded their controller operating system to S1.
Cloud and Energy
In Data Centers and Energy I wrote about Hyperscaler Data Centers and Open Compute, and how they bring down the PUE of data centers, making them more efficient, and in Streaming and Energy I followed up on this, explaining how Netflix energy usage fits into this. Now the Uptime Institute has released a study that claims “Data center energy efficiency gains have flattened out”.
It is summarized as:
The average power usage effectiveness (PUE) ratio for a data center in 2020 is 1.58, only marginally better than 7 years ago, according to the latest annual Uptime Institute survey (findings to be published shortly).
Waffle House Index of Tooling
Charity Majors was on fire and on target, again :
What is a Waffle House Index ?
The Waffle House Index is an informal metric named after the Waffle House restaurant chain and is used by the Federal Emergency Management Agency (FEMA) to determine the effect of a storm and the likely scale of assistance required for disaster recovery.
A “Waffle House Index for Tooling” would be an indicator how bad the situation on the ground in an IT department is. Charity Majors suggest “CPU load alerts” as a tooling emergency indicator.