teleren/devto huggingface dataset:
Revisiting the L in SOLID
Tags: computerscience, cleancode, solid, java
Published: 2021-01-24 12:37:36

Photo by Pavel Nekoranec on Unsplash
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/8gx6wc8b3wbjjboywcoh.jpg)
This is a continuation of the SOLID. In the last post, I covered the O and now we will be continuing with the L. So if you didn't check the last post, feel free to click on the link: https://dev.to/sightlessdog/revisiting-the-o-in-solid-4i84

#Liskov substitution principle

> Let z be a property provable about objects x of type T. Then z  should be true for objects y of type S where S is a subtype of T.

In a nutshell: A has a property A, if B is a subtype of A then B has also the property A and B should behave the way A is expected to behave. And that means any derived class (B) should be able to substitute its parent class (A) without the consumer knowing it.

##Example: 

Let's suppose we have a car Class and two other classes Ferrari and Bugatti. Both of the cars are just..cars...sooo..they should behave like a normal car would do, right?

```java
public class Car {
    public int speed;

    public Car(int speed) {
        this.speed = speed; 
    }
}

public class Bugatti extends Car {
    public Bugatti (int speed) {
        super(speed);
    }
}

public class Ferrari extends Car {
    public Ferrari (int speed) {
        super(speed);
    }
}
```
And now let's suppose we want to customize a car by increasing its speed, usually, we would write a method inside the Car like this: 
```java
   public void increaseSpeed(Car car) {
        String message = "You increased the speed of " + car.getClass().getSimpleName()  + " from " + car.speed;

        System.out.println(message);
    }
```
Please notice that increaseSpeed takes any car as a parameter.
We didn't have to implement this method in each class (Ferrari and Bugatti) because they should behave the superclass (car) would. No Complications. And that's the Liskov Substitute Pattern. We replaced the car argument with one of the subtypes each time, and nothing has changed.
Now let's check our results:  
```
You increased the speed of Bugatti from 200
You increased the speed of Ferrari from 210
```

#Conclusion: 
The Liskov Substitution Principle extends the open/closed principle by preventing breaking client code. 

##Sources :
Meyer, B. (1997): Object-Oriented Software Construction, 2nd edition
http://www.cvc.uab.es/shared/teach/a21291/temes/object_oriented_design/materials_adicionals/principles_and_patterns.pdf
Robert C. Martin “Principles of OOD”
https://en.wikipedia.org/wiki/Liskov_substitution_principle
https://www.youtube.com/watch?v=rtmFCcjEgEw
https://www.baeldung.com/solid-principles
My take away from making a photography portfolio site
Tags: webdev, devjournal, projectcomplete, codenewbie
Published: 2021-01-24 12:16:01

# Photography website status: Deployed :rocket:

First and foremost, I want to talk about coding as a whole. As much as building this site has been fun it has been extremely taxing. Its reached the point where I have reconsidered programming as a career and I'm not over-exaggerating. I don't know exactly what a software developer title entails but I'm going to assume that spending hours on end in front of a screen will be a part of the job. Something I no longer look forward to. Maybe I feel this way because I ran into a lot of obstacles along the way and my computer is slow and so I get easily frustrated or maybe I didn't take enough breaks between coding sessions which lead to a couple headaches. Bottom line is: the experience was not as enjoyable as I anticipated.

However, if you had to ask me whether I would do it all over again, I would say yes. I've learned so much from this one project and not only that but I have created something that someone can actually put to use. I am on day 17 of 100daysofCodes and I can already mark off one of my objectives as complete. I feel as though I am more of a :v: complete :v: programmer because I learned more about the programming languages that I used in building the projects. 

## The Tech Stack

### React 
I used React to make this site. Now, looking at it, I would say that it was not entirely necessary to use it in this project. There are features that I intend on implementing in future that will make use of Reacts capabilities so I thought it best to leave it as is instead of reverting back to HTML CSS and vanilla JS.

### CSS

Having gone through numerous tutorials in the past I tackled this project with the mindset that most of the styling will be a breeze and boy was I in for a rude awakening. I think I had to watch a video about CSS grid 3 times over for it to completely sink in and until now I still haven't completely grasped it but hey, the site looks decent.

Thanks to this project I now have a better understanding of

:white_check_mark: CSS grid
:white_check_mark: animation
:white_check_mark: font-faces
:white_check_mark: importing CSS in React

## Conclusion

This project was a pain to complete but it was definitely worth it. To all beginners who are sitting on the fence about whether they should try create a photography site or not, I encourage you to do have a go at it, not only to further their skills but to actually help out a photographer whose work could do with more exposure.

As always, thanks for the read, stay safe, and Happy Coding :computer:

P.S. I almost forgot. [Here](https://jades-portfolio.firebaseapp.com/) is the website if you want to check it out.
VSMac Tools | Code Snippets
Tags: vsmac, snippets, vstools, xamarinforms
Published: 2021-01-24 11:49:54

Creating your own code snippets in Visual Studio for Mac to boost your day-to-day productivity has never been easier.

 
## Snippets Tool
> The tool is better explained in detail [here](https://docs.microsoft.com/en-us/visualstudio/mac/snippets?view=vsmac-2019) with fancy words that I can't use 🙂.

Here, I am just going to create a code snippet for `Observable Property` that we love to use, especially in Xamarin.Forms `ViewModels`.

---
- First, we have to open **Snippets Tool** window on **VSmac**. You can find it under **`Preferences > Text Editor > Snippets`**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/lrzmuw027ohgwu523rsk.png)
  
---
- From languages available, select `C#` since we are making a code snippet for C#. Then, click **Add** button on the right. This will pull up a whole new window where you can create your own cool snippets. Fill in all the fields like I have here.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/80c4vxldp274s7arozgs.png)


---
### Let's talk about the `keywords` in the snippet.
- Be sure to check ✅ the `Is expandable template` so that you can insert the snippet by typing the shortcut and `TAB` twice. 
- Snippet has **template text** like `$type$` and `$name$` which will be replaced by the real name and type later. 
- `$end$` template text is where the cursor position will be after the template is created.

### Lets see it in action!
{% youtube YC8KxnQ0jQs %}

### Gist
{% gist https://gist.github.com/wahid-d/b351c956bfc0c704284146cc53783d5f %}
Weekly Update #3 - 24th Jan 2021
Tags: devjournal, rust, opensource, git
Published: 2021-01-24 11:04:26

This is my third weekly update of 2021. I'm giving weekly updates to hold myself accountable for coding this year. My goals are outlined in the blog post linked below. Let's get right into it!

{% link https://dev.to/hb/my-2021-learning-plan-76f %}

## Weekly Update

This week, I dived deeper into Rust. I finished the <a href="https://www.youtube.com/channel/UC_iD0xppBwwsrM9DegC5cQQ">"Crust of Rust"</a> series by Jon Gjengset. This series taught me a lot about intermediate Rust concepts and writing Rust code "for real". I also dove into web programming with Rust. It was very interesting seeing the differences between API development with Rust, Node.js, Deno, and Flask. I thoroughly enjoy using Rocket and Diesel for web development. I plan to create a bigger project with this stack soon. I also started developing my own library/crate which will be a client for the Finnhub API which I enjoy using. One of my main focuses this week was open-source contributions. This week, I made several contributions to the open-source world. I found that doing open source is super rewarding and fun! I'll definitely be doing some more open-source. 

Last week I said that I was going to be rebuilding my portfolio and to be honest, I really do need to do that, but Rust is way too much fun! Hopefully, I'll get around to doing that in the upcoming week. Overall, I think it was a successful week. For next week, I would like to at least start my own portfolio, get more progress in my Finnhub API client, work on my web development project with Rust, and maybe dip my toes into systems programming with Rust. Good things are ahead!

Thanks for reading!

**Henry**

<a href="https://buttondown.email/hb">📰 Newsletter</a>
<a href="https://github.com/henryboisdequin">🐱 GitHub</a>
<a href="https://twitter.com/henryboisdequin">🐦 Twitter</a>
Just do it
Tags: motivation, alphastory, webdev
Published: 2021-01-24 10:52:25

# Just do it

No, this is not sponsored by Nike. It is a message that most of us need. Frankly, I am someone who needs it most. Why? In this article, I am going to talk about why instead of thinking a whole lot about it, sometimes, you just have to do it.

![Credits: https://unsplash.com/photos/D7bmnvGJA2Q ](https://s3.us-east-2.amazonaws.com/alphadevelopment/blogs/1611456325712/image-0.jpg)

I like being organized; I don’t like multitasking, instead I want to focus my resources and time on a single thing, especially if it’s something I really like. I have been in love with web development for a very long time now, but it wasn’t only until recently that I have started doing things as a web developer. It was because I wanted to find the right time to focus on web development and web development only. The result? I stalled for a good 5 years. I was so anxious to start doing things when I had free time, because I was scared I won’t be able to focus, while there are other things happening around. I thought that if I’m not able to give it my all on this, I wouldn’t be very good at it; and yes, I hate not being great at something I like. So I waited, and waited, for the perfect opportunity.

After some time, I did find the time to focus on web development, because of the lockdowns, but the funny thing is, I am not the great developer I thought I’d turned out to be. Even though, I had all the time to learn, I wasn’t able to utilize all those hours, because there were burnouts and other circumstances. I was so late to find out that I couldn’t spend all my time on a single thing. Looking back, if I had only spent a single hour every day, for the past five years, I may have become a far greater developer than the one I am today.

You see, in life, there are things we are afraid to conquer/face, because we are doubting our skills, capacity or simply the circumstances that we are in. But, if you think you have the means to do it, even just a **fraction** of it, you have just got to **DO IT**. As the mainstream saying goes, *small steps done consistently will lead you to great distances*. Don’t belittle yourself if you are making small progress, what matters is **you are still making progress**. Out of 7 billion people in this world, surely, there are a lot who wants to do the same thing as you. How do you separate yourself from them? You are the one who actually **does** the thing.

Life isn’t going backwards. It just keeps on going and going, and the time has passed is either time wasted or time well spent. And remember, in anything you want to do, **JUST DO IT.**
Day21:100DaysOfCode
Tags: 100daysofcode, productivity
Published: 2021-01-24 10:40:01

few leetcode ques on string and trees

daily scrum at intern implemented exoplayer in a page along with integrating api through retrofit in Kotlin

continued with spring boot
some assignments ......EOD

You can Follow me->
https://github.com/singhtaran1005
https://www.linkedin.com/in/taranpreet-singh-chabbra-27517918a/
Docker Container IP Dynamically Update in an Inventory Using Ansible
Tags: ansible, docker, linux
Published: 2021-01-24 10:04:35

Hello everyone,

This blog is a demonstration of the configuration of the **Docker** container in such a way that the container IP is dynamically updated in an Inventory of a Controller Node.

So Let's get started...

## Prerequisites:-

> What is Ansible and Docker?
- Head over to this link 👉
https://dev.to/niteshthapliyal/apache-webserver-configuration-in-docker-using-ansible-1dde

Now we know what Ansible and Docker are so, let's get started with the demonstration...

> First create an Inventory file

Create an Inventory file with an extension `.txt`, here I have created an Inventory file named `ip.txt`. We don't need to add the IP address of the Target node in that as it will be dynamically updated.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/fkwoj320vjla0rkh8ewq.png)
 
> Create Ansible Configuration file

To create an ansible file, create a file with extension `.cfg`, here I have a configuration file with named `ansible.cfg`

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/4w9rl3kc7digapqk3anq.png)

> Now create an Ansible Playbook 

Create an Ansible playbook with an extension `.yml`, here I have created a playbook named  `docker.yml`


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

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

This playbook will configure Docker, install docker, pull Docker image, and then fetch the Ip of the container and updated it in an inventory of the controller node. 

> Now run the Playbook

To run the playbook use command `ansible-playbook <name-of-playbook>`

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

Playbook ran successfully!!!✨

> Now check that is IP updated in an Inventory of a Controller Node

Earlier we have seen that **Ip.txt**[ Inventory file] was empty👇

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

After running the playbook👇

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

Now we can see that IP is updated!!✨

So that's how we can configure the docker container in such a way that the IP of the container is updated dynamically to an Inventory of Controller Node.

Thank you!!⭐
Switching To linux
Tags: linux, webdev, opensource, showdev
Published: 2021-01-24 09:44:09

#My problem with Windows

Being a windows user since WindowsXP and using every version of Microsoft's operating system up to the latest build of windows10 I stumbled upon all the usual problems everyone has.

Blue screens of death and updates keep crashing and many other problems, But the biggest problem I have faced in windows is after a fresh install and installing all my necessary programs, and after a  while, my system gets sluggish, starts to lag on me. And believe me, I have a pretty decent system still, It gets slow after a month or so.

I did every single optimization I could but the result would be the same, And then I stumbled upon Linux.

#Enter: Linux

I started looking for alternatives but did not know what were the options available to me but a simple google search I was already downloading the iso file of Ubuntu20.04, but switching to a new operating system was a heck of a task itself but currently, I am dual booting my machine with KDE neon and windows10 slowly switching towards Linux full time.

#Best Linux Distro for Beignner:
These are the best distributions of Linux that every new user should try. 
Linux Mint
KDE neon/Kubuntu
Zorin OS
Project0 #3 - Recording Explainer Video using OBS
Tags: webdev, cs50, html, css
Published: 2021-01-24 09:20:46

Project0 completed! I am happy with the learning process despite spenting more time than expected on basic html and css.

I tried my best to make the 3 Google Search pages as similar to the actual pages as possible as shown in the video below. Most of them are not the requirements of this assignment - the aim is to get the most learning out of it. 

Even the process of creating a demo video is not a hassle cause I am able to practice communicating features of a 'product'. Shall end this post with the demo video =)

{% youtube ZEFz0U4lgJM %}
GIT V/S GITHUB
Tags: learner, git, github, development
Published: 2021-01-24 07:13:02

1.WHAT IS GIT?
  
Git is a decentralised version control system which helps in tracking change in computer files. It is used for coordinating work among several people on a project and tracking the progress.

-- It simplifies the process of software development with an easy source 
   code.



2. WHAT IS GITHUB?

Github is the service hosted on the web where all the projects are stored with there own repository and unique URL.

-- It provides a graphical interface to store the file.


DIFFERENCE:-
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/7bn32qyml7g3rxukill3.png)
GIT
> Installed locally on the system.
> Can be used offline and don't need an internet connection for use.
> GIT can be used without Github.
> Used as version control and code sharing.
> No GUI.
> Code changes like commit, merge etc. are done using commands 
  from the command line.
> Open source licensed.



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

GITHUB
> Hosted on the cloud.
> Cannot be used offline, needs an internet connection.
> GIT cannot be used without Github.
> Used for centralised source code hosting.
> Provides easy to use GUI.
> Everything is done through a web-based interface.
> Includes free and pay for use tiers.
Hugo Theme: mixedpaper, fluency, weui
Tags: hugo, theme, blog
Published: 2021-01-24 09:04:00

I wrote some clean hugo theme for my blog in the past. If you are interested at them, you can try them in your own site or create a PR at github.

### Mixedpaper

Github: <https://github.com/wayjam/hugo-theme-mixedpaper>
Demo: <https://themes.gohugo.io/hugo-theme-mixedpaper/>

![mixedpaper](https://dev-to-uploads.s3.amazonaws.com/i/2bjv0xi76iyt3lmj385n.png)

### Fluency

Github: <https://github.com/wayjam/hugo-theme-fluency>
Demo: <https://hugo-fluency-demo.netlify.app/>

![fluency](https://dev-to-uploads.s3.amazonaws.com/i/643u2ipyqb2j3lj65ip9.png)

### WeUI

Github: <https://github.com/wayjam/hugo-theme-weui>
Demo: <https://hugo-weui-demo.netlify.app/>
Learn about hashMap.values() method
Tags: java
Published: 2021-01-24 08:26:24

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

hashMap.values() returns a Collection view of the values contained in this map #java. Check out STJ: Java fantasy card game at https://summonthejson.com/products/summon-the-json-java-deck
Markdown Cheat Sheet part-3
Tags: showdev, github, markdown, beginners
Published: 2021-01-24 08:17:06

# Images 
There are 2 ways to add an image to the Markdown.
1. Inline style 
2. Referenced style 
```
Inline Style:
![First image](http://picsum.photos/200/200)
Referenced Style:
![First image][I'm referenced]
- [I'm referenced]: http://picsum.photos/200/200
```
> Make sure you don't add any symbol in the referenced style I just used it to make it visible.

Inline Style:
![First image](http://picsum.photos/200/200)
Referenced Style:
![First image][I'm referenced]
[I'm referenced]: http://picsum.photos/200/200

## How to add logo to the image?
As you can see in the above images if you hover nothing is appearing but if we add a logo to the image it can just give an instance what the images is about or the info of the image.
### Let's see how to add logo to the image
```
Inline Style: 
![First image](http://picsum.photos/200/200 "Hey I'm the logo")

Referenced Style:
![First image][I'm referred]
- [I'm referred]: http://picsum.photos/200/200 "Hey I'm the logo"

```
> Make sure you don't add any symbol in the referenced style I just used it to make it visible.

- We just added a logo after the link in double quotes

### Hover to see the logo 

Inline Style: 
![First image](http://picsum.photos/200/200 "hey I'm the logo")

Referenced Style:
![First image][I'm referred]
[I'm referred]: http://picsum.photos/200/200 "hey I'm the logo"

# How to add Inline text?
``` Inline codes or text have `back ticks` around it. ```
    or when intended by 4 spaces.

 
* But if you want to add multiple lines to the inline block use 3 ticks ' ``` ' around it or when intended by 4 spaces. 


* But the fenced blocks(having `backticks` around it) are always preferred and recommended because only the fenced blocks can support code syntax highlighting.

# What is Code and syntax highlighting?

Stay tuned for part-4...
[How to write Markdown part-1](https://dev.to/garimasharma/how-to-write-markdown-part-1-4mne)
[How to write Markdown part-2](https://dev.to/garimasharma/how-to-add-links-in-markdown-1bnf)
Intro.js In Responsive Registration Form
Tags: css, webdev, javascript, uiweekly
Published: 2021-01-24 07:53:46

Intro.js is a light-weighted javascript library for show messages in tooltip format with a simple user interface. Here we used Intro.js CDN to show the message step-by-step for a customer. To make this Registration Form we used HTML and CSS & Intro.js library.

In this form, we used input fields and one button for registrations. To make responsive this form we used CSS media quires. This is fully responsive for mobile-view and table est view login forms.



Make it yours now by using it, downloading it, and please share it. we will design more elements for you.

[Source Code](https://w3hubs.com/intro-js-in-responsive-registration-form/)
How to extract phone numbers from the web
Published: 2021-01-24 07:41:06

Lead Extractor
Communicating with people by phone, Skype, or SMS message is often more effective than sending bulk email letters. Our lead scraper (contacts extractor) will find and collect phone numbers from websites for you within a couple of minutes, and you can spend the time you save on yourself.

Atomic’s leads extractor software
 will gather email addresses, phone numbers, as well as Skype, MSN, AOL, Yahoo, and ICQ IDs, from the web. Mobile extractor collects contacts in 39 search engines. Phone number web extractor understands edited and created scripts, and searches for contacts on all available sites.

You will also have the opportunity to search for unnecessary sites or search engines. To do this, the phone number web extractor https://www.atompark.com/phone-number-extractor/ has the ability to create a blacklist and add domains or sites there that you do not need contacts from. Atomic Lead Extractor quickly searches and retrieves information by analyzing multiple resources simultaneously. You can set the number of threads by setting limits when loading links.