teleren/devto huggingface dataset:
Have a Bad memory? Open Source N-Back game may help improve your working memory
Published: 2023-02-07 15:58:38

# Open Recall

[Open Recall](https://github.com/ObservedObserver/open-recall) is an Open Source N-Back Task Game like Simply-Recall designed to improve working memory and cognitive abilities.

> Research shows that N-Back training may lead to gains in fluid intelligence (IQ) and working memory ability (Soveri et al., 2017).

The N-Back task is a memory training game that is designed to improve working memory and cognitive abilities. To play the game, you will be presented with a sequence of items such as letters, numbers, or words. Your goal is to indicate whenever the current item matches the item that was presented "n" steps back in the sequence. The value of "n" determines the difficulty of the task. For example, if "n" is set to 1, you would need to recall the item that was presented one step back. If "n" is set to 2, you would need to recall the item that was presented two steps back, and so on. The game typically continues until you have completed a certain number of rounds or made a certain number of errors. To play, simply focus on the items as they are presented and try to recall the item that was presented "n" steps back. Good luck!

## Play it

You can play the game at [Open Recall On Vercel](https://open-recall.vercel.app/)

Github Repo at [Open Recall](https://github.com/ObservedObserver/open-recall)

## Game

+ step 1: click `start` button.
+ step 2: set game time limit and level, and click `play` button.
+ step 3: enjoy the game.

<table>
    <tr>
        <th>Home</th>
        <th>Setting</th>
        <th>Guide</th>
    </tr>
    <tr>
        <td><img src="https://ch-open-sharing.oss-us-west-1.aliyuncs.com/open-recall/open-recall-home.png" /></td>
        <td><img src="https://ch-open-sharing.oss-us-west-1.aliyuncs.com/open-recall/open-recall-play.png" /></td>
        <td><img src="https://ch-open-sharing.oss-us-west-1.aliyuncs.com/open-recall/open-recall-desc.png" /></td>
    </tr>
    <tr>
        <th>Playing</th>
        <th>Score</th>
        <th>History</th>
    </tr>
    <tr>
        <td><img src="https://ch-open-sharing.oss-us-west-1.aliyuncs.com/open-recall/open-recall-game.png" /></td>
        <td><img src="https://ch-open-sharing.oss-us-west-1.aliyuncs.com/open-recall/open-recall-result.png" /></td>
        <td><img src="https://ch-open-sharing.oss-us-west-1.aliyuncs.com/open-recall/recall-history.png" /></td>
    </tr>

</table>

> When Level = 2, you need to remember the previous two items. Suppose we have a list: Apple (n - 2), Banana (n - 1), Apple (n). Click yes because the current item is the same as the item two steps back.


## Deploy

```bash
npm install
npm run build
```
Alacritty theme
Tags: alacritty, theme, beginners
Published: 2023-02-07 15:57:12

A simple minimalist alacritty theme 

![Alt text](https://raw.githubusercontent.com/medoxb11/alacritty-theme/main/img/screenshot.jpg)

I'm using here omz, install Oh My Zsh by running the command 

via curl (make sure you have curl or wget installed)
```bash
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
```

or via wget
```bash
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
```

If you don't like omz you can install [startship](starship.rs/) either shell or Homebrew

And you'll need a font to display the icons 

you can get from [Github](https://github.com/epk/SF-Mono-Nerd-Font)

```bash
brew tap epk/epk

# Homebrew < 2.6.0
brew cask install font-sf-mono-nerd-font

# Homebrew >= 2.6.0
brew install --cask font-sf-mono-nerd-font
```

With Shell:
```bash
curl -sS https://starship.rs/install.sh | sh
```

With [Homebrew](https://brew.sh):
```bash
brew install starship
```
Once you do that you'll need to Add the init script to your shell's config file in `~/.bashrc` or in `~/.zshrc`

Bash
```bash
eval "$(starship init bash)"
```
Zsh
```shell
eval "$(starship init zsh)"
```

Create a `~/.config` file if you don't already have 
Then create an folder and name it as `alacritty`
And finsly create a file and name it as `alacritty.yml`

Or just run this and it'll do it for you 

```bash
mkdir .conf && cd .conf && mkdir alacritty && cd alacritty && touch alacritty.yml
```

copy the following code and past it in the `alacritty.yml`

````yaml
# It makes alacritty update itself when we edit the `alacritty.yml`
live_config_reload: true

window:
  opacity: .80 # to create a transparent background
  padding: # just to make beautiful (this is optional)
    x: 10
    y: 12
  dynamic_padding: false
  decorations: buttonless # to remove the top border of the window 

font:
  normal:
    family: "SF Mono" # use this font if you're using starship
    style: Regular
  size: 13.0

# then you can add some colors to the background and the foreground 
colors:
  # Default colors
  primary:
    background: '#263238'
    foreground: '#DADADA'

  # Normal colors
  normal:
    black: '#DADADA'
    red: '#dd1f1f'
    green: '#2f9e94'
    yellow: '#e4e46d'
    blue: '#24bfb1'
    magenta: '#7d357d'
    cyan: '#38a79c'
    white: '#e5e5e5'
```

That's all,
Article Review: Lessons From 6 Software Rewrite Stories
Tags: software, development, rewrite
Published: 2023-02-07 15:43:30


---
title: Article Review: Lessons From 6 Software Rewrite Stories 
published: true
description:
tags: software,development,rewrite
canonical_url: https://jessewarden.com/2023/02/article-review-lessons-from-6-software-rewrite-stories.html
cover_image: 
---

This is the [best software rewrite article I’ve ever read](https://medium.com/@herbcaudill/lessons-from-6-software-rewrite-stories-635e4c8f7c22). I knew about all the stories & blog posts they reference, but the lens this author uses + the lessons he pulls out are amazing.

When I was a freelancer, I’d rewrite all the time, whether some code base I inherited, a rescue project, or even my own code bases on repeat work. As the projects got larger and more coupled (large monoliths), it became increasingly clear rewrites wouldn’t work, for all the common reasons:

- culture of company created the mess; re-doing it \_just\_ because Jesse Warden is there isn’t going to fix it despite my confidence
- not everyone agrees it’s a mess 😅
- we don’t have time to pause new features while we riskily redo all the existing ones that aren’t exactly the same despite Innovator’s Dilemma
- no one knows all of the features, lessons learned, how they \_actually\_ work, and why

blah blah blah

Sometimes, though, things were so bad, I knew it would result in only 3 options:

1. years of pain with no joy
2. a rewrite would feel good, but the same institutional problems that caused it in the first place would be there. This only was a good choice in freelance where it was deliver and leave with short timelines and fixed budgets.
3. I’d turn down the contract, knowing it was impossible for me to be successful despite assurances to the contrary (assuming I had other work lined up)

But as we know in software, there are few absolutes, and nuance is everywhere. This article pulls 6 great ones that have completely different situations.

In the past, I’ve inundated Product Owners with who were with me in these horrible situations with articles on options and risk vs reward scenarios. Many required previous context knowledge, or were old and had to be viewed in a historical context, a lot of tech knowledge, etc, making them not a really helpful tool for a PO and architect to make a well informed call on a plan forward. This article, I think, can stand alone and help do that more intelligently.
Notifiche via [matrix] e webhook
Published: 2023-02-07 15:40:15

_You can read this article in english [here](https://dev.to/vaiton/notification-service-via-matrix-and-webhooks-bmj)_

Hai mai avuto la necessità di ricevere delle notifiche per un processo di lunga durata o per monitorare qualcosa e non avevi voglia di tirare su un [MTA](https://search.brave.com/search?q=mail+transfer+agent&source=web)?

Le email sono utili, non lo metto in dubbio, ma a volte è giusto chiedersi se tirare su postfix (o exim4 che sia), setuppare smarthost e bla bla bla  non sia un po' overkill per inviare delle semplici notifiche quando un job è concluso o quando qualcosa è andato storto.

In questa breve guida, utilizzeremo la potenza dei webhook e del network [matrix] per fare esattamente ciò.

## 1. Creare un webhook

Innanzitutto è necessario creare una stanza [matrix]. **Assicurati di averla creata come non-crittografata**, altrimenti i bridge di t2bot.io potrebbero non funzionare.

Una volta creata la stanza, [segui la documentazione di t2bot.io su come create un webhook](https://t2bot.io/webhooks/):
> 1. Invita `@_webhook:t2bot.io` nella tua stanza Matrix.
> 2. Invia nella stanza il messaggio `!webhook`
> 3. Il bridge genererà ed invierà un URL da utilizzare, insieme a semplici istruzioni su come usarlo.

## 2. Creare lo script

Crea un file chiamato `notifyMatrix.py` (o come vuoi tu) e incolla questo blocco di codice:

(Utilizzo python per semplicità, ma puoi utilizzare qualsiasi cosa, anche fare una semplice `curl`)

```python
#!/bin/env python3
import requests
import sys

args = " ".join(sys.argv[1:])

WEBHOOK = "..."
BOTNAME = "..."

requests.post(WEBHOOK, 
    json={"text": args, "format": "plain", "displayName": BOTNAME})
```

- `WEBHOOK` deve essere impostato all'URL che il bot ha inviato nella stanza appena creata. 
- `BOTNAME` deve essere impostato ad una stringa qualsiasi. Verrà utilizzato come nome dell'"utente" (tra virgolette perchè in realtà non è un vero utente) che invierà il msg nella stanza specificata.

Lo script prende gli argomenti da riga di comando successivi al primo (che è sempre il nome dello script), li concatena in una stringa separati da spazi e li invia via webhook all'url fornito.

Adesso, se provi ad eseguire
```shell
./notifyMatrix.py ciao!
```
dovresti ricevere un nuovo messaggio nella stanza che hai appena creato con il testo `ciao!`. 

Se tutto ha funzionato, sei riuscito nell'impresa di tirare su in meno di 5 minuti un servizio di notifiche su matrix!

## 3. Utilizzo

Puoi utilizzare questo script dove vuoi. Per esempio, per monitorare un sistema RAID software gestito da MDADM, basta inserire nel file `/etc/mdadm/mdadm.conf`

```conf
...
PROGRAM /root/notifyMatrix.py
...
```

e hai fatto!

## Crediti
- [t2bot.io](https://t2bot.io/)
- [[matrix]](https://matrix.org/) 

Se ti è piaciuta questa guida e/o l'hai trovata utile considera di donare a [t2bot.io](https://t2bot.io/donations/) e alla [fondazione matrix](https://matrix.org/supporters/)!
My Journey from Software Quality Assurance to Software Engineering
Tags: career, webdev, javascript, beginners
Published: 2023-02-07 15:27:26

Software Quality Assurance (SQA) was my first foray into the world of software engineering. It was a great way to learn the fundamentals of software development, while also gaining valuable insight into the software development process.

Although I enjoyed my time as an SQA engineer, I was always looking for new challenges and opportunities. That's when I decided to take the plunge and transition from SQA to software engineering.

The transition was difficult at times, but I was determined to succeed. I started out by taking online courses in various programming languages and frameworks. I also read books and articles on the latest software development topics.

I also took advantage of any opportunities I had to work on software engineering projects. This gave me a chance to put my newly acquired knowledge into practice and gain valuable practical experience.

Along the way, I received invaluable help from mentors, colleagues, and friends. With their guidance, I was able to refine my skills, gain experience, and become a better software engineer.

Today, I'm very proud of the progress I've made in my transition from SQA to software engineering. I'm excited to continue learning, growing, and pushing myself to become a better software engineer.

---

**_NOTE:_** If you found this help. Like and share. Thanks, Happy Learning!

---

### Let's connect 💜

You can follow me on [Twitter](https://twitter.com/MrDanishSaleem), [Instagram](https://www.instagram.com/mrdanishsaleem/), [LinkedIn](https://www.linkedin.com/in/mrdanishsaleem/) & [GitHub](https://github.com/mrdanishsaleem/)

### Support Me

If you like this post. Kindly support me by [Buying Me a Coffee](https://www.buymeacoffee.com/mrdanishsaleem)
Destructuring assignment
Tags: javascript, beginners, tutorial
Published: 2023-02-07 15:19:46

Let´s talk about destructuring.

**We are going to start with a simple desctruturing example.**
```
let a,b;
[a,b] = [10, 20];

console.log(a)
// Expected output: 10
console.log(b)
// Expected output: 20
```

Here we will see how defining "a" and "b" then we are assigned a value to it.


**Array Destructuring**

Basic variable assingnment
We are assigning a variable and then destructuring it, in order to call each part to get the specific value.

```
const foo = ["one", "two", "three"];

const [red, yellow, green] = foo;
console.log(red); // "one"
console.log(yellow); // "two"
console.log(green); // "three"
```


**Parsing an array returned from a function**

We will see how to pass a function into a destructuring variable.

```
function uno(){
  return [1, 2];
}

const [a,b] = uno();
console.log(a); // 1
console.log(b); // 2
```

We can also ignore return values from a function

```
function uno(){
  return [1, 2, 3];
}

const [a, ,b] = uno();
console.log(a); // 1
console.log(b); // 3
```


**Object desctructuring**

```
const user = {
  id: 42,
  isVerified: true,
};

const {id, isVerified} = user;

console.log(id); // 42
console.log(isVerified); // true
```

**Assigning to new variable names**

```
const o = {p: 42, q: true};
const {p: foo, q: bar} = o;

console.log(foo); // 42
console.log(bar); // true
```

**Unpacking properties from objects passed as a function parameter**
We will see how to unpackage properties from objects when we passed it to a function which it will return an specific thing from the object

```
const user = {
 id: 42,
 displayName: "jdoe",
 fullName: {
  firstName: "jane",
  lastName: "Doe"
 },
};

function userId({id}){
  return id;
}

console.log(userId(user)); // 42
```

We have created a function that will return the id, so we will  get the id as a parameter on the function and when we are calling the function we will pass the object "user".

If you want more examples about it you can checkout the [mdn documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#examples) 

Thank you so much for reading. I hope someone found it helpful.

If you want to reach to me you can contact me through my email "lautaro.suarez.dev@gmail.com"

Lautaro.
#Rust 🦀 – How to find a variable data type 🤔
Tags: englishpost, datatype, rust
Published: 2023-02-08 14:21:49

---
title: #Rust 🦀 – How to find a variable data type 🤔
published: true
date: 2023-02-07 15:17:29 UTC
tags: EnglishPost,DataType,EnglishPost,Rust
canonical_url: 
---

Hi !

Quick post today to share how to find a variable data type in Rust. As far as I understand, we can use several ways to do this. In example, we can use these 2 std functions:

```

    use std::any::type_name function
    use std::intrinsics::type_name

```

The full sample code below create 2 vectors with different data, and print the data type of the vector, and of some of the vector’ elements. This is the output:

```

   Compiling datatype01 v0.1.0 (C:\src\labs\RustLabs\datatype01)
    Finished dev [unoptimized + debuginfo] target(s) in 0.55s
     Running `target\debug\datatype01.exe`
alloc::vec::Vec<char>
char
i32

```

Sample Source Code

{% gist https://gist.github.com/elbruno/8276a926f4ffd90471d401d0f67924c6 %}
Happy coding!

Greetings

El Bruno

More posts in my blog [ElBruno.com](https://www.elbruno.com).

* * *
ก้าวแรกสู่ LaTeX ฉบับผู้ใช้ MacM2
Tags: latex, macos, macm2, texshop
Published: 2023-02-07 15:02:31

LaTeX เป็นเครื่องมือสำหรับสร้างเอกสาร คล้ายๆ กับ MS Word, MS Power Point แต่ต่างกันที่ LaTeX เขียนด้วยตัวอักษรล้วนๆ ไม่มีปุ่่มปรับขนาด สี จัดย่อหน้า ฯลฯ

เราอาจเทียบการ LaTeX ได้กับการเขียน HTML ที่ถ้าเราต้องการตัวอักษรตัวใหญ่ใน HTML ก็สามารถใส่ tag แบบนี้ครับ

```
<h1> My Header </h1>
my normal text

```

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

เริ่ม Download และติดตั้ง MacTeX จาก https://tug.org/mactex/

จากนั้นจะได้โปรแกรม TeXShop ให้เปิด TeXShop ขึ้นมา จะเป็นหน้าจอเปล่า

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

เริ่มเขียน  LaTeX ได้ตามตัวอย่างนี้ โดย % % คือการ comment และสามารถใส่ Command tag ได้ด้วย \\\<commamd>

```
%This is preamble sections%
\documentclass[12pt, letterpaper]{article}
\title{My first LaTeX document}
\author{Peter}
\date{February 7, 2023}

%Begin of the document%
\begin{document}
\maketitle
Good evening and welcome everyone to the first \LaTeX{} document.
\end{document}
```

จากนั้น save ไฟล์ โดยกำหนดนามสกุล .tex

> สำคัญมาก จะต้องตั้งนามสกุลไฟล์เป็น .tex เท่านั้น เพื่อให้สร้างเป็นเอกสารได้

จากนั้นกดที่ปุ่ม Typeset มุมด้านบนซ้าย เพื่อ Compile ไฟล์ .tex ให้เป็น .pdf

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n76wqtrhgqxg0ka89bo8.jpg)
ติดตั้ง Laravel: the PHP web application framework บน Ubuntu แบบใช้ sail และแบบใช้ composer
Tags: laravel, phpframework, docker, linux
Published: 2023-02-07 15:02:21

Laravel นั้นเป็น PHP Web Application Framework ที่ Powerful มากๆตัวหนึ่ง สามารถรองรับการใช้งานสองรูปแบบคือ Full Stack Framework และแบบเป็น API Backend ให้กับ Application อย่างเช่น Next.js โดยในที่นี้เราจะใช้งานเป็น API Backend นะครับ เพื่อที่จะใส่ลงไปใน CI/CD pipeline เพื่อทำการทดสอบ API Security

Environment ที่ใช้คือ Ubuntu 20.04.5 LTS

การติดตั้งแบบปกติจะต้องใช้ PHP, Composer และ components ที่เกี่ยวข้อง 2-3 ตัวครับ

ในตอนนี้เราจะมาติดตั้งโดยใช้ Sail ร่วมกับ Docker ก่อนครับ โดยใช้เพียง 3 บรรทัด

```
curl -s https://laravel.build/laravel-docker | bash
cd laravel-docker
./vender/bin/sail up

```

ตรวจสอบผลด้วยคำสั่ง
`sudo docker ps`

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

ทดลองเข้า melisearch

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


มาติดตั้งแบบปกติบ้างครับ บน Environment เดิมคือ Ubuntu 20.04.5 LTS

ติดตั้ง PHP และ Modules ที่เกี่ยวข้องให้ครบ โดยแต่ละ Module สามารถติดตั้งพร้อมกันได้

```
sudo add-apt-repository ppa:ondrej/php
sudo apt update
sudo apt install php libapache2-mod-php
sudo apt install php-{sqlite3,xml,curl,mysql,imap,zip}

```

ตรวจสอบผลการติดตั้ง

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

ติดตั้ง Composer ไว้สำหรับรัน lavavel

```
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '55ce33d7678c5a611085589f1f3ddf8b3c52d662cd01d4ba75c0ee0459970c2200a51f492d557530c71c15d8dba01eae') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

mv composer.phar /usr/local/bin/composer
```

สร้าง lavavel application แรกขึ้นมา ตั้งชื่อว่า laravel-9
`composer create-project laravel/laravel laravel-9`

เข้าไปที่ Directory ของ application ที่เพิ่งสร้างใหม่ แล้วทำการ start

```
cd laravel-9
php artisan serve

```

laravel-9 เปิดใช้งานที่พอร์ต 8000 ตรวจสอบว่า Application รันสำเร็จ

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4vn49tki1892xn5hkulb.jpg)
Git tutorial: Git rebase
Tags: git, webdev, beginners, programming
Published: 2023-02-07 14:58:50

The `git rebase` command makes it easy to change a your commit history, meaning you can alter your commits which will change your repository's history. You can edit, combine, or rearrange commits.

Generally, `git rebase` is used for modify earlier commit messages, Combine multiple commits into a single one and remove or revert unnecessary commits.

There are multiple commands you can use with `git rebase`

- `edit`  will give you the option to edit a commit, which will allow you to either add to or completely alter the commit. Before continuing the rebase, you can add more commits. With this command, you can remove incorrect changes that were made in a commit or divide a big commit into smaller ones.

- `pick` indicates that the commit is present. When the rebase is in progress, rearranging the pick commands will alter the order of the commits. If you decide against adding a commit, remove the entire line.

- `squash` allows you to combine multiple commits into one. The current commit will be squashed with the commit that precedes it and add a descriptive message of the changes made.

- `reword` is just like `edit` but unlike edit `reword` allows you to change the commit message and not the contents of it. 

- `fixup` is similar to `squash` but unlike `squash`, `fixup` does not allow us to write a message to describe the changes that were made. The message will be discarded and the merge of both commits will have the previous commit's descriptive message.

How Do You Use Git Rebase ?

Standard and interactive are the two distinct Git rebase modes. a typical mode Git rebase automatically snatches up the commits in your active working branch and applies them right away to the passed branch's head.

As opposed to gathering everything and dumping it into the passed branch, Interactive mode allows you to change various commits throughout the process. You can edit the history and remove, split, or change existing commits if you use interactive mode.

## Standard git rebase

```
git rebase <base>

```
## Interactive git rebase

```
git rebase --interactive <base>

or 

git rebase -i <base>
```
With this command, an editor is opened into which you can enter commands for each commit you wish to rebase.

| git rebase commands| description|
|--------------------|:----------:|
|`git rebase --continue`|This is used to keep the changes made.|
|`$ git rebase --skip`| This command is used to skip the changes that were made|
| `git rebase -i `| This will list all interactive options which we've mentioned above |