teleren/devto huggingface dataset:
How to pick proper name of classes?
Published: 2023-03-09 11:36:38

---
title: How to pick proper name of classes?
published: true
date: 2023-02-25 00:00:00 UTC
tags: 
canonical_url: https://karas.codes/posts/how-to-pick-proper-name-of-classes/
---

Did you ever ask yourself how you could save time on development stage? It would be very nice when you could implement some part of code way faster than now. Especially when you develop a lot of new features or extending existing ones. In this post I will show you very simple trick to achieve it!

# Don't you try to find name before you implement a class

The trick applies to structural programming too, but we are mostly using OOP on our daily basis. So I will use class as an example.

Imagine that we want to implement a class that would be doing some complex operations for us. Let's say we gathered some requirements at the first step (I will give couple examples):

* we want to take a photo from a webcam by using our browser extension
* we want to process data in a way that output would be ready to show to our client
* we want to validate URL based on rule configured by our client

In all those cases we will be able to divide code into a couple of classes. If we don't want to use meaningless names like: controller, manager, service - then we could use that simple trick

# Use some temp name

Yes, that is so simple. Use 'Foo' or 'Bar' for your class, implement whole logic encapsulated by this class. Of course, you need to remember that single class should do single thing, without any side effects. Also, remember about implementing unit-tests. Implementing both of them and sticking with very small class that have single purpose of use will let you create a name very quickly - once you finish implementing it or even in the middle of the process.

**Remember:** change the temp name to the correct one, before merging your code into the main branch.

Hope that you found it useful!
Cluster clusterfuck
Tags: kubernetes, linux, vagrant, libvirt
Published: 2023-02-24 23:50:40

If you have gained some experience in Kubernetes, then you definitely know that debugging distributed systems is .... a beast.

So, here are some short picks that I came across administrating my own cluster where all nodes are virtual machines running via KVM/QEMU.

## Time management

Make sure all your nodes have a correct time. Chrony is a good choice for that. That is even more true, when your nodes are virtual machines, and you have snapshots that your can revert back to. After such a revert, time will be a mess. So, make sure your time is accurate, to the millisecond!

## Overlay networks

In my cluster, I use project Calico. It works fine, but it seems it has some problems after reverting the cluster back to a previous state. Even after a time synchronization, I still - especially with Rook Ceph - encountered some weired scenarios where some Pods could not communicate correctly. So, I always run `kubectl -n calico-system delete pods -l k8s-app=calico-node`. This will delete all Calico Node-Pods. After a minute they should have been recreated. Solved a lot of mysterious issues for me!

## Ingress

So, time was right, network refreshed and still, I faced some issues with e.g. the Jaeger operator. It complained there was no route to ingress-nginx-controller-admission service. I then killed the ingress controller Pod. After it got recreated, the Jaeger operator found the route to ingress-nginx-controller-admission service but now complained about an invalid X509 certificate (signed by unknown authority).

This can be [fixed](https://fabianlee.org/2022/01/29/nginx-ingress-nginx-controller-admission-error-x509-certificate-signed-by-unknown-authority/) by taking the CA data from the nginx admission secret, and patching it into the nginx validating web hook. [^1][^2]

    # adjust to your namespace
    ns=default
    
    CA=$(kubectl -n $ns get secret ingress-nginx-admission -ojsonpath='{.data.ca}')
    
    kubectl patch validatingwebhookconfigurations ingress-nginx-admission -n $ns --type='json' -p='[{"op": "add", "path": "/webhooks/0/clientConfig/caBundle", "value":"'$CA'"}]'

[^1]: https://fabianlee.org/2022/01/29/nginx-ingress-nginx-controller-admission-error-x509-certificate-signed-by-unknown-authority/
[^2]: https://github.com/kubernetes/ingress-nginx/issues/5968#issuecomment-849772666


## Conclusion

After any reset or revert to a previous state, I do all of the above. That is, I force a time synchronization on every node, refresh the Calico network by deleting all Calico Pods with labels equal to `app=calico-node`, I delete the Ingress controller Pod and patch it afterwards.
Using Object spread to merge objects
Published: 2023-02-24 23:27:59

```
const user = {
  name: "",
  username: "",
  phoneNumber: "",
  email: "",
  password: "",
  verified: true 
};

const newUser = {
  username: "ReedBarger",
  email: "reed@gmail.com",
  password: "mypassword"  
};

const createdUser = { ...user, ...newUser, verified: false };
console.log(createdUser);
// console.log(Object.assign({}, user, newUser, { verified: false }));

```
Day 701 : Feel Good
Tags: hiphop, code, coding, lifelongdev
Published: 2023-02-24 23:20:20

_liner notes_:
- Professional : Whew, I took full advantage of not having any meetings today. Finished updating and refactoring a sample demo and then did the same for 2 more. This is the last day for this sprint and I wanted to get everything completed so I can move on to other things next week. I feel good, but I'm tired. hahaha.

- Personal : So I missed posting a blog yesterday because when I normally write the post, I was driving to a meetup. It took a long time to get there and I was able to live stream the event. https://otech.events/event/291597138 Got back home and did some coding. I finally figured out how to get the settings for my side project saved. I quickly wrote up some code and verified it works! Just need to clean up some code and add some checks. Now that I can save the settings, I want to be able to pull the file and use it. The cool thing is that I can save the settings in a private repo. Hoping I can do the same when I pull the settings.

![View from the mountain rim with pine trees looking at a lake in Crater Lake, OR, United States](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x7epnc2iac2xgq18e7zc.jpg) 

Going to go through tracks for the radio show. Super happy I got a bunch of stuff done already. Hopefully won't take too long to finish up because I want to work some more on my side project now that I think I figured out my blocker. Plus I want to watch a couple episodes of "Spy x Family".

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube HyHNuVaZJ-k %}
How to merge object
Published: 2023-02-24 23:16:04

```
const user = {
  name: "",
  username: "",
  phoneNumber: "",
  email: "",
  password: ""  
};

const newUser = {
  username: "ReedBarger",
  email: "reed@gmail.com",
  password: "mypassword"  
};

console.log(Object.assign({}, user, newUser));

```
(1) Always start with an empty block {} so you don't overwrite 'user'.
(2) Don't forget that objects are passed as references and not values.
Practical Tips for Freelance Developers: How to Find Clients and Grow Your Business
Published: 2023-02-24 23:11:27

As a freelance developer, finding clients is an essential part of your job. However, it can be difficult to know where to start. In this article, we will give you practical tips for finding clients and growing your business as a freelance developer.

## Use social media
Social media platforms such as LinkedIn, Twitter, and Facebook are excellent ways to get yourself known as a freelance developer. Use these platforms to share your projects, accomplishments, and expertise. Engage with other industry professionals and look for collaboration opportunities.

## Create an online portfolio
Having an online portfolio is essential for any freelance developer. It allows you to showcase your work and demonstrate your expertise to potential clients. Make sure your portfolio is well-organized, easy to navigate, and highlights your most successful projects.

## Use freelance sites
There are many freelance sites such as Upwork, Freelancer.com, and Fiverr that allow developers to offer their services to clients worldwide. Sign up for these platforms and create a complete profile. Make sure your profile is clear and precise about your skills and experience.

## References and word of mouth
Word-of-mouth is an effective way to find clients. Ask your current and past clients to recommend you to their friends and colleagues. Make sure you have their permission to use their name when looking for new clients.

## Join developer groups
Join online and offline developer groups. There are often events organized for developers where you can meet potential clients. These groups can also provide tips and tricks for improving your business as a freelance developer.

## Be proactive
Don't be shy, reach out directly to potential clients. Send them a personalized email explaining how you can help them achieve their goals. Be creative and innovative to stand out from the competition.

In conclusion, finding clients as a freelance developer may seem difficult, but with a solid strategy and proactive attitude, you can succeed in growing your business. Use social media, create an online portfolio, use freelance sites, use references and word-of-mouth, join developer groups, and be proactive in your client search. Over time, you can build a regular client base and evolve your business.

Do you have any comments or feedback to share on the tips presented in this article for finding clients as a freelance developer?
SQL | The junior tester guide
Tags: sql, juniortester, beginners, career
Published: 2023-02-24 18:27:07

Are you a junior tester or aspiring tester looking to develop your skills and enhance your career prospects? Learning SQL can be a valuable addition to your skill set, and there are many resources available to help you get started. In this article, we'll explore some tips and tricks for learning SQL as a tester.

👩‍🎓📈🎯 Why Learn SQL?

Structured Query Language (SQL) is a powerful tool for managing and analyzing data. As a tester, understanding SQL can help you to write better test cases and perform more effective data analysis. Additionally, many companies now require SQL skills as a prerequisite for certain testing roles. By learning SQL, you can broaden your career prospects and increase your earning potential.

📖📹💻 Getting Started

There are many resources available for learning SQL, including books, online courses, and video tutorials. Some popular platforms for learning SQL include Codecademy, Udemy, and Coursera. Many of these resources are free or low-cost, making it easy to get started without breaking the bank.

My personal favourite is [LNU PLATFORM](https://www.lnu.org.pl/nauka-programowania-z-lnu/)
[HackerRank](https://www.hackerrank.com/domains/sql?badge_type=sql)
[codewars](https://www.codewars.com/dashboard)
and [w3schools](https://www.w3schools.com/sql/default.asp).

🎓💪🧠 Learning Strategies

SQL can be complex and challenging, but with dedication and persistence, you can master it. Some effective learning strategies for SQL include practicing writing queries on a regular basis, using online SQL editors to experiment with code, and seeking feedback from more experienced SQL users.

👨‍👩‍👧‍👦👥🚀 Joining a Community

Joining a community of other testers and SQL users can be a great way to get support, share ideas, and stay motivated. Additionally, joining a local testing group or attending industry conferences can be a great way to connect with other professionals in the field.

🎉👩‍💼🌟 Conclusion

Learning SQL can be a valuable addition to your skill set as a tester. By approaching the subject with a growth mindset, using effective learning strategies, and connecting with other testers and SQL users, you can master this powerful tool and enhance your career prospects. So why not give it a try? With some hard work and dedication, you may be surprised at how quickly you can become a SQL pro! 💪🚀👩‍💻

Follow my Instagram account for more updates and insights on my testing projects and experiences. You can find my account at [@she_tests](https://www.instagram.com/she_tests/), feel free to connect and engage with me, I would love to hear from you.
O que é e para o que serve Apache HTTP Server?
Published: 2023-02-24 22:52:16

Apache HTTP Server é um dos mais antigos e confiáveis servidores de internet. A sua primeira versão, foi lançada em 1995, há mais de 20 anos.
O Apache permite que donos de sites mostrem e mantenham seus conteúdos na internet, daí o conceito de “servidor de internet”.

Quando alguém visita um site, esse visitante entra em um domínio na barra de endereço por um navegador. Em seguida, o servidor entrega os arquivos solicitados atuando como se fosse um como um entregador de encomendas, só que virtual.

**Para que serve Apache?**

Agora que você já sabe o que é Apache, está na hora de se aprofundar um pouco no conceito de servidores de internet.

Servidores de arquivos, de banco de dados, de email e de internet usam diferentes categorias de softwares. Cada uma dessas aplicações podem acessar arquivos armazenados em servidores físicos e usá-los para diferentes propósitos.

O trabalho de um servidor de internet é servir sites na internet. Para chegar nesse objetivo, ele age como um mediador entre o servidor e as máquinas dos clientes. Ele puxa conteúdo de um servidor em cada pedido do cliente e realizar essa entrega na internet.

O maior desafio de um servidor de internet é servir muitos usuários da internet ao mesmo tempo. Cada um deles, por exemplo, faz pedidos de acesso a milhares de páginas diferentes. Os servidores de internet processam os arquivos escritos em diferentes linguagens de programação, como PHP, Java, Python e outras.

Eles transformam esses arquivos estáticos em HTML e servem os mesmos no navegador dos usuários. Quando você escuta as palavras servidor de internet, pense como uma ferramenta responsável pela comunicação entre o servidor e o cliente.
10 Best Rust Books for Intermediate Developers
Published: 2023-04-14 11:44:18

---
title: 10 Best Rust Books for Intermediate Developers
published: true
date: 2023-02-24 22:50:50 UTC
tags: 
canonical_url: https://blog.chetanmittaldev.com/10-best-rust-books-for-intermediate-developers
---

Each of these books covers various aspects of Rust programming, including syntax, data structures, concurrency, performance optimization, and more.

These assume some prior knowledge of Rust, making them well-suited for intermediate developers who want to deepen their understanding and skills in Rust.

1. **"Programming Rust: Fast, Safe Systems Development"** by Jim Blandy and Jason Orendorff

2. **"The Rust Programming Language"** by Steve Klabnik and Carol Nichols

3. **"Rust in Action"** by Tim McNamara

4. **"Hands-On Concurrency with Rust"** by Brian L. Troutwine

5. **"Mastering Rust: Learn about memory safety, type system, concurrency, and the new features of Rust 2018 edition"** by Rahul Sharma

6. **"Rust High Performance"** by Iban Eguia Moraza

7. **"Rust Essentials"** by Ivo Balbaert

8. **"Rust Programming By Example"** by Guillaume Gomez and Antoni Boucher

9. **"Rust Quick Start Guide: The easiest way to learn Rust programming"** by Daniel Arbuckle

10. **"Rust Cookbook: Discover actionable solutions to coding problems with Rust"** by Vesa Kaihlavirta
FREE AWS Cloud Project Bootcamp Week 1 Part 1
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-02-24 22:13:50

[55/100] #100DaysOfCloud Today, I completed a part of the Week 1 of the FREE AWS Cloud Project Bootcamp by Andrew Brown.

Here's what I completed:
- Containerized the Backend and the Frontend (Created a Dockerfile and built the Container).
- Created a Docker compose file which is helpful to run multiple containers. Here it was used to run both the frontend and the backend containers.

By doing this, I was able to view the Webpage of the web application, sign up and create a new user as well as log in with that newly created user.

[GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/055/Readme.md)

You can watch the Bootcamp through this YouTube playlist : [FREE AWS Cloud Project Bootcamp playlist](https://youtube.com/playlist?list=PLBfufR7vyJJ7k25byhRXJldB5AiwgNnWv)
Rive animation is coming to NativeScript
Tags: nativescript, rive, javascript, angular
Published: 2023-02-24 21:38:27

How do you build rapidly animated icons for your navigation bar? In NativeScript, we can achieve this with CSS and JavaScript through the animate function but the quality of the icon might not be that great for multiple reasons.

This is why we had to have Lotties.

![beating heart gif](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/18p6ddvlw5c2v49ua87t.gif)

According to Lottie's official documentation, a Lottie is a JSON-based animation file format that allows you to ship animations on any platform as easily as shipping static assets(like an image) They are small files that work on any device and can scale up or down without pixelation(they are like SVGs. They don't lose quality when the width and/or the height of the screen changes.

The beating heart gif above is a Lottie animation.

But this format although extremely useful has some drawbacks.

Rive is playing in Lotties'playground and offers some serious advantages like a smaller size among others.

You can learn more about the differences between Lottie and Rive [here](https://rive.app/blog/rive-as-a-lottie-alternative)

[Sidharth Khurana](https://bootcamp.uxdesign.cc/rive-or-lottie-4caf25bb2210) also wrote an eloquent comparative of these 2 animation formats

#Rive in NativeScript 

NativeScript will be joining other popular frameworks like Flutter and React Native to fully support Rive animation and we can only be grateful for that.

![A lottie animation, yes another one](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bpjr3pgme7rlsius22nf.gif)

Without a doubt, UI and UX tooling in NativeScript will be enhanced which will make the development process much more enjoyable and the migration of those who were already using Rive with other frameworks, easier.

I can't wait to test it... Stay tuned for upcoming articles.


PS: we will be building a clinic calculator this Sunday.
Exploring the Open World of Grand Theft Auto V: A Review
Tags: gamedev
Published: 2023-02-24 21:30:59

Grand Theft Auto V, also known as GTA V, is an action-adventure video game developed by Rockstar North and published by Rockstar Games. It was released in September 2013 for PlayStation 3 and Xbox 360, and in November 2014 for PlayStation 4 and Xbox One. A PC version was released in April 2015. The game is set in the fictional city of Los Santos, based on Los Angeles, and the surrounding countryside, and features three playable characters: Michael De Santa, Franklin Clinton, and Trevor Philips.
Source : https://lookerstudio.google.com/embed/reporting/02cb5b8d-96f9-4e9c-87ce-ac08d06cab70/page/uyyDD

Gameplay:
GTA V is an open-world game that allows players to explore a vast map filled with different environments, ranging from urban areas to deserts and forests. Players can switch between the three characters at any time, both during missions and while free-roaming. Each character has his own set of skills and abilities, which players can upgrade as they progress through the game.

The game features a variety of missions, including heists, races, and shootouts. The heist missions are the most complex and involve careful planning and execution. Players can also engage in various activities such as playing golf, tennis, or even diving. The game's online mode, Grand Theft Auto Online, allows players to join together in a shared world, complete missions together, and engage in various activities.

Graphics and Sound:
One of the most notable features of [GTA V mobile](https://lookerstudio.google.com/embed/reporting/02cb5b8d-96f9-4e9c-87ce-ac08d06cab70/page/uyyDD) is its impressive graphics. The game's environments are highly detailed and realistic, with stunning lighting effects that bring the world to life. The game's sound design is also top-notch, with a great soundtrack and excellent voice acting.

Criticism:
The game has faced some criticism for its depiction of violence and mature themes, as well as its portrayal of women and minorities. The game's online mode has also been criticized for its microtransaction system, which some players argue is pay-to-win.

Conclusion:
Overall, GTA V is a highly entertaining game that offers a vast open world to explore and a wide range of missions and activities to complete. The game's graphics and sound are impressive, and the three playable characters offer a fresh perspective on the gameplay. While the game may not be suitable for everyone due to its mature content, it remains a popular choice among gamers who enjoy open-world action games.
AWS Cloud Quest: Content Delivery Networks Study Note
Tags: aws
Published: 2023-02-24 21:22:58

This is the DIY challenge of the Content Delivery Networks in AWS Cloud Quest.


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



### DIY Steps:
1. Reconfigure CloudFront distribution to use S3 `labstack-XXX`
  - In CloudFront distribution, select `Origins -> Edit`
  - Change `Origin domain` to S3 `labstack-XXX`
Basic backend template following best practices
Tags: python, beginners, node, javascript
Published: 2023-02-24 20:16:58

Here I want to explain a little what would be the points to take into account to build a simple backend following good practices.

**Choose a Programming Language:** Choose a programming language that suits your project needs. Some popular backend languages include Python, Node.js, Ruby, and Java.

**Use a Web Framework:** Choose a web framework that helps you build your API efficiently. Some popular web frameworks include Flask and Django (for Python), Express (for Node.js), and Ruby on Rails (for Ruby).

**Use an ORM:** Use an ORM (Object-Relational Mapping) to interact with the database. An ORM abstracts away the SQL code and provides an easier interface to work with. Some popular ORMs include SQLAlchemy (for Python) and Sequelize (for Node.js).

**Use a Relational Database:** Use a relational database to store your data. Some popular databases include MySQL, PostgreSQL, and SQLite.

**Use Authentication and Authorization:** Implement user authentication and authorization to protect your API from unauthorized access. Some popular authentication and authorization libraries include OAuth2 and JWT (JSON Web Tokens).

**Use HTTPS:** Use HTTPS to secure the communication between the client and server.

**Implement Rate Limiting:** Implement rate limiting to prevent abuse of your API.

**Use Environment Variables:** Use environment variables to store sensitive information like API keys and database credentials.

**Implement Logging:** Implement logging to track errors and debug your API.

**Write Tests:** Write unit tests and integration tests to ensure that your API is working as expected.

Here's an example directory structure for a Python Flask backend using SQLAlchemy and SQLite:

```
├── app/
│   ├── models/
│   │   ├── __init__.py
│   │   ├── user.py
│   ├── routes/
│   │   ├── __init__.py
│   │   ├── auth.py
│   ├── __init__.py
│   ├── extensions.py
│   ├── config.py
├── tests/
│   ├── test_auth.py
├── run.py
```

In this example, the `app` directory contains the main Flask application code, with the `models` directory holding the ORM models, the `routes` directory holding the API routes, and the `extensions.py` and `config.py` files holding the configuration settings for the app. The tests directory holds the unit and integration `tests`. The `run.py` file is the entry point to the application.

This is just a basic boilerplate, and you can customize it based on your project needs.



> Photo by Markus Spiske: https://www.pexels.com/photo/display-coding-programming-development-1921326/