teleren/devto huggingface dataset:
Recap:  My First Week of Learning Swift...Part 2 
Tags: ios, beginners, swift
Published: 2021-06-26 19:07:40

**Days 5 & 6:**

**Functions and Parameters**

*Functions allow us to re-use code in different places. If the code in the function is changed, it will be updated  everywhere that function is being used. It is common to use functions to break up large code to make it easier to follow. All parameters are constants which mean they cannot be changed. To change them the keyword inout must be used and it will change inside and outside the function. Parameters in functions are given a name and a type. For example, name: string. They can be given an external and internal label but if we prefer not to use an external label it can be replaced with an underscore. We can give a parameter a default value. For example,...new: bool = true. Variadic functions accept any number of parameters of the same type. Any parameter can become variadic by adding (...) after its type. We can throw functions by using enums to describe the errors we can throw.Its good to know that Swift wont let us run an error-throwing function by accident.*

**Closures** 

*There is so much that goes into closures so I'm going to be brief. Functions can be used like types. We can create a function and assign it to a variable, call the function using the variable and even pass it into another function as a parameter. This process is called closures. Closures accept parameters and can be used as a parameter. They can also return values. If a closure is the last value in a function we can use a special syntax called trailing closure syntax. This passes the closure after the function inside the braces. 
If we want to use closures as parameters when they accept parameters just add the parameter inside the parentheses of  () -> Void. Void can be replaced with any type of data to force the closure to return a value.*

*If you read part 1 and part 2, thank you and I hope it made sense to you. If not, that ok too! I wanted to do this to deepen what I have learned so far.*

*Until tomorrow !*
Flutter Learning Roadmap V1
Tags: flutter, developer, roadmap
Published: 2021-06-26 18:41:31

---
title: Flutter Learning Roadmap V1
published: true
description: Flutter Learning Roadmap V1
tags: flutter, developer, roadmap
cover_image: https://images.unsplash.com/photo-1498637841888-108c6b723fcb?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1491&q=80
---
# Introduction
Hello there!
Currently, I'm really into Flutter and I want to learn it inside out. I don't want to learn Flutter I want to be Flutter! So I thought this time a rough overview of all the topics would be nice so I have a rough structure to follow.

Flutter is not that old but already has many topics and subtopics to learn and master. Everyone knows the feeling when too much knowledge is overwhelming and you don't even begin to study or let it slip half the way. So my idea is to have a rough Roadmap at first that will evolve over time the further I get.

For all of you that are want to get into Flutter or currently getting into it, this first version of my Roadmap hopefully will help you.

# Flutter Roadmap

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w9qtly4j3anzffvrwccf.png)

## How to read it
I don't want to make it very strict. Without thousands of arrows and lines. It should more serve as a guidance. You can read it from top to bottom where I tried to make suggestions on which topics to learn first. The topics are grouped and you can distinguish them by the colors.

# Whats next
As i said above this Roadmap will evolve over time. As more I get into specific topics I will discover even more topics and subtopics. The end goal is to have a somehow perfect (at least to 99%) Roadmap for every upcoming Flutter Developer. If you have any suggestions for improvement please feel free to contribute to this Roadmap and drop a comment! I will upload it in my [Github Account](https://github.com/Dextavision) in the next days where I update it in the future.

When I'm finished I will announce it here.

# Conclusion
Either you are an upcoming Flutter developer or interested to become one i hope you find this Roadmap and this approach to learn a topic helpful.

Stay connected to me and my content on [Twitter](https://twitter.com/danytulumidis).

I love to improve myself every single day even if it's just a tiny bit!

Stay safe and healthy guys!

And as always: develop yourself!
Linux Command Line You Need to Know
Tags: linux, ubuntu, linuxcommand
Published: 2021-06-26 18:33:06

Whether you are looking to expand skills about linux. So, out of the hundreds of possible Linux commands you could or have to learn. Here some linux command you need to know.

### Print Working Directory
The `pwd` command for to know you where you are now. For example your’re in download folder. Try the following type pwd and you will see that you’re in your download directory.

### Clear Terminal Screen (Console)
For Linux you can type `clear` or `Ctrl+L` to Clear the screen. It works in most terminal.

### Show Lists Directory Of Contents
Command `ls` is equivalent to the DOS dir command, that it show lists files and directories. This command has some common attributes, example like:
* `ls -a` for show all folders and files including visible and hidden.
* `ls -l` for show the contents of the directory in full, starting from access rights, owner, group and the date the file or directory was created.
* `ls -i` show directory contents and size.

### Troubleshooting
For troubleshooting you can use command `tail -f`. Example like this `tail -f /var/log/daemon.log`.

### Show History Commands in Linux
If you want to see the previous commands, you can type `history` in your terminal. Meanwhile, to search command history in Linux, press `ctrl+R`, then just type the previous command you want to search or use.
Free Tools For Web Developers
Published: 2021-06-26 18:15:33

Some tools and assets to help you build your next project.

* [Unique Face Generator](https://generated.photos/face-generator) with free tier
* [Repository](https://github.com/255kb/stack-on-a-budget) with a collection of services with great free tiers for developers on a budget
* Get inspired: [A list of 100+ handpicked personal websites](https://www.personalwebsites.top/#list)
* [Presentation slides](https://sli.dev/) for devs
* [Free artsy illustrations](https://weareskribbl.com/) for your next project
* [Landing page inspirations](https://www.btw.so/marketing/landing-page-examples)
* [Daisy UI](https://daisyui.com/) - pretty CSS components
* Some [boring avatars](https://boringavatars.com/)

#####Thanks for checking out this article. I also make YT videos on web development focused on beginners. Here is the link if you want to drop a like or subscribe :) 
#####https://www.youtube.com/channel/UCOql8GiyvTDDeM7ECiRu2Sg
Dealing with huge xml-like files containing illegal characters
Tags: csharp, netcore, xml
Published: 2021-06-26 18:09:37

---
title: Dealing with huge xml-like files containing illegal characters
published: true
description: 
tags: csharp, netcore, xml
//cover_image: https://direct_url_to_image.jpg
---

Sometimes you have to deal with files that look pretty like xml. But htey are not, because contain a lot of illegal characters. Such files usually made by just concatenating strings and not verifying angainst any schema. When these files are comparably small, it's not a big deal to use regex to replace all those characters, but for really big files it's not very convinient.  
The idea was to read file element by element and if next part is not a valid xml, then I could clean all illegal characters and use well-formed xml for my needs.  
```csharp
public IEnumerable<XElement> GetElement(string filePath, string elementName)
{
    using var reader = XmlReader.Create(filePath, new XmlReaderSettings { CheckCharacters = false });
    reader.MoveToContent();

    while (reader.Read())
    {
        if (reader.NodeType == XmlNodeType.Element && reader.Name == elementName)
        {
            var str = reader.ReadOuterXml();
            XNode node;

            try
            {
                node = XElement.Parse(str);
            }
            catch (XmlException)
            {
                var pattern = @"&#x((10?|[2-F])FFF[EF]|FDD[0-9A-F]|[19][0-9A-F]|7F|8[0-46-9A-F]|0?[1-8BCEF]);";
                var regex = new Regex(pattern, RegexOptions.IgnoreCase);
                var fixedStr = regex.Replace(str, string.Empty);

                node = XElement.Parse(fixedStr);
            }

            if (node is XElement el)
            {
                yield return el;
            }
        }
    }
}
```
Important note:
To skip checking for invalid characters, you should pass to `XmlReader` settings `XmlReaderSettings { CheckCharacters = false }` so it can omit checks and give me possibility to cleanup input string.
Build a Project with JavaScript | Beginner 2021
Tags: javascript, html, css, w3tsadev
Published: 2021-06-26 17:53:54

Hello everyone, in this video, I will build a simple JavaScript Project: Shopping List. It is a beginner-friendly project to get a good grasp of JS. Hope you will enjoy it!

here is the YT link: https://youtu.be/RdG7e_5kLIo

{% youtube RdG7e_5kLIo %}
Why Docker?
Tags: docker, webdev, codenewbie, productivity
Published: 2021-06-26 16:49:29

Before I talk about Docker, let me give you a common problem in software development that developers used to have.

Let’s say a developer who just finished developing and testing a new feature worked fine on their environment. But when the same code reached production, suddenly, the system crashed. One of the possible reasons is that the development and production environments are different from each other.

Before Docker, developers would use Virtual Machine to create a virtual environment to ensure that the developer’s station matches the production server. The problem with that is now we are wasting resources and not able to usefully our Disk Space, Memory, Processing Power, and more.

Docker is different to set it up and use. It is installed directly onto the user’s machine, and developers can install multiple containers responsible for their microservice. As you can see, we didn’t have to allocate any of the resources for our containers, and it will automatically use what it needs for the need of an application.

We can now have our code base with all the tools running equally on any environment with that setup.

In conclusion, if you were to start to work on the project, I would recommend using Docker as it will remove the environmental issues.


For more tips, subscribe to my channel and don't miss the future topics.
[YouTube - DevPool](youtube.com/channel/UC03vw5F2isFkbJhyEZU5bvg?sub_confirmation=1 "DevPool")
🎬Build A Weather App | JavaScript [Beginners]✨
Tags: javascript, api, css, beginners
Published: 2021-06-26 16:39:08

Build A Weather App With Vanilla Javascript Tutorial | Javascript For Beginners
Using JavaScript APIs.

---

{% youtube eMzHhu4TaqY %}

---

🏆**Recommended Projects**🏆

🎬 Login & Registration Form Using HTML & CSS & JS
➤https://youtu.be/I5_T547tHf0

🎬 Neumorphism Login Form | HTML & CSS 
➤https://youtu.be/QWh0S-3D7uY

🎬 Top 10 Best VS Code Extensions | 2021
➤https://youtu.be/bwPmpducPgw

🎬 Amazing Social Media Buttons Hover Effects | HTML & CSS 
➤ https://youtu.be/P9pi4hq7BBA 

🎬 Animated Login Form | HTML, CSS & JavaScript 
➤ Watch: https://youtu.be/ogNwc45qHKo

---
Processes in Elixir
Tags: elixir, erlang, html, javascript
Published: 2021-06-26 16:12:01

### spawn

The basic mechanism for spawning new processes is the auto-imported spawn/1 function:

`iex> spawn(fn -> 1 + 2 end)
 # PID<0.43.0>`

Notice spawn/1 returns a PID (process identifier). At this point, the process you spawned is very likely dead. The spawned process will execute the given function and exit after the function is done:

Can we see if its dead or alive
```
iex> pid = spawn(fn -> 1 + 2 end)
#PID<0.44.0>
iex> Process.alive?(pid)
false 
```
##### Lets send a Message from one process to another

*We can retrieve the PID of the current process by calling self :*
```
iex(6)> parent=self()
#PID<0.103.0>  
```
#### Sender
```                                          
iex(7)> spawn(fn->send(parent,{:hello,self()}) end) 
#PID<0.115.0> 
```
> When a message is sent to a process, the message is stored in the process mailbox. The receive/1 block goes through the current process mailbox searching for a message that matches any of the given patterns

#### Receiver
```                                           
iex(8)> receive do                                      
...(8)> {:hello,pid}->"Got hello form #{inspect pid}"  
...(8)> end                                               
"Got hello form #PID<0.115.0>"
```
Difference between TCP and UDP
Tags: node, networking, privacy, networks
Published: 2021-06-26 15:59:45

**Transmission Control Protocol (TCP)**
Transmission Control Protocol (TCP) is connection-oriented, meaning once a connection has been established, data can be transmitted in two directions. TCP has built-in systems to check for errors and to guarantee data will be delivered in the order it was sent, making it the perfect protocol for transferring information like still images, data files, and web pages.
But while TCP is instinctively reliable, its feedback mechanisms also result in a larger overhead, translating to greater use of the available bandwidth on your network.


**User Datagram Protocol (UDP)**
User Datagram Protocol (UDP) is a simpler, connectionless Internet protocol wherein error-checking and recovery services are not required. With UDP, there is no overhead for opening a connection, maintaining a connection, or terminating a connection; data is continuously sent to the recipient, whether or not they receive it. 
Although UDP isn’t ideal for sending an email, viewing a webpage, or downloading a file, it is largely preferred for real-time communications like broadcast or multitasks network transmission.

**Differences between TCP and UDP**

TCP is a connection-oriented protocol, whereas UDP is a connectionless protocol.
The speed for TCP is slower while the speed of UDP is faster.
TCP uses handshake protocols like SYN, SYN-ACK, ACK while UDP uses no handshake protocols.
TCP does error checking and also makes error recovery, on the other hand, UDP performs error checking, but it discards erroneous packets.
TCP has acknowledgment segments, but UDP does not have any acknowledgment segments.
TCP is heavy-weight, and UDP is lightweight.
TCP vs UDP Speed
The reason for UDP’s superior speed over TCP is that its non-existent ‘acknowledgment’ supports a continuous packet stream. Since a TCP connection always acknowledges a set of packets (whether or not the connection is totally reliable), retransmission must occur for every negative acknowledgment where a data packet has been lost. 
But because UDP avoids the unnecessary overheads of TCP transport, it’s incredibly efficient in terms of bandwidth, and much less demanding of poor-performing networks, as well.

__Do you want to Kick-start a career in Cyber Security and want to know how hackers hack in real life ☠️☠️__

Join Now and support  !!!
250+ Members already Joined

https://t.me/infosecbugbounty
Basic SQL Programming
Tags: webdev, database, sql, mysql
Published: 2021-06-26 15:21:42

![MySQL Database Programming](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2a2zj7x6v5rlb5ter8ru.jpg)
Interacting with Relational Database Management Systems (RDBMSs) is a necessary skill for everyone who want to learn about web development, software development, data analysis...

To make it easier for entry-level developers to get familiar with SQL language in general and MySQL in particular, I prepared a brief summary of knowledge related to MySQL database programming at:

<https://github.com/linhtch90/learn-MySQL-database-programming>

This summary includes 10 main sections covering topics:

1. Introduction to Relational Database Management Systems (RDMS)
2. Understanding Data Types
3. Indexing and Data Integrity
4. Querying a Single Table
5. Querying Multiple Tables
6. Modifying Data and Table Structures
7. Transactions
8. Grouping and Summarizing Data
9. Advanced Querying Techniques
10. Programmable Objects

I hope this could be a good reference material to build up a solid background for anyone who want to start learning database programming.

If you think this material is useful, please give it a Github star for my effort.
LocalStorage: Clearing the clutter...
Tags: webdev
Published: 2021-06-26 14:04:00

The two great tools for saving key/value pairs locally are local storage and session storage. Today we will look into the theory and practical code and make it simplified enough for everyone to understand.
### 1. Understanding localStorage vs sessionStorage
- SessionStorage, the data, is persisted only until the window or tab is closed.
- LocalStorage, the data is persisted until the user manually clears the browser cache or until your web app clears the data

### 2. Creating, Reading, and Updating Entries
Create entries for the localStorage object by using the **setItem()** method.
```javascript
let key = 'Item 1';
localStorage.setItem(key, 'Value');
```
To read entries, use the **getItem()**
```javascript
let myItem = localStorage.getItem(key);
```
Updating an entry is done with the **setItem()**
```javascript
localStorage.setItem(key, 'New Value');
```
###  3. Deleting and Clearing Entries

Delete an entry with the the removeItem() method

```jsx
localStorage.removeItem(key);
```

To clear everything that’s stored in localStorage, can be done with the clear() method

```jsx
localStorage.clear();
```

###  4. Storing Non-String values with JSON

LocalStorage can only store string values. If you want to store objects or arrays as values in localStorage, you can use JSON.stringify() to convert them into strings.

```jsx
let myObj = { name: 'Skip', breed: 'Labrador' };
localStorage.setItem(key, JSON.stringify(myObj));
```

Although myObj is an object, JSON.stringify(myObj) converts it into a string. So myObj is now a valid localStorage value.

To read and return stringified values, use the JSON.parse() method. The JSON.parse() method takes JSON strings and converts them into JavaScript objects.

```jsx
let item = JSON.parse(localStorage.getItem(key));
```

###  5. Checking for Items

Like to test for the presence of items in the localStorage. You can use if statements to check if localStorage is holding items or if it is empty.

```jsx
if (localStorage.length > 0) {
  // ...
}
```

###  6. Iterating Over Items

The localStorage and sessionStorage objects don’t support the forEach method. To iterate over the items in localStorage, use a for loop

```jsx
for (let i = 0; i < localStorage.length; i++){
  let key = localStorage.key(i);
  let value = localStorage.getItem(key);
  console.log(`Key: ${key} | Value: ${value}`);
}
```

### 7. Checking for Support

You can test for localStorage support by checking if it’s available on the window object using an if statement:

```jsx
if (window.localStorage) {
  // localStorage supported
}
```

## Conclusion

We can use the `localStorage` or `sessionStorage` objects to store key/value pairs. There are methods that enable you to interact with the items within `localStorage`. With this tutorial, you created, removed, and updated entries within `localStorage`. You also converted array and object data into strings and back using JSON methods.

At times, it may be best to use cookies instead of `localStorage` or `session`.
Laravel 8.x Soft Delete Example Tutorial
Tags: laravel
Published: 2021-06-26 13:49:20

Here, i will show you laravel restore deleted records. This article will give you simple example of laravel get soft deleted records. This post will give you simple example of how to restore soft deleted data in laravel. if you have question about how to restore deleted records in laravel then i will give simple example with solution.

In this example, i will show you step by step how to restore soft deleted data in laravel. we will add soft delete in users table, then we will list that users where you can delete that users as well. we will also add one more button where you can view all deleted records. we will also add restore and restore all buttons where you can restore deleted items.

[Laravel 8.x Soft Delete Example Tutorial](https://www.codecheef.org/article/learn-how-to-use-soft-delete-in-laravel-6)
Create Recycle Bin in Laravel Using Eloquent Soft Delete
Tags: laravel
Published: 2021-06-26 13:48:04

Hi Dev,

Here, i will show you laravel restore deleted records. This article will give you simple example of laravel get soft deleted records. This post will give you simple example of how to restore soft deleted data in laravel. if you have question about how to restore deleted records in laravel then i will give simple example with solution.

In this example, i will show you step by step how to restore soft deleted data in laravel. we will add soft delete in users table, then we will list that users where you can delete that users as well. we will also add one more button where you can view all deleted records. we will also add restore and restore all buttons where you can restore deleted items.

so let's follow bellow step and get done like as bellow screenshot. you can also use this example with laravel 6, laravel 7 and laravel 8 version.
[Create Recycle Bin in Laravel Using Eloquent Soft Delete](https://www.codecheef.org/article/create-recycle-bin-in-laravel-using-eloquent-soft-delete)
Developer event announcement!!!!
Tags: news, eventsinyourcity, eventdriven, beginners
Published: 2021-06-26 13:39:01

Crio #IBelieveinDoing- Remote Working Tools edition is just a few days away!

Here's an excellent opportunity for the developer to take up the front seat and innovate for the remote working environment. 

Build open-source apps/extensions that make Work from Home more fun and exciting.

And stand a chance to win Sennheiser Wireless Noise Cancellation Headphones and much more by completing the exciting challenges.

Block your seat and get ready to embark on this one-of-kind exciting journey. 

Head over to the link: https://shorten.one/L21Xn to register 

Application Deadline: Jun 30, 11:59 PM(IST)

#criodo #learnbydoing #apps #extensions #workfromhometools #workfromhomelife #workfromhomeproblems #workfromhomehelp #remoteworkinnglife #remoteworkingjobs #computerscienceprojects #techprojects #projectbasedlearning #upskilling #criochallenges #experentiallearning