花花花 SuperLaserNino 花花花

DPI-dependent CSS in Atom and everywhere else too

04 Dec 2017

When programming on low-resolution screens, I like to use 10pt Monaco with antialiasing turned off. But when switching to my MacBook’s retina display, I want antialiasing turned back on. Until now, I would manually comment/uncomment some CSS in Atom’s styles.less file to change this.

Turns out, you can define CSS rules based on the current screen resolution. By adding the following to styles.less, Atom automatically switches the font and antialiasing settings as soon as you move the window from one screen to the other:

atom-text-editor {
  @media (-webkit-max-device-pixel-ratio: 1), (max-resolution: 150dpi) {
    .line {
      -webkit-font-smoothing: none;
      font-family: Monaco;
      font-size: 10;
      transform: translateX(1px);
      font-style: normal !important;
      * {
        font-style: normal !important;
      }
    }
  }
}

The transform line is there because Atom will sometimes cut off the first column of pixels when antialiasing is turned off.

Smooth cursor motion in Atom

08 Oct 2017

I’m currently trying out Atom as the main tool for my computer job and I wanted to make it more fun, so I added some CSS to make the cursor move smoothly and give the text-selection rounded corners. To try it yourself, click click on Stylesheet in the Atom menu and paste this code:

atom-text-editor .cursor {
  transition: all 80ms;
}

atom-text-editor .selection {
  border-radius: 4px;
  transition: all 20ms;
}

Now everything is nice and smooth. Yay!

Big numbers, small numbers

Created: 15 Mar 2017

Modified: 15 Mar 2017

You don’t want things to be complicated. I get it. I am here to help. Don’t worry, it’s all going to be over soon.

Continue reading →

Willpower day

08 Mar 2017

Background

I noticed I wasn’t happy with the way I spend my time. Over the last year or so I learned to structure my work habits such that I need the least amount of willpower possible to get myself to work. I tried hard to get myself to do things without requiring willpower and, in the process, built somewhat of an aversion to do anything that seemed like it might require effort. For the most part, this was good: I learned to notice moments when I just didn’t have the mental capacity to do work, and so learned not to judge myself for sometimes not working and instead looking at comics on the internet.

Continue reading →

Inconsolata LGC with oldstyle numerals

18 Dec 2016

In my perennial quest to make everyone love oldstyle numerals, I decided to make a fork of one of my favorite programming fonts, Inconsolata, and give it oldstyle numerals.

The numbers 0 through 9 set in Inconsolata LGC using oldstyle numerals
This is what it looks like

The font can be downloaded from GitHub.

If I figure out how to properly use FontForge, I’ll also add programming ligatures at some point.

Focusing on the breath

15 Nov 2016

During mindfulness meditation, you’re supposed to focus on your breath. If you encounter any stray thoughts, you’re instructed to notice them and let them pass by, always returning your focus to the breath. I often find it difficult to stay focused on my breath for an extended length of time; it’s easy to start focusing on the breath, but after a short while, I’ll notice I’ve drifted off to thinking about something completely different.

I recently realized that, since it’s easy to shift my focus instead of holding it, it is much easier to focus on one breath at a time. Then, when the breath is over, instead of trying to keep focused, I’d repeat the mental motion of shifting my focus to the breath – again, only for a single breath. This way, I’ve been able to stay focused on my breathing for many minutes without drifting off into other thoughts.

So, in general, this is good, but it also feels like cheating since I’m not actually holding the focus; instead I’m doing a new mental motion after every single breath, which might put me in a less calm state than I’d be in if I could just learn to stay focused. I’d be curious to hear from people who have more experience with meditation, whether this is a bad way of doing things.

Four or five thoughts on scientific writing

18 Aug 2016

A few days ago I handed in my bachelor’s thesis in physics and I had a few thoughts while writing it. Some of these thoughts only apply to literature that features a lot of mathematical equations, but some apply to all academic writing, or all writing in general.

Continue reading →

∞/3: Epilog · Abstraction

26 Jun 2016

[When I gave a draft of part 3 to a friend to read, they commented on the first paragraph, “Math isn’t about giving things funny names; it’s about giving things meaningless names!” I had a thought on this topic but when I wrote part 3, but I couldn’t really make it fit and thought it wasn’t that interesting anyway, but my friend said it was, so here goes. (Parts 1, 2, 3.)]

15-year old Nino had an idea once: “Math is stupid! When solving physics problems, you always have to take the actual physical quantities, then make up weird letters to put them through the equations, and then you have to translate them back to the physical quantities. This makes it harder to see what you’re doing because, when you glance at an equation, you only see the relations between letters and not the relationships between the actual physical quantities. In the hundreds of years that science has been around, someone must’ve come up with a more intuitive way to write equations. After all, computer scientists don’t just call their variables a, b, c, x, y, z either!”

Continue reading →

3/3: Mathematical notation

Created: 13 Jun 2016

Modified: 12 Oct 2016

[Part 3 is about communicating mathematical ideas. Part 1, Part 2. I took care to contain the tedious math bits in single paragraphs, so the point is still clear if you choose to only read the fun parts.1]

summary. There is no such thing as “wrong” notation. All that counts is that you get the math right and communicate your ideas clearly.


Last time I explained how it’s not accurate to say that an electron “is” a wave function, because an electron is a thing in the universe and a wave function is a mathematical object, and mathematical objects don’t live in the real universe. When people talk about wave functions, they often use the letter $\psi$. Obviously, even though it looks all nice and wavy, the $\psi$ itself isn’t the wave function either – it’s just its name. The concept of names is one we know and love from the real world: When I point at a chair and say, “This is Bob,” it’ll be clear what I mean when I explain that Bob has three legs. While it’s a terrible idea to call a chair Bob, giving things and their relationships with each other funny names is basically what mathematics is all about.

  1. In the future, when I have a list of my most notable essays, this one will be “The Long, Confusing, Meandering One.” This is my A Feast For Crows in terms of exciting action; it’s my American Gods in terms of quickly getting to the point; it’s my Getting Things Done in terms of elegant phrasing – you get the idea. Think of this more as a piece of performance art, rather than an informative article. 

Continue reading →

2/3: Models

Created: 30 Jan 2016

Modified: 13 Jun 2016

[Part 2 is the best part. [Part 1][part1], [part 3][part3].]

In science, we try to understand the world by building models and theories that describe it. You see an apple falling on your head, think, “oh, maybe that’s how the planets move, too”, and you write down rules that allow for the motion of planets and don’t allow for some phenomena you do not see, like things falling upward. You call the collection of those rules your model, or theory. When you have your model, you perform more experiments to test it, and every time your model’s prediction roughly matches your observations, you get more confident that your model is correct.

[part1]: http://ninoan.com/just-the-way-things-are “1/3: Just The Way Things Are ❀✿❀ SuperLaserNino ✿❀✿”
[part3]: http://ninoan.com/notation/ “3/3: Mathematical notation ❀✿❀ SuperLaserNino ✿❀✿”
Continue reading →