RSSAmplifier

Blog

Leah Hanson

Recent content on Leah Hanson

blog.leahhanson.usRSS feed ↗30 posts

Latest posts

About

I’ve recently moved to Canada from the US. I’d love to get your advice if you live in Canada or have moved here from the US: I’m @astrieanna on Twitter. I work at VMware (via the Pivotal acquisition). This is still the best job I’ve ever had – working on infrastructure with kind, thoughtful engineers while pair programming. I’ve never been more productive at…

Organizing Scrapbooking Supplies

A summary of my strategy and current inventory

Speaking

Past Talks I wanted to save all the links to videos of me speaking in one place, and this page is that one place. 2017 Inside Websockets at Seattle.rb in Seattle, WA 2016 Haiku Vector Icon Format (10min) at CodeAsCraft in NYC, NY video Inside WebSockets at ACM Applicative in NYC, NY video Inside WebSockets at OpenSource Bridge in Portland, OR 2015 Contributing to Julia (10min) at JuliaCon in…

500 Byte Images: The Haiku Vector Icon Format

Haiku uses a custom vector image format to store icons. This is surprising both because most OSes consider bitmaps to be totally sufficient to represent icons and because there are plenty of vector graphics formats out this (e.g. SVG). The goal of the Haiku Vector Icon Format (HVIF) is to make vector icon files as small as possible. This allows Haiku to display icons as several sizes while still…

Learning Go: Lexing and Parsing

Learning golang by solving a simple parsing problem.

Tasty: My First Go Program

Learning golang by writing a simple problem.

Using ASCIIPlots.jl

No Julia plotting package has been crowned king yet. Winston and Gadfly are the main competitors. PyPlot is a Julia wrapper around Python’s matplotlib; it is a stop-gap for use while the native Julia implementations mature. However, all three of these packages have non-Julia dependencies; this can cause installation frustration. An alternative is ASCIIPlots; it’s the simplest plotting…

Julia Helps

Programmers are always learning. You learn how to use new APIs, new functions, new types. You learn why your code doesn’t work. Julia has a lot of built-in tools to help you navigate, learn, and debug. You can use these in the REPL and in normal code. In this post, I split these functions and macros up based on what they help you do: understand functions, examine types, navigate the type…

Julia Calling Python Calling Julia...

Julia is a young programming language. This means that its native libraries are immature. We are in a time when Julia is a mature enough as a language that it is out-pacing its libraries. One way to use mature libraries from a young language is to borrow them from another language. In this case, we’ll be borrowing from Python. (Julia can also easily wrap libraries from C or Fortran. In fact,…

Making a Tool Rack

In the shed where we keep gardening tools, there was a mess. Dad wanted a thing to get all the long-handled tools up off the floor and out of the way. I started learning to weld a year ago, and have been bugging him for a project. These things combined beautifully when he designed a tool rack with me in mind. The shed has a cinder block wall with an open top.

Julia Introspects

When people are introspective, they’re thinking about how their minds work, about how and why they think what they do. The Julia language has some impressive facilities for letting you see how the compilers’ mind works. Using convenient built-in functions that are available both at the REPL1 and in normal code, Julia allows you to see the layers of internal representation that your…

Running Shell Commands from Julia

Here are some examples of starting and interacting with other programs from Julia. The official documentation is pretty good, but I want something with more (basic) examples and fewer words. I do reccommend reading that to see some of the fancier tricks you can pull (and for up-to-date documentation, when this blog post gets stale). Running Other Programs The easiest, most basic way to run a shell…

Well, that was embarrassing.

I have long been confused by the strange behavior of integers as arguments to functions. If I pass a variable into a function, I expect the function to be able to modify it. This expectation applies to variables local to the calling context and to global variables; it also applied to Strings and Floats and Integers and Chars. When I’m trying to do something (like modifying Int arguments…

Writing FizzBuzz in Julia

One of the simplest first programming exercises to try in a new language is the FizzBuzz problem. It’s a simple toy problem that is less trivial than “Hello, World” because it also involves using basic control-flow structures. This blog post assumes that you’ve already installed the Julia programming language (hint: see GitHub) and figured out how to open a REPL (hint: run…

Using TCP Sockets in Julia

This post was updated on June 28, 2013 to reflect changes in the TcpServer/TcpSocket api in Julia. Recently, I’ve been writing the WebSockets implementation for Julia. TcpSockets were not well documented when we started using them, so I figure a tutorial might be useful for anyone else who might want to use TCP sockets in Julia. REPL server I’m still figuring out this “try things…

A Simple Monad Tutorial

There are surely too many monad tutorials on the internet by now. However, I, like many before me, feel the need to try my hand at it. In most non-duck-typed programming languages, you can define an interface, which is a set of functions of particular names and types. A type implement that interface, by implementing the function signatures the interface requires. Many types can implement the same…

A First Parallel Program in Rust

Code in this tutorial runs under Rust 0.8 as of October 31, 2013. Rust is a compiled, strongly-typed language with first-class functions and closures. It has shared-nothing light-weight thread-based concurrency with message-passing for communication. It has memory safety but with this complicated three-kinds-of-pointers arrangement. It has a neat modern type system with structs (records) and enums…

Hello, Haiku -- Writing Your First Program for Haiku

This is a walk through of creating your first GUI program for Haiku. We’re writing a super-simple application using just the built-in API. Assumptions About You Haiku and Paladin I’m assuming that you’ve installed Haiku, and have used installoptionalpackages to get the Paladin IDE. OOP and pointers We’re writing the program in C++ because that’s what Haiku and its…

Falling for Haiku OS

Last February, I installed Haiku (alpha 3) on my eee pc 901. It worked well, except for not handling password-protected wifi networks. I used it a couple of times for web browsing, and then forgot about it. Recently, I decided that installing random operating systems is amusing. This lead to installing Haiku as one of several OSes on my desktop, and installing the new alpha 4 version on my eee.

Notes on Installing and Booting FreeBSD from Grub2

I have recently spent several days trying to install and boot FreeBSD, Haiku, and OpenIndiana on a single hard drive. I currently have Xubuntu, FreeBSD, and Haiku installed and booting. I am using a FreeBSD 9.0 release live-usb image as my install media. This process has involved installing FreeBSD five or six times. Below are some notes on what I’ve figured out in the process. Note that I…

Assignment Manager -- Enroll in Courses

Today is one month to the day since I last updated this blog. At that point, I had finally added course homepages. Now, users can create and enroll in courses. They are also required to enter a username and email address. That’s really sad for a month’s time, and I wish I was forgetting some exciting feature. There are things that need to be refactored: Database code needs organizing,…

Assignment Manager - Course Pages

Today, I have course homepages, generated from the database, working. Additionally, the side menu is populated by courses that the user is enrolled- in/related-to. The links really work, and take you to the course’s homepage. I moved all the code that does SQL queries into a DatabaseHelpers module. This makes things significantly cleaner, but there’s probably more I can do on the…

Assignment Manager -- Relation of Users to Courses

Having modified the happstack-authenticate hsp-demo to display my theming (meaning the navbar and menu I took from a Bootstrap demo) – on all the pages, even the login/logout ones, it is now time to make logged-in page display a bit more dynamic content. Meaning, something besides your user id. Actually, I also need to make that display the user’s “nickname”, which appears…

Assignment Manager -- Picking Libraries

In building a web app, there are a lot of libraries to choose. Here’s what I’m planning to use in building Assignment Manager: Templating: HSP HSP templates are written right in the Haskell files. They use Template Haskell to achieve this. You can insert arbitrary Haskell into the templates. Database: HDBC (with sqlite3) HDBC is a thin layer over SQL. The queries are just strings; the…

Assignment Manager -- First Post

Assignment Manager is a web-app written in Haskell on HappStack. The goal is to build a web interface to handle the assignment, submission, and grading interactions for a college course. Professors, TAs, and students will all interact with the application over the course of each assignment’s life cycle. You can see the repository on Bitbucket So far, I’ve gotten part-way through the…

The Last Question

###Introduction Why is it my favorite? For one thing I got the idea all at once and didn’t have to fiddle with it; and I wrote it in white-heat and scarcely had to change a word. This sort of thing endears any story to any writer. Then, too, it has had the strangest effect on my readers. Frequently someone writes to ask me if I can give them the name of a story, which they think I may have…

SciFi Stories: How do robots think?

There are a lot of scifi stories that involve robots; some of them even let us see things from the robots’ point of view. Here I’m collecting places where authors transcribe the thought processes of a robot character rather precisely. ###John McCarthy: The Robot and The Baby (2001) Here, R781 is a household robot in the abusive home of a single, drug-addicted mother and her infant son.…

SciFi Short Stories: What is God?

Some short works of science fiction have some fascinating takes on how reality works, on who or what God is. These three stories are all very short, and each show a different facet of how things could be. Warning: the discussion of each of these stories contains spoilers. These stories are short; read them before the discussion. ###Isaac Asimov: The Last Question (1956) I wrote a more indepth…

Across a calm green sky

_This is a rewrite of the essay I submited with my college application in 2007._ A cloud of small, winged creatures darts across a calm green sky. They flash in a rainbow of gem-tone hues as the sun bounces off thier skin. Deep in the earth below, an ancient behemoth is sleeping. It’s abode is a damp, dimly-lit cavern; it’s bed is a mound of treasure and bones.

Against a serene chartreuse sky

_This was written first as a practice college application essay for english class in the Spring of junior year. That Fall, I edited it for use as my actual college application essay. Later the same year, I submited it to our school’s writing contest; it won first place in the Non-fiction category._ Against a serene chartreuse sky, a flurry of small, winged creatures darts, flashing in…