teleren/devto huggingface dataset:
Define a Route Group Controller in Laravel 8.80
Tags: laravel, webdev, beginners, news
Published: 2022-01-28 06:51:20

The Laravel crew launched 8.80 with the power to outline a route group controller, render a string with the Blade compiler, PHPRedis serialization and compression config assist, and the most recent modifications within the v8.x department.

## Specify a Route Group Controller
[Luke Downing](https://github.com/lukeraymonddowning) contributed the ability to define a controller for a route group, meaning you don't have to repeat which controller a route uses if the group uses the same controller:
```
use App\Http\Controllers\OrderController;

Route::controller(OrderController::class)->group(function () {
    Route::get('/orders/{id}', 'show');
    Route::post('/orders', 'store');
});
```
A great thing has been added in Laravel 8.80, [https://github.com/laravel/framework/pull/40276](https://github.com/laravel/framework/pull/40276) which is the use of Route::controller() with Groups to shorten Route, so I want to share it with you so that you may use it in your next projects.

## Render a String With Blade
[Jason Beggs](https://github.com/jasonlbeggs) contributed a Blade::render() a technique that makes use of the Blade compiler to transform a string of Blade templating right into a rendered string:
```
// Returns 'Hello, TechvBlogs'
Blade::render('Hello, {{ $name }}', ['name' => 'TechvBlogs']);
 
// Returns 'Foo '
Blade::render('@if($foo) Foo @else Bar @endif', ['foo' => true]);
 
// It even supports components :)
// Returns 'Hello, TechvBlogs'
Blade::render('<x-test name="TechvBlogs" />');
```

## PHPRedis Serialization and Compression Config Help
[Petr Levtonov](https://github.com/TheLevti) contributed the power to configure PHPRedis serialization and compression choices as a substitute for needing to overwrite the service supplier or outline a customized driver.
The PR launched the next serialization choices:

- NONE
- PHP
- JSON
- IGBINARY
- MSGPACK

These options are now documented in the [Redis - Laravel](https://laravel.com/docs/8.x/redis#phpredis-serialization) documentation.

Thank you for reading this blog.
NLP & Sports
Tags: nlp, deeplearning
Published: 2022-01-28 06:40:46

You might be wondering by looking at the topic that exactly what’s the connection between the two aspects.One which is the core/heart of data mining, which is backbone of many firms today and other which is loved by everyone perhaps the one we all perfom,watch and even follow.

So, coming to the question,how are both of them related? and if integrated how can they give you something different, lucrative and something interesting to ponder?

Well,the fact is NLP has been such a potential tool that it has opened the doors for opinion mining to such an extent that statergy planning is aided to the immense extent.Well by now,some of you might have got the key as to how can NLP actually be integrated with sports. Nowadays,we see a lot of sports talk shows where experts talk about how a team A has been performing,what are the key strengths and what are the opinion of the captain/players. Well,we also see talk shows where experts try to dig into what a player has said,his opinion in a press conference or somewhere else and based on it try to build some future predictions as to the team performance, statergy and mindset. If we try to replace this with NLP, trying to perform opinion mining and by NLP trying to get some vital predictions from the opinions of the team/captain/players,it can well give us some very interesting results. Well,if we all know that there are expert systems which are AI based used in healthcare sector which can act like a virtual doctor at times.If NLP could replicate the same potential in sports you might see an expert system based opinion mining which could give us some very interesting results with regards to team decisions, planning, statergy either based on their mathematical data based performance or based on thier opinion framed in natural language.
Open Source Avatar Generation Website
Tags: javascript, vue, opensource, github
Published: 2022-01-28 06:39:28

## [vue-color-avatar](https://github.com/Codennnn/vue-color-avatar)
<span><strong><i class="fa fa-star">Star 1.1k</i> <i class="fa fa-eye">Watch 6</i> <i class="fa fa-code-fork">Fork 138</i></strong></span>


A front-end only avatar generation website. By swapping components around, you can build your own avatar.

## Preview
[https://vue-color-avatar.vercel.app](https://vue-color-avatar.vercel.app)

## Introduction
By swapping components around, you can build your own avatar.

Features you might be interested in:
- Visual component configuration bar
- Randomly generate an avatar
- Redo/Undo
- i18n

## Assets
Implementation of [Avatar Illustration System](https://www.figma.com/community/file/829741575478342595) by Micah Lanier. Licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/).

## Develop
This project is implemented using `Vue3`.
```shell
# 1. Clone project
git clone https://github.com/Codennnn/vue-color-avatar.git

# 2. Install dependencies
yarn install

# 3. Run
yarn dev
```
Effective Methods to Transfer and Migrate Hotmail to Gmail
Published: 2022-01-28 06:26:00

Now a days, users wants to **[migrate Hotmail to Gmail](https://www.migrateemails.com/how-to-transfer-email-from-hotmail-to-gmail-automatically/)** because of the advanced features provided by Gmail to its users. However, if you also want to transfer your Hotmail to Gmail then you can try our the two techniques that are mentioned below - 

1. Use MS Outlook to forward your Hotmail o Gmail.
2. Use Google inbuilt feature .

These are the two free methods through which you can convert emails from Hotmail to Google account. It is a DIY approach and requires excellent skills to carry out  the process successfully. Moreover, this method is not applicable for those users who have a huge mailbox data to convert into Gmail. However, such users can try out a easy solution named as **DRS [Hotmail backup Tool](https://www.data-recovery-solutions.com/hotmail-email-extractor.php)**. It is a excellent utility that enables users to convert their Hotmail mails into any other email client and file format. This software is a automated application and is completely safe to use.
Remove Duplicate Elements From An Array With Just a Single Line Of Code!
Published: 2022-01-28 06:52:46

---
title: Remove Duplicate Elements From An Array With Just a Single Line Of Code!
published: true
date: 2022-01-28 05:55:25 UTC
tags: 
canonical_url: 
---

> In today's article, we'll be looking at a super simple trick that can be used to remove duplicate elements from an array in Javascript.

With the help of this trick, you can delete the duplicate elements from an array without the use of loops or other complex operations.

We'll be using the concept of Sets in Javascript to achieve this.

So let's start...

We start with initializing a new example array, on which we’ll perform the operation to remove duplicate elements.

```
var arr = [1,2,2,3,3,3,4,4,4,4,5,5,5,5,5];

```

In this example array, we have duplicate integers (as many times as their value). We want to remove duplicate elements from this array and our updated array should look like this:

```
[1, 2, 3, 4, 5]

```

Now to remove duplicate elements, the simplest part, we use a combination of arrays’ spread operator (to spread the elements of the array) along with creating a new Set which will allow us to store only the unique elements from the array.

```
        arr = [... new Set(arr)];

```

This re-initializes the variable arr with the non-duplicate elements, just like the way we want.

```
Arr -> [1, 2, 3, 4, 5]

```

If you want to retain the original array, you may declare a new variable that stores the non-duplicate elements array from the original array.

Ex.

```
var arr = [1, 2, 2, 3, 3, 3];
var newArr = [... new Set(arr)];

```

Through this way, we get a new array with no duplicate elements, and we also have our original array, which we might need later.

Arr -> [1, 2, 2, 3, 3, 3]

newArr -> [1, 2, 3]

Not only integers, but we can use this concept for any data type. Let’s take an example with elements of type String.

```
var stringArray = ['a', 'b', 'b', 'c', 'd', 'd', 'd', 'e', 'e', 'f'];

```

Now, using the same concept as discussed above, we use

```
stringArray = [... new Set(stringArray)];

```

And, as you guessed, the output after removing all the duplicate elements from the array is

```

["a", "b", "c", "d", "e", "f"]

```

The last example we take is with an array of boolean values.

```
var boolArray = [true,true,false,false,true,false];

```

Applying the same concept, we use:

```
boolArray = [... new Set(boolArray)];

```

And as expected, we have the boolArray with only two elements, ie,

```
[true, false]

```

### The final key point:

> The Set() constructor lets us create Set Objects that lets us store the unique value of any data type.

Thank you for reading this far. Check out more at www.ishaanbedi.me
React Native mobile running problem. What to do?
Tags: react, errors, reactnative, node
Published: 2022-01-28 05:47:12

I am Currently using Ubuntu 20.04 and I have many problems while using react native. I've installed expo. But when I run the app, It shows some error. 

IMAGE - 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ao1i5sd3c2vf2gp9j61w.png)

What to do now?
Self-Taught Developer Journal, Day 48: TOP Building Rock Paper Scissors UI cont.
Tags: webdev, beginners, codenewbie, devjournal
Published: 2022-01-28 05:33:53

Today I didn't get much done, but I was able to spend some time studying a bit at least.

I really want to make a responsive UI for Rock Paper Scissors because I want to learn and I am a fan of responsive design. I also happened to see [a tweet from Shashi (https://twitter.com/shashiwhocodes/status/1486789899399446535)
regarding using `max-width` vs `width` for a responsive web development. I'm hoping to try it out for my UI.

Next, I was feeling a bit uncertain about how I laid out my HTML and CSS so I asked my friend, [Dwayne] (https://twitter.com/dwayne_devs),for some feedback so he suggested using grid after seeing what I had. So this lead me to watching [Traversy Media, *CSS Grid Layout Crash Course*] (https://www.youtube.com/watch?v=jV8B24rSN5o&ab_channel=TraversyMedia).


## CSS Grid Crash Course
Flexbox is 1 dimensional while Grid is 2 dimensional.

*"The basic difference between CSS Grid Layout and CSS Flexbox Layout is that flexbox was designed for layout in one dimension - either a row or a column. Grid was designed for two-dimensional layout - rows, and columns at the same time."*

Normally for rows and columns, the preferable units to use is fractions, or *fr*, over percent because of padding and margin.

## Resources
[The Odin Project](https://www.theodinproject.com/paths/foundations/courses/foundations/)
[Revisiting Rock Paper Scissors](https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/revisiting-rock-paper-scissors)
https://www.youtube.com/watch?v=jV8B24rSN5o&ab_channel=TraversyMedia
https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Relationship_of_Grid_Layout
API5:2019 - Broken Function Level Authorization
Tags: security, hacking, owasp, api
Published: 2022-01-28 05:08:37

Hello guys! Hope you are having an amazing day :hugs:

Continuing our series, today we are going to talk a little bit about API5:2019, which is an authorization vulnerability just like [API1:2019](https://dev.to/therealbrenu/api12019-broken-object-level-authorization-17ba), but they happen in different cases and for different reasons.

Hope you guys dig it!

## :national_park: Just Some Background

There are applications that need some functionalities to be only accessible to certain users. For example, if there's an endpoint that returns personal identifiable data about all the registered users, we may assume that only the administrators are supposed to be capable of using it.

For this case, verifying for an user attribute `isAdmin` might already do the trick, but some other applications, such as forums or school management systems tend to need more than that. Usually they need a whole set of access control policies that will be used to define, through the code of the entire API, whether a user is able to execute functions or not.

## :yum: Exemplifying The Problem

Implementing complex access control policies, just like any other complex business logic rules, is actually very tricky because this process cannot be handled in a generic way, and every single endpoint of the API has to take this into account.

Imagine an API where any route starting with `/admin` can only be accessed by administrators. That's great, right?! But if there is any other route that is supposed to be accessible only for administrators, such as:

> DELETE /users/all HTTP/1.1
> Host: example.com

This endpoint also needs to be considered by the access control policies, and very often, when it comes to cases like this, they are actually not taken into account! 	:grimacing:

This was the case of [CVE-2021-3980](https://huntr.dev/bounties/1f43f11e-4bd8-451f-a244-dc9541cdc0ac/). The application already had access control policies defining that only administrators would have access to the endpoints which start with `/admin` and/or `/ajax/admin`, but there was this endpoint which was starting with `/ajax/form/admin` and it wasn't being considered by the access control policies at all. This simple "misconfiguration" made possible for every user (even unauthenticated ones) to get access to some private information related to the users of any social network created with the engine.

## :notebook_with_decorative_cover: External Materials

As my goal with this series is to just explain what each flaw is while I'm learning about them all, I would like to suggest some materials about today's topic, so you understand better the details of it:

https://github.com/OWASP/API-Security/blob/master/2019/en/src/0xa5-broken-function-level-authorization.md

https://salt.security/blog/api5-2019-broken-function-level-authorization

https://apisecurity.io/encyclopedia/content/owasp/api5-broken-function-level-authorization.htm
Add Search to Hugo Static Site in 5 Minutes with No Dependencies
Tags: hugo, jamstack
Published: 2022-03-25 19:18:43

---
title: Add Search to Hugo Static Site in 5 Minutes with No Dependencies
published: true
date: 2022-01-28 05:00:00 UTC
tags: hugo,jamstack
canonical_url: https://kevinquinn.fun/blog/add-search-static-site-in-5-minutes/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1b7wmbseffsdy7dehy03.png
---

Having search on your site is a big plus for the user experience _(and for finding that piece of content I remember writing but can’t find!)_. My site isn’t big enough that it’s worth spending much effort setting up a real search solution like [Algolia](https://www.algolia.com/), [Meilisearch](https://www.meilisearch.com/), or even [LunrJS](https://lunrjs.com/).

Instead, I got inspiration from the past - let a search engine do the work for me, like so many sites in the 2000s. This is the **80/20 version** of adding search to your site - a good enough option with minimal effort.

## What are we adding

![Search bar on site](https://kevinquinn.fun/uploads/searchbar-yellow-bg.png#center)

Search engines provide the option to search within a single website with `site:<domain>`. We will use that as our base - then sync an input box with a clickable link containing user text. On click, it takes them to the search engine page with the search filled for them:

```
site:kevinquinn.fun <user-input-text-here>

```

Total additions to your codebase - **3**.

1. An input box, styled to your liking.
2. A link tag.
3. And a short script.

## Show me an example

This site is built with an older version of Boostrap, but the core element is the `<script>` from this [handy dandy Stack Overflow post](http://stackoverflow.com/questions/7097573/ddg#7097818), then attach it to your input box.

```
<div class="input-group">
<input id='search-input' type="text" class="form-control" placeholder="Search for...">
<span class="input-group-btn">
<a id='generated-link' target="_blank" class="btn btn-default" href="https://duckduckgo.com/">Go!</a>
</span>
</div>
<script type="text/javascript">
var link= document.getElementById('generated-link');
var input= document.getElementById('search-input');
input.onchange=input.onkeyup= function() {
link.search= '?q=site%3Akevinquinn.fun+'+encodeURIComponent(input.value);
};
</script>

```

## Search in under 5 minutes 😎

You just added search to your website in no time, give yourself a pat on the back! Is it the most amazing search in the world? No, not really - but it does the job. Most developer blogs only have a couple _Hello World!_ posts anyway, so Algolia might just be a tiny, _tiny_, bit overkill. Now take that time you saved and get back to scrolling Hacker News.
Publication Alert: Tim Leers
Published: 2022-01-28 10:00:34

---
title: Publication Alert: Tim Leers
published: true
date: 2022-01-28 04:53:00 UTC
tags: 
canonical_url: https://dataroots.io/research/contributions/new-publication-by-tim-leers
---

🙌 An article that our very own [Tim Leers](https://www.linkedin.com/in/tim-leers/?originalSubdomain=be) co-authored just got released.

A snippet of the summary:

> Engagement and training of community health workers (CHWs) have demonstrated their value in different conditions. Despite repeat epilepsy trainings of CHWs in Northern Rwanda, the treatment gap remained high. We hypothesized that effectiveness of CHWs on mobilization of patients living with epilepsy (PwE) could be improved using a validated tool for epilepsy screening.

Check out the full text [here](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC8780363/).

This article is only the beginning of some interesting series of publications on diagnosis and treatment of epilepsy in Rwanda, so stay tuned.
Vem aprender sobre HTML semântico 💜
Tags: html, beginners, frontend, webdev
Published: 2022-01-28 04:51:17

Antes de falar de semântica, vamos conceituar o HTML (Hypertext Markup Language). O HTML é basicamente um arquivo que pode ser lido pelos navegadores, nele podemos definir toda a estrutura de um site e seu conteúdo, seja ele texto, vídeo, imagem etc.
Entāo basicamente usamos o HTML para construçāo de páginas na web 👩‍💻

Entāo o que seria o HTML semântico?
Bem, antes do HTML5 (versāo atual) a estrutura de um HTML era dividida em divs e cada div tinha sua classe.
Entāo se eu quisesse fazer um header (cabeçalho) no meu site seria dessa forma:

```
<div class="header"> 
...
</div>
```

Mas essa estrutura dificultava os navegadores na hora da leitura e compreensāo, bem como os leitores de acessibilidade. 

Entāo a partir do HTML5 foram criadas as tags semânticas para facilitar na leitura e no processamento das informaçōes contidas na página.
Com o HTML semântico, nosso header (cabeçalho) pode ser descrito com a tag semântica header:

```
<header>
...
</header>
```

O header é somente um exemplo de tag semântica, existem aproximadamente umas 100 tags semânticas que podemos usar para ajudar os navegadores a interpretar melhor nosso site.

Confira uma lista dessas tags [aqui](https://developer.mozilla.org/en-US/docs/Web/HTML/Element)

![Diferença entre o HTML4 e o HTM5 semântico](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c4zflx9cmg2p6p00qr0r.png)

Lembrando que semântica também pode ser aplicada ao JavaScript e CSS! Veja um pouco [aqui](https://developer.mozilla.org/pt-BR/docs/Glossary/Semantics)
 

Referências
- https://www.hostinger.com.br/tutoriais/diferenca-entre-html-e-html5

- https://developer.mozilla.org/

Meu instagram: 
💬 @_dyanadev






[](url)
How I got Ruby snippets to run browser side in less than a day
Tags: ruby, webassembly, javascript
Published: 2022-01-28 04:22:01

Over the last year I've been working on Runno, an open source library and tool for embedding code snippets that run client side in the browser.

![Screenshot of the Runno website with Ruby support](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cgrcfgtyy6uo7it8pb9h.png)

I had some time yesterday to work on Runno and decided to see if I could add another language. I'd heard on twitter that Ruby was looking into adding official WASM support, so I had a look into what that was. Turns out the [proposal to merge WASI based WebAssembly support](https://bugs.ruby-lang.org/issues/18462) was perfect for me!

WASI stands for WebAssembly System Interface and it's a standard way for WebAssembly (wasm) binaries to talk to a system. This allows developers to use a single binding interface to interact with multiple different binaries. It's been primarily adopted for server-side execution, but for my use case of runnable code snippets it also works well.

I went and had a look at the PR for WASI support, assuming this would be a many month long process. When I looked [it had already been merged](https://github.com/ruby/ruby/pull/5407)! To get Ruby running on Runno I'd need to figure out how to compile it to WASM. I went to look at the building instructions, then I thought - I wonder if someone has already put it up on WAPM (the WebAssembly Package Manager)?

And it turns out that [kateinoigakukun](https://github.com/kateinoigakukun) who wrote that PR had also packaged [Ruby for WAPM](https://wapm.io/package/katei/ruby). Super handy!

With all of that sorted I could try out the package to see if it worked. Because there's a standard interface I don't need to put it into Runno to try it out, I can just use it in my terminal. I wrote an example ruby file:

```ruby
puts "G'day legend, how are ya?"
```

Then I tried running it with the Ruby package on WAPM:

```bash
$ wapm install katei/ruby
$ wapm run --dir=. ruby example.rb 
G'day legend, how are ya?
```

That looks like it works! Heck yeah!

Runno installs its packages using WAPM, it's based off a fork of [WebAssembly.sh](https://webassembly.sh) and so adding support for a new language already on WAPM is quite simple. If you're interested [here's the PR](https://github.com/taybenlor/runno/pull/181). The important change is:


```js
if (name === "ruby") {
    return { run: `cat ${entryPath} | ruby --disable=gems` };
}
```

I'm using `cat` to pipe the code over STDIN due to a bug I was seeing when the file path was passed as args to Ruby. I've also disabled gems because of another error I was seeing. I'll look into these in the future, but for now it works.

The result is that you can now make quick embeddable Ruby snippets for your website! Try clicking the run button below.

{% codepen https://codepen.io/taybenlor/pen/rNYVzOJ %}
Infinite city: Open Source AI Metaverse
Tags: opensource, csharp, github, machinelearning
Published: 2022-01-28 04:10:35

## [Wave Function Collapse](https://github.com/marian42/wavefunctioncollapse)
<span><strong><i class="fa fa-star">Star 3.5k</i> <i class="fa fa-eye">Watch 164</i> <i class="fa fa-code-fork">Fork 404</i></strong></span>


An infinite, procedurally generated city, assembled out of blocks using the Wave Function Collapse algorithm with backtracking.
There are houses, stairs, trees, and passages connecting houses in the city.
You can move, jump, and fly freely in the city, but no matter how you move, you can't reach the end, because the city will extend infinitely.
<img src='https://github.com/VorgContract/VorgMagazine/blob/master/assets/No.1/wavefunctioncollapse.gif?raw=true' style="max-width:80%; max-height=80%;"></img>