teleren/devto huggingface dataset:
Storage Classes in C
Tags: computerscience, c, programming, storageclasses
Published: 2022-03-08 15:29:01

Every variable possesses 2 features i.e. type and storage class. Type refers to the data type of the variable whereas storage class determines the visibility and scope of the variable.

## Types of Storage Class in C

### 1. Automatic Storage class
Auto storage class is the default storage available in C. Objects having auto storage are defined by a system with a garbage value. It is for variables defined inside a function or a block often referred to as local variables.

```C
{
    char rank;
    auto char rank;
}
```
Both are the same way of declaring a variable having an automatic storage class.

### 2. Register Storage Class
Variables with register storage have properties similar to automatic storage classes in many aspects like local scope, garbage initial value. 
However, instead of storage on RAM, variables with registered storage classes are stored on registers. Thus the maximum size of such variables would be restricted to the size of the register. Operators like unary '&' operator are not applied to it. 
Examples of such variables are counter etc.


```C
{
   register int counter_count;
}
```

### 3. Static Storage Class
Variables having static storage are initialized during compile time. Thus they are independent of the function call stack, which makes them alive even after the function scope is over. 
The life of the static variable remains till the end of the program. By default, static variables are initialized with the value ‘0’.


```C
#include <stdio.h>
 
void func_count();
 
static int glob_var = 6; /* global variable with initial value of 6 */
 
main() {
 
   for (;  ; glob_var --) {
      func_count();
   }
   
   return 0;
}
 
 
void func_count() {
 
   static int y = 7; /* local static variable with initial value of 7*/
   y++;
 
   printf(" y is %d and glob_var is %d\n", y, glob_var);
}
```

### 4. External Storage Class
Variables with extern storage classes are used to give reference to global variables which are visible to ALL program files.

In a program having multiple files, it becomes customary to define a global variable or function, which can be used in other files, then usage of extern becomes handy. It will be used in another file to provide a reference of a defined variable or function.


```C
// file 1
 
# include <stdio.h>
int counter ;
extern void print_extern();
 
int main (){
    counter = 5 ;
    print_extern ();
}
 
//file 2
# include <stdio.h>
extern int counter ;
 
void print_extern(){
    printf ("counter is %d", counter);
}
```

## Conclusion
In this article we have looked into only the types of storage classes. If one needs to look further on memory layout in C and how storage takes place in C, then one should look into this curated article published by Scaler topics on [Storage Classes in C](https://www.scaler.com/topics/c/storage-classes-in-c/).
Umbraco 9 - BlockList editor with added ViewComponents
Tags: dotnet, umbraco, csharp, dotnetcore
Published: 2022-03-08 15:17:38

Umbraco 9 is built using .net 5, which is .net core. This allows us to utilise ViewComponents with BlockList editor within Umbraco.
- https://umbraco.com/products/umbraco-cms/umbraco-9/
- https://our.umbraco.com/documentation/reference/templating/mvc/ViewComponents-index/ 

We've updated our blocklist implementation to use the following code to make use of ViewComponent invoking. The following code is an extract from the views/partials/blocklist/default.cshtml view.

```csharp
@inherits UmbracoViewPage<BlockListModel>
@inject IOptions<OurConfiguration> _configuration
@inject IViewComponentSelector _selector;
@if (Model == null || !Model.Any()) { return; }

@foreach (var block in Model.Where(x => x?.ContentUdi != null))
{
    if (block.Content is SiteMapTree)
    {
        @await Component.InvokeAsync(block.Content.ContentType.Alias, Umbraco.AssignedContentItem)
    }
    else if (_selector.SelectComponent(block.Content.ContentType.Alias) is not null)
    {
        @await Component.InvokeAsync(block.Content.ContentType.Alias, block.Content)
    }
    else if (block.Content.ContentType.Alias.Equals(Form.ModelTypeAlias))
    {
        @await Html.PartialAsync("components/" + block.Content.ContentType.Alias + "/default", block.Content)
    }
    else
    {
        @await Html.CachedPartialAsync(
            "components/" + block.Content.ContentType.Alias + "/default", 
            block.Content,
            TimeSpan.FromSeconds(_configuration.Value.CacheDuration), 
            true,
            contextualKeyBuilder: (model, viewData) => (model as IPublishedElement)?.Key.ToString())
    }
}
```

If we take the code above apart, we're doing a series of new things... 

1. We're injecting directly into our view, which allows us to inject our configuration and the IViewComponentSelector. https://docs.microsoft.com/en-us/aspnet/core/mvc/views/dependency-injection?view=aspnetcore-6.0

2. SiteMapTree ViewComponent has a specific implementation that we need to pass the AssignedContentItem. 

2. We can now test to see if our block is a ViewComponent and Invoke it without having to type out each block. This is what the IViewComponentSelector is for, as it can tell us whether the block is a ViewComponent. 

3. If the block is a Form, we can avoid caching, as this is bad. Never cache a form, this can result in customer data being stored in cache and showing for another request. 

4. If the block is a simple block, without any logic and not a form, we can then cache it and serve it directly through a partial. 

All components are then stored under components directly in the root of views. This is standard .net core practice for ViewComponents: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-components?view=aspnetcore-6.0

This allows us to create components in Umbraco for the BlockList editor, then add renderings all within one area. This keeps everything nice and neat. 

Any improvements or suggestions let me know!
How to install Apache APISIX Dashboard with Docker in Windows
Tags: apisix, apigateway, docker, devops
Published: 2022-03-08 15:16:58

**What is APISIX?**

Apache APISIX is Cloud-Native API Gateway. It provides rich traffic management features like Load Balancing, Dynamic Upstream, Canary Release, Circuit Breaking, Authentication, Observability, and many more.

**Why APISIX?**
Reduce time fighting bugs, focus on designing world-class systems
Apache APISIX is the first Open source API gateway, with a built-in low-code Dashboard offering a powerful and flexible interface for developers to use. The Apache APISIX Dashboard is designed to make it as easy as possible for users to operate Apache APISIX through a frontend interface. It’s opensource and ever evolving, feel free to contribute.

**Requirements**
- Docker Desktop
- Git
- VS Code

**Installation**
In order to install APISIX Dashboard with Docker, first clone the [repo](https://github.com/apache/apisix-docker):
```
git clone git@github.com:apache/apisix-docker.git
```

![Terminal view after clonning the apisix-docker repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e0luzes1th1w1vhyr9s7.PNG)

Navigate to the "example" folder of the repo:
```
cd apisix-docker/example
```

Now, we can start all modules with docker-compose as mentioned in the documentation of the repository:
```
docker-compose -p docker-apisix up -d
```
Then we should see the screen similar to this one:

![Docker compose finished on apisix-docker](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3z2q1i30n0fc8xkh4op2.PNG)

If you check you Docker Desktop, you should see the list of running containers:

![APISIX Containers running on the Docker Desktop](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qznwsskknu1xj49zqjm2.PNG)


**Usage**
In order to open Dashboard running locally, you should visit this url:
```
http://localhost:9000/user/login
```

To get login credentials, open the clonned "docker-apisix" folder with VS Code:

![APISIX Dahboard conf.yaml file](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lcd9cnvh6gpledkmr11n.PNG)

So, as we can see from the conf.yaml file, login credentials for admin and user are different:
```
Admin
Username: admin
Password: admin

User
Username: user
Password: user
```
After succesfull login, welcome screen should be opened:

![APISIX Dashboard image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/msisf3szuh8f34srnn1g.PNG)

That's it for this tutorial. I hope it will be helpful to get started with Apache APISIX. You can also watch the demonstratio of these steps above on our [YouTube video](https://youtu.be/dUOjJkb61so). Comment below, if you have any question and share this post to help other developers to learn something new. If you want to contribute APISIX project, please visit this [link](https://apisix.apache.org/docs/general/community).
React State Management (2) : Redux
Tags: javascript, webdev, react, redux
Published: 2022-03-08 15:13:22

React state management: context API, Redux and Redux toolkit. The topic in this article is Redux.

The chart below is the whole image of this practice application. Component A accepts user input text and passes it over to Component B as a prop. At the same time, dispatch the action to save the data in the store so that Component C and component D can use it.

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

[Redux Fundamentals, Part 1: Redux Overview | Redux](https://redux.js.org/tutorials/fundamentals/part-1-overview#data-flow)
Nevertheless, Lars Coded and will code again
Tags: wecoded
Published: 2022-03-08 15:05:50

This tag inspired me to tell a bit about my story.
It's been a while that I am working in tech, with all the ups and downs I'm still here!

I was the **only woman** in the office or in my styding group classes several times. It was challenging but I was brave enough to keep going and learning a lot.

Last year I had a **daughter**. And that was by far the most challenging thing I have ever done with my life and also my career. I took a 7 months **maternity leave** and decided to **move abroad** with a baby. That required me to leave my current job, settle down in the new country and try to find a job here. I am finally starting to work on the last one!✨

It's crazy for me because I've never been that much time away from work, and it's not common to see people in tech having babies (I think it's getting better now and I am helping with that number!).

I put so much pressure on me about finding a good job, if I will be able to do tech interviews after a long time without doing it. 

I love to code, and I miss it in my daily life but it's not a bed of roses you know.

My goal is to have a new job now with a good work and life balance. No more coding past 10pm and I want it to be light for you too! Don't put that much pressure on yourself because you work in tech. We need to stop this image of _"you love what you do and you do it limitless"_. That's not healty.

For more woman in tech and more work and balance life!

![Me trying to work with a 7 month baby](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xd6j039r62pv86x6obzp.jpg)
Dark Web3 Style CSS Text Gradients
Tags: css, web3, webdev, tutorial
Published: 2022-03-08 14:53:18

Gradient text is becoming increasingly popular all over the web. We even use it on Fjolt in various places. In the past, gradient text required static images, but now it can easily be done with CSS rather than photoshop.

## Web3 Text Gradient Style
In this quick guide, we'll create a few different text gradients. These text gradients are very common in Web3 designs. Here are a few examples below, with an added glow to make them seem more futuristic:

## Web3 Style Gradient

{% codepen https://codepen.io/smpnjn/pen/RwjmjMv %}

## How do CSS Text Gradients Work?

It might surprise you to know that CSS gradient text is actually done through an unstandardized set of webkit CSS properties. These properties have become so pervasive on the web, that even Firefox supports them now.

Since most other browsers are largely chromium based, gradient text has very broad support in all modern web browsers for a set of non-standardized properties. Worried about older browsers? Since these are webkit properties, older browsers just ignore them, so you don't need to worry much about support.

That means those who can see gradient text, do, and those that cannot, just see the normal text color. Easy!

## Adding Gradient Text

To add gradient text, we need to add the following CSS:
```css
.text {       
    background-image: linear-gradient(225deg, #28d8ff, #032eff);
    filter: drop-shadow(0 20px 30px #28d8ff33);
    color: black;
    -webkit-text-fill-color: transparent;
    -webkit-background-clip: text;
    -webkit-box-decoration-break: clone;
}
```

Let's break this down:
- **background-image** - is the gradient we want to use for our text
- **-webkit-text-fill-color** - replaces the normal color of the font with a transparent color, so the text disappears!
- **-webkit-background-clip** - clips the background image to the outline of the text. Now the background will only show where the text is.
- **-webkit-box-decoration-break** - is the strangest property I've ever seen in CSS, but it ensures the gradient works on multiple lines.
- **filter** - since we're using background clips and text, we can use a filter for the drop shadow rather than a normal box shadow.

Now it's up to you what gradient you want! Just adjust the background-image colors to show the gradient style you desire. [You can find the full code for this demo here.](https://codepen.io/smpnjn/pen/RwjmjMv)
Crypto Capable 
Tags: community, web3, blockchain, crypto
Published: 2022-03-08 14:42:53

**Web3** is everywhere nowadays and Indian VCs, startups are extremely bullish on it. Every developer, either web2 dev or beginner nowadays wants to be a part of it but only some of them get the chance. Reasons may include lack of resources, not fully explored, and many more. But, the most important thing is lack of great communities.

![CC](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bkfzvihmw7j3ux4qz5j.jpg)

![CC](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cr857yotqknaw5abmxe5.jpg)

[**Crypto Capable**](https://cryptocapable.community) is a community driven ecosystem where we believe learning should be collaborative and fun. Web3 is still very early and we want everyone to step into it and explore as much as they can. 
So, we are bringing three tracks for folks who want to be part of it. ⬇️

<br>- [**Learner Track**](https://www.cryptocapable.community/web3-learner) </br>
Want to shift from web2 to web3? Here you go.
<br>**Perks**</br>

1. Curated learning path and Certification program.
2. Get additional support to complete the NEAR Certified Developer program (NCD)
3. Learn how to write smart contracts and deploy production ready dapps
4. The certifications are facilitated by highly experienced third party educators from NEAR


<br>- [**Campus Ambassador Program**](https://www.cryptocapable.community/campusambassador) </br>
Want to become a community leader at your college? This program is for you. 
<br>**Perks**</br>

1. A stipend for evangelising web3 in your campus community
2. Become the go-to person for all things crypto among your peers by hosting events and connecting people
3. Certificate of Completion signed by NEAR Education team and Crypto Capable.
4. Swag pack containing T-shirt, laptop stickers and other goodies (NEAR and Crypto Capable branded).

<br>- [**BUIDL Track**](https://www.cryptocapable.community/buidl)</br>
For folks who are NEAR Certified Developers, Experienced web developers (preferably with some web3 development experience).
<br>**Perks**</br>

1. Work on live ongoing project with $500+ stipend
2. Certificate of completion
3. Receive grants from the NEAR Business team to work on your own project
4. Get prepped to fulfil the insane demand for web3 developers
5. Free membership to a premium decentralised finance learning community

**You might be confused why I used NEAR protocol image as background? Right?**

🥳We are partnered with [**NEAR PROTOCOL**](https://near.org/)
which is a software that aims to incentivize a network of computers to operate a platform for developers to create and launch decentralized applications.<br> Still confused? Watch this video below. ⬇️

{% embed https://youtu.be/1cozsZP8yd4 %}

**Thank you for reading, and let's connect!**
😊 Thank you for reading my blog. Feel free to ask any questions regarding the program in any of my socials.
[**Twitter**](https://twitter.com/aniketh_88) or [**Linkedin**](https://www.linkedin.com/in/aniketh-paul-7728691bb/)
4 ways to center a component/div in CSS
Tags: webdev, css, beginners, javascript
Published: 2022-03-08 14:38:16

- Flexbox 
- Grid 
- Margin auto on a flex item
- Position

```css
/* Using Flexbox */
.parent {
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Grid */
.parent {
  display: grid;
  justify-content: center;
  align-items: center;
}

/* Grid */
.parent {
  display: grid;
  place-items: center;
}

/* margin auto on a flex items */

.parent {
  display: flex;
}
.child {
  margin: auto;
}

/* Using Position */
.parent {
  position: relative;
}

.child {
  position: absolute;
  top: 0;
  left: 0;
  transform: translate(-50%, -50%); /* OR right: 0; bottom: 0; */
}
```
[Azure Trial Hackathon - SonarQube community branch plugin on AKS]
Tags: azuretrialhack, microsoft, azure
Published: 2022-03-08 14:33:14

---
title: [Azure Trial Hackathon - SonarQube community branch plugin on AKS]
published: true
description: I started this project for the Microsoft Azure Trial Hackathon on DEV!
tags: azuretrialhack, microsoft, azure
---

### Overview of My Submission
My project is for the Developers who need to deploy the SonarQube which is the code quality tool on the Kubernetes cluster. This tool is useful for the software company to analyze the code before deploying the code on a production/staging environment. It would be helpful for Devs who need to set up like me :)

### Submission Category: Computing Captains

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% github link_to_your_repo %}` to share a GitHub repository)
[Note]: # (Your repository must include a README)
[Note]: # (You must use and list a permissive license for your code: MIT, Apache-2)

### My Github Repository: {% github https://github.com/ninefyi/azuretrialhack-2022 %}

### Software deployment on AKS
- Website: SonarQube Community Editon
- Database: Postgres
- SSL: Letsencrypt

### Azure resources
- Azure Kubernetes Services
- Azure Public IP Address

![alt_text] (https://raw.githubusercontent.com/ninefyi/azuretrialhack-2022/main/screenshots/1.png)

![alt_text] (https://raw.githubusercontent.com/ninefyi/azuretrialhack-2022/main/screenshots/2.png)

![alt_text] (https://raw.githubusercontent.com/ninefyi/azuretrialhack-2022/main/screenshots/3.png)

![alt_text] (https://raw.githubusercontent.com/ninefyi/azuretrialhack-2022/main/screenshots/4.png)

DEV usernames: [ninefyi](https://dev.to/ninefyi)
Paracetamol.js💊| #73: Explica este código JavaScript
Tags: javascript, spanish, beginners, webdev
Published: 2022-03-08 14:30:06

## **Explica este código JavaScript**

```js
console.log(undefined || "0" || null || (undefined ?? 0))
```

A. `0`
B. `"0"`
C. `undefined`
D. `null`

Respuesta en el primer comentario.

---
Pragmatic programmers ask why
Tags: productivity, webdev, programming
Published: 2022-03-08 14:18:18

There is something about progress that hides past decisions into new solutions. Throughout history, problems are solved with tools that generate other problems that are solved with other tools. This keeps looping until we forget the whys. "Why does almost every User-Agent starts with Mozilla? And what the heck is Gecko?", "why do we need Unicode?", "why do we need HTTPS?".

Thanks to open-source software you can be a great programmer without ever asking these questions. I'm not suggesting you solve those problems on your own, but asking *why* helps you develop a pragmatic critical thinking, which is different from mere curiosity. The bad side of curiosity killed the cat and can drive you unproductive. On the other hand, the pragmatic inquisitiveness results in usable knowledge.

As an example, knowing the decisions that evolved the web into HTTP/3 teaches you high-level software engineering that is not purely theoretical - which has its value - but practical. Bonus: if you're interested in learning this, I recommend you [this MDN article about the Evolution of HTTP](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP#post-http2_evolution).

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

The good news is pragmatic critical thinking is a learned skill. I listed three habits to help you ask *why* to what matters. You may already be doing things to develop this skill, but being conscious about it accelerates this process.

**1. Recognize your assumptions**
The definition of assumption is "something that you accept as true without question or proof". If you mainly use object-oriented programming, you might fall into the error of assuming "one always need classes and methods to create a program". Or even ["the time 23:59:60 is always invalid"](https://www.creativedeletion.com/2015/01/28/falsehoods-programmers-date-time-zones.html). Beware of the words "always", "must" or "should", as they usually indicate an assumption.

**2. Debug your assumptions**
Before asking why, ask if your assumption is really true. Use your logic to support your assumption, test it, and if it's shown to be false, go to the next step.

**3. Seek answers**
This is where curiosity gets killed and your good habit of pragmatic inquisitiveness will be established. You're building reusable knowledge that will help you question more and more.

All things considered, it's common to believe in falsehoods. Use it as a cue to support your habit of questioning pragmatically and enjoy the answers you find along the way.
Hello Developer! Don't React!!
Tags: wecoded, javascript, react
Published: 2022-03-08 14:12:44

Happy International Women's day 


Few articles I would like to share here:


https://overreacted.io/goodbye-clean-code/https://overreacted.io/goodbye-clean-code/

https://sandimetz.com/blog/2016/1/20/the-wrong-abstraction

https://odannyboy.medium.com/how-to-do-creative-work-74ca6f68976f