teleren/devto huggingface dataset:
NER With Transformers and spaCy (Python)
Tags: python, deeplearning, machinelearning, datascience
Published: 2021-05-11 15:02:28

{% youtube W8ZPQOcHnlE %}

Named entity recognition (NER) consists of extracting 'entities' from text - what we mean by that is given the sentence:

"Apple reached an all-time high stock price of 143 dollars this January."

We might want to extract the key pieces of information - or 'entities' - and categorize each of those entities. Like so:

* Apple  : Organization
* 143 dollars :  Monetary Value
* this January :  Date

For us humans, this is easy. But how can we teach a machine to distinguish between a granny smith apple and the Apple we trade on NASDAQ?

(No, we can't rely on the 'A' being capitalized…)

This is where NER comes in - using NER, we can extract keywords like apple and identify that it is, in fact, an organization - not a fruit.

The go-to library for NER is spaCy, which is incredible. But what if we added transformers to spaCy? Even better - we'll cover exactly that in this video.
⌨ Update to my Hugo publish.sh script
Tags: hugo, bash
Published: 2021-05-11 18:38:32

---
title: ⌨ Update to my Hugo publish.sh script
published: true
date: 2021-05-11 14:41:00 UTC
tags:
- hugo
- bash
canonical_url: https://www.gozgeek.com/posts/2021/update-to-my-hugo-publish-sh-script/
cover_image: https://cdn.collinsoft.com/file/cdn-collinsoft/gozgeek.com/img/2021/publish/publish-1024x.jpg
---

I ran in to a little issue with my `publish.sh` script that I use [to automatically publish my site with Hugo](https://dev.to/mrrcollins/scheduling-and-automating-posts-in-a-hugo-site-25c2). I wipe out the `public` folder and then rebuild the site with Hugo. After that is done, the `public` folder is synced to the web host, using the `--delete` option. The problem arises if Hugo encounters an error. The site isn’t rebuilt but the now empty `public` folder is synced, wiping out the website.

The script now checks Hugo’s exit code, and will only sync if the code is `0`. I hope that helps someone!

```
#!/bin/bash

if ! command -v /snap/bin/hugo &> /dev/null
then
    echo "Hugo not found. Install with:"
    echo "sudo snap install hugo"
    exit
fi

cd /home/goz/Web/gozgeek.com/
echo "Building at `date`"

echo "Clear out public.."
[[-d "public"]] || mkdir "public"
rm -r public/*

echo "Building site..."
HUGO_ENV=production /snap/bin/hugo 

# If something goes wrong building the site, exit the script!
if [! $? -eq 0]; then 
    echo "Something is wrong..."
    exit
fi

echo "Set up some RSS stuff..."
mkdir public/feed
mkdir public/feed/podcast
cp public/posts/index.xml public/feed/
cp public/tags/podcast/index.xml public/feed/podcast/

echo "Adding build date..."
date > public/built.txt
hostname >> public/built.txt

echo "Uploading site..."
rsync -e ssh -avp --progress --delete public/ gozgeek:gozgeek.com/

```
Deploying App using Vercel
Published: 2021-05-11 14:33:58


### 1. Create yout account at [Vercel](https://vercel.com)


### 2. Install [vercel-cli](https://vercel.com/cli)

Use the package manager `node` or `yarn`:
```bash
npm i -g vercel
```
```bash
yarn global add vercel
```
*Obs.:* If choose `yarn`, add the [global path](
https://classic.yarnpkg.com/en/docs/cli/global/) to your `./bashrc` or `./zshrc` file.


### 3. Log in with your account through the terminal

At the end of the installation of `vercel-cli`, you can test it by typing` vercel -h` in the terminal.
After that, you must log into your Vercel account through the terminal, typing `vercel login` and follow the instructions.

![vercel login example](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uh1jf5cfzhfbchslgld3.png)
 

### 4. Deploy

To implement your project, just type `vercel` in the terminal, and follow the instructions. At the end, you will be informed of the link to your project hosted at Vercel.
After the first version of your project is deployed, if there are new changes to the project that you want to deploy as well, then you must use `vercel --prod`.

![vercel deploy image](https://www.deadbearcode.com/wp-content/uploads/2020/05/vercel-deploy-config-1024x262.png)

*Obs:* After the first deployment, the `vercel` command is used for testing and no longer for the actual deployment.


### 5. Linking to the Github project

To connect your Github / Gitlab project to the application's deployment, you must copy the link to your project hosted at Vercel (the one that was informed at the time of implementation) and open it in the browser.
Then go to `Settings > Git > Connect Git Repository`, and type in the name of your Github project.

![vercel github connection](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50nokselsos3ckcio315.png)
SpringBoot + PostgreSQL CRUD using Spring JPA tutorial
Tags: springboot, crud, springjpa, postgres
Published: 2021-05-11 14:28:35

https://loizenai.com/how-to-integrate-springboot-2-x-with-postgresql-database-using-spring-jpa/

SpringBoot + PostgreSQL CRUD using Spring JPA tutorial

How to integrate SpringBoot and PostgreSQL? It is the one of most common questions for developers. So in the post, I will help you to try it with Spring JPA. Here is a to do list for the tutorial:
<ul style="margin-left:20px" id="to-do-list-how-to-integrate-springboot-and-postgresql-using-spring-jpa-loizenai.com">
<li>Overview of Project Structure</li>
<li>Create SpringBoot with Spring Data JPA and PostgreSQL dependencies</li>
<li>Configuration SpringBoot to connect to PostgreSQL</li>
<li>Define a data model to map with table's columns in PostgreSQL database</li>
<li>Define a JPA Repository to do CRUD operations</li>
<li>Use CommandLineRunner to excute above JPA Repository APIs: save, retrieve, update, detele entities</li>
</ul>

To do the tutorial, you need prepare Java >= 1.8, Spring Tool Suite in local computer for development.

Let's go !
<!--more-->
<h2 id="video-guide-for-how-to-integrate-springboot-with-postgresql-database-tutorial">Video Guide</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/YosqvdsJ4aM?controls=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<h2 id="springboot-project-overview">SpringBoot Project Overview</h2>
[caption id="attachment_56" align="alignnone" width="378"]<img src="https://loizenai.com/wp-content/uploads/2020/04/Overview-How-to-Integrate-Springboot-2.x-with-PostgreSQL-using-Spring-JPA.png" alt="Overview-How-to-Integrate-Springboot-2.x-with-PostgreSQL-using-Spring-JPA" width="378" height="507" class="size-full wp-image-56" /> Project Overview How to Integrate Springboot 2.x with PostgreSQL using Spring JPA[/caption]

In the SpringBoot application, we use Spring JPA to connect and manipulate the data between Application and PostgreSQL database. We define a repository to do CRUD operations (save, retrieve, update, delete) with entities. And for mapping the data between Spring Application with database table's columns, we define a model class.
<h2 id="create-springboot-project">Create SpringBoot Project</h2>
We use Eclipse that had integrated with SpringToolSuite to create a SpringBoot project. Remember we need add 2 dependencies Spring Data JPA and PostgreSQL driver. 

Checking <code>pom.xml</code> file we see the needed dependencies as below:


More at:

https://loizenai.com/how-to-integrate-springboot-2-x-with-postgresql-database-using-spring-jpa/

SpringBoot + PostgreSQL CRUD using Spring JPA tutorial
Stuck with Class and Object in OOPS?
Tags: beginners, java, codenewbie, productivity
Published: 2021-05-11 14:22:14

The most basic and frequently asked question on Object Oriented Programming Paradigm in any interview. If you have mentioned about OOPS in your resume, then you are most likely to get hit by this question.

What is an __Object__.

Before diving into the definition let us consider an example. 
A pen is an object and it has a significant existence. It has many properties such as its color, size, smoothness and so on. Likewise, a car is also an object with a significant existence and has its own properties such as size, model, color and others.

So, an Object can be ‘anything’ around us. Be it a pen, a car, or anything which has a significant existence. Object must have some properties or attributes, which can help us differentiate one object from another. 

Technically, Object is a distinguishable entity with some attributes and behaviors. An Object is an instance of Class. 
Now, what is a __Class__.

Let us understand with an example. Before building a house, we need a plan or a design to build it properly. Likewise, here the house is an Object and the plan is the Class.

Technically, a Class is a container, which contains the contents of objects that belong to it.

An object is an instance(element) of a class.

In Java we use “new” keyword to create an object.

A code snippet is given, explaining class and object.
Amazing Image Slider Using Flickity & JS
Tags: html, css, javascript, webdev
Published: 2021-05-11 14:17:04

Today I created a simple Image Slider Using Flickity & JS. In this image slider, I use flickity and some jquery also to animate the slider. 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/oNZjdmg %}
How To Create A Simple Alert For An onbeforeunload Event (Closing Browser or Navigating Away From Page) [updated]
Tags: javascript, react, tutorial, webdev
Published: 2021-05-11 14:01:23

*edit: credit to Alex Lohr for suggesting to put the code inside a useEffect :)*

Here is a useful little snippet for if you have a page like a checkout or a survey and you want to warn people about leaving the page before they've completed it. 

```
  window.onbeforeunload = (event) => {
    if (whatever your condition is here) {
      return true;
    }
  };


// inside a useEffect:
useEffect(() => {
  if (conditionState) {
    const listener = () => true
    window.addEventListener('beforeunload', listener)
    return () => window.removeEventListener('beforeunload', listener)
  }
}, [conditionState])


// the return here removes the eventListener, until next time the useEffect runs again 
```

The alert gives the user the option to confirm or cancel their navigation. Alerts should never stop someone from leaving a page or closing their browser though; that's a big no-no.

![An example of a browser alert](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eotwcxupmnjioicharbi.PNG)

An onbeforeunload event occurs when the document (the current page of your site/application) is about to be unloaded (closed/exited). A example of this would be someone closing the browser window or clicking a link to a different page.

Most browsers will show a default message like "changes you've made will not be saved". You can't edit this message, but it does the job as a warning. Due to this, you don't need to return any specific content or message in the function, just return true in order for it to work. 

This function will be called when an onbeforeunload event occurs. If the condition inside is met, then the function will return true and the alert will be shown. So all you need to do is apply a condition to decide when the alert will be shown. For example, if using this in a React application, then the condition could be based on a certain state. 

There are other ways of achieving this sort of behaviour, such as using Prompt in react-router, but if you're just looking for a simple solution then I hope this helps! If you have anything to add, please leave a comment.
How I've went from WebStorm payer to a VS code player.
Tags: webdev, vscode, webstorm
Published: 2021-05-11 13:57:58

When I started doing web development I was heavily told to use [VS Code.](https://code.visualstudio.com/), From the start i hated it and found it very hard to navigate the tool and very _oh just install a plugin for things you need._ Then I heard of the tool by [Jetbrains](jetbrains.com) called WebStorm! Brought a licence and then used for a year then bang, _your licence has expired._ Then i went back to VS code and it was acctully better!

### _the end_
How to use Java 8 Stream Map Examples with a List or Array
Tags: java8, array, stream
Published: 2021-05-11 12:29:54

https://ozenero.com/how-to-use-java-8-stream-map-examples-with-a-list-or-array

How to use Java 8 Stream Map Examples with a List or Array

[no_toc]
Converting or transforming a List and Array Objects in Java is a common task when programming. In the tutorial, We show how to do the task with lots of Java examples code by 2 approaches:
<ul>
<li>Using Traditional Solution with basic Looping</li>
<li>Using a powerful API - Java 8 Stream Map</li>
</ul>

Now let's do details with examples!

Related posts:
- <a href="https://ozenero.com/java-tutorial/java-8">Java 8</a>
- <a href="https://ozenero.com/java/java-8-streams">Java 8 Streams</a>

<!--more-->
<h2>Java Transform a List with Traditional Solution by Looping Examples</h2>
Before Java 8, for mapping a List Objects, we use the basic approach with looping technical solution.
<h3>Looping Example - Java Transform an Integer List</h3>
- Example: How to double value for each element in a List?

<pre><code class="language-java">
package com.ozenero.stream;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class StreamMapExamples {
	public static void main(String[] args) {
		List<Integer> intLst = Arrays.asList(1, 2, 3, 4);
		
		// How to double value for each element in a List
		// n -> n*2
		
		List<Integer> newLst = new ArrayList<Integer>();
		
		for(int i : intLst) {
			newLst.add(i*2);
		}
		
		System.out.println(newLst);
		// [2, 4, 6, 8]
	}
}</code></pre>
<h3>Looping Example - Java Transform a String List</h3>
- Example: How to uppercase string value for each element in a String List?

More at:

https://ozenero.com/how-to-use-java-8-stream-map-examples-with-a-list-or-array

How to use Java 8 Stream Map Examples with a List or Array
Why did you get into coding? Did you really want to code?
Tags: discuss, watercooler, beginners
Published: 2021-05-11 13:43:03

I ask this question because from my own experience, thinking back to when I started I am beginning to feel like I really wanted in on the developer community (particularly Rails) and the lifestyle (being able to work anywhere). 

I wanted friends that were dev’s as they always came across as some of the nicest people on earth. 

I also wanted to have readability of code before I actually felt comfortable writing code, I thought that looking at a method and being able to figure out what it’s manipulating, and how, would be really cool.

Is that odd? Wanting to get into code without having a massive urge to write it?

I wasn’t disappointed btw, the friends I have made in the dev community have proved to be some of the kindest, helpful, thoughtful, supportive and deep thinking, principled humans I could have ever wished for.

Being able to read code (as well as write it) has also turned out to be really cool 😎 

How’s about you? We’re there things that pulled you into a Dev life that has nothing to do with code, but now your coding?
Why use a css framework when you can use vanilla css?
Tags: css, bootstrap, libary, readthis
Published: 2021-05-11 13:08:49

### Using a CSS framework for projects is quite common these days whether it be big projects or small side projects but why do dev's use a CSS framework anyway

While making a website, it is a tough job to make headers/navbars with minor feature like disappearing it on mobiles and making a menu instead, handle pads and tablets screen sizes, dropdowns so talking about these we come to our first point
- Premade features for easy use and faster development times
though implementing a normal feature like a login page might be easy and quick, adding elements like errors and dialog boxes might be a long and time-consuming task especially dealing with edge cases like overlapping on different screen sizes, messed up animations.

- Huge community/organization support for bug fixes, and implementation for many browsers, screen sizes over the years the framework has existed, that means you can get relieved for common problems in older browsers

- Help to learn CSS , just getting started with CSS and styling , well it takes a lot of time to learn CSS and proper styling of webpages, you might not know about flex boxes and the new grid layout, well the CSS framework already the easier way to implement it

- They come with documentation. If you need help getting started, the framework generally comes with some support files. This can be particularly nice if you are designing a site you will be handing off to a client. You can just let them know what framework you used and refer them to that documentation for support requests.
Crossposting to dev.to Made Easy
Tags: watercooler, discuss, markdown, beginners
Published: 2021-05-11 12:59:16

Do you often write your articles on Google Docs, Notion or Medium and then have to manually convert it to markdown to post on dev.to?

If yes, then checkout [Paste to Markdown](https://euangoddard.github.io/clipboard2markdown/). Simply paste any text and it will be converted to markdown along with proper formatting!
User Defined Function In C
Published: 2021-05-11 12:46:10

C programming language allows coders to define functions to perform special tasks. As functions are defined by users, they are called user-defined functions.

user-defined functions have contained the block of statements which are written by the user to perform a task

function has three related elements, in order to establish the function

Function declaration
function call
Function definition

>EXAMPLE:
include <stdio.h>
include <stdlib.h>
int sumNum(int x,int y); //function declaration
int main()
{
    int i,j,sum;
    printf("Please enter 2 numbers for find sum\n");
    scanf("%d %d",&i,&j);
    sum=sumNum(i,j); //function call
    printf("The result of sum is :%d",sum);
    getch();
    return 0;
}
int sumNum(int x, int y)//function definition
{
    int result;
result=x+y;
return result; //return statements
}

#Declaration of the user-defined function.

A function declaration is a frame (prototype)of function that contains the function’s name, list of parameter and return type and ends with the semicolon. but it doesn’t,t contain the function body

 

Syntax

return_Type function_Name(parameter1,parameter2,......);

>Example

int  sum_Num(int x, int y,.........);

#Calling a function

Syntax

function_Name(Argument list);

>Example

sum_Num(argument_1, argument_2,.......);

#Function Definition
The function definition is an expansion of function declaration. It contains codes in the body part of the function for execution program by the compiler – it contains the block of code for the special task

 Syntax:

return_Type function_name(parameter_1, parameter_2,....){
//statements
//body of the function
}

#Return statements:

Return statements terminate the execution of the function and return value to calling the function. Also, return statements control of the program control and moved to the calling function.

Syntax

return (expression);

>Example

return (result);
return (x+y);

>Example

include <stdio.h>
include <stdlib.h>
int division(int x,int y); //function declaration or prototype
int main()
{
    int i,j,div;
    printf("Please enter 2 numbers for division\n");
    scanf("%d%d",&i,&j);
    div=division(i,j); //function call
    printf("The result of division is :%d",div);
    getch();
    return 0;
}
int division(int i, int j)
{
    int result;
result=i/j;
return result; //return statements
}
Manual RDS Backups save the day
Tags: uncategorized, backup, cloud, otc
Published: 2023-05-19 20:39:45

---
title: Manual RDS Backups save the day
published: true
date: 2021-05-11 12:38:00 UTC
tags: Uncategorized,backup,cloud,otc
canonical_url: https://www.zufallsheld.de/2021/05/11/manual-rds-backups-save-the-day/
---

Suppose you run a database as a service (DBaaS) for example in Azure. You have automated backups configured in case something bad happens. However these backups do not save you against a accidental database deletion as the backups get deleted, too!

Then there’s the Open Telekom Cloud (OTC). The DBaaS there have the same problem. If you delete a database there, the backups get deleted, too. However only the automatically created ones get deleted, not the manually created ones. You can use this feature to save yourself (partially) from accidental deletion of databases. Just create some script or automation that peridocally creates (and deletes) “manual” backups!
Bulk SMS Provider in Tanzania
Tags: sms, bulksms, vendors
Published: 2021-05-11 12:36:29

## Key areas of concern

- Price
- Integration/Development experience
- Documentation
- Up time
- Time required to successfully register Sender ID

### Other areas

We won't be looking into these at this scope

- API limits
- Auth strategy

## Key Providers

Without any order

- AfricasTalking
- NextSMS
- Beem africa

### [AfricasTalking](https://africastalking.com/)

#### Pricing Plans

| Tier                | Price         | Plan Name  |
| ------------------- | ------------- | ---------- |
| 0 - 499,999         | TZS 22        | Basic Plan |
| 500,000 - 2,499,999 | TZS 20        | Plus Plan  |
| 2,500,000+          | Contact Sales | Max Plan   |

#### Integration/Development experience

- Plenty of Official SDK's for all major languages and frameworks

#### Documentation

- Well documented

#### Up time

- 99%

#### Time required to successfully register Sender ID

- A week / 5 business days

### [NextSMS](https://nextsms.co.tz/)

#### Price

| Plan name | Price         | Tier                |
| --------- | ------------- | ------------------- |
| PACKAGE A | 16 TSH /sms   | 1 or more SMS       |
| PACKAGE B | 15 TSH /sms   | 6,000 or more SMS   |
| PACKAGE C | 14 TSH /sms   | 55,000 or more SMS  |
| PACKAGE D | 13 TSH /sms   | 110,000 or more SMS |
| PACKAGE E | Contact Sales | 500,001 or more     |

#### Integration/Development experience

- A week / 5 bussiness days

#### Documentation

- Only API endpoints are documented

#### Up time

- 99%

#### Time required to successfully register Sender ID

- A week / 5 business days

### [Beem africa](https://sms.beem.africa/)

#### Price

| Tier           | Price  |
| -------------- | ------ |
| 1 - 1000       | TZS 25 |
| 1001 - 2500    | TZS 23 |
| 2501 - 5000    | TZS 22 |
| 5001 - 10000   | TZS 20 |
| 10001 - 25000  | TZS 19 |
| 25001 - 50000  | TZS 18 |
| 50001 - 100000 | TZS 17 |

#### Integration/Development experience

#### Documentation

#### Up time

- 99%

#### Time required to successfully register Sender ID

- A week / 5 business days

<br><br>

## Disclaimer

- All Data was retrieved on May, 11 , 2021 from official websites, Am not affiliated with any vendor mention.