Developers look at the technologies that companies adopt as one main metric when evaluating a collaboration. A decision based on this is too superficial. Do we really fear the technology? Or maybe we associate the company culture with it?
I want to tell you my story and what I would have lost if I refused to work in COBOL back in 2010 when I was 25.
After university, I started working in a big company in Milan. I was working on a private social network, using the most recent Java technology stack. …
In Kotlin we have null safety.
There are many advantages to using nullables in Kotlin, even if they can’t be totally considered as monad. Your API can express optionality in a clean/compile-time-safe way. Also, they bring back your side-effectful function to the pure world.
This feature is one of the most exciting and idiomatic of this language. Anyway, there is one drawback. Composability!
I will propose a solution to this annoyance.
Well… I can’t say that composing independently computed values really shines. Let’s figure out a real-world use-case.
Let’s think about a crypto exchange. Suppose that when registering, they ask…
In Domain Driven Design there is a concept of ubiquitous language. Being trivial, this is usually related to the names you give to the entities in the domain model.
However, it’s possible to take it a step further. We can turn the code into an unequivocal expression of the domain.
For example, here it follows how an American domain expert may describe a “contact” and some business rules.
A contact has a name, a surname, and an email. The name can have a middle initial. The email must be verified. You can send password recovery only to verified emails.
A…
Kotlin coroutines are an efficient way to (re)use threads while the computation has been moved somewhere else. Coroutines are bound to the concept of Scope
: to run one, you need before to declare a scope object. This is how they implement structured concurrency. To get a scope, you use the scope-builders functions, like coroutineScope{}
or runBlocking{}
. A scope suspends (or blocks) a thread until all of its coroutines are finished.
The following example will print “213.”
This means that you can’t just fire-and-forget an operation if you don’t have the plain control of your main
(quite usual…
There is a colleague of mine, Dario, who gives great happy birthday greetings.
Everyone in the office is happy to receive an audio greeting from Dario. They say, “it is not a birthday until Dario sends you the greeting.”
So why not let everyone in the world be greeted by Dario on their birthday Do you want to try it out?
At the moment it is only in Italian (sorry).
Github repository here:
I need an easy way for people to ask for greetings. Website? Who still uses a website in the platform era? Platform then. Which one? Facebook? Twitter…
Functional programming gained a big momentum in the IT field; many things come and go, but FP is not one of them. It is much more expressive than OOP.
I started digging into it a few years ago, during the LambdaConf in Bologna, and the more insight I get, the more I love FP.
In June, I went to an applied functional programming workshop and the teacher went deep into algebraic data types and pattern matching. I also finally understood what a monad is, but this is another story.
I used to think of pattern matching as an interesting way…
These days you read a ton of articles about all the advantages of test-driven development (TDD), and hear a lot of talks at tech conferences that tell you to: “Do the tests!”, and how cool it is to do them.
And you know what? Unfortunately, they are right (not necessarily about the “cool” part, but about the useful part).
Tests are a must!
The typical advantages we list when it comes to talking about TDD are real:
…
In this piece, I’m going to explain a simple technique for barcode segmentation from images.
For the example code, I will adopt Python 2.7 in its Anaconda incarnation and OpenCV as image processing library.
I chose Python as it is a very practical choice for quickly writing examples, but the technique can be adopted in any language of your choice.
Anaconda is an interesting Python distribution that bundles a series of useful tools for scientific programming.
Segmentation is the process of identifying the position of one or more objects inside an image.
This article is also available in english
In questo articolo vado a spiegare una tecnica di segmentazione di codici a barre da immagini. Per l’esempio utilizzerò Python 2.7 nella sua incarnazione Anaconda e OpenCV come libreria di image processing. La scelta ricade su python per comodità ma la tecnica illustrata è utilizzabile in qualsiasi altro linguaggio. Anaconda è un’interessante distribuzione di Python che racchiude in bundle una serie di strumenti e librerie molto utili in ambito di programmazione “scientifica” tra cui matplotlib, un’ ottima libreria per rappresentare i dati estratti tramite schemi e grafici. …
I’m a programmer. I love programming, any language, any paradigm