teleren/devto huggingface dataset:
UI Testing with Espresso in Android Studio
Published: 2020-03-19 10:27:37

User interface (UI) testing lets you ensure that your app meets its functional requirements and achieves a high standard of quality such that it is more likely to be successfully adopted by users. 

The Espresso testing framework, provided by AndroidX Test, provides APIs for writing UI tests to simulate user interactions within a single target app. Espresso tests can run on devices running Android 2.3.3 (API level 10) and higher, also The Espresso testing framework is an instrumentation-based API and works with the AndroidJUnitRunner test runner.
UI testing using Espresso Test Recorder is very good because it will take the pain of writing the test manually.
 
###*BENEFITS OF ESPRESSO*###

1) Saves time writing UI test

2) it's not error-prone 

3) it automates the test

4) it's maintained by the Android team

5) it's not tedious

6) it's easy to use

7) write concise, beautiful, and reliable Android UI tests

###API components###

The main components of the Espresso include the following:

##Espresso##
Entry point to interactions with views (via onView() and onData()). It also exposes APIs that are not necessarily tied to any view, such as pressBack().

##ViewMatchers##
 A collection of objects that implement the Matcher<? super View> interface. You can pass one or more of these to the onView() method to locate a view within the current view hierarchy.

##ViewActions##
 A collection of ViewAction objects that can be passed to the ViewInteraction.perform() method, such as click().

##ViewAssertions##
  A collection of ViewAssertion objects that can be passed the ViewInteraction.check() method. Most of the time, you will use the matches assertion, which uses a View matcher to assert the state of the currently selected view.






NOTE: An assertion: is the core of your test. It's a code statement that checks that your code or app behaved as expected. 

###HOW IT WORKS###

Set up Espresso

```
dependencies {
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}

```
In the video, I explained how to write a simple UI test using an espresso test recorder in an Android studio.

Video: https://youtu.be/22MZXJFMq98

For more info: https://developer.android.com/training/testing/espresso 
and https://developer.android.com/training/testing/espresso/basics
How On-demand Apps Can Be a Great Solution During The Coronavirus Outbreak?
Tags: android, ios, opensource, ondemandapp
Published: 2020-03-19 10:25:49

The world is practically reeling under the lethal Coronavirus that has already claimed more than a thousand lives besides making several thousand falls sick. More than the death and health hazard, the scare it caused to the people around the world and the helplessness it caused to the medical experts and public healthcare systems, are more impactful than the diseases themselves. Apart from quarantining people in secluded facilities and taking disinfecting measures across public places, the healthcare establishments couldn’t do much to stop the spreading of the disease.

Naturally, in many severely affected countries as well as the ones having a moderate outbreak of the epidemic, the people are being advised to avoid public gathering and regular whereabouts outside of their home. For many people, now working from home no longer remains a lifestyle attribute common to some fortunate IT workers. It has now become a reality for many white-collar jobholders. People are forced to work from home whether they like it or not, whether they are used to it or not.

In such a situation when people cannot step out of the door for buying groceries or medicines or other essentials, on-demand app solutions can play a very essential role. Already in many countries around the world where even the outbreak had a moderate impact as of now, people stopped visiting markets and restaurants. Well, it seems on-demands apps with their smooth delivery system can fulfill people’s needs at such trying times.

Basically 3 types of on-demand apps will experience the highest demand. These are respectively, on-demand grocery apps, on-demand laundry apps, and on-demand food delivery apps. Since people are now locked in their homes and they no longer can go to local shops, malls, laundries, and restaurants, these apps can allow them to fulfill their needs.

But since every human contact is now being viewed with extra caution and there is a persistent fear factor associated with the delivery people coming into contact with the subscribers, on-demand apps and the businesses have to take these factors seriously and address them accordingly. If you want to [hire mobile app developer](https://www.cmarix.com/mobile-application-development-services-india.html?utm_source=Dev2.0) for building on-demand apps in the time of the flu epidemic, consider the following things listed below.

**Couriers Without Body Contact**

![Couriers](https://www.cmarix.com/wp-content/uploads/2020/03/drone-delievery-1-768x576.jpg)

During any virus outbreak, coming into direct body contact seems to be the biggest risk factor. [Continue Reading](https://www.cmarix.com/how-on-demand-apps-can-be-a-great-solution-during-the-coronavirus-outbreak/?utm_source=Dev2.0)

Originally Published on www.CMARIX.com on 17th March 2020.
Atom editor with linter, prettier and all the stuff you need
Tags: javascript, atom, linter, prettier
Published: 2020-03-19 10:23:54

# Finally, my working atom editor setup for javascript
Recently, I setup my atom editor because of a React javascript project. What I knew from work (my fellow teammembers use VSCode there) is there are some nice tools like linter and prettier to keep your code clean, error free and readable. Some of those things remind me of the typical IntelliJ IDEA tools (e.g. Firebug, Checkstyle and so on).
However I didn't find a good instruction or tutorial to make all the stuff work. So I tried a bit around and here is what I got for all those who have the same trouble I had:

# Prerequisites
This tutorial is optimized for unix- based clients which have a bash or similar. However, you can use this setup on other machines as well but I did not test it for them.
- Download atom from https://atom.io/

# Required atom packages
- Install required atom packages with 
```bash
apm install linter \ 
linter-eslint \
linter-ui-default \
busy-signal \
intentions \
prettier-atom \
```

# Atom settings
- Open the editor and the settings by pressing `CTRL + Comma`
- Go to packages and filter for **prettier-atom** and click **settings**
- Enable the options **ESlint integration** and **Format files on save**

# Test your setup
To test the setup, I created a new react-app by executing `npx create-react-app test-app` and imported it into atom editor.
When saving an edited file with obvious errors (unused import, newlines, single vs double quotes), I can see the editor shows me linter warnings and autoformats things on save:

![linter and autoformat](https://dev-to-uploads.s3.amazonaws.com/i/byj5eppn61pof5yw1z0y.gif)

The create-react-app setup inherits a default eslint config from the react packages. If you wish to override these with your own settings, you can create a `.eslintrc` file in your project root.
Check SSH connections
Tags: linux, productivity, bash
Published: 2020-03-19 10:21:20


The other day, I needed to check if all servers I supervised were available to SSH. I added every droplet from Digital Ocean to my config file at `~/.ssh/config`.

But then manually checking every entry was pretty long and boring. Anyway, doing it manually was not a solution as I want the capability to quickly check my access-state to the servers. So here comes a terminal approach to automate the process.

First create a bash script `test-ssh.sh` and `chmod +x test-ssh.sh`

```bash
#!/bin/bash

HOST=$1
echo "> $HOST..."

ssh -q -o BatchMode=yes  -o StrictHostKeyChecking=no $HOST 'exit 0'
RCODE=$?
if [ $RCODE -ne 0 ]; then
        echo "  [!] Unable to ssh on: $HOST"
else
        echo "OK"
fi
```

This script takes in argument the Hostname and checks if it is possible to connect. With the ssh line, I use the _quiet mode_ (-q) to keep it short, and the _Bash Mode_ which tells SSH to never ask for a passphrase or password. The _StrictHostKeyChecking_ is used to bypass the fingerprint verification process.

Then, to loop through the config file, I use this bash line:

```bash
cat ~/.ssh/config | grep "Host " | awk '{print $2}' | xargs -I _ ./test-ssh.sh _
```

`awk` retrieves the Hostname from the grep output and then passes it to `xargs` which injects it to the bash script through the `-I` flag. `-I` specify a character ('_' in our case) to indicate where to inject the input.  

The output is the following:

```bash
> service-notifications-corona...
OK
> olympe-12-was8...
  [!] Unable to ssh on: olympe-12-was8
> microservice-api-27...
OK
```

Making sure I can connect to those servers improves my time-to-react in case of problems.

Post from [my blog](https://blog.lepape.me/check-ssh-connections).
Do you want a robot to avoid brain fatigue?
Tags: php, laravel, productivity
Published: 2020-03-19 10:13:21

Hi, I’m Valerio, software engineer from Italy and CTO at Inspector.

This post is a part of the series [*Pieces from inside Inspector*] and today I would talk about a little bias in developers mind: Automation.

Often we are so focused to build something automated for our customers forgetting that we could do the same with our work.

As developer, only you can understand me!

When I work on a piece of code, the most exhausting part is to keep the whole execution flow in mind before and after the code block I’m working on to evaluate the impact of the current changes.

Is it the same for you?

This is one of the reasons why software development is very hard work for our brain and it can make us stop sleeping for weeks.

Do you also ask yourself:

- How will the code perform if the traffic increases?
- Can I clearly see the moment I need more resources to avoid system crashes?
- Am I forgetting something critical?

Working day and night, giving up sleep and taking precious time away from your family is perhaps not the best solution for the long term.

Do you know that Inspector automatically creates a real-time diagnosis of your process's execution flow?

You can identify unexpected behaviors at a glance.

![](https://miro.medium.com/max/1762/1*OKqzS35-GxU3wGJFa3gAGw.png)

Every time you change something or adding new statements in a process to deliver an http request or a background job, you can visually understand its impact in real-time.

Inspector customers are using our dashboard to deliver smaller release but more often without fear. This strategy help them to avoid unnecessary risks monitoring the impact of any change in the code.

# Conclusion

You can finally delegate real-time application analysis to an autonomous tool that does this job for you.

You will never have to do it again by hand.

Thank you so much for reading it, if you want know more about Inspector come on our website [https://www.inspector.dev](https://www.inspector.dev). Don't hesitate to share your thoughts on the comment below or drop in live chat! Let's make it together.

Homepage: [https://www.inspector.dev](https://www.inspector.dev)
Facebook: (https://www.facebook.com/inspector.realtime/)[https://www.facebook.com/inspector.realtime/]
Twitter: [@inspector_rt](https://twitter.com/Inspector_rt)
Contact me: [https://www.inspector.dev](valerio@inspector.dev)
Are early-stage startups "dead-by-default" when Coronavirus is causing significant harm to the world’s economy?
Tags: discuss, startup, tech, productivity
Published: 2020-03-19 10:10:36

---
title: Are early-stage startups "dead-by-default" when Coronavirus is causing significant harm to the world’s economy?
canonical_url: https://www.indiehackers.com/post/are-early-stage-startups-dead-by-default-when-coronavirus-is-causing-significant-harm-to-the-world-s-economy-f72c2a6e54
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/fxcf8c359yw5l5aksj0n.jpg
published: true
description: Today the Coronavirus outbreak has plunged the world's economy into a global recession, which will cause a period of a global economic slowdown.
tags: discuss, startup, tech, productivity
---

Today the Coronavirus outbreak has plunged the world's economy into a global recession, which will cause a period of a global economic slowdown.

Regarding tech startups, the truth is that 90% of startups fail—all the time.

In fact, startups are ventures in search of a business model. Frankly, they don't have revenue in any economy.

However, now the time might be more limited for these tech startups to reach that point of profitability. In other words, it's never been so important to be lean for early-stage startups and turn the profitability switch to remain in business.

In this case, even if a recession does occur, it will not stop many startups on the road to being a unicorn later. The world economy 2020 is bad, meaning costs are lower, and probably, there would be less competition.

**What do you think, which kind of startups could survive or even thrive through this crisis?**
Tape-selecta Online Radio Station 
Tags: icecast, radiostation, streaming
Published: 2020-03-19 10:04:06

---
title: Tape-selecta Online Radio Station 
published: true
description: Have you ever wanted to host you own radio station from home?
tags: Icecast,radio-station,streaming
---
--- 

## What is Tape-selecta?
[Tape-selecta](https://github.com/rafapaezbas/tape-selecta) is a dockerized [Icecast2](https://icecast.org/) server together with [Ezstream](https://icecast.org/ezstream/) and [Node.js](https://nodejs.org/en/) that makes the perfect way to set up your own **online radio station** following just a few simple steps.

## How does it work?
The setup is very simple:
1. Install [Docker](https://www.docker.com/).
2. Copy your **mp3** files into the _music_ directory.
3. Run _start.sh_.
4. Check **localhost:8000/mountpoint**, your music should be streaming there!

## The selector.sh
The selector.sh is the script that chooses what is the next file to be streamed. By default, the script just randomly picks the next file to be played. Have a look at the code: 

``` bash
#pick a random mp3 file under /home/music
song=$(find /home/music -name *.mp3 | shuf -n 1);
#write mp3 tag information to status.json
mp3info -p '{"title": "%t","artist": "%a" ,"category": "'${genre}'"}' "$song" > /home/info.json
#echo the info
echo $song;

```

## Configuration
Before running your online radio station, it is important to make some security changes to the configuration of the [Icecast2](https://icecast.org/) server. Change the content of the file **icecast-config/icecast.xml**:

``` xml
<authentication>
    <!-- Sources log in with username 'source' -->
    <source-password>password</source-password>
    <!-- Relays log in with username 'relay' -->
    <relay-password>password</relay-password>

    <!-- Admin logs in with the username given below -->
    <admin-user>admin</admin-user>
    <admin-password>password</admin-password>
  </authentication>
```

After this change the content of the **ezstream-config/ezstream_mp3.xml** file to match the password choosen for the Icecast2 admin user.

``` xml
<sourcepassword>password</sourcepassword>
```

There are some other configuration options in both xml files please check the [Icecast documentation page](https://www.icecast.org/docs/) and [Ezstream documentation page](https://icecast.org/ezstream/) to know more on the subject.

## Front end
The code of the project includes an [Express](https://expressjs.com/)/[Node.js](https://nodejs.org/en/) server, ready to the static files included in the **web/public** directory.
Futhermore, it is possible to retrieve the information of the current track playing in the endpoint **localhost/status**, the information can be useful in case we want to show information of the track provided by the mp3 tags of the file.

## Next steps
If you setup your own radio station, please let me know! It would be great to have a community of self hosted stations and get to know your ideas for it.
What do you use for a website quickie?
Tags: discuss, webdev, javascript, react
Published: 2020-03-19 09:39:33

- Do you use a CLI, such as Vue CLI, create-react-app?
- Do you use `document.querySelectorAll` or related methods?
- Do you use a CSS framework, such as Bootstrap, Bulma, Foundation, Tailwind, or some others?
- What JavaScript framework will you use if you need one?

Related would be if multiple pages, what will you use?

- A JavaScript framework?
- A template engine (especially on server-side)?
- A Static Site Generator?
- Some server side scripting for templating engine, such as PHP, rather than API calls?
- None at all? 

Also, I have qualms about [GatsbyJS \<Link/>](https://dev.to/patarapolw/is-there-a-meaning-to-link-in-gatsby-js-and-is-there-something-analogous-for-other-ssg-2g96).
🤨Review 7: Coding With Basir, Developer: Basir | #elefDoesCode
Tags: career, review, developer, video
Published: 2020-03-19 09:10:46

⬇️I will review your... 

🤓The process:
1. Every week I will do a live stream on my youtube channel reviewing your site
2. I will give feedback and suggestions according to your needs. 
3. If I have a way to contact you, I'll gladly do so :)
4. If you have any question don't hesitate to contact me!

Take part [here](https://forms.gle/9AxiCUQ8YudTVYzs9) (I only need a URL and your name).

It doesn't matter if you are a beginner or more advanced. 
You can submit as many sites as you want.

🙏Thank you for taking part with your website into my live streams.
It takes courage to let someone you don't know to review your work...
But remember feedback is important and all of us need it...
 
🤗The review is FREE. You don't pay for anything. I won't be paid by anyone.

----------------------------
P.S. I am really sorry for the bad echo-sound

In particular, in this video you'll find:

🤓The developer: Basir | @BasirJD
💪The project: https://codingwithbasir.com

⌨Previously 
- [review 1](https://dev.to/eleftheriabatsou/review-1-tribute-page-by-freecodecamp-developer-kyle-elefdoescode-4006)
- [review 2](https://dev.to/eleftheriabatsou/review-2-personal-portfolio-developer-diego-elefdoescode-4g36)
- [review 3](https://dev.to/eleftheriabatsou/review-3-portfolio-and-airshare-project-developer-rajitha-elefdoescode-3gop)
- [review 4](https://dev.to/eleftheriabatsou/review-4-personal-portfolio-developer-jatin-elefdoescode-4i52)
- [review 5](https://dev.to/eleftheriabatsou/review-5-github-cool-projects-with-react-developer-saad-elefdoescode-4091)
- [review 6](https://dev.to/eleftheriabatsou/review-6-personal-portfolio-developer-john-elefdoescode-2e20)

----------------------------

👋Hello, I' m Eleftheria, an app developer, master student, freelancer, public speaker, and chocolate lover.


😎Top 3 list:
- How to stay motivated | A developer's edition | @BatsouElef: https://youtu.be/qMvEtb5OxNo
- How to be a Better Problem Solver | Tips and solutions: https://youtu.be/dELt7yKIxIA
- Simple Tips to Build a Personal Brand as a Developer (+ personal examples): https://youtu.be/7s0o1gi0iP0

🥰If you liked this video please share

🍩Would you care about buying me a coffee? You can do it here: [paypal.me/eleftheriabatsou](paypal.me/eleftheriabatsou) but If you can't that's ok too!


**************************************

🙏It would be nice to subscribe to my [Youtube](https://www.youtube.com/c/EleftheriaBatsou) channel. It’s free and it helps to create more content.

🌈[Youtube](https://www.youtube.com/c/EleftheriaBatsou) | [Codepen](https://codepen.io/EleftheriaBatsou) | [GitHub](https://github.com/EleftheriaBatsou) | [Twitter](https://twitter.com/BatsouElef) | [Site](http://eleftheriabatsou.com/) | [Instagram](https://www.instagram.com/eleftheriabatsou/)
Remote work journey - Day 3
Tags: watercooler, remote, webdev, development
Published: 2020-03-19 09:00:02

---
title: Remote work journey - Day 3
published: true
description: Continuous journey of working from home due to COVID-19 outbreak at the world. This is my journey, my challenges in trying to be productive and completely changing my work habits from office first to remote first. 
tags: watercooler, remote, webdev, development
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/w9sl4hutnsppcw8qix2e.jpg
series: working from home
---
## General

It seems in Germany people fu*** don't care. I'm questioning the ability of reasoning from most people here. People are stilling chilling in parks, bringing kids to playgrounds or having play dates. 

I'm not against this. Worldwide we have almost [9K of deaths](https://gisanddata.maps.arcgis.com/apps/opsdashboard/index.html#/bda7594740fd40299423467b48e9ecf6) and 220K of infected people officially.

Right now this is my best hypothesis about Europeans and why they act like business as usual:

{% twitter 1240555238966386688 %}

Productivity is lower than I expect but I feel that over the next days or week I will hopefully normalize more and more. Thanks to Zalando for openly communicating that we should take care of family first and work from home (remote-first) when possible.

_Fun note:_ Beginning next day, I will try out [Snap Camera](https://snapcamera.snapchat.com/download/) in our Daily Standups 😃 I feel that some of my co-workers being totally alone and isolated at home need a laugh. Me too.

## Work

After having my first [remote Retrospective](https://dev.to/fokusman/starting-the-journey-of-remote-work-day-2-3fb6) yesterday I had my first remote 1on1. My Lead was on holidays for 2-3 weeks and came back to this whole 180° changed company setup. We had a lot of topics, a lot to discuss and somehow 1h was not enough. It was mainly work with some Off-topic talk around Home-Schooling, Groceries and Kids 😃

At the same time we are currently discussing how we can setup a clear Bug process and it seems that no matter what solution you could provide some people won't like it. 


## TIL

Regarding the bug process Workgroup, I'm part of:

- Don't try to satisfy all stakeholders. Understand the underlying root cause, problems and focus on them. Accept that some people won't agree with you.
- Define your Problem and Purpose clear. Always start with that and evaluate your solutions against them.

I have realized that managing too many different stakeholders can easily result in a solution with many trade-offs. I got valuable feedback from our Frontend Chapter + Lead.


Take care and feel free to share your situation via blogposts or comments here 🤩

 ----
Past Posts:
{% link https://dev.to/fokusman/starting-the-journey-of-remote-work-day-1-280n %}
{% link https://dev.to/fokusman/starting-the-journey-of-remote-work-day-2-3fb6 %}
What Does "--" (Double-Dash) Mean?
Tags: bash
Published: 2020-03-19 08:59:21

From `man bash`:

> `--`        A  `--`  signals  the  end of options and disables further option processing.  Any arguments after the `--` are treated as
                 filenames and arguments.  An argument of `-` is equivalent to `--`.

In other words, `--` is used to signify the **end of command options**. After it, only positional parameters are accepted.

For example, we want to look for the "--color" string using `grep`:

```bash
$ echo "hello --color" | grep --color
usage: grep [-abcDEFGHhIiJLlmnOoqRSsUVvwxZ] [-A num] [-B num] [-C[num]]
	[-e pattern] [-f file] [--binary-files=value] [--color=when]
	[--context[=num]] [--directories=action] [--label] [--line-buffered]
	[--null] [pattern] [file ...]
```

We got an error, since `--color` expect a value. We can fix by signaling the end of options to the grep command using `--`:

```bash
$ echo "hello --color" | grep -- --color
hello --color
```

It's important to note that not all bash builtin commands accept the `--` as an end-of-options marker.