teleren/devto huggingface dataset:
Parameterized testing in Deno
Tags: deno, testing, typescript, javascript
Published: 2021-09-21 06:33:54

I'd like to share a simple function I wrote for parameterized test in [Deno](deno.land).

One of the things I like about Deno is that the developers are building in a lot of boilerplate tooling into the runtime. This reduces a lot of the code that seems to come along by default with node projects. A mid-sized node project can easily have a dozen or so primary dependencies supporting testing, and many more transitive dependencies. 

Deno, on the other hand, only has one function related to testing in the runtime api (Deno.test, to register tests), and a small handful of assertions in the standard library. It's all you _really_ need, but sometimes the extras can be nice.

Like parameterized tests. If you haven't used a test library that supports them, parameterized tests are basically just a syntactic sugar for running the same test case on different inputs. [For example, Jest's .each function](https://jestjs.io/blog/2018/05/29/jest-23-blazing-fast-delightful-testing#jest-each).

To achieve something similar in Deno, give this a try (I called it 'each' as well, for lack of a better name):
```
function each<T>(params: Record<string, T>, cb: (p: T) => void) {
  Object.keys(params).map(title => {
    Deno.test(title, () => { cb(params[title]) });
  });
}

```
Calling it looks like this:
```
import { assertEquals } from "https://deno.land/std@0.107.0/testing/asserts.ts";
each<[number[], number]>(
  {
    "1 + 2 + 3 == 6":     [[1, 2, 3], 6],
    "-1 + -2 + -3 == -6": [[-1, -2, -3], -6],
    "1 + 1 == 2":         [[1, 1], 2],
    "10 + 9 + 8 + 7 == ": [[10, 9, 8, 7], 34],
  },
  ([vals, expected]) => {
    const actual = vals.reduce((a,b) => a + b);
    assertEquals(expected, actual);
  }
);
```

Hopefully this can be helpful to someone, at least until more comprehensive testing features are added to the Deno runtime. You can read some of the ongoing discussion around a new test related api [here](https://github.com/denoland/deno/discussions/10771).
Where do you host your PostgreSQL?
Tags: watercooler, database, postgres, hosting
Published: 2021-09-21 06:30:54

---
title: Where do you host your PostgreSQL?
published: true
description: 
tags: watercooler, database, postgresql, hosting
cover_image: https://assets-global.website-files.com/5f0f11d97d85ed44697a5e23/5f32c1065e3fe18545245e9b_tips-postgresql-arrays_header.png
---
The hosting of the data can get expensive. For larger projects, you will most likely end up paying for the database (unless you host the database on your own machine).

I'm looking for some DBaaS options for PostgreSQL. Ideally pay-for-what-you-use services (no fixed costs for a plan) with great scalability options.

By the research I've done, I'm aware of:

* [Heroku PostgreSQL](https://devcenter.heroku.com/articles/heroku-postgresql), which offers pretty limited free tier, like 10k records or so.
* [Google Cloud SQL](https://cloud.google.com/sql/postgresql) or [Amazon RDS](https://aws.amazon.com/rds/postgresql/), including their free tier for a year.
* Self-hosting on $6 [DigitalOcean droplet](https://www.digitalocean.com/products/droplets/) or similar services.

What are some of the most cost-effective PostgreSQL hosting solutions that you use and would recommend?
HTML tags | table
Tags: html, tags, table
Published: 2021-09-21 06:26:15

It is used to **represent tabular data**, that is, information presented in a two-dimensional table made up of rows and columns of cells that contain data.

**It currently has no attributes**, other than global ones, since they are all deprecated.

The elements it can contain are, in this order:

1. An optional `<caption>` element
2. Zero or more `<colgroup>` elements
3. An optional `<thead>` element
4. Any of the following:
  * Zero or more `<tbody>` elements
  * One or more `<tr>` elements
5. An optional `<tfoot>` element

Has an **implicit ARIA role** `table`

**Providing a** `<caption>` **element** clearly and briefly describing the purpose of the table helps users of some assistive technologies decide whether to read the rest of the content of the table or skip it. It is important to **make good use of the** `scope` **attribute** in the `<th>` so that the table is readable for these same users.

There are times when certain assistive technologies may have trouble parsing and interpreting tables if they are too complex, especially when using `colspan` and `rowspan`. **In those cases it is usually better to try to separate that table into a set of smaller related tables** so that these attributes do not have to be used. That will benefit not only users of assistive technologies, but people with cognitive problems. If it cannot be separated, a combination of `id` and `headers` will have to be used to associate each data cell with its corresponding header cell.

- Type: *table*
- Self-closing: *No*
- Semantic value: *No*

[Definition and example](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/table) | [Support](https://caniuse.com/mdn-html_elements_table)
Alexander Zingman Says Belarus Agriculture Deal Will Boost Zimbabwe's Food Security

Published: 2021-09-21 06:13:43

Zimbabwe's Honorary Consul to Belarus Alexander Zingman said an ambitious $58 million deal between the two countries will revolutionalise Zimbabwe's agriculture industry. The first batch of modern farm machinery has been shipped to Harare, including 20 grain harvesters for grain and maize, 100 tractors, and 52 seed drills, with the second batch expected by December.

"This deal brings Belarusian expertise in agriculture and engineering to Zimbabwe. Both countries have been expanding ties since 2015 and this deal is a win-win for both," said Alexander Zingman.

Read More here :  https://markets.businessinsider.com/news/stocks/alexander-zingman-says-belarus-agriculture-deal-will-boost-zimbabwe-s-food-security-1029340434
React JS Netflix Clone??
Published: 2021-09-21 06:12:46

# Do you wanna create NETFLIX clone using React??
check this link
[video link](https://youtube.com/playlist?list=PLwgM1ly3fmki4Tt8nj87Ow67lf0C-WwHa)


So  I have created a video where you can learn concepts like 
react js state,useState hook ,useEFFECT hook and api calling via a simple project do check that
My first Chrome Extension .
Tags: javascript
Published: 2021-09-21 06:05:33

So, I was getting bored of making websites and then I decided to make a chrome extension.

##The folder structure 

![folders](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/z2w53l7egay60b5ckcfs.PNG)

##The Manifest file 

![manifest](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f0th8z1bec4vx2784lbe.PNG)

This file is a special file. It contains the information about the chrome extension. It is a .json type file.

It must mandatorily contain:

1.The Manifest version
2.The name of the extension.
3.The version of the extension. 

##The HTML file

A container div and an unordered list for the list of jokes.

![index](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atr32fqnb8zhv5kf296y.PNG)

##The JavaScript file

Here is our main logic. Here, we request data from an API and parse it into required state. We dynamically create new list item and put these data into it.

![js](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l5ifde43gx5jp4vzqobq.PNG)

##The CSS file

![style](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l441sjhrfeklp4jmp36u.PNG)

###So, that's it for the code and here's the result  

![Capgreagture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bayra4uc4y8rtnv2vk88.PNG)

Thanks for your time.
Hacking on Couchbase
Tags: database, devops, webdev, hackathon
Published: 2021-09-21 05:54:20

We are hosting a hackathon for #Couchbase devs at this year's Couchbase Connect conference.

Total prizes $1500 cash $600, $500 and $400 prizes respectively for 1st, 2nd, and 3rd place.

This is a very open hackathon, you can build anything so long as it uses Couchbase and our SDKs. Build an API, tool, or whatever you can imagine that utilizes Couchbase. Just submit your entry before October 1st.

Any questions can be directed to me in my DMs I'm always available!

## Prizes

- Best Overall – $600
- Best Use of Couchbase Tech – $500
- Most Popular – $400

## How to enter

https://info.couchbase.com/ConnectOnline-Hackathon.html

Fill out the form in the link above with your contact info and a link to a public GitHub repo of your code. Title your video and drop it in our Hackathon folder on Google Drive by October 1 (link provided once you submit). Remind your friends to register for ConnectONLINE so they can vote for your project!
Programmatically identify which camera clicks better photos
Tags: datascience, python, machinelearning, deeplearning
Published: 2021-09-21 05:41:11

Credit: [Ritesh Bhagwat](https://www.mentorif.com?utm_source=blog&utm_medium=Devto&utm_campaign=be-ee&utm_id=be-ee)

Let's say we have 3 cameras. Canon, Nikon and Sony and we take picture of Sunset on a beach. All three cameras have slightly different software processing so the output of all three cameras will be somewhat different.

Now the question is which is the best picture? So the 'truth' here is finding out which is the best picture. Well, it depends on personal taste. If someone likes high contrast then a certain image is best image, if someone likes more vibrant colors another picture is the best picture.

The key word here is 'Subjective'. Best picture is totally subjective and dependent on the person's taste. Many of you may disagree with me but I feel on a more broader 'Spiritual' level truth is also Subjective.

Probability is the best tool to study subjectivity. There are three types of Probability.
1. Theoretical Probability.
2. Empirical Probability (Loosely referred as Frequentist Probability)
3. Subjective Probability (Loosely referred as Bayesian Probability)

To study Subjectivity , Bayesian approach to probability is very powerful.

As we say truth is subjective if you show the picture to a dog, the dog will laugh at you as he sees the world only in black and white. The perception of colors in absent in a dog so his truth is different than our truth!
FoalTS version 2.6 is here
Tags: node, typescript, javascript, openapi
Published: 2021-09-21 05:37:01

---
title: FoalTS version 2.6 is here
published: true
description: Version 2.6 of Foal has been released! Here are the improvements that it brings.
tags: NodeJS, TypeScript, JavaScript, OpenAPI
cover_image: https://foalts.org/assets/images/banner-d245fd42d03b4afe02ba1bd55c485ad6.png
---

Version 2.6 of [Foal](https://foalts.org/) has been released! Here are the improvements that it brings.

## Support of the `array` value for AJV `coerceTypes` option

```json
{
  "settings": {
    "ajv": {
      "coerceTypes": "array"
    }
  }
}
```

Option documentation: [https://ajv.js.org/coercion.html#coercion-to-and-from-array](https://ajv.js.org/coercion.html#coercion-to-and-from-array).

## Swagger page supports strict CSP

Inline scripts in the Swagger page have been removed to support more strict *Content Security Policy* directive.

## Bug fixes

The `foal connect angular` command now supports empty `angular.json` files.
What is Open Source?
Tags: opensource, developers, beginners
Published: 2021-09-21 05:16:09

Over time you might have heard the word *Open Source* a lot. And many people might not know the significance of it in this post, you'll see what it is and how it is important

## Defining Open source 
In general, term When the Code or **Source Code** of any technology or software is made public for everyone to study it, modify it and distribute it with others.

## Why open source?

Now the natural question would be: *Why would people want to make their software's code public?* 
Here, Open source is a non-profit movement where everything works on license agreements 

From the beginning, the purpose of open source was to give free alternatives to paid technologies and create a collaborative environment within the tech community.

## How it works

Let's see an example, A developer from Mumbai came up with idea of a software and she developed an initial version of what she thought and made it open source.

Now a developer from Moscow finds this source code and he creates a copy of that source code and codes a feature, sends it for approval of core developer and after checking this the feature is added to main software.

One developer develops technology or software and makes it open source, now any developer can 

Here in open-sourcing, the technology is given a license. When agreeing with a license a person cannot copyright or patent the code or hide any section of it, everything is in public to be modified or used

this process of making a copy of code and adding a feature than adding that to the main software is called Contribution.

There could be hundreds of contributors to a project where the core developer or team of core developers check the code and adds that to the main software or technology.

## Not all about free software

This is a misconception that if a software is open source it is free, which isn't true. 

Developers are free to sell their software but the condition it that they can't copyright, patent, or hide any part of the code.

## Opportunities for students

For any student, doing open source projects can be the way to get work experience while in college or school.

While doing these projects you'll be interacting with professional developers from all over the world. Also, there are programs like GSoc which gives you a stipend for doing contributions to projects.

## Some big open source projects

- Android
- VLC
- Linux
- Firefox
- Gimp
- Blender

> This was just a basic introduction to what a person should know about whole open source community 

In general, Open Source Softwares are very reliable as they are pretty much stable but the updates to these come late as the contributors are working on these in free time.

If you liked the blog than also follow me on [Instagram](https://www.instagram.com/gaurav_vaala/) and [Twitter](https://twitter.com/gaurav_vaala)
Create a MYSQL SERVER Query Management
Published: 2021-09-21 05:12:04

- create database sql_tutorial
```sql
CREATE TABLE users (
id int primary key identity,
firstname VARCHAR(50),
lastname VARCHAR(50),
email VARCHAR(50),
phone VARCHAR(50),
password VARCHAR(100),
address VARCHAR(60),
comment VARCHAR(255)
)
```
### Select Query
```sql
SELECT * from users
```
### Insert
```sql
insert into userData values ('Muhammad Idrees','123456')
insert into users values ('Muhammad', 'Idrees','abc@gmail.com','+92123456789','123456789','staff colony DUHS flat no D6','no comments')


```
Create a Netflix clone from Scratch: JavaScript PHP + MySQL Day 57
Tags: php, javascript, webdev, tutorial
Published: 2021-09-21 04:58:59

Netflix provides streaming movies and TV shows to over 75 million subscribers across
the globe. Customers can watch as many shows/ movies as they want as long as they are
connected to the internet for a monthly subscription fee of about ten dollars. Netflix produces
original content and also pays for the rights to stream feature films and shows.


In this video,we will be  Outputting the season number
{% youtube jbQlpxA8rx4 %}



If you like my work, please consider
[![Buy me a coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jm11knj7d8zwcvo150q2.png)](https://www.buymeacoffee.com/cglikpo)
so that I can bring more projects, more articles for you

If you want to learn more about Web Development, feel free to [follow me on Youtube!](https://www.youtube.com/c/ChristopherGlikpo)
Reasons to adopt gRPC in existing systems
Tags: microservices, go, cloud, grpc
Published: 2021-09-21 04:28:32

## Microservices

Advances in cloud computing have shown that microservices architecture is an effective solution to issues introduced by monolithic systems. The previous iteration of this idea was called SOA or Services Oriented Architecture, a term coined in the 90s.

The general design pattern is not new, but the rise of highly scalable infrastructure provisioning technologies (AWS/Azure/gCloud) has pushed this instrumental pattern back into the mainstream. Leading companies have adopted Microservices to decrease the computation costs of their systems. 

## Challenges with microservices

There are three critical challenges with a microservices implementation. The first immediate challenge is that previously we would primarily deal with passing objects around in memory. Nowadays, we are passing objects across the wire. To send information over the wire requires a large amount of work. The typical journey involves:

<ul>
<li>Serialize a request into a message that we can send as bits across the wire.</li>
<li>Send the request via a network card.</li>
<li>Translate the data into packets.</li>
<li>Receive the packets on the other end.</li>
<li>Deserialize and finally turn the data into an in-memory object the requester can use.</li>
</ul>

To do all this creates a performance penalty. It is costly to do all this work every time we send a message.  Modern microservice implementations comprise many layers and operations, such as fan-out. Considering these layers, the cost of serialization and deserialization grows in computational cost as the system evolves.

The second major challenge is network contention. When dealing with poorly reliable networks and significant payloads, the system performance suffers.

The third challenge arises from the increased volume of services in a given system. Current microservices systems may often have a single machine dedicated to a single service. There are two requirements in newer systems with a higher volume of services: having a single machine run multiple services and services running over multiple machines.

## Answers to the challenges

gRPC => a collection of libraries and tools that allow us to create APIs (clients and servers) in many different languages.  It relies on protobufs, a strongly typed and binary efficient mechanism for serializing and deserializing messages (syntactically similar to Go). 

gRPC is a transport built on HTTP/2, giving it access to features like bidirectional streaming. 

gRPC can control retries, flow control, rate management—all things required for building a robust client.

The language of choice = Go. Go has a small runtime footprint. This consideration is essential when services are small, and there are lots of them. There is an economic incentive to minimize computational costs in any business. Having the ability to run a process as efficiently as possible with as little memory and system overhead required means we can pack processes into a finite amount of compute.

## What is next?

Next, I will explore the structure of a gRPC microservice.
Multi-tenant architecture for SaaS apps
Tags: saas, azure, multitenant
Published: 2021-09-21 03:25:05

- Do you distribute the same app to multiple clients/tenants?
- Are you looking to offer Software as a service and need to dig deep into the architecture of apps to work in multiple tenants?
- Are you tired of installing your app multiple times at these different clients/tenants?
- Do you want to push updates like features and bug fixes into the app without any involvement of client's IT admins (wow that should have gotten you sold on the idea by now 😉)?
- Then you need to know about multi tenancy and how you can create a multi-tenant app in Microsoft365.
![Multi-tenancy in apps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzeeyym6wv2atnio990x.png)
Read more in this article [Multi-tenant architecture for SaaS apps](https://devblogs.microsoft.com/microsoft365dev/multi-tenant-architecture-for-saas-apps/), we will convert a simple single tenant JavaScript application into a multi-tenant app that can run across different tenants to bring data into the app. Same app, but different data.
Comandos basicos en linux
Tags: linux, bash, terminal
Published: 2021-09-21 02:57:02

Como developers es inevitable que nos encontremos con una terminal de linux, ya sea para instalar un paquete en nuestra computadora o para desplegar nuestra aplicación en producción. 

A continuación listare comandos basicos y muy utiles dentro de la terminal.

## $ ls

"List" nos permite listar los archivos que dentro de un directorio, por default nos mostrará los archivos en el directorio actual.
```
$ ls
documentos
```

Podemos agregar el nombre de un directorio para ver su contenido.
```
$ ls documentos
clases  imagenes  receta.txt
```

La terminal nos indica que dentro del directorio documentos hay 3 archivos

## $ cd

"Change Dir" nos permite cambiar el directorio actual, entrar a un directorio, para ello utilizaremos 'cd' seguido del nombre de nuestro directorio
```
$ cd documentos
documentos/ $ 

```

Ahora si listamos los archivos en el directorio actual
```
documentos/ $ ls
clases  imagenes  tareas.txt
```

## $ cat
"Concatenate" entre muchas otras cosas nos premite imprimir en pantalla el contenido de un archivo

```
documentos/ $ cat tareas.txt
- Lavar los platos.
- Ir al mercado.
- Hackear el gobierno.
- Pagar impuestos.
```

## Resumen

```
$ ls directorio
$ cd directorio
directorio/ $ cat archivo
```
Reviewing Next.js 11 features with Tim Neutkens
Tags: webdev, javascript, beginners, podcast
Published: 2021-09-21 01:22:41


Original: https://codingcat.dev/podcast/1-36-reviewing-nextjs-features-with-tim-neutkens

{% youtube https://www.youtube.com/watch?v=S3NokxTVs7Y %}

## Questions

1. How did you get started on Next.js**?**
2. Have you always been a fan of React?
3. What is it like being the lead maintainer on Next.js?
4. How do you handle those angry PR responses?
5. How do you decide what PR's will go into a release?
6. Next.js Included a lot of changes (326 commits) [https://github.com/vercel/next.js/releases/tag/v11.0.0](https://github.com/vercel/next.js/releases/tag/v11.0.0) 1. How do you test these?
7. What are your biggest takeaways from Next 11?
  1. Mine are collaborative preview, conformance, Image, and Script [https://codingcat.dev/post/nextjs-11-features](https://codingcat.dev/post/nextjs-11-features)
8. Is it difficult to upgrade from 10 to 11?
  1. [https://nextjs.org/docs/upgrading#upgrading-from-version-10-to-11](https://nextjs.org/docs/upgrading#upgrading-from-version-10-to-11)
9. With Next.js Conf Special Edition happening in June, should we expect to see Next.js 12 or will we just have a Minor version announced at Next.js Conf in October?
10. Things coming up to expect
  1. SWC -
  2. On Demand revalidation
11. Next.js Live - [https://nextjs.org/live](https://nextjs.org/live)

## Links

* [Next.js](https://github.com/vercel/next.js)
* [MDX](https://github.com/mdx-js/mdx)
* [Micro - Asynchronous HTTP microservices](https://github.com/vercel/micro)
* [ncc - Simple CLI for compiling a Node.js module into a single file](https://github.com/vercel/ncc)
* [Tim Neutkens @ Vercel](https://vercel.com/about/timneutkens)
* [Chrome Introducing Aurora](https://web.dev/introducing-aurora/)