teleren/devto huggingface dataset:
Why AWS?
Tags: cloud, aws, beginners
Published: 2021-12-02 18:13:52


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/crqs3tlgea4xa8h7z77t.jpg)

**I**f You are here, then you are already hearing about the cloud, definitely known or at least heard about AWS or Amazon Web Services.

So What I'm trying to achieve is that I'll start writing these blog about AWS services, Guides, How to Guides, basically that will help the very beginner who have just started to learn about AWS (Cloud) in a very easy manner so that everyone can learn about the AWS

## Let's Come to the Question Why AWS ?
Why there is always this same name come up every time we are talking about cloud, let's go back in the history when Amazon was expanding they come up with this very first service called EC2 or compute service, you can learn more about the history in [here](https://en.wikipedia.org/wiki/Amazon_Web_Services).

From then it came a long way, whether it's about computing, storage developer tools, machine learning, big-data, development you name it **AWS** have it.

When You First see the what AWS have to offer you it seems like they have it for unlimited amount, they are never out of storage, never out of resources. 

### What makes AWS different from others ?
**Let's first talk about the dashboard**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dcf958n09b33exgxzerd.png)
When I first saw it when I was learning AWS it seems very chaotic, very random to me, and I'm pretty much sure that you feel the same way.

Clicking on **"All services"** opens a very long list of services.

> Most of them I've never used, Trust me on this
Here We can access all the services, we can search the services, know about the categories and much more.
I love the dashboard, I hope you feel the same way about it😅.

**"Learning Curve"**
How soon I can start working with all these service by myself ?
Some of the services are pretty much very easy to understand and can be learned in a week or two. But to get the depth feel and knowledge about that it will be longer run.

**"The Best Things That I felt is the Support/Customer Chat "**
Whenever I have requested anything like to increase the limit for a particular service or about payment or anything they issue get solved in no time.

#### FREE TIER
Who doesn't love FREE Things, I love them 😅🤩, and best part is that **AWS** comes with **1yr FREE TIER** for you to learn about AWS different services try them, get you hand feel the power of **Cloud** and trust me this 1yr is enough for you to learn the cloud AWS ways. 

Once you're in AWS you'll feel that none of the cloud provider is as good as AWS.😎😎 

#### Well these are my thoughts about the AWS, and with this I have planned to write a whole series of blog about AWS as I have already mentions, so till then **stay safe & stay healthy**.
Acra. Features: Searchable encryption
Tags: cryptography, security, encryption, database
Published: 2021-12-02 18:01:45

Cloud storage technologies have their gains and pains. While they enable distributed operations, they also raise the question of **keeping data well-protected**.

Encrypting sensitive data is one of the first steps in this field. However, encryption makes it harder to search over the data once it is encrypted, which is both what encryption is needed for and a huge operational downside. In an ideal world, it would be convenient to keep the data encrypted and still be able to securely search over it, without constraining the application architecture. And **today it's possible.**  

To solve the issue, we built a technology called **Acra Searchable Encryption**. It’s basic version is available in Acra Community Edition, a more sophisticated one—in Acra Enterprise Edition. 

> *[Use Acra Community Edition for free] (https://github.com/cossacklabs/acra). Check out [Acra Enterprise Edition] (https://www.cossacklabs.com/acra/#pricing) tailored for solutions with high security requirements.*

##2️⃣ Searchable encryption

Searchable encryption means that data is stored encrypted in the database, yet it’s possible to run simple queries on encrypted fields without decrypting them. 

💡 There are **various searchable encryption schemes** available, but in Acra we use one that balances security and usability the best—it's **keyword search.**

[Acra’s search through encrypted data] (https://docs.cossacklabs.com/acra/security-controls/searchable-encryption/) is based on blind indexing with probabilistic bloom filters, built around strong AES-GCM-256 and HMAC.

Acra encrypts data fields and builds a searchable index for them. Acra supports exact queries out of the box (`select * from emails where email=<query>`), and allows building compound encrypted indexes to make even sophisticated queries possible over encrypted data.

> 💡 Unlike the existing solutions, Acra provides adjustable performance-leakage ratio for protected search, strict separation of duties which guarantees absence of cryptographic key leakage from application, secure storage and management of cryptographic keys, and a set of additional security features that better correspond to the real-world threats.

![Searchable encryption](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hgjk2ux7kl0pfxakxn2j.gif)

🔥 Ready to learn more Acra features? Follow the link to get acquainted with another feather in our cap :)
Advent.js🎅🏼| #2: ¡Ayuda al elfo a listar los regalos!
Tags: javascript, webdev, spanish, adventjs
Published: 2021-12-02 17:39:45

## [¡Ayuda al elfo a listar los regalos!](https://adventjs.dev/challenges/02)
Te ha llegado una carta ✉️ con todos los regalos que debes preparar. El tema es que es una cadena de texto y es muy difícil de leer 😱. ¡Menos mal que han puesto cada regalo separado por espacio! (aunque ten cuidado, porque al ser niños, igual han colado más espacios de la cuenta)

Encima nos hemos dado cuenta que algunas palabras vienen con un _ delante de la palabra, por ejemplo _playstation, que significa que está tachado y no se tiene que contar.

Transforma el texto a un objeto que contenga el nombre de cada regalo y las veces que aparece. Por ejemplo, si tenemos el texto:

```js
const carta = 'bici coche balón _playstation bici coche peluche'
```
Al ejecutar el método debería devolver lo siguiente:

```js
const regalos = listGifts(carta)

console.log(regalos)
/*
{
  bici: 2,
  coche: 2,
  balón: 1,
  peluche: 1
}
*/
```

Ten en cuenta que los tests pueden ser más exhaustivos... 😝 ¡Cuidado con contar espacios vacíos!

Completa el reto!

--- 

Mi solución:

{% jsitor https://jsitor.com/embed/obIbRKx2U %}

---
Puedes seguir a @midudev y estar pendiente de los retos de Advent.js 

{% twitter 1466086678507008003 %}
Crear tienda online wordpress (woocommerce)
Published: 2021-12-02 17:38:52

 (http://www.jisat.com/create-a-store-online-in-wordpress/).
La idea principal de este artículo es crear una tienda online en wordpress que te ayude a vender tus productos online.
Antes de empezar a crear una tienda online en wordpress necesitamos instalar y configurar algunos plugins, temas y configurar los ajustes en wordpress.

## [Tienda online con woocommerce](https://estandar.io/shopify-vs-woocommerce-para-sitios-web-de-comercio-electronico/)

En primer lugar tenemos que instalar y configurar los siguientes plugins:
Estos son los principales plugins que hay que instalar.
El siguiente paso es instalar y configurar un tema.  Personalmente te recomiendo que elijas un tema que sea responsivo.  Un tema responsivo significa que el tema será sensible a cualquier tamaño de pantalla (teléfono, tableta, portátil, escritorio). 
Un tema responsivo será más atractivo y fácil de usar para tus clientes.

## [Tienda Wordpress](https://estandar.io/shopify-vs-woocommerce-para-sitios-web-de-comercio-electronico/)
Ahora tienes que instalar un tema y configurarlo para que se adapte a tu tienda online.  Puede personalizar el tema de muchas maneras y es usted quien decide cómo crear su tienda online.
Después de haber instalado y configurado el tema, es necesario comprobar la configuración del tema y configurar los ajustes en wordpress.
En primer lugar, necesitas instalar y configurar el plugin WooCommerce.  WooCommerce es un plugin gratuito de wordpress que se utilizará para crear tu tienda online.  El proceso de instalación de WooCommerce es muy sencillo.  Sólo tienes que descargar el archivo desde wordpress.org e instalarlo en tu instalación de wordpress.
Puedes encontrar la guía de instalación de WooCommerce aquí: http://docs.woothemes.com/document/install-woo-commerce
Después de haber instalado y configurado WooCommerce necesitas configurar los ajustes en wordpress.  Puedes encontrar los ajustes en Dashboard > WooCommerce > Settings.
Necesitas configurar los ajustes de acuerdo a tus necesidades.  Por ejemplo, necesita configurar las categorías de productos, la configuración de la imagen del producto y los detalles del producto.
El último paso es utilizar las imágenes de los productos en tu tienda.  Puedes establecer el tamaño de la imagen del producto en la configuración general.  Tienes que subir las imágenes de los productos a la carpeta de productos en tu directorio de wordpress.  Las imágenes de los productos se utilizarán en su tienda.
Puedes ver el resultado final de mi tienda aquí: http://www.jisat.com/shop/
Espero que este artículo te ayude a crear una tienda online en WordPress.
Creating my first program
Published: 2021-12-02 17:31:08

I wrote my first program this week in making a clone of hangman. I still plan on making more additions to the program, such as bring in the word list through a separate file to remove possible bloat in the program. But the program did teach me quite a bit. I learned that programming is just a series of smaller problems that needed to be solved. This became really apparent when I started experiencing more problems to deal with in the code and started to write comments before code blocks. 

[](https://github.com/Sl4rky/Hangman) source code here
Advent.js🎅🏼| #1: Contando ovejas para dormir.
Tags: javascript, webdev, spanish, adventjs
Published: 2021-12-02 17:25:41

## [Contando ovejas para dormir](https://adventjs.dev/challenges/01)
Considera una lista/array de ovejas. Cada oveja tiene un nombre y un color. Haz una función que devuelva una lista con todas las ovejas que sean de color rojo y que además su nombre contenga tanto las letras n Y a, sin importar el orden, las mayúsculas o espacios.

Por ejemplo, si tenemos las ovejas:

```js
const ovejas = [
  { name: 'Noa', color: 'azul' },
  { name: 'Euge', color: 'rojo' },
  { name: 'Navidad', color: 'rojo' },
  { name: 'Ki Na Ma', color: 'rojo'}
]
```
Al ejecutar el método debería devolver lo siguiente:

```js
const ovejasFiltradas = contarOvejas(ovejas)

console.log(ovejasFiltradas)

// [{ name: 'Navidad', color: 'rojo' },
//  { name: 'Ki Na Ma', color: 'rojo' }]

```
Completa el reto!

--- 

Mi solución:

{% jsitor https://jsitor.com/embed/BnJ2x-ebN %}

---
Puedes seguir a @midudev y estar pendiente de los retos de Advent.js 

{% twitter 1466086678507008003 %}
Advent.js 2021, una iniciativa navideña para mejorar tu lógica de programación🎄
Tags: javascript, spanish, webdev, adeventjs
Published: 2021-12-02 17:04:48

Como muchos sabran el crack de @midudev acaba de lanzar un proyecto para la comunidad donde puedes mejorar tu lógica de programación resolviendo 1 reto por día, desde el 01 al 25 de diciembre. 
Te dejo aca el hilo de Twitter donde el mismo explica su propuesta.

{% twitter 1466086678507008003 %} 

Por mi parte me propuse tratar de resolver todos los problemas del reto, ire subiendo mis resultados para que lo puedan ver o comparar. Animense a unirse al resto, es desafiante pero muy divertido.
Developer Portfolio with React.js
Tags: html, css, javascript, react
Published: 2021-12-02 17:01:38

I build my developer portfolio using react.js and I would like to have it reviewed by our awesome community.🤍🖤
I have tried to keep the UI design minimalistic and modern and I'm loving it. 
Any feedback, suggestions, or comments are welcome. If you like the website please leave a mail from the contact page. I promise it won't take long.
Thank You!
Website Link:- https://personal-portfolio-30590.web.app/
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zmgu6fru1o0y794ugicn.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6jmncxqmzuywty6gayc2.png)
[Solved] No MediaQuery widget found Error in Flutter
Published: 2021-12-02 16:50:24

You may got this error in Flutter if you haven't placed MaterialApp() widget correctly in widget tree. See the solution below to solve this error:

## Error Message:

```
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞════════
No MediaQuery widget ancestor found.
MyApp widgets require a MediaQuery widget ancestor.
The specific widget that could not find a MediaQuery ancestor was:
  MyApp
The ownership chain for the affected widget is: "MyApp ← [root]"
```

## Solution 1:
```
class MyApp extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    return MaterialApp( //use MaterialApp() widget like this
      home: Home() //create new widget class for this 'home' to 
                   // escape 'No MediaQuery widget found' error
    );
  }
}
```

## Solution 2: 
```
MediaQuery(
      data: MediaQueryData(),
      child: MaterialApp()
)
```

This answer is referenced from: [How to Solve ’No MediaQuery widget found’ Error in Flutter](https://www.fluttercampus.com/guide/69/how-to-solve-no-mediaquery-widget-found-error-exception-flutter/)
Can Anyone help me with my journey?
Tags: javascript, webdev, programming, beginners
Published: 2021-12-02 16:42:28


*Hey, Dev community*, I hope everyone is reading my post is well.
As we know the main purpose we joined this community is to help each other!
Recently I joined developer community And I have 2-3 month experience about programming languages Such as HTML, Css, Media Quary and basic of java and the Concept of Web developer, So I want to work fast to gain more experience about programming languages to get remotely jobs ASAP. Although  I met many challenges like 'English problem' but it seems that I tackle it.
I started to learn at Udemy and Coursera and they helped me a lot. 
Can anyone help me learning Node.js or recommended me the best Course of Node.js.because I'm looking for Full-Stack Engineer.

Finally I would to drop your advice.
If something wrong with my post, please click comment below.
Thank you 😊
#Node.js
#Java
C++ 17: IF and SWITCH With Initialisation
Tags: cpp, cpp17
Published: 2021-12-02 16:35:02

---
title: C++ 17: IF and SWITCH With Initialisation
published: true
description: 
tags: cpp, cpp17
canonical_url: https://www.aloneguid.uk/posts/2021/12/if-with-initialisation/
//cover_image: https://direct_url_to_image.jpg
---

In C++ 17, `if` statement can have an initialisation clause i.e. instead of 

```c++
if(condition) {}
```

this:

```c++
if(init; condition) {}
```

Why? I could just write

```c++
init;
if(condition) {}
```

and it's almost the same. Initialisation clause *is valid until the ned of the `if` part*. To demonstrate:

```c++
if (int i = 1; i == 0)
{
    // OK
    cout << "if 1" << endl;
}
else
{
    // OK
    cout << "else:" << i << endl;
}

// left the scope, so the following line won't compile:
cout << i << endl;
```

This also means RAII applies to the initialisation phase i.e. if init instantiates a class on stack, a destructor will be called.

This is useful in many scenarios, for instance guard initialisation:

```c++
if (std::lock_guard<std::mutex> g{mtx}; !coll.empty()) {
	// safely use the collection
}
```

You can achieve the same in pre C++17 codebase with the following code, which is equivalent to above:

```c++
{
    std::lock_guard<std::mutex> g{mtx};
    
    if (!coll.empty()) {
        // safely use the collection
    }
}
```

it's just syntaxically longer.

**Important note** - the object in initialisation clause **must have a name**, and if it doesn't, it's automatically created and destroyed before the first statement inside `if` executes. Basically, it's destroyed as soon as possible, so no resources are wasted. It would make sense, as you are not referencing it.

Same goes for `switch` statement, absolutely no differences from `if`:

```c++
switch(init; condition) {}
```
hyper Enhancements — Round 2 ✨
Published: 2021-12-21 19:28:35

---
title: hyper Enhancements — Round 2 ✨
published: true
date: 2021-12-02 16:12:55 UTC
tags: 
canonical_url: https://hyper-io.medium.com/hyper-enhancements-round-2-1efb6bd04fdb
---

The hyper team is pleased to announce [new enhancements](https://docs.hyper.io/cloud/whats-new) to our service cloud platform for startups. hyper cloud consists of secure, scalable backend services that allow your team to focus on what matters: features for your customers.

#### Enhancements

- 🔎 [Search Service has launched!](https://docs.hyper.io/cloud/whats-new) — Spin up a high-performance search service in one click! Our search service manages the complexity of running your own search engine or having to deal with separate services, the search engine sits right next to your data and cache for a highly composable integration.
- 🔑 Enhanced [App Key](https://docs.hyper.io/cloud/app-keys) Management. Create new app keys, as well as, disable, delete, and enable.
- 🎓 New NodeJS [Workshops](https://docs.hyper.io/cloud/nodejs-workshops) and [Quickstarts](https://docs.hyper.io/cloud/nodejs-quickstarts)
- 📈 Current release and version information within the dashboard footer.

For more details, head on over to [What’s New](https://docs.hyper.io/cloud/whats-new). Don’t forget to [Sign up](https://dashboard.hyper.io/) for a free hyper cloud account.

#### Coming Soon! 🚀

- Teams and Paid Subscriptions. Manage hyper cloud users within a team for your paid subscription. Stripe integration to securely manage your payment details.

Keeping developers happy,

The hyper team
Kotlin Scala Differences Cheat Sheet
Tags: kotlin, scala
Published: 2021-12-02 15:57:02


| Feature      | Kotlin | Scala |
| ----------- | ----------- | ----------- |
| Function Keyword | fun | def |
| Nullability | Default not nullable except by adding ? at the end of variable type| Null is discouraged, but no hard check |
| Null Check | Use [?.](https://kotlinlang.org/docs/null-safety.html#safe-calls) and/or [?:](https://kotlinlang.org/docs/null-safety.html#elvis-operator) | Use [Option](https://www.scala-lang.org/api/2.13.6/scala/Option.html) |
| Lambda/Anonymous Functions | Need to be surrounded with {} | Can be used anywhere |
| Covariant | [out T] | [+T] |
| Contravariant | [in T] | [-T] |
| Pattern Matching | (partial) when statement | (full) match/case |
| Default Case | `else ->` | `case _ =>` |
| Loop a Range | i in 1..10 step 2 (closed)    i in 1 until 10 step 2 (half-closed) | i <- 1 to 10 by 2 (closed)    i in 1 until 10 by 2 (half-closed) |
| Read File into Strings | File(fileName).useLines { it.toList() } | scala.io.Source.fromFile("file.txt").mkString |
| [For Comprehension (for/yield)](https://docs.scala-lang.org/tour/for-comprehensions.html) | No Equivalent | Supported |
| Companion Object | `companion object` keyword inside class | `object` keyword besides class | 
| New Immutable Sequence | listOf("one", "two", "one") | Seq("one", "two", "one") |
| New Immutable Set | setOf("one", "two", "three") | Set("one", "two", "one") |
| New Immutable Map | mapOf("key1" to 1, "key2" to 2, "key3" to 3, "key4" to 1) | Map("key1" -> 1, "key2" -> 2, "key3" -> 3, "key4" to 1) |
| Top Level Functions (Package Level) | Supported | [Will be supported in Scala 3](https://jducoeur.medium.com/finally-top-level-definitions-c67a33300a12) |
| Extension Functions | fun Any?.toString(): String { if (this == null) {return "null"} return toString()} | extension (c: Circle) def circumference: Double = c.radius * math.Pi * 2 |
| Operator Overloading | with `operator infix` keyword | operators are just normal functions |
| Regex String | "[0-9]".toRegex() | "[0-9]".r |
| Tuple 2 | Pair(a, b) | (a, b) |
| Tuple 3 | Triple(a, b, c) | (a, b, c) |
| Destructuring Assignment | Objects with `componentN()` (data classes and collections) | Objects with `unapply()` (extractors like case classes) |
| Tail Recursive Function | `tailrec` keyword | `@tailrec` annotation |
| Multiple Inheritance Resolution | Must override function in question manually | Later trait wins |
| Class Inheritance | only with `open` or `abstract` keyword | allowed |
| The `sealed` keyword | sealed class is something like enum | sealed types are confined in its source file |
| Secondary/Auxiliary Constructors | `constructor` keyword | `this()` functions |
| Reference Equality (the Java `==`) | `===` | `eq` |
| Map Entry Literal | k `to` v | k `->` v |
Do we have to await every single C# async method?
Tags: csharp, async, dotnet
Published: 2021-12-02 15:54:07

---
categories: csharp async
description: Do we have to await each C# async method? Does this have any effect on code performance? Let's check it out!
excerpt: Do we have to await each C# async method? Does this have any effect on code performance? Let's check it out!
date: 2021-04-2016:30:00+0100
---

Did you ever see code a like that? The method calls another asynchronous method and returns its direct result. 

```csharp
[HttpPost]
public async Task<GetUserQueryResult> Get([FromBody] GetUserQuery query)
{
    var result = await _mediatr.Send(query);
    return result;
}
```

Okay, it works perfectly well, so what's the matter? Now take a look at the code below:

```csharp
[HttpPost]
public Task<GetUserQueryResult> Get([FromBody] GetUserQuery id)
{
    return _mediatr.Send(query);
}
```

I got rid of the `async` and `await` keywords. This makes the `Get` method synchronous. It just passes the task on and does not wait for the result.

Both pieces of code work the same, but are they equally efficient? Let's check it out! 

## So what's the difference? 

The `await` keyword is syntactic sugar. In fact, when compiled, it is turned into a state machine that manages the asynchronous code. Additional code increases execution time and consumes additional resources.

Let me show you an example class:

```csharp
public class TestClass
{
    public Task<int> MethodA()
    {
        return Task.FromResult(1);
    }

    public async Task<int> MethodB()
    {
        return await Task.FromResult(1);
    }
}
```

And its benchmark:

```csharp
public class Benchmark
{
    private TestClass testObject = new TestClass();

    [Benchmark]
    public async Task NoRedundantOperators()
    {
        await testObject.MethodA();
    }

    [Benchmark(Baseline = true)]
    public async Task RedundantOperators()
    {
        await testObject.MethodB();
    }
}
```

Here are the results of the benchmark:

|               Method |     Mean |    Error |   StdDev | Ratio |
|--------------------- |---------:|---------:|---------:|------:|
| NoRedundantOperators | 34.90 ns | 0.738 ns | 1.035 ns |  0.58 |
|   RedundantOperators | 60.17 ns | 1.243 ns | 2.144 ns |  1.00 |

As you can see, the code without unnecessary operators is almost twice as fast!

I have put all the benchmark code in my GitHub repository so you can test it yourself. You can find the repository [here](https://github.com/mikasjp/AsyncAwaitBenchmark).

## Finally

I hope I convince you that it is not always worth it to await every single async method call. As always, if you have any interesting thoughts on this topic, please let me know!