teleren/devto huggingface dataset:
So what exactly are those pesky versions in your package.json and Gemfiles anyway? An introduction to Semantic Versioning
Tags: beginners, javascript, rails, github
Published: 2023-03-14 21:36:32

You may not give it a second thought, but as a software engineer, you come across Semantic Versioning every day. Simply put, it's a way of standardizing how version numbers are assigned and interpreted. It follows a three-part numbering system: **_Major.Minor.Patch_**. And trust me, understanding what each number means can save you a lot of time and headaches down the line.

Let's start with the **PATCH** version. This level is for implementation level detail changes, like small bug fixes. It's denoted by a number in the form of 0.0.**x**. So, if you see a new version of software that has changed the **PATCH** number, you can safely update your code without worrying about backwards compatibility issues.

Moving on to the **MINOR** version, which is denoted by a number in the form of 0.**x**.0. This level is for any backwards compatible API changes, like new functionality/features. So, if you see that a new **MINOR** version has been released, you can safely update your code and expect it to work as expected.

Finally, the **MAJOR** version, which is denoted by a number in the form of **x**.0.0. This level is for backwards incompatible API changes, such as changes that will break existing users' code if they update. So, if you see that a new MAJOR version has been released, proceed with caution and make sure you thoroughly test your code before updating.

Let's take an example. Suppose you want to build a toy 'magic-8-ball' application that can predict the future. Using semantic versioning, you might keep track of changes in your CHANGELOG like this:

- v0.1.0: Initial release, with the core 'magic-8-ball' prediction functionality.

- v0.2.0: Added color to the 8-ball because black and white is so last century.

- v0.3.0: Added a 'shake' method that shakes the ball so you don't have to.

- v1.0.0: Added a 'reveal' method to see the prediction without shaking the ball. Breaking change: prediction string now includes question asked.

- v1.1.0: Added a 'history' method to view previous predictions. Backwards-compatible: still returns only the latest prediction by default.

- v1.1.1: Fixed a bug in the 'history' method that prevented it from returning more than one prediction.

- v1.1.2: Fixed a bug in the 'reveal' method that was caused by the previous bug fix.

Semantic Versioning is a simple and powerful tool that can save you time and prevent headaches. Understanding what each number means can help you stay ahead of the game and make informed decisions when updating your code. So, next time you come across a new version of software, take a moment to check the version number and make sure you understand what each number means before updating!

Want to learn more? Check out [SemVer](https://semver.org). Preparing for a software engineering interview? Checkout [Firecode.io](https://firecode.io).
Anxiety ...
Tags: mentalhealth, anxiety, juniordeveloper, beginners
Published: 2023-03-14 21:14:56

I am sitting here wondering when the anxiety subsides with a new career path.  In healthcare I am literally superwoman who feels like I am really able to do / achieve anything.  When it comes to development I am smart and finding docs / codes / videos / explanations BUT when handed someone else's code I literally feel like I go blank.  Truth is I know MY code and if I break it the fact is that it is my own and I have time to figure out how to fix it.  Hand me someone else's code and I have got to look through / learn the style and THEN I can try to contribute but I fumble because I don't want to mess up.  I am overly critical of myself when it comes to being part of a team and having tasks handed to me.  

Question is when does that subside?  When do you become somewhat comfortable with other developer's code?  Waiting for the ah ha moment where my anxiety subsides and becomes confidence instead.

Trying to find MY way and I am reaching out for support from peers who have also been going through changing careers.
The Structure of the C Program
Tags: c, lowcode, beginners, alx
Published: 2023-03-14 21:11:01

## **Overview**
Most programming languages tend to have a structure or design, including C Language. C language is divided into five different sections which are: Documentation, Preprocessor command, Main() function, printf(…), and Return 0.

## **Introduction to the C program structure.**
Every human being has a particular structure that includes a torso, head, neck, and four limbs. The vast majority of objects have a distinct structure. Every programming language has a unique structure in a manner akin to this. You would have to use these structures whenever writing the code.
The structure of the c program can be divided into different parts, each having its purpose. This makes the program easy to read, modify, and document and makes it consistent in format.

## **Basic structure.**

1. The documentation, which is typically given in the form of comments, includes a brief description of the program, the name of the programmer, the creation date, and more.
2. Preprocessor command: This processor command instructs a C compiler in the stdio.h file to proceed with the actual compilation before the preprocessor command is executed.
3. The main function, Main(), is where the program actually starts to run.
4. Another function in C called printf(…) causes the text "Hello, World!" to be printed or displayed.
5. Returning 0 closes/terminates the main function and gives the number 0.

Taking this example of c program. hello.c

```
/**                         // Documentation
  * file: hello.c
  * Author: your-name
  * description: program to print hello world
*/

#include <stdio.h>         // Proprocessor command

int main(){                // main function
printf("Hello World! \n);
return 0;

}
```

## Assemble and run a C program.

1. By following these few instructions, this task should be simple.
2. Add the required code in a file editor.
3. Saving as hello.c
4. Enter the command prompt and navigate to the saved file's directory.
5. To compile your code, execute the command gcc hello.c.
6. If there are no mistakes, the code will move on to the following line and create an executable program.
7. In order to run your application, type a.out.
8. The message "Hello World!" will appear on screen.

```
gcc hello.c
./a.out
Hello, world!
```

## **Conclusion**

- The documentation, preprocessor command, main() function, printf(…), and return 0 sections are the six five sections in all.
- The main() function is a requirement for all C programs, although the others are optional.
- Well-structured C programs make debugging easier and increase readability and scalability.
Why You Should Deploy Your Smart Contract with Thirdweb
Tags: solidity, thirdweb, blockchain, erc721
Published: 2023-03-14 21:01:07


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

When it comes to deploying smart contracts, Thirdweb is a total game-changer. Deploying a smart contract requires writing complex scripts, managing private keys, and dealing with RPC URLs. However, with Thirdweb, we can deploy a smart contract without exposing any private keys or writing any scripts. That means they are not needed in our code at all. This takes away a significant amount of stress and saves us a lot of time.

To deploy a smart contract on Thirdweb, we only need to follow a few easy steps. First, we need to build and compile our smart contract in our code editor of choice. I personally prefer to use VSCode and Hardhat to compile my contract. Once the contract is compiled without any errors, we can then deploy it to Thirdweb.

All you need to do is execute "npx thirdweb deploy" in your project terminal, and the Thirdweb dashboard will pop up. From there, you can configure and deploy your contract to the selected blockchain. For this demo, I used the Goerli(ETH) testnet. Once deployed, you will have access to the contract explorer. The contract explorer is extremely useful because you can see all of the contract details like functions, events and source code.

My NFT ERC-721 contract: https://thirdweb.com/goerli/0x59fca2b861A7f81f08CD1E9a98325bfdc2d9B9ea. 

The contract explorer's most notable feature lies in the code tab, where Thirdweb produces code snippets that enable easy contract building without the need for hours of manual coding. You can also import existing smart contracts from other platforms into Thirdweb, further simplifying the deployment process. 

One of the biggest advantages of using Thirdweb is its security. As developers, we are always concerned about the security of our smart contracts. With Thirdweb, we can be sure that our contracts are deployed securely and without exposing our private keys. This allows us to focus on other aspects of our development process.

I highly recommend using Thirdweb to deploy smart contracts and build on your favorite network. Thirdweb streamlines the process by removing the necessity of intricate scripts and the potential vulnerability of revealing private keys. In addition to its deployment capabilities, it offers a user-friendly interface and remarkable development tools. 

For more details, checkout Thirdweb’s blog post on ‘Any EVM, Any Contract’ https://blog.thirdweb.com/any-contract-any-evm-chain/. [](url)

My github repo: https://github.com/outerspacesoph/thirdwebNFT
Assignment 1 Version Control, Journal, Slack
Tags: osdc, github
Published: 2023-03-14 20:41:41

I just started OSDC 2023 course with @szabgab OSDC and here is my first assignment:
My name is Zohar and I'm student of MSC. in Azrieli college [azrieli site](https://www.jce.ac.il/)

This is my [github](https://github.com/zoharasulin)

I would love to tell you a little about me:

I am  27 years old, happily married and mother of 3 sweet children.

For two years I have been working as a data developer and analyst.

I love what I do and am interested in software and data.

I expect that [in this course](https://github.com/zoharasulin/osdc-2023-03-azrieli) I will be able to master github and share public projects to improve the world and help developers like I am helped by web searches.
PHP/Laravel: <embed> cannot display 30MB+ PDF file
Tags: php, laravel, pdf, displaylargepdffile
Published: 2023-03-14 20:36:12

Hi folks!

If I pass the direct url to the PDF file, <embed> can display large PDF file, but if I generate preview url for that file, and in that preview page return the PDF file content, <embed> cannot display it, showing error: 

Failed to load PDF document

preview page (Laravel):

```
public function preview(Request $request) {
  $pdfFileContent = $this->storage->getFileContent($request->uuid);
  return response()->make($pdfFileContent, 200, [
         'Content-Type' => 'application/pdf',
         'Content-Disposition' => 'inline',
  ])
}
```

view PDF:

```
<embed src="/file/preview/{uuid}" width="100%" height="800" type="application/pdf"></embed>
```

Any help would be appreciated! Thanks beforehand!
Migrate an ASP.NET web application to AWS Elastic Beanstalk Windows Web Application Migration Assistant (WWAMA)
Tags: aws, cloud, awscommunity, 100daysofcloud
Published: 2023-03-14 20:35:58

[73/100] #100DaysOfCloud Today, I migrated a sample ASP.NET web application to a fully managed Elastic Beanstalk environment using the Windows Web Application Migration Assistant (WWAMA).


AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, .NET, PHP, Node.js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.

You can simply upload your code and Elastic Beanstalk automatically handles the deployment, from capacity provisioning, load balancing, auto-scaling to application health monitoring. At the same time, you retain full control over the AWS resources powering your application and can access the underlying resources at any time.

You can try do it by yourself by following the steps from the link below: [GitHub](https://github.com/aaditunni/100DaysOfCloud/blob/main/Journey/073/Readme.md)
React and Firestore Part 2
Tags: javascript, webdev, react, firebase
Published: 2023-03-14 20:12:34

Hello guys!
In the previous tutorial, Part 1, we learned how to save and get data from Firestore, which is a cloud-hosted, Firebase NoSQL database. We also learned how to create and integrate a Firestore database to React.

In this part 2, we will learn how to update, delete and sort data.
**You can read the detailed version of this article here:**
>[React and Firestore: A complete tutorial - Part 2](https://discover.hubpages.com/technology/React-and-Firebase-A-complete-tutorial-Part-1)

---

## Updating Documents in Firestore

In your React file, let's say App.js, import the database from the firebase.js file. Next, get the collection (we will call it "users") and check whether the document you want to update exists or not.

If it does exist, we can update it exists using the update method. We will provide this method an object that will contain the name attribute and its updated value.

```javascript
import React from "react";
import db from "./firebase";
function App() {
  const getData = async () => {
    //get the user
    const user = db.collection("users").doc("user1");
    const doc = await user.get();
    //check if user exists
    if (doc.exists) {
      //if user exists, update the name
      await user.update({ username: "Mike" });
    } else {
      console.log("User does not exist!");
    }
  };
  getData();

  return <div className="app"></div>;
}
export default App;
```

## Deleting Documents in Firestore

Once again, we will check if the document exists and if it does, we will delete the document using the simple delete method.

```javascript
if (doc.exists) {
   //if user exists we delete it
   await user.delete()
} else {
   console.log("User does not exist!");
}
```

## Sorting

Detailed information on sorting which includes Getting a List of Documents and Sorting based on a specific attribute is discussed in the detailed article. Check it out:
>[React and Firestore: A complete tutorial - Part 2](https://discover.hubpages.com/technology/React-and-Firebase-A-complete-tutorial-Part-1)

---

Thanks for Reading!
Check out my personal [blog](https://salehmubashar.com/blog) too
#DEVDiscuss: Coding Against Bias
Tags: devdiscuss, wecoded
Published: 2023-03-14 19:58:29

*image created by [Margaux Peltat](https://www.patreon.com/margauxpeltat) for the [Chilled Cow YouTube channel](https://www.youtube.com/watch?v=lTRiuFIWV54)*

Time for #DEVDiscuss — right here on DEV 😎

Inspired by our ongoing [#WeCoded](https://dev.to/wecoded) celebration, tonight’s topic is...**coding against bias**!

It will come as a surprise to very few that [algorithms](https://en.wikipedia.org/wiki/Algorithmic_bias), [user interface design](https://www.nngroup.com/articles/confirmation-bias-ux/), and other aspects of the technology we used are just as biased as the people who make them—often unintentionally so.

For today's #DEVDiscuss, we want to uplift people, projects, and case studies that are **coding against bias**.

This is a rich topic, so we encourage you to think on it, do some research, and bring some thoughtful considerations to the conversation. Take all the time you need!

---

Questions:
- **Who are some people or projects that are coding against bias?**
- **Do you know of any case studies to share?**
- **Have you ever used your technical skills to combat bias or other inequity?**
- **What are some things to keep in mind when coding against bias?**
- **Any triumphs, fails, or other stories you'd like to share on this topic?**
Suggest a Feature for Flexify 🦄
Published: 2023-03-14 19:55:57

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/itqwmlc5o5ejvjp3ijmq.png
---

So, you know the gist of Flexify, right? In case you don't, Flexify is a handy cross-based open-source add-on, currently under active development, that allows you to have full control over any web page out there with a click of a button, which in turn allows you to improve the accessibility of any website, while also promoting inclusivity by helping people with disability.

Up until this moment, I have filed [a handful list of issues](https://github.com/wiseaidev/flexify/issues) I am working on in my spare time and some needs help/feedback from you. So, It would be awesome if you could help by suggesting features, and creating/joining discussions, or anything of that nature...

So, what are you waiting for? Let's work together towards a more flexible (hence the name Flexify), accessible, and inclusive web!
displaying images in sfml
Published: 2023-02-14 07:10:54

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d50x45sg4orv996hsn0e.jpeg)


**step 1**
first of all you need to [install SFML](https://www.sfml-dev.org/download.php). I am using [kali linux]
(https://www.kali.org/) and i found the linux installation guide [here](https://www.sfml-dev.org/tutorials/2.5/start-linux.php).

**step 2**
next you need to make a window i made a guide [here](https://dev.to/dwarft/creating-a-window-in-sfml-gnh) but i will give you the code anyway. Enter this code into your preferred text/code editor:

```cpp
#include <SFML/Graphics.hpp>

int main()
{
    // create the window
    sf::RenderWindow window(sf::VideoMode(800, 600), "Hello window!");

    // run the program as long as the window is open
    while (window.isOpen())
    {
        // check all the window's events that were triggered since the last iteration of the loop
        sf::Event event;
        while (window.pollEvent(event))
        {
            // "close requested" event: we close the window
            if (event.type == sf::Event::Closed)
                window.close();
        }

        // clear the window with black color
        window.clear(sf::Color::Black);

        // draw everything here...
        // window.draw(...);

        // end the current frame
        window.display();
    }

    return 0;
}
```

then check that the window will display by compiling it with:`g++ main.cpp -o main -lsfml-graphics -lsfml-window -lsfml-system` and run it with: `./main`

**step 3**
first you will need to find an image to use. i will be using this one: 
![mushroom](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgjjwvzh89u0fdepe0xq.png)

**step 4**
now we will implement the code. this is what the code for displaying the image on the window should look like:

_note_: on line 8 change the Mushroom.png to your file of choice.

```cpp
#include <SFML/Graphics.hpp>
#include <iostream>

int main(){
        int x = 100;
        int y = 100;
        sf::RenderWindow window(sf::VideoMode(800, 600), "Hello Window");
        sf::Texture texture;
        if (!texture.loadFromFile("Mushroom.png")) {
                std::cout << "Could not load enemy texture" << std::endl;
                return 0;
        }
        while (window.isOpen()) {
                sf::Event event;
                while (window.pollEvent(event)) {
                        if (event.type == sf::Event::Closed)
                                window.close();
                }

                window.clear(sf::Color::Black);

                sf::Sprite image;
                image.setTexture(texture);
                image.setPosition(sf::Vector2f(x,y));
                image.scale(sf::Vector2f(1,1.5));
                window.clear();
                window.draw(image);

                window.display();

        }

        return 0;
}
```

**step 4**
we will compile this by doing: `g++ -o main main.cpp -lsfml-graphics -lsfml-window -lsfml-system` and then run it with: `./main`

**step 5**
enjoy and have a good day.
How does Android SDK updates affect android developers?
Published: 2023-03-14 19:55:15

We can understand that with an example that
From Android SDK version 24 (Nougat) to 25 (Nougat), there were several API updates and changes that could impact Android developers. Here are some of the notable updates:

    Multi-Window Support: Android SDK 24 introduced support for multi-window mode, but it was further improved in SDK 25 with new APIs to help developers manage multi-window mode, such as the new Activity.isInMultiWindowMode() and Activity.onMultiWindowModeChanged() methods.

    Notification Enhancements: The Notification API was updated in SDK 25 to include new features such as the ability to set custom views for notifications, and a new method called Notification.Builder.setPriority() that allows developers to set the priority level of a notification.

    Java 8 Language Features: Android SDK 25 added support for Java 8 language features, such as lambda expressions and method references, which can help developers write more concise and expressive code.

    Power Efficiency: Android SDK 25 introduced several new APIs to help developers optimize their apps for power efficiency, such as the JobScheduler.setRequiresDeviceIdle() and JobScheduler.setRequiresCharging() methods.

    Improved Media Support: The Media API was updated in SDK 25 to include new features such as the ability to create and configure MIDI devices, and the ability to record multiple audio streams simultaneously.

These are just a few examples of the API updates and changes that occurred between Android SDK versions 24 and 25. Developers would need to review the full list of changes and updates to determine how they might impact their apps and what changes may need to be made to ensure compatibility and optimal performance.