teleren/devto huggingface dataset:
How to rename all md files to mdx
Tags: bash, todayilearned
Published: 2020-11-26 20:47:48

---
title: How to rename all md files to mdx
published: true
tags: bash, todayilearned
canonical_url: https://www.emgoto.com/md-to-mdx-rename/
cover_image: https://www.emgoto.com/md-to-mdx-rename-dev.png
---

Recently I converted my Gatsby blog from Markdown to MDX, and I wanted to convert all my `.md` files over to `.mdx` for consistency’s sake.

The folder structure of my repository looks something like this:

```
posts
    post-slug-one
        index.md
    post-slug-two
        index.md
```

Since I have over 50 posts, I didn’t want to do the renaming manually!

If you’re using VSCode, there is a [Batch Rename](https://marketplace.visualstudio.com/items?itemName=JannisX11.batch-rename-extension) extension you can use. However, it doesn’t seem to work when all your files are located inside of their own folders (like mine are).

I came across [this snippet](https://github.com/johno/johno.com/blob/master/content/notes/dev/rename-all-files-in-a-directory.mdx):

```sh
for file in *.md; do mv "$file" "${file%.md}.mdx"; done
```

This seems to do the trick for any files that live in the same folder.

To get all files that live underneath the `posts` directory, this works:

```sh
find posts -type f -name "*.md"
```

## The solution

Putting both of the above snippets together, I came up with this:

```sh
find posts -type f -name "*.md"|while read file;
  do mv "$file" "${file%.md}.mdx";
done
```

> Before running the script, I would recommend checking that the `find` command is finding all the files you expect it to. Also, make sure to stash any other changes on your repository so that you can easily reverse this operation if it goes wrong!
Qualified Name Is Not Allowed In Member Declaration in C++
Tags: cpp, oop, computerscience
Published: 2020-11-26 20:31:14

Member declaration is a variable that is associated with a specific object and is accessible for all other member functions. The error occurs if a variable that does not belong to the class of variables is used as a member of the function.

#Cause 

The compiler has a standard text like a template that it uses in its internal buffer and thus errors are detected when the compiler parses the template and detects the error.

Template declarations have different meanings depending on the arguments used in their development. The expressions used may have different types of values that give variables different types or functions calls for different functions; such depend majorly on template parameters.

The standards separate the construct into groups depending on dependency level:

Dependent types such as a parameter (T)

Value-dependent expressions like non-type parameter (N)

Type-dependent expressions that are cast to a type template parameter (T) 0

The use of declarations in C++ also includes “typename” which means that a name can be looked up if the template arguments/parameters are known. 

Under all circumstances of programming, the template’s arguments must be fulfilled else qualified name not allowed error is will display. [Read Solution](https://www.kodlogs.com/blog/1912/qualified-name-is-not-allowed-in-member-declaration-in-c)
‘touch’ is not recognized as an internal or external command, operable program or batch file
Tags: html, webdev
Published: 2020-11-26 20:29:37

Consider that, You are using node.js just use npm with a view to install it on windows.

#node.js npm:

`C:\ npm install touch-cli-g`

For doing this, it will install the command line interface for touch. So, you can use it the same as Unix.

Another way you can do this. Using

`echo>`

**in windows cmd**

`path / file. Sqlite`

This command is a unix/linux based command. Therefore, it doesn’t perform in windows. But it does update the modified timestamps of a file. If you are using with copy to imply missing parameters. Then this will updates the files modified date.

##Example Given:

`Copy / b file1 ,,`

**Command prompt: c:\windows\system32\cmd.exe**

```
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved
C:\users\sekar>cd desktop
C: \users\sekar\Desktop>cd react-test
C: \users\sekar\Desktop\react-test > type nul>webpack.config.js
C: \users\sekar\Desktop\react-test>
```

###Example:

Type nul>test.html in windows CMD and another one method is

`echo.>test.html`

Both will be working. In case you are on windows device just install git bash. Then type the following command

`touch test.html`

After running this command it will generate a 0 Kilobyte test.html file for you in your specified directory. It is contextual to any other type of file. [Read more](https://www.kodlogs.com/blog/137/touch-recognized-internal-external-command-operable-program)
November 26th, 2020: What did you learn this week?
Tags: weeklylearn, discuss, weeklyretro
Published: 2020-11-26 20:27:55

It's that time of the week again. So wonderful devs, what did you learn this week? It could be programming tips, career advice etc.

<center>

![Yoda wooping someone's butt](https://media.giphy.com/media/yDYAHbqe5DfyM/giphy.gif)
</center>

Feel free to comment with what you learnt and/or reference your TIL post to give it some more exposure.

{%tag todayilearned %}

And remember, if something you learnt was a big win for you, then you know where to drop it as well.👇👇🏻👇🏼👇🏽👇🏾👇🏿

{%link https://dev.to/devteam/what-was-your-win-this-week-16ip %}

<center>

![Little kid making a fist as if to say "Yes!"](https://media.giphy.com/media/6brH8dM3zeMyA/giphy.gif)
</center>
What are "Delegates" in C#?
Tags: csharp, webdev, dotnet, devjournal
Published: 2020-11-26 20:23:38

Hello, My name is Nima Owji. I am 14. I am a C# programmer for 3 years. Today, I wanna talk about "Delegates". What are them? Read this article!

Delegates are known by "Function-Pointers" too. You can point to a method by them. 

#### Example
See this example:

```cs
public int Sum(int a, int b)
{
   return a + b;
}
```

This is a simple method that can get the sum of two numbers.
Now we want to use it with a delegate:
```cs
public delegate int MyDelegate(int a, int b);
MyDelegate = Sum;
int sum = MyDelegate(5,6) // returns 11
```
As you can see they are like variables.
Delegates are this:
```cs
[Scope] delegate [Return type] [DelegateName]([Input parameters])
```

#### You can add many methods to a delegate
You can add as many methods as you want to a delegate. Look at this example:

```cs
public void Sum(int a, int b)
{
   Console.WriteLine(a + b);
}

public void Pow(int a, int b)
{
   Console.WriteLine(Math.Pow(a, b));
}

public delegate void MyDelegate(int a, int b);
MyDelegate = Sum;
MeDelegate += Pow;

// Now you can use it
MyDelegate(2,3);

// Console will show you this
5
8
```

As you can see they are really easy. I hope you enjoyed this. Don't forget to like this article and share it. If you have any questions, ask them in a comment.
Follow me on Twitter @nima_owji too, I will answer all of your questions there.

Thank you!
Thanksgiving: No que você é GRATO com a tecnologia?
Tags: todayilearned, devjournal, help
Published: 2020-11-26 20:22:17

Como meu primeiro post aqui no Dev.To, eu tinha a **OBRIGAÇÃO** de fazer um post sobre: **AGRADECIMENTO**.

*Uma adaptação ao post feito pela Lee Brandt [LINK](https://developer.okta.com/blog/2020/11/25/open-source-thankful)

Hoje o mundo inteiro (eu achava que era só dos EUA 😱):

> Thanksgiving is a national holiday celebrated on various dates in the United States, Canada, Brazil, Grenada, Saint Lucia, and Liberia, and the sub-national entities Leiden, Norfolk Island, and the inhabited territories of the United States. **It began as a day of giving thanks and sacrifice for the blessing of the harvest and of the preceding year.**

[Thanksgiving (Wikipedia)](https://en.wikipedia.org/wiki/Thanksgiving)

E como um Desenvolvedor que aprendeu **MUITO** com a comunidade (principalmente essa do Dev.To), decidi fazer esse post com projetos que me ajudaram a evoluir e me tornar um melhor profissional em 2020.

#Next.js

[Next.js](https://nextjs.org/) é um framework que traz a melhora na experiência do desenvolvedor e também do usuário final, ao mesmo tempo. Sem dúvidas o Next.js, que está na vanguarda no momento, foi meu *xodó* do ano e foi o responsável por evoluir quase exponencialmente minha carreira, além de abrir o leque de possibilidades, com novos projetos e aprendizado. Obrigado Next.js🚀

#Material-Ui

[Material-UI](https://material-ui.com/pt/) ou mais conhecida como o *Design System do Google*, foi e está sendo a biblioteca de componentes React com fácil desenvolvimento e adaptação. Eu diria que com ela, eu tive mais vontade de pesquisar mais e entender como funciona os componentes *por debaixo dos panos*, além de forçar a entender como funciona o CSS (que era o maior problema para mim no começo da minha carreira como Desenvolvedor. Obrigado Material-UI e Google 🚀

#Rocketseat

A [Rocketseat](https://rocketseat.com.br/) é uma plataforma de educação em tecnologia que hoje sem dúvidas é uma das maiores comunidades do Brasil para Devs. Com eventos SENSACIONAIS como NextLevelWeek e videos semanais como Codedrops e Masterclass, mostra que você pode ensinar as pessoas a aprenderem de um jeito descontraído, fácil e didático ao mesmo tempo. Obrigado Rocketseat 🚀

#UAUBox

[UAUBox](https://uaubox.com.br/) é um clube de assinatura de produtos de beleza e a empresa que eu trabalho hoje. A UAU me deu a oportunidade de começar uma nova página na minha vida profissional: virar um Desenvolvedor Frontend. Para quem não me conhece, trabalhei a 10 anos como Analista de Suporte, sou formado em Engenharia de Controle e Automação e na UAUBox tive a oportunidade de começar uma nova carreira, e se não tivesse sido a UAUBox, eu teria me frustrado novamente e não teria certeza do que estou fazendo hoje.

##Deixe seu comentário e me fala: **pelo o que você é GRATO**? 😍
How to display multiple selected value of drop down-list in PHP?
Tags: php, webdev
Published: 2020-11-26 20:21:21

#Solution:
1. **For Windows** – Hold down + Ctrl key for selecting multiple option

2. **For Mac** – Hold down command key for selecting multiple option

**STEP 1: Create a list of item**
##Code:
```<html> 
	<body> 
		<form method = "post" action = "name.php"> 
			<h4>SELECT SUJECTS</h4> 
			<!--Using multiple to select multiple value-->
			<select name = "subject" multiple size = 6> 
				<option value = "english">ENGLISH</option> 
				<option value = "maths">MATHS</option> 
				<option value = "computer">COMPUTER</option> 
				<option value = "physics">PHYSICS</option> 
				<option value = "chemistry">CHEMISTRY</option> 
				<option value = "hindi">HINDI</option> 
			</select> 
			<input type = "submit" name = "submit" value = Submit> 
		</form> 
	</body> 
</html>
 ```
 

**STEP 2: Fetch or print multiple selected value from list. In this case we are going to use form method and loop to fetch selected value in PHP**
##Code:
```<html> 
	<body> 
		<!--name.php to be called on form submission--> 
		<form method = 'post'> 
			<h4>SELECT SUJECTS</h4> 
			
			<select name = 'subject[]' multiple size = 6> 
				<option value = 'english'>ENGLISH</option> 
				<option value = 'maths'>MATHS</option> 
				<option value = 'computer'>COMPUTER</option> 
				<option value = 'physics'>PHYSICS</option> 
				<option value = 'chemistry'>CHEMISTRY</option> 
				<option value = 'hindi'>HINDI</option> 
			</select> 
			<input type = 'submit' name = 'submit' value = Submit> 
		</form> 
	</body> 
</html> 
<?php 
	
	// Check if form is submitted successfully 
	if(isset($_POST["submit"])) 
	{ 
		// Check if any option is selected 
		if(isset($_POST["subject"])) 
		{ 
			// Retrieving each selected option 
			foreach ($_POST['subject'] as $subject) 
				print "You selected $subject<br/>"; 
		} 
	else
		echo "Select an option first !!"; 
	} 
?>
 ```

[Read more](https://www.kodlogs.com/blog/450/how-to-display-multiple-selected-value-of-drop-down-list-php)
.tofixed is not a function.
Tags: java, oop, computerscience
Published: 2020-11-26 20:14:46

The toFixed number in javascript is used for number formatting by using fixed-point notation. This can be used to format a number with a specific number of digits to the right side of the decimal.

#Syntax:
`numObj.toFixed([digits])`

##Parameters:
The number of digits that appear after the decimal point: These numbers have a value between 0 and 20 inclusive and this implementation can support a wide range of values. It will be treated as 0 if this argument is removed.

###Return Value:
It will return a string representation of the given number by using the fixed point notation.

####Exceptions:
If this method is invoked on an object then it is not a number. [Read more](https://www.kodlogs.com/blog/1120/tofixed-is-not-a-function)
Introducing BannerCLI
Tags: javascript, tooling, opensource
Published: 2020-11-26 20:14:14

A command-line interface to add relevant information to your source code from package data. This lib reads the package.json files, then a banner is generated based on each of these values: name, version, homepage, year, author, and license.

I am always looking for a way to simplify common tasks. Developing tools that help me automate some actions is the best way to learn something new. BannerCLI was born with a very simple goal: get the information from the package.json to register in any file.

I use BannerCLI to build some personal projects: [Milligram](https://github.com/milligram/milligram), [Airform](https://github.com/airform/airform), [OpenFB](https://github.com/cjpatoilo/openfb), [ReactChip](https://github.com/cjpatoilo/react-chip), and [others](https://github.com/cjpatoilo/). BannerCLI is Open Source (MIT) and [available on GitHub](https://github.com/cjpatoilo/banner-cli), with over +13k downloads and +125 dependents.

I hope you enjoy!
(https://github.com/cjpatoilo/banner-cli)
Python remove all whitespace
Tags: python, oop, computerscience
Published: 2020-11-26 20:06:40

Python String is immutable in nature. What does it mean? In C, C++, or Java, we can change the value of a string after initialization. It means String is mutable in these programming languages. In the case of Python, once we initialize a string it becomes final and we do not have the authority to change the string value. In Python, any function that manipulates string value returns a new string and we have to explicitly assign it to the string, unless, the string value won’t change. Let’s discuss how we can manipulate and remove the white spaces from a string in Python. There are two methods 1. strip() method 2. replace() method

#Using the strip() method:
Python string has a built-in function named .strip(). This function removes all the whitespace (leading and trailing) from the string explicitly. We can perform the same thing applying by the lstrip() or rstrip() function instead.
```
is_a_string = "  My name is John    "
print(is_a_string.strip())
```
The sample string has whitespace in both starting and at the end of it. Applying the strip() function will remove those whitespaces and return the string as:
`My name is John`

[Read Replace method](https://www.kodlogs.com/blog/1088/python-remove-all-whitespace)
Introducing Milligram
Tags: css, web, framework, opensource
Published: 2020-11-26 20:03:22

2015 has been an incredible year, and is not over yet! 👊

Two weeks ago I began to devote a little more of my free time to share a personal project. Of course, this project did not have all the features that it currently has, not even a concern with other forms of distribution. I was honing and improving each feature one by one during those days while analyzing the way they were implemented in other projects.

This experience has been fascinating. I learned much more than I expected. And that phrase was the inspiration for all these days, and somehow, I hope that at some point can also serve to you.

> “Even if people say — don’t reinventing — I think it should be reinvented, because it will teach you something. So even if there is already something out there, dive into their code, and perhaps rewrite everything, even if it’s just to learn. “
- TJ Holowaychuk

Well, here’s one more CSS framework. (https://github.com/milligram/milligram)

![milligram.io](https://dev-to-uploads.s3.amazonaws.com/i/13kjc96fk9tydv5rora6.png)
java check if the string is empty.
Tags: java, oop, computerscience
Published: 2020-11-26 20:00:25

#Java program to check if a string is empty or null:
In the above program, we check that the isEmpty() method will only check whether the String is empty or not. If the user wants to check whether the given String is null or empty then you can do this in following ways;

```
public class Example{

   public static void main(String args[]){ 

               String str1 = null;

               String str2 = "beginners book"; 

               if(str1 == null || str1.isEmpty()){

                  System.out.println("String str1 is empty or null");

               }

               else{

                  System.out.println(str1);

               }

               if(str2 == null || str2.isEmpty()){

                  System.out.println("String str2 is empty or null"); 

               }

               else{

                  System.out.println(str2);

               }

   }

}
```
[Read more](https://www.kodlogs.com/blog/1080/java-check-if-the-string-is-empty)
##Output
```
String str1 is empty or null

beginners book
```
Using bundle exec with Flycheck in Emacs
Tags: ruby, emacs
Published: 2020-11-26 19:54:33

Create a .dir-locals.el file in the project root and
edit the file with this code in Emacs Lisp

```lisp
((ruby-mode . ((eval . (setq-local flycheck-command-wrapper-function
  (lambda (command)
    (append '("bundle" "exec") command)))))))
```
Java call a method from another class.
Tags: java, computerscience, oop
Published: 2020-11-26 19:52:19

Java can call a method from another class by using the behavior and the access level is present there. Following access modifiers can be used within the methods.

#Access level / Modifiers:
##Public:
In public modifiers, methods are visible to any other class you are using. The users can access from anywhere as long as they create a new instance of the class otherwise the user will get NullPointerException.

##Private:
In private modifier, methods are only visible within that class. Methods are only available within the method that is encapsulated in that class.

##Protected:
In protected access modifier is limited to package. The users can get the ability for their subclass outside the superclass package by using the to inherit methods and constructors. The users can only access by using the inheritance. In this way methods only extend the superclass functionalities not replace it. [Read more](https://www.kodlogs.com/blog/877/java-call-a-method-from-another-class)
In programming, the terms "line" and "statement" always mean the same thing.
Tags: cpp, computerscience
Published: 2020-11-26 19:50:27

No, the Statement is a group of lines. 
One statement contains many lines 

#For example:

```
int main()
{
    int x, y;
    printf("enter the value of x:");
    scanf("%d", &x);
    printf("enter the value of y:");
    scanf("%d", &y);
    if (x>y)
    {
           printf("x is greater than y\n");
    }
    if (x<y)
    {
           printf("x is less than y\n");
    }
    if (x==y)
    {
           printf("x is equal to y\n");
    }
    printf("End of Program");
    return 0;
}
```
**The above example contains 22 lines but 3 number of Statements are three.**

##Line
Lines of code are the "source code" of the program, and one line may produce one machine guidance or a few relying upon the programming language. ... In an elevated level language, for example, C++ or Java, one line of code produces a progression of low-level computing construct guidelines, which brings about different machine directions. 

##Statements                                                                                      
In PC programming, a Statement is a syntactic unit of a basic programming language that communicates some activity to be done. A grouping of at least one explanation shapes a program written in such a language. An announcement may have inward part 

##Type of statements
Assignment statements are used to assign a program variable. Flow control explanations help direct the request where statements are performed.

###There are four types of control statements
[Read more](https://www.kodlogs.com/blog/849/programming-the-terms-line-statement-always-mean-same-thing)
My 2k20 experience
Tags: microclubusthb, opensource, github, hacktoberfest
Published: 2020-11-26 18:11:04

 Hello **DEV Community** ! My name is *Messaoud Sihem Fadia*, and i usually go by *Mehis*, I'm a freshman year computer science Student at the *University Of Science And Technology Houari Boumediene* in Algiers, And in this post I'm gonna try to talk about my journey so far as a student.
Since this was my first year in university, I'm still a beginner when it comes to computer science. Due to the current pandemic that the world is going through we barely had to go through the basics, But luckily i had the chance to become a part of a student Club based in our university, **MicroClub** to be more specific.
being a member provided me access to a community full of supportive and kind people, that are always willing to help and to share their knowledge, which gave me the opportunity to have a grasp over the basics of Html, css, js,c ...ect. It also taught me how to be better at team work and to be more confident when expressing my ideas. More over I had the opportunity to see first hands how events are organized and what goes on in back scenes .
The most recent Event i had to be part of was **Hacktoberfest**, and it was my first contact with the concept of *opensource*. so even tho i still do not know much about it, i still learned alot
So overall, i can safely state that it provided me with a great working environment, where i learn new things everyday.