teleren/devto huggingface dataset:
PHP VMValidator 2.4.2
Tags: webdev, php, showdev, opensource
Published: 2022-06-11 20:22:13

🥳🥳 PHP VMValidator 2.4.2 is here 🥳🥳

## For those who do not know, what is this:

> This is simple attribute validation for PHP models and value objects based on the new features, presented in PHP 8

**With even more improved callback execution after validation**
```

$successCallable is executed on successful validation

$failureCallable is executed on unsuccessful validation

$forcedCallable is executed on successful AND unsuccessful validation`
```

I am feeling excited how things are getting shape. 

Currently I am pleased with the progress of it but I still need feedback from all kind of developers junior or experienced. 

Like every successful library, this one also needs to be battle tested and proven. 

I am welcomming all sorts of feedback, recommendations and suggestions.

Feel free to play, test and work with it.

https://ivangrigorov.github.io/VMValidator/
Remove Duplicates from Sorted List II
Tags: leetcode, dsa, theabbie
Published: 2022-06-11 20:00:51

Given the `head` of a sorted linked list, _delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list_. Return _the linked list **sorted** as well_.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/01/04/linkedlist1.jpg)

**Input:** head = \[1,2,3,3,4,4,5\]
**Output:** \[1,2,5\]

**Example 2:**

![](https://assets.leetcode.com/uploads/2021/01/04/linkedlist2.jpg)

**Input:** head = \[1,1,1,2,3\]
**Output:** \[2,3\]

**Constraints:**

*   The number of nodes in the list is in the range `[0, 300]`.
*   `-100 <= Node.val <= 100`
*   The list is guaranteed to be **sorted** in ascending order.

**SOLUTION:**

    # Definition for singly-linked list.
    # class ListNode:
    #     def __init__(self, val=0, next=None):
    #         self.val = val
    #         self.next = next
    class Solution:
        def deldup(self, head: Optional[ListNode]) -> Optional[ListNode]:
            if not head:
                return head
            if head.val in self.dups or (head.next and head.val == head.next.val):
                self.dups.add(head.val)
                head = self.deldup(head.next)
            else:
                head.next = self.deldup(head.next)
            return head
        
        def deleteDuplicates(self, head: Optional[ListNode]) -> Optional[ListNode]:
            self.dups = set()
            head = self.deldup(head)
            return head
Success story of tailwind CSS
Tags: tailwindcss, frontend, programming, tutorial
Published: 2022-06-11 19:49:26

Going from zero to 2 million USD revenue annually.
If you here to read then sorry to interrupt your expectation but this is not an article rather its a video version to share the inspiring success story of Tailwind CSS.

[Success story of Tailwind CSS](https://www.youtube.com/watch?v=xl2uKJ7r9iQ)
act on burst motivation
Tags: motivation, productivity, devjournal
Published: 2022-06-11 19:39:21

Chronic procrastinators like me have a hard time even with the smallest tasks.

I have noticed is that throughout the day, there will be moment of "flashes of motivation" to work on something.

If your procrastination is deeply ingrained you might not even notice.
The usual reaction is fantasizing about doing that thing for about 30 seconds and then refreshing hackernews as your mind moves on.

Being mindful and training yourself to act on these tiny bursts of motivation immediately is something I am trying to get better at and have found helpful.

If you manage to act on it, the worst thing that can happen is you will give up in a minute or two but quite often you will work on that problem for longer periods of time now that you have started.

I practice this with small tasks, but couple times this has been the beginning of actual healthy habit or a hobby.
Diagonal Traverse
Tags: leetcode, dsa, theabbie
Published: 2022-06-11 19:30:40

Given an `m x n` matrix `mat`, return _an array of all the elements of the array in a diagonal order_.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/04/10/diag1-grid.jpg)

**Input:** mat = \[\[1,2,3\],\[4,5,6\],\[7,8,9\]\]
**Output:** \[1,2,4,7,5,3,6,8,9\]

**Example 2:**

**Input:** mat = \[\[1,2\],\[3,4\]\]
**Output:** \[1,2,3,4\]

**Constraints:**

*   `m == mat.length`
*   `n == mat[i].length`
*   `1 <= m, n <= 104`
*   `1 <= m * n <= 104`
*   `-105 <= mat[i][j] <= 105`

**SOLUTION:**

    class Solution:
        def findDiagonalOrder(self, mat: List[List[int]]) -> List[int]:
            m = len(mat)
            n = len(mat[0])
            op = []
            x, y = 0, 0
            while len(op) != m * n:
                slope = (x + y) & 1
                op.append(mat[y][x])
                dx, dy = (-1, 1) if slope else (1, -1)
                if x + dx < 0 or x + dx >= n or y + dy < 0 or y + dy >= m:
                    if slope:
                        if y < m - 1:
                            y += 1
                        else:
                            x += 1
                    else:
                        if x < n - 1:
                            x += 1
                        else:
                            y += 1
                else:
                    x += dx
                    y += dy
            return op
1. Let's learn Heroku once and for all (a series)
Tags: heroku, devops, beginners, tutorial
Published: 2022-06-11 19:26:43

Hi reader! 
So you want to learn Heroku? well, so do I, the other day I had to deploy an app to Heroku and I thought I could do it easily as I had already done the process before, what happened is that I spend the following couple hours with no idea which command to run and a lot of errors to deal with so I decided to create this series for me and anyone wanting to get started with Heroku and deploy their first application in few steps. 
First Heroku has a very good detailed Documentation (which I will be referencing to often) and you should check that out as well for more information but this series should give you everything you need to know to have your application hosted on this amazing platform. Let's get started!

**Structure**
This will be a series, a long one 😉, and it will be made intentionally long as each article will be a short one focusing on a single aspect of Heroku. This will be an advantage to you as you will be learning one thing at a time, also able to skip to the section that interest you.

That said let's focus on understanding what is Heroku in this first post.

**So What exactly is Heroku?** 
> Heroku is a platform as a service (PaaS) that allows developers to quickly build and deliver applications. 

But what does this mean? first let's explain what is a platform as service (PaaS)

**Platform as a service**: PaaS is a cloud computing model where the provider offers a platform where customers can develop and run apps without building and maintaining cloud infrastructures required to launch an app. 
This means that with Heroku you don't have to worry about servers, networking, installations, operating systems or any of that configuration, you will only worry about your code and others will be handled by Heroku platform. PaaS is more like renting a car where you don't have to worry about car maintenance or any other mechanical settings but it's still be up to you to drive it to where you want to go. 

This doesn't mean that apps running on Heroku don't require servers or any other cloud infrastructures in fact Heroku is based on AWS and that's where all Heroku applications will be hosted but all that underlying configuration is abstracted from the user for ease of use.

Heroku has built in support for git and many programming languages including Node.js, Python, Ruby, Java, PHP... and it offers a free plan where developers can push their application and get them running in matter of minutes and that's what we will be doing in this series.

Now that you have an idea what Heroku is in the next article we will be looking into how to get started with Heroku by creating an account starting interactions in the command line.

See youu....
Install Java JDK on Arch Linux
Tags: archlinux, java, linux, jdk
Published: 2022-06-11 19:06:26

open your terminal first
## At first check is java jdk already installed on your system or not

`java --version`
Unknown command: java
`which java`
which: no java in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl)

## Install JRE in Arch Linux
`sudo pacman -sS java | grep jre`
## Install the latest version of JRE
`sudo pacman -S jre-openjdk`
## Install JDK in Arch Linux
`sudo pacman -sS java | grep jdk`
## Install the latest version of the JDK
`sudo pacman -S jdk-openjdk`

## Now check, is java installed or not on your system by running this command
`java --version`
openjdk 18.0.1.1 2022-04-22
OpenJDK Runtime Environment (build 18.0.1.1+2)
OpenJDK 64-Bit Server VM (build 18.0.1.1+2, mixed mode)
This Week In Python
Tags: python, discuss
Published: 2022-06-11 19:02:11


**Fri, June 10, 2022**


This Week in Python is a concise reading list about what happened in the past week in the Python universe. 


## Python Articles

- [Solving Sudoku with Poetry's dependency resolver](https://www.splitgraph.com/blog/poetry-dependency-resolver-sudoku) – An unexpected use case for one of Python's most popular package managers
- [Adding a dunder to an object](https://nedbatchelder.com/blog/202206/adding_a_dunder_to_an_object.html) – An unusual solution for tracking how an attribute on an object was changing
- [Python 3.11 Performance Benchmarks Are Looking Fantastic](https://www.phoronix.com/scan.php?page=article&item=python-311-benchmarks)
- [What’s New In Python 3.11](https://docs.python.org/3.11/whatsnew/3.11.html) – official announcements about the upcoming Python version
- [How To Profile Python Code](https://codesolid.com/how-do-i-profile-python-code/) – Profiling for Performance




## Projects

- [python-syntax-errors](https://github.com/jwilk/python-syntax-errors) – no-op statements syntactically valid only since Python X.Y 
- [python-live-gui](https://gitlab.com/BenWiser/python-live-gui) – A simple python immediate mode gui that renders out to the Web 
- [htmx_examples](https://tildegit.org/cst/htmx_examples) – the htmx examples rendered with python/flask
- [pyperformance](https://github.com/python/pyperformance) – Python Performance Benchmark Suite
- [ga-extractor](https://github.com/MartinHeinz/ga-extractor) – Tool for extracting Google Analytics data suitable for migrating to other platforms/databases



{% embed https://twitter.com/bascodes/status/1535177063140835328 %}
BIG-O for BIGinners
Tags: algorithms, beginners, codenewbie
Published: 2022-06-11 19:01:14

> Just like Sunrise in the 90s, I've decided to do a series on "Big O" (if you don't get that reference, look it up; decent show)

# Part 1: Overview

Diving into algorithms and data structures, you most likely will have seen Big O notation, or at least seen some references to it.

But, what does it mean? How can it be calculated? And what is it useful for?

In this series, I will try to break down Big O notation in a way that is easy to understand and allows you to feel confident when dealing with Big O notation in the future.

So, let's get into Part 1:

## What is Big-O notation?

Before we get started with what Big O is and what is does, I think that I should take a second to clear up a common misconception.

### Big-O does not describe how much time (or space) an algorithm takes to run

If you think about it, there's really no way to actually know how long an algorithm or function is going to take to evaluate beforehand. System specs, programming language used, details about the input, all of these things will affect our function at runtime. 

For example, Going through a sorted data structure using Linear search (checking every element) is usually less efficient than a binary search (targeting the center and dividing the search space in half). 

But, what if the element we're searching for is the leading element? 

In that case, the linear search will finish almost immediately while the binary search will go through the maximum number of iterations. 

So, Big-O notation will not give an absolute description of the complexity, but rather describes the *worst case scenario*.

 *(if you're interested look up Big Theta and Big Omega, for average and best case scenario noatation)*

## What is Big-O, though

Big O notation, in the simplest terms I can think of, is a mathematical function that describes how algorithm complexity grows **as the number of elements increases** and in the **worst case scenario** 

I already explained the worst case scenario part, but the "as the number of elements increase" part is key.

![Big O complexity visualized](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bbi2ok5z4ijlagsfvz3x.png)

If you look at the chart, you'll see different ways that the number of operations(complexity) increases as a function of the number of items (size). We'll go into each of the different functions shown later.

## "n"

Even though it's called "Big O" notation, the  key to understanding it lies in the n variable.

The "n" variable represents the size of the input, usually the number of elements that the algorithm has to work on. This is the main variable we will be looking at.

## Next Time

That's a basic overview of big-O notation, what it means and how to read it. This will be a series, so the next article will tackle how to figure out big-O for your own algorithms.

If you have any comments, questions or corrections, Feel free to leave a comment!

See you next time...
We live in a world where you have to be lucky to succeed
Tags: webdev
Published: 2022-06-11 18:57:07

What do you guys think?

Most people on IH are here to sell something to make a living.
A seller trying to sell to another seller.

Its difficult. Its very difficult. While we were in school, others had completed and were building apps for android.

Now that we are out of school, where is the android market? Its dead.
This applies to the internet, to blockchain, to desktop apps, to a lot of other things
Why you should Hire Open Source Developer in Your Team
Published: 2022-06-11 18:54:23

Open Source has become a very internal part of several level of IT in recent years. Many companies are using open source software now more than ever. But when it comes to hiring open source developers,
most of them tend to stay away from the process.
This might be because most companies don't really put any value to open source applications. Eventually, no real value is placed on the people who code open source applications.

When hiring an open source developer, there are a few important considerations to take into account. I will cover some of the reasons why hiring open source coders can actually prove rewarding to your company.

1. **Availability and Expertise**
Open source software are always on their toes as they might need to mend the often broken programs. Companies like Microsoft continuously upgrade their programs ( e.g Windows) and so if you have a project built for these programs, you have to continuously update too to keep up these updates.
With this comes experience. You can always count an open source developer to code in the latest standards.

2. **Passion…Because, why not?**
Open source developers are generally passionate about their work. Therefore , hiring them would be hiring a passionate employee who is efficient and has the drive to work and go the extra mile too.

3. **Support from the community**
It is needless to say that having an open source developer on your team will enable you to enjoy the benefits of the open source community as well. With a diverse pool of coders behind your project, success is almost guaranteed …

4. **Open-source developers go beyond resumes** 
 Developing open source software means that your work is readily available for free  for the world to see. Since the applications the candidates work on are open, you can easily gauge their skill sets and level of proficiency ( Like CodeSpread  :-) do it for you ), based on their past work. Forget resumes- they are highly overrated. In programming, all you should care about is your interviewee can really write code.

Again , going open source also means that you are open to getting honest critics on your work.
A candidate with open source work will almost always be confident with their skills and open to corrections.
Popular Tools For DevOps
Tags: devops, beginners, softwaredevelopment, developers
Published: 2022-06-11 18:46:05

[DevOps](bpbonline.com/search?q=DevOps&type=product), which is a software development strategy, bridges the gap between the developers and operations team or teams responsible for the deployment, using which organizations can release small features very quickly and incorporate the feedback that they receive very quickly into their application. To achieve automation at various stages are Puppet, Jenkins, GIT, Chef, Docker, Selenium, and [AWS](bpbonline.com/search?q=AWS&type=product), which help in achieving continuous development, continuous integration, continuous testing, continuous deployment, and continuous monitoring, which expedites and actualizes the DevOps process apart from culturally accepting it to deliver quality software to the customer at a very fast pace.

The version control system for source code management is enabled by Git and GitHub
- Plug-ins for server automation built for developing CI/CD pipelines are enabled by Jenkins
- [Selenium](bpbonline.com/search?q=Selenium&type=product) enables automated testing
- [Docker](bpbonline.com/search?q=Docker&type=product) is the platform for software containerization
- [Kubernetes](bpbonline.com/search?q=Kubernetes&type=product) is the tool for container Orchestration
- Puppet enables configuration management and deployment used for deploying, configuring, and managing services.
- Chef enables configuration management and deployment and is used in more complex infrastructure with less effort and is an open-source integration framework supporting Linux and Unix variants and Windows.
- [Ansible](bpbonline.com/search?q=Ansible&type=product) also enables configuration management and deployment.
- Nagios enables continuous monitoring and is an open-source computer system and network monitoring application tool used for troubleshooting.

The various stages into which these tools are categorized by DevOps are as follows:
- Eclipse, Jira, Git, and Subversion are used for code development
- Maven, Gradle, and Ant are used for code build
- Puppet, Chef, Ansible, and RANCID are used for configuration management
- Selenium and JUnit are used for testing
- [Jenkins](bpbonline.com/search?q=Jenkins&type=product), Maven, and Ant are used for testing and building systems
- Bamboo, Jenkins, and Hudson are used for release
- Capistrano, SaltStack, Ansible, Chef, Puppet, Docker, and Vacrant are used for application deployment
- ActiveMQ, RabbitMQ, Memcache enable Queues, Caches, and so on.
- New Relic, Nagios, Graphite, Ganglia, Cacti, PagerDuty, Splunk, and Sensu are used for monitoring, alerting, and trending
- PaperTrail, Logstash, Loggly, and Splunk enable logging
- Monit, Runit, Supervisor, and God are process supervisors
- Snorby Threat Stack, Tripwire, and Snort are used for security
- Multihost SSH Wrapper and Code Climate are miscellaneous tools

Which one is your preferred tool? Tell us know in the comments section.
Lessons learnt so far in my programming Journey
Tags: beginners, programming, career
Published: 2022-06-11 18:40:07




**_The journey of a thousand miles begins with one step.
--Lao Tzu._**

Learning or achieving anything begins with just taking the first step. Taking the first step marks the beginning of a new direction/journey.

These are some of the lessons I've learned and still learning:
 
**Set a goal & move towards it:**

_**“Goal setting is massively individual, it’s about checking in with yourself and being really honest about what you want and what your motivations are” — Katerina Georgiou, Technical Coach @ Maker’s.**_

Setting a goal can be a powerful, motivational booster on your path to learning to code. 
There is no end to learning and improvement in programming, and that’s why it is a good idea to keep setting goals, not lose track of your primary goal, and also help you to be accountable.


**You must always be open to Learning:**

This is a journey of never-ending learning, there is no end to improvement. we are always upgrading our skills to meet the latest market requirement. As a beginner, you should always be ready to learn new things.
So, what can you take away from this? It is okay to not know everything. As long as you never stop learning new things, you’ll be fine.


**More doing, Less Watching:**

Watching along with a coding tutorial is great for starting out. You may learn a little when watching a code along but you actually learn more by doing.

A better way to learn to code build a project by yourself. Just get started. Write your own code, solve the bugs, read documentation, and use other resources like StackOverflow, google.

**Don’t compare your journey with anyone else’s:**

It's very important to know your journey is different from any other person's journey, so it will do you more good than bad to focus on yours and continue grinding. 
Comparing your own personal journeys with others often leads to discouragement. The only person you are in competition with is you.


**It's okay to be frustrated:**

Being frustrated is very much okay and it's part of the experience. It's okay to take a step back if things aren't going your way at a point in time.

It’s okay to hate it sometimes, it’s okay to ask for help, and it's okay to take your mind off that problem.


**Google is your Friend:**

Knowing how to google is one of the most important skills for a developer.
Becoming a great developer takes a lot of learning to achieve and more often we get stuck on a particular problem or bug. So it's essential to develop your googling skills.

The problem you are facing especially as a beginner in most cases has a solution and it's just a Google search away. This will help improve your googling skills.




Learning new things in general is a big task and as much takes a lot of dedication, energy, and input to achieve. I hope these few above-mentioned points will help you with this journey you've started.
Wishing you all the best as we journey together and i can't wait to see you at the top.
Shell Programming Using C Programming Language
Tags: shellprogramming, c, programming, unix
Published: 2022-06-11 18:38:03

The following C_Program is used to append text from one file to the end of another file. Does any one have an Idea on how I can implement the code using the **COMMANDLINE ARGUMENTS** and the various **FLAGS**
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/azppxmjeb7qeugx87s8p.png)