teleren/devto huggingface dataset:
Single Responsibility Principle (SRP) - Pense como um vingador
Tags: ruby, rails, solidprinciples, braziliandevs
Published: 2023-09-07 20:49:30

## Introdução
O Princípio da Responsabilidade Única (SRP) é um dos princípios SOLID do design de software orientado a objetos. Popularizado por Robert C. Martin, ou Uncle Bob, o SRP nos diz que cada classe deve ter apenas uma "razão para mudar". Vamos explorar esse conceito usando o exemplo dos Vingadores.

Cada herói dos Vingadores tem uma habilidade única que define sua "especialidade". O Homem de Ferro é um gênio da tecnologia, Thor é um deus com poderes mágicos, e a Viúva Negra é uma espiã habilidosa.

Todas as ações de cada herói estão alinhadas com essa especialidade única:

``` ruby
# Homem de Ferro e sua especialidade em tecnologia
class HomemDeFerro
  def disparar_misseis
    puts "Disparando mísseis!"
  end

  def voar
    puts "Voando alto!"
  end
end

# Thor e seus poderes Asgardianos
class Thor
  def usar_martelo
    puts "Martelo lançado!"
  end

  def convocar_raio
    puts "Convocando um raio!"
  end
end

# Viúva Negra e sua habilidade em espionagem
class ViuvaNegra
  def espionar
    puts "Coletando informações secretas."
  end

  def lutar
    puts "Lutando habilmente."
  end
end
```

## Coesão no design de software e domínio de negócios

O design de software não é uma ciência exata onde você pode simplesmente contar "responsabilidades". O que importa é a coesão, que se refere a quão bem as partes de um sistema trabalham juntas para formar um todo unificado. Em um código coeso, cada classe ou módulo tem uma responsabilidade claramente definida e todas as suas funções e variáveis contribuem para essa responsabilidade.

A coesão também deve ser entendida no contexto do domínio de negócios. Por exemplo, todas as habilidades do Homem de Ferro fazem sentido dentro do contexto de ser um gênio da tecnologia. Se esse contexto mudar, o que era coeso pode de repente não ser mais.

```ruby
class HomemDeFerro
  # ...
  # Adicionando uma nova habilidade defensiva :)
  def ativar_escudo
    puts "Ativando escudo de energia!"
  end
end
```

## Quando a coesão é perdida
Suponha que o Homem de Ferro ganhe a habilidade de prever o futuro. Isso seria uma violação do SRP, pois essa nova habilidade não tem relação com sua especialidade em tecnologia.

```ruby
# Homem de Ferro perdendo a coesão
class HomemDeFerro
  # Aí ta troll. Isso é papel do Dr. Estranho :(
  def prever_o_futuro
    puts "Prevendo o futuro!"
  end
end
```

## Conclusão
O SRP serve como uma orientação para criar sistemas mais robustos e confiáveis. Adicionar habilidades ou tarefas não alinhadas com a responsabilidade única pode tornar o sistema menos coeso e mais difícil de gerenciar.

Ao refatorar seu código, pense como um Vingador: qual é a sua "especialidade", e como você pode tornar seu código mais coeso dentro desse contexto?
It’s My Birthday!!
Tags: birthday, bday, watercooler
Published: 2023-09-07 20:23:07

Hey Y’all!

So today is a big day, it’s my birthday 🎉 🥳 🎂!!! I am turning [REDACTED] and am so happy to be one year older and one year wiser. Thank you for a great first 7/8 months on DEV.
Mojo🔥SDK has been released for Linux
Tags: mojo, python, ai, performance
Published: 2023-09-07 19:57:00

From the creators of LLVM, Clang, and Swift. A better Python, Python++... [Mojo is finally here](
https://www.modular.com/blog/mojo-its-finally-here).

3 months after the release of Jupiter online playground, one can download the SDK and play with Mojo in VSCode (on Linux with x86 CPU).

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

As a programming language, Mojo wants to be a superset of Python allowing it to run any Python code as-is while giving new constructs to solve well known problems.

As a platform, Mojo wants to be a 'Modular Stack' - an efficient hosting for AI/ML workloads.

Mojo today:
- Has implemented a limited set of Python features (e.g. there are no classes)
- Yet it has native interop with Python, making the whole ecosystem accessible
- Has 'strict' mode disabling dynamic typing and enforcing type checks (`fn` vs `def`)
- Promises C/C++ performance via static typing, native in-language support of SIMD extensions, and parallelism
- Self-contained builds with small runtime (22kb 'Hello world' app)

In the future Mojo plans to close the gap with Python syntax and introduce support for more hardware (more CPUs and GPUs), macOS, and Windows.

Let's wish them a good luck 👍
Console log timelines
Published: 2023-09-07 19:56:54

Logs are as necessary as tedious. They give valuable information in a usually terrible format. Coming to the rescue when we need to log time events, we have Chrono functionality in js-awe library:

https://www.npmjs.com/package/js-awe

```Bash
npm install js-awe
```

## Chrono

Chrono time events and visualize them.

Spread in your Async code some:

```Javascript
chrono.time('step1')
chrono.timeEnd('step1')
```

And then ```chrono.report()``` to log the timeline and some stats.

Full example: [chronoExample.js](https://github.com/josuamanuel/js-awe/blob/main/sandbox/Chrono/chronoExample.js)

```Plaintext
chronoCreation :  2023-05-25T20:58:17.175Z
report :  2023-05-25T20:58:18.480Z

Timeline of events:
┌────────┬───────────────────────────────────────────────────────────────────────────────────────┐
│ Events │ ms 0                                     650                             1186   1288  │
├────────┼───────────────────────────────────────────────────────────────────────────────────────┤
│ step1  │    |--------------------------------------|                                        || │
│ step2  │                                             |-------------------------------------|   │
│ step3  │                                              |-----------------------------|          │
└────────┴───────────────────────────────────────────────────────────────────────────────────────┘

Total elapse Time of each event:
┌─────────┬─────────┬────────┬────────────┐
│ (index) │  name   │ elapse │ percentage │
├─────────┼─────────┼────────┼────────────┤
│    0    │ 'step1' │  650   │   36.81    │
│    1    │ 'step2' │  615   │   34.84    │
│    2    │ 'step3' │  501   │   28.36    │
└─────────┴─────────┴────────┴────────────┘

Coinciding Events timeline:
┌─────────┬──────────────────────┬──────────┬────────────┐
│ (index) │    runningEvents     │ elapseMs │ percentage │
├─────────┼──────────────────────┼──────────┼────────────┤
│    0    │     [ 'step1' ]      │   650    │   51.38    │
│    1    │     [ 'step2' ]      │   114    │    9.04    │
│    2    │ [ 'step2', 'step3' ] │   501    │   39.58    │
└─────────┴──────────────────────┴──────────┴────────────┘
```
Build AI Apps in Minutes with Open Source Dify Ai
Tags: webdev, programming, python, ai
Published: 2023-09-07 19:27:50

[Dify Ai](https://uneedbest.com/build-ai-apps-with-open-source-dify-ai/) is a cutting-edge platform for LLMOps that empowers developers to create AI applications with ease and speed by utilizing a variety of large language models. The platform’s core idea is to define all aspects of an AI application, including prompts, contexts, and plugins, using declarative YAML files. With Dify, users can effortlessly orchestrate prompts, operations, dataset management, and more through a visually intuitive interface. By using Dify, users can generate an AI application in mere minutes or integrate LLM into their existing application for continuous enhancement.

You can build AI chatbots, Q&A robots, text generators, and other AI apps with Dify in just minutes.


[Learn More](https://uneedbest.com/build-ai-apps-with-open-source-dify-ai/)
Please Help
Tags: css, video, img
Published: 2023-09-07 18:56:50


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

Hello fam, please how do I make videos and images to be filling it's container and not showing in the  center of the container
How to work with git
Tags: github, beginners, softwaredevelopment, git
Published: 2023-09-07 18:44:23

**Step-by-step process**

Git is a version control system used to track changes in software development.

**How to get started with git?**

- Create a directory on your local machine, e.g., git-repos-test
- Move to directory git-repos-test

- `cd git-repos-test`
- Create a repository on GitHub, e.g., test-git
- Get the repository on your local machine using
- `git clone git@github.com:nitanagdeote/test-git.git`
- Move to the repository using
-` cd test-git`
- Create a React project or any other inside test-git, e.g., test-git-react-vite-project
- Make changes in your project directory.
- Check the status
`git status`
The result will show if changes are made or not.
Add the changes using,
`git add .`
Then, commit the changes using,
`git commit -m 'commit name'
`The changes can be pushed to the git repository using
`git push`
Create a branch using
`git branch 'branch name'`
Switch to branch using
`git checkout 'branch name'`
To pull changes from the remote git repository
`git pull`
To see how many lines of code has changed
`git diff`
These are the basic commands to get started with git.
To check if it's a git repo, use
`ls -a`

---

**Definitions**
Remote: means the repository hosted on the server
Local: directory on the local machine
Origin: is also the remote repository
git: command line tool

---

**What will you need to get started?**
Terminal window to use the git commands
GitHub

---

**Resources**
Git - Wikipedia
Git () is a distributed version control system that tracks changes in any set of computer files, usually used for…en.wikipedia.org
GitHub: Let's build from here
GitHub is where over 100 million developers shape the future of software, together. Contribute to the open source…github.com
Task4-Manual Testing,benefits & Drawbacks
Tags: beginners, python, manualtesti, learning
Published: 2023-09-07 18:34:03


Manual Testing:

1. It's a type of testing that involves validation and 
 requirements of an application by executing it using a set of test cases that are tested manually without using any automated tool.
2.Manual testing aims to identify software application 
 bugs,issues,and defects.
3.It is the most primitive technique of all the testing types 
 which helps to find the critical bugs in the application.

The types of manual testing are:

1.whitebox testing:
   This testing is performed at the unit level and is also known as clear box,structural and glass box testing.
In this type of testing,the testers will use the programming skills to design the test case.


2.Black box testing:
    Black box testing can be applied to all levels of the testing.That is like integration,unit,acceptance and system testing.
Here the testers access the functionality of the software
application.

3.Acceptance testing:
    It is also known as pre-production testing.
Along with testers,end users perform testing for validating the functionality of the application.
After completing the testing successfully,a formal testing is conducted to decide whether the application is built according to the requirement.

4.Unit testing:
   It is also known as component testing or module testing.
it is carried out to verify whether the particular module or unit peice of code is working properly or not.
it is usually performed by the developers.

5.System testing:
    It verifies the entire system to ensure that the application works as planned.
It is the process of testing a completely integrated application and its defined requirements,also known as end-to-end testing.

6.Integration testing:
    It is the mechanism of testing the software between the two software modules.
It is done by various approaches called the top-down approach,Bottom-up approach,and the big-bang approach.

The Benefits and drawbacks of manual testing:

Benefits:
1.It detects almost every bug and issues of the software application.
2.Testers can access visual components like layout,and text,and also identify the UI and UX issues
3.If we are making any changes to the application so that it can be adopted easily.
4.As we do not use any high-level language or any type of tools,it will be a low-cost operation.

Drawbacks:
1.The primary disadvantage is,that it is time-consuming.
2.It is not easy to discover the size difference between GUI objects.
3.Regression test cases are time-consuming.
4.Performance and load testing are impossible.

A Simple example of manual testing would be login screen-we could test quite a few scenarios that are enlisted below:
1.checking if Both username and password are entered and not blank.
2.Verifying if screen navigates to next page incase valid login credentials are provided.
3.Incase of invalid login,ensure system doesn't navigates further,but display error message.
4.checking the maximum possible length of login and password fields.
My History Teacher Modernized…
Published: 2023-09-07 18:31:33

My History Teacher back from my childhood days has modernized, and he was a very musical teacher. I want you to show him some support. He posts his historical music on YT at the link below so go sub to him!![https://www.youtube.com/@silencedogoodsings9810/videos](https://www.youtube.com/@silencedogoodsings9810/videos)
User Groups with custom permissions in Django
Published: 2023-09-07 18:20:02

Whether you're building a simple blog or a complex web application, Django's user groups and custom permissions offer the flexibility and security needed to control user access effectively. This level of access control ensures that users can interact with your application securely, protecting both your data and your users' experience.

read this article to know more about user groups with custom permissions
 https://mccall167.medium.com/title-user-groups-with-custom-permissions-in-django-a-guide-to-fine-grained-access-control-486e32c86cee
Professional literature as a way to improve your analytics skills
Tags: analytics, datascience, management
Published: 2023-09-07 17:53:55

This article is intended to reset the priorities for analysts from hard skills and frameworks to a broader understanding of the value of analytics. It will be helpful to data professionals of any level. As in the good old days, reading books is the best way to understand things better. 

Online education has revolutionized the way we learn now. The process is as democratized as it never was; millions of users have access to a variety of courses. It is a significant trend that is difficult to overestimate. There are several things that could be improved with this approach, though. The first one is that the increased number of programs makes it more challenging to choose a good and trustworthy one. The second significant problem - the courses are usually short, basic, and very practical. This format converts better than others. The students who did such studies typically tend to think about the profession as a set of actions rather than trying to get deeper. 

Analysts, like many other IT specialists, are also very often those who learn by doing. Learning by doing is an excellent way to boost your knowledge. But this boost may be much faster and have much higher quality if supplemented by previous generations' wisdom. 

It is worth reading to enhance the knowledge from online courses or structure your knowledge in analytics gained in your workplace.

To be honest, there are not so many previous generations of data analysts in the current understanding of the term. The term data-driven has only been used in the business context since the early 2000s. It means that there are only 20 years of literature on the topic. But several books are a must-read for any analyst and head of analytics especially.

If you don't have time at all, take two books from practitioners - two books by DJ Patil, the second one co-authored with Hilary Mason: "Building Data Science Teams" and "Data-Driven - Creating a Data Culture" - both published by O'Reilly. Thus, you will have a chance to understand, in general, what a good analytics team should look like, what it should do, and how the decisions should be dated in a company.

If you have more time - please refer to the most cited works about data-driven decision-making - such pillars as Davenport's "Competing on Analytics" or papers by Brynjolfsson. These fundamental works mean the same for modern data analytics as Odyssey for contemporary literature. 

If these two are Odyssey, Anderson's "Creating a Data-Driven Organization" is Uliss. Anderson builds over all the previous literature and perfectly explains all dos and don'ts. 

Having read these books, you will have a clear vision of where you want to move your organization from the point of view of data usage for decision-making and will avoid some of the pitfalls that can wait for you in this way.
What are the key benefits of investing in cheap web design services?
Published: 2023-09-07 17:47:00

Key benefits of [cheap web design](https://websvent.com/):

Affordability: Saves money.
Quick Launch: Gets online fast.
Basic Functionality: Essential features.
Upgrade Potential: Add more later.
Business Starter: Ideal for startups.
Online Presence: Better than none.
App performance lags on Samsung devices
Published: 2023-09-07 17:38:39

App performance lags on Samsung devices running Android OS 13 and Samsung S23 Ultra.

Especially when going from one page to another, it takes at least 10 seconds.

Additionally, the below error in Android locket
Layer History | Surface Spruce | main function maximum (could not resolve refresh rate)

React Native Edition
0.72.4

Note : No issues in iOS
Any one starts to face the issues in Android 13 OS. Kindly guide me. It is really helpful.
Avoid DDD to overwrap Laravel App
Published: 2023-10-18 08:12:02

---
title: Avoid DDD to overwrap Laravel App
published: true
date: 2023-09-07 17:30:00 UTC
tags: 
canonical_url: 
---

Laravel လို Structured ရှိပြီးသား Framework တွေမှာ DDD Apply ရတာနည်းနည်း Handy ဖြစ်တယ်။ Namespace သပ်သပ်ခွဲထုတ်တာထက်၊ Domain တွေက Application Layer Level ဖြစ်တာကြောင့် App Directory အောက်မှာဝင်ရေးတာပိုအဆင်ပြေတယ်။ Controller တွေကို Domain အနေနဲ့ထားတာမျိုးတော့သဘောမကျပါဘူး။ သူ့နေရာသူထားပြီးတော့ Domain Name အပေါ်ကနေ Folder အနေနဲ့ထပ်အုပ်ပေးတာက FDD ကို Promote လုပ်သလိုမျိုးဖြစ်သလို DDD ရဲ့ Feel ကိုလည်းအရသာမပျက်တော့ဘူးပေါ့။ ဒီနေရာမှာ DTOs လို၊ Context လိုကောင်တွေကိုသက်ဆိုင်ရာ Domain အောက်မှာပဲထားသင့်သလို၊ Models a.k.a Projections တွေကိုလည်း Domain အောက်မှာပဲထားဖို့လိုပါတယ်။ ကျန်တဲ့ migration လိုကောင်တွေကို Bloated Infrastructure အနေနဲ့ယူဆရင်လည်းအလုပ်ဖြစ်တာမို့ Folder တွေအောက်မှာခွဲထားပြီးတော့ရှိပြီးသား Laravel Structure ကိုမဖျက်ဘဲနဲ့ Boilerplate Code တွေကိုလျှော့ပြီးထည့်လို့ရပါတယ်။
Best Agriculture colleges in UP
Tags: education
Published: 2023-09-07 17:20:07

TMU is a top-notch [agriculture Colleges In UP]
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ac6vb40z6w5p133nt4rp.jpg)(https://www.tmu.ac.in/college-of-agriculture-sciences), offering students a comprehensive educational experience. It has a long history of excellence in research and teaching. Located in Moradabad, Uttar Pradesh, the university has gained national recognition for its academics and is home to a diverse community of students. Its faculty members are experts in their fields and provide the best education available. It also offers excellent facilities, including well-maintained lawns and air-conditioned classrooms.

The BSc agriculture program at TMU is an ideal choice for those looking to pursue a career in the field of agricultural science. This undergraduate degree focuses on research and practice and covers plant genetics, soil science, and crop pathology. This program is a great fit for those who enjoy working in the field and want to make a difference in the world.

TMU is a private university that offers over 150 programs at the undergraduate and postgraduate level in a wide variety of specializations. The university is UGC-recognized and offers degrees in medicine, dentistry, pharmacy, paramedical sciences, nursing, physiotherapy, hospital administration, management, engineering, polytechnics, law, fine arts, and Jain studies. Students can apply to TMU through the CUET or UPCET examinations, and admission is granted on merit.
The "Something else" option in Linux installation
Tags: beginners, tutorial, linux
Published: 2023-09-07 17:12:27

> I won't be very detailed in this post, it's more of a future reference for my future self in case I need to go through this again. In the "References" section of the post, I will leave some links to content by people who have explained what is being done in more detail. Still, I hope it can help someone else as well.

How it does not happens every day, I always forget how to setup the partitions in Ubuntu (or other OS's) when I need reinstall the system keeping my dual boot in order.

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

I recommend you format your Linux system (ig Ubuntu) in Windows, and when installing the new one, use the option "alongside". It's more safe and simple.

But we are here to use the "Something else" option. Below is a simple step by step of how use it.

1. The biggest space (which will be for the operating system) use type `ext4`. For its `mount point` put the value `/`.
2. Create a "swap" partition with 2048MB (2GB)
3. Setup the field `Device for boot loader installation` to your `Windows boot manager`
4. And you are ready to "install now"

![Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6hlh2wg522qy9ckm7fz4.png)


### References

1. https://www.youtube.com/watch?v=GXxTxBPKecQ&ab_channel=SavvyNik
2. https://devicetests.com/install-ubuntu-alongside-windows
3. https://www.youtube.com/watch?v=4PXbdGHo5I8&ab_channel=LearnComputerTechnologies
4. https://www.youtube.com/watch?v=vcOMWfykE34&ab_channel=QiroLab
Announcing the Public Beta of doc-ai
Tags: ai, document, news, buildinpublic
Published: 2023-09-07 16:25:56

I'm thrilled to introduce the public beta of [doc-ai](https://doc-ai.app), a groundbreaking AI-powered platform designed to deeply understand and process the contents of your documents. Say goodbye to the days of endlessly skimming through pages to find that one piece of information. Now, you can simply ask a question and get precise, contextual answers directly from the text!

###How Does It Work?
At its core, [doc-ai.app](https://doc-ai.app) leverages cutting-edge artificial intelligence to read and interpret documents just like a human would, but at lightning speed. Whether you have lengthy **research papers**, detailed reports, or **comprehensive manuals**, our AI can digest the content and provide you with answers in seconds.

###Why Use doc-ai.app?
**Save Time**: No more manual searching. Get the information you need instantly.

**Increase Accuracy**: Receive answers that are contextually relevant, reducing the risk of misinterpretation.

**User-Friendly**: Designed for everyone, from students to professionals. **No technical expertise required**.

I invite you to try it out and experience firsthand the power of AI-driven document comprehension. Try out the public beta of [doc-ai.app](https://doc-ai.app) 

**Discount:** 20% off for the first 15 to upgrade to premium using the following discount code: **PUBLICB**

Let me know your feedback!