<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Alvaro Revuelta</title><link>https://alvarorevuelta.com/</link><description>Recent content on Alvaro Revuelta</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Sun, 20 Apr 2025 16:43:20 +0530</lastBuildDate><atom:link href="https://alvarorevuelta.com/index.xml" rel="self" type="application/rss+xml"/><item><title>Designing Critical Systems. Airplanes, Medical Devices, and Blockchains</title><link>https://alvarorevuelta.com/posts/critical-systems/</link><pubDate>Sun, 20 Apr 2025 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/critical-systems/</guid><description>&lt;p>It&amp;rsquo;s acceptable for some systems to fail occasionally, but others simply cannot afford to. Your &lt;a href="https://en.wikipedia.org/wiki/Blue_screen_of_death">Windows can crash&lt;/a>, but the software controlling an airplane&amp;rsquo;s engine cannot.&lt;/p>
&lt;p>Not all systems are designed the same way. The more critical the system, the stricter the requirements and the more expensive it becomes. In this post, I will take a systems and software approach to understand:&lt;/p>
&lt;ul>
&lt;li>Systems classification according to criticality.&lt;/li>
&lt;li>How to make your systems more robust.&lt;/li>
&lt;/ul>
&lt;p>No matter which industry you&amp;rsquo;re in, you should apply some of these principles, especially those that don&amp;rsquo;t significantly impact system cost.&lt;/p></description></item><item><title>Unlocking True Randomness. Quantum Computers for Entropy</title><link>https://alvarorevuelta.com/posts/quantum-randomness/</link><pubDate>Sun, 01 Dec 2024 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/quantum-randomness/</guid><description>&lt;p>Last week, I had the chance to attend a one-day course on quantum computing at &lt;a href="https://www.scayle.es/">SCAYLE&lt;/a>. While it was just a high-level introduction, it gave me a solid intuition about the fascinating world of quantum mechanics and computing.&lt;/p>
&lt;p>In this post, I’ll take things a step further by using a real quantum computer as a source of entropy to generate truly random numbers. With these numbers, I’ll create a private key on the Ethereum blockchain and deposit some funds into the associated address.&lt;/p></description></item><item><title>Ergodicity and Stationarity. Luck but Not for You</title><link>https://alvarorevuelta.com/posts/ergodicity/</link><pubDate>Wed, 18 Sep 2024 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/ergodicity/</guid><description>&lt;p>We are constantly making decisions under uncertainty where information is limited and the outcome of the decision is not granted. You don’t know if your startup investment will go to zero. You don’t know if a given health treatment will save your life. You don’t know if you will win a hand in poker.&lt;/p>
&lt;p>Luckily, statistics help us to manage uncertainty. Metrics such as mean, median, mode or percentiles give us information about the past. We can incorporate these metrics in our decision making process to trade-off the risk and reward.&lt;/p></description></item><item><title>Convolutions, Fast Fourier Transform and Polynomials</title><link>https://alvarorevuelta.com/posts/fft-polynomials/</link><pubDate>Fri, 26 Apr 2024 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/fft-polynomials/</guid><description>&lt;p>You may remember from high school what a polynomial is. If so, you may also remember how to multiply two of them. But what if I told you that the method you were taught is slow as F?&lt;/p>
&lt;p>In this post we will connect polynomials with the Fourier Transform and convolutions, and show you how to multiply polynomials with &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>O&lt;/mi>&lt;mo stretchy="false">(&lt;/mo>&lt;mi>n&lt;/mi>&lt;mi>l&lt;/mi>&lt;mi>o&lt;/mi>&lt;mi>g&lt;/mi>&lt;mi>n&lt;/mi>&lt;mo stretchy="false">)&lt;/mo>&lt;/mrow>&lt;annotation encoding="application/x-tex">O(nlogn)&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:1em;vertical-align:-0.25em;">&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.02778em;">O&lt;/span>&lt;span class="mopen">(&lt;/span>&lt;span class="mord mathnormal">n&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.01968em;">l&lt;/span>&lt;span class="mord mathnormal">o&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.03588em;">g&lt;/span>&lt;span class="mord mathnormal">n&lt;/span>&lt;span class="mclose">)&lt;/span>&lt;/span>&lt;/span>&lt;/span> complexity instead of &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>O&lt;/mi>&lt;mo stretchy="false">(&lt;/mo>&lt;msup>&lt;mi>n&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msup>&lt;mo stretchy="false">)&lt;/mo>&lt;/mrow>&lt;annotation encoding="application/x-tex">O(n^2)&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:1.0641em;vertical-align:-0.25em;">&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.02778em;">O&lt;/span>&lt;span class="mopen">(&lt;/span>&lt;span class="mord">&lt;span class="mord mathnormal">n&lt;/span>&lt;span class="msupsub">&lt;span class="vlist-t">&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.8141em;">&lt;span style="top:-3.063em;margin-right:0.05em;">&lt;span class="pstrut" style="height:2.7em;">&lt;/span>&lt;span class="sizing reset-size6 size3 mtight">&lt;span class="mord mtight">2&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;span class="mclose">)&lt;/span>&lt;/span>&lt;/span>&lt;/span>, being the latter the method that’s taught in high school.&lt;/p></description></item><item><title>30 Lessons for 30 Years</title><link>https://alvarorevuelta.com/posts/30lessons-30years/</link><pubDate>Tue, 09 Jan 2024 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/30lessons-30years/</guid><description>&lt;p>Just turned 30 years old and wanted to share my 30 lessons learned during this decade. Highly biased by my own experience, but hope they can help someone to navigate these years.&lt;/p>
&lt;h3 id="1-do-sport-regularly">1. Do sport regularly:&lt;/h3>
&lt;p>It took me a while to get into it. Exercise at least 3 days a week. Do not fall into having sport taking your life, spending hundreds of euros a month on protein shakes and shit. You don’t think the same way about a problem after doing sport. Cardio over weight lifting. If you can’t find the time during the day, wake up early and do it. If your knees allow it, run a half-marathon once.&lt;/p></description></item><item><title>Multi-block MEV in Ethereum</title><link>https://alvarorevuelta.com/posts/ethereum-mev-multiblock/</link><pubDate>Wed, 11 May 2022 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/ethereum-mev-multiblock/</guid><description>&lt;p>This article answers the following question: How likely is it that a given Ethereum staking pool controlling &lt;code>p&lt;/code> of the stake proposes &lt;code>k&lt;/code> consecutive blocks within an epoch.&lt;/p>
&lt;p>After &lt;em>The Merge&lt;/em> (transition from Proof of Work to Proof of Stake ), this is of paramount importance since it opens up a new dimension for &lt;em>Maximal Extractable Value&lt;/em>&lt;sup id="fnref:1">&lt;a href="#fn:1" class="footnote-ref" role="doc-noteref">1&lt;/a>&lt;/sup>.&lt;/p>
&lt;p>To begin with, these probabilities are analytically modeled and then validated through Montecarlo simulations. To conclude, on-chain data is used to study n-consecutive block proposals for Coinbase, a well-known entity in the Ethereum consensus layer.&lt;/p></description></item><item><title>Presenting cONNXr. ONNX Runtime For Machine Learning Inference in C</title><link>https://alvarorevuelta.com/posts/connxr/</link><pubDate>Fri, 15 May 2020 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/connxr/</guid><description>&lt;p>I&amp;rsquo;m writing this post to announce the release of &lt;a href="https://github.com/alrevuelta/cONNXr">cONNXr&lt;/a>, a project I have been working on since last year.
It&amp;rsquo;s an ONNX backend written in pure C that allows running inference for machine learning models defined in &lt;code>.onnx&lt;/code>.
It has zero dependencies and it&amp;rsquo;s meant to work in any embedded device.&lt;/p>
&lt;p>After having a working proof of concept by the end of 2019, the project was forgotten for some time.
But some months later, with the lockdown and the pandemic I had some spare time to continue working on it.
And this is the result.
Just so you know, it&amp;rsquo;s an unfinished project and not meant for production usage, so please use with care.&lt;/p></description></item><item><title>Encoding spatial rotation with Quaternions</title><link>https://alvarorevuelta.com/posts/quaternions/</link><pubDate>Thu, 01 Jun 2017 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/quaternions/</guid><description>&lt;p>During my thesis, I researched different techniques for estimating the orientation of an object in a three-dimensional space. Think of your head, you can tilt left/right, look up/down, or right/left. Well, the exact position of your head can be expressed mathematically and quaternions are one of the options.&lt;/p>
&lt;p>Quaternions were introduced by Hamilton (1843) and are used to represent the attitude of a rigid body in space. They can be viewed as an extension of complex numbers. A complex number can be used to represent the rotation in a two-dimensional space. A quaternion is similar, but instead of one axis it is extended to three axes. For its representation, four values are needed, where there is one real component &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;msub>&lt;mi>q&lt;/mi>&lt;mn>0&lt;/mn>&lt;/msub>&lt;/mrow>&lt;annotation encoding="application/x-tex">q_0&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:0.625em;vertical-align:-0.1944em;">&lt;/span>&lt;span class="mord">&lt;span class="mord mathnormal" style="margin-right:0.03588em;">q&lt;/span>&lt;span class="msupsub">&lt;span class="vlist-t vlist-t2">&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.3011em;">&lt;span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;">&lt;span class="pstrut" style="height:2.7em;">&lt;/span>&lt;span class="sizing reset-size6 size3 mtight">&lt;span class="mord mtight">0&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;span class="vlist-s">​&lt;/span>&lt;/span>&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.15em;">&lt;span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span> and three imaginary &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;msub>&lt;mi>q&lt;/mi>&lt;mn>1&lt;/mn>&lt;/msub>&lt;mo separator="true">,&lt;/mo>&lt;msub>&lt;mi>q&lt;/mi>&lt;mn>2&lt;/mn>&lt;/msub>&lt;mo separator="true">,&lt;/mo>&lt;msub>&lt;mi>q&lt;/mi>&lt;mn>3&lt;/mn>&lt;/msub>&lt;/mrow>&lt;annotation encoding="application/x-tex">q_1, q_2, q_3&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:0.625em;vertical-align:-0.1944em;">&lt;/span>&lt;span class="mord">&lt;span class="mord mathnormal" style="margin-right:0.03588em;">q&lt;/span>&lt;span class="msupsub">&lt;span class="vlist-t vlist-t2">&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.3011em;">&lt;span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;">&lt;span class="pstrut" style="height:2.7em;">&lt;/span>&lt;span class="sizing reset-size6 size3 mtight">&lt;span class="mord mtight">1&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;span class="vlist-s">​&lt;/span>&lt;/span>&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.15em;">&lt;span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;span class="mpunct">,&lt;/span>&lt;span class="mspace" style="margin-right:0.1667em;">&lt;/span>&lt;span class="mord">&lt;span class="mord mathnormal" style="margin-right:0.03588em;">q&lt;/span>&lt;span class="msupsub">&lt;span class="vlist-t vlist-t2">&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.3011em;">&lt;span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;">&lt;span class="pstrut" style="height:2.7em;">&lt;/span>&lt;span class="sizing reset-size6 size3 mtight">&lt;span class="mord mtight">2&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;span class="vlist-s">​&lt;/span>&lt;/span>&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.15em;">&lt;span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;span class="mpunct">,&lt;/span>&lt;span class="mspace" style="margin-right:0.1667em;">&lt;/span>&lt;span class="mord">&lt;span class="mord mathnormal" style="margin-right:0.03588em;">q&lt;/span>&lt;span class="msupsub">&lt;span class="vlist-t vlist-t2">&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.3011em;">&lt;span style="top:-2.55em;margin-left:-0.0359em;margin-right:0.05em;">&lt;span class="pstrut" style="height:2.7em;">&lt;/span>&lt;span class="sizing reset-size6 size3 mtight">&lt;span class="mord mtight">3&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;span class="vlist-s">​&lt;/span>&lt;/span>&lt;span class="vlist-r">&lt;span class="vlist" style="height:0.15em;">&lt;span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span>&lt;/span> ones:&lt;/p></description></item><item><title>Euler angles and gimbal lock</title><link>https://alvarorevuelta.com/posts/euler-angles/</link><pubDate>Wed, 05 Apr 2017 16:43:20 +0530</pubDate><guid>https://alvarorevuelta.com/posts/euler-angles/</guid><description>&lt;p>Euler Angles were first introduced by Leonhard Euler. According to his theorem, any rotation can be described using three angles &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mo stretchy="false">(&lt;/mo>&lt;mi mathvariant="normal">Φ&lt;/mi>&lt;mo separator="true">,&lt;/mo>&lt;mi mathvariant="normal">Θ&lt;/mi>&lt;mo separator="true">,&lt;/mo>&lt;mi mathvariant="normal">Ψ&lt;/mi>&lt;mo stretchy="false">)&lt;/mo>&lt;/mrow>&lt;annotation encoding="application/x-tex">(\Phi, \Theta, \Psi)&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:1em;vertical-align:-0.25em;">&lt;/span>&lt;span class="mopen">(&lt;/span>&lt;span class="mord">Φ&lt;/span>&lt;span class="mpunct">,&lt;/span>&lt;span class="mspace" style="margin-right:0.1667em;">&lt;/span>&lt;span class="mord">Θ&lt;/span>&lt;span class="mpunct">,&lt;/span>&lt;span class="mspace" style="margin-right:0.1667em;">&lt;/span>&lt;span class="mord">Ψ&lt;/span>&lt;span class="mclose">)&lt;/span>&lt;/span>&lt;/span>&lt;/span> also referred as roll, pitch and yaw. They can be seen as head movements: saying &amp;ldquo;no&amp;rdquo; is the yaw, saying &amp;ldquo;yes&amp;rdquo; is the pitch, and leaning the head left or right is the roll.&lt;/p>
&lt;p>&lt;img src="https://alvarorevuelta.com/images/euler-angles-img-1.png" alt="">&lt;/p>
&lt;p>Note that the order that which the angles are represented is not important, but the order of rotation is. For this post, we will be using the &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>Z&lt;/mi>&lt;mi>Y&lt;/mi>&lt;mi>X&lt;/mi>&lt;/mrow>&lt;annotation encoding="application/x-tex">ZYX&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:0.6833em;">&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.07153em;">Z&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.22222em;">Y&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.07847em;">X&lt;/span>&lt;/span>&lt;/span>&lt;/span>. The following equation is a very important expression, which represents the rotation along the three axes in the &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>Z&lt;/mi>&lt;mi>Y&lt;/mi>&lt;mi>X&lt;/mi>&lt;/mrow>&lt;annotation encoding="application/x-tex">ZYX&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:0.6833em;">&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.07153em;">Z&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.22222em;">Y&lt;/span>&lt;span class="mord mathnormal" style="margin-right:0.07847em;">X&lt;/span>&lt;/span>&lt;/span>&lt;/span> order. Note that for shortening purposes, &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>cos&lt;/mi>&lt;mo>⁡&lt;/mo>&lt;mo stretchy="false">(&lt;/mo>&lt;mi>x&lt;/mi>&lt;mo stretchy="false">)&lt;/mo>&lt;/mrow>&lt;annotation encoding="application/x-tex">\cos(x)&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:1em;vertical-align:-0.25em;">&lt;/span>&lt;span class="mop">cos&lt;/span>&lt;span class="mopen">(&lt;/span>&lt;span class="mord mathnormal">x&lt;/span>&lt;span class="mclose">)&lt;/span>&lt;/span>&lt;/span>&lt;/span> is &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>c&lt;/mi>&lt;mo stretchy="false">(&lt;/mo>&lt;mi>x&lt;/mi>&lt;mo stretchy="false">)&lt;/mo>&lt;/mrow>&lt;annotation encoding="application/x-tex">c(x)&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:1em;vertical-align:-0.25em;">&lt;/span>&lt;span class="mord mathnormal">c&lt;/span>&lt;span class="mopen">(&lt;/span>&lt;span class="mord mathnormal">x&lt;/span>&lt;span class="mclose">)&lt;/span>&lt;/span>&lt;/span>&lt;/span> and &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>sin&lt;/mi>&lt;mo>⁡&lt;/mo>&lt;mo stretchy="false">(&lt;/mo>&lt;mi>x&lt;/mi>&lt;mo stretchy="false">)&lt;/mo>&lt;/mrow>&lt;annotation encoding="application/x-tex">\sin(x)&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:1em;vertical-align:-0.25em;">&lt;/span>&lt;span class="mop">sin&lt;/span>&lt;span class="mopen">(&lt;/span>&lt;span class="mord mathnormal">x&lt;/span>&lt;span class="mclose">)&lt;/span>&lt;/span>&lt;/span>&lt;/span> is &lt;span class="katex">&lt;span class="katex-mathml">&lt;math xmlns="http://www.w3.org/1998/Math/MathML">&lt;semantics>&lt;mrow>&lt;mi>s&lt;/mi>&lt;mo stretchy="false">(&lt;/mo>&lt;mi>x&lt;/mi>&lt;mo stretchy="false">)&lt;/mo>&lt;/mrow>&lt;annotation encoding="application/x-tex">s(x)&lt;/annotation>&lt;/semantics>&lt;/math>&lt;/span>&lt;span class="katex-html" aria-hidden="true">&lt;span class="base">&lt;span class="strut" style="height:1em;vertical-align:-0.25em;">&lt;/span>&lt;span class="mord mathnormal">s&lt;/span>&lt;span class="mopen">(&lt;/span>&lt;span class="mord mathnormal">x&lt;/span>&lt;span class="mclose">)&lt;/span>&lt;/span>&lt;/span>&lt;/span>.&lt;/p></description></item></channel></rss>