teleren/devto huggingface dataset:
Getting started with code.
Tags: javascript, codenewbie, programming, development
Published: 2021-05-18 06:48:35

The number one question I am asked on social media is, "how do I get started with coding" - so I'm here to point all my new devs in the right direction. 

The advice is simple really. Build, break, create. 

Build: I recommend building something. Anything. As long as you are writing code, you are making a step in the right direction (as a beginner). 

Break: You will break sh*t. It's going to happen and you have to be okay with that. It doesn't matter if you have been coding for 1 year, or 12 - you will end up breaking something. The good news is, that is how you learn!

Create: I include 'create' separate from 'build' because I think they can be two separate processes. In my 'build, break, create' methodology, you are building out of necessity for learning. Alternatively, you create things out of passion.

So there it is. My #1 advice. Build, Break, Create. 
Happy coding!
A beginners guide to PowerApps Component Framework (PCF) – part 2: Common problems/errors
Tags: pcf, powerapps, microsoft, dynamics365
Published: 2021-05-18 06:43:09

In the first part of this series I gave an introduction to setup, test and deployment of PCF components. And the plan was that the next part should be about the actual coding of a PCF component.

But after talking with some of my coworkers I realised that we all came across a lot of the same problems/errors, and as a newbie it can be hard to know where to start when looking for a solution. Therefore I decided that this second part should be about common problems/errors that you can come accross when developing a PCF component. I will update this post as I encounter more problems/errors (as I’m sure I will).

## Property does not exist on type IInputs
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oqzl2scyn7e95m6q37qp.jpg)
**Problem:** When you add a new property to your manifest file the TypeScript-type will not be generatet until you run `npm run build`. So if you try using the property in your code before that you will get the error “Property ‘propertyname’ does not exist on IInputs.

**Solution:** run `npm run build`

## Error: Building temporary solution wrapper: failed.
**Problem:** You try to run pac pcf push to test your solution, and you get the Error: Building temporary solution failed.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s56veepppycsbpfk08wp.jpg)
**Possible solution 1:**
The first thing I do is to do a npm run build. And in most cases there is some small compilation error in my code, like ” expecting a ; ..” , and after fixing these errors I can run pac pcf push again with no errors.

**Possible solution 2:**
If the npm build does not return any errors I take a look in the obj\build.log file.

One error that showed up was problems with loading nuget packages.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r5q9t7b5vurmjpvdscb8.jpg)
Since this error showed up right after I had cloned and setup a .NET project in Visual Studio I figured it must be that msbuild (which is used by pac pcf push) tries to use all the packages that are referenced in “Package source”.

And sure enough when I went into VS2019 and unselected the private packages I was again able to run pac pcf push without errors. To find these settings go in Visual Studio –> Tools –> Nuget Package manager –> Package Manager settings. And select “Package sources” as shown in the image below.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ntryh9s43i5pkgenp4d6.jpg)
Unselect the packages that require additional login.
***
I hope you found this article useful. If you have any feedback or questions please let me know in the comments below. 🙂

Thank you for reading, and happy coding!

/Eli
Laravel Collection difference between contains() & containsStrict() Methods
Tags: laravel, php, beginners, webdev
Published: 2021-05-18 06:36:48

In this post, we will see about  difference between contains() & containsStrict() Methods

## contains() Method `#`

if we Look contains() method Syntax:

```php
/**
     * Determine if an item exists in the enumerable.
     *
     * @param  mixed  $key
     * @param  mixed  $operator
     * @param  mixed  $value
     * @return bool
     */
    public function contains($key, $operator = null, $value = null);
```
contains() if an element exists in the collection matching a given truth other wise it return false .let see example 


```php
$collection = collect([
        'apple',
        'samsung',
        'xiaomi',
        'oppo'
    ]);
$collection->contains('apple'); //true

$collection->contains('htc'); //false

```
we can see apple is exists then it will return true and htc not exists then it will return false 

## Problem with contains() method `#`
[Read more...](https://larainfo.com/blogs/laravel-collections-difference-between-contains-containsstrict-methods)

### Read also `#`

[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)
Python virtual environments
Tags: python
Published: 2021-05-18 06:31:30

In today's article, we'll be looking at Python virtual environments.
What they are, why we need them and how to create them.

In basic, a virtual environment is an isolated environment for Python projects.
Basically a container for your specific project.
For those familiar with node modules, I find it quite similar to that.

You can have modules globally installed, and every project can access those, or you can have them project-based installed so only that project can find them.

## Why do we need virtual environments

It's because of Python's way of downloading packages that we want to differentiate between projects.
In general, I find it a good choice to have project-based environments anyway since it will narrow down your error possibility.

Python can have a hard time differentiating between versions of a package to narrow it down, so let's say we want `packageA` but `projectA` needs `v1.0.0` and `projectB` needs v2.0.0`.
As it would be installed globally, there is no way to differentiate between those two.
If we installed them in our virtual environment, each project would use its own specified version.

## Python virtual environments

For my article, I'll be using `venv`. However, multiple options can create virtual environments for you.

Open up your project in a terminal and run the following command.

```bash
python -m venv .venv
```

The last argument, `.venv`, is the virtual environment's location and can be anything you want.
In this case, a folder called `.venv` is created.

![Python virtual environment files](https://cdn.hashnode.com/res/hashnode/image/upload/v1620971938506/Wk4JjRkge.png)

We can activate this virtual environment by running the following command.

```bash
source .venv/bin/active
```

You will see it's active if the terminal places the environment name in front of your arrow like this.

![Python activate virtual environment](https://cdn.hashnode.com/res/hashnode/image/upload/v1620972082907/cvp3Kn-ak.png)

Now, if we run `pip install`, it will install specific packages inside our virtual environment.

### 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)
And so it starts
Tags: blog, productivity, career, journaling
Published: 2021-05-18 06:28:51

First of all, happy Monday! Surprisingly it was a very productive one for me. 😀

Mondays are the start of a week, and in that spirit, it's the day I'll start out sharing what I learn every day as a software engineer.

As an early-in-career SWE, I've noticed that most of my time is spent learning, looking at code patterns, trying to figure out how in the world Visual Studio works with so many teams collaborating -in a sense- on the same code. So I thought that sharing my learnings may be interesting. 

### I have a really bad memory
I write these entries for my future self, so that when I'm trying to remember how I fixed a particular thing or used a certain framework, I can come back and dust off that knowledge sitting in the back of my mind.

### Explaining concepts makes things clearer
I have found that I fully understand a concept when I am able to explain it to somebody else; and if I can't, it is a good way to finding blind spots.

### I'd like to see more representation of women in tech
I do not consider myself an expert, but I think anyone can share what they like out there. In the case of the world of tech, it is still a very male-dominated area of expertise (although I do sense a shift in the last couple of years, yay!).

### It might be helpful for somebody else
It is not secret that a SWE's work is not to come up with the best solutions on your own; as the expression says, is not about *reinventing the wheel*. Instead, is about building your knowledge on the work and ideas of others, learning from their mistakes and experiences.

So with that in mind, I hope you (at least, you Melissa of the future) find this series handy.

🌻
URL Shortener Using Python - Beginner Python Project (10)
Tags: programming, python, beginners, productivity
Published: 2021-05-18 05:51:39

Ever wanted to share a link but you can not remember it because it was too lengthy? We are about to change that.
We are going to create a URL Shortener using python and the pyshorteners library.

#### Let's Get Coding  
Before we begin you can watch the video down below:

[![](https://yt-embed.herokuapp.com/embed?v=Cn_SwdOYATY&t)](https://www.youtube.com/watch?v=Cn_SwdOYATY&t=6s "How to Create URL/Link Shortener Using python")  

In this part 10 of the [Python Projects for Beginners](https://dev.to/larymak/series/12034) we will be creating a URL/Link Shortener for that purpose.  


For more python beginner projects check out my [GitHub](https://github.com/larymak/Python-project-Scripts), Feel free to <mark>CONTRIBUTE</mark> to the Repo and give it a Star⭐

Also check out my other Python Beginner Projects: 
- [Youtube Video Downloader](https://dev.to/larymak/beginner-python-project-4-youtube-video-downloader-4gpj)
- [WhatsApp SpamBot](https://dev.to/larymak/beginner-python-projects-part-1-5h1d)  


Connect With me at [Twitter](https://twitter.com/larymak1) | [Insta](https://www.instagram.com/nextgencoders/) | [YouTube](https://www.youtube.com/channel/UCrT1ARRZfLOuf6nc_97eXEg) | [LinkedIn](https://www.linkedin.com/in/hillary-nyakundi-3a64b11ab/) | [GitHub](https://github.com/larymak)

Enjoy Coding ❤
Laravel 8 Soft Delete Example Tutorial

Tags: laravel, php, programming, tutorial
Published: 2021-05-18 05:38:31

<p>Hi Dev,</p>

<p>In this Article , i will exmaple how to use soft delete in LARAVEL 8,we are tell simple example of LARAVEL 8 soft delete.it will LARAVEL 8 soft delete migration.</p>

<p>we abstract row from database when expunge record from site. But LARAVEL 8 introduce SoftDeletes in models that way we can't abstract from database but if abstract record from front side then it doesn't show record on front. So we can retrieve record from database if we abstract erroneous row.</p>

<p>How work soft delete, laravel integrate deleted_at column on the table that be default will be null and when we abstract then it will place current timestamp, Laravel Model always fetch that record have only deleted_at = null.</p>
<p>In this tutorial i am utilizing Utilizer model to our laravel soft expunge example. To enable soft effaces for a model, utilize the Illuminate\Database\Eloquent\SoftDeletes trait on the model:</p>

more..

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

https://codingtracker.blogspot.com/2021/05/laravel-8-soft-delete-example-tutorial.html
px 2 rem sass
Tags: html
Published: 2021-06-06 15:29:51

---
title: px 2 rem sass
published: true
date: 2021-05-18 05:05:00 UTC
tags: HTML
canonical_url: https://drmsite.blogspot.com/2021/05/px-2-rem-sass.html
---

I was working with a designer recently and so had to convert <abbr title="Pixel">px</abbr> measurements to <abbr title="root em">REM</abbr>. Given that I set the base font size to 16px, I figured the fastest way to develop some utility classes was using <abbr title="Syntactically Awesome Style Sheets">SASS</abbr>. This script seems to generate enough utility classes and, should I need anything more for a `class` or `id`, I can use `#{(1 / 16) * x}rem;`, where `x` is the number of pixels from the designer.

```scss
@for $i from 1 through 32 {
    .f-s-#{$i}px {
        font-weight: #{(1 / 16) \* $i}rem;
    }
    .l-h-#{$i}px {
        line-height: #{(1 / 16) \* $i}rem;
    }
}

```
About Ethics
Tags: ethics, development, community
Published: 2021-05-18 04:57:43

Without any doubts, I am very under level on this topic. Honesty goes first.


That said... how many times do we stop writting code to reflex on how much impact it will have on the comunity we live into? Let me guess: not many. 


The World has moved faster than ever in 2020, and it still does in '21. That global ticket called COVID-19 put all of us hands on work for adapting, even for thoose who were the most anti virtual activists. And those tasks revealed a lot of who we are, how IT people think, work, imagine or even, move.


We are one of the first industries that adopt remote work as usual, many years ago. And we created our tools, our methods, our culture. And we were pointed as the freaks. But now, almost every single industry is working completly or in part as we are used to.


It is then in this cahotic context when we can really have a meassure about how much impact we made into people's life. And it is a bit scary to remember ourselves writting code without cocerns on if it could harm someone, or if we were dealing with some personal data. Or even beyond: how many times did we notice something smelt rare on the definitions we were given?


Tons of times we had to deal with customer's or bosse's intentions we can disagree, but we still have to code. Did we do the enoug to protect everybody's integrity? Or have we protect our own integrity, keeping us as good citizens?


There are two accepted and adopted ethics codes around:
ACM: https://www.acm.org/code-of-ethics
IEEE: https://www.ieee.org/about/corporate/governance/p7-8.html


But still, it looks a really underated topic in our community. I have never had the chance to discuss it in a work environment, for example.


In other to improve our proffesion, my intention and commitment is to put this topic on the table every single time I can. This is my promisse to Touring and Ritchie. 


Furthermore, I want to motivate you to be conscious on the impact you are causing with your code... and to raise an alert every time you see something strange behind the scenes.


Thans for the reading, and ethic hacking!
LeetCode 977. Squares of a Sorted Array (javascript solution)

Tags: algorithms, javascript
Published: 2021-05-18 04:54:50

###Description:
Given an integer array nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.

###Solution:
Time Complexity : O(n)
Space Complexity: O(n)

```javascript
// Two pointer
var sortedSquares = function(A) {
    let result = [];
    // Left and right pointer
    let l = 0;
    let r = A.length - 1;
    // Position to add squared number to A
    let p = r;
    
    // Add the higher number to the array and then decrease the pointer
    while (l <= r) {
        if (A[l] ** 2 > A[r] ** 2) {
            result[p--] = A[l++] ** 2;
        } else {
            result[p--] = A[r--] ** 2;
        }
    }
    
    return result;
};
```
Trapping Rain Water
Tags: cpp, computerscience, codenewbie, programming
Published: 2021-05-18 04:53:12

This is my first blog and from now I will regularly post on some easiest solution of famous problems.

**Trapping rainwater** is a very famous problem asked by many companies like amazon, facebook, oracle etc. I’m here to tell you the easiest method of doing this problem. My approach of solving this problem is not the best but it's the easiest and once you understand the problem you can try to find the best solution by your own.
**Problem statement:** you are given an array of non-negative numbers which represents the size of the block/buildings. In this case the given array is {1,0,2,1,0,1,3,2,1,2,1} 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zofmckrq139ahcqo86ar.png)

In the above image the black color represents the block/building, while grey color represents the space where water can get stored so our aim is to find out the amount of water which can get trapped in it i.e. calculating the total number of grey blocks. In this case it is total grey blocks are 6. 

**Solution:** Water can get trapped only if the block have a higher block on right side as well as left side. Suppose we take first element i.e. 1 it has a higher block on right side but it doesn’t have a higher block on left side, so no water got trapped. Now look at the second element it have higher blocks on both the side so it can contain water.so our first task is to find out the highest block available on right hand side 
 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36621a82vh9gz32wsb7b.jpg)

Similarly we will find out the highest block available on left hand side 
 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/at60e0ahd0c42d7ad45z.jpg)
 
Now our left and right array are going to look like this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eyvjh8xocnh7qqshbldq.jpg)

Now we are going to choose the minimum from both the left and right array. Why we are choosing a smaller element? Take an example we have three blocks {1,0,3} now the block at second position can contain only 1 unit of water because 1 block can’t stop 3 units of water. 
Now we are gone subtract the height of the block from the minimum of left and right array. It might give you a negative number but you have to consider it as 0 because the amount of water can't be negative.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2462nkelpgirkmw42cnb.jpg)
 
Now you can just print the value of ans1.

## The complete code is going to look like this:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9rcxzq2hjsakgz2kke3w.jpg)
 
Thanks for reading.
Why sorting Algorithm is so important ?
Published: 2021-05-18 04:35:07

Sorting is important because it make access of data more easier for doing operations on sorted array or any other data Structure.

All of us read books right, so could you imagine what will happen if the page numbers on the book are randomly arranged. For e.g. after page no. 5 next will be 267 and then 138. Won't it make it very difficult for reader to read the book because after reading one page he will be keep finding the other.

So similarly the after sorting, the data arranges in a well manner to do any kind of operations on that for e.g. we will be knowing minimun element and maximum element, we will be able to search for a particular element.
How to extend interfaces in TypeScript
Tags: typescript, extends, interfaces, types
Published: 2021-05-18 04:30:10

The other day I had the following problem: the property `sources` in my interface `ITemplateField` was a list of key-value objects.
```typescript
export interface ITemplateField { 
  sources?: KeyValue<string, string>[];
}
```
`KeyValue` was a generic type imported from `@angular/common`, but I needed a new property called `description`in the `sources`list items. 
```typescript
interface KeyValue<K, V> {
  key: K;
  value: V;
}
```
I couldn't (and I shouldn't) create a new parameter in the `KeyValue` generic type. First, it is a library import, which I couldn't change unless I changed the implementation in the library, and second, it is a key-value generic interface, and we should never pollute generic scopes. 

## Enter interface extensions
I decide creating a new interface named `Source`, which extends `KeyValue<string, string>`
```typescript 
interface Source extends KeyValue<string, string> {
  description: string;
}
```
Once I did that, all I needed to do was to use it as the new type for `sources`.
```typescript
export interface ITemplateField { 
  sources?: Source[];
}
```
Works like a charm.
Cross platform app to aggregate and rename files in bulk with simple drag n' drop
Tags: node, github
Published: 2021-05-18 04:27:10

![Mr dcluttere](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dip089io33fpv2hkodc1.png)
A minimal and beautiful X-platform desktop app to organize,aggregate and rename files in bulk automatically.

GitHub repo: https://github.com/deep5050/Mr.Dclutterer 
app store: https://www.electronjs.org/apps/mrdclutterer

Features:
    Drag and drop
    Rename files on-the-fly
    Aggregate files by extensions and types (more coming soon..)
    Process files under sub-directories too
    Quick access to settings from the right click context-menu 
    Minimal and beautiful 
    Auto updates itself
    Available both for Linux & windows
Day 65 of 100 Days of Swift
Tags: swift, 100daysofcode
Published: 2021-05-18 04:18:41

I just completed day 65 of 100 days of swift. Today, I started working on the InstaFilter app. Insta filter is a simple app that can be used to apply a sepia filter to any chosen image. 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9k3us6smiokj9mldu1s0.png)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v6gluvp1f4ftbzuld55b.png)

Here's a link to the github [repo](https://github.com/sanmiAde/InstaFilter)
Simple menu with HTML and CSS
Tags: css, codenewbie, beginners, todayilearned
Published: 2021-05-18 03:04:12

The easiest and fast way to create a menu with an unordered list as your HTML structure and then style it using CSS.

This is our final result of the simple menu with HTML and CSS.

{% codepen https://codepen.io/atulcodex/pen/jOBMaVK %}

{% link https://dev.to/atulcodex/postman-alternative-1lf8 %}