teleren/devto huggingface dataset:
Declarative programming?
Tags: programming, beginners
Published: 2021-07-24 00:21:17

## Declarative = **WHAT** you want

- Declarative programming is not coding how to do it, it is a programming method where you code what you want to do

## The opposite

- Declarative ⇔ Imperative
- Imperative = HOW you want

## Analogy

- Getting a cup of coffee
    - Declarative: Just tell: 'Give me a cup of coffee'
    - Imperative: Instruct how to make coffee
- Driving car
    - Declarative: Automatic shift
    - Imperative: Manual shift
![Image 2021-07-24 at 9.20.01 AM](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kavvhf2cdq0km1f4piq2.jpg)
 
https://twitter.com/gethackteam/status/1268892357027663873?s=20

## Resources

- [Imperative vs Declarative Programming - ui.dev](https://ui.dev/imperative-vs-declarative-programming/)
- [宣言的？ Declarative?どういうこと？ - Qiita](https://qiita.com/Hiroyuki_OSAKI/items/f3f88ae535550e95389d)
Tacit knowledge vs explicit knowledge
Tags: knowledge, learning, teaching, softskills
Published: 2021-07-25 09:54:55

---
title: Tacit knowledge vs explicit knowledge
published: true
date: 2021-07-24 00:00:00 UTC
tags: knowledge,learning,teaching,softskills
canonical_url: https://jhall.io/archive/2021/07/24/tacit-knowledge-vs-explicit-knowledge/
---

I just finished reading [_The Knowledge-Creating Company_](https://amzn.to/3rAXp1R), which discusses two types of knowledge: Explicit knowledge and tacit knowledge.

As an over-simplification, explicit knowledge is things that can be explained explicitly. How to bake a cake, for example.

Tacit knowledge is things that are known, but difficult or impossible to explain, and you may not even know you know them. Riding a bicycle can be an example.

I see this model as related to (though still clearly distinct from) the concept of hard skills vs soft skills. Most of the English-speaking world focuses mostly on “hard skills” or “explicit knowledge.” How to build a linked list. How to bubble sort. How to install Kubernetes.

But the tacit skills are just as important. How to debug a failing service. How to design an intuitive architecture. How to prioritize tasks with no direct business outcome.

How much of what you do on a daily basis is based in tacit knowledge? In other words: How much of what you do on a daily basis would you struggle to explain to someone as step-by-step instructions?

* * *
_If you enjoyed this message, [subscribe](https://jhall.io/daily) to <u>The Daily Commit</u> to get future messages to your inbox._
How to move a file to another folder or directory in Linux?
Tags: resource
Published: 2021-07-24 00:00:00

---
  title: How to move a file to another folder or directory in Linux?
  published: true
  tags: Resource
  date: Sat Jul 24 2021 05:30:00 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/move-file-to-another-folder-or-directory-linux
  cover_image: https://melvingeorge.me/_next/static/images/main-4166feb018885d1a88ee0cbbae4fe654.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/move-file-to-another-folder-or-directory-linux)
  
To move a file to another folder or directory, we can use the `mv` command followed by the source path of the file and then the destination path in Linux.

For example, let's say we have a file called `myFile.txt` which we need to move to a directory called `myDirectory`, to do that we can use the `mv` Linux command like this,

```bash
# Move "myFile.txt" to "myDirectory" directory
mv myFile.txt myDirectory
```

- In the above command after the `mv` command we have defined the source path of the file which is the `myFile.txt` and after that the destination path which is the `myDirectory` directory where the file needs to be moved to.

- Executing the above command will move the `myFile.txt` file to the `myDirectory` directory or folder.

See the execution of the above command live in [repl.it](https://replit.com/@melvin2016/move-file-to-another-folder-in-linux#main.sh).

That's all 😃!

### Feel free to share if you found this useful 😃.

---
CREATE MYSQL CONNECTION IN PHP
Published: 2021-07-23 23:10:11

# Introduction
XAMPP is the most popular software package which is used to set up a PHP development environment for web services by providing all the required software components.XAMPP provides easy transition from local server to live server. XAMPP is a AMP stack which stands for Cross platform, Apache, MySQL, PHP, perl with some additional administrative software tools such as PHPMyAdmin (for database access).

##Steps to Download and Install Xampp
XAMPP is a completely free, easy to install Apache distribution.
* In the web browser, visit  [Apache Friends](https://www.apachefriends.org/index.html) and download XAMPP installer.
* click on the required version and bit on your system  
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/viaswzg5ck1om4irefu5.PNG) download and install.
* Uncheck the Learn more about bitnami option and click Next button.
* Click the Allow access button to allow the XAMPP modules from the Windows firewall.
* After the installation process, click the Finish button of the XAMPP Setup wizard.
* Now the XAMPP icon is clearly visible on the right side of start menu. Show or Hide can be set by using the control panel by clicking on the icon.
To start Apache and MySql, just click on the Start button on the control panel.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f8ubslzuqzarrcx8gebw.PNG)
*  Open your web browser and check whether the XAMPP service has properly installed or not. Type in the >URL: http://localhost. If you are able to see the default page for XAMPP, you have successfully installed your XAMPP Server.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2c173a3q9bygnzv78tf0.PNG)

##Connection with php
```php
<?php $conn = mysqli_connect("localhost","root","");
?>
```
                         OR
```php
<?php
$localhost='localhost';
$root='root';
$pass='';
mysqli_connect($localhost,$root,$pass);
?>
```
##Connection With Database
If you are using database here are the connections. 
1. click on xampp and start **Apache** and **MySQL**.
2. open the htdocs folder. You can find it under the XAMPP folder in your local disk (C: or D:) or any local disk name on your sysytem. In this htdocs folder, we will create a new folder named our database 'First' to store our web files. XAMPP will use this 'First' folder to execute and run the PHP web pages or website. 
3. Type >localhost/PHPMyAdmin in your browser and click on New.
     ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/umdx1cjza2g86xo315ue.PNG)
4. Create a database name(let name the database as **db_name**).
  ![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbgtw3m0jonylce0p2fh.PNG)          
5. Create Connection
```php
<?php $conn = mysqli_connect("localhost","root","","db_name");
?>
``` 
                     OR
```php
<?php
$localhost='localhost';
$root='root';
$pass='';
$db_name='db_name';
mysqli_connect($localhost,$root,$pass,$db_name);
?>
```
Add Formspree Formbutton to a Gatsby site
Tags: gatsby, formexpress, forms, react
Published: 2021-07-23 23:07:53

I was looking to add the [Formexpress](https://formspree.io/formbutton/docs) button to a Gatsby site I was developing as a method of contacting the business. In normal HTML you could have probably pasted the script tag easily but in Gatsby it's not so simple.

My method was to create the [gatsby-ssr.js](https://www.gatsbyjs.com/docs/reference/config-files/gatsby-ssr/)                                                                  file in the root of my working directory and post the code there so that the script tag appears on the body.


This is what I wrote in the file:
```
import React from 'react';
export const onRenderBody = ({ setPostBodyComponents }, pluginOptions) => {
	setPostBodyComponents([
		<script key="formspreeBase" src="https://formspree.io/js/formbutton-v1.min.js" type="text/javascript" aysnc />,
		<script
			key="formspreeWindow"
			dangerouslySetInnerHTML={{
				__html: `
                window.formbutton=window.formbutton||function(){(formbutton.q=formbutton.q||[]).push(arguments)};
                formbutton("create", {
                    action: "https://formspree.io/{your-form-id}",
                    title: "How can we help?",
                    fields: [
                    { 
                        type: "email", 
                        label: "Email:", 
                        name: "email",
                        required: true,
                        placeholder: "your@email.com"
                    },
                    {
                        type: "textarea",
                        label: "Message:",
                        name: "message",
                        placeholder: "What would you like to discuss?",
                    },
                    { type: "submit" }      
                ],
                styles: {
                    title: {
                        backgroundColor: "#ff7b24"
                    },
                    button: {
                        backgroundColor: "#ff7b24"
                    }
                }
                });`
			}}
		/>
	]);
};
```
Adding this to the page resulted in a small button on the site that the user can click to send a form to the user!
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k45qbtq1lmigv2glvhro.png)
ActiveMQ as event source for Lambda in Terraform
Tags: aws, lambda, terraform, activemq
Published: 2021-07-23 22:36:14

Finding example for ActiveMQ as event source of lambda in terraform is difficult. Here are the steps to setup quickly.

#### Assuming below services up and running

1. ActiveMQ broker created with users
2. Lambda

#### Step 1:

Create secret(String) in secret manager with below format.

```json
{
    "username": "lambda-sink",
    "password": "random-string"
}
```

#### Step 2:

Create below terraform resource

```terraform
resource "aws_lambda_event_source_mapping" "lambda_sink_mapping" {

  event_source_arn = aws_mq_broker.broker.arn
  function_name    = aws_lambda_function.lambda.function_name
  batch_size       = 100
  queues = ["queue-name"]

  source_access_configuration {
    type = "BASIC_AUTH"
    uri  = aws_secretsmanager_secret.lambda_user_secret.arn
  }
}
```
Day 415 : Action
Tags: hiphop, code, coding, lifelongdev
Published: 2021-07-23 22:34:56

_liner notes_:
- Professional : Wow! Today was a blur. Pretty much just went over some demo applications and blog posts.

- Personal : Last night, I went through some tracks for the radio show. Watched an episode of "Fire Force". Then I went down this rabbit hole doing research for a project I want to get done in the future. Looking to launch it when I can travel again and will be a feature for https://dwane.in I'm looking to explore what can be done with livestreaming. Learned about some new technologies and I think I may have a plan of action. I went into the late night reading documentation.

![View of a star-filled night sky with some comet trails in a forest with a lake in Lake Matheson, New Zealand](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bxvcvqpc0dctem0qbhdz.jpg)

Going to watch an episode of "Fire Force", work on the radio show tomorrow and the show on Sunday. Now that I got that API working with my side project, I may work on that so I can test it on Sunday. We'll see.

Have a great night and weekend!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube QF24oQIU5DI %}
A Filesystem in JavaScript 🐣
Tags: showdev, javascript, computerscience, imateapot
Published: 2021-07-23 22:21:26

It's Friday, it's nearly my Birthday, it's time to address some long running iterative projects (projects I never finish) LRIP for short 🪦. 

## What's my latest LRIP?
I have a bunch of these projects which I may one day finish.
One in particular which I really wanted to make possible but have been less experienced in previous iterations, a virtual file system.

## In my mind Unix probably works in these easy to understand steps
The kernel 🐣🍗 is the entry point of an application (aka your computer) which a Filesystem sits on top of, the kernel provides syscalls to do things like change directories, write files and so on, these [syscalls](https://man7.org/linux/man-pages/man2/syscalls.2.html) are usually C functions (that's it, no magic, although FYI Rust 🦀 is entering the chat).

Okay so we got functions, an application and how do we use this application?

How do you use your computer without a GUI? That's a trick, don't answer that because terminal is graphical, kind of... But yes a terminal, but the shell, that's what we are talking about.

Think of the most basic shell... Shell not Bash, just Shell, it's just a parser really, type 'cd' and the shell parses your input, `cd` is not in your bin it's a syscall `chdir()`, cool right? 😴, Wake up ☺️

##Okay sleepy head
Get to the point, what do I need a Filesystem written bin JavaScript for, it sounds useless. Precisely, this filesystem offers nothing more than the bear bones 🐻 to represent a Filesystem, it's going to have a lot of extension points (plug-in a function) allowing library authors to represent a Filesystem as a data structure. 

## Here are some ideas:
- A web server / application with a limited and synced to phisical disk 
- Some sort of mock FS testing
- Deploy a yeoman style template in node.js
- Build an OS real or otherwise
- Build the next docker 😅
- Browser mock FS
- Wasm FS thing
- hybrid synchronized FS
- some new build system concept
- Port it to Rust
- Make it work on a real disk (it's possible with Fuse) 

{%codesandbox jolly-zhukovsky-bwn6p %}

So I'm on my phone, I can't go explaining the code because it's not done yet, BUT it's intuitive I feel, also it's locked down as much as possible so that only a `new Shell()` can actually interact with the FS just like the real thing.

Such a fun toy, want to help me, get in touch we can FOSS it 🦄
Html Elements and Structure!
Tags: html, 100daysofcode, tutorial
Published: 2021-07-23 21:51:56

Basically, any html file consists of elements, that marks or tell the browser what to render.

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

The majority of these elements have an opening tag, the content itself, and a closing tag. Although there are a few exceptions that we see in a moment. 

Most of the time, we’ll be using some tag
attribute. That can have several utilities.

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

The next important tag, is the heading element,
that have six levels.

Please don't get confused thinking that we use the levels to style our headings. The purpose of the levels, is to tell the browser the hierarchy of importance in our titles, that's it.

![headings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2so3l3nvighqpqw83wu1.png)

The `<p>` tag will include a section of text. And it stands for:
Yes, you guess it... a paragraph! Let’s make one with some "lorem" inside.

Oh, right...On web development, and graphic design, we use this gibberish text, as a demonstration, to fill spaces where it suppose to have content, without actually have to type real content.

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

So far, all is working, but there are some important tags that we are missing, and they give the structure in html. Let me introduce to you, the <body> tag. All that's inside this element will be rendered. Is like telling the browser, hey this is the content of our page.

![body tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i38ttou3gq35mmof918b.png)

Now let's talk about formatting in html. There´s a convention  that when we nest elements inside others, we must use indentation. In that manner, we talk about child elements, like `<h1>`, `<p>`, etc, that are also siblings; and  parent elements, like the `<body>`tag.

And if we keep nesting elements deeper in the family tree structure, now we're talking about grandparents, grandchildren, more siblings, and yes, it can become the Addams family 😅. So it's better not to take this to far.

![nesting html](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/taps6mmdji8k6aklvhnq.png)

To end this part, let's introduce two more useful tags, the `<em>` and the `<strong>` elements. This are what we call inline elements, and normallly you will find theme inside a `<p>` tag.

![em and strong tag](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qt3k0uyqdez657mjx65a.png)

Just remember that 99% of the times, our style is given through a CSS document, but is nice to know that this tag exists. And sometimes it's just faster  to format directly in html. 

Don't miss part two! ✌

If you have questions or you find it useful, please let me know in the comments!

Find me on:

[🔗 Instagram](https://www.instagram.com/carlosginer_webdev) | [🔗 Twitter](https://twitter.com/Carlosginer_dev) | [🔗Github](https://github.com/CARLOSGINER) | [🔗linkedIn](www.linkedin.com/in/carlosginerdev)
Why I Created a Password Generator CLI Tool
Tags: showdev, cli, password, npm
Published: 2021-07-23 21:34:52

> *Photo by [Paulius Dragunas](https://unsplash.com/@paulius005) on [Unsplash](https://unsplash.com/)*

Yes it's true, I created my own password generator CLI tool, and published it as an NPM package. It has only ~12kB, easy-to-use and it's open-source.  

You can find the package on this link:
https://www.npmjs.com/package/@thpadelis/gpass

You can find the source code on this link:
https://github.com/ThPadelis/gpass

## Why I did it?

I built [gPass](https://www.npmjs.com/package/@thpadelis/gpass) because I was finding it way too tiring to visit a website, configure the settings and generate a new one every time I wanted to use a password.

I wanted something to help me with this obstacle and be easy to use for everyone who uses a terminal.

Another reason was that I haven't work on something personal in long days. I felt that the routine was drowning me and I wanted to change it.

As result, I created this small project of mine and published it.

## How does it work?

Firstly you need to install the package on your machine.

```bash
npm install -g @thpadelis/gpass
```

After installation, you are ready to use the `gpass` alias. You can use the `gpass -h` option to list all the available options.

### Examples

Following are some very basic usage examples of the tool.

#### Create password with length of 15 chars

```bash
gpass -l 15
# output
# gV6|yA5&lA1=iV9
```

#### Create PIN

```bash
gpass -p
# output 
# 5176246270
```

#### Create 5 passwords with length of 10 characters and no symbols

```bash
gpass -l 10 -n 5 -es
# output
# dY6tA6nM7q
# hK4eB6qE5p
# cD5pM0eJ0l
# cM4bV5uQ6s
# sD3bG1yV2n
```

#### Create password and copy it to clipboard

```bash
gpass -cp
```

You can find more examples in the [README.md](https://github.com/ThPadelis/gpass#readme) file.

## Outcome

At the end of the day, this is just another tool - not the first for sure, not the best but is part of me and my try to contribute to the open-source community.

If you like, please consider dropping a comment, like or even a new feature idea.

---

If you found this post helpful or enjoyed it, consider supporting me by [buying me a coffee](https://www.buymeacoffee.com/ptheodosiou). Your support helps me create more valuable content. ☕ Thank you!
Roller Coaster Project
Tags: python, pandas, beginners, datascience
Published: 2021-07-23 21:34:46

Hello everyone,

I have been focusing on the Data Science pathway on Codecademy so I haven't been able to post any projects for a bit that I felt were different enough from an expected answer to post. This project was a bit more open ended where they wanted result, but how you got there was on your own. I would like to start doing some solo data projects soon, I think I almost have the skills I need to feel confident in doing so.

This project took me a few hours to complete. I have been focusing mostly on statistics and data visualization, so it has been a while since I have worked with functions. My personal projects are always function heavy so it was nice to get back to working with them. I do admit, I was a bit rusty though.

Please let me know if you anything you like or could use improvements, I am always looking to get better.

https://github.com/TheHamhams/cc_roller_coaster
How to easily optimize your SEO when hosting your site with Netlify
Tags: netlify, wordpress, gatsby
Published: 2021-07-23 21:18:07

I love Netlify for hosting my static sites. It's free, fast and the automatic deployments with the Github integration is a game changing. You still need to **pay attention to a few points** if you want to get the best out of it, especially from a SEO point of view.

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

Static websites made with Gatsby, NextJS or Hugo have everything to boost your SEO score and help you get the golden 100 mark on Lighthouse. 

Indeed, expect to see your speed performances soar, with insanely low FCP (First Contentful Paint) , LCP (Largest Contentful Paint) and CLS (Cumulative Layout Shift) values.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f9yjfjumgxoi8nl8p5pd.png)
 
##The issue

However, a great Lighthouse score does not necessarily mean a better ranking and visibility on search engines. Especially if you host your site on Netlify. The reason? With its default settings, Netlify makes every page of your site available as a page on your custom domain and as a page in a subdomain inside *.netlify.app*. And God knows how Google for instance does not like duplicate content! 

##The Solution

### Set _redirects file (important!)

First, you need to tell Netlify to redirect your Netlify subdomain to your custom domain. You have two ways to do that: 

- Create a *static* folder in your project root and save inside a **_redirects** file with the following content, by replacing the site name accordingly.
```
https://[yoursitename].netlify.app/* https://www.[yoursitename].com/:splat 301!
``` 

- Install [gatsby-plugin-netlify](https://www.gatsbyjs.com/plugins/gatsby-plugin-netlify/) plugin, that will automatically generate the **_redirects** file for you.

### Use `rel:"canonical"` on every page

To prevent duplicates and tell Google which page is the original version, make sure to include the following `<link>` tag inside the `<head></head>` of every pages. 

```
<link rel="canonical" href="{{ your-base-url }}{{ page-slug }}">
```

If you have too many pages on your site, doing it manually can quickly become tedious. I suggest you use [Gutenberg](https://www.getgutenberg.io/) to automate this process.

Here you are! Your site won't have duplicate content anymore and you should now stay far away from Google SEO penalties.

##Other tips

I would also suggest you to use the following Netlify plugins and npm packages to boost your static sites performances

- if you used Gatsby: [**gatsby-plugin-minify**](https://www.gatsbyjs.com/plugins/gatsby-plugin-minify/), to minify all output HTML files.
- **Image Optim** (Netlify plugin) to compress all your static images
- **Inline source** (Netlify plugin) to inline some sources and assets
- **Submit sitemap** (Netlify plugin) to automatically push your updated sitemap to major search engines after each new build. 


If you have any questions, feel free to reach out to me - I'd be happy to help!