teleren/devto huggingface dataset:
Scripting support added to the Structurizr DSL
Tags: architecture
Published: 2021-09-10 16:10:41

---
title: Scripting support added to the Structurizr DSL
published: true
description: 
tags: architecture
//cover_image: https://direct_url_to_image.jpg
---

The [Structurizr DSL](https://github.com/structurizr/dsl) now provides a way to run scripts written in Groovy, Kotlin, Ruby, and JavaScript, via the new `!script` keyword. This gives you access to the underlying [Structurizr for Java](https://github.com/structurizr/java) workspace, for when you need to do something not supported by the DSL.

For example, you could use a script to create the default set of views, without automatic layout enabled:

```
workspace {

    model {
        user = person "User"
        softwareSystem = softwareSystem "Software System"

        user -> softwareSystem "Uses"
    }

    !script groovy {
        workspace.views.createDefaultViews()
        workspace.views.views.each { it.disableAutomaticLayout() }
    }   
     
}
```

You could also use a script to programmatically add elements to a view, using more complicated logic than is possible via the DSL alone.

```
workspace {

    model {
        group "Group 1" {
            a = softwareSystem "A" {
                tags "Tag 1"
            }
            b = softwareSystem "B" {
                tags "Tag 2"
            }
        }
        group "Group 2" {
            c = softwareSystem "C" {
                tags "Tag 1"
            }
            d = softwareSystem "D" {
                tags "Tag 2"
            }
        }
    }

    views {
        systemLandscape "key" {
            !script groovy {
                view = workspace.views.getViewWithKey("key");
                workspace.model.softwareSystems.findAll { it.group == "Group 1" && it.hasTag("Tag 1") }.each{ view.add(it); };
            }

            autolayout
        }
    }

}
```

Scripting support is available now, via the open source [Structurizr CLI](https://github.com/structurizr/cli) and the free [Structurizr Lite](https://structurizr.com/help/lite). See the [Structurizr DSL language reference - Scripts](https://github.com/structurizr/dsl/blob/master/docs/language-reference.md#scripts) and the [Structurizr DSL cookbook - Scripts](https://github.com/structurizr/dsl/tree/master/docs/cookbook/scripts) for more details.
Introduction
Tags: opensource
Published: 2021-09-10 16:00:57

My name is Kunwarvir and I'm currently a student in Toronto. I've always been intrigued by open source and even though over the years I've used a lot of open source code in my projects, I never really got around to becoming a contributor in open source development.

However, I really wanted to try out open source development and I plan on becoming an active contributor in the open source community. This blog marks the beginning of my open source journey, and I will use it to share my experiences.

As a starting point, this week I explored trending projects on GitHub. I was amazed by the number of interesting projects out there, but one that especially caught my eye was [google/zx](https://github.com/google/zx), as it provides a way to write bash scripts with JavaScript

Another project that has sparked my interest is [loopback-next](https://loopback.io/index.html), which is a Node.js framework that can be used to generate APIs. I find it really interesting and I've forked this project on GitHub. It seems like an active project that is being worked on, and this is definitely something I could contribute to.
https://github.com/loopbackio/loopback-next
OSCA OS Challenge 2021
Tags: opensource, github, android
Published: 2021-09-10 15:44:55

The OSCA Open-Source 2021 challenge finally came to an end even though I started late I'm glad I participated in the challenge. I learnt a lot of things involving what is actually an Open Source Software to contributing to different open source projects.

Though it was quite a challenging tasks that involves searching for active repositories, attempting to try and understand the code-base, fixing issues, following contribution guidelines and finally creating the actual PR. Then comes the hard part of waiting for it to be actually merged. But the feeling of seeing my PRs getting merged makes it a rewarding task.

Thumbs up to the Open Source Community Africa (OSCA) team for organizing this event, hoping to see more of this in the future.
5 no-code apps that officials battling COVID can benefit from
Published: 2021-09-10 13:11:10

At a certain level, the response to COVID has been about information. We have all become a little statistics-literate, seeing endless graphs depicting daily COVID counts, the distribution of cases, recovery rates, looking at curves representing "exponential growth". 

Officials dealing with COVID, especially the administrative side, have also had to deal with vast floods of information. Here is a list of 10 "no-code" apps that these officials can immediately benefit from, even though they might not have coding experience. The apps below assume the [WorkMap.ai no-code automation platform](https://www.hyperoffice.com/wm/), but these apps could be built in other similar platforms as well. 

**1. Registration Forms** - Officials need to gather information from their stakeholders, whether it be people registering for vaccinations, testing, essential employees giving consent, or just about anything else. Registration Forms can be quickly set up, branded, and gather data from stakeholders in a database that can be sliced and diced as needed.

**2. Vaccine Self-Scheduling** - This allows end-recipients of vaccinations to use a link to self schedule for a vaccination slot.

**3. Vaccination tracking** - This is more an end to end solution for vaccine management, allowing patients to self register, schedule a vaccination, have vaccination details captured once they get the vaccination, sign consent, get reminded about follow ups, and finally get their vaccination passport. 

**4. Test Tracking** - Many organizations need to regularly test their employees or audiences on a regular basis, and report findings to the authorities. For example a meat plant, that needs to make sure its employees are COVID free, or a concert organizer, which needs to test the audience. A test tracking application allows you to register people, and record test results against them, and report on this data internally, or provide it to authorities. 

**5. Alerts and reminders** - This allows for stakeholders to sign up for email and SMS alerts and reminders from local authorities, their school, their employer etc.
The plugin `libphonenumber` uses a deprecated version of the Android embedding flutter
Published: 2021-09-10 15:29:25

{% stackoverflow 68756780 %}
The plugin `libphonenumber` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.

This problem occurred after the upgrade of flutter 2.5.0, now  I have the problem when I'm going to flutter pub get or flutter run
Learning Path for QA with JavaScript
Tags: javascript, qa, auomation
Published: 2021-09-10 15:17:54

1. Understand Node 
2. Understand NPM
3. Understand yarn
4. Understand How to initialize Node Project (nmp init -y)
5. Understand package.json & its Key
6. Understand packkage-lock.json file
7. Understand Execute Script Under Package.json
8. Understand How to install different package from npm & its command
9. install Any Package Like Cypress,WebdriverIO,Playwright,Puppeteer 
10. Happy Learning
Beginning of my Open Source Journey
Tags: opensource, osd600
Published: 2021-09-10 14:30:29

Hello people of the internet! My name is Francesco Menghi and I am a third year student at Seneca College in Computer Programming and Analysis. I am originally from Italy and I have been living in Toronto for the past 12 years.

I have been using the internet for a long time and have always enjoyed learning from people's blogs, but I never thought about starting my own. I guess it's never too late for it!

I am currently taking the Open Source Development (OSD600) course to improve my knowledge of Git and to get involved and contribute to open source software. I find it fascinating that there is a rich community of people that give their time to create and maintain projects that are accessible for everyone to use.

My first real interaction with open source software happened when I was a teenager and I installed Ubuntu 8.04 (from a CD!) on my old Windows XP laptop because it was getting too slow. Looking back, I wish I learned more about Linux instead of just playing [Tux games](https://en.wikipedia.org/wiki/Tux_%28mascot%29#List_of_video_games_featuring_Tux) and moving on to other things.

During the semester, I am also hoping to improve my web development skills, especially getting more comfortable with Javascript. I recently discovered a project called Chart.js from this [blog post](https://tobiasahlin.com/blog/chartjs-charts-to-get-you-started/). Chart.js is a very useful tool to create beautiful HTML5 Charts and I would like to try to contribute to it.

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

{% github chartjs/Chart.js no-readme %}

I am ecstatic to learn the ropes in contributing to open source projects, as I hope to become an avid contributor in the near future. I know I have a lot to learn but am feeling very excited to begin!
HELP on JS! alert box wont appear in browser
Tags: javascript, help, alertjs, beginners
Published: 2021-09-10 14:35:27

new to js ... i tried my best to display alert box in browser, this are my html and js file


<!DOCTYPE html>
<html lang="en">
<head>
    <script src="try.js"></script>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="try.css" type="text/css" >
</head>
<body>
   <button class="try">click here</button>
    
</body>
</html



var any = document.getElementsByClassName("try");
any.addEventListener('click' , () =>{
alert('you clicked!');
});
REST vs. SOAP
Published: 2021-09-10 14:16:48

### SOAP: Simple Object Access Protocol
SOAP was created to accomplish communication between applications over all internet browsers and servers. Regardless of any operating system, technology or programming language.

1. It is a protocol
2. Based on rules
3. XML only
4. Not cacheable


### REST: REpresentational State Transfer
1. Architectural principles
2. A set of guidelines
3. HTML, XML, plain text, and JSON
4. HTTP only

### SOAP vs. REST
REST is faster and more flexible then SOAP for web-based scenarios. SOAP however has built-in (security) rules with specific requirements, this fit many enterprise needs better but is heavier.

That's all folks~
Viewbinding
Tags: android, kotlin
Published: 2021-09-10 13:53:38

Hoje eu quero falar de uma forma melhor de referenciar controles dentro do Android com Kotlin sem ser usando o findViewById. Uma boa alternativa é usando o Viewbinding. Com ele temos, inclusive, o suporte do intelissense do Android Studio para localizar os nossos controles localizados no __layouts.xml__. Vamos ver como fazer?

Antes de mais nada coloque dentro do build.gradle da app o seguinte trecho:
```gradle
    buildFeatures{
        viewBinding = true
    }
```
Este trecho vai dentro do bloco __android__.

Agora dentro de MainActivity.kt você declara uma variável da seguinte forma: 
`lateinit var binding: ActivityMainBinding`

Depois, dentro de __onCreate__ inclua a seguinte instrução:
`binding = ActivityMainBinding.inflate(layoutInflater)`

Agora pra acessar o objeto declarado no xml tudo que é preciso é usar dessa forma:
`binding.myTextView.text = "new text"`

Layout.xml:
```xml
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <TextView
        android:id="@+id/myTextView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="¿Hola?"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <Button
        android:id="@+id/myButton"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Click me!"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintRight_toRightOf="parent" />

</androidx.constraintlayout.widget.ConstraintLayout>
```

MainActivity.kt
```kotlin
package com.avanade.viewbinding

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.Button
import android.widget.TextView
import com.avanade.viewbinding.databinding.ActivityMainBinding
import org.w3c.dom.Text

class MainActivity : AppCompatActivity() {
    lateinit var binding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding = ActivityMainBinding.inflate(layoutInflater)
        setContentView(R.layout.activity_main)

        //Antes
        val oldButton: Button = findViewById<Button>(R.id.myButton)
        val myText: TextView = findViewById<TextView>(R.id.myTextView)

        //Agora
        val button: Button = binding.myButton
        val text: TextView = binding.myTextView

        binding.myTextView.text = "new text"
    }
}
```

[Código](https://github.com/dgbarreto/android_viewbinding)

Até a próxima!
Please don't mock SWR, Fetch or Axios in your unit/integration tests
Tags: testing, jest, react, webdev
Published: 2021-09-10 13:43:46

Please don't mock SWR, Fetch or Axios in your unit/integration tests.

In this video you will learn how to test components that use "useSWR" without doing jest.mock("swr") or jest.mock("axios") or jest.spyOn(window, 'fetch') in order to give you more confidence on your tests :)

We are going to use MSW (Mock Service Worker) in order to mock the HTTP call itself, not your favorite fetching library

{% youtube FggwAN76lM0 %}
Setting up External File Storage in Optimizely CMS 12 (preview)
Tags: optimizely, episerver, blobs, cms
Published: 2021-09-10 13:26:38

Optimizely (formerly Episerver) CMS 12 comes with lots of exciting new stuff, including .NET 5 support (thank you finally!).

Setting up a new website in a development environment is easy ([Clone the .NET 5 preview repo here](https://github.com/episerver/netcore-preview)), however when you want a shared file share for the blobs (instead of the local App_Data folder), it's a little bit hard to find the accurate documentation for it.

To configure an Optimizely CSM 12 (preview) website to use a file share, you need to edit the `appSettings.json` file to include `BlogProviderOptions`, like this:

```
{
  "EPiServer":{
     "Cms":{
            "BlobProvidersOptions": {
                "DefaultProvider": "fileShare",
                "Providers": {
                    "fileShare": "EPiServer.Framework.Blobs.FileBlobProvider, EPiServer.Framework"
                },
             } 
             "FileBlobProvider":{
                 "Path": "\\dbserver\blobs"
             }
     }
  }
}
```

Until you do so, the `App_Data` folder will be used for your CMS content files.

The documentation for this can be found under the [Deploying to Windows Servers](https://world.optimizely.com/documentation/developer-guides/optimizely-platform/-net-core-preview/CMS/Deployment/deployment-scenarios/Deploying-to-Windows-servers/) section.
Async/await ainda pode te surpreender... MUITO!
Tags: javascript, codenewbie, computerscience, webdev
Published: 2021-09-10 13:21:56

Eu amo tecnologia ❤, e o fato de que não importa o quanto você saiba ainda vai existir algo para te supreender. Algum tempo atras, um amigo meu ([@Rafael_Toscano](https://twitter.com/toscanorl)) me mostrou algo e minha reação automática foi mais ou menos assim:

![Cat Surprised ](https://charlesassuncao.tech/919cd1a4952b40064bb1905abc1be859/tumblr_ma0do9creh1qi2sux.gif "Cat Surprised ")

Ele compartilhou comigo um artigo do blog da V8 sobre ["Faster async functions and promises."](https://v8.dev/blog/fast-async) e entre várias coisas interessantes, uma particular capturou minha atenção de uma forma que na hora eu pensei "Isso não pode ser real, vou ter que testar."

Era sobre o comportamento do `async/await` e como podem ser usados com qualquer função que seja considerada "thenable". O que isso significa? Qualquer objeto que tenha um método `then()` pode ser usado com `async/await`

No artigo ele da o seguinte exemplo:

```javascript
class Sleep {
  constructor(timeout) {
    this.timeout = timeout;
  }
  then(resolve, reject) {
    const startTime = Date.now();
    setTimeout(() => resolve(Date.now() - startTime),
               this.timeout);
  }
}

(async () => {
  const actualTime = await new Sleep(1000);
  console.log(actualTime);
})();
```

![Mother Of God](https://charlesassuncao.tech/static/96f9dd53fa7e40bf581a295fac92da98/ffc89/disgusted-mother-of-god.png "Mother Of God")

Yeaaah, por favor me diz que não fui só eu que ficou tão surpreso. 

Acho que ajuda a gente a entender um pouco mais sobre como `async/await` funciona e as possibilidades das coisas que podemos fazer fazer. Mas como diria tio Ben, isso tudo vem com grandes responsabilidades também, não vai sair colocando objetos com `then` no projeto só para parecer fodão 💣

Você provavelmente nunca vai precisar de usar `async/await` dessa forma direta e se você encontrar um caso de uso para isso por favor compartilha com a gente. Um caso que eu considerei foi para implementar algo chamado "retry strategy", segue o exemplo: 

```javascript
const ServerMock = {
  count: 0,
  getData() {
    if (this.count === 2) {
      return Promise.resolve([{ name: "SomeName" }]);
    } else {
      this.count++;
      return Promise.reject("Error");
    }
  }
};

function fetchData(limit, time) {
  return {
    then(resolve, reject) {
      const retry = setInterval(async () => {
        limit--;
        try {
          console.log("Trying....");
          const data = await ServerMock.getData();
          if (data) {
            console.log("Resolve");
            clearInterval(retry);
            resolve(data);
          }
        } catch {
          if (limit === 0) {
            clearInterval(retry);
            reject("Limit Reached");
          }
        }
      }, time);
    }
  };
}

(async () => {
  try {
    const result = await fetchData(3, 1000);
    console.log(result);
  } catch (err) {
    console.log(err);
  }
})();
```

Me diz o que você achou sobre essa nova descoberta nos comentários...
GitApper or a way to extend Git without alias or custom scripts
Tags: bash, git, opensource
Published: 2021-09-15 16:29:56

---
title: GitApper or a way to extend Git without alias or custom scripts
published: true
date: 2021-09-10 12:50:53 UTC
tags: Bash,git,OpenSource
canonical_url: https://daniele.tech/2021/09/gitapper-or-a-way-to-extend-git-without-alias-or-custom-scripts/
---

A new way to use Git for developers and maintainers that want to get the best from this tool easily.

The post [GitApper or a way to extend Git without alias or custom scripts](https://daniele.tech/2021/09/gitapper-or-a-way-to-extend-git-without-alias-or-custom-scripts/) appeared first on [Daniele Mte90 Scasciafratte](https://daniele.tech/eng).
I Want To Be a Software Engineer
Published: 2021-09-10 12:49:52

A software engineer is a person who can develop, debug, and come up with complete, better software that can solve problems. She\He is always ready to make changes when the program has some problems. The best thing about this subject or course is that you create things that cannot be touched, they are virtually confined. Becoming a software engineer is not as easy a task as it may sound. But it’s the only engineering that you can get without a university degree or diploma.


Learn the Right Programming Languages

This is the key foundation of software development. You can either decide to be a back-end developer with languages such as java, python, C#, C++, C, etc., or you can decide to be a front-end engineer with languages such as JavaScript, HTML5, CSS, and their frameworks. Alternatively, you can decide to be a full-stack developer working both front-end and backend with additional knowledge in database languages i.e. MySQL and SQL.


Data structure and algorithms.

Many people will complain about the difficulty of understanding this unit. But it is the building unit of a software engineer. There are many algorithms to be used in developing complex software. Dealing with large projects you need some sort of array, hash maps, a stack which are all data structures. This is the area where most big companies will test their interns to see how they approach difficult problems. For those who are self-taught programmers, make sure you take a course in this topic, it will broaden your mind to start seeing projects more than just writing codes and compiling them.


Sharp and open-minded.

‘Think like a programmer’s the obvious quote in computer science class. You have to be that person that can come up with several ideas to solve one problem. See the problems from different angles, and have different methods to tackle the problem. In addition, you should also be an open-minded person to learn new things as technology is developing day and night. Be that person who can improve the existing solution to make it more useful.


The field calls upon some Math foundation.

Not all the math that you are being taught will apply to this course, but always make sure you understand some important concepts rather than cramming math formulas. The best units that are helpful include Linear Algebra, Calculus, Vector Mathematics for Computer science, Discrete math, etc. This is essential math that you need to equip yourself with. Always have a deeper understanding of each because you will be required to apply at a certain point.


Finally, focus on your goals.

Have a team with whom you can take on small projects. Remember, everyone starts from zero to a hero. The technology industry is growing fast, and many potholes are yet to be filed. The industry is calling for more software engineers to re-engineer models that can be used even by developers such as compilers. Trust God!.