Injecting and Discovering Dependencies in OTP Supervisors

Blogpost presents several patterns for discovering sibling processes in OTP supervisors.

https://dev.to/miros/injecting-and-discovering-dependencies-in-otp-supervisors-352m

Faster test execution in Elixir

Faster testing?

Try to use setup_all to prepare the data once and re-use it in tests.

Use tags to have a better context and be able to exclude some tests.

Prepare a processing pipeline to check the quick tests first, and when they do not fail, take care of the more time-demanding tests.

More on: https://bartoszgorka.com/faster-test-execution-in-elixir

Creating Test Data with ExMachina

Learn how to use ExMachina to create test data for Elixir applications.

https://elixircasts.io/creating-data-with-exmachina

ThinkingElixir 065: Meet Core Team Member Aleksei Magusev

In episode 65 of Thinking Elixir, we talk with Elixir Core Team Member Aleksei Magusev about how he got involved in Elixir, what it’s like being on the Core Team, some of his contributions, areas in Elixir that interest him, and even his tips for learning a new programming language! He also shares some of his interests outside of computing. Meet Aleksei!

https://thinkingelixir.com/podcast-episodes/065-meet-core-team-member-aleksei-magusev/

What Are Atoms in Elixir and How To Monitor Them With AppSignal

In this post, we’ll show you what atoms are in Elixir, why you should monitor them, and how to do so with AppSignal:

https://blog.appsignal.com/2021/09/21/what-are-atoms-in-elixir-and-how-to-monitor-them-with-appsignal.html

Trans 2.3.0 released

This release incorporates some interesting new functionality:

  • Allow using embedded schemas for structured translations. This is now the preferred way of using Trans
  • Allow translating entire structs using the new translate/2 function
  • Raise if a translation does not exist when using the new translate!/3 function
  • Documentation imrovements

Additionally:

  • Trans now requires Elixir 1.7 or higher
  • Tests have been migrated from CircleCI to GitHub Actions
  • Trans dependencies have been updated to avoid compilation warnings

https://github.com/crbelaus/trans/releases/tag/v2.3.0

Thank you.

What I do with Elixir is only made possible by the work and good will of others. I wanted to write a post to show my gratitude to the community.

https://blog.nytsoi.net/2021/09/18/thank-you

Build a reactive real-time Markdown-based website with Phoenix LiveView and PardallMarkdown

PardallMarkdown is a reactive publishing framework, where you can see it in action in a video tutorial. As opposed to static website generators (such as Hugo), with PardallMarkdown, you don’t need to recompile and republish your application every time you write or modify new content. The application can be kept running indefinitely in production, while it watches a content folder for changes and the new content re-actively gets available for consumption by your application.

ElixirConf EU 2021 - short write-up from Michał Buszkiewicz

Now, that the dust after #ElixirConfEU2021 has settled, Michał Buszkiewicz wrote a short review about this event. ➡How was it? ➡How did he feel as a speaker? ➡What was the most interesting? ➡Is it worth it to go for next year’s ElixirConf EU 2022 event? Read more: https://curiosum.com/blog/elixirconf-eu-review-event #elixirlang #myelixirstatus #elixirconf #elixirconfeu

Wallaby gets a Twitter account!

Wallaby, the library for concurrent browser tests for your Elixir web apps, now has a Twitter account! Make sure to follow to keep up on the latest changes and news!

@elixir_wallaby

Introducing Aino, a new HTTP Framework

For the last few weeks I’ve been experimenting with a new take on Elixir HTTP frameworks. Aino is built on top of Elli and loosely based around Ring from Clojure.

https://blog.oestrich.org/2021/09/introducing-aino/

Dynamic Queries in Ecto

The macro EctoQuery dynamic/2 allows you to build query fragments and interpolate them into one large query.

We get easy-to-manage query building in an accessible way. It allows you to control the parameters from the user and transparently create filtering of data stored in the database.

Check on: Dynamic Queries in Ecto

Application Code Upgrades in Elixir

Let’s look at what happens during an application code upgrading process in Elixir. https://blog.appsignal.com/2021/09/14/application-code-upgrades-in-elixir.html

ThinkingElixir 064: OTP Certificate Woes with Bram Verburg

In episode 63 of Thinking Elixir, we talk with Bram Verburg about an important root certificate expiring at the end of September and how this impacts your Elixir and Erlang projects! Bram helps explain where this IS and IS NOT a problem. He also explains the different update options available. We also get Bram’s security perspectives from his years of focused study and contributions in the Elixir and Erlang communities. A great resource for understanding the current certificate situation and for protecting your Elixir projects!

https://thinkingelixir.com/podcast-episodes/064-otp-certificate-woes-with-bram-verburg/

Arrays - Fast and versatile arrays with swappable implementations

While not as prevalent as in imperative languages, arrays (collections with efficient random element access) are still very useful in Elixir for certain situations. However, so far a stable and idiomatic array library was still missing, meaning that people often had to resort to directly using Erlang’s not-so-idiomatic :array module.

Arrays aims to be this stable, efficient and idiomatic array library.

Arrays

Arrays is a library to work with well-structured Arrays with fast random-element-access for Elixir, offering a common interface with multiple implementations with varying performance guarantees that can be switched in your configuration.

hex.pm version Documentation ci Coverage Status

Using Arrays

Some simple examples:

Constructing Arrays

By calling Arrays.new or Arrays.empty:

    iex> Arrays.new(["Dvorak", "Tchaikovsky", "Bruch"])
    #Arrays.Implementations.MapArray<["Dvorak", "Tchaikovsky", "Bruch"]>

    iex> Arrays.new(["Dvorak", "Tchaikovsky", "Bruch"], implementation: Arrays.Implementations.ErlangArray)
    #Arrays.Implementations.ErlangArray<["Dvorak", "Tchaikovsky", "Bruch"]>

By using Collectable:

    iex> [1, 2, 3] |> Enum.into(Arrays.new())
    #Arrays.Implementations.MapArray<[1, 2, 3]>
    iex> for x <- 1..2, y <- 4..5, into: Arrays.new(), do: {x, y}
    #Arrays.Implementations.MapArray<[{1, 4}, {1, 5}, {2, 4}, {2, 5}]>

Some common array operations:

  • Indexing is fast.
  • The full Access calls are supported,
  • Variants of many common Enum-like functions that keep the result an array (rather than turning it into a list), are available.
    iex> words = Arrays.new(["the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"])
    #Arrays.Implementations.MapArray<["the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"]>
    iex> Arrays.size(words) # Runs in constant-time
    9
    iex> words[3] # Indexing is fast
    "fox"
    iex> words = put_in(words[2], "purple") # All of `Access` is supported
    #Arrays.Implementations.MapArray<["the", "quick", "purple", "fox", "jumps", "over", "the", "lazy", "dog"]>
    iex> # Common operations are available without having to turn the array back into a list (as `Enum` functions would do):
    iex> Arrays.map(words, &String.upcase/1) # Map a function, keep result an array
    #Arrays.Implementations.MapArray<["THE", "QUICK", "PURPLE", "FOX", "JUMPS", "OVER", "THE", "LAZY", "DOG"]>
    iex> lengths = Arrays.map(words, &String.length/1)
    #Arrays.Implementations.MapArray<[3, 5, 6, 3, 5, 4, 3, 4, 3]>
    iex> Arrays.reduce(lengths, 0, &Kernel.+/2) # `reduce_right` is supported as well.
    36

Concatenating arrays:

    iex> Arrays.new([1, 2, 3]) |> Arrays.concat(Arrays.new([4, 5, 6]))
    #Arrays.Implementations.MapArray<[1, 2, 3, 4, 5, 6]>

Slicing arrays:

    iex> ints = Arrays.new(1..100)
    iex> Arrays.slice(ints, 9..19)
    #Arrays.Implementations.MapArray<[10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20]>

Rationale

Algorithms that use arrays can be used while abstracting away from the underlying representation. Which array implementation/representation is actually used, can then later be configured/compared, to make a trade-off between ease-of-use and time/memory efficiency.

Arrays itself comes with two built-in implementations:

  • Arrays.Implementations.ErlangArray wraps the Erlang :array module, allowing this time-tested implementation to be used with all common Elixir protocols and syntactic sugar.
  • Arrays.Implementations.MapArray is a simple implementation that uses a map with sequential integers as keys.

By default, the MapArray implementation is used when creating new array objects, but this can be configured by either changing the default in your whole application, or by passing an option to a specific invocation of new/0-2, or empty/0-1.

    iex> words = Arrays.new(["the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"])
    #Arrays.Implementations.MapArray<["the", "quick", "brown", "fox", "jumps", "over", "the", "lazy", "dog"]>

Implementations provided by other libraries:

  • ArraysAja adds support for Aja‘s A.Vector, which is an implementation of a ‘Hickey Trie’ vector. For most operations, it significantly outperforms ErlangArray and MapArray.

Is it fast?

yes 🎂


I’m proud to finally present a stable release of this library for you all. Work on Arrays started a few years back but was on the backburner because of other projects. Now, I finally had some time to get back to it.

The library is heavily documented, specced and (doc)tested. I’m very eager to hear your feedback! 🙂

~Marten/Qqwy

How to Read Data of Ethereum Smart Contract

The function of reading Ethereum Smart Contract by Ethereumex and ExABI!

https://medium.com/@leeduckgo/understanding-how-to-read-data-of-ethereum-smart-contract-functional-and-blockchain-8ea614cb5f25

Python Programming 101 - Introduction

Python always comes under the top 10 programming languages and when I searched in google for research purposes which programming language is best for 2021? The first result that came up in google is “Python is the best language for 2021”.

What makes python so famous that everyone wants to work with python? There are many advantages of python such as python has one of the biggest open source community and python can easily integrate with other projects so easily.

https://www.randomskool.com/2020/07/python-programming-101-introduction.html

Erlang/Elixir library designed to handle internet message format generation

This is the first version of the library. Unfortunately, parsing is not supported now, but it should come in the following months.

https://github.com/exograd/erl-imf

Using Schemaless Changesets to Separate Concerns Between the Web Context and the Business Context

If you find yourself making multiple flavors of changeset for your business nouns and various web forms – it might be time to rethink your approach.

https://elixirfocus.com/posts/ecto-schemaless-changesets/

An Introduction to Metaprogramming in Elixir

In the first of this four-part series, learn some fundamentals of metaprogramming as well as some Elixir metaprogramming secrets: https://blog.appsignal.com/2021/09/07/an-introduction-to-metaprogramming-in-elixir.html

Previous page Next page