Raphael Addile
https://raphaeladdile.com/
Recent content on Raphael AddileHugo -- gohugo.ioraphael.addile@gmail.com (Raphael Miedl)raphael.addile@gmail.com (Raphael Miedl)Wed, 14 Nov 2018 00:00:00 +0000Symmetric and Asymmetric Cryptography a cursory glance
https://raphaeladdile.com/post/symmetric-and-asymmetric-cryptography/
Wed, 14 Nov 2018 00:00:00 +0000raphael.addile@gmail.com (Raphael Miedl)https://raphaeladdile.com/post/symmetric-and-asymmetric-cryptography/Goal of this blog post I will try to provide a basic overview of symmetric and asymmetric encryption and where one or the other would be used. Security is an interesting and important topic that will only gain more in importance with all the devices connected to the internet or some other network. Also I’m personally really interested in it but haven’t actually taken the time to start learning anything relevant beyond the most basic overview that I’ve snapped up from random sources.Making Recursive Functions Tail Recursive
https://raphaeladdile.com/post/making-recursive-functions-tail-recursive/
Fri, 16 Feb 2018 16:25:39 +0100raphael.addile@gmail.com (Raphael Miedl)https://raphaeladdile.com/post/making-recursive-functions-tail-recursive/First of this blog post assumes that you already have a basic understanding of recursion. I’ll use some Python for the code examples simply because it’s a popular language for learners, the concepts I’ll be talking about are language agnostic. In fact your preferred language might benefit more from tail recursion than Python.
A look at a recursive factorial function Let’s first look at an issue with recursion, so that we can later fix it using tail recursion.What is recursion?
https://raphaeladdile.com/post/what-is-recursion/
Fri, 05 Jan 2018 03:16:56 +0000raphael.addile@gmail.com (Raphael Miedl)https://raphaeladdile.com/post/what-is-recursion/Recursion is a specific way to solve problems. It’s a pretty simple concept once you understand it, but regularly confuses people when they first learn it.
In essence, when solving a problem, there often is a case that is simple to solve, a so-called base case. But many other cases that are complex and require a lot more computation. In recursion we make use of this. We look at the input, if we happen to have the simple case, we can go and return the easy solution.Don't exaggerate recursion overhead
https://raphaeladdile.com/post/dont-exaggerate-recursion-overhead/
Tue, 18 Oct 2016 00:00:00 +0000raphael.addile@gmail.com (Raphael Miedl)https://raphaeladdile.com/post/dont-exaggerate-recursion-overhead/A small pet peeve of mine is when people use the very naïve recursive implementation of the Fibonacci algorithm to show the overhead of recursion. Yes, recursion can have an overhead (depending on your environment), but it’s not nearly as much as you make it seem.
The problem, The iterative version of the Fibonacci algorithm:
def iterative_fibonacci(n): a, b = 0, 1 for _ in range(n): a, b = b, a + b return a has O(n) time complexity.String to integer conversions
https://raphaeladdile.com/post/string-to-integer-conversions/
Sun, 11 May 2014 00:00:00 +0000raphael.addile@gmail.com (Raphael Miedl)https://raphaeladdile.com/post/string-to-integer-conversions/There are various functions for converting strings to integers in the C++ standard library. This post is a small overview of these functions. I’ll start with the simplest and go to the more fully featured ones at the end.
The atoi family. These functions coming from C represent the minimal set of functionality for a string to integer conversion.
int atoi(const char *str); It only takes a single argument, a c-string and interprets it as a base-10 number.Floating point to integer conversion
https://raphaeladdile.com/post/floating-point-to-integer-conversion/
Wed, 26 Mar 2014 00:00:00 +0000raphael.addile@gmail.com (Raphael Miedl)https://raphaeladdile.com/post/floating-point-to-integer-conversion/This post serves mainly as a personal reminder and came up due to a question on stackoverflow.com. The question was:
How exactly does C++ casting between numeric types work? In my code, I do something like the following:
double a = 3.0; uint64_t b = static_cast(a); double c = static_cast(b); Interestingly, this works as I would expect (a == c), as long as a is positive, but if a is negative, c ends up as an arbitrarily large positive number.