teleren/devto huggingface dataset:
Is the Front-End community better than the Back-End community?
Tags: discuss, healthydebate, career
Published: 2020-04-21 16:52:32

I know, I know, this is one of those click-bait titles you can see on YouTube.

Before everyone starts yelling, let me explain this.

I've been in the Web Development industry for a few years. Started 100% knee-deep in Front-end and everything seemed to be cool, sparky, flawless and there were a lot of "dev influencers" around the net creating videos, courses, etc... 

It was almost impossible not to make someone think "I should become a React/Vue Developer".

Now that I've dug a lot more into back-end —to the point that I'm thinking about staying there—, I feel some kind of disappointment when I look at social media like Twitter, Dev.to or local events and don't really feel the "hype" I saw in front-end.

- Do you think the same?
- Do you think there is an important difference between those two worlds?
- Could you recommend any resources for those who feel the same?

Please, let me know in the comments!

Cover illustration by [William Erhel](https://twitter.com/WilliamErhel) & [BlueCoders](https://twitter.com/bluecoders/)

![Illustration](https://dev-to-uploads.s3.amazonaws.com/i/fq0l8nj88hries5v5a0h.png)
Your tips for promoting open-source projects?
Tags: watercooler
Published: 2020-04-21 16:33:23

Hello all!

So I have a few open-source project available on GitHub which I think could really help folks doing iOS development but they don't seem to get much traction :(

I tried posting to some Slack groups and on Twitter but that did not help much. My most popular one has four stars..

Anyone willing to share tips to get this kind of project more noticed? :-)
TIL: HTMLLinkElement.href returns more than you think...
Tags: todayilearned, javascript
Published: 2020-04-21 16:29:59

I recently came across a bit of code that was trying to change the [favicon](https://en.wikipedia.org/wiki/Favicon) on every route change of a single page application.

i.e. Every time the URL changed from `/users` to `/users/fred` a function would run that checked the current `favicon` href and updated it if necessary.

It did this with a tiny bit of javascript like this:

```js
// where `expectedHref` is something like '/favicon-shop.ico'

const link = document.querySelector('link[rel*=icon]');
if (link.href !== expectedHref) {
    link.href = expectedHref;
}
```

What I noticed was that it was changing the favicon with _every_ route change. Why?

It turns out that the `href` property on an [HTMLLinkElement](https://developer.mozilla.org/en-US/docs/Web/API/HTMLLinkElement) always returns the full [URI](https://en.wikipedia.org/wiki/Uniform_Resource_Identifier) of the linked resource rather than just the content of the `href` attribute!

We should have been using `getAttribute` instead 🤦‍♀️

```js
link.href; // = 'http://example.com/favicon.ico'
link.getAttribute('href'); // = '/favicon.ico'
```
Data Scientist or Machine Learning Engineer?
Tags: machinelearning, datascience, career, beginners
Published: 2020-04-21 16:13:57


If you wish to work with data, there is a long list of titles you can require.
The list of titles goes hand in hand with a list of technologies that you can learn.


Most current common data roles are:
* Data Engineer
* Data Scientist
* Machine Learning Engineer
* ?

## But what is the difference?

Let's look at a Data Architecture and what roles required for working with large data:

![](https://docs.microsoft.com/en-us/azure/architecture/solution-ideas/media/advanced-analytics-on-big-data.png?WT.mc_id=devdataroles-devto-adpolak)

### Ingest & Store
> "Data ingestion is the process of obtaining and importing data for immediate use or storage in a database."


Data Engineers bread and butter. Their tasks range from setting up the data platform, Ingesting the data, cleaning, normalizing, building data pipelines, and securing the data flow in the system.


### Prep & Train
Prep and Train Machine Learning models are the main task for Data Scientists. 
Prep and Train Machine Learning models consist of (but not limited to) articulating the problem, establishing the data collection and cleaning mechanism with the Data Engineers, and building and evaluating various machine learning models to find the best one for the business requirements. 
This work can vary from descriptive analytics, predictive analytics, Deep Learning, and more. The outcome of these actions is a Machine learning model that can predict, classify, or detect necessary or unnecessary behavior. 


### Model & Serve
Usually, Model and Serve is the main task for ML engineers. They work with the Data Scientist team to apply model capabilities. Build an API for the model and/or embed the model capability within an application or bot. A Machine Learning model sometimes is called a mathematical model. 

### Web Application
 Web Application is the main task of our web developers! They focus most of their time on building and maintaining the web application.


## Interested in Learning more:

* [Identify the tasks of a data engineer](https://docs.microsoft.com/en-us/learn/modules/data-engineering-processes/?WT.mc_id=devdataroles-devto-adpolak) - 25 min read
* [Understand the Evolving world of Data](https://docs.microsoft.com/en-us/learn/modules/evolving-world-of-data?WT.mc_id=devdataroles-devto-adpolak) - 30 min read
* [Introduction to Machine Learning with Python and notebooks](https://docs.microsoft.com/en-us/learn/paths/intro-to-ml-with-python/?WT.mc_id=devdataroles-devto-adpolak) - Online course
* [Orchestrating machine learning with pipelines](https://docs.microsoft.com/en-us/learn/modules/create-pipelines-in-aml/?WT.mc_id=devdataroles-devto-adpolak)


🐦 Follow me on [Twitter](https://twitter.com/AdiPolak), happy to take your suggestions on topics.
Release Checklist
Tags: devops
Published: 2020-04-21 15:57:20

---
title: Release Checklist
published: true
description: a checklist to check before releasing a web service
tags: DevOps
---

A checklist example to check before releasing a web service

## Application

### Log

- [ ] Is there a log in CloudWatch Logs?

### External monitoring

- [ ] Is the stability of top page monitored by StatusCake?
    - Polling at least every 15 minutes

### Vulnerability

- [ ] Vulnerability diagnosis for externally released services.
    - Diagnostics by AWS inspector, IBM APP SCAN, etc. have been performed and the vulnerability has been fixed by the day of release

### Load test

- [ ] Has a load test been performed?

## Infrastructure

### Log (ex. CloudWatch)

- [ ] Have you set how many days to retain logs?

### Load Balancer (ex. ALB)

- [ ] Is the response time monitored in NewRelic?
- [ ] Is the load balancer 5xx monitored in NewRelic?

### App/Batch Server (ex. EC2)

- [ ] NewRelic's APMs are installed in your project.
- [ ] CPU/memory/disk is monitored in NewRelic

### Container Orchestrator (ex. ECS)

- [ ] Check the hard limit of memory set in the task definition of ECS not to exceed the upper limit of the ECS instance memory.

### Database (ex. RDS, ElastiCache)

- [ ] RDS CPU/memory/disk is monitored in NewRelic
- [ ] ElastiCache CPU/memory is monitored in NewRelic
- [ ] Are you sure it's not provided to the public?

### Network (ex. VPC, SG, WAF, S3)

- [ ] VPC's IP range is not the same as your other AWS VPCs
- [ ] Is there a clear separation between the Public and Private segments?
    - Even though it's a private segment, it has no igw and you can't connect it from outside
- [ ] If it is an internal service, is SG's ingress limited to your organization?
- [ ] Set WAF for services that are released to the public.
- [ ] Are all S3 buckets other than that must be disclosed to the outside world due to the need to provide services privately?

## DevOps

- [ ] can you run build/test/deploy with CircleCI?
- [ ] Are you able to manage your cloud resources with Terraform?
- [ ] Is there an on-call system like Opsgenie?
    - Be able to receive the following error notifications by phone or other means and be ready to write a playbook/post-mortem after recovery
        - external monitoring
        - 5xx of load balancers
        - Disk space remaining in EC2
        - Disk Space in RDS
        - Amount of memory remaining in ElastiCache
Reading Snippets [53 => Ruby] 💎
Tags: ruby, rails, codenewbie, beginners
Published: 2020-04-21 15:31:45

Iterating over an array in Ruby is one thing. Iterating over a multi-dimensional array in Ruby is another. Ruby presents an elegant way to iterate through an array using <code>array.each {}</code>. 

The process of iterating through a two-dimensional array is slightly different:

<code>s.each { |sub_array| sub_array.each { |element| puts element }}</code>




<kbd><small><a href="https://www.codecademy.com/courses/learn-ruby/lessons/ruby-data-structures/exercises/iterating-over-multidimensional-arrays">Codecademy Ruby Course</a></small></kbd>
NumPy loadtxt tutorial
Tags: python, beginners, tutorial
Published: 2020-04-21 15:23:46

---
title: NumPy loadtxt tutorial
published: true
description: 
tags: #python #beginners #tutorial
---

1 Specifying the file path
2 Specifying delimiters
2.1 Dealing with 2 delimiters
2.2 A general approach for multiple delimiters
3 Specifying the data type
4 Ignoring headers
5 Ignoring the first column
6 Load first n rows
7 Load specific rows
8 Skip the last row
9 Skip specific columns
10 Load 3D arrays
11 Comparison with alternatives
11.1 numpy.genfromtxt
11.2 numpy.fromfile
11.3 pandas.read_csv
12 Handling Missing Values
13 Conclusion

https://likegeeks.com/numpy-loadtxt-tutorial/

Most workarounds for loading data from files in NumPy.
Hope you like it.
Regards,
Spring Boot : Spring Data JPA
Tags: java, springboot
Published: 2020-04-21 15:03:36

Example of how to configure Spring Data JPA

* pom.xml

```xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.12</version>
</dependency>
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.12</version>
    <scope>provided</scope>
</dependency>
```

* application.properties

```
spring.datasource.url=jdbc:postgresql://localhost/{DBNAME}
spring.datasource.username={USERNAME}
spring.datasource.password={PASSWORD}
spring.datasource.driver-class-name=org.postgresql.Driver
```

* Customer.java

```java
@Data
@Entity
public class Customer {

    @Id
    @GeneratedValue(strategy= GenerationType.IDENTITY)
    private Long id;

    private String name;
}
```

* CustomerRepository.java

```java
public interface CustomerRepository extends CrudRepository<Customer, Long> {

    Optional<Customer> findById(Long id);
}
```
Public demo of our side project (no signup required)
Tags: showdev, vue
Published: 2020-04-21 14:58:52

We've been working in our side project called [theLifeBoard](https://thelifeboard.app) for a few months, just doing little bits whenever we can. It's a web application to help people identify their goals and help them achieve them by providing a dashboard to organize their weeks and curated resources. 

We have a version of the web app that we've been using for a few weeks, but it still has a lot of missing features and some nasty bugs.

A couple of days ago I had an idea. As the application is not ready to be shared with real users we thought about building a public demo, one that **doesn't require users to sign up** but that allows them to play around with the dashboard and maybe give us some feedback.

It just took me a couple of days to remove all the API integrations and add it to our landing page. You can find it here:

https://thelifeboard.app/demo

Feel free to play with it and let us know what you think. 

>The data will not be sent to our back end and will be lost if you refresh the page.

### Tech stack
If you're interested in the technical side, the front end it's built with Vue.js + Vuetify and the back end is composed of multiple APIs some of them built with Strapi and others are simple Lambda functions.

Happy coding!
Matt's Tidbits #65 - It's time for proper support for JUnit 5
Tags: mattstidbits, android, testing, tidbittuesday
Published: 2020-04-21 14:47:32

[Last time I wrote about an interesting Hamcrest error and how I resolved it.](https://medium.com/@matthew.b.groves/matts-tidbits-64-digging-into-some-ham-crest-assertions-80332570e400) This week, I have a quick story about writing JUnit 5 tests for Android apps.

Recently I started writing a new software library, and as such, wanted to make sure I was using all of the latest tools so my code didn't take on technical debt from the beginning.

If you've read my blog for any period of time, you know I'm a huge proponent of testing, so naturally, I wanted to make sure that my new library was extensively unit-tested and was built on the latest versions of testing tools.

I did a little Google searching and found that there's a new version of JUnit -  JUnit 5, that brings a refined API and powerful features, so naturally I wanted to use it.

It's fairly easy to set up, so I was pretty quickly off and writing unit tests with the new framework.

... That is, until I tried to run the tests. It's easy to run them within Android Studio - you can just run them as you've run other unit tests. But, when it comes to running them from the command line via Gradle (or in your CI tool), nothing happens.

Doing a little more digging, I found that most people use a 3rd-party plugin to allow the Android Gradle Plugin to run JUnit 5 tests: https://github.com/mannodermaus/android-junit5

Somehow, despite JUnit 5 being released over 2.5 years ago, Android Studio *still* doesn't have proper support for it. I even found this issue filed against the AndroidX Test library over a year ago: https://github.com/android/android-test/issues/224

After considering all of these factors, I decided to go back to JUnit 4 instead of using JUnit 5, because I don't want to be reliant on a 3rd-party library for running unit tests.

If you'd like to see native JUnit 5 support, please go like and/or comment on the Android-Test issue linked above - perhaps with more community outcry we can get this prioritized!

What version of JUnit are you using on your project? If you have switched to JUnit 5, what has your experience been like? Let me know in the comments! And, please follow me on Medium if you're interested in being notified of future tidbits.

*This tidbit was originally delivered on March 27, 2020.*
Configure the Nuxt.js server to see your site on your mobile
Tags: nuxt, vue, server
Published: 2020-04-21 14:42:59

---
canonical_url: 'https://debbie.codes/blog/nuxt-configure-server-to-see-site-on-mobile'
---
Sometimes you want to test out your site on your actual mobile device or tablet and not just in the dev tools. This is great when bug fixing or just to see how it looks in a real environment.

By default, the Nuxt.js development server host is localhost which is only accessible from within the host machine meaning you can't open localhost on your mobile.

However you can modify the server in your nuxt.confg.js file. 
```javascript
export default {
  server: {
    host: '0' // default: localhost
  }
}
```
By assigning the string value of '0' which is short for '0.0.0.0' Nuxt.js will give you your local IP address.

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

Now instead of typing localhost to see your application you will type your local IP address. In this example mine is http://192.168.0.199:3000/

You can now go to you mobile or tablet and open your website using that link.

The default port is 3000. Should you wish to change it you can also do so by using the port property.
```javascript
export default {
  server: {
    port: 8000, // default: 3000
  }
}
```
If this port is already in use, Nuxt.js will give you a random port.

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

Although you can modify this in the nuxt.config.js file it is not advised to as it might cause you issues when hosting your site. It is much better to modify the host direct in the dev command. 
```bash
HOST=0 npm run dev
```
or the port that you want
```bash
PORT=8000 npm run dev
```
or both
```bash
HOST=0 PORT=8000 npm run dev
```
You can even setup a script command in your package.json. For this example I will call it dev:host but you can call it whatever you like. You can add the hostname you always want to use or you can add '0' to get a random one. 
```json
"scripts": {
  "dev:host": "nuxt --hostname '192.168.0.199' --port 8000"
}
```
Which means you only have to run one command when you want to change your servers and the normal dev command for when you want to run on localhost. 

```bash
npm run dev:host
```

Although you can now see your site on your mobile you can't share this port with anyone outside of your LAN. That means if you are working remote and want to share your work in progress with someone not on the same wifi connection as you, then this method will not work.

Give it a try and start testing your mobile user experience, while in development, on an actual mobile. 

[See the nuxt docs for more info](https://nuxtjs.org/faq/host-port)
Spring Boot : JDBCTemplate
Tags: java, springboot
Published: 2020-04-21 14:24:21

Example of how to setup Spring Boot with `JDBCTeamplate`

* pom.xml

```xml
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
</dependency>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
<dependency>
    <groupId>org.postgresql</groupId>
    <artifactId>postgresql</artifactId>
    <version>42.2.12</version>
</dependency>
<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
    <version>1.18.12</version>
    <scope>provided</scope>
</dependency>
```

`spring-boot-starter-jdbc` and JDBC Driver, in this case `postgresql` is mandatory.

* application.properties

```
spring.datasource.url=jdbc:postgresql://localhost/{DBNAME}
spring.datasource.username={USERNAME}
spring.datasource.password={PASSWORD}
spring.datasource.driver-class-name=org.postgresql.Driver
```

We often don't need `spring.datasource.driver-class-name` because Spring can figured it out from url.

* App.java

```java
@Slf4j
@SpringBootApplication
public class App implements CommandLineRunner {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public static void main( String[] args ) {
        SpringApplication springApplication = new SpringApplication(App.class);
        springApplication.setWebApplicationType(WebApplicationType.NONE);
        springApplication.run(args);
    }

    @Override
    public void run(String... args) throws Exception {
        log.info("Count total row = {}", 
            jdbcTemplate.queryForObject("SELECT COUNT(id) FROM customer", Integer.class));
    }
}
```

`JdbcTemplate` is auto configured in Spring. We can Autowired it directly into any Spring bean class.
JavaScript projects for open source
Tags: javascript, developer
Published: 2020-04-21 14:21:25

Hello... Today I want you request to collaborate with me to build JavaScript open source project repository.

Here is my repo 
https://github.com/nayyaung9/js-codelabs

Warmly welcome.
before you collaborate, please open issue (type: enhancement)
in your issue, please write down project flow and project level (basic, intermediate or advanced)
After that, I will give you project id. for example
your project name is "Todo list App" and i give you 03 id.
so you have to put id in front of project name( 03-todo-list-app ) like so.

I hope, you all will collaborate with me..Thanks
Introducing Object Hooks: Mutable State for React 🤯
Tags: react, typescript, javascript
Published: 2020-04-21 14:21:11

---
title: Introducing Object Hooks: Mutable State for React 🤯
published: true
description: 
tags: react, typescript, javascript
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/e8dcmbynqqq03wommeue.gif
---
The idea I started with is: What if we could write state changes in react as mutations on a persistent reference? 🤔 So I [wrote the code](https://github.com/shiftyp/object-hooks-test) to make it work! The basic concept is summed up in the code from the banner image:

```tsx
import React from 'react';

import { useObject } from '../hooks/useObject';

export const Counter: React.FC = () => {
  const [state] = useObject({
    count: 1,
  });

  return (
    <button
      onClick={() => {
        state.count++;
      }}
    >
      {state.count}
    </button>
  );
};
```
In this case, state is a persistent reference that you can mutate (`state.count++`). The consequences of this change are fairly interesting. For one, you can create these objects with a class! So the above example could be rewritten as:
```tsx
import React from 'react';

import { useInstance } from '../hooks/useInstance';

class Counter {
  count = 1;

  increment() {
    this.count++;
  }
}

export const Counter: React.FC = () => {
  const [counter] = useInstance(Counter);

  return (
    <button
      onClick={() => {
        counter.increment();
      }}
    >
      {counter.count}
    </button>
  );
};
```
Also, if you need to subscribe to to changes in the objects outside of a component function, they implement the `AsyncIterable` interface, so you can `await` their next state, or `for await` future states in an `async` function. Here's a logger class that subscribes to a counter!
```typescript
class CounterLogger {
  constructor(
    private counter: Counter & AsyncIterable<Counter>
  ) {}

  log(count: number) {
    console.log(`Count is: ${count}`);
  }

  async watch() {
    this.log(this.counter.count);

    for await (const { count } of this.counter) {
      this.log(count);
    }
  }
}
```
There's more to it, and there will be more as the project progresses. I wanted to share what I have in its current "state" 😉 to give everyone a chance to contribute their thoughts and ideas! If you're interested, [clone the repo](https://github.com/shiftyp/object-hooks-test) and try it for yourself! Or leave a comment or question on this post! All are contributions, all are welcome. 🔰