Printing to a 1980-era daisywheel printer from OS X, part 2

The Hardware

Printers of this era used a 25-pin parallel interface and connected to computers with what was generally called a “Centronics” cable. Modern computers do not include these ports though they can sometimes be added with a PCI card or express card. As of this writing, Startech manufactures many varieties, but with drivers only for Windows and Linux. There are units from other companies too, but I have never found OS X drivers. For a Mac, we need to go another route.

parallel adapters

Many manufactures sell USB-to-parallel adapters that work pretty well. Of the ones I own, those with chipsets by Prolific seem to work the best, but they’re all pretty good. The adapter is a standard USB device and can be connected directly to the computer or at the far end of a hub. The adapters generally have DB-25 male connecters on the non-USB end and connect directly to the printer. Our job thereafter will be to send the correct ASCII codes to the adapter, which will then pass them on to the printer. There exist fancier adapters that allow the user to change the speed of the adapter and other aspects of its interface but these are more expensive and not necessary; the default settings implemented in the normal adapters are fine.

Printing to a 1980-era daisywheel printer from OS X, part 1

I’ve long been fond of daisywheel printers, and they can generally be picked up for the cost of shipping when somebody finds one rotting in the garage. They’re easy to use with computers of their own era. I generally test them with a Tandy WP-2, which is a dedicated word processor. Connect the WP-2 to the printer with a standard Centronics parallel cable, type a few lines and hit the ‘print’ command. Unfortunately, printing from Windows or Mac is a bit more complicated.

Modern Macs will print to almost any page printer via the CUPS system, but the operating system provides little support for printing to an old line printer. Basically, if the printer expects to get a picture of a page, it will work with a Mac just about instantly. If you want to send across a stream of letters, a bit more work is needed.

The following posts will explain how to get one of these old beasts (an NEC Spinwriter ELF 360 in this example) running under OSX.

New release of Bloomberg-to-Mathematica code

A new release of my code to move data from Bloomberg to Mathematica. The big changes here include

  • rolling all four functions (current data, historical data, intraday data, and intraday bar data) into a single executable. This reduces the number of connections needed by Mathematica among other advantages,
  • standardization of function names,
  • addition of DPDF code to intraday functions, allowing the user to specify whether or not data should be adjusted for dividends, and
  • it has been compiled for the first time for x64 as well as x86.

This interface, its source code, and compiled binaries are freely available at
https://github.com/MichaelSternNYC/

Example:

x1 = msBBGhistory["IBM US Equity", "Px_Close_1D", {2015, 1, 1}, "", "Day", "use DPDF" -> False];
x2 = msBBGhistory["IBM US Equity", "Px_Close_1D", {2015, 1, 1}, "", "Day", "use DPDF" -> True];
DateListPlot[{Callout[x1/x1["FirstValue"], "without dividends"], Callout[x2/x2["FirstValue"], "with dividends"]}, PlotStyle -> {Red, Blue}, PlotLabel -> "Historical IBM Returns", Frame -> {True, True, False, False}, ImageSize -> Large]

Graph of normalized IBM prices demonstrating dividend adjustment and Callouts.

Cycling data via Mathematica

Modern cycling trainers show a video and correlate resistance with what’s being shown on screen. You can “ride” a stage of the Tour de France and it will be tougher as you ride up steeper hills. Zwift has created virtual courses that cyclists from around the world can ride simultaneously, interacting with each other. It records detailed information about your virtual progress in a .FIT file, along with your heart rate, cadence, and other data from third party monitors you may be using.

Using fitparse, I created software that converts these into a format that Mathematica can understand, and using Mathematica, it is possible to break down the data a million ways. A few graphical examples are shown below.

The topography of an evening's ride in Zwift's Watopia as decoded by Mathematica

The topography of an evening’s ride in Zwift’s Watopia as decoded by Mathematica

Velocity on the course, roughly the inverse of changes in elevation except where there are sprints

Velocity on the course, roughly the inverse of changes in elevation except where there are sprints

My heart rate as measured by a Wahoo heart rate monitor

My heart rate as measured by a Wahoo heart rate monitor

Bloomberg-to-Mathematica interface now supports overrides

Reference data requests made via the Bloomberg API can be simple (“current price of IBM Equity”) or complex (“trailing 12 month beta between AAPL US Equity and the Nasdaq index”). To send those more complex requests via external software requires overriding Blomberg’s default fields, something the Bloomberg-to-Mathematica interface did not allow. Until now.

moStarts = DateRange[{1990, 1, 1}, {2016, 4, 1}, "Month"];
moToInclude = 12;
corr1 = Table[{moStarts[[i + moToInclude - 1]], msGetBBG["SPX Index", "CORR_COEF", "noisy" -> False, "overrides" -> <|"BETA_OVERRIDE_REL_INDEX" -> "NDX Index", "BETA_OVERRIDE_START_DT" -> bbgifyDate[moStarts[[i]]], "BETA_OVERRIDE_END_DT" -> bbgifyDate[moStarts[[i + moToInclude - 1]]]|>]}, {i, 1, Length[moStarts] - moToInclude}];
corr2 = Table[{moStarts[[i + moToInclude - 1]], msGetBBG["SPX Index", "CORR_COEF", "noisy" -> False, "overrides" -> <|"BETA_OVERRIDE_REL_INDEX" -> "USGG10YR Index", "BETA_OVERRIDE_START_DT" -> bbgifyDate[moStarts[[i]]], "BETA_OVERRIDE_END_DT" -> bbgifyDate[moStarts[[i + moToInclude - 1]]]|>]}, {i, 1, Length[moStarts] - moToInclude}];

DateListPlot[{corr1, corr2}, PlotLabel -> "Trailing 12-Month Correlations", Frame -> {True, True, False, False}, PlotStyle -> {Blue, Purple}, Epilog -> {(Text[Style["SPX vs. NDX", FontSize -> 10, Blue], {{2010, 9, 2}, 1.01}]), (Text[Style["SPX vs. U.S. 10 Yr Rates", FontSize -> 10, Purple], {{2007, 3, 2}, .65}])}, ImageSize -> Large, Axes -> True]

Correlation of SPX vs. various things over time

The interface and source code can be found at GitHub