teleren/devto huggingface dataset:
Melhorando a eficiência com processamento assíncrono em filas
Tags: laravel, filas, webdev, braziliandevs
Published: 2024-05-13 16:10:24

Há alguns meses assumi o desenvolvimento de um projeto e logo de cara precisei resolver um problema que estava acontecendo na geração de relatórios. Nesse post eu vou explicar um pouco mais sobre esse problema e como resolvi usando processamento assíncrono com filas.

## Cenário problemático
O sistema estava desenhado para quando o usuário clicar no botão de "Baixar relatório", um endpoint no backend era chamado. O endpoint buscava os dados do banco de dados, processava os dados e retornava para o frontend em formato csv, então o arquivo csv era baixado para a máquina do usuário.

Esse fluxo até que funcionava bem quando o relatório tinha poucos registros, mas quando o número de registros aumentava, isso já gerava alguns problemas como timeout na requisição, e as vezes até travava a aplicação inteira pelo consumo exagerado de memória no processamento dos dados.

## Solução
A solução adotada foi mudar o fluxo de download dos relatórios, agora quando o usuário solicita um relatório, o backend vai criar um "job" para esse relatório, adiciona-lo a uma fila de processamento e retornar a requisição imediatamente para o frontend informando que o job foi criado.

Agora, com esse job adicionado na fila, o sistema em um outro processo que vai consumir os jobs que chegam na fila, vai gerar o relatório e quando terminar vai notificar o usuário que o solicitou.

Além de mover o processamento do relatório para ser executado em segundo plano, o processamento também foi dividido em pequenas partes (chunks), ou seja, invés de buscar 1 milhão de registros no banco de dados, trazer isso para a memória da aplicação e processar, agora a aplicação busca os registros de 100 em 100 por exemplo, processa os 100, quando termina de processar, busca mais 100 até processar o relatório todo.

Dessa forma, o problema de timout foi resolvido, já que o endpoint não processa mais o relatório todo na mesma requisição. O problema de consumo de memória também foi resolvido, já que agora há um número limitado de registros que podem ser processados ao mesmo tempo.

## Tecnologias
Para esse projeto, eu utilizei as ferramentas do ecosistema [Laravel](https://laravel.com). Usei as [filas do laravel](https://laravel.com/docs/11.x/queues), integrada com o redis, e para processar e agrupar os chunks usei os [Job batches](https://laravel.com/docs/11.x/queues#job-batching).

## Conclusão
Independente da tecnologia, o mais importante é entender o conceito de filas e processamento assíncrono e saber quando utilizar. Nesse caso específico a solução proposta funcionou bem e o problema foi resolvido.
thePodsFactory - The Sleeppods Factory
Published: 2024-05-13 16:09:40

Founded by Robin Hagedoorn and Bram Breukers, [The Pods Factory](https://thepodsfactory.com/) is a pioneering venture into the future of hospitality, offering luxurious, sustainable, and modular sleeping pods tailored for the modern hotel and hostel industry. Leveraging expertise from the award-winning Bunk Hotels, The Pods Factory enhances guest experiences by blending privacy, comfort, and design efficiency. Our mission is to assist hoteliers in optimizing space and elevating accommodation standards without compromising on quality or sustainability. Let's transform the hospitality landscape together.
What are your goals for week 20 of 2024?
Tags: discuss, motivation
Published: 2024-05-13 16:06:16

 It's week 20 of 2024. We're in the second full week of May. Schools are wrapping up for the summer.

## What are your goals for this week? 

- What are you building? 
- What will be a good result by week's end?
- What events are happening this week? 
  * any suggestions for in person or virtual events?
- Any special goals for the quarter?


### Last Week's Goals
 
- [:white_check_mark:] Continue Job Search. 
- [:x:] Project work. * Some research for one. Worked on content for another but no coding.
- [:x:] Blog. 
- Events.
  * [:x:] Thursday Virtual Coffee. 
  * [:white_check_mark:] 11ty conference. Thursday, Forgot about this when I made my post last week. My calendar just said event with no info. This the add to calendar didn't work.
- [:white_check_mark:] Run a goal setting thread on Virtual Coffee Slack. It's our month of kindness.
- [:white_check_mark:] Went to the ren faire need to edit my photos.


 
### This Week's Goals


- Continue Job Search. 
- Project work.
- Blog.
- Events.
  * Thursday Virtual Coffee. 
- Run a goal setting thread on Virtual Coffee Slack.
- Went to the ren faire again need to edit my photos.



### Your Goals for the week 

Your turn what do you plan to do this week? 

- What are you building? 
- What will be a good result by week's end?
- What events are happening any week? 
  * in person or virtual?


```html
-$JarvisScript  git commit -m "Hip Hip, Huzzah!"
```
861. Score After Flipping Matrix
Tags: php, leetcode, algorithms, programming
Published: 2024-05-13 16:06:08

861\. Score After Flipping Matrix

Medium

You are given an `m x n` binary matrix `grid`.

A **move** consists of choosing any row or column and toggling each value in that row or column (i.e., changing all `0`'s to `1`'s, and all `1`'s to `0`'s).

Every row of the matrix is interpreted as a binary number, and the **score** of the matrix is the sum of these numbers.

Return _the highest possible **score** after making any number of **moves** (including zero moves)._

**Example 1:**

![lc-toogle1](https://assets.leetcode.com/uploads/2021/07/23/lc-toogle1.jpg)

- **Input:** grid = [[0,0,1,1],[1,0,1,0],[1,1,0,0]]
- **Output:** 39
- **Explanation:** 0b1111 + 0b1001 + 0b1111 = 15 + 9 + 15 = 39

**Example 2:**

- **Input:** grid = [[0]]
- **Output:** 1

**Constraints:**

- `m == grid.length`
- `n == grid[i].length`
- `1 <= m, n <= 20`
- `grid[i][j]` is either `0` or `1`.


**Solution:**

```
class Solution {

    /**
     * @param Integer[][] $grid
     * @return Integer
     */
    function matrixScore($grid) {
        $m = count($grid);
        $n = count($grid[0]);
        $ans = $m;

        for ($j = 1; $j < $n; ++$j) {
            $onesCount = 0;
            for ($i = 0; $i < $m; ++$i) {
                $onesCount += $grid[$i][$j] == $grid[$i][0];
            }
            $ans = $ans * 2 + max($onesCount, $m - $onesCount);
        }

        return $ans;
    }
}
```

**Contact Links**

- **[LinkedIn](https://www.linkedin.com/in/arifulhaque/)**
- **[GitHub](https://github.com/mah-shamim)**
New Gamedev.js Jam 2024 t-shirt: Power!
Tags: gamedev, gamedevjs, power, javascript
Published: 2024-05-13 16:02:36

---
title: New Gamedev.js Jam 2024 t-shirt: Power!
published: true
date: 2024-05-13 15:57:07 UTC
tags: gamedev,gamedevjs,power,javascript
canonical_url: https://gamedevjs.com/competitions/new-gamedev-js-jam-2024-t-shirt-power/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0lct0mgl3dgeac5n48oj.png
---

Brand new t-shirt is now [available in our Shop](https://gamedevjs.myspreadshop.com/gamedevjs+jam+2024+power-A661e551b39eae846bbdbec06), and similarly to the 2023 one it follows this year’s theme:  **Power**! This means the **Shop** now holds four different t-shirt designs:

- [Gamedev.js Jam](https://gamedevjs.myspreadshop.com/gamedevjs+jam+artwork-A65bbc12949743f4e8da3859e)
- [Gamedev.js Jam 2023: Time](https://gamedevjs.myspreadshop.com/gamedevjs+jam+2023+artwork-A65bbc129597ee44b23c076dd)
- [Gamedev.js Jam 2024: Power](https://gamedevjs.myspreadshop.com/gamedevjs+jam+2024+power-A661e551b39eae846bbdbec06)
- [Gamedev.js Weekly](https://gamedevjs.myspreadshop.com/gamedevjs+weekly-A65bbc1295e1af93b7370e4fb)

There’s a **15% off promo** on everything for the next **four days** , so grab any design you like with a discounted price! Every sale supports organizing next editions of the Jam, thank you!

### Prizes and 2025

All the [prizes](https://gamedevjs.com/jam/2024/#prizes) will be emailed to you this week, so if you won anything, please keep your eyes on the email address you provided when submitting your entry through Itch.

There’s also the [Gamedev.js Jam 2025](https://gamedevjs.com/jam/2025/) page published and the [2025 Itch](https://itch.io/jam/gamedevjs-2025) up as well, so you can already **join** to be up to date with any announcements. Thanks again and hopefully see you next year!
Yokai - new SQL module
Tags: go, sql, observability
Published: 2024-05-13 15:52:35

Yokai, until today, came only with an ORM module (based on GORM), cause it has been the fastest way to provide DB access while having a good observability (logs, traces) by using GORM hooks.

We've been working on and just released an SQL module:

- based on **database/sql** 
- with out of the box **observability** (SQL logs and traces)
- with a **migrations** mechanism (based on Goose)
- with a **seeding** mechanism (for testing)
- with a **hooking** mechanism (to extend logic around SQL operations)

Since it's decorating database/sql, you can use tools like **SQLC** with it.

The documentation is here: https://ankorstore.github.io/yokai/modules/fxsql/

Hoping this may help 👍
Ctrl + Alt + Kubernetes: Navigate the Cloud-Native Cosmos with Me :-)
Published: 2024-05-13 15:49:52

Hey Dev.to Community!

Allow me to introduce myself: I'm Tal Yitzhak, a passionate Solutions Architect deeply immersed in the world of cloud-native technologies and Kubernetes wizardry. :-)

My fascination with cloud-native architecture and its potential for revolutionizing the way we build and deploy applications led me to dive headfirst into the realm of DevOps and Kubernetes administration. Over the years, I've honed my skills in managing cloud-native production deployments on Kubernetes and developing advanced CI/CD pipelines using a variety of tools and technologies including Python, Helm, Kubernetes, Docker, ArgoCD, and Argo Rollouts.

My journey into cloud-native technology has been greatly inspired by the vibrant community surrounding the Cloud Native Computing Foundation (CNCF). As a fervent advocate for open-source collaboration and innovation, I've found immense value in contributing to and learning from this dynamic ecosystem. 

I invite you to read and provide feedback for my technical coverage (more at [https://medium.com/@talyitzhak](https://medium.com/@talyitzhak)):

- ["Java Application Tracing: Quick Setup in K8S with OpenTelemetry and Jaeger in Under 15 Minutes"](https://medium.com/faun/java-application-tracing-quick-setup-in-k8s-with-opentelemetry-and-jaeger-in-under-15-minutes-47302d5f1b2f)
- ["True Developer Story: Navigating Challenges with Traditional Logging vs OpenTelemetry Tracing"](https://medium.com/faun/true-developer-story-navigating-challenges-with-traditional-logging-vs-opentelemetry-tracing-deffe348ad55)
- ["How Helm Subcharts Make the Transition to Argo Rollouts a Breeze"](https://medium.com/faun/how-helm-subcharts-make-the-transition-to-argo-rollouts-a-breeze-aaf160924dbf)
- ["Smoothly Migrating Argo CD to a New Kubernetes Cluster: A Step-by-Step Guide"
](https://medium.com/faun/smoothly-migrating-argo-cd-to-a-new-cluster-a-step-by-step-guide-1c93c96358f7)

Let's embark on this journey together as we navigate the exciting frontier of cloud-native technology!

Cheers,
Tal Yitzhak
Developed a website for a friend.
Tags: webdev, react, gsap, nextjs
Published: 2024-05-13 15:48:17

Abhishek this side. Developed a animated and interactive website for a friend of mine. Used Next JS and GSAP for the frontend and animation respectively.

It is live at - [babbar.vercel.app](https://babbar.vercel.app)

Also, I would love to see your portfolio's too. Please share your portfolio link in the comment.

![Home page of the portfolio website of abhishek babbar.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/85gybx4dm7qglvrd4bdu.png)

Regards, 
Abhishek.
Kg Digital
Tags: digitalmarketingagencyindelhi, digitalmarketingservices, websitedevelopmentservices, digitalmarketingagencydelhi
Published: 2024-05-13 15:47:38

KG Digital is one of the Best digital marketing agency in Delhi which was good and it was a phenomenal experience for them. We have many services available like Social Media Marketing, SEO services, Graphic Design, Web development, etc. We assure of good quality services from our team.

(www.kgdigital.in)
Safeguarding Avalonia Apps with ByteHide Shield 🛡️
Tags: avalonia, shield, security, dotnet
Published: 2024-05-13 15:41:51

From ByteHide we are thrilled to announce our partnership with AvaloniaUI to enhance application security with ByteHide Shield, our cutting-edge obfuscation tool.

## Understanding the Importance of Application Security

Security is a critical aspect in the Avalonia development environment. When applications are compiled in .NET, the code is converted into Intermediate Language (IL), making it highly susceptible to reverse engineering and code manipulation. This can be translated into significant risks to intellectual property and application security.

### Unlocking the Power of ByteHide Shield for Avalonia Applications

[ByteHide Shield](https://www.bytehide.com/products/shield-obfuscator) addresses this vulnerability by obfuscating IL code, making it encrypted [while](https://www.bytehide.com/blog/while-loop-csharp) preserving its functionality. This additional layer of protection fortifies Avalonia applications against unauthorized access, intellectual property theft, and malicious alterations.

-   **Enhanced Security:** Shielding Avalonia apps from reverse engineering threats ensures robust protection.
-   **Simplified Protection:** Easily secure your applications in just a few clicks, making advanced security effortless for developers of any expertise level.
-   **Safeguarding Assets:** Preserving intellectual property and sensitive data within Avalonia applications is a top priority, maintaining competitiveness and regulatory compliance a breeze.

## Avalonia: Empowering Developers with Cutting-Edge UI Solutions

At ByteHide, we are proud to provide support for Avalonia UI. Avalonia offers a versatile and powerful [framework for building cross-platform applications](https://avaloniaui.net/XPF) with rich user interfaces. By combining the robust features of Avalonia with the advanced security capabilities of ByteHide Shield, developers can create secure, high-performance applications that deliver exceptional user experiences.

The partnership between Avalonia and ByteHide represents a significant advancement in safeguarding Avalonia applications from potential threats. As cybersecurity risks continue to evolve, ByteHide Shield offers a powerful solution, allowing developers to focus on creating outstanding applications while entrusting security to experts.

We are committed to protecting Avalonia applications and providing all the necessary tools to ensure their security. Visit our website to learn more about ByteHide Shield and how we can help you protect your Avalonia applications: [ByteHide Shield – Secure Your Avalonia Applications](https://www.bytehide.com/products/shield-obfuscator/dotnet/avalonia)

Stay secure while developing your Avalonia applications with ByteHide Shield!

If you want to learn more about Avalonia, don’t forget to visit [their website](https://avaloniaui.net/)!
Premium Barbershop
Published: 2024-05-13 15:41:49

Welcome to our premier barbershop destination located at 969 3rd Ave. Here, we offer an unparalleled grooming experience with our signature [premier cuts](https://premiumbarbershop.com/969-3rd-ave/). Our barbers are dedicated to providing personalized service, ensuring that each haircut is tailored to your individual style and preferences. Whether you prefer a classic, clean-cut look or a more modern and edgy style, we have the expertise and creativity to deliver. Step into our stylish and inviting space, and let us elevate your grooming routine to the next level. Book your appointment now and discover why we're the go-to destination for discerning gentlemen.
peviitor.ro powered by Apache SOLR
Tags: peviitor, motordecautare, backend
Published: 2024-05-13 15:29:37

## Ce este peviitor.ro?

_peviitor.ro_ este un motor de căutare de munca din România. 

> ![peviitor.ro](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wq0ul7g0w0fhpejfdtad.png)

Locurile de muncă din România sunt actualizate zilnic pentru a primi în fiecare clipă informații corecte și exacte.
[peviitor.ro](https://peviitor.ro/)

---

## Care este infrastructura PROD?

_SOLR operează pe portul 8987 redirecționat din zimbor.go.ro de pe portul 80._


- Server PowerEdge-T110-II

![Server PowerEdge-T110-II](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anu7zbymj0cxvmz7zf4f.png)


- Memoria

![Memoria](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pg43m9et4jxk1xcgnamq.png)


- Hard Disk

![Hard Disk](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdiaykhdiz8ebh6sasks.png)


- Sistem de operare

![Sistem de operare](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p25moyh2qw9d1qilnxfv.png)

---
## Care este infrastructura TEST?

_SOLR rulează pe portul 8985_


- Raspberry Pi 400

![Raspberry Pi 400](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s3fg1dgve7nj5wkgofck.png)


- Memoria

![Memoria](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8h3r685azhy8lo6vm9zp.png)


- Hard Disk

![Hard Disk](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfwlyvji8acxsvsfb23p.png)


- Sistem de operare

![Sistem de operare](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/apfovymrvisjut1ttp02.png)

---
The Right Way to Learn Javascript
Tags: javascript, tutorial, codenewbie, beginners
Published: 2024-05-13 15:20:41

You want to learn JavaScript.....
You watch a 10 hr Javascript course....
You don't complete it.....
Now, you think Javascript is hard.....

THIS WAS MEANT TO HAPPEN.

BUT WHY?

Learning methods are different for each and every one. You can't expect to complete a 10 hr course on YouTube while you can't sit for a 10 min video. The friction will happen. You're not ready to consume whole 10 hr video with loads of javascript concepts at a time because your mind first process the information that it will take a lot of time to complete the course. And the breakdown happens automatically.

INSTEAD DO THIS...

There is a free website I came accross which is the best resource for learning JavaScript.

[jschallenger](https://www.jschallenger.com/)

It will take you step by step 🪜 process to learn JavaScript and you'll not feel any stress learning it.

Happy Learning 🎉
New asserts for testing stopped streams after Ruby on Rails 7.1.
Tags: changelog, testing, rails
Published: 2024-05-13 15:10:04

Previously, developers encountered a significant challenge verifying if streams ceased operation correctly. This issue often led to the creation of intricate workarounds or the omission of proper testing.

## The Old Way

Here's an e­xample:

```ruby
assert_not ActionCable.server.pubsub.redis_connection_for_subscriptions.subscribed_to?("messages")
```

This code­ works but isn't straightforward to update.

## The New Solution

The following Ruby on Rails introduces `assert_has_no_stream` and `assert_has_no_stream_for`. These new methods simplify the testing of stopped streams.

```ruby
assert_has_no_stream "messages"
assert_has_no_stream_for User.find(42)
```

With these new assertion methods, you can straightforwardly express your test goals. This simplicity and clarity strengthen your tests and make them easier to maintain, giving you confidence in the reliability of your code.
I have launched my Flutter Boilerplate🚀
Published: 2024-05-13 15:06:33

FlutterPlate is boilerplate with Clean Architecture. It has RevenueCat and Admob integration. It can work with three types

of data traditional REST Api, Sqlite Drift in our case and Firestore.

It also has almost all Firebase products configured. There are already templates for Paywall and Settings with needed buttons and services which handle these buttons actions.

Let’s take a closer look at Data layer. Here we are separating our 3 types of Data.

If you don’t use rest you can just simply remove whole folder related to it. And left only data type you will use for certain project. This is advantage of Clean Architecture.

We are not dependent on data sources. Our Data layer serves for Presentation.

Then we have Domain layer. It is layer which has only Dart code. It is clear from dependencies here we have rules for communication of Presentation with Data layer. It means we will have here our repository and entity models.

And our main layer is Presentation. Here we will handle all our business logic and UI.

So as you can see we have bunch of service files. Here we have routing, our payment controller, and ad controller. And also of course pages folder which holds our screens with own controllers.

And things related to some handy methods, our stylings, colors, assets we will store inside Core.

Check it out here https://flutterplate.dev/

So thank you for your time, do not hesitate to contact me if you have any questions. See you later.

support@flutterplate.dev
Uso Eficiente de Memoria en PHP con WeakMaps
Tags: php
Published: 2024-05-13 14:43:19

En el ámbito del desarrollo web, la optimización del manejo de memoria juega un papel crucial en asegurar el rendimiento y la escalabilidad de nuestras aplicaciones. En PHP, existe una herramienta poco reconocida pero sumamente eficaz para esta tarea: el WeakMap.

[Leer más](https://angelcruz.dev/post/ahorro-memoria-php-weakmaps?utm_source=devto&utm_medium=social&utm_campaign=promotion)
Fixing Most TypeScript Intellisense issues in VS Code
Tags: typescript, vscode
Published: 2024-05-13 14:34:40

I'm having this issue constantly, specially with devcontainers or other virtual environments, where I suddenly have hundreds, if not thousands of intellisense errors all over my TS code while the app works just fine.

This is mostly due to VSCode not selecting the correct TS Version automatically. Even if you have `"typescript.tsdk": "node_modules/typescript/lib"` in your `.vscode/settings.json` it mostly fails. 

To solve this:

1. Open any typescript (`*.ts`) file.
2. Hit `F1` or `Ctrl + Shift + P`
3. Search for "TypeScript: Select TypeScript Version..." and hit enter
4. Select "Use Workspace Version" (even if the version number is the same as VSCode's version)
5. Reload VSCode (close it and reopen it) for it to take full effect and for it to reprocess all open tabs.

This is usually how I fix the issue.
Vue 3 Admin Template
Tags: webdev, javascript, programming, vue
Published: 2024-05-13 14:18:17

Devs, Please I have a question and I hope you help me with an answer or any of your followers that sees this. I'm a react dev and I'm transitioning to Vue, Vue 3 actually, I have learned it and built couple of projects etc  it like expense tracker, todo app etc. Now I'm gonna be in a team to work on a project. So I was sent a template, admin template starter kits. I ran the template and it has documentation inside of it. I'm reading the guide in the docs but I'm curious about something. If tasks is given to me, probably to implement a feature or somewhat
Is there gonna be a specific way to go about it? I have worked in a team before during my internship but we didn't work with a template. So I need explanations on how to navigate through it and what would be expected of me. If anyone has worked on a template before. 
Thanks Devs