teleren/devto huggingface dataset:
Building on observability
Tags: observability, monitoring, devops, sre
Published: 2020-11-19 09:48:42

We've been building our product for the better part of two years now. The game-changer for me personally has been building [observability](https://charity.wtf/2020/03/03/observability-is-a-many-splendored-thing/) in right from the start.

We instrument almost everything, so we can ask questions about our system later. This includes collecting events from both our client apps and server APIs. Some real questions we've asked along the way:

- Is it just me, or did our mobile app's boot time just go through the roof? (cause: [third-party API acting up](https://twitter.com/codeflows/status/1157250603099283456))
- Why is the P99 latency of our notification API so high? (cause: data doesn't fit into Postgres' in-memory cache anymore)
- Why is our overall API latency high sporadically? (cause: noisy neighbors on Heroku)

The fact that we can easily ask and answer these questions means that we can fix things quickly, and prioritize technical improvements before things get out of control.

For example, since our team is small, we've been using Heroku to keep operations relatively simple. Heroku has been a great choice for us so far, but our observability tooling reveals the shortcomings of a shared environment such as Heroku. In the screenshot below, we see how a single dyno (i.e. a process on Heroku) goes amok before it's terminated and replaced by a new process:

![The dyno that got away](https://dev-to-uploads.s3.amazonaws.com/i/2ksqndsr9e0fpo5wvs3a.png)

<figcaption>The dyno that got away</figcaption>

Still, Heroku is good enough for us _for now_, and if we decide to jump ship, we have the data to back the decision up.

What tools you end up using is another matter, but we've been happy paying customers of [Honeycomb](https://www.honeycomb.io/) since 11/2018.
How to send an email with the Springboot email application with 9 steps
Tags: springboot, java, rest, security
Published: 2020-11-19 09:48:20

Sending an email is a normal prerequisite for any program. In this post, you can learn how to send e-mails using the Springboot e-mail program. You need SMTP information to send an e-mail to work on this tutorial. You can use Gmail SMTP for sample submission (keep in mind that Gmail has any limits on your email quota). The Spring Framework offers a basic abstraction for sending emails using the JavaMailSender Interface, and the Spring Boot provides an auto-configuration and a starter kit.


 [Find the complete tutorial](https://onurdesk.com/send-an-email-with-springboot-email-application/)
Blog: The day I understood CORS
Published: 2020-11-19 09:45:09

CORS is the kind of bad word I have tried to avoid for years ! Even when I moved to a full-stack position and started to work on webapps, I willingly ignored it. But then, I joined Gravitee.io, and during my first week, I was asked: “Guess what, some people don’t understand a thing about CORS. We could help them a bit by providing more information in the logs”.

I was the perfect tester for that feature ! :-)

I then opened my favorite search engine and read the first results for : “CORS for dummies”. And I decided to make a synthesis of what I learnt.

https://www.gravitee.io/article/the-day-i-understood-cors
npx bsconfig.json
Tags: reason, rescript, ocaml
Published: 2020-11-19 09:44:15

---
title: npx bsconfig.json
published: true
description: Instantly create a bsconfig.json file in your project
tags: reasonml,rescript, ocaml
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/q5oiit8tnhh95gsm7d34.png
---

# bsconfig.json

I've been annoyed by writing or createing new `bsconfig.json` files for projects that may not have started out as `reasonml` or `ocaml` projects, especially when using `reason-apollo-client` and `graphql-ppx` projects. So, inspired by the greate [@benawad](https://twitter.com/benawad) who teaches at [youtube/benawad97](https://www.youtube.com/benawad97) and his [tsconfig.json](https://github.com/benawad/tsconfig.json) project, I created myself this utility. Check it out if you are like me and just want to remove the friction of creating a new `bsconfig.json` file.

Run `npx bsconfig.json`.

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

[idkjs/bsconfig.json](https://github.com/idkjs/bsconfig.json/blob/master/README.md)
Roost: Desktop/cloud-based cloud-native application collaboration & health platform
Tags: roost, kubernetes, cloudnative
Published: 2020-11-19 09:40:56

Roost is a desktop/cloud-based cloud-native application collaboration & health platform. Developers struggle to learn or migrate to Kubernetes; this will help them get-going the moment they have it installed. 

They can just signup on https://roost.io and download the product.

Developer to developer collaboration: Simplify your multi-developer workflow around coding and testing using Roost collaboration.
A multi-node Kubernetes cluster: to make developers' life more comfortable, and bring them close to the production environment.
Development environment: A complete Kubernetes ecosystem/tooling on one-click options.
Service health and analytics: Monitor the health of your services.
Service change management automation: Manage your micro-service changes/versions in a better way.
Team/Enterprise Dashboard: Get your team productivity insights (number of collaborations, number of image scans, dependent service development efficiency)

learn more at https://roost.io
What is encapsulation in C++?
Published: 2020-11-19 09:33:40

What is encapsulation in C++?
Encapsulation in C++ means binding of data with the functions that performs actions on that data. Encapsulation keeps us safe from outside interference and misuse. And that led us to the important concept of OOP which is data hiding. Encapsulation is used to hide the values or state of a structured data object inside a class, preventing the interference with them.

 

Data hiding
Data hiding is also a concept of Object Oriented Programming (OOP) that hides details of internal objects. 
The belief behind data hiding is to conceal data within a class, so it can be prevented or protected to be accessed by the outside class. Data hiding helps us to create classes with unique data sets and functions by avoiding unnecessary penetration from other program classes.
There is a slight difference between data hiding and data encapsulation, data hiding hides only class data elements, whereas data encapsulation hides class data parts and private functions/methods.
Gradle plugin to deeply hide secrets keys on Android
Tags: android, security, gradle, kotlin
Published: 2020-11-19 09:31:56

Hello community! We are looking for feedbacks on the gradle plugin we have created : [hidden-secrets-gradle-plugin](https://github.com/klaxit/hidden-secrets-gradle-plugin) 🙏

This plugin allows any Android developer to deeply hide secrets in its project. It is an open source equivalent of what [DexGuard](https://www.guardsquare.com/en/products/dexguard) can offer to prevent **credentials harvesting**.

It uses a combination of obfuscation techniques to do so :
- secret is obfuscated using the reversible XOR operator so it never appears in plain sight,
- obfuscated secret is stored in a NDK binary as an hexadecimal array, so it is really hard to spot / put together from a disassembly,
- the obfuscating string is not persisted in the binary to force runtime evaluation (ie : prevent the compiler from disclosing the secret by optimizing the de-obfuscation logic),
- optionally, anyone can provide its own encoding / decoding algorithm when using the plugin to add an additional security layer.

This plugin is **used in production** at [Klaxit - Covoiturage quotidien](https://play.google.com/store/apps/details?id=com.wayzup.wayzupapp). Our engineering team at Klaxit will provide its best effort to maintain this project.

⚠️ Nothing on the client-side is unbreakable. So generally speaking, **keeping a secret in a mobile package is not a smart idea**. But when you absolutely need to, this is the best method we have found to hide it.

For all implementation details, please visit the github repository : [hidden-secrets-gradle-plugin](https://github.com/klaxit/hidden-secrets-gradle-plugin) 😇
2nd Elimination. Open to more fights. Week almost done.
Tags: opensource
Published: 2020-11-19 09:19:25

Yep, 2nd post of the day. Hey yall, whaddddupppp! As you guys can already guess it, it's my 2nd post of the day. Why 2 posts at once you ask? Reading the first one will answer lots of questions. I'll be talking about what type of PR I did for my 2nd PR. So, without further due, let's dive into the blog post.

Before I started working on the 2nd PR, I had a few important things on my mind.  First, the PR should be related to my coursework for this sem. I did not want it to be out of my knowledge scope. Secondly, I wanted it to be more towards testing. When I saw the issue and what it wanted, I got super happy because of it. The things I wanted are perfectly right in front of me. So, I recommended myself to be a part of their team and fix up the issue they found.

During the fix, I had an issue pop up. The issue at first seemed sudden, but as time went out to figure what is going on, I found the answer by researching numerous blogs and sites. It was an error with installing packages, so I removed them entirely and re-installed them. That fixed everything that was asked for. Very happy that I dealt with similar types of issues during my school hours.

I am open to more options now. I am looking forward to seeing what type of more work I will be assigned. This week is almost done and it's going accordingly to my schedule, which is a super feeling. I am thinking of taking a one day break around next week, that way I can strengthen my personal relationships. About 3 more weeks left for this semester and finals. Really looking forward to that. Hopefully, I get to finish up everything before my finals. Lol, don't want to mess up my finals, predicting high marks this time. Oh, the links to the issue and the PR will be given at the end of this blog.


I would like to thank you for reading this whole blog post. Thank you. I will be updating daily as usual so please don't stop reading and keep your eyes open for my daily blog posts. Thank you for your time and I will be back next time when I have enough to talk about on my developmental journey.

Link-

[PR](https://github.com/Hylozoic/hylo-node/pull/561)

[Issue](https://github.com/Hylozoic/hylo-node/issues/558)
map() method explained : JS
Tags: javascript, webdev, 100daysofcode, java
Published: 2020-11-19 09:18:08

JavaScript methods are actions that can be performed on objects. So here is my new blog post I will cover the two  JavaScript methods `map()` and `filter()`. Will explain easily and in detail. 

<hr>

# map()
-> The `map()` method is used to apply a function on every element in an array and then return a new array. 
Let's take a look at the syntax:-

```javascript
let newArray = array.map( (v, i, a) => {
    // return element to newArray
});

// newArray - the new array that is returned
// array - the array to run the map function on
// v - the current value being processed
// i - the current index of the value being processed
// a - the original array
```
The `map()` method can be thought of as for loop, that is specifically for transforming values. Let's take a look at this example: 

```javascript
let nums = [11, 12, 13, 14];
let minus10 = [];
for(let i = 0; i < nums.length; i++) {
    minus10[i] = nums[i] - 10;
 }
```

The code results in a new array where each value of the old array is reduced by 10. Yes, it works, but there is an easier way to achieve the same result.  

Now let's rewrite the previous function using the `map()` method. 

```javascript
let nums = [11, 12, 13, 14];
let minus10 = nums.map(value => value - 10);
  // minus10 = [1, 2, 3, 4]
```
> Just see. Without any loop

And using the arrow function we have a nice and clean function to create the same array. Because we only use the value, we only pass that to the `map()` method. 

Here in this example, we'll utilize both the value and index arguments. 

```javascript
let nums = [11, 12, 13, 14];
let newArray = nums.map( (v, i) => {
  return {
     value: v,
     index: i
   };
});

// newArr = [
// {value: 11, index: 0},
// {value: 12, index: 1},
// {value: 13, index: 2},
// {value: 14, index: 3}
//   ]
```

I think now you are seeing that whatever we return within the `map()` method is used to create the new array. You can use the current value, current index or even the entire array to determine what to return. 

<hr>
You could even do something stupid like this 😂😁 below and just return a static string : 

```javascript
let nums = [11, 12, 13, 14]; 
let cats = nums.map ( ( ) => 'cats');
 // cats = [`cat`, `cat`, `cat`, `cat` ]
```
<hr>

Till here, all the examples have transformed all of the values in the old array. Let's look at a way to transform some of the values in our array. 

```javascript
let nums = [11, 12, 13, 14]; 
ley newArr = nums.map(v => v % 2 === 0 ? v * 2 : v);
  // newArr = [11, 24, 13, 28];
```
First, we checked if the value divided by two has a remainder of zero. If the remainder is zero we'll return v * 2 or double the current value. 

<hr>
I'm done. Thanks For Reading 😀😀
First Seen [Here](https://rahulism.co/map-method-explained-js)
Local Variables
Tags: cpp, beginners, computerscience, oop
Published: 2020-11-19 08:57:53

---
title: Local Variables
published: true
description: Declaring and Initializing Variables
tags: cpp, beginner, computerscience, oop 
cover_image: https://images.unsplash.com/photo-1534713295860-66cf9b9bc3d1?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2167&q=80
series: Programming 101 with C++
---

# Variables in C++ have a type. 
* C++ is a type safe language, i.e., it enforces your decisions around types.
* string, number, date, Employee, etc.
* some types, like int, are **built into the language**
* some are **user-defined** -  some "users" are actually library writers

# Declaration and Initialization
* Variables must be declared (type + name) before they are used.

> int limit;

where int is the type and limit is the variable name.

* built in types are not initialized
* user-defined types might be

**Best Practice:** declare and initialise at once.

> int limit = 100;

If you make it a habit to always initialise variables with declaration, you can **rely on the compiler to figure out the appropriate type** to keep the value in.

> auto x = 7; // x is an int

* C++ is a **strongly-typed** language.

Please leave out comments with anything you don't understand or would like for me to improve upon.

Thanks for reading!
Search Data From Database In Codeigniter With Example
Tags: codeigniter, php
Published: 2020-11-19 08:56:54

This tutorial is search data from database in Codeigniter based on CodeIgniter and Bootstrap design and other designs I share with you how to display data from database in PHP using Codeigniter. When we want to retrieve a record filtered by a keyword, we have to use the search function. we have to search for all records to get the needed one record. So, here I will explain to you how to display data from database in Codeigniter simple search button.

**[Search Data From Database In Codeigniter With Example](https://www.phpcodingstuff.com/blog/search-data-from-database-in-codeigniter-with-example.html "Search Data From Database In Codeigniter With Example - phpcodingstuff")**

**Controller**

```
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
 
class Searchcontroller extends CI_Controller {

  public function searchfunction()
		{
			$data['searchdata']=$this->Search_Model->GetSearchdata();
			$this->load->view('search',$data);
		}
}
```


**Model**

```
<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Search_Model extends CI_Model {

public function GetSearchdata()
	{
		$this->db->select("*");	
		$this->db->like('tutorial_name',$this->input->get('search'));
		$query = $this->db->get("tutorial_name"); 
		return $query->result();
	}
}
```
Making Money As A Web-Developer.
Tags: freelancer, webdev, html, dev
Published: 2020-11-19 08:56:16

Reading this, you are probably a web- developer, or you are learning to be one. Regardless you want to make some extra cash with web development, especially now, with this pandemic closing down business. In this article, I will reveal ways to make money as a web-developer!

Friends and Family
The first thing I'd recommend is to ask your friends and family members if they need a website for their business. Granted, you probably will not charge them anything or for a low cost, but this will give you client experience and potentially your first review. Get a friend or family member to hire you on Upwork and ask them to leave a review. This will help you out in your freelancing journey since clients will trust you more.

Freelance
The most popular way to make extra cash as a web-developer is to start freelancing. There are a lot of freelancing platforms out there; I'd recommend Upwork, especially for beginners.

Here are some other popular freelancing sites:

*Freelancer.com
*Fiverr
*Toptal

After signing up and setting up your profile, I'd recommend checking out my other article. Where I talk about essential tips to keep in mind while bidding on a project. Read Now...

Templates
In your free time, you can create a ready to use template or two. Then you can sell that template to your local business. This won't always work, and there is a 1/20 chance the business will actually buy your template. But it's worth giving it a try.

Reaching out to business
You can also find a business with outdated websites (information and technology-wise) and offer the business to update their website for an affordable price. You can also try to make a website for a business then show the business the website, and if they like it, they will buy it. This will take time and patients and might not give you a sale, but I will provide you with the experience and something else to put on your portfolio.

Those are some tips that make me an extra buck or two. These methods won't make you a millionaire but will give you some extra cash and work experience!

Missed something out? Comment it.

Stay safe and don't forget to wear a mask 😷.
❎❓Quiz: Web Performance #19
Tags: challenge, webperf, webdev, quiz
Published: 2020-11-19 08:52:05

Why are 16ms for each task, not the single truth?

What time in ms should you aim for animations in the real world rather than the 16ms?

- 10 ms
- 20 ms
- 12 ms
- 8 ms

---
<center>[Answer the question](https://marcradziwill.com/web-performance-quiz/what-time-in-ms-should-you-aim-for-animations-in-the-real-world-rather-than-the-16ms/)</center>
---
How I can replace an acroform PDF field with text using PHP
Tags: help, php, pdf
Published: 2020-11-19 08:52:05

I have a PDF using AcroForm. I want once the form is filled to replace the form with the fixed value. My reason is that I want to autofill a PDF then send it to an another person via mail without being able the one that opens it be able to edit it.


So I want to ask how I can either lock an Acroform PDF form so it can be prevented from editing or how I can replace the acroform field with its value.
2020-11-18 | Thoughts about Daily Diary
Tags: learninpublic, beginners, webdev, career
Published: 2020-11-19 08:41:33

---
title: "2020-11-18 | Thoughts about Daily Diary"
description: "Summary of my day"
published: true
tags: ["LearnInPublic", "Beginners", "Webdev", "Career"]
series: "miku86 Diary"
canonical_url: "https://miku86.com/blog/day-2020-11-18"
---

This is meta.

On dev.to I have 12.700 followers. Since starting the [daily diary](https://dev.to/miku86/series/9516), the number _decreased_.
Each post has some 30-50 visits.

Looking at this, I ask myself some questions:

- Should I care?
- Is the content "useful" or "useless"? Does it matter?
- Do people care more about my old stuff, mostly tiny tutorials? Is this something I want to contribute to - "tutorial hell"?
- Is the habit more valuable than the actual content?

A lot of questions.

To answer them, I need to get in contact with my core values. Why do I even write this daily diary?
Don't Write Admin Panel for Small Website, Generate it
Tags: webdev, wordpress, node, javascript
Published: 2020-11-19 08:40:33

Creating admin panel for small website is an expensive thing. Each site has a different structure, and it needs different admin sections. This site has a news section, that doesn't. This site has a landing page with five texts, that site has only one image there. Familiar?

⏩ [Read the rest of the article here...](https://t3mpl.n4no.com/docs/dont-write-admin-panel-for-small-website/)
Integrating TailwindCSS with React in 3 simple steps!
Published: 2020-11-19 08:39:01

In this article I'll demonstrate how you can integrate TailwindCSS in React and also, how to purge unused CSS at the end. Let's begin!

#### Step 1: Adding TailwindCSS to your project

cd into your project directory and use the following command to install TailwindCSS:
`$ npm install tailwindcss`

#### Step 2: Adding a build script

Open your `package.json` and add the following line in scripts:
```javascript
"build:style": "tailwindcss build src/tailwind.css -o src/tailwind.output.css",
```

and, modify the `start` script to this:
```javascript
"start": "npm run build:style && react-scripts start",
```

Your final scripts should look like the following:
```javascript
"scripts": {
    "build:style": "tailwindcss build src/tailwind.css -o src/tailwind.output.css",
    "start": "npm run build:style && react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
```

Now, create a new file called `tailwind.css` in your `src` directory and add the following lines:
```css
@tailwind base;
@tailwind components;
@tailwind utilities;
```

Finally import `tailwind.output.css` in your `index.js` file:
```javascript
// index.js
import './tailwind.output.css';
```

#### Step 3: Purging unused CSS

To purge the unused css and consequently reducing the total size, we will need to create a new file in the root directory of our project named `tailwind.config.js` and add the following lines of code in it:
```javascript
module.exports = {
  purge: [
    'src/**/*.js',
    'src/**/*.jsx',
    'src/**/*.ts',
    'src/**/*.tsx',
    'public/**/*.html',
  ],
  theme: {
    extend: {},
  },
  variants: {},
  plugins: [],
}
```
**Note:** You'll also need to have the environment variable `NODE_ENV` set to `production` in order for purging to work.

And that's how you can add TailwindCSS to your React project in just **3** simple sreps!

---

If you made it so far, kudos to you! Be sure to leave your tips and suggestions down below in the comments!