bpholt's picture

Partial Application of Type Parameters in Scala

Scala doesn’t directly support partial application of type parameters, which can be frustrating when several are required but only a portion can be inferred by the compiler. For example, this implicit class wraps a request object from the Amazon Java SDK and defines a method that accepts an asynchronous function that should be used to execute the request. (This provides a more fluent Scala API than using the Java SDK directly.)

Since the effect type F is not bound anywhere else, it cannot be inferred. I would like to provide just the type of F and let the compiler infer Req and Res. Unfortunately, since Scala doesn’t support partial application of type parameters, the caller has to explicitly provide all three types.

There is a workaround. One can wrap the function in a class paramterized by the unknown types, define an apply() method on the class that is parameterized by the inferrable types, and provide a function returning a new instance of the class. (The details are more fully explained in this blog post by Tony Morris.)

Read the full details in the full post.

bpholt's picture

Matrix Builds with Automatic sbt-release

Following up on yesterday’s post, I ended up modifying the build process for the scala-aws-utils project. The two problems described in the “Caveats / Room for Improvement” section bothered me.

Protected branches help prevent accidental pushes to master, a backstop I didn’t want to lose. The switch from Java 7 to Java 8 for the Scala 2.10 and 2.11 artifacts wouldn’t have impacted our use of the library, but why unnecessarily restrict who can use those artifacts?

bpholt's picture

Automated Releases using sbt-release and Travis CI

At Dwolla, we have several Scala-based open source projects, each of which needs to be automatically tested and built. We have these projects set up to build using Travis CI, which the build results reporting back to GitHub for branches and pull requests. Merges to master are built and artifacts pushed to Bintray automatically as well.

We hadn’t automated the release process, though. Pull requests were responsible for updating the version information correctly, which could be tedious and somewhat error-prone. Concurrent pull requests needed to resolve versioning conflicts. Local development usually proceeds using a ‑SNAPSHOT version, so Ivy knows to overwrite any artifacts being created, but that means I have to remember to change the version in the project’s build definition before committing my changes.

Several Scala-based open source projects use the sbt-release to manage their release process. The plugin ensures no snapshot dependencies are being used, moves the project from a ‑SNAPSHOT version to a release version, commits and tags the version change, and builds and publishes artifacts. In the end, two commits are created (the release version and the next snapshot version).

bpholt's picture

Des Moines Women's March

I marched in the Women’s March at the Iowa State Capitol today, in solidarity with all those who would stand against fascism and the erosion of human rights. Here are some of the pictures and video I took during the march:

bpholt's picture

Scala, Docker, and our open-sourced SBT tools and libraries

At Dwolla, the platform team dedicates lots of time to writing tooling, making our teams’ lives easier. What’s particularly exciting is when those tools have wider application beyond the walls of Dwolla. Since our team spends lots of time with Scala microservices deployed using Docker, we’ve written several SBT plugins and helper libraries. These plugins help us manage our services, both in production and locally during development.

All of the projects described below have been released on GitHub using the MIT License—pull requests are welcome! Each project contains a Bintray badge in its README, linked to where its artifacts have been published in one of Dwolla’s Bintray repositories.

bpholt's picture

Harvest 2014

I’m pleased to share with you my latest video creation:

Thanks to Holt, Inc.—Mike (my dad) and Gary (my uncle)—for letting me ride along that weekend in October. Additional thanks to Nick (my cousin) for washing the equipment and helping with mounting the GoPro, and to Kathleen (my mom) for driving me around in the field, allowing me to focus on UAV flight.

bpholt's picture

Starting Something New

Tomorrow is my first day at Dwolla! After a couple weeks off for Christmas and New Years, I’m excited to get started and learn more about what I’ve gotten myself into. I know Dwolla is a United States-only e-commerce company that provides an online payment system and mobile payments network (thanks, Wikipedia), and I’ve been a customer for a couple years now. I know many of the people I’ll be working with. I don’t yet know specifically what I’ll be working on, and of course there are the typical new workplace concerns regarding the culture and whether the chairs are comfy.

December 23, 2014 was my last day at John Deere. It was a little scary leaving Deere: I’d worked there full-time since graduating from college in 2005, and even spent my summers and winter breaks there as an intern since graduating high school in 2001. I spent time with nine different groups in various roles of increasing responsibilty, writing code in Java, SAS, ABAP, Puppet, JavaScript, Bash scripting, VBA, various JCL/mainframe tooling (as far as I know, Dwolla has no mainframes…), and HTML (and probably some I’m forgetting).

I visited Mexico, Germany, and India on behalf of the company, extended those trips to visit Austria, Switzerland, Scotland, and the UAE, and lived in India for six months. (All my intercontinental travel was in business class, too.) Domestically, I visited New York, Boston, San Francisco, Chicago, Minneapolis, Austin, Amarillo, Los Angeles, Kansas City, Fort Collins, Omaha, Las Vegas, Jacksonville, Atlanta, the Quad Cities (so many nights in Moline…), Waterloo/Cedar Falls, and several other small towns in Iowa, Illinois, Indiana, and Texas. I regularly visited my alma mater, the University of Illinois, to recruit and present to students on behalf of the company. In India, I saw the Taj Mahal, the Amber Fort of Jaipur, the Ellora Caves, and the Qutb Minar. I spent time in the quaint German resort town of Bad Sooden-Allendorf, the metropolis of Frankfurt, and the university town of Kaiserslautern.

I directly supervised a handful of employees (Sadly, including having to fire one.), managed the work of several offshore teams, and provided architectural direction for projects with hundreds of developers. I represented the company publicly to the press and industry standards groups, and I even met with senior leadership and a member of the Board of Directors. I worked with great people, including some who are now among my best friends, and had some amazing opportunities.

Lots of people have asked me why I left Deere. There wasn’t any one reason, nor was it really driven by the idea of leaving. My friend Jared Dellitt has been encouraging me to make the leap for probably 18 months, and from what I’d heard from him and others that work there, this feels like a great opportunity to try something different, and above all, learn in a new environment. So I’m leaving something familiar for something unknown, in the hopes that I learn and grow (and thrive) in a new environment. Dwolla is a much smaller company—from 60,000 employees to 60—with a much greater focus on software and growth. It’s a startup that has been around for about four years, as opposed to an established manufacturing concern founded in 1837. I’ll be working with staff in Des Moines and San Francisco, potentially relocating to the Bay Area in a few months as well. I will meet a new circle of colleagues, and hopefully, through them, meet others in the broader community. I’ll be learning an entirely new technology stack, primarily Scala and C#. I can’t wait to get started!

bpholt's picture

Total Lunar Eclipse

Given that my body half thinks I’m still in a European timezone, I decided to get up early and watch the total lunar eclipse, taking some photos while I watched.

Blood Moon

bpholt's picture

Apple Canyon Lake with a Phantom UAV and GoPro

Interest in unmanned aerial vehicles, or UAVs, has soared over the last few months. After seeing the AirDog Kickstarter campaign, I decided to buy in, and after some research, I bought a DJI Phantom 2 and a GoPro Hero 3+ Black edition. I got them both about three weeks ago and they’ve been a lot of fun. Using iMovie to combine the footage from the drone, the waterproof GoPro, and a little bit of Dad’s Nikon with a 70–300mm lens attached, I put together this video from our weekend at Apple Canyon Lake.

Thanks so much to Kevin and Susan for letting us stay at their cabin for the weekend!

Several people have asked about exactly what I’m using. Here are the details:

I also bought several mounts and accessories for the GoPro (including the floaty backdoor (≈$10 at Amazon) and the wrist mount (≈$50 at Amazon), used for the footage in the trailer) and an extra battery for the Phantom 2 (≈$130 at Amazon).

Dad has a Nikon D3200 we used with my ProMaster 70–300mm f4–5.6 lens to shoot people jumping off the rock. This was a little challenging because the D3200 didn’t want to auto-focus this lens, so not only did I need to deal with the rocking of the boat, but had to manually focus as well. (That’s why there is no footage of me jumping off the rock—Dad didn’t realize it needed to be manually focused.)

Click “read more” to learn more about the drone, camera, and other technology used in the video!

bpholt's picture

Germany in March

Opportunities for travel are definitely among the perks of my job, and this latest trip to our offices in Kaiserslautern was no different. Our meetings started Monday, but several of us took the red eye flight arriving Sunday morning (in order to be a little more well-rested for work) and thus had several hours to kill.

Jill, Mike, and I drove down from Frankfurt, which meant several stretches of unlimited-speed Autobahn. I rented the car because I wanted to open it up, but unlike last time, I don't think we achieved the top speed of our Volvo. This hatchback was much smoother at 180 kph than the Opal van I drove while last in Germany for work was at 170, and it was certainly fun to drive.

Once we settled in to the hotel, we met with Steve and drove through the Palatinate Forest towards Neustadt. We wanted to check out the Hambacher Schloß, a small castle said to be the “birthplace of Germany democracy” because of a protest march held there in the early 1800s. It was a lovely drive through the winding roads of the forest, with only a couple close calls where the road narrowed through some villages. Luckily we had a navigation system or we might have gotten lost several times, but we made it to the castle and found that lots of others had the same idea!

After passing several prospective parking spots up because we weren't sure they were legal places, we finally got settled into one about a kilometer down the hill. While we were parking an older couple gave us their parking ticket, saving us several Euros and probably a second trip up and down the hill to get change for the parking meter. As it was, we climbed the hill to the castle and spent several minutes admiring the views and enjoying the beautiful 60° weather.

The view from Hambacher Schloß

We explored the castle and had dinner in the 1834 restaurant. Unfortunately there were no seats outside but beer was still served, so we didn’t mind too much. I had an enormous roast pork chop, which was delicious and highly recommended. It was served with the back fat and skin on, which was excellent. Germany knows what to do with pork. (Beef, on the other hand… not as good.)

Syndicate content