teleren/devto huggingface dataset:
Laravel image validation example

Tags: laravel, webdev, programming, codenewbie
Published: 2021-07-21 16:50:14

Hi artisan, today I will show you how to validate images in your laravel project easily.

**Solution**
```
$request->validate([
   'file' => 'image'
]);
```
Route : routes/web.php
```
Route::get('form-create','FromController@index');
Route::post('form-store','FromController@store')->name('form.store');

```


Controller : app/Http/Controllers/ImgController.php

```
<?php

namespace App\Http\Controllers;
use Illuminate\Http\Request;

use Illuminate\Support\Facades\Blade;
use App\Models\User;
use App\Models\Post;

class FromController extends Controller
{   

    public function create()
    {
        return view('form');
    }

    
    public function store(Request $request)
    {
        $request->validate([
           'file' => 'image'
        ]);
    }
}

```
GET FULL CODE: [Laravel image validation example](https://codesnipeet.com/laravel-image-validation-example/)
Welcome Thread - v134
Tags: welcome
Published: 2021-07-21 16:44:42

---
title: Welcome Thread - v134
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Purple spinning background with the words "yo"](https://media.giphy.com/media/1lBKMs4X8hSASiK47G/giphy.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
things new devs should learn
Tags: tips
Published: 2021-07-21 16:39:20

learn to write comments and pseudocode(this will help you and others so much .

think it through and step throw all of your code instead of saying why doesnt this way say what did i change before.

document, document document

never assume your first idea will be your best you a growing

always go back with new knowlage and improve your old code(if you an)
Running Experiments To Create Change w/ Dominica DeGrandis of TaskTop
Tags: change, workflow, velocity, storypoints
Published: 2021-07-21 16:34:08

Change is difficult.

And it’s even more difficult if you’re the one trying to make change happen. But as more organizations start modernizing their software development workflows, like going from story points to cycle time, change is something we need to learn how to implement.
 
That’s where Dominica DeGrandis comes in.

As the Chief Flow Advisor at TaskTop and author of [Making Work Visible](https://ddegrandis.com/book/), Dominica DeGrandis has been helping teams make big changes for decades. She joins us on [Dev Interrupted](https://devinterrupted.com/podcast/running-experiments-to-create-change/) to explain why change is necessary and how to approach making positive change within your organization. 
#**Listen to the full episode**
{% spotify spotify:episode:7gTKVJQIiGbvPEJffMIqWp %}

#**Episode Highlights include:**
* How to overcome resistance to change
* Flow and the 3 metrics behind it
* Strategies for making a new change stick
* Why Velocity and Story Points don’t work anymore
* The types of experiments to run within an organization

#**Join the Dev Interrupted Discord Server**
With over 1200 members, the Dev Interrupted Discord Community is the best place for Engineering Leaders to engage in daily conversation. No sales people allowed. [Join the community >>](https://discord.gg/devinterrupted)
![Join the Dev Interrupted Discord Community!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19j3dzgz4r4kzav3w6z8.png)
Day 8: Stacking up
Published: 2021-07-21 16:11:42

---
published: true
series: Competitive Programming
title: 'Day 8: Stacking up'
---

### Disclaimer:
> I am a beginner in competitive programming, and this is me documenting my learnings. So, anything I say is just what I think at the moment and should not be taken as hard truths.

### Problem 1: [cAPS lOCK](https://codeforces.com/problemset/problem/131/A)

Based on some property, give answer.

```cpp
#define all(x) begin(x), end(x)

main() {
  string s;
  cin >> s;

  int n = s.length();
  bool first = islower(s[0]);
  bool c = count_if(all(s), [](char c){ return isupper(c); });
  // check condition
  if((c == n) || (first && (c == n-1))) {
    for(auto& e: s) {
	  if(isupper(e)) cout << tolower(e);
	  else cout << toupper(e);
	}  
  } else {
    cout << s;
  }
}
```
To toggle case we can also use bitwise operators. It grossly simplyfies the code.
```cpp
for(auto& c: s) {
  cout << (char) (c^32); // toggle case
}
```

New cpp standard algorithm used:
- [count_if](https://www.cplusplus.com/reference/algorithm/count_if/)

### Problem 2: [Xenia and Ringroad](https://codeforces.com/problemset/problem/339/B)

Simple math problem.

```cpp
#define forn(i, n) for(int i = 0; i < n; i++)

main() {
  ll n, m;
  cin >> n >> m;
  ll ans = 0, curr = 1; 
  forn(_, m) {
	ll next;
	cin >> next;
	if(next >= curr) ans += (next-curr);
	else {
	  ans += (n-curr)+next;
	}
	curr = next;
  }
  cout << ans;
}
```

## Algorithm

We didn't learn any new algorithm today.
I should practice more problems, so that when I get stuck somewhere, I could try to learn a new algorithm.
Also knowing the basics should help, rather than learning all complex algorithms at once.
Sticking to learn new algorithm if and when required and doubling the questions to be practiced.

## Sources
- Toggle Case: [geeksforgeeks](https://www.geeksforgeeks.org/toggle-case-string-using-bitwise-operators/)
Sketchnote: Automate your Cloud with Microsoft Learn
Tags: azure, cloudskills, sketchnote, cloud
Published: 2021-07-21 16:05:28

In February, I had the honor to co-present the Microsoft Learn Live session “Automate your Cloud with Carnegie Mellon University and Microsoft Learn” on LearnTV. Didn't get a chance to attend the live event? The session is available on [Channel9](https://channel9.msdn.com/Shows/Learn-Live/Automate-Your-Cloud-with-Carnegie-Mellon-University-and-Microsoft-Learn).

## The session

Automating your cloud resource management can increase productivity, sustainability, and the scalability of your services. In this session, we will explain the concept of Infrastructure-as-Code and discuss the advantages that it offers over ordinary scripting. We will then go on to show how to automate cloud resource management with Infrastructure-as-Code tools like Terraform. We will explore Terraform’s role as an infrastructure orchestrator and describe how it differs from conventional configuration management practices.

Together, you will walk through the free Microsoft Learn module [“Automate cloud resource management“](https://aka.ms/CMUAutomateCloud).

Click on the following image to access the session recording.

[![session recording](https://sec.ch9.ms/ch9/1a38/692182e0-0afa-465c-99a6-cd17733b1a38/LearnLive-CloudAdmin03_512.jpg)](https://www.youtube.com/embed/qRTFUjZepZk"session recording")

## The sketch note

The following sketch note covers the basics of cloud automation in Microsoft Azure.

[![sketch note](https://github.com/sfoteini/sketchnotes/blob/main/cloud-automation.png?raw=true)](https://github.com/sfoteini/sketchnotes/blob/main/cloud-automation.png?raw=true)

## Learning resources

Here are some resources! Happy learning!
* [Automate cloud resource management Microsoft Learn learning path](https://aka.ms/CMUAutomateCloud)
* [Automate cloud resource management session recording](https://channel9.msdn.com/Shows/Learn-Live/Automate-Your-Cloud-with-Carnegie-Mellon-University-and-Microsoft-Learn)
* [Automate cloud resource management sketch note](https://github.com/sfoteini/sketchnotes/blob/main/cloud-automation.png?raw=true)

--------------------

More articles: [www.foteinisavvidou.codes](https://www.foteinisavvidou.codes/)

✨ [Blog](https://www.foteinisavvidou.codes/) | [LinkedIn](https://www.linkedin.com/in/foteini-savvidou) | [Twitter](https://twitter.com/SavvidouFoteini) | [GitHub](https://github.com/sfoteini)
Defining The Role Of Staff Engineer w/ Will Larson of Calm
Tags: staffengineer, management, leadership, culture
Published: 2021-07-21 15:50:46

On this week’s episode of [Dev Interrupted](https://devinterrupted.com/podcast/defining-the-role-of-staff-engineer/) we’re tackling one of the most ambiguous and subjective roles in the software engineering career path: the Staff Engineer.

Many companies don’t even have this role, and the ones that do have a hard time defining exactly what it means. Will Larson, the CTO of Calm, and author of the new book, [_Staff Engineer: Leadership Beyond the Management Track_](https://staffeng.com/book), joins us to share his research on what a Staff Engineer actually is and whether or not companies need one.

#**Listen to the full episode**
{% spotify spotify:episode:4tX6oRd407xz78lpVkNRrr %}

#**Episode Highlights include:**
* The different archetypes of the Staff Engineer role
* Whether or not a purely technical senior role exists
* The differences between management and leadership
* Strategies for becoming a Staff Engineer
* How to decide if your organization needs a Staff Engineer role

#**Join the Dev Interrupted Discord Server**
With over 1200 members, the Dev Interrupted Discord Community is the best place for Engineering Leaders to engage in daily conversation. No sales people allowed. [Join the community >>](https://discord.gg/tpkmwM6c3g)
![Join the Dev Interrupted Discord Community!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19j3dzgz4r4kzav3w6z8.png)
JavaScript Frontend
Published: 2021-07-21 15:42:43

Moving into more of the frontend side of things using JS as a frontend language besides using rails erb I can see how I'm able to make a more friendly user experience. Even though I can add a button with rails erb and have it load a new page, with JS I can make it Fetch JSON from a rails api and give me back that info to use without having to have the user wait for the page to load. With that same power I can also Post, Edit and Delete through Fetch and being able to update the DOM without a refresh. This makes the user experience friendlier and they don't have to sit there waiting for the page to refresh. 

The hardest part of working on this webpage was trying to figure out how I wanted to structure my app. I first started by making everything as a class then calling each method on the main file. But that got really messy and those classes served no function besides calling class methods. So I got rid of all the classes and only made two classes Task and Item which served a purpose to store each Object that was fetched from the Rails API. Next I built out generator functions that would return back some raw html to render a Task or a Item to the DOM to clean up the code in the main file. 
In the end the code looks a lot cleaner now and a lot more readable   .    

I can't wait till I get to learn React next which will take a lot of the pain of writing out all the code myself to interact with the DOM and focus more on the meat of the app.
Googling Tips for Developers
Tags: podcast, productivity
Published: 2021-07-21 15:25:04

{% spotify spotify:episode:5QOofAZf208EwRDM5MwHqh %}

## What is HTML All The Things

HTML All The Things is a [web development podcast](https://podcast.htmlallthethings.com/) and [discord community](https://discord.com/invite/jweMCx9) which was started by Matt and Mike, developers based in Ontario, Canada. 

The podcast speaks to web development topics as well as running a small business, self-employment and time management. You can join them for both their successes and their struggles as they try to manage expanding their Web Development business without stretching themselves too thin.

## What's This One About?

In this episode Matt and Mike discuss Googling for developers and other tech professionals. If you've ever worked in IT you may have heard the phrase "we are just professional Googlers." Googling all the time can be spun in a negative way as it can be seen as easy, or something that people only do when they don't know what they're doing. This episode tackles this negative stigma, breaking down why tech professionals need to be such good Googlers, and why Googling all the time does not mean you don't know how to do your job, and why having good Googling skills is so valuable.

## Show Notes

3:25 - Introduction
4:25 - Matt's googling process
9:00 - Mike's googling process
15:00 - Googling goes beyond just finding a solution to a problem
21:50 - How do you keep the resources you've found organized?
28:48 - Googling stuff can have a negative connotation
35:50 - Mike's take on being a professional Googler


##Key Takeaways

* When searching, start with search terms as specific as possible and make is broader and border when you don't find the answer.

* Ask for help when you've done the initial searches. 

* Google search operators are very powerful. https://ahrefs.com/blog/google-advanced-search-operators/

* There's no way you can know everything about everything. It's more important to learn how to find that information then to just know it. 

## Thank you!

If you're enjoying the podcast consider giving us a review on [Apple Podcasts](https://podcasts.apple.com/us/podcast/html-all-things-web-development-web-design-small-business/id1412209136) or checking out our Patreon to get a shoutout on the podcast. 

**[Support us on Patreon](https://www.patreon.com/htmlallthethings)**

You can find us on all the podcast platforms out there as well as

[Instagram (@htmlallthethings)](https://www.instagram.com/htmlallthethings/)
[Twitter (@htmleverything)](https://twitter.com/htmleverything)
[TikTok (Html All The Things)](https://www.tiktok.com/@htmlallthethings)
Backend Developers — Top Trending Stories this Week.
Tags: softwareengineering, programming, softwaredevelopment, backend
Published: 2021-08-11 12:57:04

---
title: Backend Developers — Top Trending Stories this Week.
published: true
date: 2021-07-21 15:13:28 UTC
tags: softwareengineering,programming,softwaredevelopment,backend
canonical_url: https://medium.com/backenders-club/backend-developers-top-trending-stories-this-week-3a8b8e545ce6
---

### Backend Developers — Top Trending Stories this Week.

Backend Developers received some fantastic content in the past few days, and here, we share our favorites.

[5 Most Scalable Backend Development Languages/Frameworks in 2021–22](https://medium.com/backenders-club/5-most-scalable-backend-development-languages-frameworks-in-2021-22-f7f96101c19b): This article shares the top 5 languages/frameworks for backend development to rule the roots in **2021** and the coming years…

You don’t want to miss the **COMMENTS** in this article 😂

[Why are backend developers making a comeback in the market?](https://medium.com/backenders-club/why-backend-developers-making-a-come-back-in-market-2fcea62e650f): This article highlights why Backend developers seem to come back in more demand these days. If I see recent job trends, more companies are now asking for a Backend developer…

It would be best if you had read this article to better **POSITION** yourself for the **JOB MARKET**.

[Top Java Serialization Interview Questions and Answers](https://medium.com/backenders-club/top-java-serialization-interview-questions-and-answers-d53de4fdb41b): Serialization in java is the process of converting the state of an object into a byte stream, which can be saved as a file on the local disk or sent, over the network, to another machine…

If you’re a Java developer, then learning these **Java serialization interview questions** is a  **MUST**.

[5 Must-have skills for a Backend Developer](https://medium.com/backenders-club/5-must-have-skills-for-a-backend-developer-f97284061fc6): This article will explore the most critical technical and non-technical skills for a backend developer and why it is crucial to learn these skills in today’s ever-changing world of technologies and tools…

If your mentee asks you for the **SKILLS** required to learn Backend Development, what will you say? 😏😏 Find out in this article.

[Rust Programming Language: The Ultimate Guide:](https://medium.com/backenders-club/rust-programming-language-the-ultimate-guide-4d7462752aeb) This is the most comprehensive guide to the Rust Programming Language online…

You can submit your article to the Backend Developers publication. [Click on this link right now](https://masteringbackend.com/write-for-us).

Thanks for reading these

Until next week,

Stay safe.

Solomon Eseme  
_Editor @_[_Backend Developers_](https://medium.com/backenders-club)

* * *
Road To An Internship - Starting Off [0/3]
Tags: story, internships, css, boostrap
Published: 2021-07-21 15:07:09

Hey folks!

In December of 2020, I decided to pursue a career as a web developer - in this series of articles I'll be talking about the steps I took. You don't have to follow these exact steps, however I wanted to write about my experience and on top of that I hope to motivate some of you future developers who are currently trying to forge your own path!

I'm far from a full stack web developer, nevertheless I have the mindset of learning new things everyday. Taking that in account, I've accomplished a lot of my goals that I had in mind when I was starting. One of them was securing an internship and working what I love. 

### Starting Off 🌟

I have to say that I had prior programming knowledge before I started learning with a more serious approach. Where did I start? CSS. I practiced CSS a LOT. It might sound weird, but if you start working with responsive designs, grid designs, flexbox and the rest, you need to know CSS quite well. 
I recommend everyone who's a beginner to use [Bootstrap's Grid](https://getbootstrap.com/docs/4.0/layout/grid/) system. 
As I was working through the grid system, I was acquiring knowledge in colors.  [Adobe Color](https://color.adobe.com/) is an amazing tool which assisted me in choosing and picking colors. 

My way of learning is making projects - in my opinion that is the best way to learn a skill. I picked up a Udemy course about CSS and created a website called  [Omnifoods](https://aacevski.github.io/Omnifoods/). 

It's not the finest websites, however I acquired plenty of knowledge. Some other pretty useful websites if you're starting are
[Glyphs](https://css-tricks.com/snippets/html/glyphs/), [0to255](https://www.0to255.com/) and last but not least [Octopus](https://octopus.do/). 

I'm in love with Octopus since it makes sure you plan out your website prior to doing the programming. 

### To be continued... 🔜

That's how I started out, in the next article I'll be talking how I learned about API's, Node.js and much more. Thanks for reading!
How I solved SQL to Redis caching with Go
Tags: go, mysql, redis, postgres
Published: 2021-07-21 15:05:25

# Problem

I wanted a library to abstract copying data from MySQL + Postgres to Redis for the purpose of caching, none were present at the time.

# Solution

Introducing, [redisql](https://github.com/DGKSK8LIFE/redisql), a Go module and command-line tool that allows you to convert SQL tables to a desired Redis datatype with one method call. 

# Example

Let's start with a celebrity table: 

```
mysql> DESCRIBE celebrity; 
+-------+------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------+------+------+-----+---------+-------+
| name  | text | YES  |     | NULL    |       |
| age   | int  | YES  |     | NULL    |       |
+-------+------+------+-----+---------+-------+
2 rows in set (0.01 sec)
``` 

Now we incorporate redisql:

```go
package main

import (
    "github.com/DGKSK8LIFE/redisql"
)

func main() {
	config := redisql.Config{
		SQLType:     "mysql",
		SQLUser:     "user",
		SQLPassword: "password",
		SQLDatabase: "celebrities",
        SQLHost:     "localhost",
        SQLPort:     "3306",
		SQLTable:    "celebrity",
		RedisAddr:   "localhost:6379",
		RedisPass:   "password",
	}
	err := config.CopyToString()
	if err != nil {
		panic(err)
	}
}
```

In redis-cli:

```redis
127.0.0.1:6379> get celebrity:0:name
"Jaden Smith"
```

If we wanted to copy to other datatypes:
```go
// copy to redis list
config.CopyToList()

// copy to redis hash
config.CopyToHash()
```
Mastering Flutter: An introduction to Pay plugin
Published: 2021-07-21 15:05:17

It has passed a while from when Flutter was a "**new thing**" and it had quite a wild run. One thing did miss however was a pure dart support for **paying physical goods** but now we have the boringly named **"pay" plugin** (here's the [pub.dev page](https://pub.dev/packages/pay))! Let's get on with it and let's check how to start integrating payment on our app!

Check out the [full article here](https://theotherdevs.com/mastering-flutter/mastering-flutter-an-introduction-to-pay-plugin/)!
Angular infinite scrolling using RxJS and NgRx
Tags: angular, rxjs, ngrx, javascript
Published: 2021-07-21 14:51:21

{% github anirbmuk/angular-scroll-demo no-readme %}

I have seen multiple blog posts on this topic which make use of one method or the other. I just thought of putting everything together under one hood - `RxJS`, `NgRx`, `Angular Material` and in the end, pure **document** property access. This is what is leads to:

![Preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7fqv5tuadezuengzlscf.gif)

Let's quickly talk about the setup here - I am using an Angular `CLI 12.1.0` project. I have `NgRx` state management set up, with a root state and a feature state. Of course, NgRx is in no way related to the purpose of this application, but I just thought it would not hurt to implement it. We have to admit, as your application grows in size, NgRx does give you some peace of mind :-)


The UI is built using `angular material`. I have used the mat-list and and the mat-spinner components. I have some hard-coded dummy data, which I have converted into an observable stream, with a delay of 1500 ms, which gives some feeling of having fetched data from a REST service.


The key logic is to calculate when the user has scrolled down to the edge of the page. I chose a simple formula derived from the document object. Of course there are other fancy approaches like using an `IntersectionObserver`, but that's something I felt was too much for me!

![data.service.ts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gctg6k1yrs6rmebzhmsg.PNG)
The above formula works great on a desktop, as well as a mobile - but feel free to drop me a note if it doesn't.

I set up the scroll action using RxJS `fromEvent`.
![data.service.ts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmmvqvje4looz5lg7d4i.PNG)

Once the scroll event is set up, whenever the above formula is satisfied, the next set of data is called for. For my sample use case, I have used a limit and skip value, which I have used to slice off a chunk from my dummy data set. Every time a new set is emitted by my data observable, I have made use of a reducer function to append it to my previous list of data.

![feature.reducer.ts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tiv3f86u4ch4bz9g3c92.PNG)

This is where I store the next limit and skip values for the next data load, and also make a simple calculation of whether my data load is complete, and set it on my state. Once this flag becomes true, subsequent scroll actions do not trigger any more data fetch.

![data.service.ts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/erm1bncepoxpgom8b6cm.JPG)

Cheers :-)
[Anirban Mukherjee](https://anirbmuk.appspot.com/en)