Reducing the cost to execute smart contracts is an important consideration when developing on the Ethereum network. Not only do low execution costs help reduce the load on the network (ahem, CryptoKitties), but it also incentivizes users to interact more freely with a smart contract. The cheaper it is to transfer tokens, set state, or otherwise modify contract data, the better the user experience will be when using a decentralized app built on the Ethereum blockchain.

However, it’s not always obvious how much of a contract’s execution cost is spent on storage. The cost to call a contract method is…


If you have Apple App Store information, and you do this:

mysql> SELECT g.name AS 'Genre Name', COUNT(ga.genre_id) AS 'Count' -> FROM genre AS g 
-> JOIN genre_application AS ga
-> ON g.genre_id = ga.genre_id
-> WHERE ga.is_primary = true
-> GROUP BY ga.genre_id
-> ORDER BY COUNT(ga.genre_id) DESC;

You get this:

+------------------------------+--------+ | Genre Name | Count | +------------------------------+--------+ | Games | 404944 | | Entertainment | 226537 | | Education | 206385 | | Lifestyle | 194664 | | Book | 193559 | | Business | 167519 | | Utilities | 133039 | | Travel | 98875 |…

I recently worked on a large Rails application that handled a good deal of data — about 200 million entries in the database — and which imported about 100 million new entries each night.

The application needed to be able to search through all the entries, including attributes nested in multiple associations in order to return information useful to whoever was viewing the site. The problem with all this, of course, was that it takes a really long time to search through all that data.

In this post I’ll talk about the initial tricks I used to get the site…


And other git workflow things.

When I started programming, git was one of the hardest things to wrap my head around. Later, I came to understand git as a sort of version control tool. That may well have been the initial intention too, but it has become so much more than that.

Going back again to when I started with git, I learned the general pull, branch, commit, push, merge paradigm. That was simple. With some discipline easy to manage, and served the simple purpose of keeping track of a code base.

Later, at one of my first jobs, I was introduced to the rugged…


Testing controllers in Node.

A while ago at work I was trying to unit test Express controller actions — the functions that get executed when a certain route get’s hit.

function index(req, res) { 
// stuff goes here
res.send(...);
}

Coming from a Rails mindset, I figured I’d make some sort of fake call to the controller and test the response — simple stuff. Unfortunately, I was quickly faced with the fact that there is no easy way to send fake requests to a controller, and even more troublesome, all the controller testing examples I found would try to spin up a live server…


More monoids

A few days ago I made a post about monoids, culminating with an example of the standard ‘or’ operator as a monoid. It was an interesting exercise in some of the fundamentals of abstract data structures, but in retrospect it was probably too contrived of an example to really convery much.

But I think we can take the `Or` monoid that was created in that previous post, and turn it into a much more useful monoid — `Any`. In general, we want to our new monoid to tell us if any value in a list is `true`. Like so:

concat…


And the ‘or’ operator as a monoid.

A monoid (not to be confused with the much talked about monad) is an algebraic structure that has an associative binary function, and an identity element. That is, it must obey two laws:

First, it must have an identity element (`empty`) that acts as an identity with respect to the binary function (`f`).

f empty x = x
f x empty = x

Second, the binary function (`f`) must be associative.

f (f x y) z = f x (f y z)

A specific example of a well known monoid data type are lists. …


Or how to force people to make sense.

I’m currently working with an inexperienced team that is trying to quickly prototype a new version of a legacy enterprise software, using new technologies, while on-boarding a few new members.

It is a lot to keep up with — from naming a function to making a new file to simply talking about some code, there is a great deal of mental overhead associated with almost everything we do. The reason for that, as I’ve sort of alluded to, is all the ‘newness’. But that in itself isn’t inherently complicated. Even with new technologies and a less experienced team, everyone can…


And the blazing speed of Ruby’s built in Array#sort

I’m currently look for a job as a web developer. That not only means reading job postings until my eyes get sore, imagining vague futures and having impostor syndrome attacks about my skills, it also means studying CS terms and algorithms for interviews.

While doing this, one area I've gotten into is Big-O notation and sorting algorithms (as cool as that sounds, I know…). It’s interesting because there are tons of sorting algorithms, at least a dozen well used ones, and most programming languages have a built in .sort method. …


Tyler Olson

This series documents the lifespan and arc of History Clothing Company, a clothing company that I founded and operated between August 2011 and January 2013.

I moved down to South Carolina early in the summer of 2011 with a restlessness and eagerness that only a young college graduate on their way to their first job can posses. Work started, the job was fine, but the restlessness never totally subsided.

One night, probably after staying up too late watching TV, my mind was spinning as I tried to fall asleep. It’s never really clear how ideas come about, but this one…

Tyler Olson

Software developer. Functional programmer. JavaScript, Haskell, and outer space.

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