HTTP Streaming in Elixir

http://big-elephants.com/2016-12/http-streaming-in-elixir/

Storing Nested Associations with Phoenix Forms

http://blog.heartbeathq.com/storing-nested-associations-with-phoenix-forms/

Introducing CERBAS

CERBAS - A starting point API server and web proxy backed by redis data structure memory no sql database.

Clients connect to CERBAS by storing requests from any language in redis. CERBAS dispatches elixir functions.

Also includes a Plug based proxy server with some examples.

A plus is a cronjob function handler ( via crontab syntax like file).

It’s a starting point for your API needs ( customize it to fit your needs ).

Find it on GitHub

Tensor, the Vector/Matrix/Tensor library has reached v1.0!

With the recent addition of Numbers and some improvements of the documentation, Tensor now has reached version 1.0.0!

For people that do not yet know about it:

Tensor is a library that allows you to work with sparse Vectors, Matrices and higher-order Tensors, with the following nice features:

  • An implementation of the Access protocol, so you can do mymatrix[42][3].
  • It supports the arithmetic functions you would expect from vectors, matrices and tensors. These are implemented using Numbers, which means that they work on any numeric type.
  • What is even more, Tensor itself implements Numbers’ Numeric behaviour, which means that anything that does number arithmetic can now do (elementwise) vector/matrix/tensor arithmetic! It also means that you can nest matrices ad infinitum!
  • A sparse implementation: Only elements deviating from the default element of a data structure are stored. This means that e.g. a nearly-empty 10000x10000 element matrix takes up only a neglegible amount of memory.
  • While you can work with numbers, you can store anything inside: Using it as a representation of a game board (a matrix for chess, or a 3-dimensional tensor for a Rubik’s Cube), for instance, is something that is very possible.
  • Functions to rotate, transpose, transform, combine, separate, map over and reduce vectors/matrices/tensors.

Here are some examples from the Readme:

Vectors

iex> vec = Vector.new([1,2,3,4,5])
#Vector-(5)[1, 2, 3, 4, 5]
iex> vec2 = Vector.new(~w{foo bar baz qux})
#Vector-(4)["foo", "bar", "baz", "qux"]
iex> vec2[2]
"baz"
iex> Vector.add(vec, 3)
#Vector-(5)[4, 5, 6, 7, 8]
iex> Vector.add(vec, vec)
#Vector-(5)[2, 4, 6, 8, 10]

Matrices


iex> mat = Matrix.new([[1,2,3],[4,5,6],[7,8,9]],3,3)
#Matrix-(3×3)
┌                          ┐
│       1,       2,       3│
│       4,       5,       6│
│       7,       8,       9│
└                          ┘
iex> Matrix.rotate_clockwise(mat)
#Matrix-(3×3)
┌                          ┐
│       7,       4,       1│
│       8,       5,       2│
│       9,       6,       3│
└                          ┘
iex> mat[0]
#Vector-(3)[1, 2, 3]
iex> mat[2][2]
9
iex> Matrix.diag([1,2,3])
#Matrix-(3×3)
┌                          ┐
│       1,       0,       0│
│       0,       2,       0│
│       0,       0,       3│
└                          ┘

iex> Matrix.add(mat, 2)
#Matrix-(3×3)
┌                          ┐
│       3,       4,       5│
│       6,       7,       8│
│       9,      10,      11│
└                          ┘
iex> Matrix.add(mat, mat)
#Matrix-(3×3)
┌                          ┐
│       2,       4,       6│
│       8,      10,      12│
│      14,      16,      18│
└                          ┘

Tensors

  iex> tensor = Tensor.new([[[1,2],[3,4],[5,6]],[[7,8],[9,10],[11,12]]], [3,3,2])
  #Tensor(3×3×2)
        1,       2
          3,       4
            5,       6
        7,       8
          9,      10
            11,      12
        0,       0
          0,       0
            0,       0
  iex> tensor[1]
  #Matrix-(3×2)
  ┌                 ┐
  │       7,       8│
  │       9,      10│
  │      11,      12│
  └                 ┘

You can find it on Hex.pm and on GitHub.

And here in the Elixir Forum.

db2kafka - RDBMS to Kafka pump

We just released the first cut of db2kafka, a tool that helps migrate MySQL-using apps to Kafka without having to rethink transactions, etcetera.

Code on https://github.com/PagerDuty/db2kafka and hex.pm

SearchQL: Parse search queries in Elixir

https://github.com/usecanvas/searchql

Best parts of "What's New in Ecto 2.0"

Plataformatec’s official book about the newest Ecto revamp is finally out and it’s a must-read for any serious Elixir/Rails developer.

Read more on Phoenix on Rails blog

Morse: Morse code encoder and decoder

https://github.com/sotojuan/morse

MapDiff: A small library that computes the difference between two maps

Hello everyone,

I wrote a small library today called MapDiff. It returns a map listing the (smallest amount of) changes to get from map_a to map_b:

iex> foo = %{a: 1, b: 2, c: %{d: 3, e: 4, f: 5}}
iex> bar = %{a: 1, b: 42, c: %{d: %{something_else: "entirely"}, f: 10}}
iex> MapDiff.diff(foo, bar)
%{changed: :map_change,
  value: %{a: %{changed: :equal, value: 1},
    b: %{added: 42, changed: :primitive_change, removed: 2},
    c: %{changed: :map_change,
      value: %{d: %{added: %{something_else: "entirely"},
      changed: :primitive_change, removed: 3},
    e: %{changed: :removed, value: 4},
    f: %{added: 10, changed: :primitive_change, removed: 5}}}}}

This is mainly useful if you have two maps describing the state of something, where replacing all of the old state and then filling in the new is too slow, which means that only replacing the things that actually are changed is better.

ExMustang slackbot 0.2 with several responders such as howdoi, uptime, isup, insult, etc.

ExMustang is a slackbot that uses Hedwig framework and implements several responders. While the responders have been primarily tested with Slack, they should work with other adapters as well.

Source code

Morphix 0.0.4 -- now with `:safe` atomorphifification!

Morphix is a tiny library of utility functions for working with enumerable objects.

The atomorphify and atomorphiform functions will convert the string keys of a map into atoms. This worries some people because atoms are never garbage collected, so both methods now take a :safe flag that will prevent them from creating new atoms.

Usefull for partial application of a structure over a large JSON message – only atomize the strings you know you want to access, but keep the whole object.

https://hex.pm/packages/morphix

Tuning Elixir GenStage/Flow pipeline processing

How to use Flow to implement parallel pipeline processing and be confident about performance.

http://teamon.eu/2016/tuning-elixir-genstage-flow-pipeline-processing/

How to write a simple chat application

With a brand new authentication package - Coherence, Channels and Presence.

https://medium.com/@Stephanbv/elixir-phoenix-build-a-simple-chat-room-7f20ee8e8f9c#.apth0plzq

Benchmarking communication between Elixir and Ruby

Benchmarking communication between Elixir and Ruby described in last 3 posts.

https://blog.fazibear.me/elixir-ruby-dont-fight-benchmark-9c6f442de37e#.7tutheq7r

Numbers -- A generic wrapper to use *any* custom Numeric type!

Numbers is a wrapper exposing the generic functionality all kinds of (custom and built-in) numeric datatypes have. So you can use it to make your code fully number-agnostic!

The most fun might be that Tensor and ComplexNum now both follow Numbers’ Numeric behaviour ánd also use Numbers internally, which means that you can nest them arbitrarily! :D

Morphix -- now with morphification!

Version 0.0.3 adds the morphify, morphify!, and morphiflat! methods, as well as a bunch of new documentation.

morphify will take a list and a function and return a map, where, for each item in the list, the function applied to the item is the key to the item.

Also, atomorphify and atomorphiform prefer String.to_existing_atom, which is supposed to be safer.

https://hex.pm/packages/morphix

Project ExCelsius: Measuring Temperature on a Raspberry Pi

An Elixir Nerves powered Raspberry Pi reads temperature from a DS18B20 sensor through 1-wire protocol: http://www.carstenblock.org/post/project-excelsius/

Connecting Ruby and Elixir with Erlectricity

Communicate between Ruby and Elixir using Erlang Ports and Erlectricity.

https://blog.fazibear.me/elixir-ruby-dont-fight-talk-with-erlectricity-dbf3af67d999#.xkq935iwh

Many to many and upserts

This is the 9th chap of our ebook “What’s new in Ecto 2.0 (beta version)” that José Valim presents Ecto.Changeset.put_assoc/4 in contrast to `cast_assoc/3. <br> Many to many and upserts « Plataformatec Blog

[Screencast] Per-user workers with custom queue processing

I’ve recorded a screencast explaining how I solved a problem in my current Elixir project using GenServer and Supervisor

https://youtu.be/19JakddwsV8

Previous page Next page