teleren/devto huggingface dataset:
Here's a beginner tutorial on unexpected moments of JavaScript that may challenge your understanding of the language.
Published: 2023-03-18 17:55:15

The concept of hoisting: In JavaScript, variable and function declarations are moved to the top of their respective scopes during the compilation phase. This can sometimes result in unexpected behavior, such as being able to call a function before it's declared.

The difference between == and ===: In JavaScript, the double equal sign (==) is used to compare values for equality, while the triple equal sign (===) is used to compare both value and data type. This can sometimes result in unexpected behavior, such as when comparing a string and a number.

The use of the this keyword: In JavaScript, the this keyword is used to refer to the object that the current function is a method of. However, the value of this can sometimes be unexpected, such as when using it within a callback function.

The concept of closures: Closures are functions that have access to variables defined in their outer scope, even after that outer scope has returned. This can sometimes result in unexpected behavior, such as when modifying a variable that was defined outside of the closure.

The behavior of the typeof operator: In JavaScript, the typeof operator is used to determine the data type of a variable or expression. However, it can sometimes produce unexpected results, such as when checking the type of null or an array.

These are just a few examples of unexpected moments in JavaScript that can challenge your understanding of the language. To become more proficient in JavaScript, it's important to continue practicing and learning about the language's features and quirks.
Laravel Naming Conventions
Published: 2023-03-18 17:45:58

Laravel, a popular PHP framework, follows PSR-2 for its naming conventions, along with some additional conventions specific to the framework. Here are some of the conventions:

1. **Class names**: Class names should be declared in `StudlyCaps (also known as CamelCase) style`, with the `first letter of each word capitalized, without underscores`, and with no prefixes. For example: `MyClassName`.

2. **Method names**: Method names should be declared in `camelCase style`, with the first letter of the first word in lowercase and the first letter of each subsequent word capitalized, without underscores. For example: `myMethodName`.

3. **Constant names**: Constant names should be declared in all `uppercase letters with underscores` separating words. For example: `MY_CONSTANT`.

4. **Variable names**: Variable names should be declared in `camelCase style`, with the first letter of the first word in lowercase and the first letter of each subsequent word capitalized, without underscores. For example: `myVariableName`.

5. **Function names**: Function names should be declared in `snake_case style`, with all letters in lowercase and underscores separating words. For example: my_function_name.

6. **Route names**: Route names should be declared in `snake_case style`, with all letters in lowercase and underscores separating words. For example: `my_route_name`.

7. **View names**: View names should be declared in `snake_case style`, with all letters in lowercase and underscores separating words. For example: `my_view_name.blade.php`.

8. **Controller names**: Controller names should be declared in `plural form`, with the first letter of each word capitalized, without underscores, and with the word "Controller" added to the end. For example: `MyControllerName`.

9. **Model names**: Model names should be declared in `singular form`, with the first letter of each word capitalized, without underscores. For example: `MyModelName`.

Following these conventions can help make your code more consistent and easier to read, which can ultimately make your development process more efficient.
The Importance of Using Source Control
Tags: sourcecontrol, beginnermistakes, sillystories
Published: 2023-03-18 17:43:44

A young monk arrives at the monastery and is assigned to work with other monks who have been copying the old canons and laws of the church by hand. He notices that each of them is copying from another handwritten copy, and not the original manuscript.

The next time he meets with the abbot, he points out that if any of the monks makes even a tiny error, then it could be passed down in subsequent copies. The abbot says they have been doing things this way for centuries, and such mistakes just don’t happen and decides he would compare a recent copy with the original manuscript to prove to the young monk the wisdom in their ways.

And so the abbot heads down into the basement of the monastery where the original manuscript is stored in a locked vault. Several hours later, when he still hasn’t returned, the young monk gets worried and heads into the basement, where he finds the abbot completely distraught, openly weeping. He runs over to ask what has happened, and the abbot keeps repeating, “we missed the ‘R’!”. 

The young monk walks over to the manuscript to see what the abbot is talking about.

The word was celebRate.

And this is why you should always use source control.




Photo by [Vlad Hilitanu](https://unsplash.com/pt-br/@vladhilitanu?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/photos/EHrXDGHGAF0?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText).
Empowering Startups with AI: The Benefits of AI in Cyber Security Solutions
Tags: cybersecurity, startup, security, ai
Published: 2023-03-18 17:37:04

As startups continue to grow and evolve, their cyber security needs become more complex. Fortunately, artificial intelligence (AI) is a powerful tool that can help startups protect their data and systems from potential threats. Here are some ways that AI can be used in cyber security solutions for startups:

Automated Threat Detection: AI can be trained to detect potential threats and respond automatically, reducing the workload for security teams and allowing them to focus on more complex issues. This can help startups to quickly identify and respond to potential threats, minimizing the impact of cyber attacks.

Predictive Analytics: AI can be used to analyze data and identify potential vulnerabilities in systems and networks. This can help startups to proactively address security issues before they become major problems.

User Behavior Analysis: AI can be used to analyze user behavior and detect anomalous activity that could indicate a potential security breach. This can help startups to quickly identify and respond to potential threats, minimizing the impact of cyber attacks.

Cyber Security Education: AI can also be used to provide education and training to employees on best practices for cyber security. This can help startups to build a culture of security and reduce the risk of human error.

Overall, AI can be a powerful tool for startups looking to protect their data and systems from potential threats. By implementing AI-powered cyber security solutions, startups can improve their security posture and ensure that they are well-protected against the ever-evolving cyber threat landscape.
radio toggle button in react
Tags: react, webdev, javascript
Published: 2023-03-18 01:38:55

this small component consist by data, jsx & css...

Data:-
```js
// data.js

import girl from '../assets/girl.webp';
import boy from '../assets/boy.webp';

export const gender = [
    {
        data: "Boy",
        icon: boy,
    },
    {
        data: "Girl",
        icon: girl,
    }
]
```

Jsx:- 
```jsx
// App.jsx

import { gender } from './constants/data';
import { useState } from 'react';

const App = () => {

  const [switchToggle, setSwitchToggle] = useState(true);

  const handleClick = (data) => {
    setSwitchToggle(pre => !pre);
    console.log(data);
  }

  return (
    <div className="radioBtnContainer">
      {
        gender.map(({ data, icon }) => (
          <label htmlFor={data} >
            <input
              id={data}
              type="radio"
              value={data}
              name="value"
              onChange={() => handleClick(data)}
            />
            <img src={icon} alt={data} /> {data}
          </label>
        ))
      }
      <span 
        className={`switch ${switchToggle ? 'activeSwitch' : ''}`}
      >
      </span>
    </div>
  )
}

export default App;
```

CSS:-
```css
/* style.css */

* {
    margin : 0;
    padding: 0;
}

body {
    width          : 100%;
    height         : 100vh;
    display        : flex;
    align-items    : center;
    justify-content: center;
}

.radioBtnContainer{
    background-color: white;
    width           : 500px;
    display         : flex;
    align-items     : center;
    border-radius   : 25px;
    border          : 1px solid skyblue;
    position        : relative;
}

label {
    cursor       : pointer;
    display      : flex;
    align-items  : center;
    width        : 50%;
    height       : 30px;
    border-radius: 25px;
    position     : relative;
    z-index      : 1;
}

.switch {
    position        : absolute;
    top             : 0;
    left            : 0;
    bottom          : 0;
    background-color: rgb(194, 222, 255, .5);
    border          : 1px solid skyblue;
    width           : 50%;
    border-radius   : 25px;
    transition      : left .3s;
}

.activeSwitch {
    left: 50%;
}

input {
    margin    : 0 8px;
    appearance: none;
    outline   : none;
}

img {
    margin-right: 10px;
    width       : 16px;
}
```
How to Set Up the Soroban Python SDK on Windows
Tags: python, tutorial
Published: 2023-03-18 17:34:16

Sure, here's a step-by-step guide on how to set up the Soroban Python SDK on Windows for beginners:

First, you need to download and install Python on your Windows computer. You can download Python from the official website: https://www.python.org/downloads/windows/.

Once Python is installed, you can open a Command Prompt or PowerShell window. To do this, press the Windows key + R to open the Run dialog box. Type "cmd" or "powershell" in the box and press Enter.

In the Command Prompt or PowerShell window, use the pip package installer to install the Soroban Python SDK. Type the following command and press Enter:

Copy code

```
pip install soroban
```
This will download and install the Soroban Python SDK along with any required dependencies.

Now that Soroban is installed, you can start using it in your Python projects. To test that Soroban is working properly, you can try running the following code in a Python script:

scss
Copy code

```
from soroban import Soroban

soroban = Soroban()

result = soroban.evaluate("2 + 2")

print(result)
```
This code should output the result of the expression "2 + 2", which is 4.

That's it! You have now set up the Soroban Python SDK on Windows and can start using it in your Python projects. For more information on how to use Soroban, you can refer to the official documentation: https://soroban-docs.readthedocs.io/.
Laravel Form Request Validation
Tags: laravel, beginners, validationrequest, programming
Published: 2023-03-18 17:23:42

One of the key features of Laravel is its support for form request validation, which allows you to easily validate incoming HTTP requests.

When you create a form in your Laravel application, you can define a corresponding Form Request class that encapsulates the validation logic for that form. The Form Request class extends the base Laravel request class, and includes a set of validation rules that are applied to the incoming request data.

Here's an example of a simple Form Request class that validates a user's name and email address:

```
<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ContactFormRequest extends FormRequest
{
    public function rules()
    {
        return [
            'name' => 'required|min:3',
            'email' => 'required|email',
        ];
    }
}

```
In this example, the `rules()` method returns an array of validation rules for the form fields. The `'name' => 'required|min:3'` rule specifies that the name field is required and must have at least 3 characters, while the `'email' => 'required|email'` rule specifies that the email field is required and must be a valid email address.

Once you've defined your Form Request class, you can use it in your controller method to validate the incoming request. Here's an example:

```
<?php

namespace App\Http\Controllers;

use App\Http\Requests\ContactFormRequest;

class ContactController extends Controller
{
    public function store(ContactFormRequest $request)
    {
        // The incoming request data has already been validated
        // Do something with the validated data...
    }
}

```
In this example, the `store()` method accepts a `ContactFormRequest` instance as its argument. Laravel automatically validates the incoming request data using the rules defined in the `ContactFormRequest` class, and passes the validated data to the `store()` method.

Using Laravel's form request validation feature can help you write cleaner and more maintainable code, by separating your validation logic from your controller code. It can also help you ensure that your application's data is consistent and valid, which can improve the overall user experience.
I need help in settingup javafx for vscode
Published: 2023-03-18 17:20:01

i am absolute beginner for javafx. I have some issues in my vscode. 

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

launch.json

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

setting.json

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/if5u84qe2zz02m326sou.png)
My journey to Cloudreach
Tags: career
Published: 2023-03-18 17:11:57

Julio Arana Jr. 
Berlin: 15. September 2022

> "Non peream sine gloria et sine pugna, sed > faciam primum aliquid magnum…"

I would like to start by saying: "Don't open your mouth, If what you are going to say is not more beautiful than silence"…

My name is Julio Arana, I was born in Puerto Ordaz, Venezuela, my father is a doctor and my mother was a nurse, I was supposed to be the first doctor of the next generation like my father and my uncle David, but instead I chose to go my own way to be a Computer ́s Doctor.

I have a bachelor's degree in Science, my background was always related to the world of computing and information technology, always researching and learning by myself about this new science, I am a witness to the evolution of computers, the creation of the network of networks (Internet) and how technology has become an important part of everyone life around the world.

One day I made the hard decision to leave behind my family, my friends, my homeland to look outside my country, with the hope to find a better future and an opportunity for my dreams and my family.

It has been a long an a difficult journey to arrive in Germany in 2019, I was working at amazon as an associate in a logistics center for two years, where I learned and saw incredible things, the most valuable: "Work Hard, Have Fun and Make History…"

Many times I felt very tired and same time I felt the need to go forward without thinking about all the bad things that had happened to me, I needed to move on and fight for my dreams. Insist, Persist and Never give up, is the master key when you really want to fight for your dreams.

I was lucky enough to apply to Cloudreach Talent Academy, I finally realized that my opportunity was in just front of me. When the admission process began, I knew I had found the right place.

Wonderful people making technology more accessible, in a multicultural environment, amazing people, really aware of the diversity of culture, country, religion, race, disability or identity.

Find an opportunity in a company with which I share the same principles and values, is it real? No, this is unbelievable but true. It is so important to do what is right, not what is easy, when you believe in something.

As Paulo Coelho said once, Life has a way of testing a person's will, either by having nothing happen at all or by having everything happen all at once. 

That is why I am very happy to be here with you today, to be part of this special moment, learning something new every day, supporting my colleagues and preparing all of us for the great future that awaits us all as a team.

Finally, I want to share with you the poem Coloquio Bajo la Palma by Andrés Eloy Blanco, one of the greatest Venezuelan poets.

`"Lo que hay que ser es mejor y no decir que se es bueno 
ni que se sea malo, 
lo que hay que hacer es amar lo libre en el ser humano, 
lo que hay que hacer es saber, alumbrarse ojos y manos 
y corazón y cabeza y después, ir alumbrando."
`
Daily UX Writing Challenge Day 12, 13, 14
Published: 2023-03-18 16:45:01

[Day 1](https://dev.to/fuwa/daily-ux-writing-challenge-day-1-50la) | [Day 2](https://dev.to/fuwa/daily-ux-writing-challenge-day-2-4d6p) | [Day 3](https://dev.to/fuwa/daily-ux-writing-challenge-day-3-3cog) | [Day 4](https://dev.to/fuwa/daily-ux-writing-challenge-day-4-5cg8) | [Day 5](https://dev.to/fuwa/daily-ux-writing-challenge-day-5-2hac) | [Day 6 + 7](https://dev.to/fuwa/daily-ux-writing-challenge-day-6-7-1730) | [Day 8 + 9](https://dev.to/fuwa/daily-ux-writing-challenge-day-8-9-p8p) | [Day 10 + 11](https://dev.to/fuwa/daily-ux-writing-challenge-day-10-11-2d4l)


![Error message for an invalid name in a form](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q1hdwj5ehkdh2futsyi6.png)

The character limit made this challenge really hard....I can easily just write ‘Invalid name, please try again’ but no one wants their name to be called invalid…..you’re basically calling the user invalid! There was no space for empathy or a kind way to tell them their name was considered invalid…by a machine. 


![Notification for a truck driver regarding delay](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/74xl52qbc88914iyjjgv.png) 

I wasn’t sure if the app has the fuel level information or not, if it does then the ‘take break’ button should be ‘check fuel’ instead. However, I assumed the fuel level was on the truck dashboard  - so user would get the notification reminding them to check their fuel, they would look at their dashboard and determine whether to continue or not. 
Now thinking about it, ‘Take break’ doesn’t really work because it’s not like the truck driver can just stop straight away. 

So as 2nd iteration, I would prob just put a single button either ‘check remaining deliveries’ or ‘check fuel’


![Unknown error message for an app](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r2lxl4zm4pz6sk48hdx3.png) 

When an app suddenly doesn’t work, as a user, it is normal to feel annoyed and frustrated. So I wanted to avoid mentioning anything in the message that would lead the user into thinking it was their fault like ‘check your connection’. 

I found with a lot of these writign challenges, I had the most trouble staying within the character limit. I understand there are there because of the limited space where the message would be displayed, but they left very little room for a more human one.
Setup SSH on windows
Tags: powershell, windows
Published: 2023-03-18 16:36:44

How do you generally connect to your windows machine remotely?

I bet you use some 3rd party software or use Remote Desktop connection (uses RDP) to connect.

Now RDP is a SOAP based connection protocol and it is not that great either is it? I mean you can not easily use RDP from any other platform such as macOS or linux can you? Situation is even worse if you need to do it programmatically.

But hey! Did you know you could very easily use SSH? Well I did not!

It turns out our old faithful PCs can connect quite easily over SSH. We just have to enable a few settings and what better way to do this than firing up the Powershell?

First, let's clarify the terminology. The system that we will connect to is referred to as _server_ (<u>This has got to be a windows machine</u>). The system that we will use to connect is referred to as the _client_ (This can be running any desktop OS).

1. Open Powershell on the server as <u>Administrator</u> and check if openssh services are available.
```
Get-WindowsCapability -Online | ? Name -like 'OpenSSH*'
```
2. It can be that neither of the services are available. But mostly on newer windows installations, open-ssh clients are available. So, I will show how to install the server. Client can be installed similarly.
```
Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0
```

3. Now start the open ssh server
```
Start-Service sshd
```

4. Check if the services are running. Open SSH server needs to be running in order to make the device act as a server.
```
Get-Service sshd
```

5. _(Optional)_ Set the services to startup automatically on windows boot.
```
Set-Service -Name sshd -StartupType 'Automatic'
```

That's it! You can now ssh directly from your client terminal into this windows machine (server).
How To Add A New Column Using Laravel Migration?
Published: 2023-03-18 15:57:49

In this post, we will focus on the Add new column after another column in our DB table. step by step explain how to add a new column in the migration file.  follow the below step to learn how to do it.

will give you a simple example of how to add a column after a specific column in Laravel migration. Alright, let’s dive into the details.  for example, we have the "posts" table with columns: 

['id', 'title', 'body', 'created_at', 'updated_at'] and we need to add the "status" column after the body column into the table.

`Firstly Create a Migration File`

```
php artisan make:migration AddStatusColumnToPostsTable
```

Then use the after() method from Schema to do it with syntax $table->boolean('status')->after('body');

```
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('posts', function (Blueprint $table) {
            $table->boolean('status')->after('body');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('posts', function (Blueprint $table) {
            
        });
    }
};
```

Now, you can run the migration command:

```
php artisan migrate
```

You can See [The Most Important Software Design Patterns](https://mahmoudabdelhalim.com/post/the-7-most-important-software-design-patterns)

Thanks
Ryan Teaching Adult Series 001 - Circle and PI
Tags: blog, math, circle, teaching
Published: 2023-03-18 15:50:08

My son Ryan starts to practice his presentation skills by teaching his Daddy (which is me). The first talk is Circle and he also talks a little bit about [Pi](https://helloacm.com/pi)

https://youtu.be/GNCZ4niPy4c

Video Series: [Ryan Teaches Adult](https://zhihua-lai.com/teaching/?s=&cat=ryan)

Teaching is the best way to learn!



<hr/>

### [Steem](https://steemyy.com) to the Moon!
1. You can swap the STEEM/SBD to USDT (TRC-20) via [Steem2USDT](https://steemyy.com/steem2usdt.php)
2. Register a free STEEM account at [here](https://steemyy.com/reg.php)