Author Archives: oxinabox.github.io

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

String Types in Julia

By: oxinabox.github.io

Re-posted from: https://white.ucc.asn.au/2018/05/03/Strings-Types-in-Julia.html

A shortish post about the various string type in Julia 0.6, and it’s packages.
This post covers Base.String, Base.SubString, WeakRefStrings.jl, InternedStrings.jl, ShortStrings.jl and Strs.jl;
and also mentioneds StringEncodings.jl.
Thanks to Scott P Jones, who helped write the section on his Strs.jl package.
Continue reading