Wednesday, August 21, 2019

Functional Program Design in Scala


The second class in the Scala specialization down. I was a little put off by the fact that this is basically a retooled/abridged version of the "Functional Reactive Programming" class, which made it feel incomplete. Regardless, the programming exercises were fun, if a bit lightweight. The lecture material was ... meh.

My solutions on Github: FunctionalProgramDesignScala


Wednesday, July 24, 2019

How to install OpenToonz and Synfig on a Chromebook

Backstory

I've wanted to dabble in digital art for some time now, and I finally got up the motivation to play around with it a bit on my dinosaur laptop. My 8 year old was showing some interest in drawing, and I thought she might have fun doing animation, so I started looking around for animation software. I found several programs, including opentoonz, synfig, and pencil2d. While she was immediately fascinated (and almost just a quickly lost interest), I was annoyed by how difficult it was to try to draw anything with a mouse.

Not long ago we had replaced my wife's aging Lenovo Twist with a Lenovo C330 Chromebook. For under $250 it was quite adequate for her needs. Being that it was a touch screen device, I thought it might be better suited for digital art, so I began looking into whether the programs I'd installed in Ubuntu could be used on it. There wasn't a Chromebook version, per se (boo), but it turns out that Chromebooks can now run Linux apps (yay!), but only if they have a version for ARM processors (boo).  "Welp," I thought, "guess I'll just have to see about building from source." How hard could that be, right?

For any non-techies who just want this to work, don't be scared. It's actually pretty straight forward...

Sunday, April 7, 2019

Generating a bigram language model from the Wikipedia corpus

Motivation


While working through the Scala Principles class, the final unit had an example exercise that involved creating a "mnemonic" for a telephone number by mapping the number to an English "phrase". While a fun exercise, I was unsatisfied with the naive generation of mnemonic phrases. Yes, you could get "Scala is fun" for 7225247386, but you also get:
  • sack air fun
  • pack ah re t
  • pack bird to
  • Scala ire to
  • rack ah re to
  • pack air fun
  • sack bird to
  • rack bird to
  • sack ah re to
  • rack air fun

... which are decidedly less helpful. I thought that if I could implement even a simplistic language model, like a bigram model, to the options, and then rank them, I could make the output a little more useful. So I went looking for some bigram data, and eventually ran across a Wikipedia corpus on corpusdata.org.  The second paragraph points out that prepping the data yourself is hard work and would require many hours, so paying them $295 for it is a steal. Challenge accepted mofos.

Functional Programming Principals in Scala

After a long break (Advanced Algos took a lot out of me), I decided it was time to take another class. When the topic of taking the Scala series of classes from Coursera came up in my programming group, I jumped at the chance. I needed a break from theory, and a chance to do some coding in a new language was just the ticket. This post covers the first course in the series, "Functional Programming Principles in Scala". tl;dr: Take this course, it's great!