linguistics, computers, and puns

A Scala Interview - Part 3

In the last post we finished implementing the TopQueue class and looked at how it was able to perform so much better than the plain sorting solution from Part 1.

This time we're going to drill down into Scala and turn our special purpose integer collection into an elegant, general purpose tool. We'll implement and briefly discuss a number of Scala features along the way. ...more

July 08, 2018 #deepdive #generics #interview #scala

A Scala Interview - Part 2

In this post we'll be developing the solution that we began designing in the last post. As a refresher, here's the problem we're solving.

Design and implement a method to select the largest m values from a very large list of n numbers.

Last time we learned that sorting the entire sequence of n numbers doesn't scale. In some cases, the numbers may not even fit in memory. But with our solution, this won't be a problem. ...more

July 06, 2018 #algorithms #deepdive #interview #scala

A Scala Interview - Part 1

I was once given the following interview question:

Design and implement a method to select the largest m values from a very large list of n numbers.

I liked this question because solving it (the way we'll be doing) touches on a good cross section of software design in Scala:

  • complexity ("Big O") analysis
  • polymorphism (subclassing, traits, and bounds)
  • testing!
  • ...and a few Scala-flavored ideas:
    • companion objects
    • implicit values

In this post we'll examine the problem, calling out a few factors that make this question interesting, and propose a design for our solution.

In upcoming posts, we'll follow the design through implementation, functional testing, and add a few bells and whistles. ...more

July 01, 2018 #algorithms #deepdive #interview #scala

JVM Upgrade for SmartOS

Joyent's SmartOS is a great virtual hosting platform. I've used it to deploy Ruby on Rails apps and even a Yesod app with excellent performance and minimal fuss. If you haven't already, go check it out. I deployed a full Tomcat Java app server in less than 30 minutes, including download and configuration time.

The Tomcat 7.0 package that SmartOS has is great, but the JDK 6 is showing some wrinkles. Given my fully configured and running system, how simple is it to install an aftermarket JDK 7 and configure Tomcat to use it?

Pretty damn simple. ...more

February 03, 2013 #jvm #unix

Dead Tree Nostalgia

So I was digging through some old computer books the other day and found what you might call my first "serious" programming book [picture right]. (My first was this colorful gem.)

The Tandy 1000 Programmer's Reference Manual has has seen better days, but it's in pretty good shape for a 27-year-old book. But I own plenty of books published pre-1990. What makes this one special? Aside from it being among my first geek tomes, it also represents so much of what has changed about technology. ...more

September 10, 2012 #assembly #basic #books #rpn

Stupid Perl Tricks

... wherein we demonstrate the wholesale assignment of an external package's symbol table to a lexical hash. We further demonstrate that bidirectional manipulation of the external package is possible. ...more

September 10, 2012 #perl

Load Average for the Masses

Some people like CPU meters. I collected them for quite a while myself. At one point I had 4 gkrellm instances on my desktop at once; one local, 3 connected to remote gkrellmd instances. More recently, I've used MenuMeters for this same effect in my OS X menubar.

But I also have quite a lot of terminals open, both local and remote, connected to up to half a dozen or more servers at one time. And I like to watch the cpu load on all of them. What to do? ...more

September 09, 2012 #c #linux #unix