teleren/devto huggingface dataset:
Variables , Constants And Data Types in C
Tags: clanguage, datatypes, variables, constants
Published: 2021-05-10 16:54:26

#Variables

      

 A variable is an identifier which is used to store some value. Variables can change during the execution of a program and update the value stored inside it.
A single variable can be used at multiple locations in a program. A variable name must be meaningful. It should represent the purpose of the variable.


>Example: 
Height, age, are the meaningful variables that represent the purpose it is being used for. Height variable can be used to store a height value. Age variable can be used to store the age of a person.
 
### Rules :
* A variable name should consist of only characters, digits and an underscore.

* A variable name should not begin with a number.

* A variable name should not consist of whitespace.

* A variable name should not consist of a keyword.

* C is a case sensitive language that means a variable named 'age' and 'AGE' are different.

> Example : int my_variable;
            my_variable = 48; 





# Constants
      



Constants are the fixed values that never change during the execution of a program.
 Following are the various types of constants:

### Integer constants :
An integer constant is nothing but a value consisting of digits or numbers. These values never change during the execution of a program. Integer constants can be octal, decimal and hexadecimal.

> Example :  111, 1234

### Character constants :
A character constant contains only a single character enclosed within a single quote (''). We can also represent character constant by providing ASCII value of it.

>Example :'A', '9'

### String constants :
A string constant contains a sequence of characters enclosed within double quotes ("").

>Example: "Hello", "Programming"

# Data types


C provides various data types to make it easy for a programmer to select a suitable data type as per the requirements of an application. Following are the three data types:

* Primitive data types
* Derived data types
* User-defined data types

There are five primary fundamental data types,

1.int for integer data
2.char for character data
3.float for floating point numbers
4.double for double precision floating point numbers
5.void

### Integer data type :

Integer is nothing but a whole number. The range for an integer data type varies from machine to machine. The standard range for an integer data type is -32768 to 32767.

> Example : int age;

### Float data type :

The 'float' keyword is used to represent the floating point data type. It can hold a floating point value which means a number is having a fraction and a decimal part. A floating point value is a real number that contains a decimal point.

>Example :float division;
          double Bank Balance;

### Character Data type :

Character data types are used to store a single character value enclosed in single quotes.

> Example : Char letter;

### Void data type:

A void data type doesn't contain or return any value. It is mostly used for defining functions in 'C'.

> Example :void display Data()
Part 3: Get started with the Go Programming Language with Microsoft Learn! (no experience needed)
Tags: programming, productivity, opensource, go
Published: 2021-05-10 17:20:57

---
title: Part 3: Get started with the Go Programming Language with Microsoft Learn! (no experience needed) 
published: true 
description: Learn how to get started with the Go Programming Language
series: "#GoLang For Beginners"
tags: programming, productivity, opensource, go
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/05pjplxe75ysxvwfzttm.png
---

Hello everyone, 

I'm back again with part 3 of this Go Lang series. I was always wanting to learn more about it but never dedicated the time. Fast-forward to today and I'm learning it live on my Twitch stream using [Microsoft Learn's](https://learn.microsoft.com) free, online training platform. 

Follow along with the [MS Learn Module](https://docs.microsoft.com/en-us/learn/modules/go-control-flow/).

In this lesson, We cover how to: 

* Work with simple and compound if statements.
* Learn about switch statements and their features.
* Learn about loop statements and how Go creates them by using the for keyword.
* Learn about essential error-handling functions like defer, panic, and recover.

Video (19 mins)

{% youtube MRavAhhge2w%}


Conclusion

Feel free to checkout my [Twitch streams](https://twitch.tv/mbcrump) as we learn about security and app development or you can watch the condensed version of all of my streams by subscribing to my [YouTube](https://youtube.com/mbcrump). 

Stay connected with me on social platforms for daily software development news.

-[Twitter](https://twitter.com/intent/follow?screen_name=mbcrump) | [Twitch](https://twitch.tv/mbcrump) | [Instagram](https://instagram.com/mbcrump) | [YouTube](https://youtube.com/mbcrump) | [GitHub](https://github.com/mbcrump) | [Website](https://www.michaelcrump.net)
Sequelize Many-to-Many association – NodeJS/Express, MySQL
Tags: sequelize, node, mysql, express
Published: 2021-05-10 17:03:01

https://grokonez.com/node-js/sequelize-many-to-many-association-nodejs-express-mysql

Sequelize Many-to-Many association – NodeJS/Express, MySQL

In the <a href="https://grokonez.com/node-js/sequelize-one-to-one-association-nodejs-express-mysql">post</a>, we got started with Sequelize One-To-Many association. Today we’re gonna create Sequelize Many-To-Many association models with NodeJS/Express, MySQL.

Related posts:
- <a href="https://grokonez.com/node-js/sequelize-one-to-many-association-nodejs-express-mysql">Sequelize One-To-Many association – NodeJS/Express, MySQL</a>
- <a href="https://grokonez.com/node-js/sequelize-one-to-one-association-nodejs-express-mysql">Sequelize One-To-One association – NodeJS/Express, MySQL</a>
- <a href="https://grokonez.com/aws/amazon-s3/node-js-restapis-download-file-from-amazon-s3-using-express-aws-sdk">Node.js RestAPIs Download File from Amazon S3 | using Express, AWS-SDK</a>

<!--more-->
<h2>Sequelize Many-To-Many Association Express/Nodejs</h2>
Many-to-many association with a join table.

<strong>Note</strong>: When calling a method such as <code>Project.belongsToMany(User, {through: 'UserProject'})</code>, we say that the Project model is the <strong>source</strong> and the User model is the <strong>target</strong>.



https://grokonez.com/node-js/sequelize-many-to-many-association-nodejs-express-mysql

Sequelize Many-to-Many association – NodeJS/Express, MySQL
Accessing the store from an external file
Tags: nuxt, vuex
Published: 2021-05-10 17:03:00

---
title: Accessing the store from an external file
published: true
description: 
tags: nuxtjs, vuex
//cover_image: https://direct_url_to_image.jpg
---

Error 
```javascript
TypeError: __WEBPACK_IMPORTED_MODULE_2__store__.default.dispatch is not a function
```

Inject store to Class (example)

```javascript
export default class AuthService {
  constructor(store) {
    this.store = store
  }
  login() {
    this.store.dispatch('someAction')
  }
}
```
365 Days of Blogging Challenge
Tags: productivity, career, webdev
Published: 2021-05-10 17:02:55

---
title: 365 Days of Blogging Challenge
published: true
description: Everyone sometimes struggles with consistency. Do you want to develop a good habit but often fail after a few days? Well, **you are not alone**.
tags: [productivity, career, webdev]
series: "365 Days Of Blogging Challenge"
---
Everyone sometimes struggles with consistency. Do you want to develop a good habit but often fail after a few days? Well, **you are not alone**.

To help myself with that (and possibly you), I come up with the idea of making a **public commitment** and finding **accountability partners**.

### Public commitment

This post is my public commitment to writing and publishing articles daily for the next 365 days. It's well over any magic number you hear that is necessary to form a habit. For my liking, it's fair enough.

### Accountability partners

To hold myself accountable (and to make you more interested in helping me stay consistent), **I declare that I'll pay $1000 to one of my accountability partners** (by whom I mean anyone who comments on this post on dev.to) **if I miss a day in publishing articles in the next year**.

### The rules

1. One article a day published, no excuses.
2. No article published - a script chooses a random person from the comments section to transfer money to their bank account.
3. The way of choosing a random person may change with time - I want to make it automated and public, to provide transparency and fairness (and to prove I'm taking it seriously!). Feel free to propose your ideas on how to approach this problem.

### Join me in the challenge

I encourage all of you who want to develop a good habit of putting yourself out there to join the challenge. 

Of course, your numbers may be different. Maybe your goal is to publish just one article a week. Maybe $1000 is too much or too little to make you feel uncomfortable. 

Choose your perfect numbers and join me in the challenge!  If you struggle with this, [DM me on Twitter](https://twitter.com/PJeziorowski), and I'll do my best to help you come up with numbers that will work for you.

And please, let me know what you think about this idea. Feedback highly appreciated!
Sequelize Many-to-Many association – NodeJS/Express, MySQL
Tags: sequelize, node, express, mysql
Published: 2021-05-10 16:58:41

https://grokonez.com/node-js/sequelize-many-to-many-association-nodejs-express-mysql

Sequelize Many-to-Many association – NodeJS/Express, MySQL

In the <a href="https://grokonez.com/node-js/sequelize-one-to-one-association-nodejs-express-mysql">post</a>, we got started with Sequelize One-To-Many association. Today we’re gonna create Sequelize Many-To-Many association models with NodeJS/Express, MySQL.

Related posts:
- <a href="https://grokonez.com/node-js/sequelize-one-to-many-association-nodejs-express-mysql">Sequelize One-To-Many association – NodeJS/Express, MySQL</a>
- <a href="https://grokonez.com/node-js/sequelize-one-to-one-association-nodejs-express-mysql">Sequelize One-To-One association – NodeJS/Express, MySQL</a>
- <a href="https://grokonez.com/aws/amazon-s3/node-js-restapis-download-file-from-amazon-s3-using-express-aws-sdk">Node.js RestAPIs Download File from Amazon S3 | using Express, AWS-SDK</a>

<!--more-->
<h2>Sequelize Many-To-Many Association Express/Nodejs</h2>
Many-to-many association with a join table.

<strong>Note</strong>: When calling a method such as <code>Project.belongsToMany(User, {through: 'UserProject'})</code>, we say that the Project model is the <strong>source</strong> and the User model is the <strong>target</strong>.

We define 2 models:

<pre><code class="language-javascript">
const Project = sequelize.define('project', {
	/*
		attributes
	*/
});

const User = sequelize.define('user', {
	/*
		attributes
	*/
});
</code></pre>

Many-To-Many associations are used to connect sources with multiple targets. And the targets can also have connections to multiple sources.

More at:

https://grokonez.com/node-js/sequelize-many-to-many-association-nodejs-express-mysql

Sequelize Many-to-Many association – NodeJS/Express, MySQL
I always wanted to have built-in Racing Mechanics in Elite Dangerous
Tags: javascript, electron, vue3, gamedev
Published: 2021-05-10 16:50:39

Sad, but turns out - it's not going to happen any time soon.

Okay, let's make our own racing overlay for Elite Dangerous! Let's take some JS, Electron with some fresh tasty Vue3, drop b bit of CSS on top, and finish drawing the Owl.

You can race solo for now and make your own track anywhere you like. Multiplayer mode is on the way.

{%youtube cQ344CdLF6U%}

Feel free to ask any questions and let me know if you like it so I can share some more fun things!

Cheers! 🍻

Early Navigation test:
https://www.youtube.com/watch?v=-xoxKqmILuI

Original Video:
https://www.youtube.com/watch?v=cQ344CdLF6U

Latest Version on GitHub: 
https://github.com/vovchisko/ender-o/releases/latest
Displaying the active Amplify Environment alongside the current Git branch
Tags: aws, amplify, environments, serverless
Published: 2021-05-10 16:50:10

Working with a lot of Git branches can get a bit tricky when they align to different [Amplify environments](https://docs.amplify.aws/cli/teams/overview). I usually find myself checking `amplify status` or `amplify env list` to determine the active environment. Below is an approach that is a bit more dynamic and similar to what Git and Python virtual environments show while working in the terminal.


### Prerequisites
You'll need to have the below installed for the function to take effect.

- [git](https://git-scm.com/) - used to determine the root directory of your Amplify project
- [jq](https://stedolan.github.io/jq/download/) - helps with parsing JSON
- [oh-my-zsh](https://ohmyz.sh/) - managing terminal functions and themes


### Display the active Amplify `env`

Add the below into your `.zshrc` or `.bashrc`. The output of the function can be adjusted depending on how you'd like to display the information. I display mine to the left of the current working directory by adjusting my zsh custom theme (below). This puts the environment name in a similar spot to where an active Python virtual environment name will show.

```zsh
# .zshrc

amplify_env () {
    PROJECT_DIR=$(git rev-parse --show-toplevel 2>/dev/null) 

    ENV=$PROJECT_DIR/amplify/.config/local-env-info.json 

    if [ -f "$ENV" ]; then
        env_info=$(cat $ENV | jq -r ".envName") 
        echo "(🚀 $env_info)"
    fi
}

```

The function checks for the current working environment name in the `<project>/amplify/.config/local-env-info.json` file. This approach requires a few extra steps but is quicker than re-computing on each terminal input using the `amplify status` CLI command. 



After re-sourcing your `.zshrc` (below), the environment function can be invoked by running `amplify_env` in the terminal.

```zsh
source ~/.zshrc
```


### Adding to a custom theme

If you're using `oh-my-zsh`, then you can adjust your theme (or any theme) to add the output of the function so that it shows in the terminal prompts. The updated `PROMPT` below now includes the Amplify environment function output (`${amplify_env}`).


```diff
# ~/.oh-my-zsh/custom/themes/<my-custom-theme>.zsh-theme

- PROMPT='${ret_status} %{$fg[cyan]%}%c%{$reset_color%} '
+ PROMPT='$(amplify_env) ${ret_status} %{$fg[cyan]%}%c%{$reset_color%} '
...

```

### Amplify `env` + Git branch = 🔥

Now the environment is displayed alongside the Git branch that is active. This is a nice way to quickly determine if I need to switch branches or environments to match. Make sure to initialize Git in the project(`git init`) if the environment name and the Git branch aren't showing.


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



Hopefully that helps keep your Amplify environments visually in sync with your current Git branch 🌲.
What Alfred Workflows do you use?
Tags: discuss
Published: 2021-05-10 16:45:09

I started using Alfred in earnest about a month ago, by that I mean I purchased the Powerpack. 
It's fantastic my only complaint is that a lot of the workflows seem a little outdated or needing some TLC so far the ones I've been using a ton are:
* [Bear](https://github.com/chrisbro/alfred-bear) by Chris Brown, which I use to quickly open my notes
* [Harvest](https://github.com/ajilderda/alfred-harvest-v2) by Andre Jilderda, I consult for a company that uses Harvest for time tracking
* [Emoji Taco](https://github.com/jeeftor/EmojiTaco) by Jeff Stein, it's nice to be able to grab the perfect emoji.
* [Launch in 3 Browsers](https://www.alfredapp.com/blog/tips-and-tricks/tutorial-launch-a-url-in-3-browsers-from-alfred-or-remote/) by Vero Pepperrell, I've found this dosen't seem to work in all browsers all the time but it's come in handy a few times when I've had to test some front-end features.

What Alfred workflows do you find indispensable? I haven't spent much time exploring yet so I'm open to all suggestions.
Pretty format number using '.toLocaleString()'
Tags: javascript, webdev, codenewbie, beginners
Published: 2021-05-10 16:40:23

```js
// Error
console.log(123456.toLocaleString()); // wont work

// Method 1: Store it in a variable 
const n = 123456;
console.log(n.toLocaleString()); // 123,456

// Method 2: Use Number() to convert it into type Number
console.log(Number(12345).toLocaleString()); // 12,345
```

---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for more.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack  
**[codedrops.tech](https://www.codedrops.tech/)**

---
**Projects**  
[File Ops](https://marketplace.visualstudio.com/items?itemName=mehullakhanpal.file-ops) - A VS Code extension to easily tag/alias files & quick switch between files
The EsoList
Tags: esoteric, esolang
Published: 2021-05-10 16:26:49

This is the EsoList, not the first (but probably the first on dev.to) community built list of amazing esolangs! Feel free to comment  on any of these so long as the comments are constructive. Enjoy!

# FreakC

FreakC is a multi-paradigm esoteric scripting language. It is written in Batch, compiled to Batch and compatible with Batch codes and libraries. It adds certain features to Batch, but with excessive cursing which makes it an esolang. It is 100% open-source on Github, and open for anyone to contribute! The language is currently at v4.9.0 and is stable.

Hello world:
```
Swear[fnc] Hello, World^!
```
GitHub: https://github.com/FreakC-foundation/FreakC
Facebook: https://www.facebook.com/FreakC-Programming-Language-111425377421861
Itch.io: https://npmgames.itch.io/FreakC
Esolangs.org: https://esolangs.org/wiki/FreakC
Dev Article: https://dev.to/freakcdev297/freakc-the-esolang-that-can-do-stuffs-3f9c
Website: https://freakc-foundation.github.io/
Tutorial: Custom Domains - Learn how to connect your domain to your WebApp
Tags: tutorial, webdev, domain, dns
Published: 2021-05-10 16:15:38

>In this article, we are going to show you how to connect a custom domain in Codesphere.

By default, Codesphere deploys to a generic Codesphere subdomain based on your app ID and port. If you're looking to use your app for production, however, you're most likely going to want to add your own domain.

While this can be done with any domain registrar, we will show you how to connect your domain from GoDaddy in this tutorial.

###Let's get started
To get started, open up your app in the Codesphere IDE. We are then going to select the infrastructure tab in our app. Then we can press "Domains", then the "New domain" button, and enter in our custom domain.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2840rw4vccen17z0c5od.gif)

---

###Configure the DNS
Next, we need to configure our DNS from GoDaddy. Go to "My Products", scroll down to the domain you would like to connect and click on "DNS". From there we can access the DNS records that we need to configure.

The first record that we have to edit is the "A" record. Edit the A record to have the following settings:

Host: *
Points To: Navigate back to Codesphere and grab the address after the "A" in the DNS section.

---

Next, add an additional A record with the following settings:
Host: @
Points To: The same IP as the other A record

---

Finally, edit the TXT record to have the following settings:

Host: codesphere-verification
TXT: Go back to Codesphere and copy and paste everything after the TXT in the DNS section

Your records should then look something like this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/68qd8av1cde21ahrhq37.png)

###Verify on Codesphere
Now that we have our DNS records configured correctly, we just need to verify it on Codesphere. To do so, go back to the domain menu and press "verification status". It may take a few minutes to verify the domain and automatically generate a certificate.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pun51lbl9lk3l1za8264.gif)


###Deploy the App
Once everything is in order, we are ready to deploy the application!

As you can see on the domain menu, the domain is connected to port 80, so you need to run your app on that port.

While the specific command that you need to run is going to differ according to the type of application that you're running, if you are using Codesphere's default to-do list app, we're just going to run `API_PORT=80 npm start`.

Once our app is deployed, you can go to your custom domain, and you should see your app!

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fqr3xk9nzryvrcnulrqk.gif)

Thanks for reading! If you want to see the video version of this tutorial, we recently released a tutorial video:

{% youtube ymNhCjdDCaQ %}

For more information and updates on how Codesphere is revolutionizing the software industry, follow us on our socials.

Stay tuned and Happy Coding!
4 THINGS I HATE ABOUT WINDOWS
Tags: linux, windows, computer, gitam
Published: 2021-05-10 15:54:33

Windows 10 has improved a lot since its 2015 release, but it has a long way to go


<b> DESIGN: </b>


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xre1pwt47bqz2a4jfhsa.jpg)

Starting off number one is Design
With Windows 10, Microsoft has combined the bests of Windows 7 and 8. But the design inconsistencies are all over the UI. Windows should change its approach from concentrating more on clean and flawless UI than customization features.

<b>PRIVACY AND DATA CONTROL:</b>


![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3siw60olwbt5605hvuvt.jpg)

It seems to me that the biggest Flaw that many people point to on Windows 10 is Privacy and Data control and also the forced updates, especially combined with poor quality control on those updates. You probably have heard that windows 10 "spy" on you and collects all sorts of information. Even if its a rumor but it will affect us.

<b>CORTANA:</b>

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hgwz9m2rt04uvobosjv7.jpeg)
Another reason is Cortana, I don't know a single person who uses Cortana only while using a computer. Instead, all of us use google assistant more. Even windows also ignore it they won't improve it or advertise it to encourage us to use it. Cortana doesn't have any unique features comparing with other voice assistants. As of now, Cortana has a long way to go to even stand a chance against google assistant or any other

<b>RESTARTING ISSUES:</b>

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

Everyone knows that if you have a problem with your computer the first thing everyone does is try to turn it OFF and ON again. But it doesn't solve anything once we shut down the system windows 10 will not close all the processes but instead, it will move the process and other stuff from the main memory to the hard drive. So when the computers will restore lots of same processes again. 
So to close everything out and fix something its better to restart because that will actually clear everything out from the memory.