Sunday, January 28, 2024

Trombone

One thing I've added to my routine is practicing trombone, just maybe ten minutes a day. (I'll time myself today to see how long I'm actually going for.)

Currently, I'm working through "40 Progressive Etudes for Trombone" by Sigmund Hering plus some scales and a medley of Christmas music.

I'm looking forward to starting to take a look at Arban's famous method for slide and valve trombone and baritone (bass clef) soon, which I found based on the recommendation of a longterm family friend and trombone player. He also pointed out that he enjoys playing the Bach cello concertos, transcribed to trombone. I'm taking inspiration from this performance of them: SUITE Nº1 IN G MAJOR (BWV 1007) J. S. BACH FOR TROMBONE ALONE BY JAVIER YERA (though I'm so far off from this level at the moment). I think this portion of it will be a good place for me to start: Cello Suite No.1 in G major BWV1007:I Präludium For Trombone.

I'm looking forward to making progress, to learning from the larger trombone community. Another thing I'm looking at is Douglas Yeo's FAQ.

If you have any favorite resources for improving your trombine skills, I'd love to hear about them. Thank you.

Saturday, January 27, 2024

"The Five Parts of Every Business"

I'm enjoying The Personal MBA, though I don't think I'll be able to finish it before I have to return it to the library.
Roughly defined, a business is a repeatable process that:
  1. Creates and delivers something of value ...
  2. That other people want or need ...
  3. At a price they're willing to pay ...
  4. In a way that satisfies the customer's needs and expectations ...
  5. So that the business brings in enough Profit to make it worthwhile for the owners to continue operation.
One point that caught my attention: while it means more competition, the fact that other businesses are succeeding in an area at least means that there is demand for what they're producing. So, if there's existing competition, it at least indicates there are some potential customers, avoiding one pitfall.

Sunday, December 17, 2023

Boethius defined chance in terms of epistemic uncertainty

Reading Boethius's "The Consolation of Philosophy", I've been repeatedly struck by Boethius showing knowledge of ideas that I'd wrongly assumed only had a later origin. This reminds me that we should not underestimate the "ancients", although he is far closer to us than the true ancients, two hundred thousand years or more before.

Here he is defining "chance" in terms of epistemic uncertainty, after nodding to arguments from the ancients that there are not chance occurrences:
We can define chance, then, as the unexpected result of causes that come together of things that were done for some other purpose.
(Emphasis added by me.) He credits Aristotle's Physics as the source of this idea.

Another example that surprised me was him mentioning the problem of evil -- how can an omnipotent God allow there to be evil in the world? His answer, at least in the translation I'm looking at from David Slavin, is that "evil is nothing".

This other translation captures the same thing:
‘Nobody would care to doubt that God is all-powerful?’
‘At any rate, no sane man would doubt it.’
‘Being, then, all-powerful, nothing is beyond His power?’ ‘Nothing.’
‘Can, then, God do evil?’
‘No.’
‘Then evil is nothing, since it is beyond His power, and nothing is beyond His power?’
He also makes many arguments that at least have the flavor of an ontological argument. Again from that other translation:
‘Now consider,’ she continued, ‘where it lies. The universally accepted notion of men proves that God, the fountain-head of all things, is good. For nothing can be thought of better than God, and surely He, than whom there is nothing better, must without doubt be good. Now reason shews us that God is so good, that we are convinced that in Him lies also the perfect good. For if it is not so, He cannot be the fountain-head; for there must then be something more excellent, possessing that perfect good, which appears to be of older origin than God: for it has been proved that all perfections are of earlier origin than the imperfect specimens of the same: wherefore, unless we are to prolong the series to infinity, we must allow that the highest Deity must be full of the highest, the perfect good. But as we have laid down that true happiness is perfect good, it must be that true happiness is situated in His Divinity.’

The reasoning in these sections bothers me because it seems to trade on different meanings of the terms involved: "existence", "nothingness", etc. I don't recall Boethius addressing this possibility, but he does recognize the counterintuitivenss of some of his conclusions; he notes that if you cannot question either the premises or the reasoning from them, then you should accept the conclusion, which is something I heard one of my intro philosophy professors say around 1500 years later.

Do we need to define evil away to "remain Stoic"? I think there are good practical reasons to remain calm in the face of adversity, as in the Serenity Prayer:
God, grant me the serenity to accept the things I cannot change,
the courage to change the things I can,
and the wisdom to know the difference.
Before reading Boethius, I had a vague idea Stoicism was about this, maintaining calm despite the circumstances, a practical philosophy. But Boethius ultimately seems to be arguing that there is no such thing as adversity? To me, that weakens the appeal a bit.

Wednesday, October 11, 2023

Meow

"Meow", said the old cat. Her yellow green eyes were dulled with age, but still they glowed as the setting sun caught them. Steadfast, the eyes of a warrior, of a leader. The wind rustled the tufts of hair at the tops of her ears and her whiskers but the rest of her short gray fur moved only as her steely muscles rippled beneath. She turned to the younger at her side, a tabby. "Meow meow, meow meow meow," he said, his head bowing slightly. "Meow!" she said. "Meow?" he replied. "Meow, meow, meow, meow. Meow meow", she said. The tabby nodded and walked off into the forest. "Meow", the old warrior cat said to herself. Meow indeed.

Sunday, July 16, 2023

Boston Housing dataset ethical/data quality problems

I'm not sure if I've worked with the Boston Housing dataset previously -- maybe? -- but I've at least heard of it, I'm pretty sure. I was surprised to see this message when attempting to import it today as part of working through "TensorFlow 2.0: Quick Start Guide":
ImportError: 
`load_boston` has been removed from scikit-learn since version 1.2.

The Boston housing prices dataset has an ethical problem: as
investigated in [1], the authors of this dataset engineered a
non-invertible variable "B" assuming that racial self-segregation had a
positive impact on house prices [2]. Furthermore the goal of the
research that led to the creation of this dataset was to study the
impact of air quality but it did not give adequate demonstration of the
validity of this assumption.

The scikit-learn maintainers therefore strongly discourage the use of
this dataset unless the purpose of the code is to study and educate
about ethical issues in data science and machine learning.

In this special case, you can fetch the dataset from the original
source::

    import pandas as pd
    import numpy as np

    data_url = "http://lib.stat.cmu.edu/datasets/boston"
    raw_df = pd.read_csv(data_url, sep="\s+", skiprows=22, header=None)
    data = np.hstack([raw_df.values[::2, :], raw_df.values[1::2, :2]])
    target = raw_df.values[1::2, 2]

Alternative datasets include the California housing dataset and the
Ames housing dataset. You can load the datasets as follows::

    from sklearn.datasets import fetch_california_housing
    housing = fetch_california_housing()

for the California housing dataset and::

    from sklearn.datasets import fetch_openml
    housing = fetch_openml(name="house_prices", as_frame=True)

for the Ames housing dataset.

[1] M Carlisle.
"Racist data destruction?"


[2] Harrison Jr, David, and Daniel L. Rubinfeld.
"Hedonic housing prices and the demand for clean air."
Journal of environmental economics and management 5.1 (1978): 81-102.

It was interesting reading M Carlisle's investigation and the scikit-learn discussion around it. I also found Fairlearn's discussion enlightening. (I One other surprise for me in this is the existence of an Ames, Iowa, housing dataset. Article describing it: Ames, Iowa: Alternative to the Boston Housing Data as an End of Semester Regression Project [PDF] (2011) by the original creator of the dataset, Dean DeCock.

Saturday, June 3, 2023

Drawing with all the fonts available in Colab

import os
import unicodedata

from PIL import Image, ImageDraw, ImageFont

def get_fonts(default_size=20):
  fonts = []
  for root, dirs, files in os.walk('/usr/share/fonts/truetype/'):
    for file in files:
      if file.endswith('.ttf'):
        fonts.append(ImageFont.truetype(os.path.join(root, file), default_size))
  return fonts

TARGET_ALPHABET = [c for c in map(chr, range(128))
  if not unicodedata.category(c).startswith('C')]
FONTS = get_fonts()
WIDTH = 500

out = Image.new("RGB", (WIDTH, 2000), (255, 255, 255))

d = ImageDraw.Draw(out)

x = 0
y = 0
for c in TARGET_ALPHABET:
  for font in FONTS:
    d.text((x, y), c, font=font, fill=(0, 0, 0))
    left, top, right, bottom = d.textbbox((x, y), c, font=font)
    if right < WIDTH - 20:
      x = right + 5
    else:
      x = 0
      y = bottom + 5
out.show()
UNICODE CHARACTER DATABASE: General_Category Values ImageDraw.textbbox

Monday, May 29, 2023

Handwriting recognition links

One project I'm curious: handwriting recognition. Dumping a list of resources I've come across: I guess there must be some more recent stuff that I'm missing? Recent articles citing the Graves and Schmidhuber article.