teleren/devto huggingface dataset:
My technical interview experience in paytm for DevOps role.
Published: 2021-09-12 13:36:20

Resume based interview. Must have read your resume thoroughly before sitting in interview.

1.) Can we use git without github?
2.) Difference between gitpull and git fetch?
3.) Command used for revert in git?
3.) Theoretical question from Computer Network and Operating 
    System.(Important)
4.) OOPS question.(C++/Java)
5.) Two coding question on strings.(easy/Medium level):
    a) check the given string is right IP Address or not?
    b) if a string is given "aabbcc" you have to print "abc"?
6.) ACID properties in DBMS?
7.) Define consistent?
8.) Deep understanding of devops.(Important)
9.) SQL commands.(DDL,DCL,TCL,DML)
10.) About your projects mentioned in resume.

Must be experience in devops and good knowledge of Computer fundamentals.
**I was not able to answer the 1 question properly how would you 
  give the answer please comment below.
Clean code, o que fazer?
Tags: beginners, braziliandevs, programming
Published: 2021-09-12 10:47:52

Então você entrou no mercado de TI e tudo fala ou exige 'clean code'. Com certeza você já leu ou viu alguma explicação no youtube a respeito e mesmo assim se sente perdido para aplicar no que você faz.

Apesar de ser algo simples a utilização passa por um processo de maturidade. Mas não é algo para se preocupar ou que sem este conhecimento você não é capaz produzir algo. Não estou dizendo que 'clean code' seja que não precise aprender, muito pelo contrario junto com os princípios do SOLID é algo que todos deveria aprender porque vai ajudar em muitos aspectos.

Voltando ao nosso tema, passei por muitas empresas e projetos que a aplicação de 'clean code' e/ou SOLID era visto negativamente. As pessoas gostavam de métodos de 2000 linhas onde tudo acontecia ali, enquanto eu gosto de métodos simples e com menor complexidade possível.

Então para você que esta no inicio de sua carreira deixo uma ideia que utilizo hoje, vai escrever código e onde você esta trabalhando existe uma cultura onde o pedido é um amontoado de código ou que seja apenas duvida de como fazer. Então escreve o teu código com as seguintes considerações:

## Seja simples de ler

Escrevemos códigos e sempre em algum momento, imediato ou não, outra pessoa vai por mão neste código. Considere que você não conheça o negócio e apenas olhando o código fique claro o objetivo dele.

## Nomes para métodos e variáveis

Isto é um ponto que anda de mãos dadas com o item anterior, uma boa nomenclatura facilita e muito o entendimento. Recentemente eu estava revisando um código que tinha um método chamado 'SalvarCliente' que apenas fazia uma consulta em base de dados, 'ValidarCpf' que verificava se o CPF já estava salvo em outra parte.

## Códigos simples

Conhecer técnicas avançadas, complexas e etc, é legal e eu também gosto mas não é necessário utiliza-las em tudo que vai ser feito muitas das vezes um simples 'if/else' resolve, quanto mais simples é mais fácil para outros lerem o código. Não estou dizendo para esquecerem as coisas complexas mas para avaliar objetivamente o problema e a solução a ser implementada.

## Métodos pequenos

Pensem em métodos com poucas linhas de código. Um método extenso 
muitas das vezes significa que ele pode ser quebrados em soluções menores. E soluções menores é mais fácil de dar manutenção e eventuais alterações apresentam menor impacto.

Bom, finalizando. Tudo que eu coloquei aqui se enquadra dentro de 'clean code' e/ou SOLID, são boas praticas para ajudar qualquer tipo de projeto em qualquer linguagem sendo utilizadas.

Espero que ajude em algo e se você passou por algo onde o nome não representava o que de fato executava, escreve ai.
Apple  vs the world - the power of tinkering
Published: 2021-09-12 13:24:30

I was shocked to discover quite recently that I've become an Apple user. For years I've been a Linux man (intermittently using a Mac, offered by my employer), while using an Android phone since the very first commercially available version. I've never appreciated Apple's universe and locked-in platform, though I did admire its seamless interconnectivity and how the ecosystem worked together.

Another thing I've admired about Apple (design aside - matter of taste) is that it is a giant which competes with other giants on a number of fronts. It competes with Google in the mobile OS market (and smart home), against a number of competitors (led by Samsung) in the mobile device category, against Microsoft on computer OS and against a multitude of desktop/laptop makers.

Its offer is quite interesting - an integrated ecosystem of devices that "just work" together, with simple operation that removes any entry overhead so that whether you're a creator (developer, musician, etc) or just consumer, you can get right down to what you're doing and forget anything else.

There was a time when I would appreciate the ability to tinker with my system. The endless customisation options of Linux to create that perfect desktop system that blends beauty and functionality (hello `Enlightenment`). The straightforward plugin development for `Sublime Text`. The ability to create interoperability with other devices (rooting and customizing Android devices) and so on.

Nowadays, my focus is on just doing the work. I tinker, but with the "outer" technologies that I learn on the job (Kubernetes, Golang, all sorts of frameworks and so on) and I like my local environment to be stable and just support that (preferably out of the box).

My old self would have never seriously considered Apple. My old self has become to appreciate the offer. But it's an evolution, I think.

Looking back, joining the "get to business" mindset would have deprived me of a lot of learning. Tinkering with Linux allowed me to learn (besides scripting) a lot about the inner workings of an OS. Creating plugins for Sublime allowed me to learn a lot about programming and what it means to parse code (as well as natural language and string processing). Tinkering with Android (and briefly creating my own flavour) allowed me to learn about ARM architecture and the composition of a mobile OS, drivers and so on.

Tinkering is great and I consider it to be a hallmark of the inquisitive mind. It's a great learning process that comes out of passion for technology and it also allows the discovery of your true interests. It sparks creativity.

But it's still just a phase (albeit an essential one). There's no shame in specialising, creating your recipes and algorithms and then applying them. That's what experience is ... as long as you down allow this to become a closed box. Or, if you do, do try to peek outside every now and then.
VSCode - C# Minimal APIs
Tags: ptbr, vscode, dotnet, braziliandevs
Published: 2021-09-12 13:23:23

Olá Devs! 👩‍💻👨‍💻

Vejo que existe um empenho grande por parte da Microsoft em facilitar cada vez mais o desenvolvimento Web. Hoje as possibilidades são muitas e acredito que existe espaço para todo mundo. Só fica complicado competir se a solução do colega do lado for muito mais simples do que a sua, tudo indica que essa facilidade nasceu por conta disso.

Resumindo em uma única frase essa nova possibilidade: "ir direto ao ponto"

Criei um exemplo utilizando um tema que eu gosto muito 😁 

### Repositório
{% github leandroats/vscode-minimalapi no-readme %} 

Comandos utilizados para criar o projeto:
```powershell
dotnet new console -n MinimalAPI -f net6.0
```

### <a name="links"></a>Links e Referências:
👉 [Post do "Anuraj"] (https://dotnetthoughts.net/minimal-api-in-aspnet-core-mvc6/)
👉 [VSCode] (https://code.visualstudio.com/)
👉 [Rest Client] (https://marketplace.visualstudio.com/items?itemName=humao.rest-client)

Até a próxima! 👊
Laravel: How to use `USE INDEX` and `FORCE INDEX` for Eloquent and MySQL
Tags: php, laravel, mysql
Published: 2021-09-12 13:22:12

Eloquent - is a powerful class for working with databases, easily extensible and easy to use. But sometimes it is necessary to get a little more than the developers have provided for at the moment.

Some time ago I was investigating a problem with MySQL indexes on a big table and realized that there is no way to build a query with `use index` or `force index` statements using Laravel Eloquent class.

This is why I have tried to fix it :)

Let me introduce a simple Laravel package to cover these needs:
https://github.com/vpominchuk/laravel-mysql-use-index-scope

## Installation
`composer require vpominchuk/laravel-mysql-use-index-scope`

## Usage
Simply reference the required trait in your model:

#### Model

```php
use VPominchuk\ModelUseIndex;
    
class MyModel extends Model
{
    use ModelUseIndex;
    ...
    ...
}
```

#### Anywhere in the code:
```php
$builder = MyModel::where('name', $name)->where('age', $age)->
        useIndex($indexName)->...
```

#### MySQL Indexes
Don't forget to create a named index with Laravel migration:
```php
$table->index(['name', 'age'], 'user_age_index');
```

## Available methods
`useIndex($indexName)`
Tells MySQL to use an index if it possible.

`forceIndex($indexName)`
Force MySQL to use an index if it possible.

Please check my personal blog for new articles:
https://pominchuk.com/posts
Tales from the Real World - Architecting the Transformation
Tags: architect, architecture, productivity, agile
Published: 2021-09-12 12:34:31

**This post was originally published on Fri, Sep 10, 2021 at [cloudwithchris.com](https://www.cloudwithchris.com/episode/architecting-the-transformation/).**

Most organizations engaged in transformation today are moving from left to right in digitally-driven maturity models. The objectives are well known: increase agility, boost productivity, and provide seamless digital experiences for consumers.

Architects play a pivotal role as the curators of this transformation. In this session, Asanka will share his experience on how architects can contribute and introduce a framework to follow on refactoring enterprises.

{% youtube TPPujJ7N8tM %}
Head First Design Patterns : 10 of 10 ( Proxy Pattern)
Published: 2021-09-12 12:34:03

I just learnt a new design from the Head First Design Pattern book. Today, I learnt about the State pattern.

According to The head first design pattern, the Proxy pattern is used to provide a placeholder for another object to control access to it. It also allows you to perform actions before or after calls have been made to the real object.

Types of Proxy:

1 Remote proxy: A remote proxy is a kind of proxy that acts as a local representative of an object that lives in a different JVM. Method calls to a remote proxy are transferred over the wire and invoked, and the result being returned to the proxy and then to the client.

2 Virtual Proxy: A virtual proxy is a kind of proxy that acts as a representative for an object that is expensive to create. Virtual proxies defer the creation of the real object until it is needed. 

3 Protection Proxy: A protection proxy is a kind of proxy that is used to restrict access to confirm calls to the real object.

4 Cache Proxy: A cache proxy is a kind of proxy that caches data returned by the real object so later calls to return the cached data. 

5 Log Proxy: A Logging proxy is a kind of proxy that is used to logs requests to the real object before or after.

Implementing a proxy is rather simple. Proxy is a wrapper around the real object with the same base type as the real object. 

```kotlin
interface Money

class Cash : Money {
  fun makePayment(){ }
}

class ATMCard(val cash: Cash) : Money {
    fun makePayment() {
         if (checkTime()) {
             cash.makePayment()
         } else {
             throw  IllegalArgumentException("You can not use an atm at this time")
         }
    }

    fun checkTime() : Boolean
}
```
1. The first thing you need to do is setup up your marker interface or abstract class. 
2. Make the real object and the proxy implement the same type.
3. Make the proxy wrapper the real object and delegate calls to it. 

The example above is a protection proxy. It validates calls to the real object before delegating them to the real object. 
This design pattern is somewhat similar to the Decorator design pattern in implementation. The proxy pattern is used to control access to the real object while the Decorator pattern is used to add new behaviour to the object.
You don't know spread operator !
Tags: javascript, webdev, programming
Published: 2021-09-12 12:27:23

I was recently reading a [blog post about iteration](https://2ality.com/2021/08/iteration-helpers.html) from [Axel Rauschmayer](https://twitter.com/rauschma) (I suggest you follow him, all his posts are minegold for JS devs).
This post was mindblowing to me as I learned so much about iteratables in JavaScript.

### Let's challenge our knowledge
Let me sum up a bit of what I learned here with a small challenge to you : 
When I use the spread operator on a Number, I want the result to be an array that counts from 1 to the given value : 
![Example in the chrome console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0z8hf4grikvwed044qoe.jpg)

### First steps to an answer
First thing to do is try the code for yourself and you will see that using a spread operator on a Number throws an error => **Uncaught TypeError: X is not iterable**

Then **what is an iterable** ? 
[An iterable is an object that defines an iteration behavior,](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators) meaning it has a property with a Symbol.iterator key and an iterator as value.
This iterator should respect the [iteration protocol](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#the_iterator_protocol) which means it is a function that returns an object with a next fonction that returns an object with 2 properties : "value" (the current iteration's value) and "done" (a boolean indicating weither we are done iterating with this iterator or not).

The spread operator is simply a consummer of such iterables: when you give it an iterable, it'll call the next function of its Symbol.iterator property until it returns an object with {done: true} (and push each time the result in an array).

### Verify that with an Array
An array in JavaScript is an iterable since it has an iterator as a value of its property with Symbol.iterator key.
Here is how you can use this iterator :
![Usage of an array iterator in the chrome console](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wg4tk254640lb3tjmc7j.jpg)

### Answer to the challenge
So how do I make the spread operator not throwing an error when given a number ? You set the Symbol.iterator property on the Number primitive wrapper object.
Let's make all numbers iterables ! 
![Setting the property on the Number's prototype](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uwfhb43kg2abzaek28sk.jpg)

### Conclusion
Obviously you never want to change the prototype of a primitive wrapper object, it's too dangerous.
But the knowledge of how iteration and the spread operator works is I think very valuable as a developper.
Migrating to the Cloud
Tags: azure, azuremigrate, cloudmigration, cloudadoptionframework
Published: 2021-09-12 12:17:22

**This post was originally published on Wed, Sep 8, 2021 at [cloudwithchris.com](https://www.cloudwithchris.com/episode/migrating-to-the-cloud/).**

In this episode, Chris is joined by Susanne Tedrick. Susanne is an Azure Infrastructure Specialist for Microsoft and the award-winning author of "Women of Color in Tech". They will discuss the basic technical and business considerations to be made when migrating applications and workloads to the cloud, based on the Cloud Adoption Framework.

{% youtube D_yM0XcYQ0Y %}
to get Mysql Server running
Published: 2021-09-12 12:06:32

Follow the below 

https://linuxize.com/post/mysql-remote-access/
and off course to fix sha password issues

https://stackoverflow.com/questions/49194719/authentication-plugin-caching-sha2-password-cannot-be-loaded

remeber port forwarding is a bitch

In order for PIP3 INSTALL mysql to work you must first
https://stackoverflow.com/questions/7475223/mysql-config-not-found-when-installing-mysqldb-python-interface
AdminLTE - Open-Source Django Starter
Tags: adminlte, dashboards, opensource
Published: 2021-09-12 12:05:30

---
title: AdminLTE - Open-Source Django Starter
published: true
description: Open-source seed project crafted in Django (latest version) and AdminLTE, an iconic open-source dashboard template. The product can be downloaded from Github under the MIT License.
tags: adminlte, dashboards, opensource
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ocl61cfh0grq7w6p0xd9.jpg
canonical_url: https://appseed.us/product/adminlte/django/

---
Hello Coders!

This article presents [AdminLTE Django](https://appseed.us/product/adminlte/django/), an open-source Django Dashboard crafted on top of the latest stable version of **AdminLTE**, an iconic Material UI design. 

The product, available for download on Github under the MIT License, has been updated recently to **use the latest Django version** (3.2.6 LTS), **SASS compilation** via Gulp, and **improved Docker** scripts.

- 👉 [Django AdminLTE](https://appseed.us/product/adminlte/django/) - `Product page`
- 👉 [Django AdminLTE](https://adminlte-django.appseed-srv1.com/) - `LIVE Demo`

![AdminLTE - Open-source Django Dashboard, the calendar page.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kpfcvpauywqnvp95x5ri.png)

---

Probably the simplest way to get the product up & running in a local environment is to use the Docker setup as presented by the official product documentation and README file (saved on Github).

---

> **Step #1** - Download the sources from the [product page](https://appseed.us/admin-dashboards/django-dashboard-adminlte)

```bash
$ unzip django-dashboard-adminlte.zip
$ cd django-dashboard-adminlte
```

---

> **Step #2** - Start **AdminLTE Django** in Docker

```bash
$ docker-compose up --build
```

Once all commands are executed we should see this simple Django dashboard running in the browser:

---

![AdminLTE - Open-source Django Dashboard Login Page. ](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjyzjcog5oxksf4jgvgp.png)

---

> **AdminLTE** - Charts Page

![AdminLTE - Open-source Django Dashboard Charts Page.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pmc2fs746r3dr3qaxr52.png)

---

## Product Features

This new release of AdminLTE **[Django](https://appseed.us/admin-dashboards/django/)** comes with an important update regarding the dependencies and other (less) important but useful features:

- Dependencies Update: latest **Django 3.2.6 LTS**
- **SASS compilation** scripts via Gulp
- **Docker** - improved scripts
- Codebase refactoring for easier maintenance
- Free support via [Discord](https://discord.gg/fZC6hup) and Github (issues tracker)
 
---

> Thanks for reading! For more resources, feel free to access: 

- 👉 More [Django Dashboards](https://appseed.us/admin-dashboards/django/) - a curated index 
- 👉 [Django App Generator](https://app-generator.dev/django/) - A 2nd generation App Builder
A Quick 10-Second Programming Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2021-09-12 12:00:27

---
title: "A Quick 10-Second Programming Joke For Today"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1259369613c.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ How does a sysadmin keep a fire going?

___A:___ They rotate the logs.
 -->
How to deploy Angular project using firebase
Tags: angular, firebase, devops, typescript
Published: 2021-09-12 11:50:24

If you are going through this article then I assume you have a javascript-based Awesome project with (Angular, React, etc..) which you want to deploy to any cloud providers like (AWS, Azure, or GCP).
In this article, you will get to know how to deploy your project on firebase, cause i don't know how to do it using the above ones :( .

Step-1:npm i -g firebase-tools .

step-2:run firebase login(if you haven't logged in yet then it will take you to the browser from where you can log in to your firebase account ).

step-3:run firebase init. you will be going to get some options like the below example from which you can select which one do you want to go with. in my case I have selected hosting.

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

step-4:After you select hosting you need to select the project from firebase. if you don't have it then you need to create a new one

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

step-5: Hosting setup, in this step you need to select in which folder you have your hosting assets.

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

After this, you will get an option to set up CI/CD pipeline with Github which I am not doing right now will do it in the later articles.


Step-6:run firebase deploy. After this firebase will deploy your application and will give you a site link like(abc.web.app) where you can interact with your project.

Hope it will be helpful to you.
Ternary Operator and Short Circuit Conditionals in Python like JavaScript
Tags: python, javascript
Published: 2021-09-12 11:31:36

If you ever coded in JavaScript then you probably would be aware about content of cover image.

Assuming you are aware that how much ternary operators are useful in programming languages such as C, C++, Go, Perl, Ruby, Java, JavaScript, etc. And Yes Python also Supports Ternary operator.

###Python Introduced Ternary operator in Python 2.5.
It's Called inline-if, Which has syntax something like this:
```
a if condition else b
```
That Simply means if condition is true then result is a else b.

But if you come from JavaScript Background then it seems odd at first, Cause we are used to code something like this:
```
variable = condition ? a : b
```
**But what if we can familiarize that odd ternary operator to feel like JavaScript one?**
Yes We can do that, and that's not a rocket science. We can simply replace the ? with python logical `and` operator and : with logical `or` operator. 


Let's See how:
```
variable = condition and a or b
```

After reading this you might be feel like, "hmmm! that was not much important and useful". But the aim of this article to explain that how logical conditional operators are helpful and just requires a different approach to it.

Also We can use conditional short-circuiting in JavaScript.
```
let data = online && getData();
```

What it does is if online is true then and then it calls the getData() method.

*Short circuiting means that when we are evaluating an AND expression (&&), if the first operand is false it will short-circuit and not even look at the second operand.*




So instead code in python like this:
```
if(online):
  data = getData()
```

We can simply use logical `and` again to avoid writing if statement using one liner code:
```
data = online and getData()
``` 


_Yes I accept that this was not much smart article compare to others but Hope Some Novice programmer will get help form this🤞._

_Hope you gained some information from this article✨._


##Thank You For reading it out😀
Comment Your Thoughts Below.