teleren/devto huggingface dataset:
Will Carbon Replace C++?
Tags: programming, cpp, webdev, javascript
Published: 2022-08-23 07:19:41

This question was asked on [Quora](https://www.quora.com/Will-carbon-replace-C), but I feel dev.to is a more concentrated place to discuss this as there are thousands of active developers here.

A top answer concluded Carbon have no chance of replacing C++; the language is a result of (mostly) Googlers throwing tantrum after C++ standardisation committee voted against ABI braking changes in C++23. And that there might be some hype at the beginning, similar to what happened with Go, but then it'll land in its niche, mostly in Google's projects.

Well, Carbon may end that way, and it may not.

After spending a weekend exploring the language, I feel the language got a chance. Although I wrote a 2000 words article on [7 heated Reasons why I don't want to become a Carbon Developer](https://jeremyikwuje.hashnode.dev/reasons-not-google-carbon-developer-2022).

Carbon's goal is to be the successor to C++. Carbon is designed to match the performance of C++ with LLVM while being able to interrupt with the existing C++ codebase. That means it can do what C++ can do and you don’t have to throw away your C++ code.

Now, that’s a big deal because most C++ coders I know are feeling stuck with C++ and they want something new, but when it comes to building high-performance low-level systems there is just no match for C++ out there.

C++ is a prolific language for doing low-level stuff. However, because Carbon is a modern alternative that is designed to equal C++ performance while being able to connect with existing C++ code, it may “replace” C++.

“replaced” not that C++ will no longer be useful, but in terms of relevance. It will still be there, but you may not see the need when you can use efficiently use Carbon.

This is not going to happen tomorrow or next. C++ will still be relevant in the next decade.

That being said, Carbon is an experiment. There are no guarantees, it may fail to meet its goal. 

There are many reasons Carbon might fail to succeed C++, it not just matching performance. I think much of it has to do with developer adoption - something outside of Google’s control. 

Many developers love C++ and they don't want it to go away even if they know it has many faults. The most upvoted answer to this question on Quora didn't really care what Carbon has to offer but rather about the game engine he is building with C++ and how much he loves to code with C++.

Think Rust? projected as a C++ killer and also a wonderful language. But a good number of C++ dev don't want to code with Rust. It is now gradually carving out its own niche (found a space in crypto).

While Carbon is designed to match C++ performance, it still has a long way to go. For me, the biggest problem is Developer Adoption.

Will the C++ community embraced it as the Carbon thing hoped they do? It's a thing of hope.

### What do you think?

Over to you. What do you think about Carbon vs C++, will it replace it? will it end up finding its own nitch, what are your thoughts?
Fig Plugin for your Terminal
Tags: tips, mac, terminal
Published: 2022-08-23 07:13:00

er research most of the developers just spent 2% of finding tools, helping in their workflow.

Last week we came across @withfig and find it a very useful tool to be in your workflow.

𝐅𝐢𝐠 𝐓𝐞𝐫𝐦𝐢𝐧𝐚𝐥:
A tiny plugin https://fig.io/ adhere superpower to Mac's built-in terminal. Yes, you’ve heard it right, I come across Fig last week and found it immensely capable of as a helping hand.
 
It has autocompleted and IntelliSense, which really help us, and most significantly its free version for Mac is almost of capable everything.

Installation:

I have written few words about it on https://medium.com/@imhamad/fig-plugin-for-your-terminal-617a3d664c6, do check it out and let me know your thoughts.

```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sab5y4vd22p0otx2v2n0.png)
```
How PR Wait time can impact contributor experience with open source repos
Tags: programming, opensource
Published: 2022-08-23 07:11:03

My colleague from [Multitudes](https://www.multitudes.co/) Jenny Sahng wrote a great [medium blog post](https://medium.com/gitconnected/how-does-pr-review-wait-time-affect-your-open-source-project-d79bd0af0ea3) about her research delving into PR wait time in open source projects.

If you work on open source projects or am interested in the impact that review wait time can have on contributors I'd highly recommend giving this a read!

Read here: ["How does PR review wait time affect your open source project?"](https://medium.com/gitconnected/how-does-pr-review-wait-time-affect-your-open-source-project-d79bd0af0ea3)
Best Essay Classes for UPSC
Published: 2022-08-23 06:56:11

[What you'll learn
1. Discussion on art and nuances of Essay writing. Essay paper is a low-hanging fruit as you just have to package the content you have in a presentable manner. But this entails a creativity quotient and skills to write an above-average essay.

2. Understanding the basics of the Essay writing without which it becomes difficult to score good marks in essay paper. How to connect one paragraph to another , what should be the flow in the essay , how many dimensions to discuss to score good marks. All this will be discussed in classes.

3. Learning of various approaches to Essay writing in general and Introduction and Conclusion in particular. It is well known that many times students can write content for MAIN BODY of the essay , but when it comes to Introduction and Conclusion of Essay they can’t do justice with it.

4. Essay writing is an art and so by the very definition can be learnt by practicing it correctly. During classes there would be brainstorming sessions on the previous years topics of UPSC Essay paper. This would help you learn how to unfold an essay topic.

5. Most importantly, stress to be given to PHILOSOPHICAL topics which are becoming the darling of UPSC in recent times. It is here that normal candidates are lacking to express themselves. After the classes you must be able to deal with philosophical topics confidently.

6. Learning how to structure an Essay. As an unorganized and unstructured Essay is the one which gets poor marks in Main Examination. Hence if you know how to structure your essay you can ensure good marks in this paper.](https://chromeias.com/essay-classes-for-upsc/)
Most Trusted Web Development Company in India
Tags: webdev, agile
Published: 2022-08-23 06:19:00

Folks, 

2022 is into its 3rd quarter and we have seen many updates in the field of technology. From AI-ML to Data science, from software development to web development; we’ve seen more in the upgrade.

Well this time many web development companies have attracted everyone’s attention. The reason behind it was COVID. Due to the pandemic the way of working in the IT industry has been changed completely. And there are many companies that have made unique ways to serve their overseas clients. We’ll talk about the pioneer company that involved a lot into their internal processes and made them effective and also made customer experience favorable to their requirements. We’re talking about Bacancy.

As per the recent meeting with the CEO of the company, I was totally unable to believe that they have made many changes to the organization in just one year. In so short period of time they have achieved things like;

They are shifting to the new location in Ahmedabad just to change the environment and ambience of the company. Management strongly believes that creativity and new ways of achieving things comes with a new environment, so they are shifting near to nature where there would be no external noise, there will be peace and fresh oxygen.
My god that is extraordinary. They care for their employees and their health. Hats off Bacancy.
 
Moving to another big jump is they have developed their own PMS and CRM to regulate the internal(employees) and external(clients) process easier. After getting client’s feedback, they found that the process of hiring software developers is far more improved. They told that after onboarding the project, the involvement of the client and company is equal so that company can serve the best.
And yes! It's good because in the service industry, your true potential is how you give your best inputs to clients during the ongoing project. 

The most likely change and it is my favorite is they entered the electric vehicle-EV market with their sister company [Bacancy Systems](https://www.bacancytechnology.com/systems/). Here they provide EV products like BMS, CCS2 Controller, Motor Controller, DC charger and Many more. Already India’s top automotive companies are in contact with Bacancy for EV products.

After all these key achievements; I completely agree that Bacancy is all set to fly high by providing clients top notch software and [web development services](https://www.bacancytechnology.com/web-development-services).
Suggest me something for reading
Tags: beginners, programming, discuss, algorithms
Published: 2022-08-23 05:53:21

I want to learn the fundamentals of programming and other concepts from the base with the following topics:
- Data Structure and Algorithms
- System Design
- AI
- ML
- Cloud

Please do suggest me material which will be great to learn the things.
I'm also open to video material or other type of content

Feel free to share your experience while learning the mentioned thing which will be helpful to me and people encountering this post.

Let's discuss it!
Drag and Drop Events from an External Source to Vue Scheduler
Tags: vue, webdev, scheduler
Published: 2022-08-23 05:52:28

Learn how to drag events from an external source to the [Vue Scheduler component](https://www.syncfusion.com/vue-ui-components/vue-scheduler) of Syncfusion. In this video, you will learn how to add the TreeView component to an existing Vue Scheduler app, and how to drag an item from the TreeView component into the Vue Scheduler component. You will also learn how to open the editor window before the item is added as an appointment to the Scheduler. 

Product overview: https://www.syncfusion.com/vue-ui-components/vue-scheduler

Explore tutorial video: https://www.syncfusion.com/tutorial-videos

Download example from GitHub: https://github.com/SyncfusionExamples/drag-and-drop-events-from-an-external-source-to-vue-scheduler

{% youtube bqMv0OOEPZk %}
Okteto-stacks - docker-compose batteries included
Tags: kubernetes, docker, tips
Published: 2022-08-23 05:50:00

Okteto stacks extend docker-compose specification by adding new fields. Lot of them have been discussed in the previous post
```bash
services:
  api-backend:
    build: api-backend
    scale: 2
    ports:
      - 5000:5000

  redis-db:
    image: redis
    ports:
      - 6379
    volumes:
      - redis-db:/data

volumes:
  redis-db:/data
```
This creates a 2-tier application with 2 instances of `api-backend` (on port `5000`) connecting to one instance of `redis-db`(on port `6379`) which is based on a volume-mount under `/data`
Translating it to kubernetes manifests would lead to a long manifest (>300 lines)
```bash
❯ kubectl get all
NAME                         READY   STATUS    RESTARTS   AGE
pod/redis-6fb6c999bd-hdvwt   1/1     Running   0          2m23s
pod/api-backend-7fb866df6c-cpbmw     1/1     Running   0          97s
pod/api-backend-7fb866df6c-vhkfp     1/1     Running   0          97s

NAME                 TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGE
service/kubernetes   ClusterIP   10.96.0.1       <none>        443/TCP    3m7s
service/redis        ClusterIP   10.96.185.225   <none>        6379/TCP   2m24s
service/api-backend          ClusterIP   10.96.214.56    <none>        5000/TCP   2m24s

NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/redis   1/1     1            1           2m23s
deployment.apps/api-backend     2/2     2            2           97s

NAME                               DESIRED   CURRENT   READY   AGE
replicaset.apps/redis-6fb6c999bd   1         1         1       2m23s
replicaset.apps/api-backend-7fb866df6c     2         2         2       97s
```

###### More info
[Official documentation](https://www.okteto.com/docs/0.10/reference/stacks/)
Super Reduced String
Tags: javascript, hackerrank
Published: 2022-08-23 05:19:39

Just try working with sub-string & index
```
function superReducedString(s) {
  let left = 0;
  let right = 1;
  let subStr = s;
  while (right <= subStr.length)
    if (subStr[left] === subStr[right]) {
      subStr = subStr.substring(0, left) + subStr.substring(right + 1);
      left = 0;
      right = 1;
      i = 0;
    } else {
      left++;
      right++;
    }

  return subStr;
}

console.log(
  "Answere here ====>",
  superReducedString(
    "kagoyzkgfjnyvjewazalxngpdcfahneqoqgiyjgpzobhaghmgzmnwcmeykqzgajlmuerhhsanpdtmrzibswswzjjbjqytgfewiuu"
  )
);

// kagoyzkgfjnyvjewazalxngpdcfahneqoqgiyjgpzobhaghmgzmnwcmeykqzgajlmuersanpdtmrzibswswzbjqytgfewi-> output


```
I started journey on Stack Overflow
Tags: intro
Published: 2022-08-23 05:18:14



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u9a87a8kp9t7bgjv8396.png)
A few days ago, I joined [Stack Overflow](https://stackoverflow.com/users/19730236/steve-gerrad).
Now, I already get **6** badges (`Scholar`, `Autobiographer`, `Supporter`, `Teacher`, `Editor`, `Informed`) and earn about **200** reputation. And also about **400** people reached on my profile.

I'm going to become top **1 %** in few months. Please support me :)
https://stackoverflow.com/users/19730236/steve-gerrad
FastHttpd - Alternate nginx
Published: 2022-08-23 05:09:00

## Introduction

I was looking for a reverse proxy to replace nginx and found [valyala/fasthttp](https://github.com/valyala/fasthttp).

I had just developed [jarxorg/tree](https://github.com/jarxorg/tree), so I started developing [fasthttpd/fasthttpd](https://github.com/fasthttpd/fasthttpd), thinking that if I combined the two, I could create a product that would meet my needs.


## Features

- Serve static files
- Simple routing
- Access logging
- Reverse proxy
- Customize headers
- Support TLS
- Virtual hosts
- YAML configuration


## Getting started

Specify the configuration file.

```sh
fasthttpd -f path/to/config.yaml
```

Use build-in configuration and some customization.

```sh
fasthttpd -e root=./public -e listen=:8080
```


## Installation

Using homebrew.

```sh
brew tap fasthttpd/fasthttpd
brew install fasthttpd
```

In addition, binaries, deb, rpm and docker image are available.

Refer to https://github.com/fasthttpd/fasthttpd#installation


## Alternate nginx example

The following is nginx.conf.

```
upstream backend {
	server 127.0.0.1:8000;
}

server {
	listen 80 default_server;
	return 302 https://$host$request_uri;
}

server {
	listen 443 default_server;
	ssl on;
	ssl_protocols	   TLSv1 TLSv1.1 TLSv1.2;
	ssl_certificate	 /etc/letsencrypt/live/example.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;

	error_page 404 /404.html;
	error_page 500 502 503 504 /50x.html;
	location ~ ^/(404|50.).html {
		root /usr/share/nginx/html;
		internal;
	}
	location ~ ^/(.*)\.(ico|css|git|jpg|jpeg|png|js)$ {
		alias /app/public/$1.$2;
	}
	location / {
		proxy_set_header Host $host;
		proxy_set_header X-Forwarded-Proto $scheme;
		proxy_set_header X-Forwarded-Port $server_port;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
		proxy_http_version 1.1;
		proxy_intercept_errors on;
		proxy_pass http://backend;
	}
}
```

The following is a configuration of fasthttpd.

```yaml
host: example.com
listen: ':80'

routes:
  - path: ^/(.*)$
    match: regexp
    rewrite: https://example.com/$1
    status: 302
---
host: example.com
listen: ':443'
root: /usr/share/fasthttpd/html
ssl:
  autoCert: true

errorPages:
  '404': /err/404.html
  '5xx': /err/5xx.html

handlers:
  'backend':
    type: proxy
    url: http://localhost:8080/
  'public':
    type: fs
    root: /app/public
    indexNames: [index.html]

routes:
  - path: ^/(.*)\.(ico|css|git|jpg|jpeg|png|js)$
    match: regexp
    handler: public
  - path: /
    handler: backend
```

I would be happy to get your feedback, Thank you!
Please give me some feedback about my npm package
Tags: javascript, typescript, npm
Published: 2022-08-23 04:59:24

Hi everyone, this is my first post on **Dev.to** and I'm very excited to hear from you guys.

For the last couple of weeks I've been working on a validation library and yesterday I've published the second major version of it on npm. This package was my first npm package.

See it on npm: [handy-types](https://www.npmjs.com/package/handy-types)

GitHub Repository: [handy-types](https://github.com/h-sifat/handy-types)

It's a lite weight validation library that I've developed as a side project to reduce validation boilerplate in my other validation library that I've been working on for the past few months 😅. But I've decided to publish on npm in case others find it useful. 

#### Example Usages (**TypeScript**):

```ts
import { is, assert } from "handy-types";

let value: unknown;

is("integer", value); // false
is("positive_number", value); // false
is("8bit_unsigned_integer", value); // false
is("non_null_object | plain_object", value); // false

if (is<string | string[]>("non_empty_string | non_empty_string[]", value)) {
  value; // here the type of value is: string | string[]
}

// we can use caching for improved performance
if ( is.cache<string | string[]>("non_empty_string | non_empty_string[]", value)) {
  value; // here the type of value is: string | string[]
}

assert("integer", value);
// throws error: `Value must be of type Integer`

assert("integer", value, {
  name: "Age",
  code: "INVALID_AGE",
});
// throws error: `Age must be of type Integer`, with code: "INVALID_AGE"

assert("non_empty_string", value, {
  message: "Invalid path",
  otherInfo: {
    path: value,
    errorId: -3,
  },
});
// throws error: `Invalid path` , with properties path: undefined, errorId: -3

// use caching for improved performance
assert.cache<string | string[]>(
  "non_empty_string | non_empty_string[]",
  value,
  { name: "hobbies" }
); // throws error: "hobbies must of type: Non-Empty String or Non-Empty String Array"
```
Please refer to the github README for detailed documentation.

Kindly let me know if you think I can improve something. Thanks in advance 💝.
234. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-08-23 04:59:16

```
class Solution {
 public:
  bool isPalindrome(ListNode* head) {
    ListNode* slow = head;
    ListNode* fast = head;

    while (fast && fast->next) {
      slow = slow->next;
      fast = fast->next->next;
    }

    if (fast)
      slow = slow->next;
    slow = reverseList(slow);

    while (slow) {
      if (slow->val != head->val)
        return false;
      slow = slow->next;
      head = head->next;
    }

    return true;
  }

 private:
  ListNode* reverseList(ListNode* head) {
    ListNode* prev = nullptr;

    while (head) {
      ListNode* next = head->next;
      head->next = prev;
      prev = head;
      head = next;
    }

    return prev;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/palindrome-linked-list/
One good feat is worth a 1000 bug fixes - day 4 of coding
Tags: svelte, 100daysofcode
Published: 2022-08-23 04:55:59

Last I posted, I was struggling with making a working context menu. The requirements sound basic but I've been debating whether to use svelte actions or listeners to make it happen.

Essentially:
* When users right click on a friend in the friend list window, they will be able to edit or delete.
* When they right click on a blank space, they will be able to create a new friend.
* When they right click on an area without context menu ability, nothing should happen
* Only one context menu should be open at a time.

I'm still considering how to do this. One solution could be to treat the whole window like a desktop instead. So when they right click on a "friend" icon, it does the right actions. When you right click on any other space, it would have the new friend select.

This might be way easier and funner of a design. Especially if you could drag drop the friends around in groups in the way macOS desktop works.

Sadly this requires a pivot, and before I can do that, I need to make sure my code is squeaky clean. However, for today I just wanted to focus on some other low hanging fruit.

## Accomplished
* Created close window functionality
* Added sorting (sort by location and friends) by storing a sort method in the store and having a derived store variable for sortedFriends
* Added filtering for people by search keyword so you can search by name or location
* Added more properties for gift ideas, friendiversary, notes 

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

### Note on missed days
Obviously the goal when you start any 100 day consecutive challenge is to not miss a day. The idea with this challenge being that I transform into a Lebron James of svelte at the end of the 100 days. But truthfully, I haven't coded for fun in a long time. Doing it on weekends still feels like something I should report to HR, so I'm trying to take it as lightly as possible. Still keeping up with it, but no resetting if I miss a day (or two but no more!! 😡) /excuses
MariaDd Quick-tip #10 - Select table definition
Tags: sql, mysql
Published: 2022-08-23 04:55:56

## MariaDB tips and tricks

This is part of a series of quick tips and tricks I have accumulated over the year, that I think can be useful for others.
If you have similar short tips and tricks please leave a comment.

### Select table definition

Have you ever had the task of documenting a whole database or maybe just a few tables some programmer created years ago. I have, and I quickly found that having a query to directly select the schema of a table was a great timesaver.
Or maybe you don't have access to the production database, but the bugs or performance issues you experience, indicate a missing index or a wrong column definition, so you need to send a request for the IT operations department to fetch the information about a table from the database for you.
In both cases the queries below can be very useful.

```sql
SET @DatabaseName := 'test_db';
SET @TableName := 'departments';

SELECT c.COLUMN_NAME, c.COLUMN_TYPE, c.IS_NULLABLE
  FROM INFORMATION_SCHEMA.`COLUMNS` c 
 WHERE c.TABLE_SCHEMA = @DatabaseName
   AND c.TABLE_NAME = @TableName;
   
SELECT s.TABLE_NAME,
       s.INDEX_NAME,
       group_concat(s.COLUMN_NAME ORDER BY s.SEQ_IN_INDEX ) AS index_columns,
       s.INDEX_TYPE,
       CASE s.NON_UNIQUE
            WHEN 1 THEN 'Not Unique'
            ELSE 'Unique'
       END AS is_unique
  FROM information_schema.STATISTICS s
 WHERE s.INDEX_SCHEMA = @DatabaseName
   AND s.TABLE_NAME = @TableName
 GROUP BY s.TABLE_NAME,
          s.INDEX_NAME,
          s.INDEX_TYPE,
          s.NON_UNIQUE
 ORDER BY s.TABLE_NAME,
          s.INDEX_NAME;

SELECT tc.CONSTRAINT_NAME, tc.CONSTRAINT_TYPE  
  FROM information_schema.TABLE_CONSTRAINTS tc 
 WHERE tc.CONSTRAINT_SCHEMA = @DatabaseName
   AND tc.TABLE_NAME = @TableName;
```
![DBeaver screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2yz41lnc5sgidbdz6pla.png)
![DBeaver screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8jjsbm7hy20ttw32t7j.png)
![DBeaver screenshot](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cvkiw91ku7ekm49fcqy1.png)