How Many First-Years Are Taking Their Free Course?

To de-densify campus, Brown University moved to a three-term model in which students take courses for two of three possible terms. This third term will be carved out of the summer months of 2021, during which an unlucky subset of the student body will swiftly discover that Brown does not air-condition its dorms. So, who are these unenviable souls? Well, first-years, obviously, who will begin in the spring semester and continue through the summer.

To compensate them for this inconvenience, Brown has extended all first-years the opportunity to remotely take one course this Fall, for free! How many took Brown up on this offer?

Brown’s Class Size Paradox

University Admissions departments love to brag about their schools’ small class sizes. Brown University, for instance, boasts a 7:1 student–faculty ratio (so “you’ll have a lot of face-to-face time with some of the best researchers and teachers in academia”) and that “72 percent of our undergraduate classes have fewer than 20 students.” These claims invite prospective students to daydream of cozy, intimate classrooms, and personalized learning experiences — dreams quashed (or perhaps squished?) on one’s first day of classes.

Nobody is lying, per se — this is merely an instance of the “class size paradox”: the size of the average class is relatively small, but the experience of the average student suggests otherwise.

Private Implementations of a Public Trait

In Rust, there is no such thing as a private implementation of a public trait. If you implement a public trait for your public type, anyone can take advantage of that implementation! In other words, while types and traits have a first-order notion of visibility, trait implementations merely inherit the visibility of the involved trait and types. A third-party cannot use the functionality of a private trait on a public type, nor use the functionality of a public trait on a private type.

So, to make a public trait implementation private, we merely need to introduce a private type into it!

Private Methods on a Public Trait

In Rust, the methods of a trait inherit the visibility of the trait itself:

pub trait Foo<Arg> {

    pub(self) fn foo(&self, arg: Arg);

    /* other public methods */

}
error[E0449]: unnecessary visibility qualifier
 --> src/lib.rs:7:3
  |
7 |   pub(self) fn foo(&self, arg: Arg);
  |   ^^^^^^^^^

At minimum, we should hide this method from our documentation:

pub trait Foo<Arg> {

    #[doc(hidden)]
    fn foo(&self, arg: Arg);

    /* other public methods */

}

...but this doesn't actually prevent outsiders from calling our method! Fortunately, there are at least three other patterns #[doc(hidden)] can be combined with to make foo externally unusable.

Taming nalgebra's Rustdoc

Nalgebra is a powerhouse of functionality, but its documentation can be overwhelming—the documentation for Matrix lists over 600 methods. Your documentation endeavors might not be quite so overwhelming, but you still could benefit from these three tricks nalgebra uses to improve its docs.

A Gentle Introduction to Transmutation Stability

What's up with transmutation stability?

Fixing include_bytes!

Rust's include_bytes! macro lets you statically include the contents of a file into your executable's binary. The builtin is a quick-and-dirty solution for packaging data with your executable, and perhaps even helping the compiler optimize your code! Unfortunately, it's difficult to use correctly.

Javascript Generators, Meet XPath

Using Generators to Modernize a Geriatric Javascript API for $CURRENT_YEAR