teleren/devto huggingface dataset:
Laravel 8 image Upload crud using spatie mediaLibrary package
Tags: laravel, php, beginners, webdev
Published: 2021-05-19 11:40:08

in this  tutorial you will see how to upload image with spatie mediaLibrary package.

[Read Full Article...](https://larainfo.com/blogs/laravel-8-image-upload-full-crud-with-spatie-medialibrary-package) 

you will also learn how to upload image,image edit,image delete.today you will see all in one place

I’m pretty sure many of you may have found yourself gotten into the situation where you do not edit,

or delete image with post

#### Laravel image Upload full crud with spatie mediaLibrary package 

Step 1: Set Up Laravel Project
Step 2: Set Up Database Details in ENV
Step 3: Create Model and Migration
Step 4: Install laravel-medialibrary
Step 5: Set Up laravel-medialibrary
Step 6: Perform Crud Operations

### Set Up Laravel Project

Installing a fresh new laravel application, so head over to the terminal, type the command, and create a new laravel app.

```
composer create-project --prefer-dist laravel/laravel laravel_image_crud
```
Now, You have to move to the project folder:
```
cd laravel_image_crud
```
### Set Up Database Details in ENV

Now, you have to connect the laravel app to the database, hence open the .env configuration file and add the database credentials as suggested below.
```
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=database_name
DB_USERNAME=database_user_name
DB_PASSWORD=database_password
```
### Create Model and Migration
In the terminal screen, type the recommended command and execute it to generate model and migration files.
```
php artisan make:model Image -m
```
You need to add the $fillable array and add the table values  app/Models/Image.php file.

```php
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;

class Image extends Model implements HasMedia
{
    use HasFactory, InteractsWithMedia;

    protected $fillable = [
        'name'
    ];
}
```
[Read Full Article...](https://larainfo.com/blogs/laravel-8-image-upload-full-crud-with-spatie-medialibrary-package)

##Read aslo
[Laravel php artisan inspire command](https://larainfo.com/blogs/laravel-php-artisan-inspire-command-that-can-inspire-you)
[Laravel clear cache without using artisan command](https://larainfo.com/blogs/laravel-clear-cache-without-artisan)
Hosting your react-native express.js backend on Heroku.
Tags: reactnative, node, heroku
Published: 2021-05-19 11:38:40

You have created an app in react native and written backend in expressjs/nodejs and you want to host your backend so you can get or post data on your app from anywhere?

Answer: Heroku.

Here's how:

* Create a Heroku account on www.heroku.com
* Install Heroku CLI.

```
// for mac:
brew tap heroku/brew && brew install heroku
// for ubuntu: 
sudo snap install --classic heroku

```
* After Heroku CLI has been installed, open the terminal and just login with your credentials

```

// type this in your terminal to login:
heroku login

```

* When you have logged in you can create a heroku app by executing this command:

```

heroku create

```

* Once the heroku app has been created you will see the app name, remote git link and the site url.

* Add heroku remote branch:

```
heroku git:remote -a your-app-name

```

* Heroku git remote will be added and you can check that by:

```

git remote -v

```

* Add Procfile to the root of your backend folder, eg:

```
-ReactNativeAppFolder
 -MainBackendFolder 
  -routesFolder
    -Routes.js
  -modelsFolder
    -Schema.js
  -app.js
  -package.json
  -package-lock.json
  -Procfile

```

* Procfile is needed to tell heroku to run node app.js on it's server, so your app can start and run.

* You don't need to push the whole react-native app to heroku you can just push your backend folder to it, here's how:

```

git subtree push --prefix MainBackendFolder heroku master

// this specific command makes sure that only backend folder gets pushed to heroku.

```

* After the build and push is successful heroku will tell you that your app is being hosted on a specific url.

* You can then add the specific url however you want to on your get and post request urls. That is it.
Wednesday Links - Edition 2021-05-19
Tags: scala, java, jvm, kotlin
Published: 2021-05-19 11:37:17

Scala 3 has been released (3min read) 🎉
https://www.scala-lang.org/blog/2021/05/14/scala3-is-here.html

Health report of your JVM app with JFR events (2min read) 🙈
https://github.com/flight-recorder/health-report

Comments? We don't need no stinkin' Comments! (40min read) 💩
https://www.ufried.com/blog/comments_1/

Agent for custom low level JFR events (10 min read) 🗞
https://developers.redhat.com/blog/2021/01/25/introduction-to-containerjfr-jdk-flight-recorder-for-containers

Stream#mapMulti() is the new Stram#flatMap() (2 min read) 🥴
https://4comprehension.com/java-stream-mapmulti

(re)Discover memory leak in Spring (3min read) 💣
https://krzysztofslusarski.github.io/2021/05/13/casspringjdbc.html 

Dealing with Full GC on G1 (4min read) 😱
https://krzysztofslusarski.github.io/2021/05/16/fullgc.html

Kotlin Coroutines 1.5.0 is out (12min read) 🥳
https://blog.jetbrains.com/kotlin/2021/05/kotlin-coroutines-1-5-0-released/

Docker in a glance (256s listen) 📻
https://256.nurkiewicz.com/40

GraalVM with adaptive G1GC (10min read) 🧐
https://blogs.oracle.com/javamagazine/pedal-to-the-metal-high-performance-java-with-graalvm-native-image

Fetch plan in JPA (5min read) 🤯
https://vladmihalcea.com/jpa-entity-graph/
Node.js : Reading a file line by line
Tags: node, programming, webdev, javascript
Published: 2021-05-19 11:01:47

Create a file as app.js (or whatever name you want) and paste below code -

app.js
```javascript
const readline = require('readline');
const fs = require('fs');
var file = 'path.to.file';
var rl = readline.createInterface({
 input: fs.createReadStream(file),
 output: process.stdout,
 terminal: false
});
rl.on('line', function (line) {
 console.log(line) // print the content of the line on each linebreak
});
```

`path.to.file` will be path of your file and once modified this line you can run 'node app.js' and you will get the file reading as line by line.

<a href="https://www.buymeacoffee.com/rkycom" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;" ></a>

With all that being said, I highly recommend you keep learning!

Thank you for reading this article. Please feel free to connect with me on [LinkedIn](https://www.linkedin.com/in/www-rajeshkumaryadav-com/) and [Twitter](https://twitter.com/rky_com).

{% link https://dev.to/rajeshkumaryadavdotcom/node-js-determining-the-line-count-of-a-text-file-195l %}
{% link https://dev.to/rajeshkumaryadavdotcom/node-js-reading-a-file-line-by-line-5ga9 %}
{% link https://dev.to/rajeshkumaryadavdotcom/node-js-reading-from-a-file-synchronously-28ef %}
{% link https://dev.to/rajeshkumaryadavdotcom/node-js-checking-if-a-file-or-a-directory-exists-1jp6 %}
{% link https://dev.to/rajeshkumaryadavdotcom/node-js-check-permissions-of-a-file-or-directory-3l7k %}
Software delivery through a flexible and agile DevOps model
Tags: devops
Published: 2021-05-19 10:59:37

**DevOps Portfolio** 

[Software delivery through a flexible and agile DevOps model] (https://www.softwebsolutions.com/software-delivery-through-agile-devops-model.html)

**Challenges**
In the fast-moving world, digitization is sweeping across many industries, creating an unparalleled demand for companies to innovate, experiment and deliver capabilities faster. As the demands of modern businesses have increased significantly, affecting the very nature and scale of software development, companies require a more flexible and efficient approach to software delivery. So, due to these required changes in technical, organizational and cultural aspects, DevOps adoption and implementation have become essential.

**Solutions**

DevOps is considered important in the ability to frequently and reliably update a system in an operational state. DevOps presumes automation and seamless cross-functional collaboration between multiple teams. Hence, to manage a single smart product developed by multiple teams, our client needed a robust DevOps approach.

[Softweb Solutions] (https://www.softwebsolutions.com) significantly accelerated the delivery of mobile and web apps features, fixes, and updates by aligning the client’s development, testing and staging environments with the production environment, thereby automating performance testing, load balancing, IT infrastructure monitoring and log management. With the DevOps approach, at no point were any of the teams dependent on each other for their own tasks.
Automation testing. Tools and technologies 
Tags: testing
Published: 2021-05-19 10:59:02

Tools and technologies we use for automation testing. It's time to explore the technical side of automation testing. In many cases, the team's toolset is the trigger point in the decision-making process regarding further cooperation. Here what we use:

=> Java, JavaScript and Python for scripts development.
=> Such testing frameworks as JUnit and TestNG for Java, PUnit, and PyDev for Python to develop, group and run auto-tests.
=> JBehave and Cucumber for Behaviour-Driven Development.
=> Allure and Thucydides frameworks for report generation.
=> Jenkins, CircleCI, Travis CI for Continuous Integration.

More at https://hire-tester.com/
Automation testing. Reporting
Published: 2021-05-19 10:58:03

You have a clear picture and understanding of what automation testing is and how the process looks like in general. But what about the reporting?

We can share our experience and show how it works in our team. Once the testing is completed, you get the source project, all test cases, and automation scripts with instructions.

What for? This is an opportunity for you to run a set of tests locally and update them following the product improvements.

But to save your time, we at HireTester offer to provide further support of scripts on our side. Interested? We are just one message away. https://hire-tester.com/

#HireTester #qa #testing #softwaretesting #QAcompany #automationtesting #AQA #QAreporting
Automation testing procedure
Tags: testing
Published: 2021-05-19 10:56:37

How does the automation testing procedure look like at HireTester?
First, we analyze specifications and other project documentation, study the application and decide on test tools and technologies to be used during the testing process.

Then, we review your requirements, perform manual testing, develop test cases and test scenarios.

The next stage is test cases and test scenarios agreement with you.

After that, we get to the scripts development and tests running with reporting on the received results.

Looking for automation software testing services or a dedicated AQA specialist? Feel free to reach us out at info@hire-tester.com or visit https://lnkd.in/drpNgEi.

#HireTester #qa #testing #softwaretesting #QAcompany #automationtesting #AQA
Automation testing 
Tags: testing
Published: 2021-05-19 10:54:33

Automation testing is the process of software verification when the major functions and test steps, such as start, initialization, execution, analysis, and report on results, are performed automatically with the help of test automation tools and with no or little human interaction.

This testing technique helps to achieve greater test speed and efficiency. It is especially profitable for the verification of complex products or separate functional blocks of large projects that are frequently updated, have vast functionality, and, as a result, require continuous manual testing.

The HireTester team provides automation testing services for web applications. And if you’re still considering the necessity of automation testing for your product, get in touch for a competent consultation: info@hire-tester.com.

Depending on the product structure and requirements, we advise what type of testing is appropriate for it and whether automation testing is actually needed.

#HireTester #qa #testing #softwaretesting #QAcompany  #automationtesting #AQA
FAQs on Bug Life Cycle in Software Testing
Tags: testing
Published: 2021-05-19 10:53:26



What is a non-reproducible bug?
A non-reproducible bug is a defect triggered by a specific action that cannot be easily traced or reproduced by testers.

What is bug management?
Bug management is a process of bug identification, investigation from discovery through to resolution and elimination.

What is a bug report?
A bug report provides a detailed outline of the detected defects as well as the environment and precise steps leading to their reproduction.

What information should be included in a bug report?
The requirements as for what information a bug report should contain may vary depending on the project, customer requirements, or QA team approaches to the testing process. As a rule, a bug report should reveal the following points: summary, overview or description, steps to reproduce, test results, environment setup, configuration, screenshots.

What to learn more about bugs and how to deal with them developing a product? Visit: https://hire-tester.com/

#HireTester #qa #testing #softwaretesting #QAcompany #manualtesting #automationtesting #dedicatedQA #bug
Bug life cycle in software testing 
Tags: testing, bug
Published: 2021-05-19 10:52:15

A bug or defect detected in software goes on a fascinating journey through various stages, corresponding certain bug statuses right until being resolved or closed. What are these stages? Let’s track the route.

New
This status is applied to new, lately discovered, and added to a tracking system bugs.

Assigned
These are the bugs that have been already assigned to a certain specialist for checking, fixing, or verification.

Open
This status shows that the specialists entrusted with the bug are actively inspecting it. They can also assign another status to the bug: Duplicate, Rejected, Deferred, or Not a Bug.

Fixed
As its name implies, the bug gets this status after the fixing is completed and when a QA engineer can continue the verification process.

Retest
This status is a signal for a QA engineer to retest the bug, confirm if it has been indeed fixed with no impact on corresponding functionality.

Reopen
If the bug has been reproduced during retesting, it gets the Reopen status and goes to the developer for re-investigation.

Verified
The status used for bugs the QA engineer could not reproduce during testing.

Closed
This status shows that all verification procedures are completed, and the bug does not exist anymore.

https://hire-tester.com/
#HireTester #qa #softwaretesting
Laravel Regex Strong Password Validation Example Tutorial

Tags: laravel, programming, php, tutorial
Published: 2021-05-19 10:29:51

<p>Hi Dev,</p>
      
<p>Today, I will learn you how to use strong password validation example with regex in laravel we can create strong password validation before registration in laravel.</p>

<p>In this tutorial password validation example we will force utilizer to give password must be more than 8 characters long, should contain at-least 1 Uppercase, 1 Lowercase, 1 Numeric and 1 special character before submit the form.</p>

more..

if you want to see full example follow this link..

https://codingtracker.blogspot.com/2021/05/laravel-regex-strong-password.html
SVG zu CSS konvertieren
Tags: css, svg
Published: 2021-05-19 10:09:08

SVG steht für Scalable Vector Graphics. Es ist ein offener Standard für Vektorgrafikdateien. Es ist ein mächtiges Werkzeug in den Händen eines Webdesigners, mit dem man grafische Effekte auf Webseiten erstellen kann.

Die [https://j0e.org/tools/svg-to-css/](Umwandlung von svg Dateien in css Hintergründe) ist ein sehr einfacher Prozess. Die svg Datei ist nur eine Bilddatei, die zusätzliche Informationen hat, um das Bild in xml zu beschreiben. Da die Hintergrundbilder auf verschiedenen Seiten und in verschiedenen Größen verwendet werden, kann der css-Code helfen, Probleme mit der Dateigröße zu vermeiden. Der css-Code ist nur ein paar Zeilen Code und der Prozess wird unten erklärt.
Angular Dev Tools 
Tags: angular, dev, devtools
Published: 2021-05-19 09:52:12

⚡ We now have Angular `Chrome Developer Tools`, a new way to debug angular apps ⚡

Easily navigate between component hierarchy, `properties` `directives` and more,

We can deliberately update property value from `Angular Dev Tools`

> **The Angular Developer tools support on `Angular Version 9+`**

Install now to:
‣ Visualize the structure of your apps
‣ Explore, inspect & edit components Left-pointing magnifying glass
‣ Profile performance Bar chart

Install here → [http://goo.gle/install-angular-devtools]
Read Full Documentation → [https://angular.io/guide/devtools]

<figure>
  <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a7repiltf8xanybj0ar1.gif" alt="Trulli" style="width:100%">
  <figcaption>Chrome Angular Developer Tool</figcaption>
</figure>
Java 9 Module System
Tags: java, java9, module, systems
Published: 2021-05-19 09:37:23

https://grokonez.com/java/java-9/java-9-module-system

Java 9 Module System

Java 9 <strong>Module System</strong>, which is developed under <strong>Project Jigsaw</strong>, comes to us with the specific goal: to provide <em>reliable configuration</em> and <em>strong flexible encapsulation</em>. That helps application developers, library developers, or Java SE Platform implementors more easilier create a scalable platform, make greater platform integrity, and improve performance. In this tutorial, we're gonna take a look at Java 9 <strong>Module System</strong> in a summarized way.

<!--more-->
<div id="tuttoc" class="jsa-toc"></div>

<div id="tutcontents">
<h2>I. Why Jigsaw?</h2>
The primary goals of <a href="http://openjdk.java.net/projects/jigsaw/" rel="nofollow">Project Jigsaw</a> are to:
<div class="jsa-quote">
<ul>
<li>Make the Java SE Platform, and the JDK, more easily scalable down to small computing devices;</li>
<li>Improve the security and maintainability of Java SE Platform Implementations in general, and the JDK in particular;</li>
<li>Enable improved application performance;</li>
<li>Make it easier for developers to construct and maintain libraries and large applications, for both the Java SE and EE Platforms.</li>
</ul>
</div>
A standard module system was designed and implemented to have ability to modularize the JDK and other large legacy code bases.
<h2>II. Module System</h2>
<h3>1. What is Module?</h3>
<h4>1.1 Definition</h4>
A module is a named, self-describing collection of:
- code: packages containing types (Java classes, interfaces...)
- data: resources and other kinds of static information.

In summary:
- Class contains fields, methods.
- Package contains Classes, Enums, Interfaces, configuration files...
- Module contains Package and Other data resources.
<h4>1.2 Declaration</h4>
This is the way we declare a module:

More at:

https://grokonez.com/java/java-9/java-9-module-system

Java 9 Module System
Java 9 Multi-Resolution Images
Tags: java, java9, images, multiresolution
Published: 2021-05-19 09:31:27

https://grokonez.com/java/java-9/java-9-multi-resolution-images
Java 9 Multi-Resolution Images

In this tutorial, we will introduce <a href="https://grokonez.com/category/java/java-9">Java 9</a> Multi-Resolution Images, a new API that allows a set of images with different resolutions (width and height) to be encapsulated into only one single image.

<!--more-->
<h2>I. Basic operations</h2>
The new API which is defined in the <code>java.awt.image</code> package can help us:
- Encapsulate many images with different resolutions into an image as its variants.
- Get all variants in the image.
- Get a resolution-specific image variant - the best variant to represent the logical image at the indicated size based on a given DPI metric.

Now take a look at <code>MultiResolutionImage</code> with 2 importants methods <code>getResolutionVariant()</code> that returns an <code>Image</code> and <code>getResolutionVariants()</code> that returns a list of <code>Image</code>s:
<pre><code class="language-java">
package java.awt.image;

public interface MultiResolutionImage {

    Image getResolutionVariant(double destImageWidth, double destImageHeight);
    public List<Image> getResolutionVariants();
}
</code></pre>
Then, we have an <strong>abstract</strong> class that implements <code>MultiResolutionImage</code>:
<pre><code class="language-java">
public abstract class AbstractMultiResolutionImage extends java.awt.Image
        implements MultiResolutionImage {

    @Override
    public int getWidth(ImageObserver observer) {
        return getBaseImage().getWidth(observer);
    }

    @Override
    public int getHeight(ImageObserver observer) {
        return getBaseImage().getHeight(observer);
    }

    @Override
    public ImageProducer getSource() {
        return getBaseImage().getSource();
    }

    @Override
    public Graphics getGraphics() {
        throw new UnsupportedOperationException("getGraphics() not supported"
                + " on Multi-Resolution Images");
    }

    @Override
    public Object getProperty(String name, ImageObserver observer) {
        return getBaseImage().getProperty(name, observer);
    }

    protected abstract Image getBaseImage();
}</code></pre>
This abstract <code>AbstractMultiResolutionImage</code> class provides default implementations of several <code>Image</code> methods. We can create our own custom class by extending it to implement the interface.

More at:

https://grokonez.com/java/java-9/java-9-multi-resolution-images
Java 9 Multi-Resolution Images
Java 9 Optional Improvements
Tags: java, java9, optional
Published: 2021-05-19 09:15:26

https://grokonez.com/java/java-9/java-9-optional-improvements

Java 9 Optional Improvements

Java 9 Optional comes with some small useful improvements. In this tutorial, we're gonna look at new added methods: <code>stream()</code>, <code>ifPresentOrElse()</code> and <code>or()</code>.

<!--more-->
<div id="tuttoc" class="jsa-toc"></div>

<div id="tutcontents">
<h2>I. New Optional API</h2>
<h3>1. stream()</h3>
With <strong>Java 8</strong>, this is a way for getting a List of Values from a Stream of Optionals:
<pre><code class="language-java">List&lt;String&gt; strings = streamOptional()
				.map(Optional::get)
				.collect(Collectors.toList());</code></pre>
But, if <code>streamOptional()</code> returns a Stream that contains an <strong>empty Optional</strong> instance. It will throw a <code>java.util.NoSuchElementException</code>.
To handle this case, we can add <code>filter()</code> method:
<pre><code class="language-java">// streamOptional(): [(Optional.empty(), Optional.of(&quot;one&quot;), Optional.of(&quot;two&quot;), Optional.of(&quot;three&quot;)]

List&lt;String&gt; strings = streamOptional()
				.filter(Optional::isPresent)
				.map(Optional::get)
				.collect(Collectors.toList());
				
// Result: strings[one, two, three]</code></pre>
<strong>Java 9</strong> provides new <code>Optional::stream</code> to work on <code>Optional</code> objects lazily, it returns a stream of either zero or one/more elements. It also checks empty element automatically and removes it.
<pre><code class="language-java">// streamOptional(): [(Optional.empty(), Optional.of(&quot;one&quot;), Optional.of(&quot;two&quot;), Optional.of(&quot;three&quot;)]

List&lt;String&gt; newStrings = streamOptional()
				.flatMap(Optional::stream)
				.collect(Collectors.toList());
				
// Result: newStrings[one, two, three]</code></pre>
<h3>2. ifPresentOrElse()</h3>
<strong>Java 8 Optional</strong> provides <code>ifPresent()</code> method to perform the given action if a value is present, otherwise do nothing.

More at:

https://grokonez.com/java/java-9/java-9-optional-improvements

Java 9 Optional Improvements