Roland's homepage

My random knot in the Web

Older articles (12/27)

  1. Install ntpsec on FreeBSD

    A short article on how to install ntpsec on FreeBSD. Tested with 0.9.7 and 1.0.0.

    Note

    There is/was a bug in the ntpdate implementation that set the clock to a completely bogus value. So I’ve since written a simple script that runs from cron to fetch the time from a near NTP server.

    date: 2018-01-28
    modified: 2019-07-30
    reading time: 2 min.
    category: freebsd
    tags: ntp python3
  2. Database scheme for resin recipes

    This document explores how an SQLite database could be used to store data for the resin-calculator. Normally, the recipes are a dictionary keyed to the name of the resin. The value of each recipe is a list of (component, parts-by-weight) tuples. Since a database only contains tables, where each row has the same form, how do we store such infomation in a database?

  3. Converting RCS history to git

    Before the rise of git, I used rcs as my version control system. Because I want to standardize on git, I am slowly converting old repositories.

    In this article, as an example, I’ll be converting my old perl scripts in ~/src/perl.

    date: 2017-08-13
    modified: 2022-01-14
    reading time: 2 min.
    category: problems
    tags: RCS git
  4. Doing calculations with Python

    As an engineer I do a lot of calculations. These can be done with pen and paper and a calculator, in an IPython notebook or in a throwaway spreadsheet. All of these methods have shortcomings, though.

    Pen and paper is hard to share and (in my case) hard for others to read. In IPython you can assign the results of calculations to a variable, but you have to perform a separate action to display them. And spreadsheets in general show you the results but not the calculations.

    So I wrote a simple function in Python to help me with that. Using this function I can print both simple assignments and relatively complex calculations. And it shows both the calculation and the result.

  5. Structures in Python

    Sometimes I miss the C’s plain old struct in Python.

    Of course Python has dictionaries, but I prefer to write a.b over a['b'].

    Here are several ways of doing something akin to a struct in Python.


←  Page 11 Page 12 / 27 Page 13 →