teleren/devto huggingface dataset:
MySQL Installation Error On WSL 1
Published: 2020-10-01 21:31:33

Welcome to my first post on dev.to! My goal is to share my experiences and solutions, hoping it might help someone out there facing similar challenges. As I continue to refine my posts, I appreciate your understanding and patience.

## The Challenge

While setting up MySQL on WSL, I encountered the following error:

```shell
mysqld is running as pid 2657
sleep: cannot read realtime clock: Invalid argument
dpkg: error processing package mysql-server-8.0 (--configure):
 installed mysql-server-8.0 package post-installation script subprocess returned error exit status 1
No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                          dpkg: dependency problems prevent configuration of mysql-server:
 mysql-server depends on mysql-server-8.0; however:
  Package mysql-server-8.0 is not configured yet.

dpkg: error processing package mysql-server (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 mysql-server-8.0
 mysql-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
```

The error is caused by things being not properly installed/set up, so the solution involves basically uninstalling and reinstalling Mysql related packages.

**Step 1**: Begin by purging all related MySQL packages:

```shell
sudo apt-get purge mysql*
sudo apt-get autoremove
sudo apt-get autoclean
sudo apt-get dist-upgrade
```
**Alternative for Step 1** (if the above doesn't work):
```shell
sudo apt purge mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 mysql-server
```

**Step 2**: Update and upgrade your system:
```shell
sudo apt update && sudo apt dist-upgrade && sudo apt autoremove && sudo apt -f install
```

**Step 3**: Reinstall MySQL:
```shell
sudo apt install mysql-server
```

I hope this guide helps you navigate and resolve similar MySQL issues on WSL. Let's continue to learn and share together!
Useful Cheat Sheets For Web Developers And Designers
Tags: javascript, react, css, design
Published: 2020-10-01 20:47:33

# Shortcuts Design
is a small website that lists every shortcut a designer ever wants to know, all designapps in one place and in a simple and clear way.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/y60emj98xcfqn29kiop9.JPG)

https://shortcuts.design/

# Ultimate Flexbox Cheat Sheet
Flexbox is a brand, spankin'new **CSS Layout** module with suprisingly good browser support.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/up0z2j3yolbfzts0315x.JPG)

https://sketchingwithcss.com/

# Web Developers SEO Cheat Sheet
this free and downloadable document covers all of the important **SEO Code** and best practices that are needed by online marketers and developers.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/204lfenzuier9ofx65m8.JPG)

https://moz.com/learn/seo/seo-cheat-sheet

# CSS Grid Cheat Sheet
Another helpful tool for using CSS Grid properties.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/kcp8yuailqhx47b0jtpc.JPG)

https://alialaa.github.io/css-grid-cheat-sheet/

# ReactJS Cheat Sheet
a very useful filterable cheat sheet for react made by michael chan.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/uky7rj00c29o0fjk8z0j.JPG)

https://reactcheatsheet.com/

# Type Terms 
is the perfect tool for designers to learn the basics of typographic terminology.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/i3l1cjtcgy6hrbm1pfl3.JPG)

https://www.supremo.co.uk/typeterms/
The different files of C
Tags: c, explainlikeimfive, beginners, help
Published: 2020-10-01 21:03:03

I'm trying to form a mental model of something that is never truly explained in any post or tutorial.

What is the purpose of the following files:
- `.c`
- `.h`
- `.a`
- `.o`

`.c` now I assume I could write the whole program in this one file but honestly I like making libraries so I guess my functions go somewhere else and are included in. But is that where the `.h` comes in?

As for `.a` and `.o` let's go, tell me more 😁 are there any more of the alphabet I should know?

`.c .h .a .o .s` seems like there a hidden meaning to c programming?
My  journey to Programming 
Tags: javascript, node, codenewbie, webdev
Published: 2020-10-01 20:58:28

I have always been very interested in tech since my teens. Dad wanted me to be a doctor, but I loved computers and disliked shots and bl**d.
I got my first personal PC(I had to be specific) during 2016, at that moment i knew this was my stepping stone towards picking up a tech stack,"programming". I didn't have a guide and I didn't do a good job during my researches, I would just type stuffs like "how to build a calculator" then copy-paste. I thought there was one universal programming language. I made no progress learning and my PC got issues,i left coding for a very long time after that. A year later i got more insight on different programming languages but oops my system was just too bad to be used.
I came across python3 for mobile phones and i  downloaded it and started learning the language. After a month I got admitted into the University, time just wasn't there to code during my first year cuz I needed to gather enough grade points. "oh my,maybe coding isn't for me" I thought. 
First year was over and I was in second year, I decided to try again 😂 !!. This time I stumbled on batch coding. Learnt a lot using a friend's system but the time couldn't just actually work out.
The Corona outbreak was my last attempt,i was bent on using the opportunity to the fullest during the lock down,i got a laptop 💻. 
From April till October 1st which is today's date I learnt:
HTML, CSS, Javascript, Reactjs basics and currently I'm learning node using express(all self taught) ..
School is about to reopen and I'm pretty sure it'll not hold back my learning ,mostly because I'll have lower number of courses next semester..
I have loved coding just as much as my course of study "engineering", that has been drive and will continue to be!! 

Thanks for reading
Introducing Gustavo
Tags: opensource, python
Published: 2020-10-01 20:48:45

I needed to search a file for URLs and generate a report of their status. So I created Gustavo to do the work for me.

**Get-Url-Status (GUS) Text-As-Visual-Output (TAVO)**

Sure, the name might be a little corny, but it makes me happy so I'm sticking with it. I also like to imagine Gus as an old mustachioed plumber that checks all the URL connections in a document... 

Gus can be called from the command line 
```zsh
python gus.py example.html
```
or from the python shell
```zsh
>>> import gus
>>> gus.tavo('example.html')
```
**How does Gus work?**
1. The file at the provided location is opened and the contents are saved as a string.
2. A regular expression matches every instance of HTTP or HTTPS and the results are saved as a list.
3. For each item in the list, an HTTP connection is made - requesting just the header - and the HTTP response code is returned.
4. The returned code corresponds to a status: 2xx is labeled as [GOOD]; 4xx is labeled [WARN]; and everything else defaults to [UNKN].
5. The entire list of URLs, codes and their status are printed to the console and also written to a file.   

I knew I wanted the written output file to be colourized, so I did some research into producing Rich Text Files. There is lots of great info at [www.pindari.com](http://www.pindari.com/rtf1.html) but unfortunately my solution ended up being a little hackier than anticipated.

First I opened TextEdit and created **output.rtf** with four lines of text. Each line was given a different colour (default, grey, green, & red). Then I had python open the file, read the contents and print it all to the console. Next I copied everything up to the first line of text and saved it to a constant. What remained were the lines of text and the colour-codes I needed! I copied those into a function which would append the appropriate code to the URL string depending on the returned HTTP status.
```python
for url in list:
    url = check_nested(url)
    code = check_status_code(url)
    color = r'\cf2' #grey
    status = 'UNKN'
    if code[0] == '2':
      color = r'\cf4' #green
      status = 'GOOD'
    elif code[0] == '4':
      color = r'\cf3' #red
      status = 'WARN'
    checked.append(f"{color} [{code}] [{status}] {url}")
```
No doubt there is a lot of room for future improvement, but overall I'm pretty happy with results so far.
 
If you're at all interested, check out the repo:
{% github slaterslater/gustavo no-readme %}
My #100DOC - Day 35
Tags: 100daysofcode, challenge, log
Published: 2020-10-01 20:36:00

### Day 35: September 30, 2020

#### **Today's Progress**: 
1. **[Redesign of my portfolio](https://github.com/pablohs1986/pablohs1986.github.io)** (1h 30min):<br>I continued to implementing the scrollspy. I'm having trouble doing it.
    
#### **What I learned**: 
* Make a scrollspy with Bootstrap.
* The art of debugging.

#### **Total time**:
1h 30min.
6 Quick Tips to Build Your Blog From Scratch
Tags: react, javascript
Published: 2020-10-01 20:31:04

Are you interested in building your blog from scratch? These quick tips may help:

1. Ship it as a static site. If you don't have to host Node.js/PHP/etc, fewer things can go wrong. You don't want to be paged because your personal blog went down.

2. Instead of depending on Share buttons for Twitter of Facebook, use their share URLs. Because no additional JavaScript will be included on your site, page load times will improve.

3. Leverage Cloudflare Workers if you had a blog before, and you want to change the URL structure. Cloudflare Workers provide extreme flexibility and adding Permanent Redirects with them takes only a few minutes.

Learn more here: https://nemethgergely.com/blog/building-your-blog-from-scratch.
Resume Blog
Tags: blog
Published: 2020-10-01 20:14:34

Let me start of by introducing myself. My name is Rodrigus Mckinney. I was born and raised in Greenville, SC. I served in the United States Army for five years. Then I learn some great leadership skills. I learned to be discipline. This has to be my greatest qualifying characteristic. I have knowledge in adobe products. I currently the CEO and Founder of The Living Restored Media, LLC. I started this company July of 2020. To see this organization flourish is my dream job. I am currently a graphic designer, logo and website designer.
#Trick - Merge a JS array with 1 line of code (not as simple)
Tags: tips, trick, javascript, array
Published: 2020-10-01 20:12:17

Hey **Tricks Hunter** !
Many thanks to your feedback about my last post ! your so awesome !
https://dev.to/simerca/why-you-don-t-use-gitlab-430j

I have worked on a project, we do make an automatic legend on a map based on markers colors.

and the output of all markers colors repeat sometimes in array ex :
```javascript
colors = ['rgb(0,255,0)','rgb(0,255,0)','rgb(0,255,0)','rgb(0,255,0)','rgb(0,0,255)','rgb(0,255,0)']
```

Let me know you, how to merge this array simply with a simple JS function.

```javascript
let array = ['a','a','b','b','c','c'];
let mergedArray = [...new Set(array)];
// output ['a','b','c'];
```

The most important thing is `...` is the new decomposition synthax in JS. If you use this, you set the variable content inside another.

exemple with object:
```javascript
let datas = {
   age:27,
   gender:robot,
}

let users = {
  email:xxx@xxx.com,
  datas:...datas
}

// output :

{
  email:xxx@xxx.com,
  datas:{
    age:27,
    gender:robot,
  }
}
```

So if you combine 
`...` and `new Set()` you do the trick with on line of code ! 
*Cool no ?*
📋✍️ Hand-drawn border animation using clip-path and border-radius
Tags: webdev, css, html, showdev
Published: 2020-10-01 20:02:49

For the same side project I created the [fully-responsive sticky note](https://dev.to/thormeier/fully-responsive-html-css-sticky-note-4okl), I also created a hand-drawn border effect and animation:

{% codepen https://codepen.io/thormeier/pen/poyXepQ %}

The skewing of the border is achieved by using `border-radius`: With the `/` notation, I can make the border look like it was drawn by the stroke of a pen.

The animation was a lot of effort. Using clip-path, I had to create five different polygons (one for each line and one for the content) and combine them, so only the borders are cut out. Using `calc()` and `min()` I can work precisely around  the content and guarantee that no bit of the border is left out, even with larger elements.

(The auto-animation in the CodePen is achieved by using `setInterval` and toggling two classes that do the animation forward and in reverse.)

For good measure, here's my post about the sticky note:

{% post thormeier/fully-responsive-html-css-sticky-note-4okl %}

That's it, have a nice evening!
AzureFunBytes Episode 16 - @Azure Subscriptions with @ExchangeGoddess
Tags: azure, beginners, fundamentals
Published: 2020-10-01 19:52:11

This week we welcome back none other than the Exchange Goddess herself, [Phoummala Schmitt](https://twitter.com/ExchangeGoddess).  

Things in the cloud for the most part eventually cost money.  You're going to have to consider what is spent, how it's spent, and how you can save money long term.  Cloud infrastructure is technical, but it does require a lot of understanding of the payment methods, invoicing profiles, and cost centers for your business.  

Making your business or app work in the cloud requires time and planning when ensuring your spending is done in the most efficient way possible.  Phoummala will help us learn a bit more on how to do that.

{% youtube Rmq1rS6YMoI %}

https://twitch.tv/azurefunbytes
https://twitter.com/azurefunbytes

Join me, ask questions, and learn about Azure!

[Microsoft Learn: Azure Fundamentals](https://docs.microsoft.com/en-us/learn/paths/azure-fundamentals/?WT.mc_id=blog-devto-jagord)
[Microsoft Azure: $200 Free Credit](https://azure.microsoft.com/en-us/free/?WT.mc_id=devto-blog-jagord)
[Azure Cost Management + Billing documentation](https://docs.microsoft.com/azure/cost-management-billing/?WT.mc_id=blog-devto-jagord)
Tutorial: [Create and manage Azure budgets](https://docs.microsoft.com/azure/cost-management-billing/costs/tutorial-acm-create-budgets?WT.mc_id=blog-devto-jagord)
Coding Partners for Startup
Tags: aws, webdev, discuss, php
Published: 2020-10-01 19:40:17

---
title: Coding Partners for Startup
published: true
description: A global scale visioned startup to push,help the entrepreneurs who have the talent, and needs a little push to showcase their outcome.   
tags: aws, webdev, discuss, php
cover_image: https://encrypted-tbn0.gstatic.com/images?q=tbn%3AANd9GcQnBeHzjNjsIiMJ7jHJFjnuV-JCXum0Ew7lCw&usqp=CAU
---

>“Great things in business are never done by one person. They’re done by a team of people.”

Searching for coding partners who would like to be partner for a tech startup to make a platform for the entrepreneurs who have the talent and needs a little push to reach the track they want to pursue. This will balance the community overly rated and underrated.  Start-Up is done only in one direction for now and will expand with time. 

Tools and Technologies :  PHP Laravel, AWS
Area : Streaming, Marketplace
Is artificial intelligence dangerous or not?

Published: 2020-10-01 19:38:21

What do we think about the future, when it comes to AI? Yes, it’s going to change our lives for the better. But do we exactly know how Artificial Intelligence works with people? And does AI remain safe? I’ll try to give a short clear.

AI is smarter than any human on earth and ultimately smarter than all humans on the planet. The theoretical physicist Stephen Halking has warned that AI could spell the end of the human race, but it’s highly unlikely. 

The key danger of AI is not that it’s going to rebel against us if that is going to do exactly what we ask it to do. AI won’t be able to avoid destroying humankind, this is because it will be programmed by humans to pursue misguided human goals.
It’s really easy to give AI the wrong problem to solve and often we don’t realize that until something has gone wrong.

Let’s take the example of Tesla. There was a fatal accident when somebody was using Tesla’s autopilot AI. Instead of using it on the highway like it was designed for, they used it on city streets. And what happened? 

AI didn’t recognize a truck in front of the car. Sure, AI was trained to recognize trucks and pictures but what it looks like happened is the AI was trained to recognize trucks on the highway driving where you would expect to see trucks from behind, not on the side. So when the AI saw the truck, it looks like the AI recognized it as a road sign.

As we see, it’s very difficult to design an AI that can understand what it’s looking at and this is why designing the image recognition in self-driving cars is so hard, AI gets confused.
Due to AI researcher Janelle Shane, when AI isn’t able to solve human problems - like creating an ice-cream or recognizing a picture - cause it doesn’t measure up to real brains.

To be sure, we are going in the right direction with AI, we should ask ourselves for what goal we want to use super intelligence and learn how to cooperate with it to avoid problems and bad consequences. Artificial intelligence is not super competent to know everything, but it helps people to create new inventions.
Day  77
Tags: 100daysofcode
Published: 2020-10-01 19:31:43

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


Finally done with the plurasight angular project. I really tried to have fun with angular but our relationship doesn't seem to be working. I'll just stick to Vue.

_That's it for day 77_
_Let's do this again tomorrow_
Modal Made Easy
Tags: beginners, html, css, javascript
Published: 2020-10-01 19:21:39

I'm back again and sharing showing another feature I learned while working on my profile site; Modals! This is what the finished product will look like: 

{% codepen https://codepen.io/fitzwebdev/pen/jOqjbNr %}

Let's get started with the HTML structure.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/q7spm6gober9mrbbe2hf.png "HTML Setup")

Now we have a simple `button` that is used to activate the modal. We also have the modal container which becomes the actual modal and last, but not least, we have the content that goes inside the modal. 

Now it's given CSS to make it look good.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/msnnt72pk1gkyu07s930.png "CSS Setup")

You can add as much style as you'd like and I encourage you to do so. I've left it clean and simple for the sake of this tutorial, but please showcase your skills and reply with a link.

So, what have we actually done?

The `.modal` class creates the overlay looking background color when it's activated. It needs to be the full width and height of the screen. Next, we are hiding it so it doesn't appear until we want it to. 

For `.the-content` class we simply want to give the actual modal some visual cues and set it to the middle of the screen. 

`.close-button` and `.close-button:hover` gives the user a clear way to close the modal when actions are complete. 

Lastly we need to add the `.active` class. This functionality will be handled by a bit of JavaScript which will be added next. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/wfxf5s6jkgyxnk5aw601.png "JavaScript Setup")

This bit of JavaScript is what makes the modal actually work. 

First we grab the modal, the button and close button and create a custom function that will toggle the `.active` class. 
This allows us to activate the modal when the user clicks the button and hides the modal when the close button is clicked. We can also hide the modal by clicking on the dark background. 

That's it! Now you have a clean and simple modal with a smooth animation while opening and closing. Please comment with a link of your finished product. Thank you for bearing with me as I continue to teach what I've learned so far on my coding journey!
JS: Use Ternary Operator for Cleaner Code (sometimes)
Tags: javascript, beginners, tutorial
Published: 2020-10-01 19:08:58

Even if you're fairly new to the world of Javascript, you've probably written a simple IF/ELSE statement AT LEAST once. While there is nothing wrong with simple IF/ELSE statements, there is a cooler / "cleaner" way to write them in JS that you may not have experienced or used yet. 

🥁🥁 enter Conditional (ternary) operator 🥁🥁

The conditional (ternary) operator allows us to turn this:
```javascript
let age = 19
if (age >= 18){
	console.log("You are an adult")
} else {
	console.log("You are not an adult")
}

// returns "You are an adult"
```
...into this:
```javascript
let age = 19
age >= 18 ? console.log("You are an adult") : console.log("You are not an adult")

// how it works:
// condition ? return this if condition is true : return this if condition is false

// again, returns "You are an adult"
```

According to [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator) the ternary is right associative, meaning that it can be "chained", similar to an  if, else if, else if, else chain. Meaning we ***COULD*** do something like this:

```javascript
function getGrade(grade){
	return (grade >= 90) ? "A"  
				: (grade < 90 && grade >= 80) ? "B"
				: (grade < 80 && grade >= 70) ? "C"
				: (grade < 70 && grade >= 60) ? "D"
				: "F"
}

getGrade(100) // "A"
getGrade(85) // "B"
getGrade(55) // "F"

// which would be equivalent to...

function getGrade(grade){
	if (grade >= 90){
			return "A"
		} 
	else if (grade < 90 && grade >= 80) {
			return "B"
		} 
	else if (grade < 80 && grade >= 70) {
			return "C"
		} 
	else if (grade < 70 && grade >= 60) {
			return "D"
	} 
	else {
				return "F"
		}
}

getGrade(100) // "A"
getGrade(85) // "B"
getGrade(55) // "F"
```
With clean formatting, nesting or chaining the ternary operator ***could*** be a perfectly fine way to write your code in a sleeker / cleaner way, but many could argue and say that the fully written out if / else if / else statement makes your code easier to read, especially in more complicated situations — which is equally, if not more, important than writing sleek code.

Remember...

![https://i.kym-cdn.com/entries/icons/mobile/000/017/572/uncleben.jpg](https://i.kym-cdn.com/entries/icons/mobile/000/017/572/uncleben.jpg)

As always, refer to MDN for more info:
Conditional (ternary) operator: [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Conditional_Operator)

Feel free to reach out on any of my socials for questions, feedback (good and bad), or just to connect / say hello 👋.