teleren/devto huggingface dataset:
✋ Avoid EventEmitter Inheritance
Tags: javascript, node
Published: 2020-02-17 16:21:33

For a long time I have been observing how a large number of libraries, modules, frameworks, etc. made for Node.js solve a need that arises as follows:


They see the need to add the behavior of the EventEmitter class and what they do is make a complete inheritance of this class 💩, which generates on the one hand, that a class as simple as Person, which can be seen in the image From below, grow unnecessarily in complexity, inheriting all EventEmitter behavior. Now what relationship exists between a Person and the rawListeners method?, 
they don't have real neither logical relationship.


It is evident that a person generates events and that he can possess this behavior, but the prototype of a person logically is not EventEmitter, surely many will realize how to solve this problem, applying composition over inheritance.


Here is an example in Express.js, an object called app is created that inherits all EventEmitter behavior:

[Express.js example](https://github.com/expressjs/express/blob/e1b45ebd050b6f06aa38cda5aaf0c21708b0c71e/lib/express.js#L42)


Now if we see it in this image that I did, it is clearer what I want to express, someone who has to analyze the behavior of a class or quickly visualize the methods and properties, he will meet this context:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/h0qq7huudrnz1jiff5md.png)
Web Design Trends 2020: to Make Your Website Both Visually Stunning and User-Friendly 
Tags: webdev, design, uiweekly
Published: 2020-02-17 16:18:01

The stunning visuals and creativity are a crucial part of every good design. But with the technology development and the growing importance of the UX, the design evolves towards a more functional and user-centered approach. For this reason, 2020 web design trends cover not only visual design solutions but also the ideas on how to make your design embrace the new functional possibilities. So, let’s get started with our guide to the main website trends of the new decade. http://bit.ly/3bNkR3w
I'm trying to figure out a way to use git to ignore local deletions
Tags: help
Published: 2020-02-17 16:00:55

I recently had the idea to try and create a modular dotfile setup by using
`git update-index --skip-worktree "$file_or_dir_in_question"`. the goal was to be able to keep all my dotfiles in a centralized repository, then pull them and delete the ones unnecessary for that system, be that because the required package isn't installed or it was something specific to another distro. Here's a [script](https://github.com/skewballfox/user_env/blob/master/dotfile_setup.sh) I wrote to do this automatically. I also did the [same](https://github.com/skewballfox/Classes/blob/master/remove_old_classes.sh) for a repository I use to keep track of all my work for my classes over the last two semesters.

So I accidentally deleted a lot of my old dotfiles (thankfully most weren't necessary) last night. I figured it was a bug in the script(ie the local worktrees weren't being ignored, but after using this same technique for my classes, verifying they were being ignored, and seeing that the files were still being listed as deleted via the `commit` messages, I realized that the script was working properly, but either `git` or `skip-worktree` was the wrong tool for the job.

What could I do with git, or another version control tool in order to get the result I want, i.e. keep the files/directories in remote but delete the local copies without pushing those deletions when I need to update the remote repository?
BEM Naming question
Tags: help
Published: 2020-02-17 15:29:22

I have used BEM for naming class sass so far. I have a question, am I naming right? If it not, which way is correct? Thanks for everyone who saw this article!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/v41xgni3zedl3fogdybi.png)
Which algorithms are you using to build software for the web?
Tags: discuss
Published: 2020-02-17 15:26:57

Which algorithms are you using from your computer science days when building software for the web? How often do you utilize them in the front end?

I re-read this excellent article by Molly Struve, and these are the questions that came to mind. 🤯
{% link https://dev.to/molly_struve/scaling-elasticsearch-part-1-how-to-speed-up-indexing-2pel %}
Software development and LEGO blocks
Tags: humor, architecture
Published: 2020-02-17 15:12:29

---
title: Software development and LEGO blocks
tags: humor,architecture 
published: true
description: As easy as assembling LEGO blocks
canonical_url: https://danlebrero.com/2020/01/15/software-dev-and-lego-blocks/
---

As I hear for the nth time the "Composable as LEGO blocks" analogy in some software related talk, I cannot stop thinking about my childhood's experience with LEGO, which to be honest has not improved over the years:
 
![Software as LEGO blocks](https://danlebrero.com/images/blog/lego/sw-as-lego-blocks.jpg "Software and LEGO blocks")
 
Once you try to assembly you very own toy, you end up with at best a pitiful monstrosity that barely looks as what you imagined ... unless you have an infinite amount of pieces and a hell of a lot of time on your hands.

It happens that this is not a lot different from my experience building software, so maybe the LEGO analogy actually works:

> You never have the right tools, frameworks and/or people.
>
> You never have enough time.
>
> And you always end up with a monstrosity
>
> that barely resembles what, in your imagination, 
>
> that beautiful design and architecture looked like.

I have to confess that I have always been a Playmobil kid (or a Click-fan for those Spaniards old enough!).

![Software and Playmobil](https://danlebrero.com/images/blog/lego/playmobil.jpg "Software and Playmobil")

Not being able to bend the elbow still sucks but, who cares? Playmobil FTW!
Laravel 6 Guzzle Http Client Request Example
Tags: clientrequest, laravel, guzzle, package
Published: 2020-02-17 14:56:41

Hello Artisan, in this tutorial i am going to discuss about guzzle http client request. I will discuss about guzzle http client request step by step. Do you know how to use laravel 6 guzzle http client request? If you don't know how to use it, then you are a right place.

https://www.codechief.org/article/laravel-6-guzzle-http-client-request-example
Data Visualization with JS
Tags: javascript, datavisualization, graph, dev
Published: 2020-02-17 14:41:19

*In this blog, we will talk about Data Visualization JS Frameworks.*



**JS frameworks for data visualization**

Currently, there is a number of data-visualization JS Frameworks/libraries available in the market. Notable tools are

- [D3JS](https://d3js.org)

- [ChartJS](https://www.chartjs.org)

- [ThreeJS](https://threejs.org)

- [Cytoscape](https://js.cytoscape.org)

- [PlotlyJs](https://plot.ly/javascript)


These tools are popular ones. There are other tools as well. These tools are really good in terms of the application that we can build where you have data analysis in place.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/mmumzu3rpj0q1fx0qwi3.png)




**Why do we need these tools or libraries?**

Nowadays many firms are using graphs and charts as a major weapon for data visualization as modern web applications have become sleek and fast. It kind of makes sense to have tools that we can use to visualize meaning data.

These tools are majorly used in Financial institutions, Data science, Social media platforms.

These tools provide animations, different ways of representation.



**Compatibility of these D.V JS tools with UI frameworks and libraries**

One of the questions that come to our mind when we build a web application that whether the D.V library will be compatible with the UI library or not. No worries, nowadays the web UI libraries and frameworks are mostly compatible with the D.V tool and vice versa.


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/yx4g22f6cdm4dstsog8i.png)


For example :

D3JS - This framework is the revelation and it is compatible with all the modern web toolkits.


You can find the installation options available for D3JS on npm or on their official website.

[Angular](https://angular.io), [React](https://reactjs.org) and [Vue](https://vuejs.org), all these frameworks/libraries support graph visualization tools. They have dedicated components specific to [React](https://reactjs.org) and [Angular](https://angular.io).



**Developer friendly - the Learning curve**

To learn a new technology you need to dedicate some amount of time say two to three months if you want to master it.

*Most developers prefer to get started in an unorthodox fashion by jumping to the tutorial videos of the tools. It is advisable to developers that whenever they start learning a new technology they should refer to the official documentation because most of the times official documentation provides you the minute details that a tutorial may not.*


[11 JavaScript Data Visualization Libraries in 2019](https://blog.bitsrc.io/11-javascript-charts-and-data-visualization-libraries-for-2018-f01a283a5727)


I have kept the article short so that I don't crap out - just kidding. I will keep coming up with new topics and articles. Please share if you like the article that will be an encouraging factor for me.
Share serial data of one COM port among several applications
Tags: splitter, hamradio, comport, serialport
Published: 2020-02-17 14:40:32

---
title: Share serial data of one COM port among several applications
published: true
description: In case if you need to send data to several serial devices from a single communications application simultaneously
tags: splitter, hamradio, com port, serial port
---
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/cc7w6kwt8steuow0stb5.png)

Serial Port Splitter creates many virtual COM ports joined to the required physical COM port. Any application acknowledges virtual serial ports as were common hardware COM ports.

When virtual serial ports are opened by communications applications, information from the physical COM port is shipped to any or all opened virtual COM ports at the same time. And contrariwise, information from every communications application written to a virtual COM port is shipped to the physical COM port.

https://www.serial-splitter.com/use-cases/ham-radio-usage/splitting-transceiver-port/
Learning the concepts of HBase
Tags: hbase, todayilearned
Published: 2020-02-17 14:15:54

Last week I started working with HBase. As someone who has worked almost exclusively with relational databases so far, it was not easy for me to understand the concepts behind HBase.

There are several tutorials for HBase on the internet, but very few of them helped me to understand it. In this blog post I want to gather the links that have been useful to me:

## Post by Jim Wilson
https://dzone.com/articles/understanding-hbase-and-bigtab
This blog post is also linked in the official documentation. Jim explains with JSON how the data is structured in HBase. I found this explanation particularly descriptive.

## Article by Amandeep
http://0b4af6cdc2f0c5998459-c0245c5c937c5dedcca3f1764ecc9b2f.r43.cf2.rackcdn.com/9353-login1210_khurana.pdf
At the beginning, Amandeep explains the structure of HBase. In the second part, he then uses an example to show how HBase is applied. He compares different solution approaches and indicates their advantages and disadvantages. Especially the second part helped me to design my own HBase schema.

## The official Documentation
https://hbase.apache.org/book.html#datamodel
To be honest, I have not read the complete HBase documentation. It is far too extensive to understand the fundamentals. But the chapter Data Model gives a good impression of how HBase is structured.

## Playing with HBase shell

To play around a bit with HBase, I used the following git repository: https://github.com/big-data-europe/docker-hbase/
I should mention that for performance reasons HBase should not be used with Docker in production. To learn HBase, however, Docker is perfectly sufficient.

I used the `docker-compose-standalone.yml` file. After a `docker-compose up`, I logged in with `docker exec -it hbase bash` on the container. With `hbase shell` on the container, I was connected with a working HBase environment.

I play around with the HBase Shell commands I found here: https://sparkbyexamples.com/hbase/hbase-shell-commands-cheat-sheet
Dom Manipulation – JavaScript Series – Part 23
Tags: javascript, webdev, beginners, tutorial
Published: 2020-02-17 14:39:30

We’ve ended the javascript basics, what next ? We are going to learn about the javascript dom manipulation.

Let’s go to console in write document.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lt4zfra9ttxi1kukthsr.png)

We can see the whole html we wrote right ?

Now we can manipulate this with our javascript code. Sound fun ?

Let’s try to write document.write('Hiiiiiiiii') in console and see the magic!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/nyl4fltcf23fm6bnjsbh.png)

So where the document is coming from ?

document is a global object which is available on the browser. But it has a parent, can you guess ?

write window in the console and see what happens –

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/pai52x95zmdiqu0wazmh.png)

Interested to make your self into a magician who can change the dom ?


You can see the graphical version here
{% instagram B8qLYmSge4i %}

Source Codes - { Check commits }
{% github nerdjfpb/javaScript-Series %}

Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/javascript-part-23/). You can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/)!
A pattern a day keeps the reviewers away - [Day 6] - Adapter Pattern
Tags: beginners, tutorial, productivity, codequality
Published: 2020-02-17 14:39:16

Hey 👀✨

It's been 7 days already, that's totally a new achievement! I hope both you and I are learning **a lot** from these posts, and please, do not hesitate to contact me with your ideas and constructive criticism to make these post better and better!

Well, let's get started:

![Unleash the post gif](https://media.giphy.com/media/3o8doT5DaMjfH3paHC/giphy.gif)

__________________________

The first day of a new week, and it's the turn for another design pattern, one that you may find really obvious, but also one that is not as used at it should be. Today, I'll be writing about the **Adapter Controller**.

Let's get in context. You may have worked before with some APIs that give you a lot of data in many *different ways and shapes*. Maybe you also had to transform this data and send it to a website, or a chart, or a PDF... Many options here.

Once you try to send the data for your first time, you notice that the service where you are sending the information *needs your data in a specific format and type*.

Here is where the **Adapter Design Pattern** gets into action.

![Improvise, Adapt, Overcome GIF](https://media1.tenor.com/images/8c06adfbb313a6f2d9632ce8cd4ff708/tenor.gif?itemid=10468556)

This pattern functionality is pretty basic, you may have already realized how does it work. Is just the same logic as an electricity adapter.

![A computer factory diagram](https://i1.wp.com/www.javagists.com/wp-content/uploads/2018/01/adapter-Example.png?ssl=1)
<figcaption>Diagram from https://www.javagists.com/adapter-design-pattern</figcaption>

What should you have in mind when working with Adapters?:

Well, there isn't much to say here. You'll always need to have in mind that **the data transformation it's made inside the Adapter Class**, and it will send it to the object that requested this information. It should be *between* the sender and the requester.

Want to know more about how to implement this pattern? [Click here.](https://refactoring.guru/design-patterns/adapter#checklist)

By following these simple rules, everything will fit together and you won't have to worry about that weird information that comes from that 0.1-alpha API you found.


![Perfect fit gif](https://media.giphy.com/media/gqHpvjKG5me9W/giphy.gif)
<figcaption>Perfect fit!</figcaption>
__________________________

And this is my sixth post about design patterns for the series "A pattern a day keeps the reviewers away".

![Bye!](https://i.giphy.com/media/m9eG1qVjvN56H0MXt8/giphy.gif)

**I'll try** to keep posting every day one of the different patterns that are around. I can't promise I'll fulfil this task every day though!

You can read more about this pattern at:

1. [Refactoring Guru](https://refactoring.guru/design-patterns/adapter)
2. [Sourcemaking](https://sourcemaking.com/design_patterns/adapter)

Also, you can follow me so you are tuned to whenever I post something through my [Twitter](twitter.com/brownio_) account!
the cloud turns everything upside down !
Tags: webdev, cloud, ssh
Published: 2020-02-17 14:38:25

NOTE TO MGR : I promise this is my last post of the day and I will start to do some REAL work - and actually I do have a oracle london meetup to go to tonight !

BUT the idea of running my "Theia Personal" instance as my primary UI and then launching SSH inside that just goes 'against' 20 years of running BASH / SSH / terminal as my primary UI and launching eclipse/mousepad/vscode from that ! 

![local browser running remote theia running ssh running top](https://dev-to-uploads.s3.amazonaws.com/i/0gmyzwrfp3mjy28hl4dy.png)
App + Web = Vaadin
Tags: java, webdev, vaadin, beginners
Published: 2020-02-17 14:33:12

The “App vs. Web” question is  in the mind and mouth of many developers. With tech giants such as Microsoft investing big on Progressive Web Applications (PWAs for short) the topic is  increasingly popular. 

_A quick disclaimer: I’m a trainee at Vaadin, but this blog is for my personal  thoughts - not Vaadin’s. I think it’s only natural that the content of my DEV blog is influenced by my current occupation._

The question is essentially about how you deploy an application: Do you code a mobile app that the user downloads and installs on their device? Or is a web page that the user can navigate with a browser a better option? Do you need both?

Progressive Web Applications attempt to answer that question; they are native like, installable, applications that run in the browser but can be installed to look and feel like ordinary software. There are benefits for the programmer in this approach:

* Code once run everywhere
* Only update and maintain on one platform
* No store required
* Lower development/maintenance cost

and for the user:

* Access on any device
* No updates to download
* Less storage required
* Fast loading times

There are several popular PWAs in play today, such as Twitter, Pinterest, Tinder etc. I'm only scratching the surface of the potential of PWAs here and there are several resources that take a deeper dive. Maybe I'll write my next blog post to introduce some of them? 

However, like anything on the internet, these applications require a front-end and a back-end, i.e the UI and what it controls. These "full-stack" apps can be complicated to code with multiple dependencies running through several programming languages.

Now, this is where Vaadin comes in; a framework for developing both ends of a PWA in Java. No knowledge on HTML or CSS required to build the UI. You can read more in this [entry level tutorial series](https://vaadin.com/learn/tutorials/java-web-app) that I've been helping with. New chapters every week!

If you’ve seen my previous posts you’ll know classify myself as a beginner - I’m simply content in only having to deal with 1 programming language instead of 3 for now, even when that requires its own tool to master… 

(Maybe I could insert one of my cheesy analogies here?)

“It’s easier to build a house with power tools than with three foreign friends that don’t speak the same language”. 

(Eh, you get my point anyway!)

Do you have any thoughts on this approach of programming PWAs or any thoughts on PWAs in general? Have you used Vaadin or something else? I’d love to discuss.

Until next time,
Mikael
Daily Challenge #190 - capitalizeFirstLast
Tags: challenge
Published: 2020-02-17 14:30:09

---
title: Daily Challenge #190 - capitalizeFirstLast
published: true
series: Daily Challenge
description: Implement a function that will capitalize the first and last letter of each word. 
tags: challenge
---

For this challenge, you will have to write a function called `capitalizeFirstLast` or `capitalize_first_last`. This function will capitalize the first and last letter of each word, and lowercase what is in between.

```haskell
capitalizeFirstLast "and still i rise" -- "AnD StilL I RisE"
```

Rules:
- The function will take a single parameter, which will be a string.
- The string can contain words separated by a single space.
- Words are made of letters from the ASCII range only.
- The function should return a string.
- Only the first and last letters are uppercased.
- All the other letters should be lowercased.

Examples:

```haskell
capitalizeFirstLast "and still i rise"               -- "AnD StilL I RisE"
capitalizeFirstLast "when words fail music speaks"   -- "WheN WordS FaiL MusiC SpeakS"
capitalizeFirstLast "WHAT WE THINK WE BECOME"        -- "WhaT WE ThinK WE BecomE"
capitalizeFirstLast "dIe wITh mEMORIEs nOt dREAMs"   -- "DiE WitH MemorieS NoT DreamS"
capitalizeFirstLast "hello"                          -- "HellO"
```

Good luck!

***
_This challenge comes from [aminnairi](https://dev.to/aminnairi) here on DEV. Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
theia personal - IDEAAS ! 
Tags: webdev, ide, ideaas
Published: 2020-02-17 14:28:23

OK its not what i was was designing BUT maybe I can live with it !

As you may have noticed todays 100% `#unofficial` `#projectoftheday` was to try and use a OCI OL7 instance to run a personal [theia](https://theia-ide.org/) - a sort of IDE As A Service !

Well as you may have seen from previous post(s) its half done ! but I can only edit remote sourcecode however i have now just discovered :shock: SSH inside THEIA !

So the fact you CANT "create a new workspace" in [theia](https://theia-ide.org/) can be solved by using a SSH terminal inside your SSH tunnel ! MINDBLOWING !

AND why shouldnt I edit my files in the cloud they are going to be hosted in (or is it 'on' ?) the cloud at the end of the day ? what advantage would i have if they WERE local ? (i mean i can even run grep on my remote sourcefiles via SSH in SSH)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i9hkxmchl7tmpppkhfd8.png)