Tag Archives: jupyter-notebook

Dispatch, Traits and Metaprogramming Over Reflection

By: oxinabox.github.io

Re-posted from: https://www.oxinabox.net/2018/10/03/Dispatch,-Traits-and-Metaprogramming-Over-Reflection.html

This is a blog post about about dispatch.
Mostly, single dispatch, though it trivially generalises to multiple dispatch,
because julia is a multiple dispatch language.

This post starts simple, and becomes complex.

  • Beginning with, introductory julia skills: dispatch
  • continue to intermidate julia skills: traits
  • and finishing up with advanced techniques: metaprogramming over reflection

The last of which is kinda evil.

Continue reading

Asynchronous and Distributed File Loading

By: oxinabox.github.io

Re-posted from: https://white.ucc.asn.au/2018/07/14/Asynchronous-and-Distributed-File-Loading.html

Today we are going to look at loading large datasets in a asynchronous and distributed fashion.
In a lot of circumstances it is best to work with such datasets in an entirely distributed fashion,
but for this demonstration we will be assuming that that is not possible,
because you need to Channel it into some serial process.
But it doesn’t have to be the case.
Anyway, we use this to further introduce Channels and RemoteChannels.
I have blogged about Channels before,
you make wish to skim that first.
That article focused on single producer single consumer.
This post will focus on multiple producers, single consumer.
(though you’ll probably be able to workout multiple consumers from there, it is pretty semetrical).
Continue reading

Optimizing your diet with JuMP

By: oxinabox.github.io

Re-posted from: https://white.ucc.asn.au/2018/05/28/Optimizing-your-diet-with-JuMP.html

I’ve been wanting to do a JuMP blog post for a while.
JuMP is a Julia mathematical programing library.
It is to an extent a DSL for describing constrained optimisation problems.

A while ago, a friend came to me who was looking to get “buff”,
what he wanted to do, was maximise his protein intake, while maintaining a generally healthy diet.
He wanted to know what foods he should be eating.
To devise a diet.

If one thinks about this,
this is actually a Linear Programming problem – constrained linear optimisation.
The variables are how much of each food to eat,
and the contraints are around making sure you have enough (but not too much) of all the essential vitamins and minerals.

Note: this is a bit of fun, in absolutely no way do I recommend using the diets the code I am about to show off generates.
I am in no way qualified to be giving dietry or medical advice, etc.
But this is a great way to play around with optimisation.
Continue reading