teleren/devto huggingface dataset:
Alternate Middleware Option for Java: Background
Published: 2021-07-22 19:11:03

######*This is the part-1 of the Alternate Middleware Option series*....

I will be talking about my recent 6th semester team project here, **"The Middleware Opensource Option/s"**.

The **objective** of the project was to explore the best alternate middleware for Java. Now, exploring for us was to choose the possible best language amongst the few good ones.
So I told my teammates to come up with 1 or 2 languages along with their respective features, advantages and disadvantages. Some of the **top features** included were the; *security*, *purpose*, *scalability*, *use-cases*, *availability of libraries*, *community support* and of course the *ease*. Once we were done with this, we started to analyze and compare the languages one by one based on the **KPI** (Key Performance Indicators) mentioned above.
When it was **Python's turn** to be compared and analyzed, we had the following *observations*:
1) Python's **security** is good enough.
2) It's **dynamic semantics** makes it more intuitive.
3) As it is an **interpreted language**, the debugging is easier here. But nothing comes for free, the easy debugging comes at the cost of speed.
4) But still what makes an interpreted language so great is it's **portability**.
5) We all know that Python is a *trending language* and so we tried finding out some *top reasons* for this which are as follows:
Main reason behind Python's popularity is the amount of **use-cases** it has in various domains like the AI/ML, Data Visualization, Web Development etc.
And why it has so many use-cases is because it's a **general purpose language** (it's not domain specific language). It is **readable**, it is **versatile** as it comes with tremendous amount of in-built **libraries**.
And of course, such a popular programming language would definitely have the greatest **community support** out there. Some of the popular ones are: *StackOverflow*, *Dev Community*, *Reddit*, *Quora*, *StackExchange* etc.

So these were some of the initial and important factors that made us choose **PYTHON**.
No technology can get a 100% replacement, because it has it's own standard and status in the market. But that doesn't mean one can not have an alternative...
Everything in the industry or the market will have at least one good alternative for it, it can be better than the existing one or can have close features to the existing one.

###Some questions that we had during this part of the project:

**1) Why to find alternate for Java, when it is so brilliant in almost all sense??**
**->** Because Java is no more free for production use. The organization needs to pay for the current version of Java SE 14.

**2) What is a Middleware??**
**->** Middleware is like the bridge in between the Frontend, the backend and the Operating System. It is a software that provides common services to the applications beyond what's offered by the OS. It's like the connective tissue between the application, the data and the user. It runs between request-response cycle (between the client and the webserver).
CSS Grid vs Flexbox - What is the difference?
Tags: css, ui, beginners
Published: 2021-07-22 19:07:02

---
title: CSS Grid vs Flexbox - What is the difference?
published: true
description: CSS, grids, flex, flexbox
tags: css, UI, beginners
//cover_image: https://res.cloudinary.com/drda5zneo/image/upload/v1626978711/images_2_7_jyidxi.png
---
The internet is made up of over 1.7 Billion web pages with different page layouts. Technology  nowadays is responsive to any screen orientation or dimension of the screen in our devices. Making page layout comes in handy with the use of Cascading Style Sheet also refers to as CSS. CSS is one of the cornerstones of the web. More like the flesh covering the bones of the body. It is easy to understand and there are lots of resources available on how to use this amazing piece of technology.

>So how is this related to our topic? 

CSS is use to design layout and the appearance of those web pages but creating multi-layouts is a huddle for beginners who intend to create project with that feature. 
To solve these complications, Devs invented proper responsive layout models available natively in the browser, out of which - Flexbox, CSS Grid and Bootstrap became most popular and are widely supported across all platforms & browsers. 
I will try to strike the difference between CSS Grid and Flexbox fundamentals and probably  when to use which layout. 
![Alt text of image](https://res.cloudinary.com/drda5zneo/image/upload/v1626978735/images_2_6_zdy52t.png)
1. CSS Grid: This is a two-dimensional grid-based layout system with rows and columns, making it easier to design web pages without having to use floats and positioning. Like tables, grid layout allow us to align elements into columns and rows.
To get started you have to define a container element as a grid with <code>display:grid</code>, set the column and row sizes with <code>grid-template-columns</code> and <code>grid-template-rows</code>, and then place its child elements into the grid with <code>grid-column</code> and <code>grid-row</code>.

2. Flexbox: The CSS Flexbox offers a one-dimensional layout. It is helpful in allocating and aligning the space among items in a container (made of grids). It works with all kinds of display devices and screen sizes.
To get started you have to define a container element as a grid with <code>display: flex;</code>

>What is the line of divide between these two? 

a. CSS Grid Layout is of two-dimensional , that means it can handle columns and rows, not like flexbox that is basically a one-dimensional.
b. A core distinction between CSS Grid and Flexbox is their approach — CSS Grid’s 
approach is layout-first whereas Flexbox’ approach is content-first.
c. The Flexbox layout is best suited to application components and small-scale layouts, while the Grid layout is designed for larger-scale layouts that are not linear in design.
d. CSS Grid deploys fractional measure units for grid fluidity and auto-keyword functionality to automatically adjust columns or rows.
Append a new User-Agent to WKWebview in iOS
Tags: ios, wkwebview, useragent
Published: 2021-07-22 18:56:39

Sometimes we need to pass another user-agent when opening a URL in the WkWebView, so here how to do it in iOS app:

```obj-c
[_wkWebView evaluateJavaScript:@"navigator.userAgent" completionHandler:^(id result, NSError *error) {
        NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"];

        NSString *userAgent = [result stringByAppendingFormat:@" %@/%@",@"Custom User Agent",version];
       
        [self.wkWebView setCustomUserAgent: userAgent];
        
        [self.wkWebView loadRequest:request];
}];
```
🧩 Creating an HTTP API with Ktor and Kotlin
Tags: kotlin, ktor, programming
Published: 2021-07-22 18:37:33

#### [Ktor](https://ktor.io/docs/welcome.html) is a modern web #framework developed by JetBrains. The library is written in Kotlin and takes advantage of coroutines to build asynchronous and non-blocking services. Explore the details of a simple Ktor application exposing an HTTP API. 

### <br>
To demonstrate Ktor we'll build a simple HTTP API exposing three endpoints: 

* `/api/messages/public`
* `/api/messages/protected`
* `/api/messages/admin`

We'll build this API over the course of three posts. In this first post, we'll build the HTTP API and provide public access to all endpoints. In the second post, we'll update the API to require a valid access token to query the `protected` and `admin` endpoints. Finally, in the third post, we'll implement Role-Based Access Control (RBAC) by requiring special permissions to query the `admin` endpoint.

In subsequent posts, we'll access this API via a [frontend application](https://github.com/auth0-sample-gallery/spa_react_javascript_hello-world), written for Node.js, which understands how to call the three endpoints listed above.

## The Sample Application Code

To build the backend application, you'll need to have JDK 11 or above, which is available from many sources, including [OpenJDK](https://openjdk.java.net/install/), [AdoptOpenJDK](https://adoptopenjdk.net/), [Azul](https://www.azul.com/downloads/), or [Oracle](https://www.oracle.com/au/java/technologies/javase-jdk11-downloads.html).

The final code for the Ktor application can be found [here](https://github.com/mcasperson/Auth0Ktor). The code discussed in each post is matched by a branch:

* [starter](https://github.com/mcasperson/Auth0Ktor/tree/starter) &mdash; the base API with no authentication or authorization. This branch is discussed in this post.
* [add-authorization](https://github.com/mcasperson/Auth0Ktor/tree/add-authorization) &mdash; the API requiring a valid access token for the `protected` and `admin` endpoints.
* [add-rbac](https://github.com/mcasperson/Auth0Ktor/tree/add-rbac) &mdash; the API requiring special permissions to access the `admin` endpoint. 

The frontend application code can be found [here](https://github.com/auth0-sample-gallery/spa_react_javascript_hello-world).

[Read more...](https://auth0.com/blog/creating-an-http-api-with-ktor-and-kotlin/?utm_source=content_synd&utm_medium=sc&utm_campaign=kotlin)
Koncrete Construction-Multipurpose Premium HTML5 Website Template
Tags: construction, robotics, engineering
Published: 2021-07-22 18:37:12

https://www.templatemonster.com/website-templates/koncrete-construction-multipurpose-premium-html5-website-template-190201.html?_gl=1*14ivmvd*_ga*MTk0NDM0MjU4Ni4xNjI1ODYxNjc0*_ga_FTPYEGT5LY*MTYyNjk3NzQ1Ni41OC4xLjE2MjY5Nzg2MzYuNjA.&_ga=2.136578416.1769001420.1626160868-1944342586.1625861674

Koncrete Construct –it is clean It is very suitable for building, architecture, company, corporate, electricity, engineering, industry, interior, isolation, maintenance, painting, projecting, renovation, mechanic, transport etc . It is great, professional and easy to use It is also suitable for industrial business
Helm Charts, with or without Kustomize
Tags: kubernetes, helm, kustomize
Published: 2021-07-22 18:33:47

I've recently read [an interesting blog about using Helm together with Kustomize](https://jfrog.com/blog/power-up-helm-charts-using-kustomize-to-manage-kubernetes-deployments/). 

Though it provides good information such as the difference between Templates (via Helm) vs Overlays (via Kustomize), I would argue that, in a real deployment, the same effect can be achieved with Helm alone without the extra complexity of Kustomize.

To avoid repeating the details in the original blog, I just provide the files to simulate the approach used by the original blog here: https://github.com/langyizhao/helm-charts-with-or-without-kustomize/tree/master/with-kustomize

The distilled bare minimum steps are:
1. `kustomize build`
2. `helm template`
3. `kubectl apply -k`

3 steps are actually not too bad. The major clutter is the introduction of the temporary folder and temporary template files and the easily-confusing order of applying overlays.

So how do we achieve the effect of overlays by just using templates? We will need some logic when drafting the template. Fortunately the Go template language under the hood of Helm charts easily support such trivial logic and some non-trivial ones.

One possible implementation is:
```
# from without-kustomize/templates/pod.yaml
{{- if and .Values.employeeName .Values.employeeDepartment }}
    args: ["/bin/echo My name is {{ .Values.employeeName }}. I work for {{ .Values.employeeDepartment }} department. Our company name is {{ .Values.companyName}}"]
{{ else }}
    args: ["/bin/echo Hello! My company name is {{ .Values.companyName }}"]
{{ end }}
```
In this case we will only render the complex form when the necessary values exists in the values.yaml file provided by our customer and safely default to the simple form when they are missing.

No pre or post rendering needed and Helm alone handles everything.

Feel free to check the simple examples out and try it yourself:
{% github langyizhao/helm-charts-with-or-without-kustomize %}
Koncrete Construction-Multipurpose Premium HTML5 Website Template
Published: 2021-07-22 18:33:15

https://www.templatemonster.com/website-templates/koncrete-construction-multipurpose-premium-html5-website-template-190201.html?_gl=1*14ivmvd*_ga*MTk0NDM0MjU4Ni4xNjI1ODYxNjc0*_ga_FTPYEGT5LY*MTYyNjk3NzQ1Ni41OC4xLjE2MjY5Nzg2MzYuNjA.&_ga=2.136578416.1769001420.1626160868-1944342586.1625861674

Koncrete Construct –it is clean It is very suitable for building, architecture, company, corporate, electricity, engineering, industry, interior, isolation, maintenance, painting, projecting, renovation, mechanic, transport etc . It is great, professional and easy to use It is also suitable for industrial business

Building Architucture and construction and Renovation Services. Koncrete has beautiful and unique design that will be best suited for your online web presence. It has 100% responsive design and tested on all major handheld devices.

Koncrete comes with necessary features for your online presence like Projects and Project Detail, About Us, Services and Services Details and Blog and Shop pages etc. Koncrete can be a great choice for your online presence.
Realtime express chat in 2021
Tags: javascript, react, opensource, github
Published: 2021-07-22 18:29:04

Did you like realtime chat, messengers? Are you using such platforms as Skype, Zoom, or Slack? Would you like to have a similar application written on Javascript / React js?
Then this application is for you!

### Capabilities
Your conversation will not be saved in any database and will be deleted once you exit the chat or just refresh the page.
An option to Create / Update / Delete General and Password protected rooms
Administrators can ban a user
Sending Emojis

### Links
[Github Repo](https://github.com/huseyn0w/Realtime-Chat)
[My Linkedin](https://linkedin.com/in/huseyn0w/)
[Demo](https://huseyn0w-realtime-chat.herokuapp.com)

Like it? Please star the project and share it in return ;)
EuroPython 2021: Data Science Mini-Conference
Tags: europython, conference, keynotes
Published: 2021-07-22 17:45:24

It has become a tradition at EuroPython to include a special data science track. This year, we have expanded on the theme and included more data science related content than ever before, including keynotes and workshops -- our own [EuroPython Data Science mini-conference](https://ep2021.europython.eu/events/data-science/) which includes:

* 37 Talks
* 9 Workshops
* 2 Keynotes
* 2 Interactive Sessions
* 1 Poster

[Tickets are still available]https://ep2021.europython.eu/registration/buy-tickets/) through our online shop and will be throughout next week.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8uo0twxm24qfgpxah1xv.png)
 
## Data Science Keynotes
We would like like to highlight our data science keynotes on Thursday:

### Claudia Comito: [Connecting Communities: the Helmholtz Analytics Framework and the making of Heat](https://ep2021.europython.eu/talks/keynote-3-connecting-communities-the-helmholtz-analytics-framework-and-the-making-of-heat/)
> HPC, Scientific Big Data, co-design, Python: beneath the buzzwords, bringing together academics from the most disparate research fields to work on a common product is no easy feat. What worked, what didn't, and lessons learned from the Helmholtz Analytics Framework experience.

### Dr. Kimberly Arcand: [Our Universe through Sight, Sound & Touch](https://ep2021.europython.eu/talks/keynote4-our-universe-through-sight-sound-touch/)
> Information of our Universe doesn't have to be just a two-dimensional snap shot. We can transform these data to be able to listen, feel, or (virtually) move through cosmic objects.  Listen to the debris from an exploded star, walk through the core of our Milky Way in virtual reality, feel vibrations of a stellar nursery, and experience our universe anew.

For full information, please check our [Data Science @ EuroPython 2021 page](https://ep2021.europython.eu/events/data-science/), which lists the complete data science program.

Access to the data science parts of the conference is part of our regular conference tickets. If you want to participate in the data science content, please obtain a combined ticket.

Enjoy,
[EuroPython 2021 Team](https://ep2021.europython.eu/europython/team/)
[EuroPython Society](https://www.europython-society.org/)
[EuroPython 2021 Website](https://ep2021.europython.eu/)
Embedding the formatting of currencies, dates and much more in i18next
Tags: webdev, i18next, javascript
Published: 2021-07-22 17:45:07

Formatting currencies is a common problem. Let's say you are working on a website that supports multiple language, and is active in multiple countries. One of the problems that you will face is formatting an amount with a currency in a string that contains text. Example:

```
En: This will be $7.99.
Fr: This will be 7,99$.
```

## Valid solution

One way of solving this problem is to have 2 distinct processes and call them one by one:

```ts
const amount: number = 7.99;
const formattedAmount = toCurrency(amount);
t("This will be {{ amount }}", { amount: formattedAmount });
```

This solution valid, but it could be nice to delegate this boilerplate to `i18next`.

## i18next solution

Interpolation in i18next accepts a [`format`](https://www.i18next.com/translation-function/formatting) function that can be implemented to handle formatting.

In your configuration:

```ts
interpolation: {
  escapeValue: false,
  // Add this line
  format: (value, format) => (format === "currency" ? toCurrency(value) : value),
},
```

Then, in your code:

```ts
t("This will be {{ amount, currency }}.", { amount: 12 })
```

This should format the currency properly.
how to achieve this r equirement in angular version 2.0 and above version 
Tags: angular
Published: 2021-07-22 17:35:50

Create the above sample webpage, the left panel contain slides of different colours, you can have your own fixed set of colours for creating the slides (minimum – 4 slides). The right panel contains sketches / images (minimum – 4), you can use any decent images of your choice.

User should be able to drag n drop any slide of his choice from the left panel to the playbook area and he /she should also be able to drag n drop the any sketch / image from the right panel over a slide in the play area. User should not be able to drag n drop the images from right panel directly to the play area.
Introduction to Variables in CSS🔥
Tags: css, javascript, webdev, vscode
Published: 2021-07-22 17:04:42

Complex websites have very large amount of CSS, often with a lot of repeated values. For instance, we have same color value used in multiple files, searching it globally and replacing would be a big cost, instead we can use CSS variables to store repeated values at one place and reference them where ever it's required. 

## What is :root ?    
:root is a [CSS pseudo-class](https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes) which is considered equivalent to `<html>` in HTML, referring to the entire document. We declare variables inside `:root` and can use everywhere. Variables are referred by double hyphens signature `--main-color: hotpink`
```
:root {
  --main-color: hotpink;
}
```

## Referencing a variable
Once a variable is set in `:root`, we can easily access it with in any selector using `var` function as below:

```
:root {
   --main-color: orange;
}

.some-other-class {
   background-color: var(--main-color);
}
```

Declaring a variable inside `:root` simply means we can access the variable within any CSS selector, as `:root` is considered to be the top most parent for all selectors, just as `<html>` for all other tags in HTML. Similarly, we can define the variable inside any other selectors too:

### HTML
```
<!-- first  element -->
<div class="first-parent">
    <div class="first-parent__child">First child text</div>
</div>
<!-- /first  element -->

<!-- second  element -->
<div class="second-parent">
    <div class="second-parent__child">Second child text</div>
</div>
<!-- /second  element -->
```

### CSS
```
.first-parent {
  --main-color: orange;
}
.first-parent__child {
  background-color: var(--main-color);
}
.second-parent__child {
  background-color: var(--main-color);  /* this won't work */
}
```

What above shows is that `--main-color` can be referenced only within selectors which refers to either `first-parent` itself or it's children tags, and not outside `first-parent` tag.

That's it for today 🎉. Would love to hear your thoughts, and do share me how often you embrace the power of CSS variables in your projects. Stay tuned 👋
Engineering Productivity & Culture at Netflix w/ Kathryn Koehler
Tags: productivity, engineering, culture, data
Published: 2021-07-22 16:49:51

What is it like to work at Netflix as a developer? How do they think about culture, their customers and engineering productivity? 

In this incredible episode of [Dev Interrupted](https://devinterrupted.com/podcast/engineering-productivity-culture-at-netflix/), we bring in Kathryn Koehler, the Director of Productivity Engineering at Netflix, to chat about what makes Netflix so unique and why they are standardizing data-driven engineering today.
#**Listen to the full episode**
{% spotify spotify:episode:0cQVpceM7vvzdzxeN31JMB %}

#**Episode Highlights include:**
* How Netflix measures productivity
* Netflix's approach to company culture
* The "restaurant" approach to [engineering productivity](https://linearb.io/blog/engineering-productivity/)
* Standardizing data-driven metrics

{% youtube 9t9cmftftbs %}

#**Join the Dev Interrupted Discord Server**
With over 1200 members, the Dev Interrupted Discord Community is the best place for Engineering Leaders to engage in daily conversation. No sales people allowed. [Join the community >>](https://discord.gg/devinterrupted)
![Join the Dev Interrupted Discord Community!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/19j3dzgz4r4kzav3w6z8.png)
Sparrow plugin to convert markdown to pdf
Tags: pdf, markdown, tools, raku
Published: 2021-07-22 16:19:03

---
title: Sparrow plugin to convert markdown to pdf
published: true
description: How to convert markdown text to pdf using Sparrow
tags: pdf, markdown, tools, raku
//cover_image: https://direct_url_to_image.jpg
---

Hi! Sparrow is a wonderful framework allows you to do all sorts of automation. Recently I've released a couple of new plugins to convert markdown text to pdf.

This could be quite handy if you keep your CV in markdown format as [me](https://github.com/melezhik/cv), and then want to convert it into pdf for recruiters.


---

Here is a simple example of Raku code:

`.tom/markdown-to-pdf.pl6`:

```perl
my %state =  task-run "readme html", "text-markdown", %(
  file => "README.md"
);

"README.html".IO.spurt(%state<html>);

say "<README.html> updated";

task-run "html-to-pdf", "weasyprint", %(
  in => "README.html",
  out => "Aleksei Melezhik CV.pdf"
);

say "<Aleksei Melezhik CV.pdf> updated";
```

And how to run it:

```bash
[root@bdcaf22ac901 cv]# tom  markdown-to-pdf
[repository] :: index updated from file:///root/repo/api/v1/index
[readme html] :: convert README.md, write to /root/.sparrow6/tmp/698215/out.html
<README.html> updated
[html-to-pdf] :: stderr: ++ weasyprint README.html 'Aleksei Melezhik CV.pdf'
[html-to-pdf] :: <empty stdout>
<Aleksei Melezhik CV.pdf> updated
```

---

The plugins require some CPAN and pip modules under the hood ( if one reads about Sparrow - it's super good in gluing things ), but an end user should not worry about that, the mentioned code should work as is, Sparrow will take care about dependencies.

I'd like users would tell me what they think about this tool.

Thanks

Alexey