teleren/devto huggingface dataset:
328. Leetcode Solution in cpp
Tags: cpp
Published: 2022-12-06 06:28:10

```cpp
/**
 * Definition for singly-linked list.
 * struct ListNode {
 *     int val;
 *     ListNode *next;
 *     ListNode() : val(0), next(nullptr) {}
 *     ListNode(int x) : val(x), next(nullptr) {}
 *     ListNode(int x, ListNode *next) : val(x), next(next) {}
 * };
 */
class Solution {
public:
    ListNode* oddEvenList(ListNode* head) {
        ListNode *oddHead = new ListNode(0); //virtual head
        ListNode *odd = oddHead;
        ListNode *evenHead = new ListNode(0); //virtual head
        ListNode *even = evenHead;
        ListNode *cur = head;
        int i = 1;
        
        while(cur){
            if(i % 2 == 1){
                odd->next = cur;
                odd = odd->next;
            }else{
                even->next = new ListNode(cur->val);
                even = even->next;
            }
            i++;
            cur = cur->next;
        }
        
        odd->next = evenHead->next;
        return oddHead->next;
    }
};
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/odd-even-linked-list/
Software Developers: At Risk Of Extinction? [Infographic]
Tags: programming, lowcode, watercooler
Published: 2022-12-06 06:22:01

Software Developers: At Risk Of Extinction? [Infographic]

Low-Code, AI-driven development, GitHub's co-pilot: there is a long list of new inventions that are accelerating and simplifying software and application development.

What will happen to the traditional developer role, as new tools & technologies transform how software is built & deployed? Software developers: are they at risk of extinction?


![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m34q5usdwjh5jrghcqod.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rai37yc7c2hn5f3bj51s.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sf146kb7ffjdjrefc9b4.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ovt046v3otc1i2txd7kg.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f5o9rc9887jodhb506f9.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g1b5pc7rcq3kct4z8var.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4d7g5i8zcjej6qeffy8e.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/odd027qz7p8sc2ix577v.png)

![Five.Co - Software Developers: At Risk Of Extinction?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7odbojjy3n4v64c6xr04.png)


To download this infographic as a pdf document, [simply click visit our website](https://five.co/software-developers-at-risk-of-extinction/).
Back In The Saddle
Tags: productivity, beginners, devjournal, motivation
Published: 2022-12-06 06:10:04

> Hello, world! Good to see you again!

I've been out of the the coding game for well over a year now. And out of web development for much more than that.

## A Bit of History

You see, I taught myself web development in university as a distraction from my actual class work. It turns out I loved it! Fast-forward to graduation in 2018 and I was applying for jobs in that very field. Unfortunately, I could never make it past the coding challenges because I was slightly more amateur than I thought. So I opted for a job in a field that was more tailored to my degree: data science.

I ended up hating that job. It paid well, but I couldn't shake that undeniable feeling of unfulfillment. Maybe it was the company, maybe it was the work, but I could never deny that web development was and still is my true love. After nearly two years I ended up leaving the job for good in search of something different.

## And "Something Different" I Found!

In all that time away from computers I:
- WWOOFed on a ranch in the Yukon
- was retired (okay, unemployed actually) for a bit
- worked a year in landscaping (my other dream job)
- and backpacked all of Vietnam

I learned a lot about myself. I learned what a crazy, creative, strong, and brave person I can be. I also learned that I can do anything I put my mind to! So, I've decided to give my dream another shot! But this time, on my own terms

## Wrangle That Wild Pony!

Today, I'm getting back to it! I have a renewed spirit and a renewed energy. And to kickstart and help guide my journey, I've signed up for an online course that teaches the basics of web development. Some of it I already know, but there are lots of topics covered I never gave myself the chance to explore.

I'm picking up where I left off. I'm pushing my limits. And I'm not taking "no" for an answer! :)
Using CSS counters
Tags: css, webdev, beginners
Published: 2022-12-06 06:04:19

A while ago, we looked at [custom numbered list styling](https://daily-dev-tips.com/posts/css-custom-numbered-list-styling/), but we can use the concept of CSS counters to turn any element into a counter.

So what exactly are these CSS counters? We can look at them as variables maintained by CSS. CSS rules can increase the values, which will track how many times they are used.

## Using CSS counters

To use these counters, we must first create them with the counter-reset function. Wherever you call this reset from, it will reset the count for that counter (identified by its name).

Let's set up a counter on our body and count for each `p` element.

```css
body {
  counter-reset: paragraph;
}

p::before {
  counter-increment: paragraph;
  content: 'Paragraph ' counter(paragraph) ': ';
}
```

If we now create the following HTML:

```html
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
```

We end up with this result.

![CSS Counter](https://cdn.hashnode.com/res/hashnode/image/upload/v1669537433562/CrYHcAulv.png)

We can define these counters as we wish and reset them as we go.

## Custom reset

Let's take a look at custom resets.
For instance, we have `h2` elements as our main counter, and for each paragraph, inside of it, we want to showcase a different counter.
For the demo, we'll even combine the counter output.

Let's take the following HTML structure.

```html
<h2>First heading</h2>
<p>Some text</p>
<p>Some text</p>
<p>Some text</p>
<h2>Second heading</h2>
<p>Some text</p>
<p>Some text</p>
```

We could then easily create an index for each section like this.

```css
body {
  counter-reset: heading;
}
h2 {
  counter-reset: paragraph;
}
h2::before {
  counter-increment: heading;
  content: 'Section ' counter(heading) ': ';
}
p::before {
  counter-increment: paragraph;
  content: counter(heading) '.' counter(paragraph) ' ';
}
```

Which would result in the following:

![Multiple counters in CSS](https://cdn.hashnode.com/res/hashnode/image/upload/v1669537895892/PjJnU2kuS.png)

Pretty cool, right, It might be for sporadic use cases, but one day, you might need CSS counters.

You can also check them out on this [CodePen](https://codepen.io/rebelchris/pen/poKKdBg).

### Thank you for reading, and let's connect!

Thank you for reading my blog. Feel free to subscribe to my email newsletter and connect on [Facebook](https://www.facebook.com/DailyDevTipsBlog) or [Twitter](https://twitter.com/DailyDevTips1)
Dynamic Pie Chart Example In Laravel 9
Tags: laravel9, piechart, chart, php
Published: 2022-12-06 05:30:00

In this article, we will see a dynamic pie chart example in laravel 9. 

Pie charts are used to represent data in graphics view. for the creation of a dynamic pie chart example, you need to create a model, controller, route, blade file, and database. 

Also, we will use echart js to create a dynamic pie chart example.

So, let's see the laravel 9 dynamic pie chart example and dynamic charts in laravel 9.

How To Create Dynamic Pie Chart In Laravel 9

```
Step 1: Install Laravel 9

Step 2: Create Migration Table

Step 3: Add Route

Step 4: Create Controller And Model

Step 5: Add Code In Model And Controller

Step 6: Create Blade File
```
File /etc/passwd
Tags: devops, linux, tutorial
Published: 2022-12-06 04:50:48

The /etc/passwd is a plain text-based database that contains information for all user accounts on the Linux system.

Each record in the /etc/passwd file has 7 fields 
separated by a colon ( : )

Let’s consider the /etc/passwd file format.

```
www-data:x:33:33:www-data:/var/www:/usr/sbin/nologin
```
www-data - Registered username.
 It is used when a user logs in. 
It should be between 1 and 32 characters in length.

x - It indicates an encrypted password. It’s stored in the /etc/shadow file.

33 - It indicates a user identifier. 
Each user in Linux must be assigned a user ID (UID). 
UID 0 (zero) is reserved for root. 
The UIDs 1-99 are reserved for other predefined accounts. 
Next UID 100-999 are reserved by system for administrative and system accounts/groups.

33 - It indicates a primary group ID (stored in the file /etc/group). 

www-data - It indicates extra information about a user. 
Different organizations set different requirements on this field format. 
This field is used by a finger command.

/var/www - It sets to a user home directory absolute path. 
When a user logged in it will be in this directory. 
If this directory doesn’t exist then user directory becomes /

/usr/sbin/nologin - It sets the shell a user is using. Usually it’s a shell. 
But it doesn’t have to be a shell. 
For example, sysadmin can use the nologin shell, which acts as a replacement shell for the user account. 
If the shell is set to /sbin/nologin and the user tries to log in to the Linux system directly, the /sbin/nologin shell closes the connection.

The  /etc/passwd file is used by login, ls, who commands.
Usage of forward slash (/) in Python
Tags: python, programming, beginners
Published: 2022-12-06 04:48:12

In Python, the forward-slash (/) has several different uses depending on the context in which it appears. Some of the main uses of the forward slash in Python include:

## Division
When used between two numeric values, the forward slash performs division. 
For example, 10 / 3 evaluates to 3.3333333333333335.

```python
>>> 10/3
3.3333333333333335
```

## Floor division 
When used between two numeric values, the forward slash followed by another forward slash (//) performs floor division, which rounds the result down to the nearest integer. 
For example, 10 / 3 evaluates to 3, and 10 // 3 evaluates to 3.

```python
>>> 10//3
3
```

## Paths
In strings, the forward slash is often used as a separator in file paths or URLs. 
For example:

```python
path = "C:/Users/john/Documents/file.txt"
url = "https://www.example.com/path/to/resource"
```

## Regular expressions
In regular expressions, the forward slash is often used to escape special characters. For example:

```python
import re

pattern = r"\d+/\d+/\d+"
text = "The date is 01/01/2021"
match = re.search(pattern, text)
```

Thanks for reading, you can further check:
- [5 usages of an asterisk (*) in Python](https://blog.soumendrak.com/5-usages-of-an-asterisk-in-python)
- [Usage of the Underscore(_) in Python](https://blog.soumendrak.com/usage-of-the-underscore-in-python)

This article was first published [here](https://blog.soumendrak.com/usage-of-forward-slash-in-python).
How do I create a simple HTML form?
Published: 2022-12-06 04:40:50




HTML forms are used for gathering information from users, or for telling another website about your personal details. HTML forms are prefilled with data by the user and then sent to another site. In this tutorial, we are designing a basic form using HTML attributes and elements.

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


**Source Code**

```
<!DOCTYPE html>

<html>
<head>
	<title>HTML FORM</title>
</head>
	<body>
	Our new HTML form
    <form>
    	Name:
    	<input type="text"><br>
        
      Password
        <input type="password"><br>
        
      Gender
        <input type="radio">Male
        <input type="radio">Female
        <input type="radio">Other
       <br>
        
      Email:
        <input type="email">
        <br>

      Phone:
        <select>
            <option>071</option>
            <option>075</option>
            <option>076</option>
        </select>
        <input type="phone">
        <br>

        <input type="submit">
        <input type="reset">
        
    </form>
	</body>
</html>
```
{% embed 
https://youtu.be/kTkeLDrOVc0  %}

References
www.w3schools.com

www.w3schools.com
Advent of Code 2022 (Day 1)
Tags: adventofcode, 8th
Published: 2022-12-06 04:37:18

I'm a couple of days behind in the AoC. To make the challenge more demanding I opted to use a language I'm not extremely familiar with: [8th](https://8th-dev.com).

8th is a FORTH-dialect aimed at the cross-platform developer market. I'm in the process of adding an 8th language track on [Exercism](https://exercism.org). 

I expect an 8th guru (there are a few) will sigh with exasperation on examining my code, but I plead ignorance (and a "let's just solve the problem, okay?" attitude).

My progress is being logged on github at [AdventOfCode](https://github.com/axtens/AdventOfCode).

Day 1, Part 1 resulted in this little blob of code

```forth
"input" f:slurp \ read in input file
>s s:trim \ convert buffer to string and trim
"\r\n\r\n" s:/ \ split into elves (on Windows so CRLF)
( 
    "\r\n" s:/ \ split into meals
    ' >n a:map \ convert to number
    ' n:+ 0 a:reduce \ total calories
) a:map \ apply to each elf
' n:cmp a:sort \ sort smallest to largest
a:pop nip . cr \ pop of the last item, clear the stack, display
bye \ exit
```
The RPN syntax is a challenge but I'm starting to get the hang of it. Having to deal with a stack forces you to refactor. For a longer discussion of that particular issue see [ForthValues](https://wiki.c2.com/?ForthValues).

Day 1, Part 2. For all of my talk about refactoring, there's no sign of it at this point.
```forth
"input" f:slurp >s s:trim \ read in file and trim
"\r\n\r\n" s:/ \ split into elves 
( 
    "\r\n" s:/ \ split into meals
    ' >n a:map \ convert to number
    ' n:+ 0 a:reduce \ total calories
) a:map \ apply to each elf
' n:cmp a:sort \ sort smallest to greatest
0 >r \ keep a total in r-stack
( a:pop r> n:+ >r ) 3 times \ pop off three items from the high end and accrue
r> . \ retrieve total and display
drop \ clean up stack
bye \ exit
```
Simple State Management with RxJS — a To-do List example
Tags: webdev, javascript, typescript, beginners
Published: 2022-12-06 04:34:27

###What is RxJS ?
RxJS is a Reactive Extensions Library for JavaScript which is getting very popular.

According to Wikipedia, Reactive Programming is a declarative programming paradigm concerned with data streams and the propagation of change.

I will cover some basics before moving on:

- **Observable**: represents the idea of an invokable collection of future values or events.
- **Observer**: is a collection of callbacks that knows how to listen to values delivered by the Observable.
- **Subscription**: represents the execution of an Observable, is primarily useful for cancelling the execution.

###Setting up the project
You can use basically any UI Framework or library out there, even with vanilla JS. In this article, I will go with SolidJS ( you can find it very similar to React )

```
npx degit solidjs/templates/ts my-app

```

This will generate a new Solid app with TypeScript, next, just add the RxJS library

```
yarn add rxjs
yarn dev
```

###Setup store
In the `src` folder, let’s create the `state.ts` file ( you can name it store or whatever ) then create the `initialState` and `subject`


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

###Subscriptions
An RxJS Subject is the only way of multicasting a value or event to multiple Observers. In this example, we’ll be subscribing our different `setter` functions to our RxJS Subject so that when it receives any data, it forwards that data to every state associated with our `setter` function ( if you familiar with React, then just pass a `setState` to it )

Then, we will subscribe to it


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

Next, we will create an `init` method to initialize the state


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

The `next` method is used to push a value to the subject, when we call the next method with a value as its parameter, that value is casted to all Observers subscribed to the Subject.

###Add, delete and modify the state
Nothing much to say about this, just like every other to-do list example, we need multiple method to modify the state that holds the tasks


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

This is a complete version of our app, you can add more methods if you want to fulfill you desire. The final product might looks like this, depend on your styling :


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

Hope this tutorial can help you understand basics of RxJS and its usage. You can find the [source code here](https://gitlab.com/letrongduc1999/todo-list-rxjs-solidjs)

References:

https://rxjs.dev/
https://en.wikipedia.org/wiki/Reactive_programming
https://blog.logrocket.com/rxjs-react-hooks-for-state-management/
TextUnited - Translation as it should be: intelligent, fast & always-on
Tags: platform, translation, localization
Published: 2022-12-06 04:27:17

A technology-first approach to localization, with professional translators in the loop.

Texunited provides a cloud-based Translation Management System for companies looking to create and maintain multilingual apps, tech docs, and websites, removing the chaos from translation and blending the processes of ordering, translation, and delivery into one.

[https://www.textunited.com](https://www.textunited.com)
Embedded System Training in Chennai
Tags: embeddedsystem, training, embeddedsystemchennai
Published: 2022-12-06 04:22:28

IntelliMindz offers comprehensive **[Embedded System Training in Chennai](https://intellimindz.com/embedded-system-training-in-chennai/)**. IntelliMindz, Embedded Systems extensive practical training equips participants with live projects. Start Learning with us, enroll in our Embedded System Training in Chennai, and became an expert in Embedded Systems.
Contact - +91 9655877677 / +91 9655877577.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a30r89lb8cfx2el1479x.jpg)
Embedded System Course Certification is one of the professional credentials which will demonstrate that the candidate has gained in-depth knowledge in Embedded System by using all its applications and platforms. With the real-time experience in projects provided by IntelliMindz Embedded System Course, Our
certification states that the student has acquired all the necessary skills to work as a Embedded System. Having our Embedded System Course certificate along with your resume will help you in prioritizing your resume at the of the interview, and also it will open the door to a wide range of opportunities.

Embedded System Training in Chennai at IntelliMindz hones the necessary basics and skill sets that are required for a professional Embedded System under the
support and guidance of our real-time experienced professionals. Embedded System Training in Chennai at IntelliMindz Is provided by experienced professionals who are having over 8+ years of experience in the Embedded System Platform. Our trainers will upskill your knowledge with the relevant real-time projects in the industry.

Apart from IntelliMindz Embedded System Course Completion Certification, Our Embedded System trainers will guide and support you to learn further by enrolling advanced course in Embedded System to clear Global Embedded System Certification exams.

Working on LIVE Project: You will get an opportunity to work on real-time projects.

Flexible Timing: At IntelliMindz you will get Ultimate Flexibility. You can pick the schedule whatever suits you the best.

Affordable Fees: In our training center fees are not only affordable, but you can pay the fees in Installment.

Job Opportunities after completing this course:

Today the increasing number of ERP Software’s increases the need for Embedded System Certified Professionals. IntelliMindz Embedded System Certification course will help the student to kick start their career as Embedded System Consultant. There were many companies which welcome Embedded System Certified professional. IntelliMindz Embedded System Training in Chennai will help you to land a job at the below-listed companies are HCL, INFOSYS, IBM, WIPRO, TCS, etc..

Placement Support: We have to Tie up an MOU with more small and Medium Companies to help you to step up your career.
How to get back your OSX storage from node_modules
Tags: osx, tips
Published: 2022-12-06 04:17:13


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

just run 

```sh
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}';
```

Note:

print all `node_modules` folder with it's size

```sh
find . -name 'node_modules' -type d -prune -print | xargs du -chs
```
running a gitlab runner on docker
Published: 2022-12-06 03:26:44

running the following commands in Git Bash on a Windows machine:

1. run `docker pull gitlab/gitlab-runner`: this pulls the Gitlab Runner image found on Docker Hub. it's managed by Gitlab themselves

2. run this command:
```
docker run -d --name gitlab-runner --restart always \
  -v /srv/gitlab-runner/config:/etc/gitlab-runner \
  -v /var/run/docker.sock:/var/run/docker.sock \
  gitlab/gitlab-runner:latest
```
it creates a container based on the Gitlab runner image we pulled in step one, and it mounts certain configuration files in the container to the local system volume so that they persist upon restart of the container (probably super useful if i'm running the container on my local machine, since i'll be turning that computer on and off a lot)

3. run this command to register the runner:
`winpty docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register
`
- original instructions on Gitlab docs don't have the `winpty`, i added it after Git Bash told me it wasn't a TTY and that I should try adding it

4. what i passed to the interactive CLI:
- gitlab instance url (found under `Settings > CI/CD > Runners`)
- registration token (also found under `Settings > CI/CD > Runners`)
- runner description (local docker container runner)
- tags (debug, setup)
- optional maintenance note (left blank by simply hitting Enter)
- executor (docker)
- default Docker image (gitlab/gitlab-runner:latest)

nicee

now let me try changing the runner of my branch to the new, dockerized runner i just set up

actually, i'm not sure if i can do that. let me try running the pipeline again and see if it can execute now that i have a runner setup - OH SHOOT IT'S RUNNING - nevermind, it's stuck still

ohhh this is enlightening: https://docs.gitlab.com/ee/ci/runners/configure_runners.html#set-a-runner-to-run-untagged-jobs
runners only run on tagged jobs. mine was likeiy not tagged at all. maybe i can either
- tag a job with the tags i gave my runners
- set a runner so that it can be used for untagged jobs

i'm trying the 2nd option 

from [this post](https://stackoverflow.com/questions/43638979/understanding-gitlab-ci-tags), seems like you specify the tag in the `.gitlab-ci.yml`. pipelines will run on all runners with those tags

i tried adding the following code snippet to each of my jobs:
```
tags:
 - debug
```

still gets stuck

ugh. at this point, i just wanna nuke everything and try anew.



gonna explore the Gitlab Runner docs to see what i can find