teleren/devto huggingface dataset:
#2 Understanding Variables, Input and Output: C++ and DSA
Published: 2023-12-07 03:30:48

Last blog we studied the introduction to C++. In this blog post, we'll be studying about variables, how to take input from the user and how to dispaly the output and how they form the building blocks of C++ progrms.

## What are variables?
Variables are conainers that hold data in a program. they act as placeholders for storing information that can be manipulated and used through out the program's execution. In C++, variables must be declared beforethey are used. A declaration specifies the data type of the variable and the name of the variable.
Syntax and examples for variable declaration: 

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

Once the variables are declared you can assign values to it using assignment operator "=":

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

Beside assigning values to the variables manually, one can take them as input from the user, which is discussed below.

## Input in C++:
Getting input from the user is a basic requirement in many programs. This can be done using "_**cin**_" stream available in C++.
To get input from the user you need to include the header file "**_isotream_**" in your program as shown below :

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


Example of taking input using "_**cin**_" stream :
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/72nmkl0ea4gphocawwbb.png)



This will show the Output as:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0wwiriyp08piu8kunaic.png)

In this example, the program prompts the user to enter marks, reads the input using "_**cin**_", and then displays the entered value using "**_cout_**".

## Output in C++:
Output in C++ is achieved using the cout stream. It is used to display information to the console.

Example demostrating Output in C++:

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

Output from the above code:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e3gwk4zhgvk3jalcm0y4.png)

In this example, the program outputs the values of variables _marks_, _cgpa_, and _grade_ to the console.


This was all for today. Next we will be seeing the Operators in C++.
Happy Coding!
Setting up a new Sitecore XM Cloud - Next.js project
Tags: sitecore, xmcloud, nextjs, dxp
Published: 2023-12-07 03:28:16

In this blog post, we will guide you through the process of creating a new project using the Sitecore starter template, breaking down the steps for a clear understanding. Additionally, we will walk you through the setup of the local environment using Docker containers. Along the way, we'll explore some valuable tricks and highlight common mistakes that individuals often encounter when configuring this setup for the first time. 

## Creating a repository
- If the repository hasn't been created yet, you can leverage the Sitecore template to effortlessly initiate a new project, complete with all the necessary files.

![Starter template repository](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d6f8f2ppd1zasa1ivysy.png)

- After completing the initial step, clone the repository to your computer and proceed with the following steps
 - Open PowerShell with administrator privileges.
 - Navigate to the project directory.

> It's important to already have a Sitecore license in your computer. 

 - Make sure you're running docker on **Windows Container** and not Linux Containers.
 - Stop any Solr instances.
 - Stop the IIS 

- Perform the first command (you can find this also in the README.md that comes with the project when creating the repo).

![Before running the init command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36owqlthv1w4pw6he6x9.png)
 - Make sure about the path of your license and select a secure password for your environment 

- After succesfully completing the previous step you'll see something like this on your terminal:

![After running the init command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q61kgrs8jggxnfqm7gy6.png)

- "It is crucial to **restart your terminal** at this point;  failure to do so may result in errors during the subsequent steps.
- Execute the **./up.ps1** command; this will initiate the download of all the necessary files and images required for the containers.

![Running the up command, downloading dependencies and images for docker containers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zltnthnurf3zrx16srp0.png)

- If everything went right, and after login with your Sitecore Portal account, you should see something like this: 

![After succesfully running the up command](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q5p4u7yl22augxpq44ko.png)

- Finally, for the last step, create a .env.local file within the project folder and populate the necessary fields, including:
 - SITECORE_API_KEY
 - GRAPH_QL_ENDPOINT
Ensure the values are aligned with those configured on the cloud instance of your project.
How to create an AWS S3 Folder in a existing Bucket
Published: 2023-12-07 03:27:30

Here the code:

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

And here the results:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hdg5arvevgbl6xpq8ojs.png)
HIRE A HACKER FOR CHANGE OF SCHOOL GRADES ......
Tags: news
Published: 2023-12-07 03:02:30

Are you tired of struggling with your school scores? Look no further than Contact Folkwin expert recovery! By seeking assistance from this amazing service, you can unlock a world of advantages that will have a positive impact on your academic performance and overall learning experience. Folkwin expert recovery provides you and other students with a lot of advantages. First of all, their team of professionals is prepared to offer individualized care that is catered to your particular requirements. They can aid you if you're having trouble with a specific subject or would like to improve your study habits. Additionally, utilizing Folkwin expert recovery can boost your confidence and motivation. By receiving guidance and encouragement from experienced professionals, you'll feel empowered to overcome any challenges standing in your way. Gone are the days of feeling overwhelmed or defeated. With their help, you can conquer your academic goals with ease. Don't just take these word for it; let the success stories of fellow students inspire you. Folkwin expert recovery has helped countless students achieve remarkable academic improvements. These inspiring testimonials highlight the effectiveness of the services provided and serve as a testament to the life-changing impact they can have. Students who were once struggling and disheartened found renewed motivation and achieved outstanding results with the help of Folkwin expert recovery . From failing grades to top of the class, these success stories showcase the transformative power of seeking assistance and utilizing the resources available to you. You can also get your grades improved by emailing: Folkwinexpertrecovery @ tech-center . com  (or)  Telegram: @folkwinexpertrecovery  ..

Regards,
Naisha Berrios.
Let's Talk Constructive Vibes in Development Teams! 🚀
Tags: codenewbie, mentalhealth, softwaredevelopment
Published: 2023-12-07 02:38:40

| ✍ **Disclaimer**: |
| --------- |
| This post is enhanced with AI assistance.|

## The Newbie Asked
> How can I succeed at the teamwork game?

## The Master Responded
> Alright, buckle up! We're diving into the juicy bits of team dynamics—where mutual respect and empathy transform code from mere syntax into a masterpiece.


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

Here's the backstage pass to encouraging constructive communication:

## 1. The Impact of Mutual Respect on Code Quality and Innovation

### Cracking the Code of Respect
   - *Imagine this:* Your code is like a rock band. Each line, a musical note. Now, for that harmony to hit, there's a key ingredient—mutual respect. When team members vibe with respect, the code quality becomes a chart-topper.

### Innovation Jams
   - *Picture a Jam Session:* Innovations happen when ideas jam together. In an atmosphere of respect, team members feel free to throw in their musical riffs of creativity. The result? A codebase that doesn’t just hum; it sings!

### The Recipe for Respectful Code Review Dinners
   - *Reviewing Code, Gourmet Style:* In the world of code reviews, respect is the secret sauce. Constructive feedback becomes the main course, and improvements are the dessert. It's a feast of collaboration that leaves everyone satisfied.

***

## 2. Empathy in Code: Understanding Users and Stakeholders

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

**Cracking the Empathy Code:**
   - *Take a Walk in Their Shoes:* Ever put yourself in the shoes of your users or stakeholders? Empathy in code is like understanding the dance moves of your audience. It's not just about writing code; it's about crafting experiences.

### Code with a Human Touch
   - *Think of Code as a Story:* Your code tells a story to users. Does it speak their language? Empathy ensures your code is not just functional but resonates with the end-users. It's the difference between reading a manual and having a conversation.

### Stakeholder Dance Floor
   - *Navigate the Dance of Perspectives:* Stakeholders have their dance moves, too. With empathy, you become a dance partner, syncing your steps to theirs. The result? A harmonious dance floor of collaboration, where everyone's moves are considered.

### Feedback as a Dialogue, Not a Monologue
   - *Empathy in Code Reviews:* When giving feedback, it's not a one-way street. It's a dialogue. Imagine you're offering suggestions over a cup of coffee rather than handing out grades. It's not about finding faults; it's about growing together.

Alright, fellow code maestro, as you navigate through team dynamics, remember: respect is the backstage pass, and empathy is the dance partner. Together, they transform your code into a symphony that resonates with users and stakeholders alike. Now, let's hit the stage and code with the rhythm of collaboration! 🎵💻🕺
CS50 Web - Project 2
Tags: showdev, python, tutorial, cs50w
Published: 2023-12-07 02:27:30


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6yz9hyg7v3bt55ad04wf.png)
Second project with Django down ✅ This time around, I was tasked with building an auctions site where users could create listings, close listings, add to watchlist, bid on listings, and add comments, which was definitely a handful. I was initially pretty doubtful whether or not I'd be able to complete this since I've never done a full stack project with so many functionalities before, but I did it so yay.

Working with views.py in Django has taught me the importance of separating functionalities, the more distinct the better. For example, originally I had the bidding functionality and the displaying bids both in the same function, but then after I separated them, Django got more clear on what each of them is supposed to do. One thing for one function at a time. 

I also learned more about databases from Django models and what foreign key, one-to-one relationship, and many-to-many relationship means. 

I'm really liking how hands-off these CS50 projects are so far. They don't tell you how to do something but give you what you need to do, which almost mimics real life. 

You can check out the demo of the working app [here](https://www.youtube.com/watch?v=JtOW5pCYh20&t=6s)
Algoritmia de programación
Tags: programming, paradigms
Published: 2023-12-07 02:11:46

¡Descubre el fascinante mundo de la algoritmia de programación en mi nueva serie de artículos! 🚀💻 Exploraremos juntos el corazón de los algoritmos y desvelaremos sus secretos. ¡No te lo pierdas! 👉[aquí](https://medium.com/@villamorosjuan/list/algoritmia-de-programacion-a70155fb82a9 ) #Programación #Algoritmos #LeerParaAprender
Nights and Weekends
Tags: nightsandweekends, learning
Published: 2023-12-07 02:06:07

## Work on your project on Nights and Weekends to learn and build.

I came across this website Buildspace where it has a Nights and Weekends programme to join, creators builders come to make their projects and ideas.

Each Project lasts 6 weeks, which can give you enough time to validate if you want to purse this further.

There is not workshop or class just making progress on your work, they do have a weekly lecture or check-in, but for the most part you have to figure out how to make you project. Eventually at the end of your finished project you have a demo day.

## What If You Can't Join? No Problem

Now, let's be real. Maybe joining a structured program like this isn't in the cards for you. Fear not; there's a workaround that packs just as much punch. Imagine creating your version of Buildspace Nights and Weekends right in your own creative cocoon.
Feeling a bit strapped for time? Take a breather between sessions. Want to keep things light? Scope out your project with a bit less intensity. The key is to keep the momentum alive.
I did that with Game Development to assess tools such as unity and unreal engine. This was done in-between projects during the pandemic.


## My Game Development Journey: A Case Study

Here is a personal story of how I stumbled in to this accidentally. I took this approach with game development, testing the waters with tools like Unity and Unreal Engine. No grandeur, no pressure—just dipping my toes in the coding and learning C#.

During the pandemic, with nights and weekends as my canvas, I embarked on a mini-odyssey. In the span of 6-8 weeks, a tiny game emerged from the chaos of code. A small space shooter where you shoot asteroids to get points. 

{% youtube fQt24JEPWKA %}
Youtube [Link](https://www.youtube.com/watch?v=fQt24JEPWKA)


Sure, it wasn't a magnum opus, but it was a step. A small game, a giant leap for my understanding of programming and game development. I learnt the basics of C# and understanding functions and making objects move on a screen. I also spent a lot of time googling for answers.

Not sure if you have done things on your nights and weekends. Hope this post can inspire you to consider building you projects in 6 weeks on nights and weekends.

Do share in the comments, if you are working on anything.

Here is some [Vaporware Music](https://www.youtube.com/watch?v=3z55w5fXqEQ) for those [Nights and Weekends](https://www.youtube.com/watch?v=3z55w5fXqEQ)
{% youtube 3z55w5fXqEQ %}
Youtube [Link](https://www.youtube.com/watch?v=3z55w5fXqEQ)

## Links about the Programme:

[https://buildspace.so/](https://buildspace.so/)

[Review of the Buildspace Programme](https://www.camhouser.com/a-review-of-buildspaces-nights-and-weekends-program/)
Socket编程
Published: 2023-12-07 01:46:21

头文件我们过会再看，
首先创建出套接字fd
```c++
int server_fd = socket(AN_INET,SOCK_STREAM,0)
//AN_INET代表地址族-因特网，使用ipv4通信协议进行通信，
//SOCK_STREAM 使用TCP进行连接
//0参数代表将默认使用最合适的协议，在上面代码中默认使用TCP进行通信
```
分析TextQuery的源码
Published: 2023-12-07 01:32:13

首先我们看下各个文件中的成员变量和成员函数都是做什么的。可以针对这个画一个类图。
### get_print
一共三个函数get_file、get_word还有get_words。
#### get_file 
这个函数，就是判断一下可执行程序后面的参数对不对，然后把文件传给TextQuery这个类进行进一步处理。
#### get_word
输入一个词，如果是q的话退出
#### get_words
输入两个词，如果第一个词是q的话退出，如果第一个词不是q的话再出入第二个词。

### TextQuery
####变量部分：
首先一个行号，
```c++
vector<string>::size_type //这个用于表示行号，这个东西本质上适用于表示vector里面有多少元素，无论vector有多少元素都可以表示其大小
TextQuery(std::ifstream &);//传入一个文件输入流
QueryResult query(const std::string&) const;//查词的函数
void display_map(); //打印wm
std::shared_ptr<std::vector<std::string> > file;
/*用于管理整个文本，那么至于为什么一定要用sptr呢？如果我们的
TextQuery进行复制，那么一篇文档就会走拷贝构造函数，进行大量的资源浪费，但是如果是sptr，我们就只需要增加引用计数就ok。*/
std::map<std::string, std::shared_ptr<std::set<line_no> > > wm;  
/*存放每一个词所对应的行号，至于为什么行号要用sptr包起来？因为一个单词可能出现相同的行号，如果相同的单词出现相同的行号，那么在内存中会造成大量的浪费*/
static std::string cleanup_str(const std::string&);/*把字符串转换为小写并且没有标点符号的，统一大小写有利于快速处理，至于为什么是静态的，因为该函数不需要访问任何成员变量*/
```

### Query
这个里面有各种查询
HTML Basics: Essential Tags
Published: 2023-12-07 01:26:14

HTML (Hypertext Markup Language) is the standard language for creating and designing web pages. It uses various tags to structure content and define elements on a webpage. Here are some fundamental HTML tags that every web developer should know:


- `<!DOCTYPE html>`
This declaration specifies the HTML version being used. It should be placed at the very beginning of an HTML document.


```
<!DOCTYPE html>
```
- `<html>`
The root element of an HTML document.


```
<html>
  <!-- Content goes here -->
</html>
```
- `<head>`
Contains meta-information about the HTML document, such as title, character set, and linked stylesheets.


```
<head>
  <title>Document Title</title>
  <!-- Other metadata goes here -->
</head>
```
- `<body>`
Encloses the content of the HTML document, including text, images, links, and more.


```
<body>
  <h1>Hello, World!</h1>
  <p>This is a sample paragraph.</p>
  <!-- Other content goes here -->
</body>
```
- `<h1> to <h6>`
Heading tags, ranging from the largest `<h1>` to the smallest `<h6>`.


```
<h1>Heading 1</h1>
<h2>Heading 2</h2>
<!-- ... -->
<h6>Heading 6</h6>
```
- `<p>`
Defines a paragraph.


```
<p>This is a paragraph.</p>
```
- `<a>`
Creates hyperlinks to navigate to other pages or resources.


```
<a href="https://www.example.com">Visit Example.com</a>
```
- `<img>`
Embeds images in the document.


```
<img src="image.jpg" alt="Description of the image">
```
- `<ul>, <ol>, <li>`
Defines unordered and ordered lists with list items.

Unordered List:

```
<ul>
  <li>Item 1</li>
  <li>Item 2</li>
</ul>
```
Ordered List:

```
<ol>
  <li>Item 1</li>
  <li>Item 2</li>
</ol>
```
- `<div>`
A generic container that does not carry any semantic meaning.


```
<div>
  <!-- Content goes here -->
</div>
```
- `<span>`
Similar to `<div>`, but used for inline elements.


```
<p>This is <span style="color: red;">red</span> text.</p>
```
- `<br>`
Creates a line break within text.


```
<p>This is the first line.<br>This is the second line.</p>
```
- `<hr>`
Represents a thematic break or horizontal rule.


```
<hr>
```
These are just a few of the essential HTML tags. As you continue learning, you'll discover more tags and attributes to enhance the structure and presentation of your web pages.
Skateboard configurator built with react three fiber
Tags: reactthreefiber
Published: 2023-12-27 18:28:29

---
title: Skateboard configurator built with react three fiber
published: true
date: 2023-12-07 00:59:00 UTC
tags: reactthreefiber
canonical_url: https://reactjsexample.com/skateboard-configurator-built-with-react-three-fiber/
---

 ![Skateboard configurator built with react three fiber](https://reactjsexample.com/content/images/2023/12/Code_2023-12_12-54-33.jpg)

Skateboard configurator built with react three fiber [based on a dribble shot](https://dribbble.com/shots/14078930-Skateboard-configurator) by [Sacha Jerrems](https://dribbble.com/sachajerrems/shots).

![Skateboard configurator built with react three fiber](https://camo.githubusercontent.com/cee5e9e5202bf6ee2f7accd8cee233a570d83620a9878297039c3190f9c75fef/68747470733a2f2f6d656469612e67697068792e636f6d2f6d656469612f76312e59326c6b505463354d4749334e6a4578636d6c364e6d6c6e4e486c6b636d67324d6e6b334e326869625464796444426e4e584e68636e566b4d58527164584d33646a683664435a6c634431324d563970626e526c636d35686246396e61575a66596e6c666157516d593351395a772f584875316141645a71466375516a337157312f67697068792e676966)

## Live

[https://skate-config.netlify.app/](https://skate-config.netlify.app/)

## Local Development

Download or `git clone` this repository

`npm install`

`npm run dev`

## GitHub

[View Github](https://github.com/dbaramo/skateboard-configurator?ref=reactjsexample.com)
Time-Independent Dates in Swift
Tags: swift, time, opensource
Published: 2023-12-07 00:23:26

---
title: Time-Independent Dates in Swift
published: true
description: An open source time-independent date type in Swift
tags: swift, time, opensource
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3ji8nasmtls933llmkh7.jpeg
# Use a ratio of 100:42 for best results.
# published_at: 2023-12-07 00:18 +0000
---

Most often, it is important that a date also near-precisely represent a point in time. In Swift, for that, we have `Foundation.Date`. `TimeIndependentDate` fills a gap where, in limited circumstances, we need to deal with a date independent of time. This is particularly useful when interfacing with third party systems which supply dates independent of time.

I often find myself needing a time-independent date in Swift. So I've open-sourced a `TimeIndependentDate` type for anyone else that might need one: https://github.com/hwjeremy/time-independent-date-swift

## Example Usage

```swift
// Initialise a date, throwing a `TimeIndependentDate` error if the supplied
// literal values are invalid.
let timeIndependentDate = try TimeIndependentDate(
    year: 2020,
    month: .january,
    day: 1
)

// Parse a date from a string. Adjust encoding order as desired. A
// `TimeIndependentDateError` is thrown if the supplied string
// is not a valid date.
let timeIndependentDate = try TimeIndependentDate.from(
    "2021-01-01",
    encodingOrder: .dayFirst
)

```
Next.JS 14.0.3 build error
Published: 2023-12-07 00:11:06

Have anyone encounter build error with Next.JS 14.0.2 or 14.0.3??

I've been using 13.4 and then 14.0.1 for testing a CMS with dynamic routes.

Build & deploy is all ok.

However upgrading to 14.0.2 or 14.0.3 will throw error during build. It'll throw error about [pre-rendering error](https://nextjs.org/docs/messages/prerender-error) on every dynamic route pages.

Been searching for answer for so long, turns out it's related to [route segment config](https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config). The workaround is adding this to layout / page / route

`export const dynamic = 'force-dynamic'`

However, doing this will force the page to be re-rendered at every request.

Leave a comment if you encounter this and what's your workaround?
USE OF SUPER KEYWORD
Published: 2023-12-07 00:02:09

class BaseClass {
    protected int x;  // Integer variable in the base class

    // Constructor for the base class
    public BaseClass(int x) {
        this.x = x;
    }

    // Method to display the value of x in the base class
    public void show() {
        System.out.println("BaseClass - Value of x: " + x);
    }
}

class SubClass extends BaseClass {
    // Constructor for the subclass
    public SubClass(int x) {
        super(x);  // Call the constructor of the base class
    }

    // Method to display the value of x in the subclass
    @Override
    public void show() {
        System.out.println("SubClass - Value of x: " + x);
    }
}

public class superkeywo {
    public static void main(String[] args) {
        // Create instances of the base class and subclass
        BaseClass baseObj = new BaseClass(10);
        SubClass subObj = new SubClass(20);

        // Call the show() method for the base class
        baseObj.show();

        // Call the show() method for the subclass
        subObj.show();
    }
}
How Do You Navigate Career Shifts?
Tags: discuss, codenewbie, beginner
Published: 2023-12-07 00:00:00

---
published_at : 2023-12-07 00:00 +0000
---
Transitioning from one career level to another often presents challenges. What obstacles might individuals face when moving from a role as a Senior Software Engineer to a Staff Engineer, and how could they navigate this shift?
<br>
Follow the DEVteam for more discussions and online camaraderie!
{% embed https://dev.to/devteam %}
How Do You Organize Your Digital World?
Tags: discuss
Published: 2023-12-07 00:00:00

---
published_at : 2023-12-07 00:00 +0000
---
How do you organize your digital world for success, and what tips can you offer to others?<br>
Follow the DEVteam for more discussions and online camaraderie!
{% embed https://dev.to/devteam %}