teleren/devto huggingface dataset:
Learning the Ropes
Published: 2023-05-01 20:53:09

Everyone starts someplace.
I know of a mathematical object that has the qualities of spin. That is, the binary pattern changes each time the algorithm is applied. 
 The initial or starting pattern completes an orbit, meaning the original bit-pattern is seen again, and this object scales from one bit to infinite bits. The thing is it's always a finite length of bit-space or as I like to call it State-Space but any length is just fine. Length is how this object scales and not by value.
 I wrote a paper and put it on arXiv in 2014 but I never published any code or made it easy to use this datatype. I followed an example of an accomplished cryptographer and left the coding as an exercise for the reader.  
 So, in reading an email invite to post here, I am coming out. I have the idea of making an include library and formalize this object as a datatype that runs on our current computers.
 I'm starting here.

Your thoughts? I am an absolute Github newbie and also I have never presented an opensource project to the public let alone worked a project for public consumption.
 So, your helpful comments are welcomed.
O poder do mundo reativo com spring webflux
Published: 2023-05-01 20:46:44

### 1. Houston, nós temos um problema.

### 2. E agora quem poderá me ajudar? Eu, o Spring Webflux.

### 3. Um pouco sobre o projeto Reactor

### 4. Nosso primeiro controller.

### 5. Houston, acho que nós temos um problema novamente.

### 6. E agora quem poderá me ajudar? Eu, o R2DBC.
30 Days of Rust - Starting the CLI tool
Tags: rust, learning
Published: 2023-05-01 20:40:07

For those of you paying attention, you may have realised that I didn't post a blog yesterday - sorry for that 🙈  Now I'm back to start my first project written in Rust. The plan is to create a simple CLI tool that measures the time elapsed running a command in your terminal. In this blog post, I'm going to sum up my learning objectives as well as some feature requirements for the first iteration of the project. 

### Objectives and key results
Lets start by naming some learning objectives for the project:
1. Packaging and exporting a Rust executable
2. Building a robust and maintainable tool by applying TDD principles
4. Familiarising myself with the Rust standard library

Cool, now we know at a higher level what we're trying to achieve, it's important to outline some kind of rudimentary product vision. This will be expressed in problem terms and feature ideations:

> 1. I want to easily and reliably test how fast my programs or library components run;
> 2. We have good unit and integration test suites, but don't have resources to commit to non-functional testing;
> 3. I develop locally with large amounts of data and want to check memory or CPU bottlenecks.

I can see a CLI solution to these problems. But problems 2 and 3 would require advanced capabilities. Focussing in the first iteration on solving problem 1 seems reasonable. There are suitable features that should get some of the problem's requirements solved:

> 1. "Test easily" -> One line installation, simple inward and outward APIs, language agnostic
> 2. "Test reliably" -> Robust error handling, taking averages over results.

Before breaking these down further to actionable steps, let's look at some prerequisites that need to be sorted first.

### Project setup
Including the right linting and testing tools as well as commit hooks can reduce the burden of project management overhead. The company I work for has an [open-source project template](https://github.com/at-gmbh/at-python-template) for Python. I'll first look to find a similar template to that. From there we'll then initialise a public git repo and work on the very first feature areas. 

### Starting features
There are two major starting points for this project:
1. CLI installation and arg parsing;
2. Process management and meta data collection.

At this stage I'd feel more comfortable starting with objective two. I'll start with TDD and see how that goes. Once I've got the ability to start and await the completion of a subprocess, I'll pause and go to objective one. My aim is to create an automatic test suite for the CLI aspect.

### What to expect from the blog?
Each day I'll run through the questions and answers from the previous day and then move on to describe some of the challenges I encountered. Apologies in advance for terrible GIF or pun action 😄
Sloan's Top 4 Newbie Memes of the Week
Tags: beginners, discuss, codenewbie
Published: 2023-05-01 20:33:29

Y'all know the drill! At the [CodeNewbie Team](https://dev.to/codenewbieteam) we decided that we wanted to spice things up and try something new out to involve our newbies in Meme Monday! **We landed on a Sloan's Newbie Memes of the Week!** [You can find last week’s meme picks here](https://dev.to/codenewbieteam/sloans-top-4-newbie-memes-of-the-week-3cip).
 

Here are some of our favorites from this week:


![Black and white photo of a person wearing a cloak extends hands to the edge of a cliff in a sort of release motion. Caption reads, "Me, after coding for hours with 0 human interaction just to make an obscure module".](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l8pqzbs0run1zl4ui7zi.jpg)


![Caption reads: My friend: How do you code? it must be hard...Me: Meme of Walt from Breaking Bad holding a chip and looking at it, with the caption, "actually, it's just basic math".](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fw56jlhdx0vqpqrt9go2.jpg)


![Twitter post from user @iammemeloper that reads, "Today I made my first money as a programmer. I sold my laptop".](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dmz559pujtwhw53nj1mk.jpg)


![Twitter post from @catalinmpit that reads, "My day as a DEV with an upside-down smiley face: 0. Something is wrong. 1. Investigation phase. 2. No way I can fix this. 3. Imposter Syndrome kicks in. 4. Questions career choice. 5. Questions life choices. 6. Oh never mind! I made a typo in the code. 7. I fixed it. 8. I am a good developer. 9. I can do anything".](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p2rmtkg27qw3udku6zjd.jpg)

**How is your week going so far? Drop us your fav memes you have added to your meme folder below!**
my project
Published: 2023-05-01 20:31:54

I needed to write a project for myself, but I have no idea how to do it, so I started looking for someone to do it for me. After a long search, I found these guys - [buy a recommendation letter](https://www.lorservice.com/) . They wrote my project in a very short period of time with very high quality, and they have a good attitude towards you. If you ever need one, please consider contacting them again.
HACKTOBERFEST 2022 - progress and badge
Tags: hacktoberfest, opensource, frontend
Published: 2023-05-01 19:53:34

I'm happy to share my first participation on Hacktoberfest 2022 🙌

no longer afraid of open source 😄


Hacktoberfest 2022 badge

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


![progress](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55f5p6j3vi1bd4xy48ol.jpg)


![final pull request](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uk2v5hdrxacdha5it17z.png)


See you soon!🚀

Thanks to #hacktoberfest & #dev.to !

You can find my work on [Github](https://github.com/vivianemartini).
How to Fix SQL Magic Errors in Jupyter Notebook After SQLAlchemy Update
Tags: sql, jupyter, sqlalchemy, mysql
Published: 2023-05-01 19:50:45

Just recently, [SQLAlchemy](https://www.sqlalchemy.org/) just released the 2.0.12 version. While this is some great news, it has brought along some code breaks when trying to load up the SQL_Magic dependencies on [Jupyter Notebook](https://jupyter.org/). 

## **This is what you might be seeing:**

![Example %%read_sql error from SQLAlchemy update](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j0e01ljsyk1e9npxqtyb.JPG)

Without the SQL_magic dependency on Jupyter Notebook, an array of problems will crop from not being able to manipulate the data in tables and the database you are working on.

## **Solution to this!**

Only the version 1.4.47 of the SQLAlchemy is running properly without the code breaking. 
Just open up your Command Prompt and first uninstall the current SQLAlchemy version using:

`pip unistall Sqlalchemy`

Then reinstall the SQLAlchemy version 1.4.47 using the following:
`pip install SQLAlchemy==1.4.47`

After this, just close your Jupyter notebook(Anaconda) and restart it again.

TADA!
That should solve everything. 

GOODLUCK!
What Was Your First-ever Email Address & Do You Still Use It Today?
Tags: discuss
Published: 2023-05-01 19:45:34


Alright, time to reveal some ancient history! What was your very first email address back in the day? And don't worry, we won't judge you for your cringy teenage email names (*cough* gamer_girl123 *cough*). Do we have any legacy AOL users? Yahoo, anyone? Bonus points if you still use it today! 😉

Share your funny, embarrassing, or super cool emails (but don't share any sensitive information!)

---

Join the conversation and [follow the DEV Team](https://dev.to/devteam) for more fun discussions!
Using Copilot: CLI to reorganize my blog
Tags: github, ai, discuss, programming
Published: 2023-05-01 19:41:43

A few days ago I was working on my blog [leonardomontini.dev](https://leonardomontini.dev/) as I'd like to give it a strong restyle and move from Gatsby to Astro.

I also took the chance to change the folder structure of the current blog as it's now flat and I wanted a more organized one.

Not too complicated, I wanted to group for `year` and `month` folders and move all the posts in the right one. For example, the post `2023-04-30_my-post/index.md` should be moved to `2023/04/my-post/index.md`.

There are ~50 articles right now, such a boring task to do manually and since it's just a simple files/folders manipulation I thought a simple bash script could have been the solution... but it's 2023, I didn't want to write it myself and Google for the right commands when I can just ask an AI to write a _wrong_ script for me :D

## Copilot X CLI

I've recently got access to the [Copilot CLI](https://githubnext.com/projects/copilot-cli) beta and I'm playing with it to see how it works but this seems like a real use case for it.

I actually didn't plan to make a video out of it but I thought the process could have been interesting to share so I quickly turned on the lights, the webcam and started recording.

This is how it went:

{% youtube AKxaoupEBv4 %}

_Spoiler: it didn't work on the first attempt, but it was definitely my fault for not noticing the error in the suggested script_

## Outcome

Running a script generated by an AI if you have no idea what is it going to do isn't probably a wise choice, even if you can ask the AI to explain it. In my case, the task was quite simple and the outcome was easy to verify so it was a safe playground.

_Actually, as you can see in the video, I was in a temporary folder AND I had an extra backup on a zip file. Better safe than sorry!_

---

Are you using AI tools for generating scripts for you? Only easy scripts or also more complex ones?
What questions are you asking or what problems are you solving with them?

Let me know in the comments! :D

---

Thanks for reading this article, I hope you found it interesting!

I recently launched my Discord server to talk about Open Source and Web Development, feel free to join: https://discord.gg/bqwyEa6We6

Do you like my content? You might consider subscribing to my YouTube channel! It means a lot to me ❤️
You can find it here:
[![YouTube](https://img.shields.io/badge/YouTube:%20Dev%20Leonardo-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/channel/UC-KqnO3ez7vF-kyIQ_22rdA?sub_confirmation=1)

Feel free to follow me to get notified when new articles are out ;)
{% embed https://dev.to/balastrong %}
NPM vs NPX
Tags: 100daysofcode, bootcamp, flatironschool, json
Published: 2023-05-01 18:20:13

I recently came into a problem trying to install a JSON server globally and came up with error after error and unable to install it. Today while working in visual code on a project for school, I finally found a solution that now works for most of my json-server needed projects. 

NPM vs NPX

So, what are they and how do they differ? Well, npm (short for Node Package Manager) is a command-line tool used to manage Node.js packages and dependencies. It allows you to install, update, and remove packages in your project. On the other hand, npx is a tool that comes with npm and is used to execute packages without having to install them globally on your system. This means that you can run a package directly from the command line without worrying about installing it first. In other words, npx is like a one-time use version of npm. So, if you need to use a package just once or for a specific task, you can use npx. But if you need to use a package more frequently or across multiple projects, it's best to use npm to install and manage it.

3/100


**edit** I'm going to add onto this blog by posting the solution I found for this error I kept getting: 

```
cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?
```

to enable scripts while using powershell in VSC I had to open powershell in admin mode. 
type in 
```
Set-ExecutionPolicy RemoteSigned
```
and the Y to change script permissions. 
restart your VScode and you're ready to go!
Como habilitar para que as portas USB acordem o computador
Tags: ubuntu, linux
Published: 2023-05-01 18:06:02

## Testado no Ubuntu 23.04

Liste os dispositivos que podem acordar o sistema:
```
grep . /sys/bus/usb/devices/*/power/wakeup
```
O resultado será uma lista de dispositivos com a indicação de habilitado ou desabilitado:
```
/sys/bus/usb/devices/usb1/power/wakeup:disabled
/sys/bus/usb/devices/usb2/power/wakeup:disabled
/sys/bus/usb/devices/usb3/power/wakeup:disabled
/sys/bus/usb/devices/usb4/power/wakeup:disabled
```
Agora vamos editar o arquivo **rc.local** para habilitar os dispositivos mesmo após o reinicio do sistema:
```
sudo nano /etc/rc.local
```
```
echo enabled > /sys/bus/usb/devices/usb1/power/wakeup
echo enabled > /sys/bus/usb/devices/usb2/power/wakeup
echo enabled > /sys/bus/usb/devices/usb3/power/wakeup
echo enabled > /sys/bus/usb/devices/usb4/power/wakeup
```
Salve o arquivo e pronto.

Espero ter ajudado.
Something for interviews
Tags: interview
Published: 2023-05-01 17:46:18

There are some important phrases thats good to have a refresher just before you head to an interview room to show that you are not just a code monkey 🐵. 

**SOLID** is 5 principles to follow when you ask where you should put your code:
- **S**ingle responsibility
- **O**pen-closed principle
- **L**iskov subsitution principle
- **I**nterface Segregation
- **D**ependency Injection

**ACID** is database characteristic for ensuring transactions correctness
- **A**tomicity
- **C**onsistency
- **I**solation
- **D**urability

Database isolation has 4 levels. Make sure you know what is dirty read, non-repeatable read and phantom read
- Read Uncommitted
- Read committed
- Repeatable Read
- Serialisable
Code Smell 210 - Dynamic Properties
Tags: webdev, beginners, programming, tutorial
Published: 2023-05-01 17:34:50

*Laziness and magic bring defects*

> TL;DR: Be explicit with your attributes

# Problems

- Readability

- Scope definition

- Unnoticed typos

# Solutions

1. Favor languages forbidding dynamic properties

# Context

Dynamic properties break type safety since it's easy to introduce typos or use the wrong property names accidentally. 

This can lead to runtime errors that can be difficult to debug, especially in larger codebases.

They also hide possible name collisions since dynamic properties may have the same name as properties defined in the class or object, leading to conflicts or unexpected behavior.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/1fceddaa27b7dcbb2cf0ba4f85861237)
```python
class Dream:
    pass

nightmare = Dream()

nightmare.presentation = "I am the Sandman"
# presentation is not defined
# it is a dynamic property

print(nightmare.presentation) 
# Output: "I am the Sandman"
```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/b2f04e4bafd415006b4ace96e4456612)
```python
class Dream:
    def __init__(self):
        self.presentation = None

nightmare = Dream()

nightmare.presentation = "I am the Sandman"

print(nightmare.presentation) 
# Output: "I am the Sandman"

```

# Detection

[X] Automatic 

Most languages have compiler options to avoid them.

# Tags

- Metaprogramming

# Conclusion

Dynamic properties are supported in many programming languages like PHP,    Python, Ruby,  JavaScript,  C#, Objective-C, Swift, Kotlin, etc.

In these languages, dynamic properties can be added to objects at runtime, and accessed using the object's property accessor syntax. 

Bear in mind that having public attributes favors [Anemic Objects](https://dev.to/mcsee/code-smell-01-anemic-models-4dg2) which is another smell.

# Relations

{% post https://dev.to/mcsee/code-smell-109-automatic-properties-f40 %}

{% post https://dev.to/mcsee/code-smell-01-anemic-models-4dg2 %}

# Disclaimer

Code Smells are my [opinion](https://dev.to/mcsee/i-wrote-more-than-90-articles-on-2021-here-is-what-i-learned-1n3a).

# Credits

Photo by [Karsten Würth](https://unsplash.com/@karsten_wuerth) on [Unsplash](https://unsplash.com/photos/0w-uTa0Xz7w)
    
* * *

> It's easy to cry "bug" when the truth is that you've got a complex system and sometimes it takes a while to get all the components to co-exist peacefully.

_D. Vargas_
 
{% post https://dev.to/mcsee/software-engineering-great-quotes-26ci %}

* * *

This article is part of the CodeSmell Series.

{% post https://dev.to/mcsee/how-to-find-the-stinky-parts-of-your-code-1dbc %}
Union and Intersection Typescript
Tags: typescript, programming, tutorial, learning
Published: 2023-05-01 17:34:11

First Type

```
type NobDeveloper = {
	name: string;
};
```

Second Type [Intersection]

```
type JuniorDeveloper = NobDeveloper & {
	expertise: string;
	experience: number;
};
```

[Union]

```
const newDeveloper: NobDeveloper | JuniorDeveloper = {
	name: "Tom Holand",
	expertise: "JS",
	experience: 5,
};
```
Install your package without conflicts
Tags: package, php, javascript, npm
Published: 2023-05-01 17:17:33

Do you know what the magic (*)(star symbol) or the (^) symbol is for while installing a package?
Reading this post will help you a lot in the near future😁 .
With different versions of Laravel, we always download a package and get the lousy error that our dependencies do not match with this package. The reason is usually the mismatch between the version we are using and the latest version of this package. So what we usually do is go to the Packagist and try to find a version that matches our project's version, and then we put two dots and a number which is the version. For example:
composer require laravel/socialite:4.3
or
composer require laravel/socialite:4.^
This will bring us version 4.2 according to Packagist which has the highest number of the version we specified.
😍 The trick today is that all you have to do is type two dots and an asterisk (*) symbol and the asterisk will go and bring the version that matches your project on its own.
For example:
composer require laravel/socialite:*
Of course, the two dots and asterisk are present in any package manager for any language, whether it's npm, pip, and so on. That's it, thank you
link to the Arabic post :
https://lnkd.in/de3tQHNc
Override Default WP Emails Addon
Tags: programming, wordpress, email, beginners
Published: 2023-05-01 17:07:48

Override Default WP Emails is an add-on for the popular WordPress plugin, User Meta, that allows administrators to replace a user's default email address with a custom one.

This addon can be useful for administrators who need to update or replace a user's email address, or in situations where the original email address is not accessible. The add-on is easy to use and helps ensure effective communication with website users. Whether you're new to WordPress or an experienced user, this tutorial will help you get the most out of User Meta Pro and its custom email. 

https://www.youtube.com/watch?v=HNtCAH8hUuA&ab_channel=UserMetaPro
Array-Flatten Array Javascript interview questions-1
Tags: javascript, react, node, html
Published: 2023-05-01 16:37:02

Frontend Interview or Nodejs Interview it's the most frequently asked interview question.

```
function doFlat(){
    let flatten = [];
    function flat(arr){    
        for(let i=0; i<arr.length; i++){
            const item = arr[i];
            if(Array.isArray(item)){
                // Object.assign(flatten,flat(item));
               [...flatten,flat(item)]
            }else{
                flatten.push(item);
            }
        }
        return flatten;
    }
    return {
        flat
    }
}

const {flat} = doFlat();

console.log(flat([1,2,[3,[0,4,5],4,[5,6]]]))
```

If you want to see more interview questions please reach out my GitHub profile

https://github.com/imran-mind/javascript-notes/blob/master/JS-Interview-coding-ques/

If you find this blog helpfull, please like and comment and don't forget to share this.
GSchema - A schematics engine written in go
Tags: schematics, javascript, go, devrel
Published: 2023-05-01 16:32:15

https://www.npmjs.com/package/gschema


A schematics engine written in go in-order to innovate the schematics niche and increase development speed.

### Install
`npm install -D hopemanryan/gschema`


### How to use

#### Templates 

 * Templates files must end with a  `__templ__` suffix 
 * The regex pattern for dynamic content is: `<% file_name =%>` (in the context file_name is a variable)
 * You can add dynamic variables to file names `<% file_name =%>Component.ts__templ__`
 * Javascript functions are supported (see more down bellow)

 #### Example

 ```
 const <% toUpperCase(file_name) =%>Component = () => {

}


const <% file_name =%>Component = () => {

}
 ```


#### Basic usage

```bash 
node ./node_modules/gschema/gschema.js -file_name=demo1 -read_dir=./abc
```


### JS functions 

Schematics are more popular in the Javascript community. There for we have added support to add a JS file that will have functions which can be used in the template files 

```javascript
// gschema.js
function toUpperCase (val) {
    return val.toUpperCase();
}
```

This will load the function and the engine sees toUpperCase it will run the function with variable value as the argument  `toUpperCase('demo1')` and return the value `DEMO1`


### Shorthands

`gschema.config.json` is the config file that can be used for shorthands configuration

```json
{
    "shorthands": {
        "demo": {
            "templatePath": "./abc"
        }
    }
}
```
``` bash
node ./node_modules/gschema/gschema -file_name=demo1 -s=demo
```
The engine will use the predefined config, this allows true re-usability of templates