teleren/devto huggingface dataset:
How to inherit from lambdas?
Tags: cpp, programming, oop
Published: 2021-10-13 21:57:31

What happens behind the scene when lambda is created:
```cpp
auto fun = [](int num) { return num; };
```
[C++ Insights](https://cppinsights.io) can be used to see what is going on behind the scene:
```cpp
class __lambda_1_12
{
  public: 
  inline /*constexpr */ int operator()(int num) const
  {
    return num;
  }
  
  using retType_1_12 = int (*)(int);
  inline /*constexpr */ operator retType_1_12 () const noexcept
  {
    return __invoke;
  };
  
  private: 
  static inline int __invoke(int num)
  {
    return num;
  }
};

__lambda_1_12 fun = __lambda_1_12{};
```
This tells us that lambdas are standard types, and that actually we can inherit from them. 

```cpp
template <typename L1, typename L2>
struct Combo : L1, L2 {
    Combo(L1 l1, L2 l2) : L1(std::move(l1)), L2(std::move(l2)) {}
    using L1::operator();
    using L2::operator();
}
```

Let's create two lambdas:
```cpp
auto l1 = []{return 42;};
auto l2 = [](const int n){ return n*n;}
```

When instantiating `Combo` we will take advantage of [Class Template Argument Deduction](https://en.cppreference.com/w/cpp/language/class_template_argument_deduction) from `C++17`

```cpp
 Combo combo(l1, l2);
 std::cout << combo() << std::endl;
 std::cout << combo(3) << std::endl;
```

A more generic version can be created and used as
```cpp
struct Combo : Ls... {
    Combo(Ls... ls) : Ls(std::move(ls))... {}
    using Ls::operator()...;
}
```

```cpp
    auto l1 = [] { return 42; };
    auto l2 = [](const int n) { return n * n; };
    auto l3 = [](const int n, int m) { return n * m; };

    Combo combo(l1, l2, l3, [](const std::string& s){return s + " " + s;});
    std::cout << combo() << std::endl;
    std::cout << combo(3) << std::endl;
    std::cout << combo(3, 43) << std::endl;
    std::cout << combo("cpp") << std::endl;

```


First version:
https://godbolt.org/z/TWs3e8raY

Second version:
https://godbolt.org/z/7qvchhvzx
Day 471 : Wednesday
Tags: hiphop, code, coding, lifelongdev
Published: 2021-10-13 21:31:47

_liner notes_:
- Professional : Did the final review of my next blog post and it will be posted tomorrow. Turned in my other blog post to start the review process. This one took me a little longer to get done. I just want to make sure people can understand what I'm trying to explain. I've got background info and examples that the reader can play around with. Feels good that I got it turned in. Now on to the next project. haha.

- Personal : Did a little more work on my side project. I want to get a working version done so I can get a feel of the workflow and then change and style things accordingly.

![Close up photo of a blades of grass in a field in Great Bookham, United Kingdom](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/luc0v8qjkz9j9peznj3k.jpg)

The plan is to work more on my side project, watch an episode of "Squid Game" and "Boruto". Maybe go through tracks for the radio show. How is it Wednesday already! haha

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube sedq-X6bshs %}
Lombok: Fixing SonarQube coverage problem
Tags: java, devops, testing
Published: 2021-10-13 21:16:17

*Photo by [Scott Rodgerson](https://unsplash.com/@scottrodgerson?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)*

[Here is a Portuguese version.](https://dev.to/malaquiasdev/lombok-corrigindo-problema-de-cobertura-de-codigo-no-sonarqube-570h)

In my ongoing project, I have a CI/CD flow and one step is responsible to collect the code coverage and validate if I have the minimal value to proceed to another step.

However, even having 84% of code coverage, the SonarQube always returned 30% of the result in the step, because of that the deployment step was never executed. 

I spent some time understanding that the problem was in the Lombok annotations, the SonarQube was computing the generated code.

## The solution:

It's simple to resolve this issue. I created a file named `lombok.config` inside the folder java *(/../src/main/java/lombok.config)* with this:

```
config.stopBubbling = true
lombok.addLombokGeneratedAnnotation = true
```

## What are these settings for?

The `config.stopBubbling` informs the Lombok that the folder where the file is the root and the Lombok don't need to search for more parent folders.

While `lombok.addLombokGeneratedAnnotation`  put in every generated code by Lombok annotation, another one named `@lombok.Generated`. This annotation informs Jacoco to not collect coverage from those codes.

Done, problem solved!

## Finishing...

If you liked this post, please be sure to like and share 😄

If you want to know what I'm doing out there or ask any questions, feel free to look for me on social networks like [@malaquiasdev](https://twitter.com/malaquiasdev).

To read more of my posts, go to [MalaquiasDEV | Life, the code and everything else.](http://malaquias.dev/tags/english)
10 Free KubeCon virtual passes just for your comments!
Tags: kubernetes, cloud, cloudnative
Published: 2021-10-13 17:44:53

Hey Dev.to community! Kubecon NA has already started and since we know how much you guys love kubernetes, we figured that CAST AI could give away 10 free virtual passes to those who haven't had a chance to attend Kubecon NA this year.

The instructions are simple(FIFO): 
- Say hi to CAST AI under this post or leave any other comment;
- That's it!

We'll reach out to the first 10 people to leave comments and send out those free invitations. Be sure to visit our booth and check all of the demos that we've got prepared! 

**Kubernetes Cost Optimization for EKS – CAST AI demo**
Wednesday, October 13, 2021
01:30 PM – 02:00 PM US/Eastern | 10:30 AM – 11:00 AM US/Pacific
**Rebalancing sub-optimal clusters to realize cost savings**
Wednesday, October 13, 2021
03:30 PM – 04:00 PM US/Eastern | 12:30 PM – 1:00 PM US/Pacific
**Continuous Bin Packing with Evictor**
Wednesday, October 13, 2021
07:00 PM – 07:30 PM US/Eastern | 4:00 PM – 4:30 PM US/Pacific
**Saving money on high throughput Yugabyte DB using Spot instances and CAST AI**
Thursday, October 14, 2021
01:30 PM – 02:00 PM US/Eastern | 10:30 AM – 11:00 AM US/Pacific
**Kubernetes Cost Optimization for GKE – CAST AI demo**
Thursday, October 14, 2021
03:30 PM – 04:00 PM US/Eastern | 12:30 PM – 1:00 PM US/Pacific
**Resilience Realized: Highly Available App across 2-3 Clouds, with failover**
Thursday, October 14, 2021
07:00 PM – 07:30 PM US/Eastern | 4:00 PM – 4:30 PM US/Pacific
**Rebalancing sub-optimal clusters to realize cost savings**
Friday, October 15, 2021
01:30 PM – 02:00 PM US/Eastern | 10:30 AM – 11:00 AM US/Pacific
**Kubernetes Cost Optimization for AKS – CAST AI demo**
Friday, October 15, 2021
03:30 PM – 04:00 PM US/Eastern | 12:30 PM – 1:00 PM US/Pacific

http://cast.ai/kubecon

[Join our community slack here for hands on talks with developers!](https://join.slack.com/t/castai-community/shared_invite/zt-nwtbsbqq-dWOBiUgLtIGMsUSup7Xksw_)
Help with installing Javascript on Webflow site
Published: 2021-10-13 21:01:00

Hey there!

I need to install an affiliate tracking on my webflow pages.

This is the documentation - https://tapfiliate.com/docs/integrations/javascript/
https://tapfiliate.com/docs/javascript/

The goal is to track each affiliate lead - what product they are buying - what pages they are visiting and give them 33% commission for up to 12 payments.

I need to be able to track:
- Pages lead visited for each affiliate
- From which affiliate lead came from
- Give affiliate 33% comission - paid monthly - up to 12 months.

I need my affiliates to be able to see:

- Pages lead visited
- Give affiliate 33% comission - paid monthly - up to 12 months.

We are sending variations of the same landing page (different domain - same affiliates) so we can see which page will perform better. Therefore I need to be able to see conversions and my affiliate as well.

I have 3 products created on stripe (using stripe payment links) and each product is associated to a different thank you page (each affiliate has their own set of 3 stripe links).

I can't seem to have this done and my due date is onFriday the 15th.....

Can somebody help me with that? I would love to hire somebody. Thansk
The difficult journey to land the first tech job.
Tags: career, programming, beginners, portfolio
Published: 2021-10-13 20:55:37

I just finished college, and now? I did a code Bootcamp, and now? Self-taught and now?

These are common questions in the minds of many new talents in the IT area, full of new skills, set out to land their first job in the software development area. Companies need new talented people, and new talented people need companies, but why these two doesn't match?

Landing the first job becomes a paradox. Companies want programmers with __experience__, but these prodigies have just left college with none. And this search is endless, nowadays even for internships they want __experience__, __how to get a job if I don't have experience and how to get experience if I don't have a job?__

![question](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sn78uy8hf6xqagc6q1if.png)

The interviews begin, the first one we are excited, on the fifth we are anxious for a positive answer, on the tenth we think we are not good enough, on the 30th we don't even know what to think. Almost always with the same feedback, and most of the time, you don't even have feedback.

I had to go through many interviews in the past to understand that we also need to study for interviews, study the company we want to join, the vacancy, the position, adapt the curriculum to the desired position, after all, the blessed __experience__ is still the "main"!

We can consider ourselves lucky because we can get __experience__ putting our knowledge into practice. We are not like doctors who cannot make mistakes or "play" to get __experience__. We are programmers, and we need only a computer to get our hands dirty.

Do you know that open position in that e-commerce company you want so much? How about studying the company, seeing what technologies it uses, and then putting into practice what you know by creating something simple like, for example, a homepage with products, then take more risks and try to create a flow of adding products to a cart. You can "play" without being afraid of making mistakes because you won't hurt anyone with your try, at least you'll create something ugly, and that doesn't even work, but you'll learn with your __experience__... And look at her there, the so dreamed __EXPERIENCE__.

With all that in mind, it will be your turn to yells "I did it!" so don't lose focus, keep trying with everything you have, you can.

And finally, one last tip, don't forget to organize your interview schedule with the recruiter's name, date, time, company name, frequently asked questions, etc.

_p.s. take advantage and create your app to persist your interviews._
MicroServices Live #1 🌍 Hello World!
Tags: microservices, kotlin, showdev
Published: 2021-10-13 20:46:11

En esta serie vamos a mostrar cómo desarrollamos **MicroServices** en **Adevinta Spain**, usando los componentes que nos proporciona nuestra **Common Platform**.

Estos componentes son compartidos de forma global por los marketplaces de **Adevinta** en todo el mundo, permitiendo cierta customización para cada uno de los tenants, en nuestro caso los marketplaces de **Adevinta Spain**.

En esta primera sesión, junto a @guatebus, crearemos un **MicroService** "Hello World" desde cero, configurando automáticamente este pipeline de CI/CD:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fm74orr7rrnwy7x77luv.png)

Puedes ver el repositorio y el streaming de esta primera sesión 👇

{% github AdevintaSpain/ms-test--hello-twitch no-readme %}
{% youtube fIJCqtmxg2M %}

En futuras sesiones usaremos este "Hello World" como base para mostrar en live coding la implementación de:

* 🔎 Logs
* 📈 Metrics
* 🤐 Secrets
* 🏗️ AWS Infrastructure
* ✉️ Kafka
* 🐙 ApiGateway - [KrakenD](https://www.krakend.io/)

Síguenos en [twitter](https://twitter.com/AdevintaEng) o [twitch](https://www.twitch.tv/adevintaspaintech) para no perderte ninguna sesión!

[![Ofertas Backend](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7v0zij7ipp05b68sh0id.png)](https://careers.adevinta.es/ofertas/?search=backend&stc=aff-blog%20dev.to-microservices%20live%20hello%20world)
Welcome Thread - v146
Tags: welcome
Published: 2021-10-13 20:41:08

---
title: Welcome Thread - v146
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
canonical_url: 
---

![Yo graphic](https://media.giphy.com/media/l0Exl2gzkfMptFOGA/giphy.gif)

### Welcome to DEV!

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

**Great to have you in the community!**
How to create your site for free thanks to Notion , Fruitionsite, Freenom and Cloudflare.
Tags: blog, quick, easy, opensource
Published: 2021-10-13 20:31:22

A guide "you can guide yourself or do everything in the video".
[YouTube Tutorial](https://www.youtube.com/watch?v=aw0x54PzCaI)

Chapter One

What you need to make your website/blog for free

First : We must login to Freenom, what is that? easy it's where you will find your free domain for 12 months with free renewal every time the 12 months is up.
-Register here :[Get Free Domain]
(https://my.freenom.com/clientarea.php)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hhc3b1a9fwxtf76ulg2.png)
 

Second: Cloudflare is completely free to have an account.
Register here :
[Cloudflare Free](dash.cloudflare.com)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36vt9nb93dx6wk8xyzow.png)
 

Third : have a free account on notion

Register here :[Notion Free]
(https://www.notion.so/signup)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jsjxfjy2oby67beat9k4.png)
 
Fourth : to have a blog template you can use any site that provides something similar.

Fifth : Use Fruitionsite Script

click here : [Scrip Free]
(https://fruitionsite.com/)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1v8l9ilcujuwfjvbfkt.png)
 

on this page are all the errors corrected and step by step guide on how to create your free website without any problems.

Date without script errors: October , 2021




I will leave you my script I use it for my websites and it is 100% functional.
Here:
[100% operational](https://gist.github.com/isjair/ba625d70afbb5290e1f2e46fee21e1bd#file-testedcodedev-txt)


#Final Chapter 
*Part* 1
**If you need to add favicon to your site I will also leave them.
add**: 

[If you want to add the extra]
(https://raw.githubusercontent.com/stephenou/fruitionsite/a604cfa022e229171b9d5702ffb2cc63e1cd911e/worker.js)

*Part* 2
*I was making a very detailed tutorial but I couldn't finish it so I didn't publish it but in this tutorial everything is detailed but only the verification of the website is missing*.
[Tutorial Final but not final](https://dev.to/jair/how-to-create-your-website-fast-easy-and-free-5701-temp-slug-1557304?preview=acec26ead3492b67a64ac219e6850b56078caf2d031bd002909aa5f440b5c3d61fda313694d2e81d6af0fd8f64a769a512f021fce872fbf283635a7a)
*End*
**All thanks to the community at [Github](https://github.com/stephenou/fruitionsite) and the creator stephenou**
Spring Boot One-To-One Mapping Demo With H2 database
Tags: java, programming, springboot, database
Published: 2021-10-13 19:48:22

There are three basic entity relationships:-

* One-to-One
* One-to-Many/Many-to-one
* Many-to-Many

## Installation
Clone project from here:- [Click Here](https://github.com/atharvasiddhabhatti/Springboot-Playground/tree/main/springboot-demo-one-to-one-mapping)
Import Maven based project in any of your Favourite IDE.

```bash
./mvnw spring-boot:run
```
## Output
Open in Browser

Access H2 Database.

```
http://localhost:8080/h2-console
```

## Usage
### MainClass.java
run() method is run when the application is started. The data is added in the database.

```java
	@Override
	public void run(String... args) throws Exception {
		Customer customer = new Customer();
		customer.setName("Atharva Siddhabhatti");
		customer.setEmail("atharvasiddhabhatti@gmail.com");
		Item item = new Item();
		item.setName("Macbook");
		item.setQty(1);
		customer.setItem(item);
		item.setCustomer(customer);
		customerRepository.save(customer);
		
```


### Customer.java
Following annotations are used in the Customer Entity class to join two tables.Check the class file to view other entities.

```java
@OneToOne(fetch =FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinColumn(name = "item_id")
	private Item item;
```


### Item.java
```java
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "item")
	private Customer customer;
```
## Output
![Output1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/chn3z94qainhqyipa8vy.png)
![Output2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jooplnz18jc89l11fjwc.png)
## Configuration
### application.properties

```c
spring.jpa.show-sql = true

# Enabling H2 Console
spring.datasource.url=jdbc:h2:mem:testdb
spring.jpa.defer-datasource-initialization=true
spring.h2.console.enabled=true

# Enable Web Access
spring.h2.console.settings.web-allow-others=true
```
Flutter Button Types and Features
Tags: flutter, dart
Published: 2021-10-13 19:42:30


Hello, In this lesson, we will talk about the most used Flutter button types and their features. When developing an application with Flutter, we can start with the example that comes up when we first open it. With the button placed in the lower right corner of the screen, we +1 to the number in the center of the screen as it is clicked. Actually, the button type used in this example is called *Floating Action Button*.

<img alt="Flutter Example App" src="https://baransel.dev/post/flutter-button-types-features/flutter-example-app.png" style="height:75%;width:75%;"/>

## Floating Action Button

Different from other buttons, it can be used outside the body in `Scaffold`. If used outside the body, we start with a lowercase letter and its position is automatically the bottom right corner of the screen. For instance,

```dart
floatingActionButton: FloatingActionButton(
  onPressed: _incrementCounter,
  tooltip: 'Increment',
  child: const Icon(Icons.add),
),
```

If we use it inside the body, we can do the positioning as we want. This time, we start with a capital letter.

It uses child because all buttons can take a single widget. We can add any widget we want to them. Let's go through the codes and examine the features of the Floating Action Button.

```dart
floatingActionButton: FloatingActionButton(
  splashColor: Colors.blueAccent,
  backgroundColor: Colors.redAccent,
  onPressed: () {
    debugPrint("Button clicked!");
  },
  tooltip: 'Increment',
  child: const Icon(Icons.add),
),
```

<img alt="Flutter Floating Button" src="https://baransel.dev/post/flutter-button-types-features/flutter-floating-button.png" style="height:75%;width:75%;"/>

When we examine the code above, we can see that we have placed the icon widget inside our button widget. When changing the background color with the `backgroundColor`; While holding down the button, we can determine the color with `splashColor`. The tooltip is the part that gives us information, when we keep the button pressed, it is reflected on the screen for a short time, as we see in the picture. With `onPressed`, we give the click feature.

`floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,`

Inside the `Scaffold`, outside the body, with the above code; We can position the `Floating Action Button` to the center.

```dart
floatingActionButton: FloatingActionButton(
  backgroundColor: Colors.pinkAccent,
  onPressed: () {
    debugPrint("Button clicked!");
  },
  shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(5)),
  tooltip: 'Increment',
  child: const Icon(Icons.insert_emoticon),
)
```

<img alt="Flutter Square Button" src="https://baransel.dev/post/flutter-button-types-features/flutter-square-button.png" style="height:75%;width:75%;"/>

So, is the Floating Action Button always round? No, we can shape it as we want with shape, just like in the picture.

## Raised Button
Continue this post on my blog! [Flutter Button Types and Features](https://baransel.dev/post/flutter-button-types-features/).
Open Source: Community, Sustainability and Growth
Tags: hacktoberfest, opensource
Published: 2021-10-13 19:26:08

As part of [Hacktoberfest2021](https://hacktoberfest.appsmith.com), we're hosting a special session with Joseph Jacks (aka JJ) to talk about all things open source. Appsmith's CEO Abhishek Nayak will be in conversation with JJ to cover a range of topics from sustainability to community to growth. 

Joseph Jacks is the Founder and General Partner of OSS Capital and is a champion of OSS. He's a core part of CNCF, as well as the founder of KubeCon while also founding and building Kismatic, the first enterprise-focused commercial Kubernetes company. 

In the discussion, Abhishek will be discussing with Joseph around what he's seeing among the best of breed open source projects, how should open source maintainers think about the sustainability of their projects, things to keep in mind as you build a community around your open source project and how to think about growth, especially in an era where there's no shortage of projects for people to go to, as well as new technologies keep coming up every day. 

If you're someone involved in an open source project and thinking about its future, or someone thinking about starting or contributing to one, this is a session worth attending. 

Please do [register](https://lu.ma/6owi92ag?utm_source=ActiveCampaign&utm_medium=email&utm_content=Open+Source%3A+Community%2C+Sustainability+%26+Growth%2C+with+Open-source+investor+JJ+Jacks%2C+Founder+OSS+Capital&utm_campaign=Appsmith%3A+Opensource+Event+with+JJ+and+Abhishek) for the session. The event is Thursday 14th October (10 AM PST, 5 PM GMT, 10:30 PM IST).

We will be posting notes of the session as well as the recording here once its done.
Responsive Image slider using Owl Carousel | HTML & CSS
Tags: css, html, javascript, slider
Published: 2021-10-13 19:16:11

In This Video Tutorial, I will be showing  How to Create Responsive Image slider using Owl Carousel | HTML & CSS .  This carousel is stage carousel automatic image sider with  works very better in any mobile device as well as a desktop device. This automatic image slide makes with popular jQuery plugin Owl Carousel.

Source :

Owl Carousel : 
https://owlcarousel2.github.io/OwlCarousel2/
 
Images : 
https://unsplash.com/

CDN
jQuery : https://cdnjs.com/libraries/jquery

Source Code
GitHub : https://github.com/Ui-geeks/Responsive-image-slider- 

Watch More Animation web Tutorials :
Glitch Text Animation Using Baffle.js | HTML & CSS 
https://youtu.be/YTXxbusCCr0

Infinite Marquee Animation Using jQuery.Marquee | HTML & CSS
https://youtu.be/33qPfl16tZw

I'm on some other places on the internet too!

Follow on Instagram
https://www.instagram.com/uigeeks