September 5, 2023
Best Frenemies: Julia and Python
Julia and Python are often seen as competitors, but in this video I want to show the integration between them. Using the PythonCall and the JuliaCall packages we can call Julia from Python and Python from Julia. Check the video out or check edited transcript below.
Don’t forget to like and subscribe.
Download the python-from-julia.jl Pluto notebook.
Download the julia-from-python.ipynb Jupyter notebook.
There are currently two ways to integrate Python in Julia and Julia in Python.
August 30, 2023
Julia Language Can't Even Handle Simple Math
I have a new video up about how Julia cannot even handle simple math! Check the video out or check an edited written version below.
Don’t forget to like and subscribe
Introduction Julia is supposed to be a great programming language, but it can’t even do simple math correctly. Take a look at this:
julia> 0.1 + 0.2 - 0.3 5.551115123125783e-17 It should be zero, but it’s actually not. The notation means
June 28, 2023
Demand of your art
On a previous video/blog post, I talked about production planning using an example of selling art on the beach. One simplification of that model was the assumption that everything that we build can be sold.
You can check the pluto notebook html or download the notebook.
I have an excert down here, but for more details, check the video.
If you just want, you can just skip to questions.
As we saw on last episode, Javier is creating and selling his art on the beach.
June 14, 2023
Selling art on the beach
I just released a video about using mathematical modeling to solve a production planning with the thematic of selling your art on the beach.
You can check the pluto notebook html here or download the notebook here.
I have an excert down here, but for more details, check the video.
In Brazil, a common joke between undergrad students (usually during exams) is that “maybe I should give up and go sell my art on the beach”.
April 27, 2023
Solving an RPG puzzle with Julia
I have a new video out where I talk about solving an RPG puzzle using Julia:
You can check the pluto notebook html here or download the notebook here.
Here’s a more fantastic setup than I used in the video:
You walk into a large room with a 3 pointed star painted on the floor. Three triangular stones sit on top of the points of the star. One of the points of the triangle complement the point of the star, indicating that there is a correct orientation for it.
February 11, 2022
Can Python with Julia be faster than low-level code?
I worked on this blog post working for eScience Center. This is the third and last part of a three-part series. Co-authored by Faruk Diblen.
Check the blog post here.
January 26, 2022
Speed up your Python code using Julia
I worked on this blog post working for the Netherlands eScience Center. This is the second part of a three-part series. Co-authored by Faruk Diblen.
Check the blog post here.
January 19, 2022
How to call Julia code from Python
I worked on this blog post working for the Netherlands eScience Center. This is the first part of a three-part series. Co-authored by Faruk Diblen.
Check the blog post here.
June 28, 2021
Migração do site para Franklin.jl
Update 2022-12-30: Já não uso mais Franklin.jl.
Há algum tempo o Jekyll tem me dado trabalho. Como não sou usuário de Ruby, volta e meia falta alguma coisa na minha instalação e eu passo horas tentando corrigir o problema pra fazer meu site rodar localmente. Para o CiDAMO, eu considerei o Hugo, já que tem mais suporte e eu não seria a única pessoa a cuidar do site. Já para meu site pessoal, e o site do Julia Smooth Optimizers, resolvi usar Franklin, já que eu quero mais é usar Julia mesmo.
December 12, 2018
Koch snowflakes for the holidays
Code for these images.
I hope you’re familiar with the Koch curve fractal or snowflake. It essentially consists taking a line segment, splitting it in three, and substituting the middle part by two segments that form an equilateral triangle without the base. From one segment you obtain four. For each new segment, repeat the process.
Images:
The most important aspect of the koch line is that it looks awesome. Furthermore, you can do it for any image that is a collection of segments.
December 5, 2018
Package Development in Julia 1.0 using the REPL
This is a quick post on package development in Julia 1.0. Let me know if you’re interested in more, and what.
Suppose you’re developing a package - say, MyPackage.jl - whether from scratch, or updating from Julia 0.6. First, and foremost, you need to be able to run and test it. On Julia 1.0, this is one possible way, while using the REPL.
Choose a folder to develop it and create the necessary files
September 4, 2018
Optimizing the Dollar Game from Numberphile
I just watched The Dollar Game - Numberphile, in which a game involving graphs is presented. I recommend you watch the video for complete information.
The game involves a graph with integer values on its nodes, positive and negative. For instance, the following graph:
Each node corresponds to a person, the node value is the amount of money that person has, the edges are the people that person can give or take money from.
July 4, 2018
My experience in the JuMP-dev annual workshop
Last week I had the pleasure of being invited to the Second annual JuMP-dev workshop, which happened in June 27-29, 2018 at Bordeaux, France. I’ve presented the packages from the Julia Smooth Optimizers organization, and had a very good time meeting with the JuMP developers.
For those still unaware, JuMP is a modelling language for Mathematical Programming written in Julia. It provides access to a few different solvers for many kinds of problems, and it works inside of Julia, so one can enjoy the advantages of having a robust language if there is a need for advanced usage.
February 20, 2017
Minicurso de Julia no IX Simpósio de Análise Numérica e Otimização da UFPR
Hoje ministrarei mais um minicurso de Julia na UFPR. Desta vez será no IX Simpósio de Análise Numérica e Otimização da UFPR.
Por enquanto, deixo esta página apenas com o link para o notebook que utilizarei: aqui.
February 17, 2017
NLPModels.jl and CUTEst.jl: Constrained optimization
This is a continuation of this post. And again, you can follow the commands of this post in the asciinema.
If you followed along last post, you should know the basics of our NLPModels API, including CUTEst access.
One thing I didn’t explore, though, was constrained problems. It’d complicate too much.
However, now that we know how to handle the basics, we can move to the advanced.
Nonlinear Programming format
February 7, 2017
NLPModels.jl, CUTEst.jl and other Nonlinear Optimization Packages on Julia
A couple of weeks ago me and Professor Dominique Orban have finally made a release of CUTEst.jl, a wrapper for the CUTEst repository of problems for nonlinear optimization (which I’ve mentioned before). Along with this release, we’ve done a release of NLPModels.jl, the underlying package. I think it’s time I explain a little about these packages, others, and how to use them together. If you want to see the output of the commands, you can open this ASCIInema side by side.
January 15, 2017
Julia Fractal on Julia
I wanted a background that would update automatically in some interesting way, instead of just random images. After some thought, I decided to use some Julia fractals.
I made a code to create the Julia fractals in the Julia language, and then some code to run it for a random point.
The code is here, including some explaining on how to use and install it.
Here are some examples:
December 18, 2016
Advent of Code 2016 in Julia
Last year I discovered by chance a code competition that happens in the month of December: The Advent of Code. This event consists of small puzzles release every day of December, up to the 25th. Which amounts to 25 problems! (I can do math).
Last year I tried doing some on Bash, and latter switched to Julia, but never got to finish them. This year I decided to use Julia, because I want to test it for these general problems.
November 29, 2016
Apresentação de Julia no SMNE
Nos dias 30 de Novembro à 2 de Dezembro de 2016 acontece o primeiro Simpósio de Métodos Numéricos em Engenharia. Neste simpósio darei um minicurso sobre Julia.
Deixo aqui o material preliminar para os alunos do minicurso, ou interessados.
Notebook (necessário) exemplo.jl (necessário) HTML estático do notebook - para quem não conseguiu instalar Também deixo aqui o link do Etherpad para usarmos na aula.
Quem não conseguiu instalar até agora, pode tentar usar o JuliaBox, que roda Julia online.
March 13, 2016
Test Driven Development in Julia
First, what is Test Driven Development (TDD)? Well, I’m not an expert, so don’t quote me, but in practice it means that you develop your code to fulfill tests that you define prior to beginning your work. You do not define all your tests first, though. You define a single test, and produce code to pass it. Then you define another code, and produce code to pass both. And so forth until you complete your specification.
February 28, 2016
Minicurso de Julia para Otimização
Semana passada, nos dias 22 a 24 de Fevereiro aconteceu o VIII Simpósio de Análise Numérica e Otimização. Nesse evento, eu apresentei um minicurso de Julia com foco em Otimização não Linear. Entre 10 e 15 pessoas participaram no total, entre alunos de graduação, de pós-graduação, e professores. O objetivo principal era apresentar a linguagem e alguns detalhes importante para otimização não linear, o que foi obtido. Por outro lado, as aulas foram mais longas do que deveriam, e o conteúdo ficou muito esparso, pois tive que variar entre o básico e uma aplicação mais avançada.
February 21, 2016
Automated testing
We’re gonna learn how to make a test for your Julia code that runs whenever you publish it online. We’re gonna use
GitHub to store the code; Travis CI to run your tests; Coveralls.io to verify which lines of code your test are missing. Alternatively, for a open source alternative, see GitLab, which I don’t know enough yet.
Let’s make a litte code to solve a linear system, paying attention to the problems it may arise, like incorrect dimensions, underdetermined and overdetermined systems, singular matrices, etc.
February 14, 2016
VIII Simpósio de Análise Numérica e Otimização - Minicurso de Julia
Nos dias 22 a 24 de Fevereiro de 2016 acontecerá o VIII Simpósio de Análise Numérica e Otimização. É uma ótima oportunidade para interagir com colegas e conhecer alguns assuntos novos de pesquisa.
Em particular, nesse simpósio apresentarei um minicurso sobre Julia com foco em Otimização. O minicurso é voltado para pessoas que conhecem um pouco de MatLab ou alguma outra linguagem. Serão três dias, com uma introdução à linguagem, alguns exemplos, o CUTEst.
October 1, 2015
Installing CUTEst and CUTEst.jl
This post will tell you how to install CUTEst using a different tool that makes it much easier. Also, I’ll install CUTEst.jl, the CUTEst interface for Julia.
Edit: Now, CUTEst.jl install CUTEst by itself. Check this post. Also, for Linux, I’ve created this CUTEst installer, which should be easier to use. February, 11, 2017.
Edit: Some corrections were made on February, 15, 2016.
Edit: Some corrections were made on November, 11, 2015.
April 13, 2015
Workshop de Ferramentas Computacionais - Maio de 2015
Sobre No dia 30 de Maio de 2015 acontecerá uma Oficina de Ferramentas Computacionais para Pesquisadores. Essa oficina será focada em três ferramentas básicas para desenvolvimento de software:
Bash Git Julia O Bash é o terminal tradicinal dos sistemas GNU/Linux (a tela preta). As possibilidades de uso são ilimitadas, mas vamos focar no básico, tentando chegar até a criação de um script simples.
O Git é uma ferramenta para controlar versões de softwares e outros arquivos.
February 25, 2015
Apresentação no VII Simpósio de Análise Numérica e Otimização - UFPR
No dia 24 de Fevereiro de 2015 aconteceu o (primeiro dia do) VII Simpósio de Análise Numérica e Otimização. Participei deste congresso fazendo uma apresentação sobre Ferramentas Computacionais para Pesquisadores (ver código).
Nesta apresentação, introduzo algumas ferramentas que considero bastante importantes para pesquisadores, principalmente da área de matemática computacional. Um resumo do que apresento é
Aprenda outras linguagens. Recomendo, por exemplo, conhecer Python ou Ruby, Shell e Makefile. Com essas ferramentas já é possível automatizar testes e fazer scripts com uso variado.
February 6, 2015
CUTEst.jl
About an year ago, Raniere started working on a interface for CUTEst. He decided to create ugly, a repository for CUTEst, but following the Unix procedure for building packages (./configure, make, make install). Also with ugly, he wanted to enable building a shared library to be used with Julia. This approach worked, but maintaining it is troublesome, since it would require updating and testing of ugly for every update of CUTEst.
January 22, 2015
A Study in Julia
Today I begin a study in Julia. This fantastic tool has syntax similar to that of Octave/Matlab, but is much faster. Furthermore, the interface with functions made in C and Fortran is much easier to accomplish, and since most things in computational mathematics are on these languages, this feature is wonderful.
My intented work is
make a simple julia and C interface, with auto-compiling and test on GitHub and Travis CI; develop a nonlinear optimization tool completely in Julia, then improve the slow bits by using C and/or Fortran; implement/improve the CUTEst interface [1], [2], possibly creating a SIF converter.
November 22, 2014
The End of Fortran
One of my main interest is the end of Fortran as the only programming language used by mathematicias. If you’re not in the area of mathematical programming, you probably find it strange for me to be talking about Fortran, so I explain. Fortran is considered the fastest programming language in mathematics, and most things made are in this language. Other often used languages such as MatLab/Octave and Mathematica are high-level, which means they are slower and are not considered for serious applications.