teaching machines

4-pin Buttons on Arduino

At the early stages of learning, we tend to mimic without understanding. That’s how I learned to code, and that’s how I’m learning electronics. A book presents a circuit diagram, and I copy it faithfully. And lo, it works! That small thrill carries me to the next step of understanding. Here’s a circuit that I […]

TransportException with Eclipse and EGit

Students in my introductory programming class were getting TransportExceptions when trying to pull from a remote Git repository with the EGit plugin in Eclipse. The issue was a missing line in their .git/config. The file should have looked like this: … [remote “origin”] … fetch = +refs/heads/*:refs/remotes/origin/* The definition of fetch was absent. I think […]

Weighted Distribution in Unity UI

Suppose you have a Horizontal Layout Group in a Canvas-based UI in Unity, and some elements in the group should expand but not others. Or some should expand at different rates than others. Checking the Width option of Child Force Expand on the group seems like it might do what you want, but you are […]

Capturing High-resolution Screenshots in Unity

A student and I were collaborating on a poster. We needed an image of a Unity scene that for a 4-foot-by-4-foot poster. Capturing our screens at their normal resolutions resulted in images that got fuzzy when scaled. So, we worked up a quick method for taking screenshots at higher resolutions with a render texture. Perhaps […]

Multicolumn Layouts in Unity

Unity’s RectTransform can be used to achieve a couple of common multi-column UI patterns. I describe here how to achieve these using only anchors, offsets, and pivots—and not any layout groups. Percentage-based N-column Layout If your layout requires multiple columns and each column is apportioned a percentage of the total display, set each column’s X […]

Toward Understanding Unity’s RectTransform

Unity’s RectTransform layout system has confused me for a very long time. Not that there’s anything wrong with it. Confusion is what naturally happens when you approach a sophisticated system and just start pressing buttons. But in order to move past this stage, I’m documenting what I’ve learned after many hours of pressing. Properties Each […]

Fixing Our Bugs

As a kid, I played many Japanese video games. In high school, I got a permanent release from study hall to teach myself Japanese in the computer lab. I chose the college I did because they offered Japanese courses. (At least they did at the time I applied. But they were cancelled before I got […]

Bad Star

If you are an illustrator, there are two things that are harder to draw than anything else. The first is lettering. Bless you, illustrators, if you have to draw a busy street scene with lots of storefronts full of signs and words. The second is stars. Most illustrators just give up on stars. They are […]

Multiple Assignment in Twoville

As I dream up animations in Twoville, I find myself generating a lot of shapes that share properties with other shapes. For instance, these two circles have the same radius and color: a = circle() b = circle() a.radius = 10 b.radius = 10 a.rgb = [1, 1, 0] b.rgb = [1, 1, 0] I […]

With Blocks in Twoville

In my software engineering class in college, Dr. Drake dropped on us a half-written piece of software that managed a database of movies. Our challenge was to improve it. It was the first and only time I’ve touched Visual Basic, and I remember only one thing about the project and the language: with-statements. Suppose you’re […]

1 17 18 19 20 21 46