Understanding the C/C++ memory model

Software is Crap

I know that a lot of people struggle with understanding the memory model introduced in C11/C++11. In a recent conversation I was alerted to the existence of this blog post, which while correct (by my understanding) is in my opinion aimed at those who already have a good understanding of some of the underlying concepts. I’m going to try to set out my understanding of the model, which is hopefully correct, in more straightforward terms and with a more “ground up” explanation.

Introduction: Program order versus memory order

You have your C/C++ program and it stores values (sets a variable or stores a value through a pointer) and it loads values (reads a variable or reads a value through a pointer). The order that your program specifies these loads and stores is the “program order”. However, there are a number of things that can cause the order in which…

View original post 1,418 more words


Kaggle Learn review: there is a deep learning track and it is worth your time

Tech and Mortals

Right from my undergrad days when I was starting out with machine learning to this date, my admiration for Kaggle continues to grow. In addition to being synonymous with and popularizing data science competitions, the platform has served as a launching pad and breeding ground for countless data science and machine learning practitioners around the world, including yours truly. In fact, skills I’d picked up from the platform are part of the reason that I recently got to join SocialCops, a company I’d admired for years. However, I hadn’t been on the platform in 2017 as much as I would have liked. So when I saw Ben Hamner‘s tweet launching Kaggle Learn, a set of interactive data science tutorials, I made up my mind to give it a shot.

View original post 863 more words

A practitioner’s guide to reading programming languages papers

the morning paper

Last week I jokingly said that POPL papers must pass an ‘intellectual intimidation’ threshold in order to be accepted. That’s not true of course, but it is the case that programming languages papers can look especially intimidating to the practitioner (or indeed, the academic working in a different sub-discipline of computer science!). They are full of dense figures with mathematical symbols, and phrases thrown around such as “judgements”, “operational semantics”, and the like. There are many subtle variations in notation out there, but you can get a long way towards following the gist of a paper with an understanding of a few basics. So instead of covering a paper today, I thought I’d write a short practitioner’s guide to decoding programming languages papers. I’m following Pierce’s ‘Types and Programming Languages’ as my authority here.


Let’s start from a place of familiarity: syntax. The syntax tells us what…

View original post 1,644 more words

One model to learn them all

the morning paper

One model to learn them all Kaiser et al., arXiv 2017

You almost certainly have an abstract conception of a banana in your head.

Suppose you ask me if I’d like anything to eat. I can say the word ‘banana’ (such that you hear it spoken), send you a text message whereby you see (and read) the word ‘banana,’ show you a picture of a banana, and so on. All of these different modalities (the sound waves, the written word, the visual image) tie back to the same concept – they are different ways of ‘inputting’ the banana concept. Your conception of bananas is independent of the way the thought popped into your head. Likewise, as an ‘output’ I could ask you to say the word banana, write the word banana, draw a picture of a banana, and so on. We are able to reason about such concepts independently of…

View original post 1,223 more words

A hidden gem: inner_product

Growing up

I know, it’s been a while since the last time I published something on my blog. The main reason is that in my spare time – apart from private life – I’ve been committed to organize events and activities in Italy and also to work on a personal project with a great friend of mine. Anyway, I found some time to share a new blog post I hope you will like.

This article is also part of my series C++ in Competitive Programming.

In the very first installment of this series, I showed an example whose solution amazed some people. Let me recall the problem: we have to find the minimum difference between any two elements in a sorted sequence of numbers. For example:

The minimum difference is 10, that is 20-10. Any other combination is greater. Then, I showed an unrolled solution for such problem (not…

View original post 1,667 more words

The Valley of Shit

The Thesis Whisperer

I have a friend, let’s call him Dave, who is doing his PhD at the moment.

I admire Dave for several reasons. Although he is a full time academic with a young family, Dave talks about his PhD as just one job among many. Rather than moan about not having enough time, Dave looks for creative time management solutions. Despite the numerous demands on him, Dave is a generous colleague. He willingly listens to my work problems over coffee and always has an interesting suggestion or two. His resolute cheerfulness and ‘can do’ attitude is an antidote to the culture of complaint which seems, at times, to pervade academia.

I was therefore surprised when, for no apparent reason, Dave started talking negatively about his PhD and his ability to finish on time. All of a sudden he seemed to lose confidencein himself, his topic and the quality of…

View original post 920 more words

$20,000 in 10 months from two small games, how? and what next?

Coffee Induced Games

Between January 2017 and November 2017, I have made a little over $20,000 in advertising revenue alone from two small mobile games on the Android App Store – Google Play

Admob income Nov 2016 - Nov 2017 Proof of income to back up my claims

Up until now, I’ve been writing small simple Android games as a hobby, but now it’s getting serious…

If you’ve have told me a year ago, that I’d be writing this article today, I’d think you were joking around. At that point, my total earnings on the Google Play store, amounted to $43.75, if it hadn’t been for some extra income from my YouTube channel showing simple games programming tutorials, I’d have never of received any money from Google up until that point. But as of the time of writing, I’ve earned just over $23,000 in the last year, all from just two games:


An pretty simple Space Invaders clone I…

View original post 962 more words