Roland's homepage

My random knot in the Web

Older articles (10/26)

  1. Adding text or graphics to a PDF file (again)

    In an earlier article I talked about using a picture environment in LaTeX to add lines and text over an image. In another article I showed how to draw with PostScript, including using Encapsulated PostScript to include arbitrary images.

    In this article I want to cover the pros and cons of these methods and introduce a third method: TikZ.

  2. ImageMagick: convert vs Wand

    The ImageMagick suite has been in my software toolbox for years. It is my go-to tool for manipulating bitmap images. Over the years I have written several front-ends for specific tasks for in Python.

    In general, I have used the subprocess module to launch convert or mogrify from Python.

    With the release of Wand 0.5.0 which supports ImageMagick 7, I decided to try that by porting one of my scripts (foto4lb) to it. This turned out to be slower than using convert directly.

    But now it is 2021. Py-wand is at 0.6.7 and it is time to try again.

  3. Installing Pelican 4

    Pelican is the static site generator that I use for my website. This allows me to write my website posts in almost plain text (actually a light-weight markup language named reStructuredText), which are then translated into HTML. As someone who has written his webpages in HTML by hand, I can tell you that this is definitely an improvement.

    Although I use LaTeX for things that require high-quality typesetting, these days almost all my other writings are in reStructuredText.

    The previous pelican version 3.7 was basically the last Python 2.7 application that I use. So now that pelican supports Python 3, I’m switching. Since Pelican 4 is not in the FreeBSD ports tree yet, I’m installing it myself.

    Note

    As of 4.0.1, Pelican is now in the FreeBSD ports tree and I’m using the port www/py-pelican. At the moment I’m still installing typogrify and smartypants by hand.

  4. Creating a nomogram with Python and Postscript

    At work I needed a suitable way to check the calibration of gelcoat spray equipment. Gelcoat requires an initiator (often called “catalyst”) in the form of a peroxide to cure. The peroxide/gelcoat ratio is important, so it is checked regularly by spraying the separate components into suitable containers and weighing them.

    For those familiar with gelcoat spraying, this is not a system with coupled gelcoat and peroxide pumps. But rather an external mixing spray gun where the peroxide is simply fed from a pressurized container to the spray gun.

    Since we’re handling resins, solvents and peroxide, protective equipment including gloves is a must. That makes it cumbersome to whip out a smartphone to use it as a calculator to check the ratio. Since you don’t want to get gelcoat or peroxide on your expensive phone, you have to take off your gloves to handle it. This would have to be repeated several times.

    So I decided to make a diagram where one could relatively easy read off the peroxide percentage given the quantities of both components. This can be printed and laminated between plastic to make it resistant against stains.

    The whole thing can be found in a github repo.

  5. Disable firefox DNS

    Some spam, tracking and ad servers are blocked at the DNS level on my network. For me it is therefore undesirable that programs use their own DNS.

  6. Drawing with PostScript

    PostScript (in the form of ghostscript) was for me the first way to generate vector graphics outside of a CAD program. I have several hundreds of figures written in PostScript for inclusion in e.g. LaTeX document.

    Later I’ve started using other programs and modules like asymptote and TikZ. But there are cases (especially if you want a small file) where directly drawing in PostScript is still the best way to go.

    When the book Mathematical Illustrations was mentioned on hacker news, this re-kindled my interest in PostScript. And I learned some valuable lessons from it.

  7. TeXLive 2018 update

    Today I updated my TeXLive install to 2018. Although the install went fine, there was a problem with the binaries.

    Both asymptote and xetex were linked to different versions of some libraries than those that are supplied by ports. So I had to rebuild them.

    date: 2018-06-24
    reading time: 6 min.
    category: howto
    tags: TeXLive
  8. Using the FT232 with Python

    In this article I will try to document how to with with the FT232H using Python on FreeBSD. I will be using the Adafruit FT232H breakout board.

    Note that since I’m using FreeBSD, the library provided by FTDI doesn’t work. However, the library provided by Adafruit was written for Python 2, and doesn’t work with Python 3. I tried tinkering with it a bit to get it to work with Python 3, but that did not work out. In the end, I went with pyftdi since it doesn’t require a native library and it just works.


←  Page 9 Page 10 / 26 Page 11 →