teleren/devto huggingface dataset:
Decode TOTP(Time-based One-time Password) QR Code
Tags: totp, security, qrcode
Published: 2021-05-11 12:34:33

# How not to do this.

<figure>
  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spaq45zmivvy3f0q8m8y.png" alt="Trulli" style="width:100%">
  <figcaption>DO NOT USE AN ONLINE SERVICE</figcaption>
</figure>

While an online service such as <a href="https://webqr.com/" target="_blank">https://webqr.com/</a> or <a href="https://www.qrstuff.com/scan" target="_blank">https://www.qrstuff.com/scan</a> are fine for normal QR codes they should never be used for TOTP QR Codes.

## What inside the QR CODE

A TOTP QR code contains the following details (all values are placeholders).

<figure>
<div class="highlight js-code-highlight">
<pre class="highlight plaintext">

     Hex secret: 3132333435363738393031323334353637383930
     Base32 secret: GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ
     Digits: 8
     Window size: 0
     TOTP mode: SHA1
     Step size (seconds): 30
     Start time: 1970-01-01 00:00:00 UTC (0)
     Time now: 2033-05-18 03:33:20 UTC (2000000000)
     Counter: 0x3F940AA (66666666)

</pre>

</div>
  
  <figcaption>Information from: <a href="https://www.nongnu.org/oath-toolkit/oathtool.1.html" target="_blank" >oathtool</a></figcaption>
</figure>

For more information visit <a href="https://www.nongnu.org/oath-toolkit/oathtool.1.html" target="_blank" >oathtool</a>

# Decode QR code locally
---
## Install

### Mac

```brew install zbar```

### Windows(WSL), Linux

```sudo apt-get install zbarimg```

## Example

```bash
/mnt/c/Users/rough$ zbarimg /mnt/c/tmp/a.png
otpauth://totp/hub.docker.com:{username}?algorithm=SHA1&digits=6&issuer=hub.docker.com&period=30&secret={Key}

```
 
You can now store the OTPAUTH URI in your favorite password manager or add the {Key} so that your password manager can generate the TOPT code.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g8x8cv4i6ukhnc5n3s98.png)
 
[How to add your TOPT key to LastPass](https://dev.to/iainrough/bad-ux-lastpass-password-dialog-4lfj)
JavaScript Interview Question #39: How does setTimeout work inside the loop?
Tags: beginners, javascript, codenewbie, webdev
Published: 2021-05-11 12:27:06

![js-test-39](https://learn.coderslang.com/js-test-39.png)

What will be logged to the console?

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

Before we analyze the code snippet, let’s try to simplify it by removing the `setTimeout`.

If we just leave the plain `console.log` in the loop, then the output is all the values of `i` from `0` to `4` printed on each iteration of the loop.

However, when the `setTimeout` is added, the `console.log` will be executed after the loop has already been processed and the value of `i` is 5.

As `i` was declared with `var`, it has the global scope and the intermediary values aren’t stored in closure around the arrow function `() => console.log(i)`.

---

**ANSWER**: the value `5` will be printed on the screen 5 times. Each time on the new line.

[Learn Full-Stack JavaScript](https://js.coderslang.com)
A container or a package???
Tags: embedded, opensource, luos, microservices
Published: 2021-05-11 12:26:30

Fellow developers, I need your help. We are working on something new, and we need your help deciding how we should call one of our features.

According to you, which word describes the best: " **A sharable folder containing cross-platform code files managing one or more services.** " ?

* A container
* A package
* Other, share in comment

Thanks a lot for your help
Excel Formulas to Display the Current Date ~ Quick Method!!
Tags: excelformula, excelformulas
Published: 2021-05-12 12:52:14

---
title: Excel Formulas to Display the Current Date ~ Quick Method!!
published: true
date: 2021-05-11 12:02:30 UTC
tags: ExcelFormula,Excelformulas
canonical_url: https://geekexcel.com/excel-formulas-to-display-current-date/
---

Do you want to put today’s date in some cell? Or you wish to highlight the current date in your Excel calendar? All this can be done by using the Excel **[TODAY function](https://geekexcel.com/how-to-use-excel-today-function-in-office-365-simple-steps/)**. This article will teach you how to **display the current (today) date in Excel**. Let’s get them below!! Get an official version of ** MS Excel**  from the following link: [https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)

## General Formula:

- If you want to create a dynamic monthly calendar, you can use the below formula.

**=[TODAY](https://geekexcel.com/how-to-use-excel-today-function-in-office-365-simple-steps/)() **

## Syntax Explanations:

- **TODAY** – This function helps to know the current date on your workbook. Read more on the [**TODAY function**](https://geekexcel.com/how-to-use-excel-today-function-in-office-365-simple-steps/).
- **Parenthesis ()** – The main purpose of this symbol is to group the elements.

## Example:

Let’s consider the below example image.

- Here we will enter the above-given formula in **Cell C4**.

![Enter the formula](https://geekexcel.com/wp-content/uploads/2021/05/Enter-the-formula-34.png)<figcaption id="caption-attachment-39878">Enter the formula</figcaption>

- And press  **ENTER** key it will display the current working date.

![Result](https://geekexcel.com/wp-content/uploads/2021/05/Result-33.png)<figcaption id="caption-attachment-39879">Result</figcaption>

- You can also display the current date by pressing the **Ctrl** +  **;** (semicolon) Keys.

## Verdict:

From this article, you can get to know how to **display the current date in Excel** easily. Hope you like it. If you have any **doubt** regarding this article or have any other **questions** related to Excel, let me know in the **comments** section below.

Thank you so much for visiting  **[Geek Excel](https://geekexcel.com/)!! **If you want to learn more helpful formulas, check out [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!! **

### Read Also:

- **[Excel Formulas to Find the Number of Days in a Month ~ Simple Method!!](https://geekexcel.com/excel-formulas-to-find-the-number-of-days-in-a-month-simple-method/)**
- **[How to Show or Display All Cell Formulas in Excel Office 365?](https://geekexcel.com/how-to-show-or-display-all-cell-formulas-in-excel-office-365/)**
- **[Excel Formulas to Create Custom Weekday Abbreviation ~ Easy Tutorial!!](https://geekexcel.com/excel-formulas-to-create-custom-weekday-abbreviation/)**
- **[Excel Formulas to Count Dates in Current Month ~ Simple Tutorial!!](https://geekexcel.com/excel-formulas-to-count-dates-in-current-month-simple-tutorial/)**
Decision making and Branching
Published: 2021-05-11 12:11:37

#Decision making and Branching:

In C programming it support sequential program statements which execute one statement immediately after another. Here the flow is sequential it never change the flow of control from the next line. The compiler executes the program sequentially in the order which they appear. 

The main important decision making statements in c are as follows.

#If statement:
‘If’ is the most powerful decision making statement in C language. Thus it is used to control the execution of statements. ‘If’ is used along with an expression. It is a two way branching or decision making statement.

Syntax :

if(test expression)
{
    Body of if;
}

>Example:

if(percentage >==80) 
    printf(“ Distinction”);
        else if(percentage >==60)
             printf(“  first class ”);
                 else if(percentage >==50)
                      printf(“ second class ”);
                          else
                               printf(“ failed “);        

#The switch statement:

If is a conditional statement where ‘switch’ is  a selection statement which means if we want to  select one from many alternatives we use ‘switch’. The selective statement ‘switch’ is a multi way decision statement, that is using a single expression we can direct the flow of control to multiple paths.

Syntax :

switch(expression)
 {
     case constant1 :
                               block1;
                               break;
     case constant2 :
                               block2;
                               break;
     case constant n:
                               block n;
                               break;
                                   .
                                   .
                                    .
     default:
                default block;
                 break;
}

>Example :

int num;
printf(“enter a number”);
scanf(‘%d”,&num);
switch(num)
{
case 1:
             printf(“Sunday”);
             break;     
case 2:     
             printf(“Monday”);
             break;     
case 3:     
             printf(“Tuesday”);
             break;
case 4:     
             printf(“Wednesday”);
             break;
case 5:     
             printf(“Thursday”);
             break;
case 6:     
             printf(“Friday”);
             break;
case 7:     
             printf(“Saturday”);
             break;
default:    
             printf(“wrong choice”);
             break;
}
Beginners Introduction to Dockerfile
Tags: docker, beginners, tutorial, devops
Published: 2021-05-11 12:06:52

# What is a Dockerfile

A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.

A very basic Dockerfile will look like
```Dockerfile
# Use an existing docker image as a base
FROM alpine


# Download and install the dependency
RUN apk add --update redis


# Tell the image what to do when it starts as a container
CMD ["redis-server"]
```
It generally have 3 steps : 

* FROM command which is to specify a base image

* RUN command to download and install the dependancies

* CMD command to tell the image what to do after starting as a container.

# Explanation using a simple scenario

Consider a case where you are given a computer with no operating system in it and the you are asked to install google chrome into it. So how can we proceed and install the google chrome in it.

Well, the most basic steps we move forward is with

* Install an operating system because without operating system, the computer will say I don't know what to do, help me with an OS. So the first basic step we do is install the operating system. So when we look to the `Dockerfile` we can see this step resembles with `FROM` command which specifies a base image.

* After installing OS, we will continue with the default browser we have and navigate to the respective site of google chrome to download the installer file. After downloading the installer file, we go to the file location inside the computer and installs the chrome.exe file. Now again we can compare it with `Dockerfile` that I provided above. This step resembles with the `RUN` command as it will install all the dependencies. Here we download the installer which needs to be then installed to make our google chrome to start.

* Now the last step, we execute the installed chrome.exe file and the chrome starts. This is the `CMD` command from the `Dockerfile` where we tell the image what to do after starting as a container.

I also created a docker github repository with the basic docker commands, do have a look and be free to correct me.

{% github Rohithv07/Docker %}
Daily Developer Jokes - Tuesday, May 11, 2021
Tags: jokes, dailydeveloperjokes
Published: 2021-05-11 12:00:06

---
title: "Daily Developer Jokes - Tuesday, May 11, 2021"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
cover_image: "https://private.xtrp.io/projects/DailyDeveloperJokes/thumbnail_generator/?date=Tuesday%2C%20May%2011%2C%202021"
published: true
tags: #jokes, #dailydeveloperjokes
---

Generated by Daily Developer Jokes, a project by [Fred Adams](https://xtrp.io/) ([@xtrp](https://dev.to/xtrp) on DEV)

___Read about Daily Developer Jokes on [this blog post](https://xtrp.io/blog/2020/01/12/daily-jokes-bot-release/), and check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/).___
### Today's Joke is...
![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258884db70.png)

---
*Have a joke idea for a future post? Email ___[xtrp@xtrp.io](mailto:xtrp@xtrp.io)___ with your suggestions!*

*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:___ What do you call a busy waiter?

___A:___ A server.
 -->
ARRAY
Tags: onedimensionalarray, twodimensionalarray
Published: 2021-05-11 11:31:37

#ARRAY
An array is defined as the collection of similar type of data items stored at contiguous memory locations. Arrays are the derived data type in C programming language which can store the primitive type of data such as int, char, double, float, etc

.SYNTAX
type arrayName [ arraySize ];

>EXAMPLE
double balance[5] = {1000.0, 2.0, 3.4, 7.0, 50.0};

#There are 2 types of C arrays. They are:

    One dimensional array:
    Multi dimensional array

1-Dimensional array: It is a linear array that stores elements in a sequential order. Let us try to demonstrate this with an example: Let us say we have to store integers 2, 3, 5, 4, 6, 7. We can store it in an array of integer data type. The way to do it is:

syntax
 dataType nameOfTheArray [sizeOfTheArray];  
int Arr[6];

dataType nameOfTheArray [ ] = {elements of array };

int Arr [ ] = { 2, 3, 5, 4, 6, 7 };

>EXAMPLE:
include<stdio.h> 
 
int main() 
{ 
     int i; 
     int arr[5] = {10,20,30,40,50}; 
    
        // declaring and Initializing array in C 
        //To initialize all array elements to 0, use int arr[5]={0}; 
        /* Above array can be initialized as below also 
        arr[0] = 10; 
        arr[1] = 20; 
        arr[2] = 30; 
        arr[3] = 40;
        arr[4] = 50; */
 
     for (i=0;i<5;i++) 
     { 
         // Accessing each variable
         printf("value of arr[%d] is %d \n", i, arr[i]); 
      } 
 
}

Multidimensional array: It can be considered as an array of arrays. The most commonly used multidimensional array is 2-dimensional array. It stores the elements using 2 indices, which give the information, in which row and which column a particular element is stored. A 2D array is essentially a matrix.

syntax:

char A[ 3 ] [ 2 ] ;

>example:
include<stdio.h>
 
int main()
{
   int i,j;
   // declaring and Initializing array
   int arr[2][2] = {10,20,30,40};
   /* Above array can be initialized as below also
      arr[0][0] = 10; // Initializing array
      arr[0][1] = 20;
      arr[1][0] = 30;
      arr[1][1] = 40; */
   for (i=0;i<2;i++)
   {
      for (j=0;j<2;j++)
      {
         // Accessing variables
         printf("value of arr[%d] [%d] : %d\n",i,j,arr[i][j]);
      }
   }
}
When to choose React JS or Angular UI Framework

Tags: react, angular
Published: 2021-05-11 11:21:24

Recently I was going through React and Angular Comparison online (latest versions) & found both are good fit for Web Application UI. While I was also wondering, there must be some differences which must be focused while deciding between two of them.

Lets suppose, I have one Java based web application with Spring MVC framework , Hibernate & JSF/JSP. Assuming this application is doing massive backend operations & displaying data on UI.

If in todays date, if I want to rebuild this type of application with latest Technology then how I should go for decision making out of React /Angular/other UI framework. For backend may be I will prefer to use Spring Boot which is advanced version of Spring MVC, but its really difficult to make choice on UI side.

Few points which I came across after googling are-

React is best when real time data update is required frequently.
React requires lot of Java script skills so it takes time develop web apps.
Now a days React is most preferred JS library which has more flexibility & big MNC's are also migrating from Angular to React.
While Angular has speedy development & also trying to improve on lacking points per release like Bundle Size, Performance etc.
Angular is preferred when web application is stable and not much enhancement are required.
Do we have some guidelines on when to use React / Angular?
O que ando estudando? #00
Tags: python, css, html, alura
Published: 2021-05-11 11:03:04

Resolvi registrar de tempos em tempos o que ando estudando, então aqui vai um pequeno resumo: 

- Python
Comecei a [formação Python da Alura](https://cursos.alura.com.br/formacao-Python-linguagem), depois de concluir um projeto com o básico da linguagem, iniciei a parte 2 onde é explorado tópicos mais avançados. A didática dos cursos é muito boa, temos um projeto (que é um jogo) e a partir disso vamos conhecendo os recursos da linguagem.

- Front End
[Também é uma formação da Alura](https://cursos.alura.com.br/formacao-front-end) e também estou na parte 2. No momento eu aprendi um básico de __HTML e CSS__ e continuo vendo mais recursos.
Am I the only one frustrated with oh-my-zsh?
Tags: question, linux, shell, zsh
Published: 2021-05-11 11:19:45

I feel lonely :) Help me stop this feeling I'm the only one. Just switched from bash to zsh, and while I completely get why somebody would want to use oh-my-zsh, and I don't have anything against the project, it just seems like everybody is using it!? It's difficult to Google for any zsh configuration help/tutorials without ending up with oh-my-zsh. Again, it's not that oh-my-zsh itself bothers me, it bothers me that all my search results are infested with it :)
Get quality technical services at your doorstep. 

Tags: cleaningduabi, carpetcleaning, homemade
Published: 2021-05-11 11:18:16

<a href="https://technicalservicescompanyindubai.com/">Technical Services Company in Dubai</a>? Get quality technical services at your doorstep. Professional & reliable technical services company near you, at best price!
Technical services company in Dubai was founded 2010 and continuously offers high quality services for Electrical, Mechanical, Plumbing, painting, sofa cleaning, and others. We are approved from private and Government agencies across the United Arab Emirates. In addition, our goal is to offer the highest standard of services to our clients. Thus, the quality of the service in order to satisfy the requirements of our valuable clients.
Quality of service is a basic trait of our dedicated and professional work whose performance is a direct result of the qualified training provided by our company and the use of superior equipment and technology, putting us squarely on the leading edge of innovation and solutions for our clientele. We focus on providing what we promise – the effective and efficient management of people and the implementation of leading edge technologies will continue to cement us as a growing organization and fuel our future growth objectives. 
We hire the most professional and experienced staff so we can deliver exceptional Quality Services to our customers. We will always be happy to address any concerns about your home.
You will find us available 24/7 at your door step. All you have to do is just give us a call on +971042706945 and we will get back to you asap.
Pipelines as Code (and some tips!) with Azure Pipelines YAML Multi-Stage Pipelines
Tags: azuredevops, azure, devops, developer
Published: 2021-05-11 11:17:52

![Cloud Drops - Pipelines as Code (and some tips!) with Azure YAML Multi-Stage Pipelines](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lornqs25g3m5xs0xbnt6.jpg)

You may have heard about Software Code or Infrastructure as Code. Well, in this video, we'll be talking about pipelines as code. If you're familiar with tools like Azure DevOps, Circle CI, GitHub, GitLab and Jenkins, you may notice a trend where these platforms are allowing you to define your pipelines as code. Throughout this video, we'll be defining a multi-stage pipeline in Azure DevOps, and picking up some tips along the way.

There is also a blog post available on the topic at [cloudwithchris.com](https://www.cloudwithchris.com/blog/pipelines-as-code/)

{% youtube -v66LR5pxQw %}
How to prevent folder to deploy on Azure app serive
Tags: azure, node
Published: 2021-05-11 11:11:17

I build a node js project for learning purpose and i deploy it on azure app serivce. It works fine, I don't face any kind of issue during deployment or after deployment. But i want to prevent or restrict a folder to not to deploy on azure app service during deployment. Suppose my folder name is logs. So how i prevent logs folder to not to deploy.
Can any one please help me on this.
Bad UX - LastPass Password Dialog
Tags: ux, ui, buttons
Published: 2021-05-11 10:46:56

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

 
So for a while, I have seen the `one-time password` field on the above dialog from LastPass with an instruction to "Enter Secret Key".  

```
otpauth://totp/hub.docker.com:{username}?algorithm=SHA1&digits=6&issuer=hub.docker.com&period=30&secret={Secret}
```

I tried entering the `{Secret}` from a decoded QR code and entering the complete otpauth URL, nothing worked.

Today I decided to google it and found: [Last Pass Support Page](https://support.logmeininc.com/lastpass/help/how-do-i-create-a-time-based-one-time-passcode-totp-for-site-entries-as-a-lastpass-or-identity-user).

WHAT, the "Enter Secret Key" is a button!!!!
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bmm4lxgqp7juofvyscot.png)
<table border=0>
<tr>
<td>
And yes they also had to <br>
point it out with an arrow<br>

so they could explain the <br>feature to the users.
</td>
<td>
<figure>
  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/stqnbw01xy1j4jt8uy9s.png">
  <figcaption>Screenshot from LastPass Help</figcaption>
</figure>
</td>
</tr>
</table>



 

## Simple Improvements in less than 5min.


 
<figure>
  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mxwk0w6siwjy3hyv83j2.png">
  <figcaption>Let there be buttons</figcaption>
</figure>
An automated quick-launch service for staging servers
Tags: testing, docker, devops, programming
Published: 2021-05-11 10:36:37

Evrone focuses on project quality, and using DevOps tools has long been a part of our culture. Some clients even ask us to implement Evrone-style development management in their own companies.

When Docker was released, we immediately began testing new ways that we could use it to increase the quality and efficiency of our work. With Docker’s help, we developed the Teatro.io project, which automated the creation of test (stage) servers for the demonstration and testing of new features.