teleren/devto huggingface dataset:
Build Spinner With HTML, CSS, SVG
Tags: html, css, svg, webdev
Published: 2022-03-20 14:45:53

Hello friends,
In this article, I will teach you how to create a Spinner with HTML, CSS, SVG.

View live Codepen: https://codepen.io/mhadi-2003/pen/abEZdjX

## HTML

```
<div class="container">
    <svg role="status" class="spinner animation-spin" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
        <path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"></path>
        <path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"></path>
    </svg>
</div>
```

## CSS

```
.container {
    padding: 10rem 1rem 1rem 1rem;
    text-align: center;
}

// Spinner
.spinner {
    color: rgb(229, 231, 235);
    height: 50px;
    width: 50px;
    fill: #1c64f2;
}

// Animation Spin
.animation-spin {
    -webkit-animation: spin 2s infinite linear;
    animation: spin 2s infinite linear;
}
@keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}
```

- You can change the color inside the spinner with the `Fill` property and the border color with the `Color` property: 

```
fill: red;
```

```
color: #fff;
```
- Or you can use the `Width` and `Height` attributes to resize the spinner:

```
height: 60px;
width: 60px;
```
- You can also increase or decrease the speed of the spinner with the `animation` attribute:

```
animation: spin 1s;
```
I hope you enjoyed this article.
3 Movies About Hacking That Will Make You Think Twice.
Tags: whoami, hacking, movies
Published: 2022-03-20 14:37:19

We have decided to present you with a ranking of the 5 best Hacking Movies of all the movies and TV series of all time. If you have not yet watched these 5 movies, be sure to add them to your to-do list. There is no doubt that the film has important social meaning and is something that will eventually leave something to think about. [Read Continue](https://ilabacademy.blogspot.com/2022/03/3-top-hacking-movies.html)
Binding and continuations in ML
Tags: functional
Published: 2022-03-20 14:36:28

If you have ever worked with Rust code before, you might have come across code like this

```rust
let a = {
  let x = 5;
  let y = 4;
  let x = 7;
  x + y
}
```

Considering your past experience with C-based language, several questions might spring to mind:

* Why is it legal to define the same variable multiple times?
* Why do blocks evaluate to the last expression in their bodies?

To get answers and more, It helps to look at a distant cousin to Rust.

## Enter OCaml
>**NB:** You can refer to https://learnxinyminutes.com/docs/ocaml/ for a quick crash course on OCaml's syntax

The same code in OCaml would be written like this:

```ocaml
let a =
  let x = 5 in
  let y = 4 in
  let x = 7 in
  x + y
```

Which could be viewed as syntactic sugar for the following:

```ocaml
(* bind is a Higher-order function that takes a value and
 * a function, and returns the result of applying that value
 * to the function
 *)
let bind x fn = fn x;;

bind 5 (fun x ->
  bind 6 (fun y ->
    bind 7 (fun x ->
      x + y
    )
  )
);;

(* Same code but without indentation.
 * Notice how bind has replaced the assignment operator.
 *)
bind 5 (fun x ->
bind 6 (fun y ->
bind 7 (fun x ->
x + y)));;
```

Because each line in our first OCaml snippet corresponds to a nested function in our second snippet, we can see why it is legal to define the same variables multiple times. It also shows why blocks are just expressions that evaluate to the last value in their bodies.

## Killing all birds with one stone

Replacing the assignment operator with a customizable bind function is a powerful abstraction that lets us do all sorts of things that would otherwise have taken years to be implemented in the core language, including Rust's try operator and async/await syntax.

While I won't bore you with all the details of how this is done, I will leave you with some resources if you're interested in how deep the rabbit hole goes.

- https://www2.lib.uchicago.edu/keith/ocaml-class/definitions.html
- https://fsharpforfunandprofit.com/posts/computation-expressions-continuations/#continuations-and-let
- https://jobjo.github.io/2019/04/24/ocaml-has-some-new-shiny-syntax.html
- https://www.cs.cornell.edu/courses/cs3110/2015fa/l/17-async/rec.html
Lucian’s-Luscious Lasagna Exercism JavaScript
Tags: javascript, exercism, tutorial, github
Published: 2022-03-20 14:22:13


Coisas que precisamos fazer:
- Task 1: Definir a constante `EXPECTED_MINUTES_IN_OVEN` que representa com quantos minutos vai precisar ficar no forno. Deve ser exportada. O valor que temos que dar a essa `const` é de 40.

```
    const PREPARATION_MINUTES_PER_LAYER = 2;

    export const EXPECTED_MINUTES_IN_OVEN = 40;
```

- Task: 2 Implementar a função `remainingMinutesInOven()` que leva como parâmetro os minutos reais que esteve no forno e retorne quantos minutos a lasanha ainda precisa permanecer no forno, com base no tempo de forno esperado em minutos da tarefa anterior.
[gif de tela azul]

Vamos com calma para entender melhor? 

- 1️⃣ Primeiro, nós temos uma função que se chama `remainingMinutesInOven`, certo? 
- 2️⃣ Ela tem um parâmetro (o que está entre parênteses na função, lembrou?) 
- 3️⃣ Beleza, temos uma função, ela tem um parâmetro mas, o que ela tem que retornar para nós? 
- 4️⃣ O tempo que precisa ficar no forno que está sendo definido pela const `EXPECTED_MINUTES_IN_OVEN` e nós precisamos do tempo que já ficou no forno que a const `actualMinutesInOven`
- 4️⃣ Entãooo para termos a conta exata precisamos SUBTRAIR. Ficou claro pra ti? Me conta ae!

```
    export function remainingMinutesInOven(actualMinutesInOven)
    {
        return EXPECTED_MINUTES_IN_OVEN - actualMinutesInOven;
    }
```

- Task 3: Implementar a função `preparationTimeInMinutes()` que está pegando o número de camadas que você tem como parâmetro (`numberOfLayers`) e retornar quantos minutos você gastou preparando-a, supondo que você leve 2 minutos para fazer isso.

Explicação: a função precisa retornar quantos minutos você vai levar para todas as camadas. Para isso, vamos precisar de dois valores, o quantidade de camadas (que ali esta sendo passada como um parâmetro `numberOfLayers`) e quanto tempo vou levar para fazer cada camada `PREPARATION_MINUTES_PER_LAYER`. Com essa informação podemos MULTIPLICAR e chegar no resultado, assim:

```
    export function preparationTimeInMinutes(numberOfLayers) 
    {
        return numberOfLayers * PREPARATION_MINUTES_PER_LAYER;
    }
```

Vamos para a última task!

- [ ] Implemente a função `totalTimeInMinutes` que está recebendo dois parâmetros, o `numberOfLayers` e o `atualMinutesInOven`. A função deve retornar quantos minutos no total você trabalhou, que é a soma do tempo de preparo (guarda essa informação) e o tempo em minutos que ficou no forno, somando esses dois, nós temos a nossa resposta?

``` 
    export function totalTimeInMinutes(numberOfLayers, actualMinutesInOven) 
    {
        return preparationTimeInMinutes(numberOfLayers) + actualMinutesInOven;
    }
```


Durante o conclusão desse artigo, tive algumas dúvidas, esses links me ajudaram, espero que faça o mesmo com você: 

- [import e export](https://blog.betrybe.com/tecnologia/import-e-export/#3)

- [Documentação](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Return_values)

Feito com ❤ por [Nycole](https://github.com/nycolexavier)
Flutter CLI Cheat Sheet
Tags: flutter, cli, dart, mobile
Published: 2022-03-20 14:01:23

This is a cheat sheet for the most useful commands you will need when developing a flutter app.

---
## Help
To see all the commands, call the help as below.
```
flutter --help
```
Or
```
flutter -h
```

---
## Start Project Commands

### New project
To create a new project just run the below command, don't forget to replace myproject to your project name lol.
```
flutter create myproject
```

<br/>
You can specify your company website and it will be used to create your application id.
```
flutter create --org=com.mycompany myproject
```

<br/>
May you want to create a project with distinct folder name from project name.
```
flutter create --org=com.mycompany --project-name=myproject myfolder
```

---
## Development Commands
### Run
To run your project, just go to root directory of your project and run the code below, and next choose the device where you want to run your project.
```
flutter run
```

<br/>
### Install Package
To install a package use the code below.
```
flutter pub add package_name
```

<br/>
### Update Packages
To update all the packages in your project, run the command below.
```
flutter pub upgrade
```

<br/>
### Build
To build your app and start using it in production, use that command.
```
flutter build target_platform_name --release
```

---
## SDK Commands
### Devices
List all the devices available in you computer.
```
flutter devices
```

<br/>
### Channel
Flutter has tree release channel, you can list them using the command below.
```
flutter channel
```

<br/>
To switch the channel you want to use for your development, run the command below.
```
flutter channel channel_name
```

---
## Bug Report
### Upgrade
Upgrade the Flutter SDK.
```
flutter upgrade
```

<br/>
### Doctor
Show information and status of installed tools.

```
flutter doctor
```

---
## References
Photo by [Rodion Kutsaev](https://unsplash.com/@frostroomhead?utm_source=medium&utm_medium=referral) on [Unsplash](https://unsplash.com/?utm_source=medium&utm_medium=referral)

[https://docs.flutter.dev/reference/flutter-cli](https://docs.flutter.dev/reference/flutter-cli)
Create Excel Bar Chart
Published: 2022-03-01 08:52:38

---
canonical_url: https://ironsoftware.com/csharp/excel/examples/create-a-excel-bar-chart
---

IronXL supports creation and editing of Charts for Excel documents in the modern XLSX file format.

This example shows how to create a bar chart. Other chart types are also supported.

**C#:**
```cs
using IronXL;
using IronXL.Drawing.Charts;
 
WorkBook workbook = WorkBook.Load("test.xlsx");
WorkSheet sheet = workbook.DefaultWorkSheet;
 
//Set the chart type and its position on the worksheet.
var chart = sheet.CreateChart(ChartType.Bar, 10, 2, 18, 5);
 
 
//Add the series to the chart
//For bar chart the first parameter is the address of the range for horizontal(value) axis.
//The second  parameter is the address of the range for vertical(category) axis.
var series = chart.AddSeries("A3:A8", "B3:B8");
 
//Set the chart title.
series.Title = "Bar Chart";
 
 
//Set the legend position.
//Can be removed by settind it to null.
chart.SetLegendPosition(LegendPosition.Left);
 
 
//Plot all the data that was added to the chart before.
//Multiple calls of this method leads to plotting multiple charts instead of modifying the existing chart.
//Yet there is no possibility to remove chart or edit it's series/position.
//We can just create the new one.
chart.Plot();
 
workbook.SaveAs("CreateBarChart.xlsx");
```

**VB:**
```
Imports IronXL
Imports IronXL.Drawing.Charts
 
Private workbook As WorkBook = WorkBook.Load("test.xlsx")
Private sheet As WorkSheet = workbook.DefaultWorkSheet
 
'Set the chart type and its position on the worksheet.
Private chart = sheet.CreateChart(ChartType.Bar, 10, 2, 18, 5)
 
 
'Add the series to the chart
'For bar chart the first parameter is the address of the range for horizontal(value) axis.
'The second  parameter is the address of the range for vertical(category) axis.
Private series = chart.AddSeries("A3:A8", "B3:B8")
 
'Set the chart title.
series.Title = "Bar Chart"
 
 
'Set the legend position.
'Can be removed by settind it to null.
chart.SetLegendPosition(LegendPosition.Left)
 
 
'Plot all the data that was added to the chart before.
'Multiple calls of this method leads to plotting multiple charts instead of modifying the existing chart.
'Yet there is no possibility to remove chart or edit it's series/position.
'We can just create the new one.
chart.Plot()
 
workbook.SaveAs("CreateBarChart.xlsx")
```
Batch vs Streaming (data fundamentals)
Published: 2022-03-20 13:48:50



## Where data comes from

Modern applications generate data in many forms as customers use the applications.

- log files
- transaction records (order confirmations, emails, etc.)

The systems that work with this data are referred to as OLTP systems (Online Transaction Processing) and they are optimized to write data quickly (append rows) and bring specific records/rows like a customer or order record.

Eventually, you are going to want to analyze that data which can initially be done with traditional databases using SQL but eventually the data will get too large and the systems will take to long to run queries.

## OLAP - Online Analytics Processing

OLAP systems are designed to handle analytical workloads which often involved reading lots of data, filtering of columns and so forth. Data in these systems will use columnar formats instead of row based ones for faster analytical performance. This may come in the form of file formats (Apache Parquet),in-memory formats (Apache Arrow) and data transport (Apache Arrow Flight) that the best of these systems are built around.

## ETL (Export Transform Load)

So our data generated by our OLTP systems need to be moved over to our OLAP systems, that means we are going to need to:

- Export the data from the source
- Transform and prepare the data
- Load it into its destination

It's the job of data engineers to architect, implement and maintain these ETL pipelines.

## Batch Data

One way to do our ETL is to do so periodically, like loading all last weeks sales data at the end of each week. This is referred to as batch processing but the downside is that data consumers like data analysts and data scientists don't have real-time data which delays the time to insight.

## Streaming Data

To have real-time data delivered to your data consumers you can use data streaming. Data steaming works by having continous pipelines that constantly export new data, apply neccessary transforms and load it in the target destination where consumers can begin using the data. Loading or Ingesting streaming data can be a little bit trickier than batch data, but gives you access to real time data.

## Summary

Data needs to be moved from OLTP systems into OLAP systems for data consumers, so data engineers need to ETL that through ingesting data in batches or streams.
Kotlin’de Değişkenler
Tags: kotlin, androidapps, android
Published: 2022-03-20 14:54:14

---
title: Kotlin’de Değişkenler
published: true
date: 2022-03-20 13:27:30 UTC
tags: kotlin,androidapps,android
canonical_url: 
---

Herkese Merhabalar. Sizlere bu yazımda Kotlin dilinde kullanılan değişkenlerden bahsedeceğim.

![](https://cdn-images-1.medium.com/max/1024/1*jYvicNC-2KCMmkzeuh0Hwg.png)

### Değişken Nedir?

Değişkenler, bir programlama dilinde verileri depolamak için kullanılan bilgisayar bellek konumlarına verdiğimiz adlardır. Tanımlanan her değişkene bellek bölgesinden bir alan ayrılır. Değişken olarak adlandırılırlar çünkü temsil edilen bilgiler değişebilir.

### Değişken İsimlendirme Kuralları

- İlk karakter herhangi bir sayı ile başlayamaz.

```
var 1number : Int = 40 //Hata
```

- Değişken isimlerinde ilk karakterden sonra istediğimiz yerde sayı kullanabiliriz.

```
var number1 : Int = 40 
```

- Değişken isimleri anlamlı olmalıdır. Bu durum bize kolaylık sağlar.

```
var studentName : String = "Ali"
```

- Noktalama işaretleri ,matematiksel, mantıksal ve karşılaştırma operatörleri kullanamayız.

```
var student.Name : String = "Ali" //Hata
```

- Değişken isimleri Türkçe karakter içermemelidir(ç, ı, ü, ğ, ö, ş, İ, Ğ, Ü, Ö, Ş, Ç). Bu durum hataya sebep olmaz ama Türkçe karakter kullanılmaması daha uygundur.

```
var yaş : Int = 5 //Hata vermez ama uygun değil

var yas : Int = 5 //Daha doğru bir kullanım
```

- Değişken isimleri \_(alt çizgi) ile başlayabilir.

```
var _number : Int = 10
```

- Değişken isimlerinde boşluk kullanılarak tanım yapılamaz. Kelimeler bitişik yazılmalıdır veya \_(alt çizgi) kullanılmalıdır.

```
var student_name : String = "Ali"
```

### Kotlin’de Değişken Tanımlamak

Kotlin’de değişken tanımlamak için var(variable) anahtar kelimesi kullanılır. Bu anahtar kelime kullanılarak oluşturulan değişkenin değeri daha sonra istenildiği zaman değiştirilebilir.

```
var score : Int = 0
```

Yukarıdaki örnekte olduğu gibi uygulamamızda skor tutmak isteyebiliriz. Bu gibi durumlarda skor değişkeni sürekli güncelleneceği için var olarak tanımlamamız gerekir. Başlangıç değerimizi ise sıfır olarak atadık.

### Kotlin’de Sabit Tanımlamak

Sahip olduğu değeri değiştirilemeyen yapılara sabit denir. Değişkenlerin değerleri değişebilirken sabitlerin değeri aynı kalır. Sabit tanımlamak için val(value) veya const(constant) anahtar ifadesi kullanılır. val ile const birbirine benzer fakat const değişkenlere derleme zamanında değer atanırken val değişkenlere çalışma zamanında değer atanır. const ifadesi val ile birlikte kullanılmak zorundadır.

```
const val message : String = "Hello World"

val pi : Double = 3.14
```

Evet arkadaşlar bu yazımda paylaşacaklarım bu kadar. Umarım sizler için faydalı olmuştur.

Herkese iyi çalışmalar dilerim.

* * *
Quick Tips (2) - Laravel
Tags: laravel, php, webdev, beginners
Published: 2022-03-20 13:22:11

I talked about this great resource https://github.com/LaravelDaily/laravel-tips a while ago in a previous article https://dev.to/morcosgad/quick-tips-laravel-3n1e because it contains a lot of great tips that will help you do your project better and I have just released this new video https://www.youtube.com/watch?v=gyQnnT1Topw and 
https://www.youtube.com/watch?v=hEmi12wNGas and
https://www.youtube.com/watch?v=mJWHv_YBC7o with some great tips that I wanted to share with you.

- Skip method

```php
$schedule->command('emails:send')->daily()->skip(function () {
    return Calendar::isHoliday();
});
```

- When searching for the first record, you can perform some actions

```php
$book = Book::whereCount('authors')
            ->orderBy('authors_count', 'DESC')
            ->having('modules_count', '>', 10)
            ->firstOr(function() {
                // THe Sky is the Limit ...
                
                // You can perform any action here
            });
```

- Make use of the value method on the query builder

```php
// Before (fetches all columns on the row)
Statistic::where('user_id', 4)->first()->post_count;

// After (fetches only `post_count`)
Statistic::where('user_id', 4)->value('post_count');
```

- Route resources grouping

```php
Route::resources([
    'photos' => PhotoController::class,
    'posts' => PostController::class,
]);
```

- Get all the column names for a table

```php
DB::getSchemaBuilder()->getColumnListing('users');
/*
returns [
    'id',
    'name',
    'email',
    'email_verified_at',
    'password',
    'remember_token',
    'created_at',
    'updated_at',
]; 
*/
```

- Route model binding soft-deleted models

```php
Route::get('/posts/{post}', function (Post $post) {
    return $post;
})->withTrashed();
```

- Specify what to do if a scheduled task fails or succeeds

```php
$schedule->command('emails:send')
        ->daily()
        ->onSuccess(function () {
            // The task succeeded
        })
        ->onFailure(function () {
            // The task failed
        });
```

- Validation is required if another field is accepted

```php
Validator::make([
     'is_company' => 'on',
     'company_name' => 'Apple',
], [
     'is_company' => 'required|boolean',
     'company_name' => 'required_if_accepted:is_company',
]);
```

- Redirect with URL fragment

```php
return redirect()
     ->back()
     ->withFragment('contactForm');
     // domain.test/url#contactForm

return redirect()
     ->route('product.show')
     ->withFragment('reviews');
     // domain.test/product/23#reviews
```

I hope you enjoyed the code.
Copy OpenSearch index data to S3
Tags: opensearch, s3, elasticsearch, elasticsearchdump
Published: 2022-03-20 13:16:00

It is a good practice to perform backups of your OpenSearch (OS) data to another storage service. This way you can access your data and restore it if something unexpected happens to it.

In this article, you can find out how to dump your OpenSearch data to
an:

- AWS S3 bucket

To copy the index data, we will be using [`elasticsearch-dump`
tool](elashttps://github.com/elasticsearchdump/elasticsearch-dump). You can read the [instructions on GitHub](https://github.com/elasticsearch-dump/elasticsearch dump/blob/master/README.md) on how to install it. From this library, we will use `elasticdump` command to copy the input index data to a specific output.

Make sure to have `elasticsearch-dump` [tool](elashttps://github.com/elasticsearch dump/elasticsearch-dump) installed for the next steps.

Copying data from OpenSearch to AWS S3
--------------------------------------

### Prerequisites

-   OpenSearch cluster as the `input`
-   AWS S3 bucket as the `output`

Information about your OS cluster and AWS service:

OpenSearch:

-   `SERVICE_URI`: OpenSearch service URI.
-   `INPUT_INDEX_NAME`: the index that you aim to copy from your input source.

S3 bucket:

-   AWS credentials (`ACCESS_KEY_ID` and `SECRET_ACCESS_KEY`).
-   S3 file path. for e.g. `s3://${BUCKET_NAME}/${FILE_NAME}.json`


Find more information about AWS credentials in the [AWS docs](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html).

### Export OpenSearch index data to S3

Use `elasticsearch-dump` command to copy the data from your **OpenSearch cluster** to your **AWS S3 bucket**. Use your
OpenSearch `SERVICE_URI` for the `input`. For the `output`, choose an AWS S3 file path including the file name that you want for your document.

``` {.shell}
elasticdump \
--s3AccessKeyId "${ACCESS_KEY_ID}" \
--s3SecretAccessKey "${SECRET_ACCESS_KEY}" \
--input=SERVICE_URI/INPUT_INDEX_NAME --output "s3://${BUCKET_NAME}/${FILE_NAME}.json"  
```

That is how you can copy your OpenSearch data to a S3 bucket. 🙋🏻‍♀️


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kh4ebq0jitmk9yyquv2t.gif)
print("Hello, devs!")
Tags: introduction, pyladies, munich, braziliandevs
Published: 2022-03-20 12:54:57


Hello, peeps!

My name is Laysa Uchoa and I am brazilian living in Munich, Germany. I am a software developer curious about structured and unstructured data with a mission to share helpful things I find while working in tech. Let's [connect](https://twitter.com/laysauchoa)! 🐦

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

I love Python and Python communities. So few years ago, I started organizing [Pyladies Munich](https://www.meetup.com/PyLadiesMunich/) to offer this space for coding ladies to meet and connect with each other.

I really believe that: If you can dream, you can make it happen in Python 🐍

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

Besides coding and running tech conferences, you can find me learning new languages. I love human languages (Portuguese 🇧🇷, Spanish 🇪🇸, German 🇩🇪 and English 🇺🇸) besides programming languages. 

**Your turn:** drop "Hi" in your programming or human language, and I will try to guess 🔎