Cons is Good - or why concatenating lists is slower than prepending elements Elixir Data Science Recently I sat and leafed through the book Programming Elixir . It had a simple challenge to write a function that would create a list from two inputs: from and to , creating an element for each value between and including from and to . I wrote something like this: def span_list (from, to, acc \\ [])…
Optimizing Travel Routes Applying Genetic Algorithms to the Traveling Salesman Problem elixir livebook algorithms Written by Anders Björkland, Web Developer at Umain Have you ever watched a delivery driver crisscrossing your neighborhood and wondered if they were taking the most efficient route? That's the Traveling Salesman Problem in action! This classic challenge has entertained…
Intro to Genetic Algorithms with Elixir elixir livebook algorithms Written by Anders Björkland, Web Developer at Umain Genetic Algorithms (GA) are algorithms inspired by the evolutionary process found in nature. Sometimes these are called Stochastic Algorithms as they make use of randomness to find an optimal solution, but with features such a "natural selection" to remove less suitable solutions…
Interactive documents with Livebook elixir livebook Have you ever wrestled with confusing documentation while trying to learn a new library or language? The explanations might be sparse, the code examples outdated, or the concepts too advanced for a beginner. It's a common frustration! Take the powerful R visualization library ggplot2 . Its complex subject matter and documentation make it a…
Mysterious Crystal Ball A Livebook application that behind the scenes fetches 10 of the latest news stories from the previous day based on a randomly selected subject. It then applies the HuggingFaceTB/cosmo-1b to generate a cryptic message about the news stories which are then stored into a term-file. One of these stories are selected and displayed. As the app does not have access to a GPU,…
Resize Image Uploads with LiveView elixir phoenix liveview In this article we will see how to resize an image before uploading it to a Phoenix backend. We will do this by adding a profile image to the user in a basic Phoenix setup. This will take us through the process of modifying an existing schema, create and run a migration, write custom hooks, add file validation, and ultimately create a new…
Schroedinger's Snack Stash Elixir In the heart of Beakerage, where sea serpents sunbathed and pocket-sized black holes were as common as gossip at the local bakery, Keith - the Quantum Quokka - awoke with a start! “ May your macarons never vanish into the void .” The ethereal voice was still echoing in Keith’s mind. He couldn’t recall anyone making such an astute statement, yet here it was:…
The Macaron Paradox Elixir It was a bustling town tearing by its threads. It was on the cusp of being called a city by the travelers arriving by boatloads each day, were it not for the inhabitants wielding their favorite pastry in a threatening way on even the slightest suggestion that their town was not just a little hamlet by the harbor. Once upon a time it was! And it was the way that many…
Evolution of PHP PHP While there have been articles before foretelling about both the death and the rebirth of PHP, this time we will simply look at how PHP has evolved over the years and what has been the driving force behind it. The beginning Let's take a journey back to the early days of the web, when Rasmus Lerdorf created PHP in 1994. It all started with a simple idea - to track visitors…
Top 6 uses of open source machine learning models axon AI ONNX BumbleBee HuggingFace AI is all the rage right now. While it's not the first time in history that we believe we are on the cusp of a great leap in AI advancement only to have an "AI winter" fall upon the field. This time it feels different, and rather than waning investments in the field, we see many diverse organizations (and…
Laugh Out Loud with LiveView elixir phoenix liveview PubSub Are you ready to take your website to the next level? Phoenix LiveView is here to help! In this article, we’ll show you how to create a website that’s not only interactive but also hilarious. Visitors will be able to make their mark by showing their taste in humor, and see how their taste align with others´. It’s the perfect way to engage…
Discovering Phoenix elixir phoenix Phoenix is a web development framework written in Elixir that uses a server-side model-view-controller (MVC) pattern. It’s perfect for building highly scalable and fault-tolerant applications. In this article, we’ll explore Phoenix by building a simple RESTful API with it. But not just any API - we’ll build a dad-joke machine! We’ll show you how to generate…
Remembering Limits calculus limits It’s been a long (loooooo-oooo-oooong) time since I studied mathematics. And with all the rage that is “AI” and machine learning (ML), I thought now would be a good time. I did an initial venture into ML but quickly realized that I do not know a knob from a steering wheel. That was when the YouTube Algo-monster figured I should look at a clip by AssemblyAI: “How…
Stock Limits? No Problem! Add availability check to your Sylius Storefront Sylius Are you missing a stock limit in your Sylius storefront? Say no more! In this article, we’ll show you how to add a Stock Limit to your Sylius Storefront with ease. With Sylius’ flexibility and malleability, you can enhance your inventory in ways you never thought possible. And who knows? You might even have some fun…
Retro Markdown Editor Retro Markdown is a retro-inspired markdown editor with live preview. The source of inspiration is the Amos-editor on Amiga. The project is a React app with state management handled by Redux. The source code is available for viewing on GitHub .
Sylius Showcase Docker Image A Docker Image built with ease of use in mind, to easily set up a showcase should the need arise. The image uses supervisord to run the following services: PHP-FPM Nginx MariaDB The image showcases the Sylius example shop and allows for loading its fixtures for example content. Check the image out on Docker Hub
Discovering the Elixir programming language elixir phoenix Elixir is an exciting programming language to learn. Especially coming from an Object Oriented Programming (OOP) background. There is so much to discover, because for many, it has flown under the radar. Just look at this chart! Look at it 👇 ( ignore the cats ) While OOP is a popular thing, functional programming is growing in usage and…
Discovering API Platform symfony api platform The story of API Platform is a story of standards. Some would say it is best-in-class API framework! It is a stand-alone library in the PHP flora, and is a popular pairing with Symfony projects. In this article we will discover what API Platform is, from initial setup to basic usage. Let's tickle some endpoints! REST is for data what SOAP is for…