teleren/devto huggingface dataset:
Benefits Of BPS-5 Supplement
Published: 2022-04-13 04:57:41

It once-in-a-lifetime opportunity to get it for a cheap price. I gave up on my [BPS-5](https://ipsnews.net/business/2021/07/22/bps-5-golden-after-50-blood-pressure-control-formula-fake-or-real-truth-explode/) near the beginning of last year. It is a fluke. The counterattack on doing it has started. Let's pretend that there was somewhere you could go to in order to learn everything with reference to doing it. You might have to have your BPS-5 ready. You need to locate the best BPS-5 without worrying too much touching on the cost. Here are four suggestions for how to bring doing it back from the brink. I was stunned at how this happened to me. 

It's genuine. It is easy to use. To what degree do colleagues gobble up exceptional [BPS-5 Supplement](https://twitter.com/bps5buy)? You can get counselors excited. That is an immovable truth. I'll fix your little red wagon. Your disquiet is noted but I sort of disown that intelligent feeling. Why would you read stupid stuff on the Internet anyhow? The type of BPS-5 you need completely depends on your taste and preference. I collaborated with them on it. I am inclined to suspect this category is the complication. It is something you may expect germane to BPS-5.

Visit Here Official Website----  https://ipsnews.net/business/2021/07/22/bps-5-golden-after-50-blood-pressure-control-formula-fake-or-real-truth-explode/
View Now Twitter----  [https://twitter.com/bps5buy](https://twitter.com/bps5buy)
[https://bumppy.com/tm/read-blog/9314_bps-5-100-powerful-natural-price-ingredients-does-it-really-work.html](https://bumppy.com/tm/read-blog/9314_bps-5-100-powerful-natural-price-ingredients-does-it-really-work.html)
[https://corosocial.com/read-blog/32157_https-ipsnews-net-business-2021-07-22-bps-5-golden-after-50-blood-pressure-contr.html](https://corosocial.com/read-blog/32157_https-ipsnews-net-business-2021-07-22-bps-5-golden-after-50-blood-pressure-contr.html)
[https://bps-5offer.company.site/](https://bps-5offer.company.site/)
[https://bps-5offer.mystrikingly.com/](https://bps-5offer.mystrikingly.com/)
[https://www.beatstars.com/bpsxoffer/about](https://www.beatstars.com/bpsxoffer/about)
Menghitung Selisih Antara Dua Tanggal Dengan Php
Tags: php, beginners, webdev
Published: 2022-04-13 04:08:09

Tutorial ini akan menunjukan bagaimana cara menghitung selisih antara dua tanggal di php.

Disini kita akan menggunakan dua cara ,yang pertama menggunakan **strtotime** dan kedua menggunakan fungsi **diff()**.

Cara Pertama.

```php
<?php 
$tgl1 = strtotime("2020-01-01"); 
$tgl2 = strtotime("2020-01-20"); 

$jarak = $tgl2 - $tgl1;

$hari = $jarak / 60 / 60 / 24;
echo $hari;
?>
```

Cara pertama ini kita mengkonversi kedua tanggal menjadi detik dengan fungsi **strtotime** ,kemudian mengurangkan keduanya ,terakhir kita konversi detik.Untuk contoh diatas kita konversi menjadi hari.

Sekedar catatan strtotime hanya mencakup mulai dari tanggal 1 Januari 1970,jadi kurang cocok untuk menghitung umur jika dibawah tanggal tersebut.

Cara Kedua
```php
<?php 
$tgl1 = new DateTime("2020-01-01");
$tgl2 = new DateTime("2020-01-20");
$jarak = $tgl2->diff($tgl1);

echo $jarak->d;
?>
```

Untuk cara kedua kita menggunakan fungsi **diff()**,fungsi **diff()** memiliki beberapa keluaran seperti contoh diatas kita menggunakan **->d** untuk hari.Untuk yang lain bisa dilihat dibawah:

1. **d** untuk selisih hari.
2. **m** untuk selisih bulan.
3. **y** untuk selisih tahun.
4. **h** untuk jam.
5. **i** untuk menit.
6. **s** untuk detik.
7. **invert** bernilai 0 atau 1,0 jika tanggal yang dikurangkan lebih kecil dari tanggal pengurang begitu juga sebaliknya.
8. **days** untuk menghitung total selisih hari.

Jika dilihat **d** dan **days** sama-sama menunjukan selisih hari,bedanya **days** mengeluarkan total jadi kalau kita menggurangkan **2020-02-2020** dengan **2020-01-01** maka akan keluar **50**,kalau menggunakan **d** akan tetap mengeluarkan **19**.

Sekian tutorial kali ini jika ada yang kurang dipahami,silahkan tanyakan dibawah.
Less verbose, better maintenance
Tags: go, rest, api, refact
Published: 2022-04-13 04:05:19

**All the codes that you will see in this post you can check [here](https://github.com/MAAARKIN/hero-api-golang/tree/step-4)**

In the last post we delivered the content to response in our controller but the code it's not too readable. In this post, we will refact the code to be more readable and easy to deliver our content.

Inside cmd/http folder we will create a new folder called helper. This package will group functions to help the http layer to deal with request and response that will be used by any other handler in our project.

First of all, lets refact our book handler in cmd/http/book.go and see how our getAll will be

```go
func (h *BookHandler) getAll(w http.ResponseWriter, r *http.Request) {
    if results, err := h.bookService.FindAll(); err != nil {
        helper.HandleError(w, err)
    } else {
        if results != nil && len(*results) > 0 {
            helper.JsonResponse(w, results, http.StatusOK)
        } else {
            helper.NoContent(w)
        }
    }
}
```

Now the helper will help us to deal with error and with the response data.

In the helper package we will create a response.go and will move the addDefaultHeaders and writeData presents in book handler to our response.go file.

3 - We will start to the more easy method here, the NoContent function.

```go
//cmd/http/helper/response.go
//...
func NoContent(w http.ResponseWriter) {
	addDefaultHeaders(w)
	w.WriteHeader(http.StatusNoContent)
}
```
We just will add the default headers and send a Header to No Content Status.

2 - We will write the json data to response

```go
//cmd/http/helper/response.go
//...
func JsonResponse(w http.ResponseWriter, data interface{}, httpStatus int) {
	addDefaultHeaders(w)
	w.WriteHeader(httpStatus)
	writeData(w, data)
}
```

Again, we just move the boilerplate code to write data to a new function in helper package.

1 - Now, we will refact our error method to improve the process.
```go
//cmd/http/helper/response.go
//...
func HandleError(w http.ResponseWriter, err error) {
	addDefaultHeaders(w)
	httpError := DealWith(err)
	w.WriteHeader(httpError.Status)

	if httpError.Status != http.StatusNoContent {
		writeData(w, httpError)
	}
}
```

look that we have a new method called DealWith this method will check if the error is a registered error or an unexpected error to our application.

At the moment we will create an error.go inside helper folder to create the DealWith method for our code works without any error.

```go
//cmd/http/helper/error.go
//...
type HttpError struct {
	Status      int      `json:"-"`
	Description string   `json:"description,omitempty"`
	Messages    []string `json:"messages,omitempty"`
}

func DealWith(err error) HttpError {

	return HttpError{
		Status:      http.StatusInternalServerError,
		Description: "Internal error, please report to admin",
	}
}
```

In the next post we will describe the DealWith method to know a better way to produce errors in http layer.
Setting up YOLO with Darknet
Tags: tutorial, beginners, deeplearning, machinelearning
Published: 2022-04-13 04:04:40

## Introduction

Hello! In this tutorial I will show you how to setup YOLO with Darknet.

---

## What is YOLO?

YOLO (You Only Look Once) is a single stage detector that is popular due to it's speed and accuracy, it has been used in various applications to detect people, animals, traffic signals etc.

There are other object detectors such as R-CNN however, they are not as reliable as YOLO.

In this tutorial we will be building YOLOv3, v3 is significantly larger than previous models but it is the best one to use.

---

## What is Darknet?

Darknet is an open source neural network framework written in C and CUDA. It is fast, easy to install, and supports CPU and GPU computation.

---

## Setting up YOLO with Darknet

First we need to install darknet

```bash
git clone https://github.com/pjreddie/darknet && cd darknet
make
```

Next we need to download the pre-trained weights

```bash
wget https://pjreddie.com/media/files/yolov3.weights
wget https://pjreddie.com/media/files/yolov3-tiny.weights
```

Or you can use the following bash script:
https://gist.github.com/ethand91/62ec891bf30ba38ab47553e4952057e8

Now we can try out the detector on the sample images provided in the repository.

```bash
./darknet detector test cfg/coco.data cfg/yolov3.cfg yolov3.weights data/horses.jpg
```

If all goes well you should see the predictions in the terminal, there will also be a file called "predictions.jpg" which when opened should look something like the below image:

![Sample](https://i.ibb.co/CwvbHdV/result.jpg)

---

## Making the detection faster with GPU

You can get the same results but with much faster time by enabling the GPU flag.
To do this just modify the Makefile.

```bash
GPU=1
```

Then rerun make

```bash
make
```

---

## Conclusion

In this tutorial I have shown how to setup Yolo with Darknet. 
I am currently interested in yolov4 👀

If you have any cool sample/projects please share. 😃

---

Like me work? I post about a variety of topics, if you would like to see more please like and follow me.
Also I love coffee. 

[![“Buy Me A Coffee”](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/ethand9999)
Nextjs Typescript Starter Template
Tags: nextjs, typescript, template, starter
Published: 2022-03-31 16:11:38

### Table of Contents

[Tech Stack](#tech-stack) 
[Project Setup](#project-setup) 
[Config Files](#config-files)

### Tech Stack

1. next.js
2. typescript
3. yarn
4. husky
5. prettier
6. eslint

---

### Project Setup

```bash
yarn create next-app --typescript
modify .gitignore
yarn add --dev @typescript-eslint/eslint-plugin
yarn add --dev prettier eslint-config-prettier
touch .eslintrc.json .prettierrc.json .prettierignore
npx husky-init && yarn
modify package.json (scripts)
modify .husky/pre-commit
# yarn commands
yarn lint
yarn build
yarn prettier-check
yarn prettier-fix
yarn dev
```

### Config Files
Opinionated configurations, modify it as you see fit.

> .eslintrc.json

```json
{
  "plugins": ["@typescript-eslint"],
  "extends": [
    "next/core-web-vitals",
    "plugin:@typescript-eslint/recommended",
    "prettier"
  ],
  "rules": {
    "@typescript-eslint/no-unused-vars": "error",
    "@typescript-eslint/no-explicit-any": "error"
  }
}

```
> .prettierrc.json
```json
{
  "singleQuote": true,
  "semi": false,
  "tabWidth": 4
}
```

> .prettierignore

```text
node_modules
**/.next/**
**/_next/**
**/dist/**
packages/next/bundles/webpack/packages/*.runtime.js
packages/next/bundles/webpack/packages/lazy-compilation-*.js
packages/next/compiled/**
packages/react-refresh-utils/**/*.js
packages/react-refresh-utils/**/*.d.ts
packages/react-dev-overlay/lib/**
**/__tmp__/**
lerna.json
.github/actions/next-stats-action/.work
packages/next-swc/crates/**/*
packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts
test-timings.json
test/**/out/**
bench/nested-deps/pages/**/*
bench/nested-deps/components/**/*
```

> .gitignore

```text
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# vscode workspace setting
.vscode
```

> package.json

```json
"scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "prepare": "husky install",
    "prettier-check": "prettier --check .",
    "prettier-fix": "prettier --write ."
}
```
Lazy loading Web Components with WebPack in 1 minute
Tags: webcomponents, webpack
Published: 2022-04-13 03:10:45

Normally when you define a web component with Lit or FAST you might do something like this:

```typescript
import { MyComponent } from "./MyComponent";

MyComponent; // Stop tree-shaking
```

As part of importing the module, it defines the `<my-component>` element that you want to put in DOM.

That works just fine but now that web component's Javascript is part of the same bundle as whatever was calling it. What if it's just some dialog picker that rarely gets called, or always called far after the main page load?

Just run this line when you need to show that component. 

```typescript
await import("./MyComponent ");
```

Webpack will see that it's a dynamic import, create a new bundle for it and download it when the code is run. That will define `<my-component>` and automatically upgrade any of them you have in your DOM already.

I was rather shocked with how easy it was to do. Just remember that if what you are loading in needs to be tree-shaken you'll need to [create an intermediate "lazy" module to help Webpack do that](https://medium.com/@christiango/the-unexpected-impact-of-dynamic-imports-on-tree-shaking-ddadeb135dd7).
Laravel whereHas and orWhereHas Query Example
Tags: laravel, php, laravel8, mysql
Published: 2022-04-13 03:04:46

In this tutorial, we will see laravel whereHas and orWhereHas query example. whereHas and orWhereHas query used in laravel for relationships. So, here I will give you an example of how to use wherehas in laravel, wherehas eloquent in laravel 8 work same as has() function.

has() is to filter the selecting model based on a relationship. So it acts very similarly to a normal WHERE condition. If you just use has('relation') that means you only want to get the models that have at least one related model in this relation. whereHas() works basically the same as has() but allows you to specify additional filters for the related model to check.

So, let's see the laravel whereHas and orWhereHas query example, Also you can use whereHas and orWhereHas in laravel 6, laravel 7, and laravel 8.

Example 1 :

```
$posts = Post::whereHas('comments', function (Builder $query) {
    $query->where('content', 'like', 'code%');
})->get();
```
 
Example 2 : 

```
$users = User::whereHas('posts', function($q){
    $q->where('created_at', '>=', '2021-01-01 00:00:00');
})->get();
// only users that have posts from 2021 on forward are returned
```

---- 
You might also like :

- **_[Read Also: Laravel whereIn and whereNotIn Query Example](https://techsolutionstuff.com/post/laravel-wherein-and-wherenotin-query-example)_**

- **_[Read Also: Laravel 8 Database Seeder Example](https://techsolutionstuff.com/post/laravel-8-database-seeder-example)_**

- **_[Read Also: CRUD Operation In PHP](https://techsolutionstuff.com/post/crud-operation-in-php)_**
Design Pattern in TypeScript: Strategy Pattern
Tags: javascript, designpattens
Published: 2022-04-13 03:01:09

### Definition - Design Patterns
**_According to [Christopher Alexander](https://en.wikipedia.org/wiki/Christopher_Alexander)_**- _Each Pattern describes a problem that occurs over and over again in our environments, and then describes the core solution to that problem, in such a way that you can use this solution as a million times over without doing it the same way twice_

The only _difference_ between the patterns described by Christopher Alexander and the patterns in the case of computer language is that he expresses solutions in terms of _**Walls and doors**_ Whereas we express them in terms of _**Objects and Interfaces**_


A pattern has 4 essential elements:

1. The Pattern Name
2. The problem
3. The Solution
4. The Consequence

What Design Patterns are not:

1. designs that are encoded or added into the classes and reused as is like Trees, Stacks ...
2. Nor are they complex,domain-specific designs for an entire applications or subsystems

**_WHAT DESIGN PATTERNS DO SOLVE ON THE OTHER HAND ARE COMMUNICATION BETWEEN OBJECTS AND CLASSES THAT ARE CUSTOMIZED TO SOLVE A GENERAL DESIGN PROBLEM IN A PARTICULAR CONTEXT_**

- It names, abstracts, and identifies the key aspects of a common design structure that makes it useful for creating a reusable object-oriented design

---
The first design pattern we are going to discuss is the **_[strategy Pattern](https://en.wikipedia.org/wiki/Strategy_pattern)_**

#### Defination - STRATEGY
Define a family of algorithms, encapsulate each one and make them interchangeable. Strategy lets the algorithm vary independently from the client that uses it.

THE STRATEGY PATTERN COMES UNDER THE CLASS OF BEHAVIORAL PATTERN - Behavioral design patterns are concerned with algorithms and the assignment of responsibilities between objects.


#### **_Also know as Policy_**

Many algorithms exist for breaking a stream of text into lines

How to identify Strategy patterns:
1. there are multiple algorithms that will be needed at different times we do not want to support multiple algorithms using line breaking/conditionals
2. it is difficult to accommodate change when implemented using line breaks and conditionals

When to use Strategy pattern:
1. many related classes differ only in their behavior. Strategies provide a way to configure a class with one of many behaviors.
2. you need different variants of an algorithm
3. an algorithm uses data that clients should not know about
4. a class defines such behavior and these appear as multiple conditional statements in an operations

Different actors in strategy:
- Strategy
   declares an interface common to all supported algorithms. Context uses the interface to call the algorithm defined by a ConcreteStrategy
- ConcreteStrategy
   implementation of the algorithm using the Strategy interface
- Context
   maintains a reference to the strategy object


![Folder Structure](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z42wv9gsa36przbfw4y1.png) 

Refer to the following for the code:

{% embed https://stackblitz.com/edit/typescript-uhdd8n?embed=1&file=index.ts %}
NextJs UUID
Tags: nextjs
Published: 2022-04-13 02:35:04

I'm trying this
`
import { randomUUID } from 'crypto'
var id = randomUUID()
`
in my NextJs app but I'm getting this error:

index.js?46cb:369 Uncaught TypeError: (0 , crypto__WEBPACK_IMPORTED_MODULE_5__.randomUUID) is not a function
    at eval (index.js?bee7:8:20)
    at Module../pages/index.js (index.js?ts=1649816623582:5680:1)
    at Module.options.factory (webpack.js?ts=1649816623582:618:31)
    at __webpack_require__ (webpack.js?ts=1649816623582:37:33)
    at fn (webpack.js?ts=1649816623582:287:21)
    at eval (?595a:5:16)
    at eval (route-loader.js?ea34:235:51)

it seems like the crypto library is available to middleware in NextJs (though it should be available at the browser) but that seems complicated to implement.  can anyone suggest how to generate a UUID in NextJs?
Testing methodology
Published: 2022-04-13 02:24:59

We can categorize testing activities into two, 1) Functional Testing and 2) Non Functional Testing. In **functional testing** we do unit testing, integration testing, system testing and acceptance testing. Whereas in **non functional testing** we test for performance, security, usability and compatibility. 

## Unit Testing

## Integration testing

## System testing

## Acceptance testing

Non-Functional Testing

Performance testing
Security testing
Usability testing 
Compatibility Testing

This post is a work in progress item
Elegir la protección adecuada contra el desgaste para las herramientas de excavación
Published: 2022-04-13 02:24:25

Oerlikon Metco personaliza las aleaciones de recargue para aplicaciones y procesos específicos con el fin de proteger las excavadoras para aplicaciones de minería y construcción.

Las herramientas de excavación (GET) a menudo se ven comprometidas porque se desgastan por el ranurado, la abrasión y/o el impacto, lo que provoca que pierdan su funcionalidad y, en última instancia, fallen. El recargue aplicado por soldadura o revestimiento protege a los GET; sin embargo, hay consideraciones a la hora de elegir la solución de recargue adecuada para maximizar la producción y minimizar los costes.

Oerlikon Metco es el creador de mercado de nuevos y revolucionarios materiales de recargue desarrollados con el sistema patentado Scoperta™ Rapid Alloy Computational Design Process. El enfoque de grandes datos permite el diseño de aleaciones únicas adaptadas tanto al rendimiento en entornos específicos como a la aplicación mediante procesos específicos. De este modo, se pueden desarrollar soluciones de recargue que aborden simultáneamente aspectos como la sensibilidad a la fisuración, la abrasión, el impacto, la soldabilidad y el coste de aplicación. "Estas nuevas tecnologías de materiales proporcionan una mejora significativa en el rendimiento operativo y son el futuro del mantenimiento de la sostenibilidad", afirma Adolfo Castells, Director del Segmento de Aplicaciones, Hardfacing.

Para los GETs, Oerlikon Metco ha desarrollado una familia de soluciones que puede hacer frente a condiciones de funcionamiento muy específicas, mejorando así el rendimiento y la vida útil de los GETs de forma significativa en comparación con las soluciones de recargue tradicionales.

En algunos casos, la mejora de la vida útil puede ser de hasta un 30% - 200%. Además, estas soluciones ya han sido probadas en el campo por los operadores de GET, en particular las grandes GET utilizadas en operaciones de minería a cielo abierto. Los productos están disponibles para su aplicación mediante soldadura por arco, revestimiento láser o PTA.

[Leer Mas...](http://orientarioja.com)