Thought I’d update my 2018 article and make it a bit more user friendly. You still have to go through the process of downloading your activity, but now the final step has been done for you — I am providing a webpage for you with the script loaded (all you have to do is “upload” your file.)

You should probably not try to go through this process on your phone. A friend of mine tried that, gave up and opened his laptop. He had no problem doing it on his computer.

I don’t have the info needed to do something…

Suppose you decide that you want to build your scala / akka project’s distributable artifact using gradle with the kotlin dsl.

You want to build a fat jar, and then you want to run it from within a docker container (or not) using java -jar myFatJarFilename.jar.

This was all working fine with sbt assembly — so if you’re inclined to dispense with the gradle and kotlin, maybe that would be better for you. I was not inclined. I had a number of issues, and I’ll itemize the big ones here with my solutions.

Custom output directory and filename.

In gradle, archiveName is deprecated, and if…

An ongoing story, and I don’t know how it ends yet

Introduction

In scala, when you want to use any data structure in your code, the default implementation is always immutable. You have mutable variants of everything available to you, but the default is always immutable.

And so last week when I needed to use a queue for something, it occurred to me that, even for this data structure, you have to specifically specify the mutable variant. Wait, what? An immutable queue? What would the point of that be? How would that even work? …

THIS IS OUTDATED! There’s a newer version of this article and you can find it by clicking here:

https://medium.com/@stevetursi/spotify-wrapped-year-in-review-for-google-play-music-users-2019-edition-eac6f7f9f27f

^^ Click That ^^

Here is the older, outdated version:

(this article assumes you have a bit of web development knowledge.)

I was jealous.

Someone’s Spotify Year-In-Review

On my company slack channel #listening-to, a number of people were posting their Spotify Year-In-Review. It had their top artists and songs. It enumerated their minutes listened and their top genre.

And I was feeling left out. I’m not a Spotify user. I do all my listening on Google Play Music, which I get for free as a YouTube Premium member (it’s pretty sweet.)

Moreover, this is not the first year that I was taken by my jealousy…

Once your fast.ai machine instance is up and running, you’re going to have to get the training set from kaggle to the machine. But since, in order to download, you have to be authenticated at kaggle, you can’t just naively wget it. You need to add an authentication token. On the video, Jeremy goes into detail on how he does it — by using firefox to get the cURL with the headers set (and the way this particular link works, it doesn’t work in chrome.) …

I ran into a problem when trying to set up an AWS instance for ML for developers lesson 1 (random forests.) After a bunch of googling I finally figured out how to fix it. Here’s what I had to do to get ML for Developers Lesson 1 (random forests) running on AWS. Disclaimer — I am a relative novice when using EC2, and I don’t know for sure if I did it “the right way”, but I got it working and that’s what matters for now.

I am going to assume that you are generally following fast.ai’s instructions at https://forums.fast.ai/t/wiki-thread-lesson-1/6825

Yesterday I wrote about using the spread operator (…) on javascript arrays. Today let’s talk briefly about Objects.

It’s actually remarkably similar, but it works remarkably with merging objects. Here’s what I mean. Concatenating objects works similarly to arrays:

> const metasyntactic1 = {
foo: "bar",
baz: "qux",
}
> const metasyntactic2 = {
quux: "quuz",
corge: "grault",
}
> {...metasyntactic1, ...metasyntactic2}{
foo: "bar",
baz: "qux",
quux: "quuz",
corge: "grault"
}

But what happens when there’s a name conflict?

> const metasyntactic1 = {
foo: "bar",
baz: "qux",
}
> const metasyntactic2 = {
baz: "quuz",
corge: "grault",
}

Hey, check it out:

...

That’s an ellipsis, right? What can we do with that?

Well, here’s what we had before the three dots:

> let a = ["foo", "bar"]
> let b = ["baz", "qux"]
> let c = a + b
> c
"foo,barbaz,qux"
> a.push("quux")
3
> a
["foo", "bar", "quux"]
> a.push(b)
4
> a
["foo", "bar", "quux", Array(2)]
> c = a + b
> c
"foo,bar,quux,baz,quxbaz,qux"

ug. Yeah it makes semantic sense, but most of the time it’s not what we want.

> let a = ["foo", "bar"] > let b = ["baz", "qux"]…

Most java developers can tell you the difference between a List and a Set. They can also tell you that both implement Iterable, which means you can call forEach on the set and perform an operation on every item.

But in what order?

A subset of java developers can tell you that you can use a HashSet most of the time, and a TreeSet when you want your elements to be sorted by their natural order (A before B, 1 before 2, January before February, etc.)

So here’s the question — if you want to preserve the insertion order when…

Suppose something happens in a non-activity Object running in an android application, and you want to update a UI component.

But first, suppose this was javascript.

A similar thing happened in a pretty complex web application we own and our group’s tech lead built a global event bus in javascript. A reference was passed down to every object that produced to or consumed from this event bus, and since it’s functional we could just pass function references to the triggers. Worked great. It was black magic to me, and I’m still impressed by it.

… and today I sat down…

Steven Tursi

Ultra Runner from New Jersey. Scala Engineer at William Hill. Opinions are my own. http://tur.si

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store