teleren/devto huggingface dataset:
Don't use Event Sourcing if you want auditability
Tags: architecture, eventsourcing, events
Published: 2020-05-05 08:02:00

---
title: Don't use Event Sourcing if you want auditability
published: true
date: 2020-05-05 07:54:00 UTC
tags: architecture, eventsourcing, events
canonical_url: https://blog.wick.technology//architecture/the-real-reason-for-event-sourcing/
---

The reasons for choosing an architecture can be so varied. We take into account customer needs, stakeholder requirements, legislation and non-functional requirements like availability and security.

At its core though, choosing an architecture is about choosing what you optimise for and the best choice, in the long run, is to optimise for _change_.

[Event Sourcing](https://dev.to/barryosull/event-sourcing-what-it-is-and-why-its-awesome) is pretty popular right now and one reason I hear for choosing it is auditability, “if we have a log of all the events of changes in the system, we get auditability for free!”

I think this is a bad reason to choose Event Sourcing - you’re choosing a particularly difficult pattern, simply so you can check what the system has done in the past.

## Why it might not provide auditability

It’s possible, and probable, you won’t get Event Sourcing right the first time, and who’s to say you actually have recorded all the events of the system? If you’re not testing your golden source of truth regularly then you may not have all your data in events and therefore your audit trail may not be complete.

## Why you should really choose Event Sourcing

A good reason to choose Event Sourcing is that you don’t know your future requirements. No one can fully predict how a system will evolve or what will be needed a year from now. Having a stream of events of all the previous changes which can be read from any service allows you to be flexible and implement any future requirement - it’s truly extensible. This is because any requirement can be implemented as a new service and it can load in data, transforming it and enriching it to meet what’s needed. For example, a requirement to send email reminders to fill in some questions: a new service can now consume user events to get email addresses and names, along with the events about when they last filled in the questions. The new service builds up an understanding of the current state of the system and then uses that to make decisions. This is all possible without changing the existing services, which helps to reduce the chance of introducing regressions, and makes it simpler to deploy since the change is only adding services, not modifying any.

In this way, Event Sourcing optimises for dealing with _change_ in requirements.
[PT-BR] Quer Chocolatey?
Tags: windows, chocolatey
Published: 2020-05-05 07:47:15

Fala, galera! Beleza?
Já ouviram falar do Chocolatey?
Não?
Então vou lhes apresentar…

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

[Chocolatey] (https://chocolatey.org/) é uma solução de gerenciamento de software para Windows (parecido com o [NPM] (https://www.npmjs.com/) do [NodeJS] (https://nodejs.org/en/) ).

Para instalá-lo é muito simples. Você pode utilizar o [CMD](https://docs.microsoft.com/pt-br/windows-server/administration/windows-commands/cmd) padrão ou o [PowerShell] (https://docs.microsoft.com/pt-br/powershell/scripting/getting-started/getting-started-with-windows-powershell?view=powershell-7). Obs: certifique-se de estar como administrador. 
Vamos começar pelo ***CMD***:
1 – Copie e cole o seguinte comando:
```bash
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
```
2 – Se não apareceu nenhuma mensagem de erro, basta digitar 
```bash
choco
```
ou
```bash
choco -?
``` 

Agora, pelo ***PowerShell*** :
1 - ```bash
  Run Get-ExecutionPolicy 
```
Caso o retorne uma mensagem "Restricted", então execute 
```bash
 Set-ExecutionPolicy AllSigned 
``` 
ou 
```bash 
Set-ExecutionPolicy Bypass -Scope Process 
```

2 – Agora, copie e cole o seguinte comando:
```bash
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
```

3 - Se não apareceu nenhuma mensagem de erro, basta digitar ```choco ``` ou ```choco -? ```

Para instalar algum software via Chocolatey, basta digitar ``` choco install <nomedopacote> ``` Você pode pesquisar pelos softwares disponíveis nesse [link] (https://chocolatey.org/packages).

Para mais informações, acesse o [site oficial do Chocolatey] (https://chocolatey.org).

Muito obrigado pela atenção!
Até mais!
Text readability library in Elm
Tags: elm, packagerelease, readabilityformula
Published: 2020-05-05 07:46:28

---
title: Text readability library in Elm
published: true
description: Release of the Elm readability package. Dale-Chall & Coleman-Liau readability formula included.
tags: Elm, Package release, readability formula
---

I am happy to announce the release of an Elm package that will evaluate text according to the [Dale-Chall](https://en.wikipedia.org/wiki/Dale%E2%80%93Chall_readability_formula) and [Coleman-Liau](https://en.wikipedia.org/wiki/Coleman%E2%80%93Liau_index) readability formula.

The package can be found in the official Elm package repository: https://package.elm-lang.org/packages/ryan-senn/elm-readability/latest/

The reason I created this package is part of a new project of mine. I tend to start to build tools etc. and give them up un-completed or un-polished. I have realised that the best way for me to push through is to have them released online. They basically have to leave my local environment or will be doomed and forgotten.

Part of my SEO strategy at work requires me to use a Word Counter tool. There are plenty of them online that I have used, but I wanted to create my own minimalistic version going forward. A quick prototype attempt turned out successful, so I set out to build this properly. This includes splitting the readability package out of the Word Counter project and open sourcing it.

The [Word Counter tool](https://seoapps.dev/word-counter) is now online and it turned out just like I had hoped. I also took this opportunity to try out Bulma CSS.

The Dale-Chall formula uses a list of 3k common words that are identified as simple. Luckily for me, there was an NPM package that contained the list. One tricky bit is that the list doesn't include plurals, so I needed a script to generate a list including plurals. I was in luck again as there is a NPM package that does just that. All there was left to do is remove any duplicates and write an Elm file.

Another challenge was performance. Scanning the entire text, splitting it into words and search for the 6k simple words was a little heavy. Changing the simple words lookup from a List to a Dict String () helped big times.

The other improvement was adding a debounce. No need to re-calculate everything on every keystroke. I found that a debounce of 200ms was a good compromise for the statistics on the right. Lucky me again, Elm has a nice library for it: jinjor/elm-debounce.

My next goal is to polish a CLI tool that I built to find the google ranking of websites for certain keywords and display backlinks from other top 100 pages. It should work very nicely with Elixir/Phoenix web-sockets and Elm.
Build Accessible forms
Tags: webdev, a11y
Published: 2020-05-05 07:31:58

---
title: Build Accessible forms
published: true
description: Forms on every website or app are most crucial. The reason is simple they bring the business. If you are an e-commerce website then people would be using it to place orders, or do payment. If you are an education website then people would be using it to fill the admission forms. etc.
tags: web development, accessibility, a11y
---

Forms on every website most crucial. The reason is simple they bring the business. If you are an e-commerce website then people would be using it to place orders, or do payment. If you are an education website then people would be using it to fill the admission forms. etc.

A non-accessible form simply means a loss in the business.

Today we are going to learn what makes the forms non-accessible
Common Mistakes:

**1) Using only colors for errors and success**

Many times UX designers decide to use the colors to communicate the state of the submission of the form - success or errors. This is not accessible by screen readers as well as to the folks who have color blindness problem. Always provide a clear and descriptive reason why the form is not getting submitted successfully.

![Using only colors for errors and success](https://dev-to-uploads.s3.amazonaws.com/i/ns6rc3l3or84i1jrledh.png)

**2) No descriptive errors**

As stated above, always provide descriptive and clear error states. I have seen the errors like: "Please correct the errors", "Please enter valid username", .etc. Form author needs to clearly explain what do you mean by 'valid', which error to be corrected, and what to be corrected?

![No descriptive errors](https://dev-to-uploads.s3.amazonaws.com/i/88gn3dec5w1zgxrr1tt9.png)

**3) Missing descriptive helper text**

To have accessible forms it is mandatory to provide the descriptive and clear helper text. This will help the users to understand the expected input and they can enter without any mistake. Eg: if the expected password is 9 characters without any special symbol then do mention is clearly before the user enters the input.


**4) No labels of the form**

Another common mistake folks do with forms is they do not keep labels separate from the input fields. This is in fact very common and I would say the very favorite style of the UX folks to have labeled as placeholders or as Material design system has label overlapping input fields.

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

Both are incorrect, reason, labels are important for the screen readers, folks suffering from cognitive, folks who are new to web and need to understand which field is related to what?

The best practice to always have labels.

__Read more at [a11ytips.dev](https://www.a11ytips.dev/docs/accessibile-forms)__
Make a simple game in python!
Tags: python, beginners, codenewbie
Published: 2020-05-05 07:10:14

Hi devs!
Today I will share some tips to make a simple stone paper scissor game in python. The game will be a Human vs Computer game.

✔️ Import the random module by the following:
```python 
import random 
```
"Why?"
So that computer will generate its own choice.

💡 Place a infinite while loop (You don't have to run program  again and again.)
```python 
while True:
```
✔️ State the rules of the game.
```python 
# Rules of the game   
    print("""Enter your choice : 
    a. Press '1' to select 'Stone'. 
    b. Press '2' to select 'Paper'.
    c. Press '3' to select 'Scissor'.\n""")  
```
✔️ Take the input from the user according to the rules mention above.
```python 
user_choice = int(input("Enter YOUR choice: ")) 
```
✔️ Code the condition when user gives input out of the range.
```python 
while user_choice > 3 or user_choice < 1:
    user_choice = int(input("Enter valid input: ")) 
```
✔️ Assign numbers to the user's choice.
```python 
    if user_choice == 1: 
        choice_name = 'Stone'
    elif user_choice == 2: 
        choice_name = 'Paper'
    else: 
        choice_name = 'Scissor'
```
✔️ Let the computer select its choice and then assign numbers to the computer's choice.
```python
    computer_choice = random.randint(1, 3)  

# Assigning numbers to the computer's choices
    if computer_choice == 1: 
        computer_choicehoice_name = 'Stone'
    elif computer_choice == 2: 
        computer_choicehoice_name = 'Paper'
    else: 
        computer_choicehoice_name = 'Scissor'
```
✔️ Write the main logic of the game.
```python 
    if((user_choice == 1 and computer_choice == 2) or
      (user_choice == 2 and computer_choice ==1 )): 
        print("Paper wins !!! \n", end = "") 
        result = "Paper"
          
    elif((user_choice == 1 and computer_choice == 3) or
        (user_choice == 3 and computer_choice == 1)): 
        print("Stone wins !!! \n", end = "") 
        result = "Stone"
    else: 
        print("Scissor wins !!!\n", end = "") 
        result = "Scissor"
```
✔️ Declare the result.
```python 
    if result == choice_name: 
        print("\nYOU WIN !!!\n") 
    else: 
        print("\nCOMPUTER WINS !!!\n") 
```
✔️ Ask a replay question and also code the condition to break the infinite while loop.
```python
    print("Do you want to play again? (y/n)") 
    ans = input() 
  
    if ans == 'n' or ans == 'N': 
        break
```
### 🎉 That's it! Isn't it easy? Now you have your own game to play! 
You can also refer my GitHub repo:
{% github divyakelaskar/Stone-Paper-Scissor-Game %}
How to Build a Free Portfolio Website with TYPO3?
Published: 2020-05-05 07:06:38

No matter on which path you’re, a web developer, web designer, UX professional, etc you’ll eventually need an eye-catching, client-landing portfolio.

While it’s easy to think of a portfolio as a collection of printed out work samples, an effective online portfolio involves designing your own website where you can host and share dynamic digital content. If you’re hoping to land a new job in tech, it’s also the ideal way to demonstrate your know-how through the site design itself.

1) Choose your TYPO3 Host
2)Install TYPO3
3)TYPO3 Template Options
4)Find best TYPO3 Portfolio Template and Extensions
5)Add an attractive header
6)Add your projects
7)Configure About section
8)Modify your Contact form
9)And your Portfolio website is ready!

Read this complete blog at https://t3terminal.com/blog/how-to-build-a-free-portfolio-website-with-typo3/ to view the complete guide on how to build your TYPO3 portfolio for FREE!
Understanding Kubernetes: part 18 – Network Policies
Tags: kubernetes, devops, docker, beginners
Published: 2020-05-05 06:43:46

---
title: Understanding Kubernetes: part 18 – Network Policies
published: true
description: Serie of sketchnotes about Kubernetes. Explaining in a visual way Kubernetes principles.
tags: Kubernetes, DevOps, Docker, beginners
series: Understanding Kubernetes in sketchnotes
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/q9b4yd8bwjcw5tgyk9vj.jpg
---

Understanding Kubernetes can be difficult or time-consuming. In order to spread knowledges about Cloud technologies I started to create sketchnotes about Kubernetes. I think it could be a good way, more visual, to explain Kubernetes (and others technologies).

We continue the serie of Sketchnotes about Kubernetes, it's time to talk about Network Policies.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/hq32p9t3ya6x5spn7ya1.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/euc3r31t5pknqhmi0u5o.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kxtgtesmb0fxfk619v5k.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/e1ujjs800ktcz4wt5anb.jpg)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/zawpkx1tk9i7f8l80920.jpg)

If you are interested, I published all the sketchnotes on Kubernetes (and new ones!) to make a "book" of 120 pages: ["Understanding Kubernetes in a visual way"](https://gumroad.com/aurelievache#uCxcr).

As usual, if you like theses sketchnotes, you can follow me, and tell me what do you think. I will publish others sketchs shortly :-).
Vanilla JavaScript string startsWith
Tags: javascript
Published: 2020-05-05 06:35:40

So a very nifty function in JavaScript is the `startsWith()` function. We can use this function on a string to see if it starts with a specific substring.

## Using startsWith function in JavaScript

To use the function, we need to have a string then we can call the `string.startsWith('substring')` function and we will get a `boolean` value in return (true/false)

```js
var string = "Your time is limited, so don't waste it living someone else's life";

// Check if it starts with `Your time`
console.log(string.startsWith('Your time'));
// true
```

Important to know is that the `startsWith()` method is case sensitive. So the following would return false:

```js
var string = "Your time is limited, so don't waste it living someone else's life";

// Check if it starts with `your time`
console.log(string.startsWith('your time'));
// false
```

## Using an offset search position on startsWith

We now used the basic `startsWith()` function, but it accepts another parameter; the starting position.
So let's assume our string always starts with "Your time" but we want to see if the string after that is "is limited".
We can do so by offsetting the `position`.

```js
var string = "Your time is limited, so don't waste it living someone else's life";

// Check if it starts with `is limited`
console.log(string.startsWith('is limited', 10));
// true
```

Feel free to play with this Codepen:

<p class="codepen" data-height="265" data-theme-id="dark" data-default-tab="js,result" data-user="rebelchris" data-slug-hash="LYpOaLr" style="height: 265px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Vanilla JavaScript string startsWith">
  <span>See the Pen <a href="https://codepen.io/rebelchris/pen/LYpOaLr">
  Vanilla JavaScript string startsWith</a> by Chris Bongers (<a href="https://codepen.io/rebelchris">@rebelchris</a>)
  on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>

## Browser Support

This function works in all browsers but not in IE 😢.
We can use [this polyfill](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith) to help IE.

### Thank you for reading, and let's connect!

Thank you for reading my blog, feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
The Case for Web Components
Published: 2020-05-05 06:16:51

Web components are a set of features that that provide a standard component model for resources on the Web. These components are reusable and make editing UI controls in HTML much easier. They can be placed anywhere without fear from code collisions. 

Web components are a great resource to use because they integrate with JavaScript framework or any or no framework. These components can be used across all of these frameworks which will save a lot of time. Websites and applications can be built and deployed so much faster than normal because coders would initially have to copy code and made sure everything worked. This was all solved by web components. 

Businesses should consider utilizing web components because they will help make the processes faster. The components can be used in other applications and also reduces the time spent developing new features. If businesses adopt web components their development will have a much easier time developing the applications.

YouTube Video: https://www.youtube.com/watch?v=aji0gdsVKJo
#WebDev on web.dev - Create a "Was this page helpful?" widget #2386
Tags: webdev, javascript, opensource, frontend
Published: 2020-05-05 05:46:34

{% youtube eJUzIWsxNp0 %}

Hey y'all, my name is Michael and I'm one of the engineers who works on Google's [web.dev](https://web.dev/) site.

On May 5th at 1 PM PST I'll be doing some coding of the site live on YouTube and would love for you to join in.

We need to make it possible for web.dev users to give us feedback on whether or not our content is actually helpful. We'll look to implement a Custom Element that will do just that!

[(Join the chat here)](https://youtu.be/eJUzIWsxNp0)
React Charts – Simple, immersive and interactive charts for React
Tags: react, frontend
Published: 2020-05-05 05:40:58

![React Charts](https://reacthacks.com/wp-content/uploads/2020/05/React-Charts.png)
##React Charts Features
*Line, Bar, Bubble, & Area Charts
*Hyper Responsive
*Powered by D3
*Fully Declarative
*Flexible data model
##Installation
> $ yarn add react-charts # or 
> $ npm i react-charts --save

More: [React Charts](https://reacthacks.com/tag/react-charts/)
LIFERAY TRAINING
Tags: liferaytraining, training, onlinetraining, corporatetraining
Published: 2020-05-05 05:30:17

LIFERAY

Liferay licenses clients to change their site page pages and online interfaces. It permits a sound Enterprise Content Management System to Add/Edit/Remove and change content on entries and areas effectively with a decision to make it open or private, making it the best Digital Experience Platform. https://www.gologica.com/course/liferay-training/

What is Liferay in Java? 

Liferay is an open source and free undertaking entryway, which is on a very basic level used to draw in corporate extranet and intranet. It is also portrayed as a web application system or substance the board structure. Written in Java, Liferay offers wide help for augmentations and modules for some programming languages. 

What is the utilization of Liferay Portal? 

Liferay is an open source experience entryway which is free and basically used to empower corporate extranet and intranet. It is an exuberant web application stage written in Java and offers a gigantic social occasion of highlights obliging for the improvement of doors and destinations. 

Features of Liferay 

•Liferay is Portlet improvement which follows the JSR 168 and JSR 286 Compliants. 
•Liferay is extraordinary open hotspot for portlet progression have generally sublime working social event and framework. 
•Portlet improvement takes after servlet progression in any case portlet is tad of dynamic substance in site page. 
•In regular web application when we send demand then server serve the reaction to the customer or program. 
•Coming to portlet headway in one site page there might be different portlets and each portlet have its own deals and reaction. 
•Each portlet can send ask for and get the reaction from server then the reaction has a spot with basically the portlet which send the deals. 
•We can say portlet is tad of dynamic substance in the page. Page is total of different bits of dynamic substance and each earth shattering part is coordinated by one portlet in the site page. 
•In one page we can suit different portlet and each portlet is liable for produce dynamic substance for page. Distinctive portlet together produce the dynamic substance and all the portlet dynamic substance arrangement will be made as one site page.
 
CONCLUSION

Liferay gives a lot of versatility and control to change the general customer experience of your passage or site. The availability of different ways to deal with supervise, use, and show CMS content and portlets gives limitless possibilities to headway using Liferay Portal.