teleren/devto huggingface dataset:
Day 54 of 100 Days of SwiftUI
Tags: swift, 100daysofcode
Published: 2021-05-07 15:11:39

I just completed day 54 of 100 day of swift UI. Today I worked on building an app that stores the books you read and their rating. It was built using CoreData as the database.

Here's a link to the [codebase](https://github.com/sanmiAde/BookWorm)

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vmqkloggvtvyzrffpw5i.png)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rwdy7qvxxun3tu1zxbdo.png)
Search for QA  Engineer
Published: 2021-05-07 15:10:36

Hi there! I am Daniel.
Seeking an opportunity to join a highly motivated team that creates amazing software products.
I have a B.A. in <what da fuck your diploma is called in English>.
I am an experienced QA engineer with strong knowledge of SQL, testing automation tools and manual testing, believing that the role of a QA engineer is not only in providing the test result but being a part of design, architecture, development and until the product meets its happy user.
Looking for a remote position in your company.
Let's build something great together!
How to read/write CSV file in Kotlin
Tags: kotlin, csv, readfile, writefile
Published: 2021-05-07 15:10:26

https://grokonez.com/kotlin/kotlin-read-write-csv-file-example

How to read/write CSV file in Kotlin

In this tutorial, we're gonna look at examples that read and write CSV file using native Kotlin.

<!--more-->
<h2>I. Write Data to CSV File</h2>
- Simple POJO <strong>Customer</strong> (id, name, address, age):
<pre><code class="language-java">
package com.javasampleapproach.kotlin.csv

class Customer {
	var id: String? = null
	var name: String? = null
	var address: String? = null
	var age: Int = 0

	constructor() {}
	constructor(id: String?, name: String?, address: String?, age: Int) {
		this.id = id
		this.name = name
		this.address = address
		this.age = age
	}

	override fun toString(): String {
		return "Customer [id=" + id + ", name=" + name + ", address=" + address + ", age=" + age + "]"
	}
}</code></pre>
- Write Customer List to CSV file:

More at:


https://grokonez.com/kotlin/kotlin-read-write-csv-file-example

How to read/write CSV file in Kotlin
Easily sort imports and remove unused declarations on each save in VS Code
Tags: vscode, eslint, prettier, javascript
Published: 2021-05-07 15:03:55

All this time I was using VSCode formatting on save which triggers the selected default formatter (Prettier).

Also I was organizing and sorting my imports manually all the time. Or in other words, I didn’t. So foolish… 

Because it couldn’t be more simpler to enable it without installation of any additional `ESLint` or `Prettier` plugins. Of course, I’m assuming you already have [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) and [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) VS Code extensions because they are a must have for any JavaScript project.

Just add the following to your VS Code `settings.json`:
```json
 ...
 "editor.formatOnSave": true,
 "editor.codeActionsOnSave": {
   "source.fixAll": true,
   "source.organizeImports": true,
   "source.sortMembers": true
 }
```

`fixAll` is not necessary for this case but could be useful too.
> `fixAll` property turns on Auto Fix for all providers including ESLint, according to [VS Code Docs, Release Notes November 2019 (version 1.41)](https://github.com/microsoft/vscode-docs/blob/efa17ec71d755cf14c4722c7d05d10c538cb0e97/release-notes/v1_41.md#eslint)

🚀 Voilà, while having all these enabled in your settings, VS Code will **automatically** on each file save:
* run code formatting with default formatter
* sort imports
* remove all unused declarations
* run ESLint auto fix

It's always nice when you don't need to take care of these things manually, right? 😎 🤖
Kotlin – How to write to file with Kotlin language
Tags: kotlin, writefile
Published: 2021-05-07 15:03:23

https://grokonez.com/kotlin/kotlin-write-file-kotlin-language

Kotlin – How to write to file with Kotlin language

This tutorial shows you how to write to File in Kotlin using <code>PrintWriter</code>, <code>BufferedWriter</code> or just <code>File</code> Kotlin extension functions.

<!--more-->
<h2>I. Technology</h2>
- Java 1.8
- Kotlin 1.1.2
<h2>II. Practice</h2>
<h3>1. PrintWriter</h3>
<pre><code class="language-java">
import java.io.File

fun main(args: Array<String>) {

	val outString: String = "Kotlin\nBe Kotlineer - Be Simple - Be Connective."
	File("kotlin1.txt").printWriter().use { out -> out.println(outString) }
}</code></pre>
Check Result:
<pre><code class="language-java">
Kotlin
Be Kotlineer - Be Simple - Be Connective.
</code></pre>
<h3>2. BufferedWriter</h3>
<pre><code class="language-java">
import java.io.File

fun main(args: Array<String>) {

	val outString: String = "Kotlin\nBe Kotlineer - Be Simple - Be Connective."
	File("kotlin2.txt").bufferedWriter().use { out -> out.write(outString) }
}</code></pre>
Check Result:

More at:

https://grokonez.com/kotlin/kotlin-write-file-kotlin-language

Kotlin – How to write to file with Kotlin language
Kotlin – How to read/write QR Code with ZXing
Tags: kotlin, qrcode, zxing
Published: 2021-05-07 14:53:34

https://grokonez.com/kotlin/kotlin-read-write-qr-code-zxing

Kotlin – How to read/write QR Code with ZXing

In this tutorial, we're gonna look at Kotlin examples that read and write QR Code using ZXing.

<!--more-->
<h2>I. Dependency</h2>
<pre><code class="language-html">&lt;dependency&gt;
	&lt;groupId&gt;com.google.zxing&lt;/groupId&gt;
	&lt;artifactId&gt;core&lt;/artifactId&gt;
	&lt;version&gt;3.3.2&lt;/version&gt;
&lt;/dependency&gt;

&lt;dependency&gt;
	&lt;groupId&gt;com.google.zxing&lt;/groupId&gt;
	&lt;artifactId&gt;javase&lt;/artifactId&gt;
	&lt;version&gt;3.3.2&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
<h2>II. Write Data to QR Code</h2>
<pre><code class="language-java">
package com.javasampleapproach.kotlin.qrcode

import java.io.IOException
import java.nio.file.FileSystems
import java.nio.file.Path
import com.google.zxing.BarcodeFormat
import com.google.zxing.WriterException
import com.google.zxing.client.j2se.MatrixToImageWriter
import com.google.zxing.common.BitMatrix
import com.google.zxing.qrcode.QRCodeWriter

@Throws(WriterException::class, IOException::class)
fun main(args: Array<String>?) {

	val qrCodeWriter = QRCodeWriter()
	val bitMatrix = qrCodeWriter.encode(
			"JavaSampleApproach\nJava Technology, Spring Framework",
			BarcodeFormat.QR_CODE,
			350, 350) // width x height

	val path = FileSystems.getDefault().getPath("JSA-QRCode.png")
	MatrixToImageWriter.writeToPath(bitMatrix, "PNG", path)
}</code></pre>
A QR Code is generated:
<img src="https://grokonez.com/wp-content/uploads/2018/03/JSA-QRCode.png" alt="JSA-QRCode" width="350" height="350" class="alignnone size-full wp-image-10981" />
<h2>III. Read Data from QR Code</h2>

More at:

https://grokonez.com/kotlin/kotlin-read-write-qr-code-zxing

Kotlin – How to read/write QR Code with ZXing
Resumo: Código Limpo - Capítulo 1: Código Limpo
Published: 2021-05-07 14:52:56

O *"Código Limpo - Habilidades Práticas do Agile Software"* é um livro escrito por Robert C. Martin, também conhecido como Uncle Bob, onde nos oferece muitas ferramentas e técnicas que auxiliam na criação de nossos projetos.

Então resolvi criar essa série de breves resumos sobre os capítulos dessa leitura tão importante para nós, pessoas desenvolvedoras.

Começaremos, obviamente, pelo primeiro capítulo denominado **Código Limpo**.

O código sempre existirá, é com ele que expressamos de maneira detalhada as especificações dos requisitos para que o projeto ganhe vida (olha que forte!).

Ótimo, nos expressamos através dos códigos, mas qual é a ideia passada nesse capítulo? Para entender precisamos saber o que é um código ruim (porque sim, podemos nos expressar mal).

Um código ruim é aquele que quando você abre o fonte e a única coisa que passa pela sua cabeça é: DESESPERO!

Sabe aquele código todo bagunçado, mal indentado, desorganizado? Então, é esse mesmo. Pensa só como seria difícil e custoso dar manutenção nisso, ou pior, mover ou apagar uma linha e o sistema todo não funcionar mais.

O meu código confuso pode te atrasar e vice-versa. A rapidez se constrói com bons códigos para que a manutenção seja mais rápida e menos custosa.

Tá, podemos culpar a pressa, mas e a nossa culpa? Sim, Tio Bob falou que a culpa é toda nossa, e é mesmo, porque somos detentores do conhecimento e precisamos fazer com que os requisitos se encaixem no sistema da melhor maneira possível. Ele enfatiza:

>"A *única* maneira de isso não acontecer - a única maneira de ir rápido - é sempre manter o código limpo"

Nossa maior responsabilidade como pessoas desenvolvedoras é saber nos comunicarmos de maneira fácil com os nossos leitores (sim, somos autores) através dos nossos códigos bem escritos (a escrita tem que ser fácil também) e com as manutenções, deixá-lo o mais limpo do que antes. A ideia é o código estar em constante evolução. 

É isso, esse é o primeiro resumo desse livro que vai mudar muito com a nossa maneira de pensar sobre código, em breve teremos novos artigos dos próximos capítulos.
All About React
Tags: react, hook
Published: 2021-05-07 14:45:27

**React JSX**: react jsx is neither a string nor an HTML tag. It's a powerful thing where we can use all javascript power.  We can create HTML elements using javascript.
```
let element = document.createElement("h3")
element.innerText = "hi Rahul"
document.getElementById("app").appendChild(element)
```
In this process, we can create Html element using js. In the backend react is automatically creates the element in this process.
```
import React from 'react';
const element = React.createElement('h1', null, "Hello Rahul");
```
Here element is a valid JavaScript object. so we can do anything with it. We can write in a more simple way like this
```
import React from "react";
const element = <h3>Hello Rahul</h3>;
console.log(element);
```
Now JSX means javascript XML that looks like this up code and this conversion happen using babel
We can use javascript in jsx inside `{}` notation . We can set attribute in jsx like HTML tag.
```
ReactDOM.render(element,  document.getElementById("app"))
```
this line shows the react element in the HTML page. if we change the element like then the code looks like
```
import React from "react";
import ReactDOM from "react-dom";
setInterval(() => {
const element = (
<h3 className="h3">
<span>
Hi Rahul
{Date()}
</span>
</h3>
);
ReactDOM.render(element, document.getElementById("app"));
}, 1000);
```
**Browser DOM:**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u7yrv2exr6as24vdtlqr.png)
This is the HTML rendering process in the browser. If we change something on the page it will rerender the page each change. So if we rerender the page it will slow the browser.

**Batch update**: Batch update is an update process where first all update happens then render the page at last.

**Virtual DOM**: In this process, a replica of the main dom is created and which is a javascript object. If something is changed in the dom react graph the change using reconciliation algorithm and find the change.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/urj0skieaeu7m9c9bukj.png)

**useState()**: useState is a function that controls the state of the react component. Here state means the data that change for each update. This is called the state of a react element.
Deploying an existing  Node.js app  to Heroku 
Published: 2021-05-07 14:27:22

Before you start, create a free Heroku account, install Node.js and npm locally. Link your app to GitHub. It needs to be on github for it to be deployed.  
####Set up heroku 
Download and run the installer for your platform from the heroku web page and follow the instructions there.


####Then run the following commands

` heroku create`
` git remote -v`
 Add a procfile and add this code inside ` web: node app.js`
 Listen on the correct port so add this line of code
`const PORT = process.env.PORT || 3000;
app.listen(PORT);`
to open the app `Heroku open`
Glassmorphism Login Form With HTML & CSS
Tags: html, css, webdev, beginners
Published: 2021-05-07 14:24:43

Today I created a Glassmorphism Login form with HTML & CSS. this login form is very simple but looks good I use the Glassmorphism effect to create this login form. I hope you like this also comments about your thoughts.

For more content follow me on Instagram  [@developer_nikhil27](https://www.instagram.com/developer_nikhil27/).

Thank you!

{% codepen https://codepen.io/NikhilBobade/pen/MWpYEzj %}
Introducing... My New Site! ✨
Tags: showdev, webdev, css, news
Published: 2021-05-07 14:20:04

Check out the site here! https://georgefrancis.dev/ 👀

---

Hey! How's it going? I've been a little quiet on DEV recently, but... I'm very happy to finally share why! 🎉

Well, as you might have noticed from the big ol' title/URL above, I have launched my very own site! As much as I love DEV 💛, and think it's a fantastic place to publish, I have found myself wanting a singular home for all of my CodePens, articles, and other bits and pieces — so I decided to build one. 

The site is built with [Eleventy](https://www.11ty.dev/), hosted on [Netlify](https://www.netlify.com/), and is finished off with a healthy scoop of generative magic ✨ It features all of my past writing from DEV, and will be the best place to catch any new content from me going forward. 

Honestly, I could chat forever about the design process, tech stack, etc, _(and maybe I will someday)_ but for now, I'd just like to share the site with y'all! If you do have any specific questions, though, please do give me a shout. I'm always happy to chat.

Anyway, now that the site is launched, I am starting to rattle through my ever-growing Trello list of article ideas, so expect some fresh new creative coding/generative art content from me soon 🎨

In case you missed it up there ^ [here's a link to the site.](https://www.georgefrancis.dev)

Cheers! 

George 👀
Guess the QR code
Tags: qrcode
Published: 2021-05-07 14:14:00


Easy and simple way to send people web url:-)

![My Youtube channel QR code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsx70puhcb8taazej6vm.jpeg)

What use case can you think of sending QR code or creating QR Code?

1) I can think of Restaurant Menu.

List down yours in the comment section.
React: Create an 'EmptyState' component
Tags: react, webdev, codenewbie, beginners
Published: 2021-05-07 14:04:37

Empty states and values are always checked. It throws an error if the array is `undefined` or `null`. There has to be a message if there is no data. 

I made this `EmptyState` component which covers these basic use cases. 

```jsx
/** EmptyState.js */
import React from "react";
import _ from "lodash";
import styled from "styled-components";

const StyledContainer = styled.div`
  text-align: center;
  width: 100%;
  font-size: 2rem;
  color: lightgrey;
`;

const EmptyState = ({ input, children }) => {
  // matches falsy values as well as empty arrays & objects
  const isEmpty = _.isEmpty(input);

  return isEmpty ? <StyledContainer>Empty</StyledContainer> : children;
};

export default EmptyState;
```

Usage:

```jsx
/** App.js */
import React from "react";
import EmptyState from "./EmptyState";

const App = ({ data }) => {
  return (
    <EmptyState input={data}>
      {data.map((name) => (
        <h3>{name}</h3>
      ))}
    </EmptyState>
  );
};

export default App;
```

Comment down what additions you think could be made.

---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for more.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack  
**[codedrops.tech](https://www.codedrops.tech/)**

---
**Projects**  
[File Ops](https://marketplace.visualstudio.com/items?itemName=mehullakhanpal.file-ops) - A VS Code extension to easily tag/alias files & quick switch between files
Handy JS Methods and Utility Functions
Tags: javascript
Published: 2021-05-07 14:08:48

---
title: Handy JS Methods and Utility Functions
published: true
description: Little helpers I've found useful over time
tags: javascript
---

This is just a list of little helpers I end up using in a lot of my applications. I'll try to add to it as time goes on. The following are listed alphabetically by function name.

# A

```js
/**
 * arrayShuffle...drum roll please...shuffles an array
 * The idea is to introduce some randomness into things
 * The array is directly modified, not immutable
 *  
 * This is the Fisher-Yates randomization method
 * The idea is to count down from the back of the array
 * As you go, you randomly pick a random one before it 
 * 
 * 
 * @param { array } array - array you want to shuffle 
 */

export function arrayShuffle(array) {
  for (let i = array.length - 1; i > 0; i--) {
    const j = Math.floor(Math.random() * (i + 1));

    // Basically we destructure the current and adjacent array indicies
    // Then we swap them around, with j being a randomized index
    [array[i], array[j]] = [array[j], array[i]];
  }
}
```

# D

```js
/**
 * dateFormatter()
 * 
 * Desc: Takes an ISO 8601 date, and gives back an object:
 * 
 *    unixTime, a Unix integer timestamp (milliseconds since 1970-01-01, ie 1546300800000)
 *    month, full name of month (ie, "July")
 *    day, string with date and suffix (ie, "5th", "13th")
 *    year, 4 digit representation of the year (ie, "2021")
 *
 * Note: this uses setDateSuffix() listed below...
 * 
 * @param { string } ISOdate - expects ISO 8601 date
 */
 export const dateFormatter = (ISOdate) => {

  // Parse date from ISO format
  const newDate = new Date(ISOdate)

  // Set up obj for results
  // using a lot of date methods, check this out if you're rusty on dates:
  // https://stackoverflow.com/questions/4321270/regarding-javascript-new-date-and-date-parse/66823255#66823255
  return {
    unixTime: Date.parse(newDate),
    month: newDate.toLocaleString('en-us', { month: 'long' } ),
    day: setDateSuffix(newDate.getDate()),
    year: newDate.getFullYear()
  }
}
```

# R
```js
/**
 * randomID() - generates sufficiently random numbers for React key IDs
 * @param { int } num - however random you want it
 */
export const randomID = (num) => { 
  return Math.round(Math.random() * num) 
}
```


# S

```js
/**
 * setDateSuffix()
 * 
 * Desc: Takes two digit date, adds 'st', 'nd', 'rd', etc
 * 
 * @param { integer } num - a number date
 */

 export const setDateSuffix = (num) => {
  const j = num % 10,
        k = num % 100

  if (j === 1 && k !== 11) {
    return num + "st";
  }
  if (j === 2 && k !== 12) {
    return num + "nd";
  }
  if (j === 3 && k !== 13) {
    return num + "rd";
  }

  return num + "th";
}
```

# T

```js
// Type detection in JS
if(typeof(image) === 'string') {
  // do work
}
```
Project Euler 001
Tags: projecteuler, programming, challenge
Published: 2021-05-07 13:52:21

# Hey folks

Project Euler is a series of challenging mathematical/computer programming problems that I like to start. I'm sure there will be a lot to learn for me, and I would like to share my solutions here in DEV.

❓ Here is problem 001:

> If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6, and 9. The sum of these multiples is 23.
> Find the sum of all the multiples of 3 or 5 below 1000.

💡 For solving this problem, we can simply use the Modulo operation and calculate the numbers which are multiples of 3 or 5.

> ❗ Modulo is a math operation that finds the remainder when one integer is divided by another. In writing, it is frequently abbreviated as a mod, or represented by the symbol %.
> For two integers a and b:
> a mod b = r
> Where a is the dividend, b is the divisor (or modulus), and r is the remainder.

Here is an example:

11 mod 4 = 3, because 11 divides by 4 (twice), with 3 remaining.

💻 So, my solution in Python is:

```python
sum = 0

for integer in range(1, 1000):
    if integer % 3 == 0 or integer % 5 == 0:
        sum += integer
print(sum)
```

✅ The answer to this problem is **`233168`**.

## **Thank You** ❤️

I wish my posts to be useful to anyone new to the world of programming or anybody curious 🧐!
If you find the content useful to you, please comment your thoughts, I would love to learn from you all.

Thank you for your loving directions.
A Woman’s Guide to Project Management
Tags: productivity, agile, management
Published: 2021-05-07 13:25:38

Every Industry has its unique characteristics. Information Technology it's no different. But it’s always about effective management of workload and change, of a systematic approach to all stages and controlling of different types of events in the course of the project life cycle.

If we want to answer a basic question first, **what is project management?** In simple terms, it is getting work done in time and budget. If we would like to dive into some depth we say Project Management is the process of creating methodologies, using tools, and following processes to plan and execute projects in a successful way. Where we use teams and resources to complete tasks within the deadline, cost, and scope of the project, while we pass five main project life cycle stages: initiation, planning, execution, monitoring, control, and closure. 

In order to execute projects in a perfect manner we use different methodologies from **Waterfall** to **Kanban** to **Scrum** and many others, all with the same objective; taking an idea and bringing it to fruition.

Now, assuming we have mastered the technical skills of project management and implementation, is this all there is to know? And is this all we need to do?
*Absolutely not*! There are other **key elements** we need to have in mind if we really want our projects to succeed:

**Creating proper communication channels**
The ability to have the proper language on communicating important information to all relevant parties is crucial to project success. Remember that it's not always easy to get everyone on the same page.

**Stimulating teams**
Motivating people over the course of a long effort doesn't always come in handy. But it is important to motivate team members to do their best work even when deadlines get tight and projects get tricky 

**Adaptability**
You need to know how to roll with the punches and make the necessary adjustments to move forward even in the face of unexpected issues.

**Resourcefulness**
You don’t always have every tool to succeed in our projects but that should not stop you. Instead of giving up when you come across an issue you are not prepared about, you need to become determined to find a solution even if it takes a little elbow grease to do so. 

**Teamwork**
Project management is all about working together in a group. Being cooperative, collaborating, creating easy environments to work in, talk to, and being fair to everyone else is as much important as any other element. 

_________________________________________________________________
*If you have any questions or need help with Project Management ping me/us.*
*We do also provide PM as a Service for our customers, If you are interested to find more contact me/us or schedule a meeting for more information.*
[Link](https://ornio.no/contact)