teleren/devto huggingface dataset:
ARTIFICIAL INTELLIGENCE
Tags: webdev, javascript, ai
Published: 2022-12-24 19:46:13

_By: JoshGreat_

AI Definition and Types

Artificial intelligence (AI) refers to the simulation of human intelligence in machines that are programmed to think and act like humans. These machines are designed to learn and adapt through experience, and are able to perform a wide range of tasks, from simple to complex, without the need for explicit instructions. AI technology has the potential to revolutionize many industries, including healthcare, education, transportation, and manufacturing. It is already being used in a variety of applications, such as personal assistants, language translation, and image and facial recognition. There are also many concerns about the potential risks and ethical implications of AI, and as a result, there is ongoing debate and discussion about the appropriate use and development of this technology.

**TYPES OF AI**
There are several different types of artificial intelligence, including:

Reactive machines: These are the most basic type of AI, and they are designed to perform a specific task without the ability to learn or adapt. They simply react to stimuli in their environment and do not have any memory or past experiences to draw upon.

Limited memory: These AI systems have some ability to learn and adapt based on past experiences, but they do not have the ability to retain long-term memories or use past experiences to inform future decisions.

Theory of mind: These AI systems are designed to have a "theory of mind" and understand that other people and objects have their own thoughts, feelings, and beliefs.

Self-awareness: These are the most advanced AI systems, and they have the ability to be self-aware and have a sense of their own consciousness.

Narrow AI: These AI systems are designed to perform a specific task or set of tasks. They are generally better at a single task than humans, but they are not capable of learning or adapting to new tasks.

General AI: These AI systems are designed to be able to learn and adapt to a wide range of tasks, similar to how humans can learn and adapt to new situations.

Strong AI: This term refers to AI systems that are able to perform any intellectual task that a human can, and potentially even surpass human intelligence.
Science On The Blockchain!
Tags: blockchain, web3, research
Published: 2022-12-24 19:38:56


Have you heard of Science On The Blockchain? 
Yes? No? Not Yet? ... 

Let me present the Frontier Registry.  - Scientific Publishing On-Chain

It's a (R)evolutionary publishing platform for scientists, engineers and academics that allows you to publish your work with an immutable record date/time stamped with your authorship - that will forever exist on the blockchain. 

Distributed Ledger Technology.  For science?  Yes! In fact, for ALL STEM Fields. 

Explainer Video HERE  - 2 mins: https://www.youtube.com/watch?v=lAxw35kjUzI 


Sign Up for BETA Testing - HERE - https://frontier-registry.carrd.co/  

Comment below or book a Time With ME for an AMA - and go ahead, Ask Me Anything! - https://www.linkedin.com/in/darshd555/

Scientific publishing and collaboration has never been so Safe, so Easy, so Free and so Secure.
BASICS ON WEB3
Tags: webdev, javascript, beginners, programming
Published: 2022-12-24 19:35:38


Web3 decentralized applications


_By: Akeribo Joshua(JoshGreat)
_
**Basic knowledge on Web3 **

Web3 refers to the third generation of the World Wide Web, which refers to the development of decentralized applications (DApps) that operate on a distributed network, rather than on a central server. Web3 technologies, such as blockchain and smart contracts, enable users to interact with DApps and make decisions that are recorded on a distributed ledger, providing a level of transparency, security, and immutability not possible with traditional web applications.

One of the main features of Web3 is its ability to facilitate peer-to-peer (P2P) transactions without the need for intermediaries. This allows users to directly interact with one another and exchange value without the need for a central authority or third party to facilitate the transaction.

Web3 technologies are built on top of the Internet Protocol (IP) and use decentralized networks, such as blockchain and peer-to-peer networks, to enable secure, transparent, and fast transactions. Some popular Web3 technologies include Ethereum, a decentralized platform that runs smart contracts, and IPFS (InterPlanetary File System), a distributed file system that allows users to store and share data in a decentralized manner.

Web3 has the potential to revolutionize the way we interact and do business online, enabling more secure and efficient transactions and enabling the creation of new types of decentralized applications.

Hope this was helpful, let us know
What is the Difference between ViewBag and ViewData in ASP.NET Core MVC
Published: 2023-01-10 19:49:38

---
title: What is the Difference between ViewBag and ViewData in ASP.NET Core MVC
published: true
date: 2022-12-24 19:01:29 UTC
tags: 
canonical_url: https://mbarkt3sto.hashnode.dev/what-is-the-difference-between-viewbag-and-viewdata-in-aspnet-core-mvc
---

[ASP.NET](http://ASP.NET) Core is a popular framework for building web applications using the .NET platform. Within [ASP.NET](http://ASP.NET) Core, there are two key mechanisms for transferring data from a controller to a view: ViewBag and ViewData. While these mechanisms serve a similar purpose, they have some notable differences that developers should be aware of.

## **ViewBag**

ViewBag is a dynamic property that is available on the base controller class in [ASP.NET](http://ASP.NET) Core. It allows you to pass data from a controller to a view by assigning values to properties on the ViewBag object. For example:

```
public IActionResult Index()
{
    ViewBag.Message = "Hello, World!";
    return View();
}

```

In the view, you can access the value of the `Message` property using the `@ViewBag` object:

```
@ViewBag.Message

```

One advantage of ViewBag is that it is dynamically typed, which means that you don't need to specify the type of the data being passed. This can make it easier to use in some cases, as you don't need to worry about type casting.

## **ViewData**

Like ViewBag, ViewData is a mechanism for passing data from a controller to a view. However, ViewData is a dictionary object that stores key-value pairs, rather than a dynamic property.

Here is an example of using ViewData to pass data from a controller to a view:

```
public IActionResult Index()
{
    ViewData["Message"] = "Hello, World!";
    return View();
}

```

In the view, you can access the value of the `Message` key using the `ViewData` object:

```
@ViewData["Message"]

```

Unlike ViewBag, ViewData is strongly typed, which means that you need to specify the type of the data being passed. This can make it more error-prone, as you need to be careful about type casting. However, it can also make your code easier to maintain, as the type of the data is explicit and can be checked at compile time.

## **Summary**

In summary, ViewBag and ViewData are both mechanisms for transferring data from a controller to a view in [ASP.NET](http://ASP.NET) Core. ViewBag is a dynamic property that is easy to use, but not strongly typed, while ViewData is a dictionary object that is strongly typed but requires more explicit type casting.

Which one you choose will depend on your specific needs and preferences. Both ViewBag and ViewData can be useful in different situations, so it's important to understand the differences between them and how they work.
React without JSX
Tags: webdev, javascript, react, tutorial
Published: 2022-12-24 18:16:11

So here I will show you how to create use react without JSX. when you will go to any tutorial for the first time they will teach you about JSX first and then component and all the cool stuff. 

But do you know that when react was created it was using plain JavaScript object to create components and all...

We will see that in this session:- 

let's say you have a html file with a div tag like below
   <div id="root"></root>

now you want to create few element and assign them to root, In plain js will do like this 

```
const h1 = document.createElement("h1");
h1.innerHTML = "Hello world!";
const root = document.getElementById("root");
root.appendChild(h1);
```

And it will render it on browser perfectly fine.

Now coming to main topic how we will do the same for react using plain javascript 

```

const h1 = React.createElement("h1",{},"Hello world");
const root = ReactDOM.createRoot("root");

root.render(h1);
```

hurrah we have create one react element using plain js 

now if you want to add multiple element to root you can do it by simply doing this 

```
const firstName = React.createElement("h2",{id:fName,"abc"};
const lastName = React.createElement("h2",{id:lName,"xyz"};

root.render([firstName,lastName]);
```
Add app icon in flutter mobile app
Tags: flutter, app, icon, linux
Published: 2022-12-24 18:14:03

To add an app icon to a Flutter mobile app, follow these steps:

1. Create a new folder in the root of your Flutter project called "assets". This is where you will store your app icons.
    
2. Add your app icons to the "assets" folder. Make sure to include versions of the icon for different screen densities, such as 1x, 2x, 3x, and 4x. You can generate these versions using a tool like [**https://makeappicon.com/**](https://makeappicon.com/).
    
3. Open the `pubspec.yaml` file in the root of your Flutter project. This file contains the configuration for your Flutter app, including the assets that it uses.
    
4. Under the "flutter" section, add an entry for each of your app icons to the "assets" list. For example:
    

```yaml
flutter:
  assets:
    - assets/icon/icon.png
    - assets/icon/icon_2x.png
    - assets/icon/icon_3x.png
    - assets/icon/icon_4x.png
```

1. Run the following command to update the Flutter app with the new icons:
    

```bash
flutter pub get
```

1. Finally, specify the app icon in the `AndroidManifest.xml` file for Android and the `Info.plist` file for iOS. For example, in the `AndroidManifest.xml` file, you would add the following line:
    

```xml
<application
    android:icon="@mipmap/ic_launcher"
    ...>
```

Replace "ic\_launcher" with the name of your app icon file.

That's it! Your Flutter app should now use the app icon that you specified.

# Hope you like this... Happy coding...
API building tool online - low code
Tags: webdev, programming, api, help
Published: 2022-12-24 18:06:09

guys, does anyone know if is there any online tool here for making API without code ( like a low-code model ). because in our product there is a lot of API is there & we will use PSQL or MongoDB.

and we can able connect out database with this tool or this will provide any database.

maximum API will do CRUD operation. and we have less time. 

this tool can be paid or free. please give any solution guys.

thanks 🤗
Code Smell 188 - Redundant Parameter Names
Tags: webdev, beginners, programming, tutorial
Published: 2022-12-24 18:02:21

*Use contextual and local names*

> TL;DR: Don't repeat your parameters' names. Names should be contextual.

# Problems

- Duplication

- Readability

# Solutions

1. Remove the repeated part from the name

# Context

When using names, we often miss that words are contextual and need to be read as a whole sentence.

# Sample Code

## Wrong

[Gist Url]: # (https://gist.github.com/mcsee/846ae86d9b75ccb1ccbabe75c4306800)
```crystal
class Employee
  def initialize(@employee_first_name : String, @employee_last_name : String, @employee_birthdate : Time)
  end
end

```

## Right

[Gist Url]: # (https://gist.github.com/mcsee/5f4a6933b3d176e061d795119d5bc11c)
```crystal
class Employee
  def initialize(@first_name : String, @last_name : String, @birthdate : Time)
  end
end
```

# Detection

[X] Semi-Automatic  

We can check our parameter names and try to find duplication.

# Tags

- Naming 

# Conclusion

Use short and contextual names for your parameters.

# Relations

{% post https://dev.to/mcsee/code-smell-87-inconsistent-parameters-sorting-21j3 %}

# Disclaimer

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

# Credits

Photo by [Wolfgang Hasselmann](https://unsplash.com/@wolfgang_hasselmann) on [Unsplash](https://unsplash.com/photos/Y3RVsHBeK7c)
    
* * *

> As a rule, software systems do not work well until they have been used, and have failed repeatedly, in real applications.

_David Parnas_
 
{% 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 %}
PHP-8.0 Named Arguments - Explained in Depth
Tags: php, php8, laravel
Published: 2022-12-24 17:43:45

PHP supports passing arguments by 5 different types. They are 
 
1. Passing by reference (default type)
2. Passing by value
3. Default argument values
4. Variable-length argument lists
5. **Named Arguments**

First Lets Discuss. Why we need a named arguments.Let consider a example we are trying to write a function to calculate the house or home's monthly expenses . Some may have tax & water tax but,some may not.Let look a code with out using a named arguments.

```
<?php

function expense($food, $vatTax = 0, $electricity, $wTax = 0)
{
    return $food + $vatTax + $electricity + $wTax;
}

echo expense(20, 0 , 10, 10);  // user without vatTax

```

In above function you can see even if the user not having a vatTax we are passing the zero. we can pass that as a last argument. for example we are passing like this.so , just think what if we have some more arguments for some reason it may need & not need.

This the case PHP-8.0 comes with **Named Arguments** where you can pass the arguments by name . let rewrite the above function using Named Arguments 

```
<?php

function expense($food, $vatTax = 0, $electricity, $wTax = 0)
{
    return $food + $vatTax + $electricity + $wTax;
}

//passing arguments by name

echo expense(food: 40, electricity: 50); 

   
```
So, using PHP named arguments we don't want to pass a default value for non used parameters.



Share your comments and like for more post like this.
What is Docker? 🐋
Tags: docker, programming, devops
Published: 2022-12-24 17:39:43

## What is it, and how does it work?

**Docker** is a tool that packages software into **containers** that can run in a reliable manner in any environment.

![Michael the office](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f95p1ldw1tmmdyb2rnqm.png)

So if you didn't understand what that means, imagine a cardboard box that contains all the parts of a software application. 

![Box being packaged](https://media4.giphy.com/media/GA1s4aZhfe5f2N3fFb/giphy.gif)


This box is the container, and it contains everything the application needs to run, including libraries, configuration files, and other dependencies.


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


The container is then deployed to a server, and the application runs inside the container. This means that the application can run anywhere, regardless of the underlying operating system or environment.


![Cargo Ship](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6pe0d9en1qt77avi8csm.png)



# What are the benefits of using Docker?

## Deployment

Using Docker has many advantages. For starters, it makes it easier to deploy applications. You don't have to worry about compatibility issues, since the application runs in a container that is isolated from the underlying environment.


![Docker Container](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g6xdd6lhklram33j82mb.png)


## Management

It also makes it easier to manage applications. Instead of having to manage multiple versions of the same application, you can just deploy a single container. This makes it easier to keep track of the application and its dependencies.


![Docker Multiple Apps](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kyc0fyeopqgq13mcjeay.png)


## Scalability
Finally, Docker makes it easier to scale applications. You can easily deploy multiple containers to handle increased demand, and you can also scale down when demand decreases.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oyxq8gworsfmaa2kl989.png)
5 Shortcuts to make tab navigation easier on your browser
Tags: chrome, browser, shortcut
Published: 2022-12-24 17:37:46

First a shout out to all the shortcut lovers ✌️

## Now here is a quick one on how to flex your tab browser without any hassle:
|


|Action |Shortcut |
|---|---|
|Open a link in new background tab |Ctrl + Click a link|
|Jump to the next open tab |Ctrl + Tab|
|Open a new tab, and jump to it |Ctrl + t|
|Reopen closed tabs |Ctrl + Shift + t|
|Close the current tab |Ctrl + w |

|Extra | Shortcut |
|---|---|
|Go back to previous page |Alt + Left arrow |
|Open the next page from your browsing history in the current tab |Alt + Right arrow |
|Jump to the address bar |Ctrl + l |


![Chrome Navigation Shortcut](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e59krsx67a6vagajsuwf.jpeg)
"Everybody struggles"
Tags: womenintech, programming, opensource, outreachy
Published: 2022-12-24 16:57:29


![struggle](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ulfvsx6e45hwqd1bym4t.jpeg)

I am an Outreachy intern (3 weeks now, wow!) working on the [Tor Browser](https://www.torproject.org/download/), a free and open-source software project that allows users to browse the internet anonymously but particularly to Extend GetTor to distribute TorBrowser on censored networks over IM and social media. I have come to realize that everyone struggles at some point in their career. No matter how skilled or experienced you are, there will always be challenges and obstacles that you need to overcome. Moreso, for someone just starting out professionally, the feeling of inadequacy is extremely poignant.

## **What are my struggles?**
So... my struggle initially when I came on the project was running the codebase but what helped me a lot is asking questions, then came the problem of understanding the entire codebase and what is happening which if I am been sincere I still do not totally know what is happening but I just focus on what I am working on what is happening there.

![A trip takes us](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1y8hymy9nmkik81rqvl1.jpeg)
As an intern, I have struggled with understanding complex technical concepts(I use Google most time) and getting up to speed on the project's development process. These struggles are natural and are a part of the learning and growth process as I have been told during the live chats on the Outreachy community channel.

One thing that has helped me to cope with these struggles is to remember that I am not alone. Every developer, no matter their level of expertise, goes through similar struggles. It's important to seek out support from colleagues and mentors (of which my mentor "meskio" and the other community members have been of immense help) and to remember that it's okay to ask for help.

Another thing that is helping me to overcome my struggles is keeping an open mind and a positive attitude. It's easy to get discouraged when things don't go as planned, but it's important to stay focused and to keep trying. By approaching challenges with a positive attitude, I have been able to find solutions and make progress in my work.

## **What's Next?**
Despite the challenges that I have faced, I am learning a lot during my time as an intern with the [Tor Browser](https://www.torproject.org/download/), and I am grateful for the opportunity to be a part of this amazing open-source project. I hope that by sharing my experiences, I can encourage others to embrace their struggles and to keep pushing forward, no matter how difficult things may seem.

As I continue to work on the Tor Browser, I am looking forward to learning even more and contributing to the project in meaningful ways. I am excited to see where my journey as an intern takes me and to see what the future holds for me in the world of open-source software development.
Laugh and Learn: How to Use Funny Stories of Codebase Mistakes to Your Advantage
Tags: security, community, devjournal
Published: 2022-12-24 16:39:50

We've all made mistakes in the codebase - it's just part of the job. But instead of dwelling on your own blunders, why not take a step back and laugh (and learn) from the mistakes of others?

That's where [shittysecrets.dev](https://shittysecrets.dev) comes in. Everyone is welcome to share their hilarious stories of leaked secrets in a codebase. 

From the colleague who accidentally committed a credential API to the lead dev who inadvertently pushed the `.env` to a public repository. These tales of woe will have you laughing (and maybe even cringing) as you relive the struggles of managing secrets in the codebase.

But it's not all doom and gloom - by reading these stories, you can learn from the mistakes of others and avoid making the same errors in your own code. So if you're looking for a good laugh (and some valuable lessons), be sure to [check it out](https://shittysecrets.dev) and get ready to laugh (and learn).

Join the party, [share your unique shittysecrets.dev story!](https://www.shittysecrets.dev/user-stories/bdc18de7-b32a-47e3-a155-6e3e8cbeb63d?submit=1)

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