An applied mathematician, boardgame collector and functional programming enthuasiast.

Here are some repos

Mail

Friends

monero

83d6gFo4P3kRPAQbkNsUiyVXF6SgLutGQ1kH4DXdWPYT7hzSSSGkDPNfQmTx6gijjcBRqwAfzzNz4VrcMbNjgYQ5Ao1DhP8

# Divide and Conquer to optimality!

This week I made a pretty cool achievement for the paper on the wall that says that I am an applied mathematician. This week, I developed a branch and bound to solve a mixed integer linear problem.

## Yeah… so?

Well, hipothetical reader, if you asked me that, I would say that you are not familiar with the power of integer programming. This kind of technique is pretty useful in the industry, in an area called operational research.

To make it simple, it is intended to help the user make better decisions. In other words, it is inside the prescription area inside artificial intelligence (more on this later!).

## Ok… tell me more… (I think)

Let's think of an example. Let's say you have to find the best route from point A to point B, and for the sake of the example, you do not want google to track you down, so you cannot use google.maps =].

In this case, integer programming can help you! Why? Because you have to make the decisions of where to turn and when.

Ok, the problem passed the first test. The second test is a lot more techinical. You have to be able to model this problem only with linear equations. Putting aside what is the modelling per se, you might be wondering: "Why must it be linear? Nothing in the world follows a linear curve!". To which my answer would be: "Correct, hypothetical reader! But you gain something pretty cool by forcing it to be linear. The solution you find is guaranteed to be optimal! In the worst case, I can tell you how better the solution could be, if not optimal!"

And now, I will give you some time to think about this. I am telling you there is an algorithm that with few conditions (one might be hard one), you can have the best kind o quality measure one can think of. The final solution is `n percent` worse than the best one.

## Ok… I'm kind of sold. But what does Branch and Bound have to do with this?

Well, branch and bound is the go to algorithm framework solvers use to find this measure of quality I mentioned earlier. And I made one in clojure! I had to solve a small problem and I could not find a decent package similar to pulp in python (which is very sad, if I may say so).

## Nice, but I don't need to find a route…

Glad you mentioned this! That's the beauty of it. Branch and Bound is a framework in which, if you can mathematically model the problem, you can solve a bunch of kind of problems:

• Find the best location to build a station (fire fighters, restaurants, telecomunication towers, etc…)
• Find the best way to load a truck (or any container for this matter).
• Best way to plan your production

and others. Here you can find a bunch of applications! =]

# A first (not bad) emacs experience

Well, not for me. I have been using emacs for almost a decade now and I have used bad configs and good ones. In the past few years that I am feeling more comfortable with lisp, I have been enjoying to tweak the configuration more and more.

My girlfriend has recently come to the good side of workplace and could drop Windows and its tools. In this new world, she tried to go into the Linux and emacs was something that I was more than eager to show her!

## The problem

Well, emacs has quite of an interesting learning curve source

and I totally agree with it! So I created what it could be a first step to use it.

## What is FirstEmacs?

What I looked for was a way to drop the two most troublesome keys in emacs (in my opinion) and its consequences. Which are `Ctrl+x`, `Ctrl + c` and `Ctrl + v` for cutting, copying and pasting. And emacs has most of its hotkeys attached to `Ctrl+x` and `Ctrl+c`.

It took me some time, but then I found wakib-keys. Which was pretty much the solution I was looking for. Basically, remaps the standart `Ctrl + x` and `Ctrl + c` to `Ctrl + e` and `Ctrl + d`.

## Last note

Writing this assured the usefulness in the notation `C-c` and `C-x` for `Ctrl-c` and `Ctrl-x` (and so on) =].

# Artix vs NVIDIA

## What happened?

Today, when I turned my computer on to log in, `X` complained that could not connect…

## Why did that happen?

On friday, I tried to solve a glitching issue on brave, and I found online that someone solved by changing some settings on the nvidia. This genius that speaks to you, hypothetical reader, tried to download nvidia-settings to find out that the solution was elsewhere. All I had to do was to disable hardware accelaration on `brave://settings/system`.

## Diagnostics

Well, to the debugging process.

Two things were off:

1. the card was not being loaded, meaning that all the letters were huge and the screen was most definetly not optimized
2. the message given when trying to load `X`: `Number of screens does not match number of detected devices`. And two devices were shown: `nvidia` and `modesetting`

## Solution

After I recovered from a panick attack, I summoned my mate Umgeher for some help.

He helped me find that nvidia blacklisted my graphic driver nouveau. From this link I could figure out what file to remove to take nouveau out from the blacklist. Now, reboot!

After that, the screen went back to the regular resolution, however the `X` still did not connect. But something different from the previous situation is that an `xorg.conf` was created at `/etc/X11/`. From there all I had to do was to change the conf file on device from `nvidia` to `modesetting` (that was the other device from the list)

# You don't need browser to check if a website is up!

Well, the title is quite an obvious statement… You can use softwares such as restclient from emacs, curl and probably a gazillion others.

However, there is not another one made in janet, authored by me, made in the last month! I can guarantee it!

## The Goal

Well, my goal here was to make a simple software that did one thing and well. That one thing is to check multiple urls if they are up and the status they would return.

## The code

This is another one in the janet journey. I used a ncurses wrapper to create the tui. All you need is a url file with a name reference and the respective url to be checked. With just this, you are ready to use it.

Like this!

# Pomodoro with shell script

By now, you must be asking yourself: "Oh my god, all you know is janet/functional programming?!", to which my answer would be a resounding "Yes!".

However, today I decided to step a little bit outside my comfort zone and make a little script to help me use pomodoro for productivity.

Like you, hypothetical reader, I use dwm with dmenu. With these you can easily create a pomodoro executable to work for you. I say easily because I have no experience with shell script and I made it happen.

Enjoy =]