teleren/devto huggingface dataset:
How to Build Java Applications Today #63
Tags: java, bpf
Published: 2022-05-04 21:07:10

## TL;DR

Spring Boot's zero-day exploit gets worse, New Relic's "State of Java" report, React and React Native surge in job ad mentions, and my InfoQ article series on native Java started to show.

***

## README

Welcome to my newsletter “How To Build Java Applications Today”! If you like it, then [subscribe to it on Substack](https://bpfnl.substack.com)! Or read it on [dev.to](https://dev.to/ksilz/series/11995) or [Medium](https://ksilz.medium.com). Even better: Share it with people who may be interested.

***

## Next Issue: Wednesday, June 1, 2022

My newsletter is published on the first Wednesday of every month.

***

## Stand-Up
My InfoQ article series on native Java started to show, I talked at JAX in Germany and will talk at QCon Plus & Devoxx UK.

**[Read Stand-Up](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-05/stand-up)**

***

## Technology Index 

Popularity trends: React and React Native surge in job ad mentions while Kotlin lost 22$ of its mentions over the last two months, Flutter lost 15%, and Postgres lost 10%. Also, see my recommendations for a JVM language, a database, a back-end framework, a web framework, and a mobile app framework.

**[Read the Technology Index](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-05/the-index)**

***

## Release Radar

Git, Quarkus, and IntelliJ had major releases in April 2022. OpenJDK 18/17/11/8, Spring Boot, Micronaut, and the Java support in VS Code had minor ones.

**[Read the Release Radar](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-05/release-radar)**

***

## New & Noteworthy

Spring Boot's zero-day exploit gets worse, New Relic's "State of Java" report,  native Java makes Java in the cloud cheaper, and Eclipse IDE moving to web & cloud.

**[Read New & Noteworthy](https://betterprojectsfaster.com/guide/java-full-stack-report-2022-05/new-noteworthy)**

***

## About

Karsten Silz is the author of this newsletter. He is a full-stack web & mobile developer with 23 years of Java experience, author, speaker, and marathon runner. Karsten got a Master's degree in Computer Science at the Dresden University of Technology (Germany) in 1996.

Karsten has worked in Europe and the US. He co-founded a software start-up in the US in 2004. Karsten led product development for 13 years and left after the company was sold successfully. He co-founded the UK SaaS start-up "[Your Home in Good Hands](https://yourhomeingoodhands.co.uk/)" as CTO in 2020. Since 2019, Karsten also works as a contractor in the UK.

Karsten has [this newsletter](https://bpfnl.substack.com/), a [developer website](https://betterprojectsfaster.com/), and a [contractor site](https://ksilz.com/). He's on [LinkedIn](https://www.linkedin.com/in/ksilz/), [Twitter](https://twitter.com/karsilz), [Xing](https://www.xing.com/profile/Karsten_Silz/), and [GitHub](https://github.com/ksilz). Karsten is also an [author at InfoQ](https://www.infoq.com/profile/Karsten-Silz).
How to watch Star Wars in your terminal
Tags: starwars, terminal, telnet
Published: 2022-05-04 20:56:17

Every year for the 4th of May there is a surprise for us. 🙂
If you are a Star Wars fan, May is always an interesting month.

<video autoplay>
<source src="https://cdnvideo.dolimg.com/cdn_assets/f44373fd69886e1bdc3c86c3f6ce3b11402c5335.mp4" type="video/mp4">
</video>

Do you want to watch the Episode IV in an alternative way?
You can watch the film directly from your favorite terminal.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a5m3mlj5pyupvvmfvk78.gif)

In my case I am using Windows Terminal, but it works in every terminals.
You just need telnet installed on your machine.

## Install Telnet on Windows 11
Telnet is not installed by default on Windows 11 (in Windows 10, as well) but you can install it very easily from the Command Prompt.
Open a terminal and launch the command below:
```
dism /online /Enable-Feature /FeatureName:TelnetClient
```
Close all the terminal windows.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijexb202x1xw17yo6z1u.gif)

## Watch the movie
As I mentioned before I use Windows Terminal as default terminal during my daily activities.
To watch the movie, open Windows Terminal and launch the command below:
```
telnet towel.blinkenlights.nl
```
Enjoy the movie!!! 😀

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z4i6ywjgh50unf2ygrhz.gif)
How to Configure GitHub Environments with Terraform?
Tags: technology, github, devops, terraform
Published: 2022-07-17 14:07:16

---
title: How to Configure GitHub Environments with Terraform?
published: true
date: 2022-05-04 20:49:10 UTC
tags: technology,github,devops,terraform
canonical_url: https://faun.pub/how-to-configure-github-environments-with-terraform-d2b76766547b
---

[![](https://cdn-images-1.medium.com/max/902/1*AQ3-knCHXNJYTqsijexnIw.png)](https://faun.pub/how-to-configure-github-environments-with-terraform-d2b76766547b?source=rss-6e21f0d290d1------2)

Did you know that GitHub Actions supports the definition of environments?

[Continue reading on FAUN Publication »](https://faun.pub/how-to-configure-github-environments-with-terraform-d2b76766547b?source=rss-6e21f0d290d1------2)
Designing a sentiment analysis application for TripAdvisor reviews in Python
Tags: python, tutorial
Published: 2022-05-04 20:17:04

Sentiment analysis allows us to quantify subjectivity and polarity of text - of a review, comment and alike.

Subjectivity scores a phrase between fact and opinion while polarity scores negative to positive context.

In this article I'll show you how to use it to score TripAdvisor reviews highlighting real business value it can bring.

To do such analysis on English (and French, German with plugins) text we can use textblob package. It's as simple as:

```
from textblob import TextBlob

TextBlob("This is very good!").sentiment
TextBlob("This is very bad!").sentiment
TextBlob("This isn't that bad!").sentiment
```

TextBlob "sentiment" property returns a tuple containing polarity and subjectivity. Polarity is a number from [-1.0, 1.0] range where 1 is positive, -1 is negative. subjectivity is a number from [0.0, 1.0] where 0 is fact and 1 is opinion.

`>>> TextBlob("This is very good!").sentiment
Sentiment(polarity=1.0, subjectivity=0.7800000000000001)`

Polarity 1 so it was rated as very positive and with high subjectivity it was treated as a more of an opinion than a fact.

`>>> TextBlob("This is very bad!").sentiment
Sentiment(polarity=-1.0, subjectivity=0.8666666666666667)`

In this case we got -1 so very bad indeed.

`>>> TextBlob("This isn't that bad!").sentiment
Sentiment(polarity=-0.8749999999999998, subjectivity=0.6666666666666666)`

With no context TextBlob still rated it negatively. What actually "isn't that bad" means? Better than expected? Worse than expected? Hard to tell and to get a more useful quantification we need sentences with enough context.


## Tripadvisor reviews

A review is a good piece of text to try out TextBlob on. Beforehand I've fetched a set of reviews for few venues on TripAdvisor using third party scrappers. This gave me a list of reviews text I could feed into the library and see what results I get. To visualize polarity I assigned red/green colors to -1/1 and intensity for in-between values:


![Example result](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/skvm2oezo3nyk5jqtfke.png)


![Interesting finds among hotel reviews](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lw3q3l3v0dw6e3tcuu5j.png)

The first marked review is negative and the user left a 1-star review. The last one is also 1-star but the polarity is big higher. Even though a customer wasn't happy he used less negative language in his review. What's interesting is the middle market review. It's a 5-star review yet it has a low polarity - customer was happy, but found things about which he wasn't - such things could be a value feedback for the venue while it could be lost among positive reviews (with 4,5 average you look closely on the negative ones while positive review may get lost among other positive ones).


**The code is on Github**:

 https://github.com/riklaunim/sentiment-analysis-example


**Full article with code commentary**:

https://rk.edu.pl/en/designing-sentiment-analysis-application-tripadvisor-reviews-python/
Add Your Git Commits to Your Website
Tags: github, git, portfolio, showdev
Published: 2022-05-04 20:00:05

Have you wanted to share your git commit chart on your personal website? It's a lot easier than you think!!

Thanks to people such as [Jason Long](https://github.com/jasonlong/isometric-contributions) and people on StackOverflow, there are countless of answers! Jason uses [obelisk.js](https://github.com/nosir/obelisk.js), which is a a JavaScript library for building isometric pixel objects. You can create bricks, cube, pyramids, etc. within the HTML5 canvas. 

![codesnap code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3c5yc0kedne0f0cfmc5b.png)

This graph also links to [Git Skyline](https://skyline.github.com/)

![2d git commit graph](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2i7v8s7w9t8wzyvbthz3.png)

Here, [yoshi389111](https://github.com/yoshi389111/github-profile-3d-contrib) creates and updates a very detailed graph of git commits and uses GitHub actions. You're able to see a beautiful chart of your most used languages, the number of forks, etc. So much detail and you also get a various of style to choose from!

![3d commit graph](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7qxpxednsatpl6drpncw.png)

This is how the graphs will appear in your repository once you have run the git action.

![Github repo file structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1o1dk624eg1kekc2729.png)

There's a basic green version with a white background, two season versions for Northern Hemisphere and Southern Hemisphere, a night view version, a night green version with a black background, a night rainbow version, and a git black version. Let me know which one is your favorite!

green version
![green version](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/at07o6038bu2elhh30e5.png)

Northern hemisphere version
![northern](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pusqfr7ppvrnim6j67u4.png)
 
Southern hemisphere version
![southern](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0y351n270gbl0i0f4q6.png)
 
night view version
![night view](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bbupcuiccklwdrisprye.png)
 
night green version
![night green](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dor6c7jxlbp1jsyx49b3.png) 

night rainbow version
![night rainbow](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ns8tv0d1dfyhdn4vr294.png)
 
git block version
![potential 3d option](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/82ls9qqk0kchsoet60i1.png)

Happy coding!
What cloud computing tools/technology skills should a front end developer have?
Tags: aws, azure, cloud
Published: 2022-05-04 19:59:29

---
title: What cloud computing tools/technology skills should a front end developer have?
published: true
description: As a front-end developer what tools and technology should he/she have to be successful in cloud technology
tags: aws, azure, cloud
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f5fw3k36zvs0ddhopy3k.png
---
Share the ️Love ️— What's your favorite #beginners post on DEV?
Tags: discuss, bestofdev, beginners
Published: 2022-05-04 19:56:02

A few weeks back I wrote up a post called [What's your favorite post on DEV? (by someone else!)](https://dev.to/michaeltharrington/whats-your-favorite-post-on-dev-by-someone-else-3f2g) and you all chimed into the conversation dropping so many links to excellent posts, plus some really kind words for the authors that created those posts.

{% embed https://dev.to/michaeltharrington/whats-your-favorite-post-on-dev-by-someone-else-3f2g %}

So, I thought we might as well try this again. 😀

This time, I'm curious to know...

**What's your favorite post shared under [#beginners](https://dev.to/t/beginners)?**

{% embed https://dev.to/t/beginners %}

Note: you can embed a post into a comment by writing:

`{% embed dev.to/username/name-of-post %}`

Please consider giving the author an @mention when ya share their work. It's probably gonna make them feel good and I think we can all appreciate that. 🙌 

So, go find whatever #beginners post you'd like to highlight and share the love! ❤️
Streaming live video feed on a website with a MJPEG server
Tags: python, webdev, tutorial
Published: 2022-05-04 19:50:56


Generic IP cameras often offer a simple MJPEG streaming that allows embedding a live view from the camera on a website. However when that's not available or you want to stream something different (desktop view, machine vision camera or some pre-recorded video clip) then you need your own MJPEG server.

{% embed https://www.youtube.com/watch?v=R9H7Tp2HLWo %}

There is a lot of example on the web, and by now MJPEG is not the best choice in terms of bandwidth/quality but it's simple...

So let's take a look at a simple server from Github: https://github.com/bootrino/maryjane

This simple server will stream contents of a JPEG file. To make it a video we have to use some other app to constantly update said file. This can be done with ffmpeg to stream a video clip or your desktop. Or some other source, like a machine vision camera and it SDK allowing capturing and saving frames.

**Examples and more info on my blog:**

> **https://rk.edu.pl/en/streaming-live-video-feed-on-a-website-with-a-mjpeg-server/**
100 Days of Code: Day 2
Published: 2022-05-04 19:30:20

On day 2 I wrote a program to calculate how many days, weeks and months someone would have left based on their age in years and assuming they lived to 90.

I started with a variable called age that prompts the user for their age.

Then I created 3 additional variables: age_in_days, age_in_weeks and age_in_months.

Each variable holds either the number 365 (days), 52 (weeks) or 12 (months). They then get multiplied by the age the user input as their current age. 

Afterwards, I created another 3 variables that hold the following calculations:

remaining_days = 365 * 90 - age_in_days
remaining_weeks =  52 * 90 - age_in_weeks
remaining_months = 12 * 90 - age_in_months

Finally I used the following print function:

print(f"You have {remaining_days} days, {remaining_weeks} weeks, and {remaining_months} months left.")

Below is an example of what happens when this code runs:

**What is your current age?** 25
**You have 23725 days, 3380 weeks, and 780 months left.**
Using local mail as notification tool
Tags: mail, linux, terminal, notification
Published: 2022-05-04 18:50:55

# Using local mail as notification tool

Post created at 2022-05-04 14:25

I used to run commands and develop into linux terminal, and have some scheduled tasks running in the background.

I need to be notified on terminal about some finished processes in a generic form, without depending GUI notifications.

By default, every cron job thats writes to console is sent to user local email. So, local email will be my notification messages repository.

## Setup

I used this setup in Ubuntu, but it must works in any distro.

1. Adding current user to __mail__ group

```bash
$ sudo adduser $USER mail
Adding user 'guionardo' to group 'mail' ...
Adding user guionardo to group mail
Done.
```

2. Install mailtools, postfix, and mutt

```bash
$ sudo apt install mailtools postfix mutt
```

3. Send test mail

```bash
$ echo "This is a test" | mail "--subject=Test email" $USER@localhost
```

4. Test new mail

```bash
$ mail
"/var/mail/guionardo": 1 message 1 new
>N 1 Guionardo Furlan qua mai 4 17:41 14/464 Test email
? q
Held 1 message in /var/mail/guionardo
```

Ok, we have an e-mail into our inbox. Lets read with better tool.

```bash
$ mutt
```

```bash
q:Quit d:Del u:Undel s:Save m:Mail r:Reply g:Group ?:Help
 1 O F mai 04 To guionardo@lo ( 2) Test email



---Mutt: /var/mail/guionardo [Msgs:1 Old:1 0,6K]---(threads/date)----(all)---
```

```bash
i:Exit -:PrevPg <Space>:NextPg v:View Attachm. d:Del r:Reply j:Next ?:He
Date: Wed, 4 May 2022 17:41:20 +0000 (UTC)
From: Guionardo Furlan <guionardo@furlan-server>
To: guionardo@localhost
Subject: Test email
X-Mailer: mail (GNU Mailutils 3.7)

This is a test


-O F- 1/1: Guionardo Furlan Test email -- (all)
```

5. Setup for notifications

Add this content to your ~/.profile or equivalent file (.bashrc, .zshrc, etc):

```bash
MAIL_CHECK_TIME=0
mail_prompt() {
 local pwd='~'
 local MAIL_SECONDS_DIFF=$MAILCHECK

 local MAIL_ELAPSED_SECONDS=$((SECONDS - MAIL_CHECK_TIME))

 [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME//~/}

 printf "033]0;%s@%s:%s033\%s" "${USER}" "${HOSTNAME%%.*}" "${pwd}"

 if [[ "$MAIL_CHECK_TIME" -eq "0" || "$MAIL_ELAPSED_SECONDS" -gt "$MAIL_SECONDS_DIFF" ]]; then
 local MAILX="$(mailx 2>/dev/null &)"
 UNREADEN_REGEX="s([0-9]{1,4})sn"
 [[ $MAILX =~ $UNREADEN_REGEX ]] && UNREADEN=$(echo "${BASH_REMATCH[1]}") || UNREADEN=0
 local COUNT=$((UNREADEN))
 local MESSAGE_TEXT="message"
 if [ "$COUNT" -gt "0" ]; then
 if [ "$COUNT" -gt "1" ]; then
 MESSAGE_TEXT="messages"
 fi
 echo "$COUNT unreaden $MESSAGE_TEXT. Run mutt"
 fi
 MAIL_CHECK_TIME=$SECONDS
 fi

}

if [[ $(which mailx) ]]; then
 PROMPT_COMMAND="mail_prompt"
fi
```

6. Close and reopen your terminal to load this configuration
7. Now, when you access the terminal, messages not readden will show a prompt:

```bash
1 unreaden message. Run mutt
```

In your custom scripts, you can send email to your local user and get notified.
Guide to migrating a React app to the new Google sign-in library
Tags: tutorial, react, typescript, oauth
Published: 2022-05-04 18:45:55

Hello! Google announced that as of [April 30, 2022](https://developers.googleblog.com/2022/03/gis-jsweb-authz-migration.html) new applications cannot use their old Javascript sign-in library and must use their new [Google Identity Services](https://developers.google.com/identity) instead (existing apps have until March 23, 2023 to migrate). 

I had a hard time finding React resources when migrating our React app to the new library, so I wrote a blog about it in case anyone finds it helpful: https://www.dolthub.com/blog/2022-05-04-google-signin-migration/
Code Anatomy - Writing high performance Python code
Tags: python, beginners, programming, performance
Published: 2022-05-04 18:28:54

Writing short and efficient Python code is not always easy or straightforward. However, it's often that we see a piece of code and we don't realize the thought process behind the way it was written. We will be taking a look at the [difference](https://www.30secondsofcode.org/python/s/difference) snippet, which returns the difference between two iterables, in order to understand its structure.

Based on the description of the snippet's functionality, we can naively write it like this:

```py
def difference(a, b):
  return [item for item in a if item not in b]
```

This implementation may work well enough, but doesn't account for duplicates in `b`. This makes the code take more time than necessary in cases with many duplicates in the second list. To solve this issue, we can make use of the `set()` method, which will only keep the unique values in the list:

```py
def difference(a, b):
  return [item for item in a if item not in set(b)]
```

This version, while it seems like an improvement, may actually be slower than the previous one. If you look closely, you will see that `set()` is called for every `item` in `a` causing the result of `set(b)` to be evaluated every time. Here's an example where we wrap `set()` with another method to better showcase the problem:

```py
def difference(a, b):
  return [item for item in a if item not in make_set(b)]

def make_set(itr):
  print('Making set...')
  return set(itr)

print(difference([1, 2, 3], [1, 2, 4]))
# Making set...
# Making set...
# Making set...
# [3]
```

The solution to this issue is to call `set()` once before the list comprehension and store the result to speed up the process:

```py
def difference(a, b):
  _b = set(b)
  return [item for item in a if item not in _b]
```

Another option worth mentioning in terms of performance is the use of a list comprehension versus `filter()` and `list()`. Implementing the same code using the latter option would result in something like this:

```py
def difference(a, b):
  _b = set(b)
  return list(filter(lambda item: item not in _b, a))
```

Using `timeit` to analyze the performance of the last two code examples, it's pretty clear that using list comprehension can be up to ten times faster than the alternative. This is due to it being a native language feature that works very similar to a simple `for` loop without the overhead of the extra function calls. This explains why we prefer it, apart from readability.

This pretty much applies to most mathematical list operation snippets, such as [difference](https://www.30secondsofcode.org/python/s/difference), [symmetric_difference](https://www.30secondsofcode.org/python/s/symmetric-difference) and [intersection](https://www.30secondsofcode.org/python/s/intersection).

---

_Do you like short, high-quality code snippets and articles? So do we! Visit [30 seconds of code](https://www.30secondsofcode.org/) for more articles like this one or follow us on [Twitter](https://twitter.com/30secondsofcode) for daily JavaScript, React and Python snippets!_ 👨‍💻
Short-circuiting
Tags: solidity, gasoptimization, bestpractice
Published: 2022-05-04 18:25:50

---series: Gas Optimization techniques---

The basic intention behind using Short-circuiting in any coding language is to reduce the number of computations done during comparison operations. And in solidity, reduced computations means reduced gas.

Consider the following contracts:

```solidity
contract shortCircuit1 {
    bool flag;

    function conditions(int x) external {
        bool isEven = x % 2 == 0;  // computation 1
        bool isNotZero = x != 0;   // computation 2

        if (isEven && isNotZero) { // computation 3
            flag = true;
        } else {
            flag = false;
        }
    }
}


contract shortCircuit2 {
    bool flag;

    function conditions(int x) external {

        if (x % 2 == 0 && x != 0) { // 3 computations only if x % 2 == 0 is true, else only 1 computation
            flag = true;
        } else {
            flag = false;
        }
    }
}
```

Both the contracts follow same conditions, input to function should be even and greater than 0. If the conditions are true, then the state variable `flag` is set to true. And if previous function call made `flag` true and the next call do not satisfy both conditions then `flag` is set to false.
Now let's just focus on the conditions written inside the functions.


**shortCircuit1**
_function input - 0_
computes both the conditions and then performs 3rd computation to checks if both conditions are true.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7794il8grke8q0pg5jnz.PNG)

**shortCircuit2**
_function input - 0_
computes second condition only if first condition is true _(short-circuit)_. Hence saving the cost of computation.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g4mi14b1mqpejjwfw3pw.PNG)

Note:- The difference in gas is very less for the examples given above. Imagine a lengthy comparison computation (say a string or array), in such cases the gas difference will be significant.