teleren/devto huggingface dataset:
5 Things I learned this year as a Developer
Tags: webdev, career, discuss, learning
Published: 2021-12-31 15:52:28


  
2021 was a hell of a year and I think everyone would agree with that. But I think we can all reflect on all that has happened and see that we have grown and learned, from others and from ourselves.

Here's a little rundown of the things I've learned this year, as a developer.

## Believe In Yourself

No you are not bad at programming, and yes **you belong here**. Don't let people tell you otherwise and bring you down. You do what you love, you make money from your passion, you wake up in the morning full of motivation and that's the only thing that **matters**.

## Not Knowing is Good, You Have Room For Improvement.

You can't know everything, technology evolves too fast and you are only **human**. Learn at your own pace, sometimes you will be motivated and sometimes not. The goal is not to be the best, to be perfect all the time. The goal is to have **fun**, otherwise you won't last in the long run.

## There is Always Someone Better Than You.

Yes, you are just a junior developer, people have been developing websites for decades now. Instead of thinking "_I'm not as good as him/her, so that means I'm rubbish_", say instead "_Hey, this person has a lot of knowledge, maybe I can learn a thing or two from them_".

Your career will be **brighter**, and your self-esteem will be **improved**.

## Ask For Help !

Asking for help is not a weakness. It doesn't mean that you are bad, that you don't know what you are doing, people won't laugh at you. 

On the contrary, people will be happy to **help** you and **congratulate** you for reaching out, because getting stuck for hours on a bug because you are too afraid to ask for help, **that's** the wrong thing to do.

## Taking Breaks Solves Problems.

Just because you stare at your screen for hours on end doesn't mean you'll solve anything. Get up, get some fresh air, play with your pet, go for a coffee or a glass of water. Or if you can, stop for the day, and the next morning the solution will be obvious.
 
_Things always look better in the morning._

What about you, what are the things you have learned in 2021?

---


Originally posted on my [blog](https://blog.ludivineachouri.com/). Check out my [instagram ](https://www.instagram.com/la.dev/)account to learn more about web development.

Photo by <a href="https://unsplash.com/@markuswinkler?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Markus Winkler</a> on <a href="https://unsplash.com/s/photos/2021?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
HTML Tricks Nobody Tells You
Tags: html, webdev, beginners, productivity
Published: 2021-12-31 15:22:29

## 1. Accept

The **accept**attribute is used to specify the type of files the user can upload. In following example, user can upload or use only `.jpg` or `.raw` files

```html
<label>Accept File<input type="file" accepts= “.jpg, .raw" /></label>
```

## 2. Spellcheck

The **spellcheck** is used to check spelling and grammar on html elements such as input.

```html
<p spellchecks="true">Hello - DEV Community!</p>
```

## 3. Translate

The **translate** attribute is use to tell the browser whether the content is to be translate or not. This can be translated to any language.

```html
<p translates="no">Hello World!</p>
```

## 4. Download

The **download** attribute is to instruct the browser to download a URL instead of navigating or the download attribute specifics that the target (the file specified in her attribute) will be downloaded when a user click on the hyperlink.

```html
<a herf=" " download>Download</a>
```

## 5. Poster

The **poster** attribute to specify an image to be shown while the video is downloading.

```html
<video src=" " poster="image.png"></video>
```

---

### Let's connect 💜 You can follow me on

[Twitter](https://twitter.com/MrDanishSaleem), [Instagram](https://www.instagram.com/mrdanishsaleem/) & [GitHub](https://github.com/mrdanishsaleem/)

If you like this post. Kindly support me by [Buying Me a Coffee](https://www.buymeacoffee.com/mrdanishsaleem)

![Buy Me a Coffee](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fefzbxbnwww7tkght33w.png)
How to style console.log();
Tags: javascript, webdev, react, tutorial
Published: 2021-12-31 15:07:57

I guess that your first code of JS was 
```js
console.log('Hello World')
```
even, mine was the same 🤏
![same](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ilui6ee59n6vv17trqz.png)

So, have you wondered about styling it? 🤔

nevermind...

I am going to take the Discord warning message into account as an example
### Discord Console Warning Message
![Discord warning msg](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qz0lygc4zz8st6nfiv9m.png)
- If you have ever opened **developer tools** in Discord, you will find this warning msg from Discord... Check it out right now if you haven't (and listennn, don't paste any malicious code there)
- So let's recreate the same warning message
- Write some necessary HTML to link a JS file to it
- Create a JS file and name it whatever you want
- Now follow the steps below
```js
console.log(text, styling)
```
When you style there will be two things you need to take note of.
- **text** - Every text message starts with a prefix - `%c`; and it is a very important thing and without it, styling will not apply to the text
- **styling** - Simple CSS

Let's head up to the code,
```js
console.log('%cHold Up', 'color: #404EED; font-size: 60px; font-weight: bold;-webkit-text-stroke: 1px black;');
console.log("%cIf someone told you to copy/paste something here you have an 11/10 chance you're being scammed", "color: black; font-size: 18px;")
console.log("%cPasting anything in here could give attackers access to your Discord account.", "color: red; font-size: 18px; font-weight: bold;")
```
{% codepen https://codepen.io/codewithsnowbit/pen/mdBxVqb default-tab=js,result %}
 
So, found this simple? If not you can dive into comments to ask questions...

Why not share your styling to the **console.log()**, I am very excited to see yours

Make sure to subscribe to my [YouTube Channel](https://www.youtube.com/channel/UCNTKqF1vhFYX_v0ERnUa1RQ?view_as=subscriber&sub_confirmation=1) I regularly upload some amazing web development videos...

Your support gives me motivation 💪
How I center a div
Tags: javascript, beginners, html, tutorial
Published: 2021-12-31 14:45:06

This is one of the most commonly asked questions, so here's how I do it.

     HTML: 
     <div class='circle'></div>

     CSS:
     .circle{
     height: 24px;
     width: 24px;
     border-radius: 50%;
     background: #618ed6;
     justify-content: center; 
          (justify's content in center of page)
     text-align: center;
          (any text will be aligned to center of page)
     margin: 0 auto;
          (creates an equal amount of margin on each side, centering the object)
     padding: 0;
          (I do this if necessary to help center the object)
         }
Design tip from Apple's Website
Tags: ux, javascript, webdev, beginners
Published: 2021-12-31 14:40:06

Designing pages can be tricky, but here's some things I've learned from Apple's website.

**1: Use Contrast.** If you look at their product description, you'll notice they'll have an initial sentence in one color, and a secondary sentence in other. To me, using this slight contrast in color helps to give more information to the user, while also creating a clean layout. Because everything is not in one color, it's easier for someone to take in the information.

**1: Use Cards.** When you go to their store page, do you notice how they have information on individual "cards", and you can swipe left and right to learn more? Why didn't they just put everything on one page? To me, they did this to reduce the cognitive load, or in other words, make it easier for the visitor to understand what's going on. 

One thing I've learned about Apple is that they make it easy for people to buy things from their website. Using **contrast** and **cards** are just two ways I've seen that they've used to create a good user experience and clean web page.
Caesar's Cipher (FreeCode Camp Solution)
Tags: javascript, programming, algorithms, beginners
Published: 2021-12-31 14:32:42

I recently came across a free code camp problem while solving JavaScript Algorithms and Data Structures certification.

**Problem Statement **: 

> One of the simplest and most widely known ciphers is a Caesar cipher, also known as a shift cipher. In a shift cipher the meanings of the letters are shifted by some set amount.

A common modern use is the ROT13 cipher, where the values of the letters are shifted by 13 places. Thus A ↔ N, B ↔ O and so on.

Write a function which takes a ROT13 encoded string as input and returns a decoded string.

All letters will be uppercase. Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on.

Example : rot13("SERR PBQR PNZC") should decode to the string FREE CODE CAMP

**Solution** : 

1. Take an empty array & store the string passed as arguments by using String split method. 
  example : let str = "An Apple"; str.split(''); this will give the result as ['A', 'n', ' ', 'A', 'p', 'p', 'l', 'e'];

2. Iterate the array using for loop

3. Inside the loop , take the ASCII char code of the first index and store it in a variable.

4. Check if the ASCII value lies between 65 and 90 i.e Capital alphabets.

5. If condition is true , check if ASCII value is greater than 77 i.e greater than 'M' , if it is true then subtract 13 from the ascii value , else if it is less than 77 than add 13 to the ascii value.

6. Now we need to replace character at that index with the corresponding new ASCII code obtained from step 5 using splice and String.fromCharCode

7. After the entire loop is completed we need to join the array using the join method.

Check out the final code below.

```
function rot13(str) {
  let charCode = 0;
  let strArr = [];
  strArr = str.split(""); // split the string into array
  for (let i = 0; i < strArr.length; i++) {
    charCode = strArr[i].charCodeAt();
    if (charCode >= 65 && charCode <= 90) {
      if (charCode > 77) {
        charCode = charCode - 13;
      }
      else {
        charCode = charCode + 13;
      }
     
      strArr.splice(i,1,String.fromCharCode(charCode));
    }
  }
  return strArr.join('');
}

rot13("SERR PBQR PNZC");
```

Here is the link for the problem : https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher
Python Complete Roadmap 2022
Tags: python, machinelearning, datascience, programming
Published: 2021-12-31 12:51:19

##Python Complete Roadmap 2022
In this blog we are going to discuss complete roadmap for Python Programming in 2022. I will give you only topics and if you like my post then follow my Blogs. Lets Start:-👇

###[Python Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-python-programming.html)


##New & Trending Topics:👇
[Top 10 Trending Technologies to Learn in 2022](https://codexashish.com/2021/12/top-10-trending-technologies-to-learn.html)
[Top 10 Programming Languages You Must Know In 2022](https://codexashish.com/2021/12/top-10-programming-languages-you-must.html)
[Machine Learning Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-machine-learning.html)

##Complete Roadmap 2022:-👇
[Python Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-python-programming.html)
[Machine Learning Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-machine-learning.html)
[C++ Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-c-programming.html)
[Java Complete Roadmap 2022](https://codexashish.com/2021/12/java-complete-roadmap-2022.html)
[Data Structure Complete Roadmap 2022](https://codexashish.com/2021/12/complete-roadmap-of-data-structure.html)


##Some Laravel Tutorial for developer:👇
[Laravel 8 Interview Questions and Answers in 2022 (Part #1)](https://codexashish.com/2021/12/laravel-8-interview-questions-and.html)
[Laravel 8 Interview Questions and Answers in 2022 (Part #2)](https://codexashish.com/2021/12/laravel-8-interview-questions-and_22.html)
[Advance Laravel 8 Interview Questions and Answers 2022](https://codexashish.com/2021/12/advance-laravel-8-interview-questions.html)
[Everything About Laravel 8 Composer 2022 | Composer in Laravel 8](https://codexashish.com/2021/12/everything-about-laravel-8-composer.html)
[Laravel Jetstream vs Laravel ui  vs Breeze](https://codexashish.com/2021/12/laravel-jetstream-vs-laravel-ui-vs.html)

##Python Concept and Projects:-👇
[10 Best Python Libraries For Machine Learning](https://codexashish.com/2021/12/10-best-python-libraries-for-machine.html)
[Alarm Clock in Python with GUI](https://codexashish.com/2021/07/alarm-clock-in-python-with-gui.html)
[Tic Tac Toe Game Using Pygame in Python](https://codexashish.com/2021/06/tic-tac-toe-game-using-pygame-in-python.html)

**Thankyou for reading my blogs.**
#####My Website:👇
[CodexAshish](https://codexashish.com/)
Just Completed 100 Contributions on GitHub
Tags: github, python, beginners, programming
Published: 2021-12-31 12:24:22

Today at Last Day of 2021. I completed 100 Contributions on GitHub. Most of them are my personal projects and programming practice. 

**I created my GitHub Account in mid of the 2021.** I'm also learning about Git and this is just start of my journey with GitHub.

The fun is that I just completed my **secret repository** and its awesome. Check it out at [here](https://github.com/Muhammad-Ahsan-Rasheed)
2021: Year in Review
Tags: beginners
Published: 2021-12-31 12:12:00

Today's the last day of the year 2021. I joined DEV Community on `Dec 29, 2021`. So, I decided to publish **_2021 Review_** as my **1st post**.
Okay, Let's Start!

## Highlights ✨

> Oct-Dec

- University 🎓 Re-Opening
- GitHub
- UET Career Fair 2021
- Android Seekho Season 1
- GDG Devfest 2021
- Secret 🤫
- DEV Community

## University Opening

The most exciting thing of the year 2021 was University 🎓 reopening. University was reopened after approximately one and a half years. During this span, the classes were online which was so frustrating 😤 for me. Finally, University was reopened on `Oct 13, 2021`.

## GitHub

The next thing I did in the year 2021, I joined GitHub on `Oct 29, 2021` and update all my code work.

> 🔗 Here's my GitHub Account [Link](https://github.com/umairshabbir-83)

![GitHub Joined](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lcimh9bhoaqosiks5a43.png)

## UET Career Fair 2021

The second exciting thing of the year 2021 was UET Career Fair 2021. Which was held on `Nov 18, 2021`.

> UET Career Fair 2021 Flyer

![UET Career Fair 2021 Flyer](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ffsfr4q7cc6nhd03h0ka.jpg)

## Android Seekho Season 1

Android Seekho Season 1 was the event organized for Pakistan Developer Community by `Google`. In this event, `Android Basics in Kotlin` were covered. I also participated in this event and completed all the units of the course.

> Android Basics in Kotlin Completed

![Android Basics in Kotlin Completed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zab6tu7za4hbjw16nrex.png)

The next stage was the quiz. I cleared the quiz and qualified for the Android Seekho Season 1 Swag.

> Quiz Cleared

![Quiz Cleared](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b3qjfdaep3a0svpczwmb.png)

Alhamdulillah! 😇
I received my Android Seekho Season 1 Swag

> Android Seekho Season 1 Swag

![Android Seekho Season 1 Swag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/znh16woph54ecvb7s62s.jpg)

## GDG Devfest 2021

The most important and exciting thing of the year 2021 was `GDG Devfest 2021`. I attended the `Devfest 2021 Lahore` at `The University of Central Punjab, Lahore` on `Dec 18, 2021`.

> Devfest 2021 Lahore

![Devfest 2021 Lahore](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1wtwiuzntkswd8yz4axd.jpeg)

It was a great experience and I also learned a lot of new things about my field.

## DEV Community

Finally, I joined DEV Community on Dec 29, 2021. It was the last thing of the year 2021 I did.

> DEV Community Joined

![DEV Community Joined](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fw08o5uekpiir9cpkvum.png)

## Wrapping up

Overall, The year 2021 was a great year for me. I learned a lot of new things and gained skills. Hope the year 2022 comes with exciting things and opportunities for you and me.

> **Regards: _UMAIR SHABBIR_**
Need A Simple and Powerful Password Manager? Try this!
Tags: opensource, security, dotnet, 100daysofcode
Published: 2021-12-31 11:58:08


Hi Guys,
# I have made a Password Manager
which is written on dotnet and runs wtih local db. So, No Need of Internet!. Tired of remembering passwords, try this out. The name is,

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

I have gone through all password managers most of them are more complex in UI and needs more time to understand but also requires money after certain time of usage, some are limited to storage and some are only online password managers. So, I made a simple and more secure password manager. The same operations that all other password managers do, but in **offline**.

Operations are on Initial Phase, But it functions well, Some of them are given below: 

- SignUp
- SignIn
- Create, Read, Update, Delete Passwords
- Copy Decrypted Passwords For Instant Use
- File Encryption and Decryption
- Update Master Password
- Export User Stored Passwords
- View Decrypted Version of Browser Passwords
- Export Browser Passwords
- Remember User Credentials
- SignOut

It's free and open source so, if you want to modify the code, feel free to do!.

Here's the Link to Github Page - [Mona - Password Manager](https://github.com/AchchuthaRengan/Mona/releases/tag/v1.0.2)
Python Exceptions: try.. except.. else.. finally
Tags: python, programming, beginners, tutorial
Published: 2021-12-31 11:58:00

Python exception handling is the process of identifying and responding to errors in a program. In other words, it is a way to deal with errors that might occur in your program.

In [my latest article on exception handling](https://python.land/deep-dives/python-try-except) at Python Land, you will learn how to handle errors in Python by using the try and except keywords. You’ll also learn how to create custom exceptions.

I'd love to get feedback on the article. I tried my best to structure it in such a way that readers really get to understand how this stuff works. But I'm far from perfect and always trying to improve, so don't hesitate to drop a comment here or on Python Land.

**[Python Try Except: Working With Python Exceptions](https://python.land/deep-dives/python-try-except)**
Happy New Year! (with p5.js)
Tags: p5js, javascript, programming, creative
Published: 2021-12-31 11:35:35

Happy New Years everyone!

Here is a small page I made with p5.js, which has interactive fireworks and a countdown to midnight

[https://ashwins-code.github.io/New-Years-Fireworks/index.html](https://ashwins-code.github.io/New-Years-Fireworks/index.html)

Github repo is [here](https://github.com/ashwins-code/New-Years-Fireworks/tree/gh-pages)
Speech recognition
Tags: machinelearning, nlp, ai
Published: 2021-12-31 10:39:17

###Language model

- A statistical language model is a probability distribution over sequences of words. Given such a sequence, say of length m, it assigns a probability  to the whole sequence.

- The language model provides context to distinguish between words and phrases that sound phonetically similar. For example, in American English, the phrases "recognize speech" and "wreck a nice beach" sound similar, but mean different things.

- Data sparsity is a major problem in building language models. Most possible word sequences are not observed in training. One solution is to make the assumption that the probability of a word only depends on the previous n words. This is known as an n-gram model or unigram model when n = 1. The unigram model is also known as the bag of words model.

## acoustic model:

- An acoustic model is used in automatic speech recognition to represent the relationship between an audio signal and the phonemes or other linguistic units that make up speech. The model is learned from a set of audio recordings and their corresponding transcripts. It is created by taking audio recordings of speech, and their text transcriptions, and using software to create statistical representations of the sounds that make up each word

- Modern speech recognition systems use both an acoustic model and a language model to represent the statistical properties of speech. The acoustic model models the relationship between the audio signal and the phonetic units in the language. The language model is responsible for modeling the word sequences in the language. These two models are combined to get the top-ranked word sequences corresponding to a given audio segment.
How to set on delete and on update cascade in Django?
Published: 2021-12-31 10:30:19

These are my models:

class Customer2(models.Model):
    Customer_Name=models.CharField(max_length=30)
    Customer_Address=models.CharField(max_length=100)
    Customer_Phone=models.IntegerField()
    Customer_Email=models.EmailField(max_length=50)
    class Meta:
    db_table="Customer_Table"

class Product(models.Model):
    Product_Name=models.CharField(max_length=100)
    Quantity=models.FloatField(max_length=100)
    Comming_Date=models.DateField(max_length=15)
    Expire_Date=models.DateField(max_length=15)
    Comming_Price=models.FloatField(max_length=50)
    Picture=models.ImageField(upload_to='Images',blank=True, null=True)

class Sale(models.Model):
    Customer=models.ForeignKey(Customer2, default=1, on_delete=models.CASCADE)
    Product=models.ForeignKey(Product, default=1, on_delete=models.CASCADE)
    Quantity=models.FloatField()
    Price=models.FloatField()
    Date=models.DateTimeField()
    Customer_Name1=models.CharField(max_length=20,default=0)
    Product_Name1=models.CharField(max_length=20,default=0)
    class Meta:
    db_table="Sale_Table"

In the above modules,when I am trying to delete (customer) from customer table it gives me(Do you really want to execute "DELETE FROM customer_table WHERE customer_table.id = 2"?)message, while I already used on delete cascade in customer table,What should I do? I want to set on update and on delete cascade in customer table.