teleren/devto huggingface dataset:
Why I Love Docker as a Newbie 🐋
Tags: docker, devops, opensource
Published: 2019-12-05 15:16:52

Hola, Hope you guys are doing great. 💖

#### Why I love docker and Why you should switch to Docker.


##### What is Docker?

Docker is a Platform as a Service, Which lets you to use OS level virtualization to Deliver software in Packages called containers.

Best thing about Docker is, Each container is Isolated. Means, One container won't mess up with another one.

##### My Story 

I'm a Big fan of Open-Source and I love to try running new Open Source stuff either in Raspberry Pi or Laptop.

One thing I hate running in the Current system is dependencies issue. Yes, Installing one package will broke another existing dependency package.

> Using Ubuntu in my Laptop and Raspbian in Pi

Yes, It's painful, I have faced this issue many times. Luckily, All the Stuff I picking have Docker Container.

But I keep ignore. Yesterday I planned to give Docker a try in my Pi.

Trust me. It solves Dependencies issue. And Very low CPU usage as compared to Native Script.


##### How it's Possible with Docker?

Docker container is a standard unit of software that packs up code and all  dependencies, so the application runs quickly and reliably without messing with other container. Also, Docker uses the Original Kernel of Main Operating System to fulfil the system level needs.

> Most of the Codes/Stuff now supports Docker. They are delivering Docker container which contains everything to run out of the Box.

> I'll leave all the Links to get started with Docker

- Installing Docker: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04

- Find Docker Container: https://hub.docker.com/

That's all for this Post :)
Daily Challenge #132 - Is my friend cheating?
Tags: challenge
Published: 2019-12-05 14:52:36

---
title: Daily Challenge #132 - Is my friend cheating?
published: true
series: Daily Challenge
description: Given a number n, could you tell me the numbers he excluded from the sequence
tags: challenge
---

- A friend of mine takes a sequence of numbers from 1 to n (where n > 0).
- Within that sequence, he chooses two numbers, a and b.
- He says that the product of a and b should be equal to the sum of all numbers in the sequence, excluding a and b.
- Given a number n, could you tell me the numbers he excluded from the sequence?

The function takes the parameter: `n` (n is always strictly greater than 0) and returns an array or a string (depending on the language) of the form:

`[(a, b), ...] or [[a, b], ...] or {{a, b}, ...} or or [{a, b}, ...]`
with all `(a, b)` which are the possible removed numbers in sequence `1 to n`.

`[(a, b), ...] or [[a, b], ...] or {{a, b}, ...} or ...`will be sorted in increasing order of the "a".

It happens that there are several possible `(a, b)`. The function returns an empty array (or an empty string) if no possible numbers are found which will prove that my friend has not told the truth! (Go: in this case return `nil`).

*Examples*
 `removNb(26) should return [(15, 21), (21, 15)]`
or
  `removNb(26) should return { {15, 21}, {21, 15} }`
or
  `removeNb(26) should return [[15, 21], [21, 15]]`
or
  `removNb(26) should return [ {15, 21}, {21, 15} ]`
or
  `removNb(26) should return "15 21, 21 15"`
or
  `in C:
removNb(26) should return  **an array of pairs {{15, 21}{21, 15}}**
tested by way of strings.`

***
_This challenge comes from g964 on CodeWars. Thank you to [CodeWars](<https://codewars.com/>), who has licensed redistribution of this challenge under the [2-Clause BSD License](<https://opensource.org/licenses/BSD-2-Clause>)!_

_Want to propose a challenge idea for a future post?  Email **yo+challenge@dev.to** with your suggestions!_
add different subtotals to the tax on my invoice woocommerce
Tags: wordpress, php
Published: 2019-12-05 14:44:05


I am starting on the development of php and wordpress and I am looking to modify the subtotal on my invoice to make two that would correspond to the subtotal of the two taxes I own on my site.

Like this:

Subtotal 5.5%: €44.50€
Sub-total 20%: €33.58€
Tax 5,5%: 2,45€
Tax 20%: 6,72€


From what I understood, it would consist in adding all the products on the invoice with a tav at 20% to do the same for those at 5% to get two lines out?

I looked at this document a little bit: https://github.com/woocommerce/woocommerce/blob/master/includes/abstracts/abstract-wc-order.php#L467

But I'm not sure how to do it.

Can you enlighten me?? I've done a lot of research, but I can't find the solution.

Sorry it's my first post here if I'm doing it wrong give me a feedback !
Day 2 - Install and Running Node on Window - Learning Node JS In 30 Days [Mini series]
Tags: node, javascript, codenewbie
Published: 2019-12-05 14:19:47

Go to node website https://nodejs.org/en/

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/l0jmb7dcxwb71k476lcm.png)

In my pc node was installed before which is 10.16.3 but you can install 12.13.1 (LTS Recommended For Most Users) because LTS means Long Term Support
Download and install
Now open command promt and write node -v then you’ll see what version use are using of node.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/yi7y81pyvhyq6c0wvw3m.png)

create a folder and name it whatever you want

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ah8rpc26v2743vuqzbcg.png)

create a file and name it whatever you want with .js extention

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/mt6toq7i3gjful95kbnw.png)

Write the simple code in there

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/jhzu92pyikrzrt95wwiu.png)

Open command promt on this folder and write command node `YOURFILENAME` like node `app.js`

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/pm79d12w3pu9qb04szzm.png)

And magic!!! see the result!

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/5bh2qpix15peqy4vyeex.png)

So can you install the node right now ?


Originally it published on [nerdjfpbblog](https://blog.nerdjfpb.com/day2-nodejsin30days/) and graphical version on [instagram](https://www.instagram.com/p/B5sT3Z8geZq/). you can connect with me in [twitter](https://twitter.com/nerdjfpb) or [linkedin](https://www.linkedin.com/in/nerdjfpb/) !
Help me understand and analyze the locust chart
Tags: help, locust, loadtesting
Published: 2019-12-05 14:14:27

---
title: Help me understand and analyze the locust chart
published: true
tags: help,locust,load-testing 
---
I know how to write Locust script and make it load test. What I still need to learn. 

Help me understand the resulting chart and make a good analysis out of it.

As we are generating the users and hitting the target website with the same IP, do we need to rotate the ip or it does not matter.

All sort of things a  load-tester should consider for better result
Humbly Asking for your Help
Tags: watercooler
Published: 2019-12-05 14:02:39

Hi DEV Community,

My sister, Bethany, saved a dog from being euthanised a little over a year ago (from a neglectful and uninformed owner) but found out recently that it has several medical issues which need attention immediately.  Beth is still in college and can't afford such a huge expense, but her dog, Rosie, is really young and needs this surgery as soon as possible. I'll let Beth explain what Rosie means to her in her own words:

> _"I saved Rosie from living on the streets with the possibility of being euthanized a little under a year ago. She has had many previous owners who have gotten rid of her. She is absolutely the most lovable and friendly dog. Rosie is my rock, my ESA, and has helped me through harder times than I can even express. She has quite literally saved my life._
>
> _"Coming back from a very expensive vet visit today, we found out she has two torn ACLs, hip dysplasia, and early arthritis. The vet visit today is something I cannot afford and it was just getting x-rays done with medication. She will be on medicine for the rest of her life and will need surgery very soon. The only way I am able to get her the help she needs to function is by creating this donation page. Any help is greatly appreciated, even if it just sharing this. If you would like more information, or to help out in other ways, please feel free to contact me. Thank you."_

Please, [if you can donate even a few dollars, or a few Euro, or a few pounds](https://www.gofundme.com/f/sm8v2m-surgery-for-rosie), Beth and Rosie would really appreciate it. Sorry for asking like this on DEV, but she really needs all the help she can get.

> [GoFundMe: Surgery for Rosie](https://www.gofundme.com/f/sm8v2m-surgery-for-rosie)

Thank you.
Craigslist Launches Mobile App
Tags: reactnative, discuss, ios, android
Published: 2019-12-05 13:56:13

Woke up this morning to news that [Craigslist launches an official app for iOS; it became the 10th most-downloaded app in the Shopping category one day after launch](https://www.launchticker.com/story/craigslist-launches-an-official-app-for-ios-it-is-the-10th).

It was also released for iOS and Android at the same time (though Android in Beta) so I (naturally for me) wondered if it was a native app.

# Ratings

10th most downloaded and great ratings for iOS. 

![App Store Ratings for iOS app](https://thepracticaldev.s3.amazonaws.com/i/af8kq816o9me4iqp1199.png)

More than 10,000 installs on Android and terrible ratings.

![Play Store Ratings for Android app](https://thepracticaldev.s3.amazonaws.com/i/27bwuhu0383u67u0igu0.png)

From my quick scanning of the reviews on Android, a lot of people are disappointed that it requires connecting to a Google account (even if you already have a Craigslist account) and frustrated that the search results on the website are different from in the app (even to the point that some things don't show up in the app with the same search string).

# Is it native?

I signed up for the Android beta, installed the app, and opened it in [Dexplorer](https://play.google.com/store/apps/details?id=com.dexplorer&hl=en_US) before even opening the app.

Tell-tale signs that React Native is in use.

![Libs folder](https://thepracticaldev.s3.amazonaws.com/i/01c1fn8guzqq9r6cqp0q.png)

Confirmation that the app is React Native

![Main Activity](https://thepracticaldev.s3.amazonaws.com/i/heer64vbmx2kncs8do97.png)

No, I don't consider React Native to be native. On [the scale of web to native](https://dev.to/touchlab/the-future-of-cross-platform-is-native-7cn), it is almost in hybrid tools territory.

React Native tends to perform better on iOS than Android, though [Hermes is supposed to narrow that gap](https://dev.to/rishikc/react-native-just-got-better-the-new-javascript-engine-is-here-7nl). But given the negative Android reviews are mostly not about performance, that doesn't seem to be the issue.

# Discuss

I don't have an iOS device to compare personally. Maybe the feature set is different on each platform, or maybe iOS users are sufficiently different from Android users.

Can anyone comment on why iOS might have such higher ratings than Android?

Is anyone better at reverse engineering to see how well they are using React Native? Maybe it's just a shell for webviews in which case this app is even further in hybrid territory than other React Native apps.

Craigslist keeps things quite simple as a website, any ideas why they wouldn't go the PWA route?
I keep feeling demotivated when I realize how deficient my knowledge is.
Tags: webdev, help, discuss
Published: 2019-12-05 13:42:10

#Hi everyone,

My name is Patrik Kiss, and I'm a junior web developer(I guess). I finished a 2 years software developer course a few months ago, and currently I have no job yet unfortunatelly.

**I have knowledge in:**
-HTML+CSS+JS
-Frameworks I can use: Jquery(JS), Bootstrap 4(CSS)
-Jquery ajax
-PHP(OOP,PDO)
-SQL-MySQL
-basics on .htaccess(making user friendly URLs)


I can create responsive and dynamic websites easily using the technologies above, I can organize my code, so it's nice and readable, I have a good problem solving skill too, I always think ahead, and create functions,methods that I can reuse in the future etc.


These are some basic, yet really useful skills a programmer should have(as I've heard many times).


But the problem is, that I keep feeling like even though I know these things, my knowledge is still **really deficient**.


Whenever I come here on DEV, reading articles, I always see ones about NodeJS,ReactJS,VueJS,GraphQL etc, and sometimes I would check on them out of simple curiorsity, and I always find myself barely understanding anything from the article, like code examples. Same when I search for solutions on Stack overflow, and I see all those complex code. And whenever this happens, I always get kind of demotivated, since I always realize that in reality, I barely know anything yet.


Same thing happens when I search for jobs, and companies barely look for beginners/juniors, or even if they do, 90% of the time knowledge in the technologies I mentioned above are **required**.
And in times like these, I always think *"How am I gonna ever get a job like this?"*.


I code a lot at home, and honestly I really like doing it, and I'm constantly trying to improve myself, by working on bigger projects, like I've been working on a website for 3 months now, and I'm always proud of myself when I manage to solve something I couldn't do until then, like when I finally managed to solve **pagintion in PHP** I was so happy, **[I even made an article of it](https://dev.to/weeb/my-pagination-code-in-php-234i)**. Don't know how much of a good solution or code it is, but this is probably what I'm the proudest of now. But these *"happy feelings"* sometimes disappear when I realize that it's actually not even a big deal, it only is for me.


I know I'm probably being too hard on myself, considering I just finished my studies, and I'm still just a junior, but still, even towards juniors there are such high expectations nowadays that it's crazy, and I don't feel like I can meet them at all.


Do you have any advice to vanish these feelings and stay motivated all the time?
How do you get project? on where?
Tags: webdev, react, wordpress, laravel
Published: 2019-12-05 13:41:48

Hi. everyone.
I am an expert of full-stack web development with experience for 6 years.
Specially, I enough skills and experience with above skills.
But for now I can't get projects from any site for freelancers, because I don't have reviews. That's very difficult to get task.
Specially on upwork, it's more difficult.
How can i do? If you have any experience like me or have a good idea. please share with me.
Thank you.
Testing less variables with do-while
Tags: php, cpp
Published: 2019-12-05 13:41:20

You may be familiar with the do-while statement, which is:

```cpp
do {
  /* something */
} while (/* condition */)
```

Today while reading through the PHP manual, I found an interesting use for this statement. Basically if you're testing for a bunch of stuff present that doesn't make sense to test for unless something else is already present, you can test less conditionals which will make your code faster (especially if it's in a compute-intensive loop like draw() for example), and maybe eliminate some variables from your code.

Suppose you have a button class of a widget library like [nanogui](https://github.com/mitsuba-renderer/nanogui/), and it has a draw() function that looks something like this C++:
```cpp
// ...
if (!this->m_hidden && this->m_text != NULL)
  draw(some_canvas, this->m_text);
if (!this->m_hidden && this->m_icon != NULL)
  draw(some_canvas, this->m_icon);
// ...

```

The real draw() function is much more complicated than this, but if you're curious you can check it out [here](https://github.com/mitsuba-renderer/nanogui/blob/master/src/button.cpp). I adapted this code for readability, severely condensed it and changed its semantics a little for the purpose of this post.

We can replace the above code with:
```cpp
// ...
do {
  if (this->m_hidden)
    break;

  if (this->m_text != NULL)
    draw(some_canvas, this->m_text);
  if (this->m_icon != NULL)
    draw(some_canvas, this->m_icon);
}
while (false)
// ...

```

This code will break if the button is hidden. When a do-while loop has (false) as its condition, it will only run once. That's why it works.

In my opinion, It's better than using a goto statement, which disrupts control flow in case you ever want to prepare a control flow graph of this code.

So why does this have the #php tag? Because as it turns out, PHP has a do-while statement to, is it was inspired by C and C++. In PHP I could write the above code as:

```php
// ...
do {
  if ($this->m_hidden)
    break;

  if ($this->m_text != NULL)
    draw(some_canvas, $this->m_text);
  if ($this->m_icon != NULL)
    draw(some_canvas, $this->m_icon);
}
while (false);
// ...

```

Hopefully, this gives you one more thing to do with the uncommon do-while statement.
Extending the Kubernetes Controller
Tags: kubernetes, devops, docker
Published: 2019-12-05 13:07:10

Kubernetes Controllers Overview
At the core of Kubernetes itself, there is a large set of controllers. A controller ensures that a specific resource is (and remains) at the desired state dictated by a declared definition. If a resource deviates from the desired state, the controller is triggered to do the necessary actions to get the resource state back to where it should be. But, how do controllers “know” that a change happened? For example, when you scale up a deployment, you actually send a request to the API server with the new desired configuration. The API server in return publishes the change to all its event subscribers (any component that listens for changes in the API server). Thus, the Deployment controller creates one or more Pod to conform to the new definition. A new Pod creation is, in itself, a new change that the API server also broadcasts to the event listeners. So, if there are any actions that should get triggered on new Pod creation, they kick in automatically. Notice that Kubernetes uses the declarative programming methodology, not the imperative one. This means that the API server only publishes the new definition. It does not instruct the controller or any event listener about how they should act. The implementation is left to the controller.

While native Kubernetes controllers like Deployments, StatefulSets, Services, Job, etc. are enough on their own to handle most application needs, sometimes you want to implement your own custom controller. Kubernetes allows you to extend and build upon the existing functionality without having to break or change Kubernetes’s source code. In this article, we discuss how we can do this and the best practices.

Custom Controller Or Operator?
From the origin of Kubernetes, it was thought of controllers as the way developers can extend Kubernetes functionality by providing new behavior. Because of the many phases that extended-controllers has passed through, we can roughly classify them into two main categories:

Custom Controllers: those are controllers that act upon the standard Kubernetes resources. They are used to enhance the platform and add new features.
Operator: at their heart, they are custom controllers. However, instead of using the standard K8s resources, they act upon custom resource definitions (CRDs). Those are resources that were created specifically for the operator. Together, an operator and its CRD can handle complex business logic that a native or an extended controller cannot handle.
The above classification is only used to differentiate between different concepts that you need to understand in each model. But in the end, the concept stays the same; we are extending Kubernetes by creating a new controller. In this article, we are interested in the first type; custom controllers.
15+ Apps For Create Website Mockup
Tags: webdev, mockup, apps, ux
Published: 2019-12-05 12:54:13

Creating a website mockup is an important step in the process of  web development . To facilitate collaboration in the process, the design must be made with a good design that is easy to understand. Then, using paper and pen is not enough. 

Currently, there are more apps that facilitate web designer to create a website mockup. In this article, we have selected the best applications 15+ can be used without the hassle own research. 

You can read full article here:
  https://desainerhub.com/2019/12/15aplikasi-mockup-website
ReactiveSearch Vue 1.0 - Build complex search UIs in record time.
Tags: vue, react, javascript
Published: 2019-12-05 12:48:25

We're out with 1.0 release of ReactiveSearch for Vue. It provides scaffolding to build complex Search UIs in record time by taking care of querying, managing search state and updating your UI. It also comes with over 10 built-in components that help you get started in minutes. Direct Github link: [https://github.com/appbaseio/reactivesearch](https://github.com/appbaseio/reactivesearch).

We always get the question about why someone should use it, and we also think about this a lot.

1. ReactiveSearch provides declarative props for the most common search scenarios: e.g. how to use auto-suggestions, how to handle search typos, how to tune weights, apply relevance. Instead of specifying how to achieve these outcomes, a user just specifies the desired outcome. This makes building search UIs accessible to all developers v/s just search engine users. It also makes it inherently safer and easier to change these.
2. Combined with the ability of specifying props, ReactiveSearch components come with built-in components that have presets on how to render the search box, facets, results.
3. ReactiveSearch doesn’t get in the way when you want to specify how to achieve a certain search scenario — you can write your own Query DSL for it. You can also [bring in your own UI components and design systems](https://docs.appbase.io/docs/reactivesearch/vue/advanced/ReactiveComponent/).
4. Above all, ReactiveSearch is Apache 2.0 licensed, actively maintained and is relied on by hundreds of projects for their production search use-cases. Aside from Vue.JS, ReactiveSearch also comes in [React](https://opensource.appbase.io/reactivesearch) and [React Native](https://opensource.appbase.io/reactivesearch/native) flavors.
5. If you are an [appbase.io](https://appbase.io) user, ReactiveSearch can additionally record search and click analytics out-of-the-box (it requires an opt-in). You can [use Appbase.io with any ElasticSearch cluster](https://medium.appbase.io/appbase-io-clusters-a-supercharged-elasticsearch-experience-f38086a6483f).

Since this is the very first time we're putting this out there, would love to hear feedback from the community.

If you're looking to just get started with it, see the quickstart guide here: https://docs.appbase.io/docs/reactivesearch/vue/overview/quickstart/.