teleren/devto huggingface dataset:
PHP Child Process and Signal-Part 2
Tags: php, process
Published: 2020-10-12 16:51:53

+ When the signal of forked process doesn't get successful process from `pcntl_wait()`, it would stay untils it get processed successfully. (Once gets handled, it would not work for later `pcntl_wait()`)

In the [part 1](https://dev.to/aldora713/php-child-process-and-signal-part-1-11m2), I talked about what happens when we kill parent process, then kill the child. In this part, I would talk about what would happen if we kill the process in reverse order.

```php
pcntl_async_signals(true);

pcntl_signal(SIGTERM, function ($signal, $status) {
    echo "inside pcntl_signal\n";
    $pid = pcntl_wait($processStatus, WUNTRACED);
//    $pid = pcntl_wait($processStatus, WNOHANG);

    if (pcntl_wifexited($processStatus)) {
        $code = pcntl_wexitstatus($processStatus);
        print "pid $pid returned exit code: $code\n ";
    } else {
        print "$pid was unnaturally terminated\n ";
    }
//    print_r($processStatus);
//    echo "\n";
//    echo "signal: $signal\n";
//    print_r($status);
});
if ($pid = pcntl_fork()) {
    $parent = getmypid();
    echo "parent: $parent\n";
    
    sleep(60);
} else {
    $childPid = getmypid();
    echo "child pid: $childPid\n";

    sleep(60);
}
``` 

Execute the above script, and according to the output of process pid, first use `kill` command to kill parent process, then kill child process. The total output would be like this:

```
parent: <parent pid>
child pid: <child pid>
inside pcntl_signal
pid -1 returned exit code: 0
inside pcntl_signal
pid <child pid> returned exit code: 0
```
We still create two processes, one parent, one child. Kill the child, and this invokes the signal handler in the child process. However, `pcntl_wait()` only works when it's called in parent, so it returns -1. Then, we kill the parent, this time, the `pcntl_wait()` in parent handles the child process status info successfully. But this raises a noticeble point: the signal which can't be handled by `pcntl_wait()` in child process stays until successfully dealed by parent process.
Difference between double equal and triple equal
Tags: javascript, beginners, webdev, codenewbie
Published: 2020-10-12 18:17:27

```
// Double equal - Converts both the operands to the same type and then compares
console.log(0 == '0'); // true

// Triple equal - Does not convert to same type
console.log(0 === '0'); // false
```

---

**Thanks for reading 💙**  
Follow **@codedrops.tech** for daily posts.  
[Instagram](https://www.instagram.com/codedrops.tech/) ● [Twitter](https://twitter.com/codedrops_tech) ● [Facebook](https://www.facebook.com/codedrops.tech/)

Micro-Learning ● Web Development ● Javascript ● MERN stack ● Javascript  
**[codedrops.tech](https://www.codedrops.tech/)**
Discover pods by label in Prometheus
Tags: prometheus, kubernetes, monitoring, python
Published: 2020-10-12 18:00:54

# What are we doing?

Kubernetes SD configurations allow retrieving scrape targets from Kubernetes' REST API in order to stay synchronized with the cluster state.

I created an image of a Python program that exports metrics using the [the Prometheus Python client](https://github.com/prometheus/client_python). Setting the environment variable `EXPORTER_PORT` will publish metrics to that port.

I deployed this container in pods with labels `foo` and `bar` and sent metrics to port 9000 and 8000 respectively. You can see in the below Prometheus config that I target them separately by their label name.

# Why would you need to do this?
I found a case where I wanted different scrape configurations per pod in my cluster.  Usually, I can set the `kubernetes_sd_configs` role to `service`, which discovers a target for each service port for each service (see the [docs](https://prometheus.io/docs/prometheus/latest/configuration/configuration/#kubernetes_sd_config)).  However, in this case I had different collection requirements for the pods inside my k8s abstractions.

# Example config files
## Foo Deployment
```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: foo-deployment
  labels:
    app: foo
spec:
  selector:
    matchLabels:
      app: foo
  replicas: 2
  template:
    metadata:
      labels:
        app: foo
    spec:
      containers:
      - name: python-prometheus-exporter-example
        image: ahf90/python-prometheus-exporter-example
        imagePullPolicy: Always
        ports:
          - containerPort: 9000
        env:
          - name: EXPORTER_PORT
            value: '9000'
```

## Bar Deployment
```
apiVersion: apps/v1
kind: Deployment
metadata:
  name: bar-deployment
  labels:
    app: bar
spec:
  selector:
    matchLabels:
      app: bar
  replicas: 2
  template:
    metadata:
      labels:
        app: bar
    spec:
      containers:
      - name: python-prometheus-exporter-example
        image: ahf90/python-prometheus-exporter-example
        imagePullPolicy: Always
        ports:
          - containerPort: 8000
        env:
          - name: EXPORTER_PORT
            value: '8000'
```

## Prometheus config.yml
```
scrape_configs:
  - job_name: 'prometheus'
    static_configs:
    - targets: ['localhost:9090']
  - job_name: 'foo-targets'
    scrape_interval: 10s
    metrics_path: '/'
    kubernetes_sd_configs:
    - role: pod
      namespaces:
        names:
        - default
      selectors:
      - role: "pod"
        label: "app=foo"
  - job_name: 'bar-targets'
    scrape_interval: 5s
    metrics_path: '/'
    kubernetes_sd_configs:
      - role: pod
        namespaces:
          names:
            - default
        selectors:
          - role: "pod"
            label: "app=bar"
```

![Prometheus targets page](https://dev-to-uploads.s3.amazonaws.com/i/mpluuaheqfnn8fjvlmg5.png)
Top Custom Software Development Companies in Seattle
Tags: softwaredevelopment, topcompanies, seattle
Published: 2020-10-12 17:59:43


DataNeoShore
https://dataneoshore.com/

Helpful Human
http://www.helpfulhuman.com/

Carbon Five
https://www.carbonfive.com/

BTown Web
https://www.btownweb.com/

LabKey
https://www.labkey.com/

Curvine Web Solutions
http://curvine.com/

Dynomid.tech
https://dynomind.tech/

SWECKER
https://swecker.co/

Smashing Ideas
https://smashingideas.com/

Kind+Human
https://kindandhuman.com/

Nortal
https://nortal.com/us/

Rooster Park Consulting
https://www.roosterpark.com/

Flower Press Creative Studio, LLC
https://www.theflowerpress.net/

Seattle Software Developers
https://seattlesoftwaredevelopers.com/

Lunarbyte.io
https://www.lunarbyte.io/

Kelsus
https://kelsus.com/

CASoft Seattle
https://www.casoftseattle.com/

Black Antelope
https://www.blackantelope.com/

TECLA
https://www.tecla.io/

projekt202
https://www.projekt202.com/

Bilberry
https://bilberrry.com/

DMC, Inc.
https://www.dmcinfo.com/

Flexasoft
http://www.flexasoft.com/

Devblock
https://devblock.net/

Celebrate Drupal
http://www.celebratedrupal.com/

Fresh Consulting
https://www.freshconsulting.com/

Neudesic
https://www.neudesic.com/

Vectorform
https://www.vectorform.com/

Digitegy
https://digitegy.com/

Northwest Independent Ruby Development
https://www.nird.us/

Arbela Technologies
https://www.arbelatech.com/

Endava
https://www.endava.com/en

Blue K LLC
http://www.bluek.com/

Jetstream Software, Inc.
http://www.jetstreamsoftware.com/

Plain Concepts
https://www.plainconcepts.com/

SOUTHWORKS
https://www.southworks.com/

Wintellect
https://www.wintellect.com/

Pixel Lab
http://thinkpixellab.com/

Foretheta - That's us ;)
https://www.foretheta.com/

Do you want your company on the list of _Top Custom Software Development Companies in Seattle_? Let us know at blog@foretheta.com.
Read about the Top 5 Open-Source Resources and Libraries For Big Data Analytics For Data Scientists.
Tags: computerscience, python, machinelearning, datascience
Published: 2020-10-12 17:57:15

###Data is Involved everywhere, Big data is a field that treats ways to analyze, systematically extract information from, or otherwise, deal with data sets that are too large or complex.

###Read about the Top 5 Open-Source Resources and Libraries For Big Data Analytics For Data Scientists.

https://medium.com/analytics-vidhya/top-5-open-source-resources-and-libraries-for-big-data-analytics-for-data-scientists-5a532c59d918
Quality Engineering for Web UI
Tags: javascript, qa, qe, ux
Published: 2020-10-12 17:41:57

Quality is a shared responsibility within the team. Historically, unit tests have always been responsibility of developers while all other types of tests, along with CI/CD integration, were responsibility of QA engineers. Over time, software testing has evolved becoming more sophisticated, but also more understood and structured. New terms have permanently entered our vocabulary - integration testing, regression, end-to-end (e2e) tests, smoke, load, stress, usability tests, etc.

For UI development, however, unit tests are not sufficient. It is just impossible to cover all possible user interactions with your app by unit tests. What then should UI developers do to insure quality of the code and, more importantly, what tools are now available to help with this task? This is the question I want to explore in this article.

Read more at http://w2ui.com/web/blog/14/Quality-Engineering-for-Web-UI
TIL - Javascript Animation on Background-Pics in React
Tags: react, webdev, css, reacjs
Published: 2020-10-12 17:36:27


#Animated Background-Pics
To get the pic to cover the whole screen on different screen sizes it is good to attach it to the `<body>` tag. 
The library [Body-Classname](https://github.com/iest/react-body-classname) provides a declarative way to specify document.body.className. I additionally used [Emotion](https://emotion.sh/docs/introduction) to write css styles with JavaScript.

```javascript
/** @jsx jsx */
(before ->  import React from 'react'; for emotion library ) 
import BodyClassName from 'react-body-classname';
import { jsx } from '@emotion/core'
(...)
 
let sectionStyle = (process.env.PUBLIC_URL + `/images/${image()}.png`) ;

let errorStyle =(process.env.PUBLIC_URL + `/images/error.gif`) ;
(...)

 <BodyClassName className="container" css={{ backgroundImage: `url("${errorState ? errorStyle : sectionStyle}")` }}>
(...)
 <BodyClassName/>
```

```css
body{
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    min-height: 100%;
    min-width: 100%;
}
``` 

####Where to put your images? 
`<src>`
 - have an image-folder in the source folder and access it from there -> 
 `<img src="/images/imagename.png" alt='image'/>` 

`<public>`
- The react docs explain this nicely in the documentation, you have to use `process.env.PUBLIC_URL` with images placed in the public folder. 
` <img src={process.env.PUBLIC_URL + '/img/logo.png'} /> `
Pokemon Generations Api v2
Tags: codepen
Published: 2020-10-12 17:31:39

---
title: Pokemon Generations Api v2
published: true
tags: codepen
---

<p>Pokemon List
api: pokeapi</p>

<p>Thanks Pokémon GO Printable Checklist Pokédex - With Gen 4 for images </p>

{% codepen https://codepen.io/rogergcc/pen/NeEYeN %}
Simple tip for your product meetings.
Tags: productivity, management, startup
Published: 2020-10-12 17:22:39

# I'm busy 

Print "KEEP IT LEAN" on a piece of paper and put the paper on a visible place during your meeting.  

[Like this](https://docs.google.com/document/d/1NiWGtBV-Uawk6bTISbb65JCgMO8ijHBVSixdSKe8qxw/edit?usp=sharing) 

--- 

## I have a minute 

Marketing, SEO, BizDev, Product owner and WebDev people. 

We spent two days locked up in a meeting room with a simple goal.  

Design a website which would enable our clients to buy and manage their licenses.  

**2 days is way too long.** 

I was so upset, angry and tired after the first day. It felt like we have done a big amount of nothing. 

Next morning, I printed out "KEEP IT LEAN" on a piece of paper with the biggest font that fit. [Here I prepared it for you](https://docs.google.com/document/d/1NiWGtBV-Uawk6bTISbb65JCgMO8ijHBVSixdSKe8qxw/edit?usp=sharing) 

Now when we heard a feature like: 

*"Merge private accounts with company accounts so they can (whatever was the argument)"* 

Someone would just grab that piece of paper and remind everyone that that's not the problem we're solving. 

We were done by lunch-time.
Prerender your Angular app, as simple as possible
Tags: prerender, angularuniversal, angular
Published: 2020-10-22 14:53:19

---
title: Prerender your Angular app, as simple as possible
published: true
date: 2020-10-12 17:22:27 UTC
tags: prerender,angularuniversal,angular
canonical_url: 
---

Have you ever wanted a simple static site, but you won’t want to lose Angular in the process? Here’s how you do it.

![](https://cdn-images-1.medium.com/max/738/0*dmYfFJBn25tHGnBi.png)

### Getting started

Make sure your Angular CLI and Angular version is up to date, you can check with ng version, and update with ng update. Version 9+ should do it

![](https://cdn-images-1.medium.com/max/531/1*g048cC98wu9yDfjB7L4PcA.png)<figcaption>My Angular version</figcaption>

### From start to finish

1. Start a new Angular Project using the CLI with ng new
2. Install Angular Universal Express Engine using the CLI ng add @nguniversal/express-engine
3. Add the routes you would like to prerender to the “prerender” -> “routes” array in the angular.json

![](https://cdn-images-1.medium.com/max/528/1*0N6FLEvc8YaX7OpJtxLfLA.png)

4. Prerender the content with npm run prerender . This will generate the prerendered files in “dist” -> MyApp -> “browser”. Note how you have “index.html” with the prerendered content and “index.original.html” with the original copy

![](https://cdn-images-1.medium.com/max/634/1*BRhpiYkZqKVriVcDzjPstg.png)

And that’s it... Bob is indeed my uncle.
Custom Printed Boxes Wholesale
Tags: customprintedboxeswholesale
Published: 2020-10-12 17:22:02

custom printed boxes wholesale are now ubiquitous in our everyday life. These custom packaging boxes are simple to locate, so each modification might be made to them, which suits the innovation and uniqueness of the company’s item. Although the structures of Custom boxes with logo are creative, these wholesale custom boxes could also be imprinted with multiple furnishing and design alternatives to distinguish all such boxes from one another & to make them stand up on their own in the market. For more visit:
https://fastcustomboxes.com/
Being Able to Let Go
Tags: socialskills
Published: 2020-10-12 17:17:14

---
title: Being Able to Let Go
published: true
description: We often see the work we do as our baby, but sometimes, you just gotta let it go.
tags: socialskills
//cover_image: https://direct_url_to_image.jpg
---

One of the harder things to learn in software development is the skill of letting go. We spend hours and hours (and days, weeks, or even years) working on a thing, and we naturally grow attached to it, especially when it is something we are passionate about. 

This is all good to the extent that we often do our best work when we are emotionally invested in it. But it does have a downside, which is that we can be so close to it that this prevents us from seeing its warts. It can also cause us to be protective like the proverbial mother bear with her cubs--to keep everyone else at a distance.

Both of these ultimately lead to having a worse end solution than is possible when we are open to criticism and open to letting others take our work in new and, sometimes, different directions that we personally would not have taken. 

The first aspect--open to criticism--is especially important during the early, formative stages of developing an idea into the artifact. A key way to help be open to such criticism is to, ourselves, try to come up with several significantly different approaches to solving what we are trying to solve, and presenting all of them as impartially as we can to others for their review and criticism. The simple act of creating such multiple alternatives weans us from our babies, so we are more able to accept constructive criticism. We then can synthesize the best of all this into a better solution. This is the essence of the Design process.

The second aspect is important during the main effort to develop the idea into a concrete thing. Especially on larger ideas, it is easy to become a roadblock to needed progress because we think only we have the ability to properly drive to a successful outcome. It is important to remain involved, but it is also important to create space for other persons to carve out some parts of the effort and to really own those parts for themselves. Just as we do our best work when we are invested and have a sense of ownership, so do others. And being overbearing, even with good intent, can sap others' energy and passion. 

It is similarly important to really be able to let go, when we find ourselves needing to move on to other things. When we no longer are as involved or as invested but, because it was "our baby," we sometimes feel the need to retain that protective mother bear stance. That, too, can kill the healthy evolution and ongoing success. This is the final step, in a sense, of making space for others to thrive and contribute. And it is key. That point almost inevitably will come, and we have to be able and willing to take that step of "faith" and entrust our baby to others.
How to add Border Radius to Container in Flutter ? fluttercorner.com
Published: 2020-10-12 17:16:22

Hello Guys How are you all? Hope you all are fine. Today We are going to learn How to add Border Radius to Container in Flutter ?

Many times we need to give Border Radius to Container, so i am going to share my code on on how to add Border Radius to a Container.

How to add Border Radius to Container in Flutter
How to add Border Radius to a Container.

Its Very Simple. Just Add decoration to your container.
use BoxDecoration property in decoration.

BoxDecoration has borderRadius Property.
give specify border radius to your Container.
Here is My Full Source Code.

```
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(
          title: Text("Border Radius to Container - FlutterCorner"),
        ),
        body: Container(
          margin: EdgeInsets.all(100.0),
          decoration: BoxDecoration(
            color: Colors.green,
            borderRadius: BorderRadius.only(
              topRight: Radius.circular(30.0),
              bottomLeft: Radius.circular(30.0),
            ),
          ),
        ),
      ),
    );
  }
}
```

So Guys That’s It For How to add Border Radius to Container in Flutter ? Hope you like our tutorial. Comment below Your thoughts and your queries. And Also Comment below your suggestion here.

Full Source Code at <a href="https://fluttercorner.com/how-to-add-border-radius-to-container-in-flutter/">How to add Border Radius to Container in Flutter ?</a>
How to make a blur Background Image effect in Flutter using BackdropFilter. fluttercorner.com
Published: 2020-10-12 17:13:19

Hello Guys How are you all? Hope you all are fine. Today We are going to learn How to add Border Radius to Container in Flutter?

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

How to make a blur Background Image effect in Flutter using BackdropFilter ? BackdropFilter Widget is used to give amazing ImageFilter effects on Images. it can also use full to use blur background. Just use BackdropFilter to any image child and give it to filter as ImageFilter effect to it. So without Wasting yolur time lets start this article.

How to make a blur Background Image effect in Flutter using BackdropFilter.
How to make a blur Background Image effect in Flutter using BackdropFilter.
First of All Import material.dart in your main.dart file.
import 'package:flutter/material.dart';
Then, Create void main and Define MyApp in your runApp.

```
void main() {
  runApp(MyApp());
}
```

Now, Create a class named MyApp extends with a Stateless widget. This is our main View class. and define

```
class MyApp extends StatelessWidget {
 
}
```

Then, After make Scaffold in MyApp Widget. Scaffold is Base of every flutter apps, Scaffold provide appbar, background color, drawer, body, bottomsheet, etc.

We need center widget in our body so add Center widget in body.

```
class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Blur Image in Flutter - Fluttercorner'),
        ),
        body: Center(),
      ),
    );
  }
}
```

Read Also How to set Background Image to Scaffold in Flutter

Then after we would make Container in Center widget with BoxDecoration and we are going to use DecorationImage in boxDecoration.

```
decoration: BoxDecoration(
    image: DecorationImage(
       image: NetworkImage(
             "https://images.pexels.com/photos/707915/pexels-photo-707915.jpeg"),
            fit: BoxFit.cover),
 ),
```

We are using a Network image as our background.
After That, use BackdropFilter as a child in our main Container.
BackdropFilter has Filter Property give it ImageFilter with blur effect.

```
            child: BackdropFilter(
              filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
            )
```

Boom, now your image has blur effect applied.
Here is My main.dart full source code.

<a href="https://fluttercorner.com/how-to-make-a-blur-background-image-effect-in-flutter-using-backdropfilter/">How to make a blur Background Image effect in Flutter using BackdropFilter.</a>
What is a Model View Controller?
Tags: webdev
Published: 2020-10-12 17:10:57

Let`s have a look at MVC, the Model View Controller. MVC is a design pattern for web applications. It consists of these three components:

1. **Model**: The model holds all the data, state and application logic. It provides an interface to manipulate and retrieve its state. It responds to requests of the View and instructions of the controller. It also informs the View about state changes.

2. **View**: The View receives all the data it needs and displays it in a User Interface. The View can request state information from the model.It also "talks" to the controller by e.g. informing it that the user pressed a button.

3. **Controller**: The controller controls the interactions between the model and the view. It sends instructions to the model to change its state based on what has happened (e.g. pressing a button) and requests the view to change its display.

Have you used the MVC yet?