teleren/devto huggingface dataset:
How To Use Smart Tags in OptinMonster?
Published: 2022-04-20 14:26:40


**What Are Smart Tags**

Smart tags allow you to add dynamic text to your campaign.
For example, you can show a visitor’s name or the current day of the week automatically using specially formatted placeholder text.

**Add a Smart Tag**

When you create a campaign you can customize the text using Smart Tags. You can use our predefined smart tags or define your own custom Smart Tags.

**To add a Smart Tag, follow these steps:**

1. Direct-select a text element in the campaign builder to edit it.
2. In the text edit toolbar, select the { } curly braces button to choose a predefined Smart Tag.
3. Select the Smart Tag you want and it will be automatically added to the text field editor.
4. (Optional) Define the default value you’d like to use for the Smart Tag in case the tag cannot find the necessary information.
5. When you’re finished, click Save.
6. Once the campaign is live, the Smart Tag will be replaced with the dynamic value.

**Smart Tag Format**

Every Smart Tag must start with two opening curly braces and end with two closing curly braces. This allows us to determine which content should be replaced inside of your campaign.
The first value should be either a predefined smart tag or the name of a custom variable you have defined.

> SMART_TAG_NAME

You can optionally use a pipe character (|) followed by text to use as the default in the event that the tag information cannot be found.

> SMART_TAG_NAME|DEFAULT_TEXT

**Reference Blog**
https://www.gomahamaya.com/smart-tags-optinmonster/
⌛ Html Css Js SVG Clock 🕐
Published: 2022-04-20 14:21:56

How to create a super simple clock using html, css, svg images and javascript?

Well it is not so complicated if you keep in mind some essential points,
you need to place the svg circle image directly inside the **Html** page in this way:

```
<div class="clock-container flex">
  <svg class="svg-seconds" width="24px" height="24px" viewBox="0 0 24 24" 	xmlns="http://www.w3.org/2000/svg"><path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 	10-10S17.514 2 12 2z"/></svg>
  <svg class="svg-minutes" width="24px" height="24px" viewBox="0 0 24 24" 	xmlns="http://www.w3.org/2000/svg"><path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 	10-10S17.514 2 12 2z"/></svg>
  <svg class="svg-hours" width="24px" height="24px" viewBox="0 0 24 24" 	xmlns="http://www.w3.org/2000/svg"><path d="M12 2C6.486 2 2 6.486 2 12s4.486 10 10 10 10-4.486 	10-10S17.514 2 12 2z"/></svg>
    
   <div class="time-box">
            <div class="time">00:00:00</div>
   </div>
</div>

```
and this is all the **Html** code you really need,

for the **Css** part it is necessary to give a position relative to the _time-box_ div, so you can position the _Svg_ circles absolutely within it

```
.time-box{
    position: relative;
...
}

/* SVGS  */
svg.svg-seconds{  
    position: absolute;
    width: 360px;
    height: 360px;
    fill: var(--second);
    stroke: var(--third);
    stroke-width: 0.5;
    stroke-dasharray: 63;
}

svg.svg-minutes{  
    position: absolute;
    width: 330px;
    height: 330px;
    fill: transparent;
    stroke: var(--fourth);
    stroke-width: 0.6;
    stroke-dasharray: 63;
}

svg.svg-hours{  
    position: absolute;
    width: 270px;
    height: 270px;
    fill: transparent;
    stroke: var(--seventh);
    stroke-width: 3;
    stroke-dasharray: 63;
}

```
for the **javascript** part instead, you need to create a simple function that change the stroke of the Svg circles and return a time string

```
// TIME FN
function timeFn (){
    let time = new Date();
    let hours = addZero(time.getHours());
    let minutes = addZero(time.getMinutes());
    let seconds = time.getSeconds().toString().padStart(2,0);
    // 4 SVG OFFSET
    secCircle.style.strokeDashoffset = -(63 - (64 * seconds) / 60);
    minCircle.style.strokeDashoffset = -(63 - (64 * minutes) / 60);
    hoursCircle.style.strokeDashoffset = -(63 - (64 * hours) / 24)
    // FULL TIME
    let fullTime = `${hours}:${minutes}:${seconds}`;
    // console.log(fullTime)
    return fullTime;
}

```
to add a zero you can use a function 

```
function addZero (timeValue) {
    return Number(timeValue) >= 10 ? timeValue : '0'+ timeValue;
};

```

or use padStart() methods

```
.toString().padStart(2,0);

```
now all that you need to do is set the interval to 1 second (default) and every time change the inner Html of the time div

```
setInterval(()=> time.innerHTML = timeFn());
```
you can find the code here [github](https://github.com/sitowebveloce/js-css-svg-clock.git)

this is a simple  [video guide](https://youtu.be/pxDydQk47FM)

👋
Wednesday Links - Edition 2022-04-20
Tags: java, jvm, spring, security
Published: 2022-04-20 14:09:52

CVE-2022-21449: Psychic Signatures in Java (7 min)✍️
https://neilmadden.blog/2022/04/19/psychic-signatures-in-java

1,000,000 Concurrent Connections (8 min)🔀
https://josephmate.github.io/2022-04-14-max-connections/

Does Java 18 finally have a better alternative to JNI? (9 min)🦙
https://developer.okta.com/blog/2022/04/08/state-of-ffi-java

These 10 New Features Make Groovy 4.0 AWESOME! (16 min)🤯
https://www.youtube.com/watch?v=fTxFa2Sb4ts

Virtual Thread Deep Dive - Inside Java Newscast #23 (9 min)🤿
https://www.youtube.com/watch?v=6dpHdo-UnCg

The Javax → Jakarta mess, and a Gradle solution (8 min)🪠
https://blog.ltgt.net/javax-jakarta-mess-and-gradle-solution/

Fig - add IDE-style autocomplete to your existing terminal (1 min)🍈
https://fig.io/

Spring Framework Data Binding Rules Vulnerability CVE-2022-22968 (3 min)📌
https://spring.io/blog/2022/04/13/spring-framework-data-binding-rules-vulnerability-cve-2022-22968

Ngrok Spring Boot Starter (1 min)🚇
https://github.com/kilmajster/ngrok-spring-boot-starter

GraalVM Enterprise 22.1—Faster, Smarter, Leaner! (3 min)⏩
https://blogs.oracle.com/java/post/graalvm-enterprise-221--faster-smarter-leaner

Ensure Greater Software Security With Package Analysis by Checkmarx in IntelliJ IDEA (2 min)🔎
https://blog.jetbrains.com/idea/2022/04/ensure-greater-software-security-with-package-analysis-by-checkmarx-in-intellij-idea/
Spring Boot - Nice & Easy
Tags: java, webdev
Published: 2022-04-20 14:06:52

Hey folks! 
Here's a new video format we've been playing with, covering different frameworks & programming languages in a comprehensive but (hopefully) super-engaging way. 

Let's start off with a super popular Java framework:

👉Spring Boot - Nice & Easy.

Let me know what you think in the comments!

{% embed https://youtu.be/QuvS_VLbGko %}

(Direct YouTube Link: https://youtu.be/QuvS_VLbGko)
Retrieve Logic App (Standard / Single-tenant) workflow callback URL using Azure bicep
Tags: azure, bicep, logicapps, automation
Published: 2022-04-20 14:02:11

Recently I've been researching on Azure components, especially using Logic App (single-tenant) and its deployment automation using Azure bicep. One roadblock I faced was retrieving the callback URLs of the workflows inside the Logic App.

It's pretty easy to retrieve the callback URL of a workflow of Logic App (multi-tenant), since practically they're the same thing. The code below retrieve the callback URL of a workflow:

`listCallbackURL('${logicAppWorkflow.id}/triggers/manual', '2017-07-01').value`

Logic App (single-tenant) on the other hand, is a different beast altogether. A single Logic App (single-tenant) can house many different workflows. I've been searching around in Microsoft's documentation, in forums to no avail. Finally I got the hint from stackoverflow post [here](https://stackoverflow.com/questions/69008987/not-able-to-retrieve-logic-app-standard-workflow-url-from-arm-template) where user ibda provided the REST API sample below:

`az rest --method post --uri https://management.azure.com/subscriptions/$subscription/resourceGroups/$ResourceGroupName/providers/Microsoft.Web/sites/$LogicAppName/hostruntime/runtime/webhooks/workflow/api/management/workflows/$MyWorkflow/triggers/manual/listCallbackUrl?api-version=2018-11-01`

Essentially, with the above sample we can just call the function as follows:

`listCallbackUrl('${logicAppStd.id}/hostruntime/runtime/webhooks/workflow/api/management/workflows/${workflowName}/triggers/manual', '2018-11-01')`
Why should you learn Angular?
Tags: angular, javascript, webdev
Published: 2022-04-20 14:00:17

Angular is one of the most popular JavaScript-based web development frameworks and is used by many application developers to create web applications. Angular provides various features like HTTP service, materials, and animations which helps the developer to create large applications and saves their time writing lengthy codes.

## Why Angular?
Angular applications are built using TypeScript language, which removes errors during encoding and ensures high performance and security.
It offers two bindings that provide seamless synchronization between modes and views. Updates these components in real-time, in case the data is updated.
Angular time investment in projects is small compared to other web development frameworks. The Angular CLI tool allows developers to build original projects, perform tests, and integrate features together.
Angular View Engine takes the templates you have written and merges them into HTML and JavaScript files for the browser to read.
Reduce development time as Angular uses HTML to define the user interface of the app, which is more complex compared to JavaScript.

## Features of Angular
The Angular Framework supports many platforms that help developers build different types of Desktop applications, native, and ongoing web applications. Angular provides excellent performance for the following reasons:

**Code Distribution**: With the help of the router component, the user can decrypt the default code. Therefore, only the code required to provide is uploaded.
Extensive Support: Angular can be used with a variety of programming languages ​​in front-end development and servers for faster use with HTML.

**Production**: Angular provides powerful templates for quick UI creation and Angular CLI provides command-line tools for faster development and implementation.

**Accessibility**: Angular provides ARIA-enabled components, built-in test facilities, and developer guides to create accessible applications.

**Animation Support**: Create animation timers that work best by typing small code.

**Test**: Test your codes using Angular testing runners. In Angular, Jasmine is used to testing the unit, while Karma is a JavaScript test runner.

## Advantages of Angular
There are various advantages of learning Angular
1. Coding Reduced
2. Single Page Applications are supported By Angular
3. Declarative User Interface
4. Modularity
5. Ease of Integration

With the help of features and advantages of using Angular, developers can benefits significantly by learning Angular. Also, you can take an [Angular Course](https://intellipaat.com/angular-training/) that allows you to learn Angular for further development
NextJS Key not working
Published: 2022-04-20 13:47:44

Hey there! I tried creating an array with nextjs but I always get the error `Missing "key" prop for element in iterator`. Does anyone know how to fix that error? I really don't know what I did wrong

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

My data: (These aren't real ip adresses)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1bvd86xqjxon5ftb00yk.png)
How to Install and Use the Zapier Addon With WPForms
Published: 2022-04-20 13:36:01


**Installing the Zapier Addon**

Before you get started, be sure you’ve installed and activated WPForms and verified your license. Then go ahead and install the Zapier addon.
Once the Zapier addon is activated, go to WPForms » Settings and click on the Integrations tab. Here, you’ll see Zapier listed with your available WPForms integrations. Go ahead and click on it to see more details. This is where you’ll find the Zapier API key for your site.

**Creating a Zap in Zapier**

In Zapier, the integrations you create are called “zaps.” The next step is to create a zap that sends information from your forms to another service. First, you’ll need to log in to your Zapier account. If you don’t have one yet, then you can sign up for free. After you’ve logged in to your account, click the Create Zap button in the upper left corner (if your browser window is small, this button may appear as a black plus (+) sign instead).

**Setting Up Your Trigger Event**

Next, select WPForms as your trigger app. In the App Event search box, type “WPForms.” In the results that appear, click on WPForms.
Once you’ve selected WPForms, Zapier will display your trigger options under Trigger Event. WPForms only has one trigger option (New Form Entry). Select it from the dropdown, then click the Continue button to proceed.

**Reference Blog**
[How to Install and Use the Zapier Addon With WPForms](https://www.gomahamaya.com/zapier-addon-wpforms/)
💡 12 DICAS que vão te ajudar nos testes técnicos práticos acompanhados (Hands-On)
Tags: career, help, hackeandoatechinterview
Published: 2022-04-20 13:25:10

Esse teste prático consiste em realizar a implementação de algum trecho de código ou projeto em tempo real com o acompanhamento de outras pessoas desenvolvedoras. Similar ao teste de quadro-branco porém, considera que as pessoas devem implementar utilizando o computador.

1. Treine com ferramentas HackerRansk, Codility, Codewars.

2. Estude algoritmos de base.

3. Quando a aplicação estiver pronta aplique clean code.

4. Escreva o código em inglês.

5. Mantenha a calma.

6. Se já tem um trecho de código, tente seguir padrões.

7. Pergunte e converse com as pessoas que estão acompanhando o teste.

8. Nem sempre as regras são simples. Se necessário, utilize os comentários para escrever as regras antes de implementar.

9. Pense em melhoria incremental, ou seja, implemente as melhorias aos poucos. Primeiro faça funcionar, depois melhores performance e escrita.

10. Não fale sobre termos que você ainda não pratica como se você já tivesse prática.

11. Seja honesto(a), não tem problema falar quando você não sabe sobre um tema.

12. No final, cite quais seriam possíveis melhoria para o código e implementação. 

E aí, o que achou das dicas? Adicionaria mais alguma coisa?

Deixe seu comentário abaixo!
Primeiros passos com Gradle no Java 11
Tags: webdev, gradle, java, beginners
Published: 2022-04-20 13:23:34

Aprenda como utilizar o Gradle em um projeto Web com Java e Spring Boot.

Vantagens de utilizar o Gradle

- Até 10x mais rápido do que o maven
- Gerenciador de Builds oficial do projeto Android
- Facilidade para customização dos projetos 
- e muito mais que você apredenrá no vídeo. 

Assista o vídeo e nos deixe um comentário.

{% embed https://www.youtube.com/embed/YABbY3JVMmM %}
Django REST FRAMEWORK Tutorial 7 -- snippet_list の GET/POST を APIView で扱う
Tags: django
Published: 2022-04-20 12:54:55


## 前回の復習

前回の記事で sinppets/views.py で
`@csrf_exempt` で JSON レスポンスを通して GET と POST を実装した

## APIView で GET/POST を確認

https://www.django-rest-framework.org/tutorial/2-requests-and-responses/#wrapping-api-views

```py
from rest_framework import status
from rest_framework.decorators import api_view
from rest_framework.response import Response
```

status コードの 200 ~ 500 を使うために status
`@api_view` を使うために api_view
Response として返すために Response

これらをインポート

```py
@api_view(['GET', 'POST'])
def snippet_list(request):
```

`@api_view` で GET, POST を受けることを snippet_list の上に記載

```php
AssertionError at /snippets/
@api_view missing list of allowed HTTP methods
```

`@api_view` のみだと、HTTP メソッドの許可がないエラーになる。


---

## GET

snippet_list の中にかく

```py
    if request.method == 'GET':
        snippets = Snippet.objects.all()
        serializer = SnippetSerializer(snippets, many=True)
        return Response(serializer.data)
```

GET は前回と大きくは変わらない。
JsonResponse を Response に変更して safety=false がなくなったくらい。

---

## POST

```py
    elif request.method == 'POST':
        serializer = SnippetSerializer(data=request.data)
        if serializer.is_valid():
            serializer.save()
            return Response(serializer.data, status=status.HTTP_201_CREATED)
        return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
```

POST は大きく変わった。
JSON parser を使わず、request.data から直接シリアライズし

JsonResponse を使えわず、Response で
`status.HTTP_201_CREATED` や `status.HTTP_400_BAD_REQUEST`
をステータスとして返すようにする

---

## ブラウザで REST FRAMEWORK の API View を試す

上記のメソッドをちゃんと記載していれば


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

API View を使って、REST FRAMEWORK の UI で綺麗にレスポンスが見れる。


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


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

```php
POST /snippets/
HTTP 201 Created
Allow: OPTIONS, POST, GET
Content-Type: application/json
Vary: Accept

{
    "id": 8,
    "title": "from REST API VIEW",
    "code": "print(\"updated\")",
    "linenos": false,
    "language": "python",
    "style": "friendly"
}
```

Postman と同じように POST も JSON データを送れる。

---

## まとめ

`@api_view(['GET', 'POST'])` と定義して関数を書くと
ブラウザで Django REST framework の API View の形で
GET, POST を扱える。
1.Naked Machine Learning
Tags: machinelearning, python, programming, datascience
Published: 2022-04-20 12:50:03

I have been thinking to write about Machine Learning for quite a while so I'm finally writing my first blog using whatever I learned for the past few months. This will be a series of blogs covering all the fundamental topics you need to get start with Machine Learning.

## Pre-Requisite 

To get most out of this blog series, you need to have the understanding of Python.

## IDE

For this series, We will be using Google Colab that allow you to write and execute arbitrary Python code from your browser without  worrying about the computing resources. 

## Problem Statement

Through this series, We will be trying to build a real time NIDS solution using Machine Learning. However, we can deviat from this to get a better understanding of a specific concept.

## Dataset

The dataset used for this series is [CSICS-2017](https://www.unb.ca/cic/datasets/ids-2017.html) which you can easily download and find information from [here](https://www.unb.ca/cic/datasets/ids-2017.html). 

## Supervised Learning

We will be using Supervised Learning to solve this problem. Supervised Learning algorithm are trained using labeled examples, such as an input where desired output is known.

For example: 

We want to create a model which tells us whether a given Email is SPAM or HAM. The model is trained with dataset which contain millions of email each tagged with either **HAM** or **SPAM**. This is the simple example of supervised Learning.

In a nutshell, our Machine Learning models receive a set of input (emails) along with cerrosponding outputs (HAM or SPAM), and the algorithm learns by comparing its actual/predicted output with correct outputs to find errors. It then modifies the model accordingly in order to get the desired accuracy.

Let's continue our journey with the next blog.
Every web developer should be familiar with these GitHub repositories.
Tags: javascript, webdev, programming, github
Published: 2022-04-20 12:30:24

A GitHub repository is a site on the GitHub platform where files and codes pertaining to projects and their associated versions are saved, managed, and used as part of the revision history. Within the repository, one can discuss and manage the entire project's work. With the definitions done, let’s check out the repositories(repos)!

## The repositories are:

- Clean Code JavaScript. It's a tutorial for writing legible, reusable, and refactorable JavaScript code. You'll be able to tell what's good code and what's bad code. How to name variables in a sensible and pronounceable way. Also, how vital it is to use the same terminology for the same variable. More intriguing is the role of searchable names in maintaining maintainability. Given that we will read more code than we produce, it includes samples of legible code. It has been translated into 20 other languages.https://github.com/ryanmcdermott/clean-code-javascript


- JavaScript algorithms. Many popular algorithms and data structures are demonstrated using JavaScript in this repository. Each method and data structure has its own README file with explanations and links to other resources (including ones to YouTube videos). It includes JavaScript implementations of algorithms and data structures, as well as explanations and connections to more reading. https://github.com/trekhleb/javascript-algorithms


- Free-for.dev .A collection of SaaS, PaaS, and IaaS providers with free tiers of interest to devops and infradev developers and open source authors. There are a lot of free tiers out there, but finding them all to make educated judgments might be difficult. This is a list of software (SaaS, PaaS, IaaS, and other providers) with free developer levels. This list is restricted to items that infrastructure developers (System Administrators, DevOps practitioners, and so on) are likely to find valuable.https://github.com/ripienaar/free-for-dev

See you soon.
How much does it cost to develop an app like Tinder?
Tags: android, ios, mobile
Published: 2022-04-20 12:20:12

If you want to know how much does it cost to create a dating app like tinder, there are a number of factors that can increase or lower the dating mobile app development cost. The best guidance can be given by [app developers for startups](https://appinventiv.com/startup-app-development/) who will help your company foray into the hot market of online dating apps. 

However, some factors are discussed below for you to consider before taking your next big step: 

**1. App platform**
To create an app like Tinder, iOS platforms cost comparatively less than Android platforms. Since android applications require multiple testing on various devices, it is important to explore the possible development opportunities on both the platforms. 

**2. App design** 
If you are looking to incorporate tinder-like app design in your social media application, note that the development cost is going to be relatively higher. You can take advantage of the advanced designing and development tools available to run down the cost. A reliable social media app development company can help you with developing a Tinder clone at an affordable price. 

**3. App size **
App size signifies the total number of features and functionalities the app carries. The more functionalities your business app bears, the higher it’s development cost will be. 

**4. App developers**
The tinder app developers have a proficient experience and expertise in creating dating applications. Therefore, the location of your app developers, their history and experience also play a significant role in determining your app development cost.
SaaS product adoption for dummies
Published: 2022-04-20 12:14:17

There are plenty of things you probably want to get right with your SaaS business.

Hell, there are plenty of things you need to get right if you’re going to be successful.

Build strong relationships with potential users and customers alike
Make it easy for users to sign up and become paying customers
Allow average folks to become power-users as quickly as possible
Lucky for you, there’s one concept that incorporates all these SaaS ideas and more into two words.

**Product adoption.**

Read the complete guide to SaaS product adoption on the Driftly blog - https://blog.driftly.app/saas-product-adoption/