teleren/devto huggingface dataset:
Introduction and 1.0 - Hello World
Tags: rust, codenewbie, tutorial, motivation
Published: 2021-02-25 18:33:45

## Introduction

[Rust By Example - Introduction](https://doc.rust-lang.org/stable/rust-by-example/index.html)

On the first page of Rust By Example, we're greeted with this statement:

> Rust is a modern systems programming language focusing on safety, speed, and concurrency.

Awesome. But what does this mean?

Over the course of completing these exercises we'll explore how Rust language prioritizes and implements these qualities.

## Hello World (Chapter 1.0)

[Rust By Example - Hello World!](https://doc.rust-lang.org/rust-by-example/hello.html)

![Screen_Shot_2021-02-24_at_6.47.23_PM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/83jt6o211davgnerp1og.png)



It's tradition to create a "Hello World" program whenever you learn a new coding language. But before we do, let's take a look at the top right of our in browser coding environment.

![Screen_Shot_2021-02-24_at_6.47.42_PM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wb2xuamt4e91uoulze1f.png) 

- We can reset the code to it's original state by clicking the leftmost button
- We can copy all of the code by clicking the middle button
- We can run the code by clicking the rightmost button

If we click run we should see `Hello World!` below

The `println!` `macro` prints our text to the console. A `macro` in Rust isn't a function call although it may look like one. Instead, the contents of the `macro` expand into source code. That way the body of the macro explicitly writes code which is eventually executed. This is a form of meta programming. We are writing code (`println!`) that generates other code (code we put inside of `println!`). We'll look at `macros` more in a future post! 

Lastly, we are given instructions on how to create a Rust binary in our local dev environment. Follow the instructions and you will have created an executable binary which will print out "Hello World!". An executable binary is a machine code version of any code we write. In this case, it's our "Hello World!" code! 

We've completed our Hello World example! 

In the next post, we'll cover the next chapter, 1.1 - Comments
Implicit Conversion JavaScript
Tags: javascript
Published: 2021-02-25 18:20:48

res = '6' + 2  =  output : '62' ( String + Number = String )
res = '6' + true = output : '6true' (string + boolean = string boolean )
res = '6' + null = output : '6null' (String + null = String null)
res = null + '6' = output : 'null6' (null + String = null String)
res = null + null = output : 0 ( null + null = 0)

res = '6' - '2' = output : 4 (String - String = Number)
res = '6' - 2 = output : 4 (String - Number = Number )
res = '6' * 2 = output : 8 (String * Number = Number )
res = '4' / 2 = output : 2 (String / Number = Number )

res = 'b' + 'a' + + 'a' + 'a' =  output : baNaNa 
     (String + String + NaN + String + String)
res = ++ 'a' =  output : NaN (NaN + String = NaN)

Boolean ('Hello') => true 
Boolean (NaN) => False 
Boolean ('NaN') => True
Boolean (null) => False
Customer Feedback - Building SaaS #82
Tags: python, django, templates
Published: 2021-02-25 18:18:19

{% youtube PAZq0rcKP7E %}

In this episode, I worked on feedback from my primary customer. We fixed a couple of issues that she reported, then moved on to more of the onboarding flow.

Before getting to the code, we chatted about ways to learn to code. I linked to a popular book, Automate the Boring Stuff with Python, and some good web tutorials for learning Django.

The first bit of customer feedback that I worked on was to add a back link from a course details to get a user back to the grade level that holds the course. I added the appropriate anchor tag in the destination template. We tested the URL manually to confirm that a properly crafted link would behave as we expect. Then I switched to the course detail page, found the spot in the UI that needed the new link, and added the link back to the anchor tag that I added in the other template.

I took a break to have a discussion on a question from the chat about JavaScript versus Python. I tried to compare the languages fairly, even though I have an obvious bias.

After that break, I moved to my next customer issue. The customer wanted the ability to print out one of the page, but the page wasn't designed for printing so the output looked terrible. I went into the template and added some CSS classes to improve the print layout of the page.

For my final change for the stream, we returned to the onboarding work. I need to add some polish to filling in pages when there is no data to guide users on what to create and why. I worked on my main page and added some template work for the scenario when the user has no students. I completed the template to finish off the stream.
The future of HTTP: What is IPFS?
Tags: devjournal, ipfs, blockchain
Published: 2021-02-25 17:58:16

---
title: The future of HTTP: What is IPFS? 
published: true
tags: ["devjournal", "IPFS", "blockchain"]
---


**WARNING**: This post was written in nano; readers descretion is advised.


## What is IPFS? 
`IPFS` is an internet protocol just like `HTTP` built for the web. The key differences is that 
`IPFS` is a hybrid between blockchain and peer to peer networks (p2p). 

You can think of IPFS as the giant web version of Bit-torrent and blockchain comnbined. Bit-torrent is 
the underlaying technology on how the files are distributed, while the blockchain is how the files are 
managed. At the moment writing this, security with IPFS is still at alpha stage, 
meaning; as a developer you have to do your own pre-encryption before sending things off into the orbit.

I have to stress the point that IPFS isn't 'decentralized' at it's core. It is distributed, even though it 
shares the same principles as a decentralized network. If we say IPFS is decentralized, it would mean 
each peer has a copy of the entire network, while that is possible it's not true for every peer on the network. 

Therefore: at best it's decentralized, at worst, it's simply a distributed network.

In summary; the main difference between HTTP and IPFS is that HTTP serves files while IPFS distributes files 
to whomever wants a piece of ownership. When a user requests for a file on HTTP they are temporarily gaining
ownership to the file; if the network shuts off, they can't no longer access that file. Whereas IPFS; if you request 
a file, you are served the original copy of that file from the nearest node that lastly had access to that file.

At the end, on IPFS you get to own the file even if it isn't yours, because it was cryptographically singed by the original 
owner using a hash of the content on the file and the node's private key. On HTTP, you are just another peer asking to 
borrow services for the moment while the network remains online.

In theory: IPFS has great redundancy at the cost of latency, HTTP has low latency at the cost of redundancy. What does that all mean? 

It means, HTTPS is good for **realtime** services like checking flight times and streaming music. On the other hand 
IPFS is great at fool-proofing files, digital content ownership and giving power back to the user. Hence why it's blockchain 
based.





TLDR; IPFS is a giant bit-torrent made for the web.
How do you test a design system?
Tags: discuss, css, javascript, healthydebate
Published: 2021-02-25 17:52:17

I've inherited a component library that I'm bringing back to life.

In the past I've worked on React component libraries and used tools like [Storybook](https://storybook.js.org/) to develop them. Testing these is pretty easy - I tend to use mostly [react-testing-library](https://testing-library.com/docs/react-testing-library/intro/) and [jest](https://jestjs.io/).

But this particular library is different—each component is:
- a **scss** file for styling
- optionally, some **javascript**
- a **markdown** file that combines written guidance for using the component with code samples and live previews

It's not that different from the [GOV.UK design system](https://design-system.service.gov.uk/).

Testing the javascript parts is easy enough, but it's only a small part of the overall library.

How do you go about testing something like this in a robust way?
Which exactly are your options to get a marriage officiant?
Tags: webdev, webperf, weeklyretro
Published: 2021-02-25 17:44:11

If you're engaged and are currently thinking about finding your ideal wedding place congratulations! It's wonderful that you're researching the possibilities that are available for your requirements. Not only does one select your place, blossoms and music however, in addition you have a say who conducts that the core of one's own day, your own ceremony.

Keep in mind that whenever you're engaged and getting married in Scotland, different rules apply this advice identifies to places from England, Wales and Northern Ireland.

Which exactly are your options to get a marriage officiant?

Your marriage ceremony may be run by a a Celebrant.

Why not some places offer me a selection?

Some places receive their reservations via the regional Register Office and it's consequently easier for them never to give an alternate. Still another and much more likely explanation is they could well not be knowledgeable about this part of a Celebrant.
http://www.foreveryoursweddings.com.au/
is it that hard to set a simple authentication process with firebase ?
Tags: help
Published: 2021-02-25 17:38:28

okay i know I'm an absolute beginner as a react native dev but that doesn't  make spending 3 days working on setting up a sign up and login processes normal  !!!! 
i tried working with https://rnfirebase.io/
and other youtube and medium articles but nothing worked 😥
anyone here to help that would be very appreciated and thanks .
Day 12
Tags: 100daysofcode
Published: 2021-02-25 17:23:32

Day 12/100 of #100DaysOfCode

Incrementing Counter | Smart Brain App Deployment On Heroku

Hours coded: 1.2
Lines of code: 102
Keystrokes: 1441


1. "Incrementing Counter" was part of "50 Projects in 50 Days" Udemy Course.
2."Smart Brain App" part of "The Complete Web Developer in 2021: Zero to Mastery" Udemy Course.

via @software_hq
's #vscode extension
JavaScript - remove duplicates from array
Tags: react, javascript, webdev, programming
Published: 2021-02-25 17:18:44

Hello Coders! 👋 😊

In this short article, I would like to show you how to remove duplicated items from an array in JavaScript.

__Before we start__, I would highly recommend you to check out __runnable example__ for the solution on our website:
[JavaScript - remove duplicates from array](https://dirask.com/posts/pzrbop)

##Quick solution
In this quick solution, I've used the built-in `filter()` function which has been added to improve functional programming.

If an index with the same value is found on another position, it won't be saved (in other words, it saves only those that occurred for the first time, it does not take into account the next ones).

Practical example:
```javascript
const array = [1, 2, 3, 1, 1, 2, 2, 3, 3];
const result = array.filter((item, index, array) => array.indexOf(item) === index);

console.log(JSON.stringify(result)); // [1,2,3]
```
You can run this example [here](https://dirask.com/posts/pzrbop)

##Iterative example
In this approach, I've used a `blocker` object that represents a map of elements that have already occurred. The `for` loop iterates only once over all elements adding to this map and if an element has already appeared, it won't add it again.

This solution is more optimal because it has lower computational complexity. 📉✅

Practical example:
```javascript
const removeDuplicates = (array) => {
  	const result = [];
	const blocker = {}; // prevents against item duplication
  	for (const item of array) {
    	if (blocker.hasOwnProperty(item)) {
        	continue;
        }
      	blocker[item] = true;
      	result.push(item);
    }
  	return result;
};

// Usage example:

const array = [1, 2, 3, 1, 1, 2, 2, 3, 3];
const uniqueItems = removeDuplicates(array);

console.log(JSON.stringify(uniqueItems)); // [1,2,3]
```
You can run this example [here](https://dirask.com/posts/pzrbop)

Thank you for your time! I hope you like the solution. 😊
If you have any questions, drop a comment below. 💬

See you in upcoming posts! 🔥🔜
_____________
## Write to us! ✉
If you have any problem to solve or questions that no one can answer related to a React or JavaScript topic, or you're looking for a mentoring write to us on [dirask.com -> Questions](https://dirask.com/questions)
An Introduction to react hooks rules
Tags: react, javascript, webdev, redux
Published: 2021-02-25 17:14:20

Through this article i will try to explain react hooks in beginner friendly manner hope you enjoy and learn through this article. 

Let's try to understand in what ways you can use hooks 


# Rules of Hooks


# Only use hook at the top level

Never call hooks inside 
>* **1 .loops** 
>* **2 .conditions**
>* **3 .nested functions**

On contrary always use at the top level of your react function. This is necessary to ensure that Hooks are called in the same order each time a component renders. That’s what allows React to correctly preserve the state of Hooks between multiple **useState and useEffect** calls.

### Only hooks from react function

1. ✅ Call Hooks from React function components.
2. ✅ Call Hooks from custom Hooks

## Now lets see some example of what we discussed above

```jsx
function Form() {
  // 1. Use the name state variable
  const [name, setName] = useState('Mary');

  // 2. Use an effect for persisting the form
  useEffect(function persistForm() {
    localStorage.setItem('formData', name);
  });

  // 3. Use the surname state variable
  const [surname, setSurname] = useState('Poppins');

  // 4. Use an effect for updating the title
  useEffect(function updateTitle() {
    document.title = name + ' ' + surname;
  });

  // ...
}
```

Order of execution 

```jsx
useState('Mary')           // 1. Initialize the name state variable with 'Mary'
useEffect(persistForm)     // 2. Add an effect for persisting the form
useState('Poppins')        // 3. Initialize the surname state variable with 'Poppins'
useEffect(updateTitle)     // 4. Add an effect for updating the title
```

Example of what we cannot do

```jsx
  // 🔴 We're breaking the first rule by using a Hook in a condition
  if (name !== '') {
    useEffect(function persistForm() {
      localStorage.setItem('formData', name);
    });
  }

//
useState('Mary')           // 1. Read the name state variable (argument is ignored)
// useEffect(persistForm)  // 🔴 This Hook was skipped!
useState('Poppins')        // 🔴 2 (but was 3). Fail to read the surname state variable
useEffect(updateTitle)     // 🔴 3 (but was 4). Fail to replace the effect
```

Instead this is what we can do

```
  useEffect(function persistForm() {
    // 👍 We're not breaking the first rule anymore
    if (name !== '') {
      localStorage.setItem('formData', name);
    }
  });
```

#Conclusion

I will be writing articles explaining each hooks  provided by react in upcoming articles please follow to stay connected.

For more detailed explanation [please visit](https://reactjs.org/docs/hooks-rules.html)
Tailwind CSS Buttons UI Kit
Tags: css, html, tailwindcss, webdev
Published: 2021-02-25 17:11:01

Tailwind CSS is a modern CSS framework that is for rapid UI development with awesome component and utility classes. So here we made simple Buttons UI Kit in Tailwind CSS with the help of utility classes.

In this kit, we only used the background color class which is already given in these beautiful CSS frameworks. Also, we used hover classes to make buttons more attractive and user-friendly. We also used rounded buttons and 3d buttons to make this UI kit more useful. Here we not modify any single class just we used background color utility classes. Also, you can modify and make your own class with custom colors.

Npm:-  npm i tailwindcssbuttonsuikits

Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source Code] (https://w3hubs.com/tailwind-css-buttons-ui-kit/)
Better ways to get started into the world of programming
Tags: career, programming, productivity, beginners
Published: 2021-02-25 16:46:41

👋🏻 Hello World!

I would like to share few important points that one should keep in mind when he/she starts learning how to code.

1. Choose your living environment so that you can focus on building healthy habits/routine. Most importantly, Do yoga and meditation to silence your chattering mind.
2. Find Peer-groups, Mentor support(online or offline) and a Feedback mechanism that helps you on the journey.
3. Keep an eye on Time and Money that you are investing, Try making weekly commitments to achieve your goals. 
4. Start Understanding Problems to the core and Building Solutions step by step using the language you love.
5. Look for the best online *free* resources when you start.
For eg(for JavaScript): FreeCodeCamp.org, JavaScript.info, MDN JavaScript etc
6. Do Recap, Write sensible code everyday, Git it.
7. Blog, Tweet and Dev.to your progress and concepts that you learn.. More you share, more you will come to know. 
8. Teach your peers and Learn from them.

Please add to the comment section, if I have missed anything.. 😊 and help the noobs!

hackerfarm 
with ❤️ from 🇮🇳
yet another form validation package for Vue

Tags: vue
Published: 2021-02-25 16:40:44

Hello guys,The vue input validator is a highly extensible & customizable input validator for Vue 2. You can create input validators only with the help of a single directive without the need for additional settings. Add this directive to your input and you are done!

- You are not limited to certain validation rules; with the help of the vue input validator you can create custom validation rules with the help of regex or functions.


- This plugin has multiple global variables to interact with your inputs and validation rules across your app.


- Also, you are not limited to a single rule for each input like many other validation libraries. You can chain your validations and this plugin will combine and use them to validate your input.


There are many more features that you can check out in the documentation.

Lightweight (4kb gzipped) ☁️

Simple API 🎈

Customizable 🧰

Rich Support for HTTP async & ajax validation 👊

Easy to use ✔️

Mobile-friendly 📱

TypeScript support 🔒

Validation chain 🔗

Vue3 support (soon)

if you are interested in this package you check these links below


[Github repository](https://github.com/mediv0/vue-input-validator) | [live demo](https://nphgg.csb.app/) | [codesandbox](https://codesandbox.io/s/vue-inuput-validator-nphgg?file=/src/App.vue)

thank you for reading
3 Good Habits For A Happy Life
Tags: productivity
Published: 2021-02-25 16:40:29

Habits shapes our life. They can work for us or can work against us. If  you wanna be successful in your life change your habits, live your life with such habits which makes you a person you want to be, which help you in getting what you want in your life. Our future is hidden in our daily habits they can break us or make us. Always try to stay out of your comfort zone otherwise you are developing a habit of laziness within yourself. Do something everyday which takes you towards your goals and dreams.

### Habit 1 : Rise Early
It's best to have failure happen early in life. It wakes up the phoenix bird in you so you rise from the ashes. - Anne Baxter
The morning hours are self improvement hours in which we can improve ourselves daily. The best thing you can do in morning hours is reading, exercising & meditation which help you in becoming a better you. The morning hours are miracle hours which you will realize in your life when you start getting up early in the morning. The people who get up early in the morning are the ones who are crazy about their goals and dreams. If you don't have a reason to get up early give yourself a strong reason to wake up early morning. The people who have a deep sense of purpose to live they feel excited about their morning hours when you live your life with purpose you feel meaningful and excited. 

### Habit 2 : Stay out of your Comfort zone
The hardest thing to do is leaving your comfort zone. But you have to let go of the life you are familiar with and take the risk to live the life you dream about. - T. Arigo
Do something everyday which makes you uncomfortable. Always remember you will never grow in your comfort zone you will grows only when you leave your comfort zone, when you do something which makes you uncomfortable. The comfort zone is place where you feel lazy feel it may makes you feel good in the present but it will never grows you, we will only grows in life when we do something from out of our comfort zone. We only grows in life when we develop the habit of not staying in comfort zone. Your comfort zone may make you feel relaxed but it will never makes you  a better version of you. 

### Habit 3 : Exercising
Do something today that your future self will thank you for. - Unknown
The exercise is important part of our life. If you want to be healthy and fit person you should exercise daily whether its a push or running. Doing a daily exercise prevent us from disease. Exercise fulfills the needs of the muscle that is not getting the physical activity to [present days lifestyle](https://ayushantiwal.com/the-shadow-lines-amitav-ghosh-summary-amitav-ghosh/). I believe the people who does not love themselves are the ones who don't exercise.
How to Improve your Programming Skills
Tags: debugging, programming, debug, career
Published: 2021-02-25 15:04:50

---
title: How to Improve your Programming Skills
published: true
description: 
tags: debugging, programming, debug,career 
//cover_image: https://direct_url_to_image.jpg
---
Whether you are a beginner or expert software developer, you probably find bugs in your code.

‌‌We all have bugs in our applications because no one knows everything about coding, and we sometimes make mistakes. After all, there is no way to stop being human.

‌‌Or can you show me how to develop a superpower? Ah alright then, never mind. :)

‌‌We can only study ourselves, our tools, and our bugs to find solutions that can help us be more efficient in reducing the bugs we create.

# How can we deal with bugs?

There are three major ways to deal with bugs:

***Prebugging***: the reduction of bugs before they're created

***Debugging***: identifying, fixing, and removing bugs once you find them

***Post-debugging***: expecting unexpected or unknown bugs
Let's look at each one in detail.

Check it here:

[How to Improve your Debugging Skills](https://www.freecodecamp.org/news/how-to-improve-your-debugging-skills)
should create custom AUTH_USER_MODEL after making a custom user model
Tags: devops
Published: 2021-02-25 16:24:57

I followed [this](https://www.google.com/search?q=create+costum+AUTH_USER_MODEL&rlz=1C5CHFA_enIQ865IQ865&oq=create+costum+AUTH_USER_MODEL&aqs=chrome..69i57.7967j0j7&sourceid=chrome&ie=UTF-8) to create a Costume user model.
Before, I was have a field `added_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)` in a model for books store thta have title and review and added_by field. Now, after I created a costume user the apps start having trubble with using `settings.AUTH_USER_MODEL` should I use somthing els. Also, I deleted my migrations after I created the CostumUser model, but I'm still having the same error that says ` column myApp_BooksModel.added_by_id does not exist` 

[more details](https://stackoverflow.com/questions/66370751/how-to-use-the-costumuser-in-modles-py-and-views-py-applications)