teleren/devto huggingface dataset:
opengauss synchronization status question
Published: 2022-08-16 08:29:51

I have manually created the master-slave environment here, the synchronization can be normal, but viewing the synchronization information prompts the error marked as follows, what is the reason?

The database has only one omm account

`[omm@localhost data]$ gs_ctl query -D /opt/opengauss/data
[2022-07-20 17:10:52.856][30384][][gs_ctl]: gs_ctl query ,datadir is /opt/opengauss/data
HA state: local_role
: Primary
static_connections : 1
db_state : Normal
detail_information : FATAL: Forbid remote connection with initial user.
FATAL: Forbid remote connection with initial user.

sync_mode : Async

Senders info:
No information
Receiver info:
No information`
GitHub CLI on devcontainer
Tags: vscode, github
Published: 2022-08-16 08:23:35

---
title: GitHub CLI on devcontainer
published: true
description: 
tags: 
  - vscode
  - github
---

To use the [GitHub CLI](https://cli.github.com/) (a.k.a. `gh`) on devcontainer, you need to pass credentials for that.

If you run `gh auth login` on the host side, the credentials will be stored at `~/.config/gh/hosts.yml`, so mounting it on the container side will work.

Maybe it can be difficult to include this setting in `docker-compose.yml` since it is the developer's preference whether to use `gh` and devcontainer or not. In such case, it would be nice to add that setting to `docker-compose.override.yml`, and ignore these files from Git. 

```yaml
# docker-compose.override.yml
services:
  rails:
    volumes:
      - ~/.config/gh/hosts.yml:/root/.config/gh/hosts.yml
```

```shell
# .gitignore or .git/info/exclude
docker-compose.override.yml
.devcontainer/devcontainer.json
```

Normally, `docker-compose` command will automatically merge `docker-compose.override.yml` into `docker-compose.yml`, but in this case you need to specify it explicitly as follows:

```json
# .devcontainer/devcontainer.json
{
  "name": "Rails",
  "dockerComposeFile": [
    "../docker-compose.yml",
    "../docker-compose.override.yml"
  ],
  "service": "rails",
  "workspaceFolder": "/workspace",
  "runServices": ["rails"]
}
```
The Power Of Python's Assert Statement
Tags: python, assert, debug
Published: 2022-08-16 08:08:41

## What Are Assertions In Python?
In Python, assertions are statements that allow developers to test the correctness of their code. If the assertion evaluates to true, nothing happens; otherwise, an *AssertionError* is raised.

Let's look at how assertions are used in Python first, but first let's create a Book class. Below is an example Python code.
```
from typing import NamedTuple

class Book(NamedTuple):
    author: str
    title: str
    published_year : int
```
We created a Book class that inherits from the typing module's NamedTuple class. Because NamedTuples are tuples by default, our Book class is immutable.
Creating an instance of the Book class

```
>>> book1 = Book('Christian Mayer', 'The Art Of Clean Code', 2022)
>>> book1
Book(author='Christian Mayer', title='The Art Of Clean Code', published_year=2022)
```

Let's use the assert statement to test for the truthiness of the published_year.

```
>>> assert(book1.published_year == "2022")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError
>>>
```
AssertionError was raised because the published_year has an integer type and we tested it against a string.

Now let's test it with a valid year value of 2022


```
>>> assert(book1.published_year == 2022)
>>>
```

Because, the assertion statement is true nothing happened

## Why Use Assertions?
* As a debugging aid rather than an error handling mechanism
* As internal self-checks for a program 
* Allows developers to find the likely root cause of a bug more quickly
A Fun Programming Joke To Start Your Day
Tags: jokes, dailydeveloperjokes
Published: 2022-08-16 08:00:28

---
title: "A Fun Programming Joke To Start Your Day"
description: "Check out today's daily developer joke! (a project by Fred Adams at xtrp.io)"
series: "Daily Developer Jokes"
published: true
tags: #jokes, #dailydeveloperjokes
---

Hi there! Here's today's Daily Developer Joke. We hope you enjoy it; it's a good one.

![Joke Image](https://private.xtrp.io/projects/DailyDeveloperJokes/public_image_server/images/5e1258d992c4e.png)

---

For more jokes, and to submit your own joke to get featured, check out the [Daily Developer Jokes Website](https://dailydeveloperjokes.github.io/). We're also open sourced, so feel free to view [our GitHub Profile](https://github.com/dailydeveloperjokes).

### Leave this post a ❤️ if you liked today's joke, and stay tuned for tomorrow's joke too!

_This joke comes from [Dad-Jokes GitHub Repo by Wes Bos](https://github.com/wesbos/dad-jokes) (thank you!), whose owner has given me permission to use this joke with credit._

<!--
Joke text:
___Q:___ How do programming pirates pass method parameters?

___A:___ Varrrrarrrgs.
 -->
How Automate OKTA with Atlassian suite integration using Terraform/Helm
Tags: terraform, helm, kubernetes, devops
Published: 2022-08-16 07:51:00

Hello,

We currently have Atlassian suite (Jira, confluence, crowd etc) installed on AWS EKS cluster and we would like to use OKTA Single Sign-On (SSO) to enables access to Atlassian products. 

My question is if we can automate OKTA Atlassian suite integration using Terraform/Helm because the EKS cluster has been designed using Terraform/Helm.

Many thanks in advance

Del
Data Structures Internal Implementations
Published: 2022-08-16 07:42:00

> Data Structures

We know how data structure plays an important role in interview preparation as well for problem solving.

Usually we use internal data structures and we don’t know how things are working behind. Using a data structure without knowing its working its useless. This data structure implementation are asked in interview and if you know how to implement a data structure you can design your own custom data structure according to your needs.

So you understood that data structure implementation will not only help you in interview but also can be used in development for creating custom structures. So from where we need to learn this?

I have made a GitHub repository containing all the internal collection framework of Java plus Data structures needed in daily 
life. Below is the list of Data structures in my GitHub repo .

- ArrayList
- LinkedList (Single , Double , Circular)
- Stack
- Queues (Standard, Circular , Deque )
- Trees ( Binary ,Binary Search , N-Arry )
- Map ( HashMap , LinkedHashMap , TreeMap )
- Set ( HashSet , LinkedHashSet , TreeSet)
- Heap ( MaxHeap , MinHeap )
- Trie
- Graph

This repo is completely free and share with your friends and 
star/fork the repo if its helping you. Happy Coding

{% embed https://github.com/nisabmohd/DS-Implementations %}
Welcome to MaanavaN Learn Code
Tags: javascript, webdev, programming, react
Published: 2022-08-16 07:41:00

**MaanavaN Learn Code** is one of the most popular Tamil technology e-learning platforms Hundreds of thousands of elite **students, freshers, and working professionals** around the globe have joined the platform to **up-skill** themselves.

We cater to professionals and students across the globe in categories like **Cloud, DevOps, Front-End, Full Stack & Mobile Technologies, System Engineering and Programming.**

**MaanavaN Learn Code**
**Programming** and Latest **Technologies** in **Tamil**
www.maanavanlearncode.com
Hidden Costs Of Data Backup: Top 7 Tips To Avoid Them
Tags: community, databackup, beginners
Published: 2022-08-16 07:29:32

Data backup is one endeavor that costs companies time, money, and effort. However, saving on costs is a noble goal every smart and responsible business should pursue. On the other hand, you must look for ways to avoid hidden and unnecessary data backup costs.


Therefore, it would be beneficial to look for ways to save you these costs and channel them to other useful projects. Here are seven tips to help you save money on your data backup efforts (see our official website for more on our Hyper-V backup solutions). Keep reading to learn and save more money on your data backup plans.


Source: https://www.hostreview.com/blog/220809-hidden-costs-of-data-backup-top-7-tips-to-avoid-them
A Complete NodeJS Web Server
Published: 2022-08-16 07:07:00

[https://github.com/safeonlineworld/cwserver](https://github.com/safeonlineworld/cwserver)

![CWSERVER](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0m10dfvxbxwfnxs7tigg.png)
 

The aim of the project is to create an easy to use, lightweight, Complete Web Server Framework with default #NodeJs HTTP Server
How to Secure a Website? Quick Tips
Tags: security, webdev, javascript, php
Published: 2022-08-16 06:50:00

How to Secure a Website | 7 Tips to Keep It Secure

1. Install SSL – buying a simple Secure Sockets Layer certificate is a crucial first step.

2. Use anti- malware software – to scan for and prevent malicious attacks.

3. Make your passwords uncrackable – 123456 won’t cut it!

4. [Keep your website up to date](https://liveupx.com) – using out-of-date software is like leaving your back door unlocked.

5. Don’t help the hackers – look out for phishing emails and other scams.

6. Manually accept on-site comments – keep control over potentially dodgy comments.

7. Run regular backups – to prepare for the worst case scenario.
Appwrite Announces Loot V2
Published: 2022-08-16 06:47:18

Do you love swags as much as we do? The Loot V2 is the perfect opportunity for you to get your hands on some exclusive swags!

We are immensely thankful to our community members! With the introduction of Loot V2, we want to thank you for your contribution and make being present in the community a lot of fun! 🌟

_Disclaimer - The loot is specific to our Discord community members. This is your cue to [join](appwrite.io/discord), if you haven’t yet! 😉_


---

## 🤔 What is Loot?
Every month in Appwrite we will organize a swag loot, where the winners get their hands on some really cool swag!

### Here’s what will happen every month:
We will announce new and fun activities every month and participants will have to complete it within the mentioned time frame.
At the end of the month, we will announce the top 3 winners. Our team members will reach out to them to send the swags 🎁

### Here’s how will we decide the winners:
- The Appwrite core team will judge every entry of the activities made under social media hashtags like **#appwrite** and **#appwriteloot**. The hashtags for each month will be announced.

- The Appwrite core team will track Discord engagement to find the most active members

---

## 🪜 Activity for August

It’s time we unveil the secret and declare the activity for this month! 🥳

The first activity had to be something special and something we all love! 😎

Yes you got that right! It’s **MEMES**!

Here’s what you need to do to win:

1. Put your funny bones to work! Make memes that makes us double up with laughter, they can be about Appwrite or anything programming related
2. The submission window is open from **16th August to 26th August**.
3. Tag [@appwrite](https://twitter.com/appwrite) on Twitter and use hashtags **#appwriteloot** **#appwrite**
4. Also share your memes/meme post links to our #memes Discord channel

_Note: Step 3 is very important, that is how we will track your entries_

**P.S** - Results will be announced at the end of every month, make sure to keep a lookout on our #announcement channel! 

---

## 🗒️ Ending Notes
With this loot we want all of you to have fun and it also gives us an opportunity to give back to the community!


For additional questions, drop them below or send them on Discord!
That Arduino Pin Can't Interrupt
Tags: interrupt, staticassert, arduino
Published: 2022-08-16 06:18:07

---
title: That Arduino Pin Can't Interrupt
published: true
description: Time saver when working with tiny Arduino's
tags: interrupt, staticassert, arduino
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cs1llbx660kxxtd02dpd.jpg
# Use a ratio of 100:42 for best results.
---

I thought it would be easy to couple a button to my Arduino Gemma.

However, it just didn't work.  I've read the whole [page on `attachInterrupt`](https://www.arduino.cc/reference/en/language/functions/external-interrupts/attachinterrupt/) but apart from a hunch that _maybe_ some pins can't be used for interrupts, I got nothing.

So I had to dive into the code, where I found this little snippet (`Arduino.h`)

```C++
#define NOT_AN_INTERRUPT -1
```

And in `$HOME/.arduino15/packages/arduino/hardware/avr/1.8.5/variants/gemma/pins_arduino.h`, I read this:

```C++
#define digitalPinToInterrupt(p) \
   ((p) == 2 ? 0 : NOT_AN_INTERRUPT)
```

So here's an idea for you: add a little snippet to your sketch:

```C++
template<int PIN>
constexpr int interruptFor() {
  constexpr auto i = digitalPinToInterrupt(PIN);
  static_assert(i != NOT_AN_INTERRUPT,
     "board can't use this pin for an interrupt");
  return i;
}
```

And use this function instead:

```C++
namespace my_wiring {
  constexpr auto BUTTON_PIN = 2;
}

constexpr auto BUTTON_INTERRUPT =
  interruptFor<my_wiring::BUTTON_PIN>();
```

Now, on my Gemma (with an ATtiny85), when I change my `BUTTON_PIN` to e.g. 1:

```shell
sketch_aug14a.ino: In instantiation of
  'constexpr int interruptFor() [with int PIN = 1]':
sketch_aug14a/sketch_aug14a.ino:19:70:   required from here
sketch_aug14a/sketch_aug14a.ino:11:3: error: static assertion failed:
   board can't use this pin for an interrupt

   static_assert(i != NOT_AN_INTERRUPT,
   ^~~~~~~~~~~~~
```

That would have been a time saver!  Maybe I'll propose to introduce this in the arduino headers, too.  When I have time.
Top 10 Data Science Resources Online
Tags: resource, datascience, machinelearning
Published: 2022-08-16 06:06:35



1. Coursera
2. DataCamp
3. Udemy
4. EdX: Data Science Essentials
5. Udacity
6. Kaggle
7. Analytics Vidhya
8. KDNuggets
9. Dataquest
10. Khan Academy
Top 10 Data Science Books
Tags: machinelearning, datascience, beginners
Published: 2022-08-16 06:05:11



1. Introduction to Statistical Learning
2. Data science at the command line
3. Think stats
4. Python data science handbook
5. R for data science
6. Machine learning yearning
7. Ethics and data science
8. Deep learning
9. Rules for machine learning
10. Probabilistic Programming & Bayesian methods
Top 10 Machine Learning Algorithms
Tags: machinelearning, ai, beginners, career
Published: 2022-08-16 06:03:47

1. Linear Regression
2. Logistic Regression
3. Decision Trees
4. Random Forests
5. K Means Clustering
6. Support Vector Machine
7. Artificial Neural Network
8. XGBoost
9. Naïve Bayes Classifier
10. Nearest Neighbor
387. Leetcode Solution in CPP
Tags: cpp
Published: 2022-08-16 05:46:13

```
class Solution {
 public:
  int firstUniqChar(string s) {
    vector<int> count(128);

    for (const char c : s)
      ++count[c];

    for (int i = 0; i < s.length(); ++i)
      if (count[s[i]] == 1)
        return i;

    return -1;
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/first-unique-character-in-a-string/
[Redis Hackathon Submission Post Placeholder Title]
Tags: redishackathon
Published: 2022-08-16 04:44:08

[Instructions]: # (To submit to the Redis Hackathon on DEV, please fill out all sections. DELETE ALL NOTES, reminders, and guidelines before publishing.)


### Overview of My Submission
[Note]: # (Share what you built, how you built it, and the inspiration behind the idea! Please make sure the project links to the appropriate GitHub repository, and includes the [MIT](https://choosealicense.com/licenses/mit/), [Apache](https://www.apache.org/licenses/), [BSD-2](https://opensource.org/licenses/BSD-2-Clause), [BSD-3](https://opensource.org/licenses/BSD-3-Clause), or [Commons Clause](https://commonsclause.com/) license and a README.)


### Submission Category: 

[Note]: # (Select between Minimalism Magicians, Microservice Mavens, MEAN/MERN Mavericks, Wacky Wildcards – Descriptions of requirements listed in the announcement post.)

### [Optional: Video Explainer of My Project]

[Note]: # (This is where you can embed the optional bonus video you created to accompany your submission. Ensure your video is published publicly to YouTube and you’ve used the embed tag here to share it with us. By opting to include a video, you will be eligible for BONUS prizes. Learn more in the announcement post.)

### Language Used
[Note]: # (Select the language you used for your project – must be one of the following: C#/ASP.NET Core, Java/Spring, JS/TS/Node.js, Python)


### Link to Code

[Note]: # (Our markdown editor supports pretty embeds. Try this syntax: `{% embed link_to_your_repo %}` to share a GitHub repository)

BTW, your Github code’s README file should contain the details as [per this template](https://github.com/redis-developer/hackathon-docs/blob/main/README.md).

### Additional Resources / Info

[Note:] # (Be sure to link to any open source projects that are using your workflow!)

[Note:] # Screenshots/demo videos are encouraged!

### Collaborators

[Note]: # (Be sure to include the DEV usernames of your collaborators, if any. Prizes for winning projects with multiple collaborators will be sent ONLY to the person who posts this submission and they will distribute the prize evenly.)

[Note]: # (All collaborators with DEV profiles listed here will receive a badge, however, prizes including sticker packs will only be sent to the member who publishes the post, with the person expected to distribute the prizes evenly amongst their collaborators.)

[Reminder]: # (Submissions are due on August 29th, 2022 @ 11:59 PM UTC).

- - - 

[Note]: # (Please ensure  that the footer content below is part of your post when publishing. Please delete this note in parentheses but do not delete the content below.)


* _Check out [Redis OM](https://redis.io/docs/stack/get-started/clients/#high-level-client-libraries), client libraries for working with Redis as a multi-model database._
* _Use [RedisInsight](https://redis.info/redisinsight) to visualize your data in Redis._
* _Sign up for a [free Redis database](https://redis.info/try-free-dev-to)._
Switching my career to React...
Tags: javascript, programming, react
Published: 2022-08-16 05:22:00

## Short Web Development Journey

2015 - 2017 I am learning web development by myself. I have learned HTML, CSS, JS basic, Bootstrap, jQuery using only a smartphone. 2018 - 2019 was interesting. I have started learning PHP and WordPress. On the other side, I did a job and save some money for buying a laptop. Finally, I did it. I have purchased a laptop and start freelancing as a WordPress designer. I have complete 200+ projects

In this journey, I fall in love with JavaScript. Jan 2022 I have started learning React.js.

## Now I am skilled at:

- JavaScript
- React.js
- Node.js
- Tailwindcss
- Redux-toolkit
- Next.js

## Right now I have started building projects as portfolio
[My Portfolio](https://wyarejali.vercel.app/)

## Stock-Pic React app
[Live Preview](https://wa-stock-pic.netlify.app/)
[Source Code](https://github.com/wyarejali/wa-stock-pic)

## Right now, I'm looking for a Front-end developer job
So, please support me. Please check out my portfolio and do comment what I have to improve.

Thanks for read.
DataBase Table Indexing
Tags: mysql, database, php, laravel
Published: 2022-08-16 04:43:00

If you have large number of data and your query is taking long time to execute. Database table indexing could be helpful. 

Primary key is automatically index, likewise you can add more indexing keys (column_name) that you frequently used for query. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b7wejqtnjqepwkq028vj.png)
Longji Vwamhi | An Overview of Cloud Architecture
Tags: longjivwamhi, cloudarchitecture, business, technology
Published: 2022-08-16 04:36:55

Fintech expert who is also a DevOps professional, Longji Vwamhi has worked in the finance industry in various capacities. In this article, he is going to explore the world of cloud computing. The term ‘The term ‘Cloud Architecture’ simply refers to the numerous internet delivery mechanisms for apps and services.’ simply refers to the numerous internet delivery mechanisms for app and services. According to him, people no longer rely so much on physical storage devices for so many reasons.

**Cloud Computing**
Understanding cloud computing has different aspects like cloud architecture, cloud environment, cloud storage, and so on. The most important part of cloud computing is cloud architecture, which is designed by a cloud architect. It deals with the features of cloud computing systems and how they are organized. It also shows the link between these features and how useful they are.

**Cloud Services**
Cloud environments are built and structured around some architectural concepts. These are: 

Cloud Deployment Services
Cloud Delivery Services:
Cloud Infrastructure
Cloud Service Services

**Conclusion**
[Longji Vwamhi](https://gh.linkedin.com/in/longji-vwamhi-9b9054b8) advises organizations and corporate firms to adopt cloud services in their business operations. They are safer because unauthorized personnel will find it difficult to access data stored in an encrypted cloud. You can also back up your data and retrieve it if a problem occurs in the future. In addition, you don’t need to keep buying lots of physical storage devices as your data increases. However, if you are worried about how to operate cloud services, employ people that are cloud experts. Or you can hire the services of firms that provide cloud services to organizations like yours.
3 ways to find second largest number in array JavaScript
Tags: javascript, beginners, programming, tutorial
Published: 2022-08-16 04:33:00


{% youtube qap75u_09QA%}

are you looking for answer of how to find the second largest number in any array in JavaScript?
In this video i have explained 3 ways you can find the second largest number in any array in JavaScript, and also given their time complexity.


The first method involves sorting whose time complexity is O(nlogn)

The second method involves two for loop whose time complexity is O(n)

The second method involves just one for loop whose time complexity is also O(n)