mark cerqueira well-rounded nerd

Trails of Cold Steel

I just wrapped up Legends of Heroes: Trails of Cold Steel on the Vita. It’s a JRPG set in the Legends of Heroes world, focuses on a class of students at a military academy, and guides us through their field studies around the empire as they learn about brewing troubles. The game is like Grandia with a turn-based and position-based battle system; Persona with lots of focus on character development and relationship building; Final Fantasy 7 with a materia-esque system for powering up your team; and Xenoblade Chronicles because it has a ridiculously amazing soundtrack.

An interesting cast of characters.

This game is a solid 40 hours of world-building for the first entry of a three-part series. The plot is delicately and intricately laid out and the game ends on a massive cliffhanger. This game is not for those who want a straightforward plot or a self-contained story that resolves itself by the end. While the gameplay and battle system is enough to warrant a play-through, you’ll likely be craving the next entry by the time the game wraps up.

Lucky for me, the sequel, Trails of Cold Steel 2, comes out next Tuesday!

Twitter's Lonely Follow Button

The Follow button on Twitter feels strangely out of place. The left side of the page has the Tweet to and Message actions. I tend to look there when I want to follow someone. But the Follow button is all the way on the right.

Hanging out all the way on the right...

It’s above the Who to follow section which kind of makes sense. I’m unsure if the current three column separation is ideal. Perhaps a two column version where the Follow button and Who to follow section is integrated into the leftmost column would be nice, but I can see why Twitter would want to jam-pack as much stuff as possible above the fold.

Testing Sinatra... With iOS Unit Tests

I spent last week on vacation… hacking with Spencer on integrating ChuckPad Social into MiniAudicle for iPad. The week’s work involved building out the iOS library to interact with the Sinatra-based backend. While building that, I realized I was doing a lot of repetitive tasks (e.g. creating a user, uploading patches, updating patches) which could be automated with some testing.

I never got around to writing unit tests for the backend so I could’ve written those, but why do that when I could write iOS unit tests to exercise both my iOS code and the Sinatra backend? That’s way more efficient!

It was super easy to set up iOS unit tests; the Android developer in me cried a river. I set up the tests so they ran against an instance of the ChuckPad Social service running on my local machine. iOS even has a nice mechanism – XCTestExpectations – for testing asynchronous things. Below is a snippet of the tests. You can see all tests in the hello-chuckpad repository.

These tests gave me some assurances that both my iOS library code and the Sinatra backend were behaving as expected on both ends. It also let me more rapidly iterate on the codebase and catch bad behavior (a.k.a. “bugs I wrote”) before I passed the code on to Spencer. Writing these tests was time definitely well spent!

Measuring Android WebView Content Size

Situation: you’re loading content into an Android WebView that’s embedded in another view (i.e. not a fullscreen WebView) and you want to ensure the WebView resizes to the height of the content it contains.

Easy, right? Loaded question: it’s Android so you know the answer is absolutely not. StackOverflow answers provide many ways to potentially do this, but most don’t work. I only found one way – using some Javascript magic – to reliably get the content height.

Changing Progress Bar Spinner Color

Situation: you’ve got a little progress spinner in your Android app.


But it’s grey. You want it to be a different color. Something more exciting. To the Googles!

Like many Android things, there are multiple Stack Overflow posts with all sorts of answers and comments on each one saying “Thanks” and “That doesn’t work for me.” I cut through all that and here is how you do it programmatically and it works across all API levels:

// Source:
try {
  int color = ContextCompat.getColor(this, R.color.favorite_color);
  myProgressBar.getIndeterminateDrawable().setColorFilter(color, PorterDuff.Mode.SRC_IN);
} catch (Exception e) {
  // Why try-catch? Because some Xiaomi device out there will probably choke...

Now your ProgressBar – that’s actually a spinner and not a bar – be colored!