teleren/devto huggingface dataset:
Diffbot Vs. Proxies API
Published: 2021-04-08 06:28:32

The world of web scraping is varied and complex, and Proxies API sits at one of the most crucial junctions. They are allowing web scrapers/crawlers to bypass IP blocks by using a single API endpoint to access our 20 mi
One of the questions we get frequently is how we are different from services like OctoParse or Diffbot. Many times it is like comparing Apples and Oranges. Still, when we send this comparison table to our customer's developer team, their CXO, their marketing, or SEO team, they typically get it quite quickly if we are a convenient service or not.

So here is how we are different from Diffbot

Diffbot uses AI to scrape data from an annoying website where you can set up and crawl multiple websites without having to create a new crawler for each.

They also offer a ready database of the web that you can query instantly, so you don't have to wait for crawling to finish.

They also offer a commercial-grade crawler service for only crawling 1000s of websites.

Diffbot is suitable for enterprise-level customers who want to create large scale web crawlers and scrapers.llion-plus high-speed proxies on rotation.
Diffing in React
Tags: react, javascript, writing, firstpost
Published: 2021-04-08 06:22:11


As a react-developer, you must come across the topic **DIFFING**. 
I read few articles and understood the basics of them. And out of nowhere, I thought of sharing my knowledge in a simpler way or maybe in a non-technical way. 😜😜

Think for a moment, Whatsapp as a *VIRTUAL DOM* 
Let suppose, JSX element have their own *Whatsapp Group*(group name is *Virtual DOM Object*)
Now, there is a member of this group, who wants to update itself and not the rest.

Now the admin of this group: **REACT** thought of making a new group very similar to the existing one(which means, *the new list of objects*).

Obviously, this group will also exist in Whatsapp only (that means, **VIRTUAL DOM**) 

In both the groups, **REACT** is the only admin. 
And **REACT** observe both the groups from the top-level and wanted to see, which member of the existing group has been changed(that means, *which of the VIRTUAL DOM Object has been changed*) 
And it found out the member. 

So, *this process of finding out or the comparison* (in React language) is called **DIFFING**. 

*That's it*. 

Thank you for taking out your time and reading it. I tried for the first time, writing some tech article like this. Let me know, your thoughts on it.
Any appreciation, criticism are welcome. 👍
How to remove all docker containers in a network
Tags: docker, network, bash, script
Published: 2021-04-08 06:19:23

**Update**
Thanks @hasnayeen for making me aware of the following better approach
```
docker <stop|rm> $(docker ps -qf "network=<NAME>")
```

# Steps
**How to list docker containers in a network**

 [Inspecting a docker network](https://docs.docker.com/engine/reference/commandline/network_inspect/)  will list containers along with other information, we can use the `--format` flag to get a newline separated list.

```
docker network inspect <NAME> --format='{{range $id, $_ := .Containers}}{{println $id}}{{end}}

// Example output
197123ceff4c60ad99518e948047d842eab52ab7eac38476dabe22ac5f6cc209
2ec40124c66a394d6f29e1448bff3182902a94e74f923c7cab4f10c3d7f99d1d
aeb2b9d5686efcf186adf13ce6b8471782f332385aa8b2c4314932a1416f8376
```

**Stopping and removing containers in a docker network**
```
docker <stop|rm> $(docker network inspect <NAME> \
    --format='{{range $id, $_ := .Containers}}{{println $id}}{{end}}')
```


After much Googling I couldn't find how to do this anywhere, if there's a better way please let me know.
Automated Society Security System
Tags: python, security, firebase
Published: 2021-04-08 06:15:14

# ASST


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

Django-Firebase app for improving Security Systems in housing societies using Face Recognition and IoT

## How to use the app :

- Get your society registered with the application. Once the society is registered you have the permission to assign one account to every flat in the society as the admin of that house.

- Now the admin has the powers to register his house members. These members will be verified by the secretary before registration.

- Once the registrations are done, every admin will be able to keep a watch on the people who have come to visit him and he has the power to permit them inside or reject them.

- Now the admin will have to also register a watchman who will receive live notifications whom to permit and whom to reject.

Link to the IoT source code and setup : [here](https://github.com/coldkillerr/ASST_IOT/)

Link to the Django Source code : [here](https://github.com/coldkillerr/ASST_Django)

This application is ready to be hosted on [Heroku](https://dashboard.heroku.com/).

## Are you Interested ?
- Fork the Repo
- Make some modifications
- Send the Pull Request :)
49 Days of Ruby: Day 12 - Conditional Statements, Part I
Tags: ruby
Published: 2021-04-08 05:40:41

---
title: 49 Days of Ruby: Day 12 - Conditional Statements, Part I
published: true
description: Join us on a 49 day learning journey through Ruby!
series: 49 Days of Ruby
tags: #ruby
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/9m73qaetuse3nm3y3it8.png
---

**Welcome to day 12 of the 49 Days of Ruby! 🎉**

In the past 11 days, we have learned about a wide variety of topics and gained a solid grounding in Ruby. Congrats!

Today, we are going to begin applying that learning in some real-world coding examples. The first building block that we will look at is *conditional statements*. Over the next two days, we will look at two varieties of them.

Let's start with the first conditional statement: the **if/else**.

## If/Else Condition: What Is It?

The **if/else** pattern is an incredibly common coding choice because it reflects how we often think. Take the following scenario:

*You are at the grocery store. You want to purchase apples. You think to yourself: if they have red apples, buy the red apples, else, purchase the green apples.* 

We have just described an if/else condition! If there are green apples, do X, else, do Y.

## If/Else in Ruby

Now that we have a grasp of what it is. How do we build it in Ruby?

Here's an example:

```ruby
morning_coffee = 'yes'

if morning_coffee == 'yes'
  puts 'Glad you enjoyed!'
else
  puts 'It is time to have your cup of coffee!'
end
``` 

In the above example, we created a new variable called `morning_coffee` and set it to `yes`. We then created an if/else condition checking the value of `morning_coffee`. If `morning_coffee` equals `yes` we output one thing, else, we output something else.

What can you do with if/else conditions? Share your learning! Tomorrow, we'll dive into `elsif`, and how that can add more nuance to your conditional statement.

**Come back tomorrow for the next installment of 49 Days of Ruby! You can join the conversation on Twitter with the hashtag [#49daysofruby](https://twitter.com/hashtag/49daysofruby).**
You Need Measurable Goals
Tags: perl, cpp, performance
Published: 2021-04-08 05:30:06

One thing I try to reinforce with clients, particularly those who have "big" projects, is that they need measurable success criteria. Sometimes that's dangerous because numbers can be gamed—such as the support manager who won an award for reducing support calls, only to find he had hidden the support phone number on our web site—but if you have _measurable_ goals, you can use that to declare success or failure, rather than punting on the problem.

Case in point is my favorite "successful" project: I was with a company that decided to rewrite a massive Perl system in C++ because Perl was too slow.

Already, I know several of you want to know what "too slow" means in this context, but no, you gotta wait for the punchline.

This project was written years ago and was thus "legacy" code. It was clunky, but critical. Honestly, fixing it would have been cheaper and faster than a rewrite, but you probably know that. The dangers of rewrites are well-known.

But it didn't matter. Perl was too slow, so C++ it was.

And unlike many rewrites, this one was finished. It took them years, but they finished. The new code was a bit of a pig, but they finally lifted the millstone of Perl's performance from around their neck.

But there was a small problem. Turns out the C++ system, years in development, a steaming pile of ones and zeros, and possibly just a wee bit unmaintainable ...

... didn't run any faster than the Perl system it replaced.

You know what makes software slow? Network congestion. I/O issues. SOAP instead of JSON. RPC. Oh, and the database. It's always the database. Unless a system is CPU-bound, changing the programming language will often gain you no performance improvements!

The new project was started years ago, so when I asked, no one was sure if the system that was "too slow" had any performance profiling done to find the bottlenecks.

But management crowned it a success anyway, because now that it was done, no one wanted to admit that its only measurable success criteria showed it to be a complete failure.

When I left the company there was talk—I'm not kidding—about rewriting the system in Perl.
Using artifact method to install modules via composer
Published: 2021-04-08 05:29:51

Sometimes we have to check a certain module in a new Magento version which can be incompatible due to modules's composer.json, eg. new php version not made compatible.

When there are version compatibility issues in module composer.json files, we are unable to install via "composer require" commands.

In root composer.json add the following:
1. Create a folder named "zips" and add the proper path 
```
"repositories": {
        ---
        
        "example-mods": {
          "type": "artifact",
          "url": "/<path>/zips"
        }
    },
```
2. Do any changes in the module folder (i.e. something like updating the php version) and create a .zip of the module
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vfdtgmzfl79qq3gl4hf8.png)

3. Add the above .zip folder to <path>/zips location. The name of the zip file should be "module-exampl1" as per the above composer.json
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l7vyodsebbjzi2bdrh7i.png)

4. In your root folder, run the composer command to install the module
``` composer require sample/module-exampl1 ```
Learning Android Dev!
Tags: android, kotlin, udacity, google
Published: 2021-04-08 05:24:20

I have been learning android development through Udacity's Android Development using Kotlin Course.
First I learned Kotlin using the bootcamp course specified by the main course and later I followed Telusko Channel for Kotlin Development .
So far it's a bit of fun and much of pain .
Android Development is a Vast Topic.
Might take time but will reach the Goal.🤟🏽
LeetCode 139. Word Break
(javascript solution)
Tags: javascript, algorithms
Published: 2021-04-08 05:09:09

###Description:
Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.

Note that the same word in the dictionary may be reused multiple times in the segmentation.

###Solution:
Time Complexity : O(wordDict.length*s.length^2)
Space Complexity: O(s.length^2)

```javascript
var wordBreak = function(s, wordDict, memo={}) {
    // If we have s stored in memo return its value
    if(memo[s]!==undefined) return memo[s]
    // We can always make and empty string 
    if(s.length===0) return true   
    
    for(const word of wordDict) {
        // Check if word is at the beginning of s
        if(s.indexOf(word)===0) {
            // Recursive call to check if using word as the prefix is a possible combination to complete s
            const output = wordBreak(s.slice(word.length), wordDict, memo)
            if(output) {
                // If we are able to complete s save in memo as true
                memo[s] = true
                return true
            }
        }
    }
    
    // If we get here then we did not find combinations to complete s using wordDict
    memo[s] = false
    return false
};
```
React App For Beginner's
Tags: javascript, react, beginners, tutorial
Published: 2021-04-08 05:00:38

Hello friends ,
Here is a link  https://lp-codes.github.io/My-First-React-App/#/My-First-React-App/ of Live App I have tried to create using react, it might be useful for beginner's as a concept who are learning react .I have tried to cover react components such as routers ,hooks,useffect & using bootstrap,fontawesome,materialui ,api's with react -- There is basic home page with external media links , weather app, To-do-App with local storage & a Covid Tracker .Attaching some Snaps from link,
If more info is required kindly ping me ...

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/58it3mnqiqzlr45jsxd0.PNG)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/obmip3my3br92wz7vsex.PNG)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zj5kegj11zeolvajjgfg.PNG)![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/98v3dd8c2b714b5hcqyn.PNG)
 Git-repo - https://github.com/LP-Codes/My-First-React-App/tree/gh-pages
Learn how DevOps unifies people, process and technology to bring better products to customers faster
Published: 2021-04-08 04:25:12

DevOps definition:
A compound of development (Dev) and operations (Ops), DevOps is the union of people, process and technology to continually provide value to customers.

What does DevOps mean for teams? DevOps enables formerly siloed roles—development, IT operations, quality engineering and security—to coordinate and collaborate to produce better, more reliable products. By adopting a DevOps culture along with DevOps practices and tools, teams gain the ability to better respond to customer needs, increase confidence in the applications they build and achieve business goals faster.

The benefits of DevOps:

Teams that adopt DevOps culture, practices and tools become high-performing, building better products faster for greater customer satisfaction. This improved collaboration and productivity is also integral to achieving business goals like these.

DevOps and the application lifecycle:

DevOps influences the application lifecycle throughout its plan, develop, deliver and operate phases. Each phase relies on the others and the phases are not role-specific. In a true DevOps culture, each role is involved in each phase to some extent.

DevOps tools:

Teams have many DevOps tools to help them facilitate a DevOps culture in their organization. Most teams rely on several tools, building custom toolchains that fit their needs for each phase in the application lifecycle. While adopting a specific tool or technology is not the same as adopting DevOps, when the DevOps culture is present and the processes are defined, people can implement and streamline DevOps practices if they choose the proper tools. Get the tools to put DevOps into practice:

DevOps and the cloud:
Cloud adoption has fundamentally transformed the way teams are building, deploying and operating applications. Together with the adoption of DevOps, teams now have greater opportunity to improve their practices and better serve their customers better.

Cloud agility:

With the ability to quickly provision and configure multi-region cloud environments with unlimited resources, teams gain agility in deploying their apps. Now, instead of having to buy, configure and maintain physical servers, teams create complex cloud environments in minutes, then shut them down when they’re no longer needed.

Kubernetes:

As more and more applications use container technology, Kubernetes is becoming the industry solution for orchestrating containers at scale. Automating the processes of building and deploying containers via CI/CD pipelines and monitoring these containers in production are becoming essential practices in the age of Kubernetes.

Serverless computing:

With most of the overhead of managing infrastructure moved to the cloud provider, teams can focus on their apps rather than the underlying infrastructure. Serverless computing offers the ability to run applications without configuring and maintaining servers. Some options reduce the complexity and risk of deployment and operations.

Thanks to go through my blog!!!
Let's prepare your mac for development. Stop having version conflicts.
Tags: ruby, python, node
Published: 2021-04-08 04:19:22

---
title: Let's prepare your mac for development. Stop having version conflicts.
published: true
description: Installing Ruby[rvm] Python[pyenv] NodeJS[nvm]
tags: ruby,python,nodejs
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttsjqhqmlf10n41wd56h.png
---

Hi everyone,

During my first few years of programming, the first struggle I have is how to manage multiple versions of Ruby.

It's been a very painful programming experience. I have to keep upgrading Ruby in the older projects in order to maintain them.

I know it's a good practice to keep everything up to date, but sometimes, it's just a side project and not worth spending time on.

That was 9 years ago.... If you are having the same problem as me with Ruby, Python, and NodeJS.

Here is the solution, 

- Ruby use RVM
- Python use pyenv
- NodeJS use NVM

I made a video to explain.

[![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bm6p0rqg2a2ndy9szkvf.jpg)](https://www.youtube.com/watch?v=TUMbUeschdg)

Hope you find it useful
Detect and Fix ANR in Android
Tags: android, java, kotlin
Published: 2021-04-08 04:16:07

The recently released Finotes SDK 3.3.0 for Android has some significant improvements in ANR detection. The SDK now provides near perfect root cause detection of ANR issues in Android apps. The feature is enabled automatically with out any need for developer to write extra lines of code.

The new version is already getting appreciation from customers. Here is a screenshot of a mail from an Android developer at one of top global mobile apps. It clearly indicates his excitement on how Finotes was able to help him detect the root cause.

![Mail from an Android developer about how Finotes helped him fix ANR](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rh1tomw726dkgn4y4zh3.png)

Visit https://www.blog.finotes.com/post/identifying-root-cause-of-anr-in-android-apps to know more about the improved ANR detection capability of Finotes.
I made a Climate Change News App
Tags: showdev
Published: 2021-04-08 04:10:18

Hey,

I've been working on a little news app for the past few weekends. It's a news app that only focuses on "climate change". It shows climate change related articles from different sources.

Link: [http://polrr.news](http://polrr.news)
Tech Stack: React(TS), NodeJS, MongoDB, AWS

#### Why I made this?
This is not my first project using MERN, I have built some decent apps for other people(at work or helped some friends) but I never added a good project to my portfolio. I do have some apps, but they are either on Heroku or Netlify and those apps are more like experiment stuff. I've abandoned a lot of projects too. 

This time I wanted to make something from start to finish. Something that can go on my portfolio/resume. Something people can actually use and benefit from it.


Why this specific news app?

I could've easily made a Netflix or YouTube clone and added it to my resume. People do it and they get jobs based on that. If you're a beginner that's fine. But for a guy like me, who's not a beginner that might not look nice + it's not even fun as I already know the flow and everything. Also, nobody's going to use it. After one gets a job, that project will go into the pool of unfinished projects.

As developers, we have the privilege to build stuff that can actually make someones' life easier. Almost anybody can come up with an idea, but the ability to execute only lies among a few.


These are the few reasons I chose to develop this specific app:

1. Chance of people using this app > Chances of anybody using a clone. I can get actual user feedback and add new features based on that.

2. I wanted to try Typescript. I wanted it to be something small so I can focus more on Typescript and less on thinking about the app features and their complexity.

3. I wanted this to be a refresher for my MERN skills.

4. It's not something recruiters see every day.

5. MOST IMPORTANT! As I mentioned I have this habit of abandoning projects. I didn't wanna pick something huge as I might get bored and leave the project unfinished.

This is the first time, I brought a domain for a project. :raised_hands:

It's not HTTPS, because I can't afford it. LOL. :grin:

I have a few more ideas to work on. I'll be experimenting with new technologies and try to build something people can actually use.

All of this information wasn't necessary, but I hope this helps out someone who's deciding to start on a new project.

Also, I'll be writing an article on hosting on AWS(+ nginx). If you are interested, let's stay connected.

Thank you. :v:

You can connect with me on [Twitter](https://www.twitter.com/thesnjvsharma) or [LinkedIn](https://www.linkedin.com/in/thesanjeevsharma).
Types vs interfaces in TypeScript
Tags: typescript
Published: 2021-04-08 03:39:38

แนวคิดในการตรวจสอบประเภทคงที่ใน JavaScript นั้นยอดเยี่ยมมากและการนำ TypeScript มาใช้ก็มีมากขึ้นทุกวัน

คุณเริ่มใช้ TypeScript ในโปรเจ็กต์ของคุณคุณสร้างประเภทแรกของคุณจากนั้นคุณก็ข้ามไปที่อินเทอร์เฟซแรกของคุณและคุณทำให้มันใช้งานได้ คุณสรุปได้ว่าในความเป็นจริงแล้ว TypeScript ช่วยในการพัฒนาของคุณและประหยัดเวลาอันมีค่าของคุณ แต่คุณอาจทำผิดพลาดและไม่ได้ปฏิบัติตามแนวทางปฏิบัติที่ดีที่สุดเมื่อคุณเริ่มทำงานกับ type และอินเทอร์เฟซใน TypeScript


นี่เป็นกรณีของนักพัฒนาจำนวนมากพวกเขาไม่ทราบความแตกต่างที่แท้จริงระหว่าง type aliases และอินเทอร์เฟซใน TypeScript


การเริ่มต้นใช้งาน TypeScript นั้นง่ายมาก แต่บางครั้งเราก็ต้องคิดเพิ่มเติมเกี่ยวกับกรณีการใช้งานที่ดีที่สุดสำหรับเรา ในกรณีนี้ประเภทหรืออินเทอร์เฟซ?


## Types and type aliases

ก่อนที่เราจะข้ามไปสู่ความแตกต่างระหว่างประเภทและอินเทอร์เฟซใน TypeScript เราจำเป็นต้องเข้าใจบางสิ่ง 

ใน TypeScript เรามีประเภทพื้นฐานมากมายเช่น สตริง บูลีน และตัวเลข นี่คือประเภทพื้นฐานของ TypeScript นอกจากนี้ใน TypeScript เรามี **advanced types** และในประเภทขั้นสูงเหล่านี้เรามีสิ่งที่เรียกว่า type aliases ด้วย type aliases เราสามารถสร้างชื่อใหม่สำหรับประเภทได้ แต่เราไม่ได้กำหนดประเภทใหม่

[everyday-types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#type-aliases)

เราใช้ type keyword เพื่อสร้าง new type alias นั่นเป็นสาเหตุที่บางคนอาจสับสนและคิดว่าเป็นการสร้าง type ใหม่เมื่อพวกเขาสร้างชื่อใหม่ให้กับประเภทเท่านั้น

ความแตกต่างระหว่าง type และอินเทอร์เฟซใน TypeScript เคยมีความชัดเจนมากขึ้น แต่เมื่อใช้ TypeScript เวอร์ชันล่าสุดจะมีความคล้ายคลึงกันมากขึ้น


อินเทอร์เฟซเป็นวิธีอธิบายรูปร่างข้อมูลตัวอย่างเช่นวัตถุ


Type คือคำจำกัดความของประเภทข้อมูลตัวอย่างเช่นยูเนี่ยนดั้งเดิมจุดตัดทูเพิลหรือประเภทอื่น ๆ


[ต้นฉบับ](https://blog.logrocket.com/types-vs-interfaces-in-typescript/)