CODEX

The intersection of lists shouldn’t be a nightmare, but it easily could become one. It isn’t unusual to need the intersection of two lists. So, what is the easiest way to do it in Java?

Firstly, what intersection of two list means? Let’s assume that we have two lists of String, one with a dictionary of names and one with some random names. We want to know if our random name list contains names from the dictionary list and which one.

Give the two lists:

List<String> dictonaryList = Arrays.asList(“Adam”, “Mary”, “Ana”, “Ben”, “Ted”);List<String> randomNamesList = Arrays.asList(“Mary”, “John”, “Ben”, “Hur”);


7 changes that will happen with the human body in the next century

Human evolution is never stopping. Our bodies are in constant change and we are adapting constantly to our environment. Researchers and futurologists believe that the human body as we know may look very different in the next century. For example, in the last centuries, humans became more solid and taller and our life expectancy almost doubled.

  1. We will have more flexible bodies


Need a simple reusable wrapper for your Angular Component?

Do you need a really simple reusable wrapper for your Angular Component? And also, you know that this component will always be a basic component and you will never need a complex logic in it? That’s perfect, I will show you one way to achieve this behaviour in an easy manner.

If you already read my article about creating complex Angular Wrapper Component (found here: https://javascript.plainenglish.io/angular-wrapper-component-e56859b6d69c), you know that there is a possibility to create advanced wrappers, that are open for extension but are a little bit harder to maintain and code.

So, let’s take a table for example. I…


Did you ever wonder what is the best and clean way to make JavaScript REST API calls? What about in a big project, where you are making hundreds of them?

I had this question too late in my projects, after a lot of code was already written. It is much better to know early which method to choose, it will give you a lot less headaches later.

As you may know, there are a lot of options to call API from JavaScript. Some of them are XMLHttpRequest, jQuery, fetch and so one. …


So, you decided to build a gallery android application but native android layout system is giving you headaches? You have an alternative now.

Why did I choose to write this article? I wanted to build an android app that works like Google Photo on a private cloud. Meaning that I need an android app that synchronizes all my device photos and videos and sends them over some kind of requests (http, tcp…) to a remote server. Also, I wanted to be able to see those images and videos in a gallery style on my app.

What I did first was…


Have you ever wondered how to call pure Android Kotlin (or Java) functions from JavaScript?

There are a few frameworks that are already doing this for you, like Ionic or React Native, and Apache Cordova. I am not going to talk about them now as I like to build things from scratch and I am more confident in something that I build myself.

When I first wanted to build fast android application, I searched for solutions on building android applications using web technologies. …


Prerequisite: Angular, Typescript, ng-template, ng-container

When I first start an Angular 2+ project, the first thing I look up for is a component library. I test some and then I choose a winner. Everything is great, I can focus on my business logic now and just use some already built components, like table, toogles, tabs, wizards, with a lot of built in functionality.

Usually, I use a component multiple times in my project, some of them even hundreds of times. …


Prerequisite: Javascript, Typescript, RxJs operators, RxJs pipes, Observable, subscription.

RxJs comes with a great power and an easy approach to reactive programming in javascript. It comes with a lot of built-in operators, but sometimes, you just need to create your own.

It is easy to create a simple operator by just using some built in ones, like filter. We will start easy first and then we will create a more complex one, without using the built-in operators, just from scratch.

Creating operators using the built in operators

Let’s create a multiply by 2 operator from a stream. This is quite…

Beniamin Pantiru

Java and Angular enthusiast, Technical Lead on Java and Angular, husband and father.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store