teleren/devto huggingface dataset:
Bootstrap open Accordion after Ajax loaded
Tags: javascript, bootstrap, css, ajax
Published: 2022-06-04 13:27:01

[Accordion](https://getbootstrap.com/docs/5.2/components/accordion/) is a nice component of Bootstrap. It uses [Collapse](https://getbootstrap.com/docs/5.2/components/collapse/) feature of Bootstrap. It works properly under the hood but sometimes you need to do something different. In my case I needed to click on accordion header, then send an Ajax request and get the content of accordion and then open it. There was not a straigh-forward API or document for that and finally I find it.

```
<script>
    let prevent = true;

    $("#collapseThree").on("show.bs.collapse", function (e) {
        if (prevent) {
            e.preventDefault();
        }
        setTimeout(function () {
            prevent = false;
            $("#collapseThree").collapse("show");
            prevent = true;
        }, 1000);
    });
</script>
```
In this example, I've added an event on the open state of collapse and I've used a `setTimeout` function for simulate Ajax request.
Excel Sheet Column Number
Tags: leetcode, dsa, theabbie
Published: 2022-06-04 13:00:47

Given a string `columnTitle` that represents the column title as appears in an Excel sheet, return _its corresponding column number_.

For example:

A -> 1
B -> 2
C -> 3
...
Z -> 26
AA -> 27
AB -> 28 
...

**Example 1:**

**Input:** columnTitle = "A"
**Output:** 1

**Example 2:**

**Input:** columnTitle = "AB"
**Output:** 28

**Example 3:**

**Input:** columnTitle = "ZY"
**Output:** 701

**Constraints:**

*   `1 <= columnTitle.length <= 7`
*   `columnTitle` consists only of uppercase English letters.
*   `columnTitle` is in the range `["A", "FXSHRXW"]`.

**SOLUTION:**

    class Solution:
        def titleToNumber(self, columnTitle: str) -> int:
            total = 0
            for c in columnTitle:
                total = 26 * total + ord(c) - ord('A') + 1
            return total
Liferay e-Commerce Headless API
Tags: liferay, headlessapi, react, ecommerce
Published: 2022-06-04 12:35:11

Anybody worked on Liferay Ecommerce using React and Liferay Headless API's. Can you help us in understanding the required APIS for the ECommerce portal User Journey. We are working on a Hybrid Environment for the ecommerce application development.
Karate Game
Tags: javascript, beginners, opensource, gamedev
Published: 2022-06-04 12:20:46

If you also want to **Develop Game** with Java Script, Check it ones.

This Game is made by using HTML, HTML Canva, CSS, Java Script.
If you want to use this game live click on  [Karate Game](https://harshit-paneri.github.io/canvas-game/martial/main.html)


You can play this game and most important if you are a game developer or wants to become a game developer , Take a chance to add any feature in this game , GitHub repository : [Karate Game](https://github.com/harshit-paneri/canvas-game)

This Repository is beginner friendly you can try it as your first opensource project also.
Roadmap to Full-Stack Development
Tags: webdev, discuss, learn, programming
Published: 2022-06-04 12:17:27

📌 **Who is a Full-Stack Developer?**
A full-stack developer is an engineer who can handle all the work of databases, servers, systems engineering, and clients. Depending on the project, what customers need may be a mobile stack, a Web stack, or a native application stack

📌 **Why become a Full-Stack Developer?**
As a full-stack developer, you know of multiple technologies. Whether it's about adding images to a web page or creating a database, you'd be familiar with all of them. This gives you an edge over other developers because you can make technical decisions faster and see the big picture.

📌 **Roles of Full-Stack Developer:**
The primary responsibility of a Full Stack Developer includes designing user interactions on websites, developing servers and databases for website functionality, and coding for mobile platforms.

📌 **Particular responsibilities often include:**

**1.**  Developing front-end website architecture.
**2.**  Designing user interactions on web pages.
**3.**  Developing back-end website applications.
**4.**  Creating servers and databases for functionality.
**5.**  Ensuring cross-platform optimization for mobile phones.
**6.**  Ensuring responsiveness of applications.
**7.**  Working alongside graphic designers for web design 
        features.
**8.**  Seeing through a project from conception to finished product.
**9.**  Designing and developing APIs.
**10.** Meeting both technical and consumer needs.
**11.** Staying a breast of developments in web applications and 
        programming languages.

**📌 Tech-Stack for a Full-Stack Developer**


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


🚩 **Basic Tech (Building blocks & All are important)**
**1.** HTML: Defines the structure of the application
**2.** CSS: Defines how the application will be presented
**3.** JavaSript: Defines the functionality of the application

🚩 **Back-End Technology (Any one of the following)**

- Java
- Python
- C#
- Ruby
- Php
- Node.js (Easy and Latest)

🚩 **DataBases (Any one of each category)**

**1.** SQL
-  MySQL (Preferrable)
-     SQL Server
-     Oracle

**2.** NoSQL
- MongoDB (Preferrable)
- CouchDB

**🚩 Version Control**
- Git
- GitHub (Preferrable) / GitLab / BitBucket

**🚩 Cloud Services (Any one of the following)**
- Google Cloud Platform (GCP)
- Microsoft Azure
- Amazon Web Services (AWS)
- Heroku

**🚩 Containers**
- Docker
- Kubernetes

**📌 Common terms for Full-Stack Development**
- MEAN Stack Developer
     - Mongo DB
     - Express Js
     - Angular Js
     - Node Js

- MERN Stack Developer
    - Mongo DB
    - Express Js
    - React Js
    - Node Js
You can use this blog as a checklist in your journey

**❤️ Thank you very much for reading ❤️**
Like | Share | Follow
How to fix MongoCompatibility Error when connecting to Azure Cosmos DB
Tags: webdev, javascript, tutorial, node
Published: 2022-06-04 11:32:27

## Introduction
Last week I was trying to connect my Nodejs Application with Cosmos DB, I had already been using mongo DB and I saw that Azure had Mongo DB API connector for Cosmos DB and i decided to use this because I love Azure.
I was able to create it using the azure portal.
Next was to connect this on my node JS web app. 


### Creating the first connection
I googled how to do this and came across some [repository ](https://github.com/Azure-Samples/angular-cosmosdb/blob/master/src/server/mongo.js)on microsoft sample on how to do this and I tried to follow how they created the connection, it was like this

```
const mongoUri = `mongodb://${env.accountName}:${env.key}@${env.accountName}
.documents.azure.com:${env.port}/
${env.databaseName}
?ssl=true`;
```
I went to my azure portal, clicked on setting then opened connection string and copied all the details requested from me only to see this in the terminal when i ran this. 

```
error: MongoCompatibilityError: Server at XXXXX- 
 XXXX.documents.azure.com:10255 reports maximum   
wire version 2, but this version of the Node.js Driver  
  requires at least 6 (MongoDB 3.6)
```
### Troubleshooting
I googled and google and did not find a solution to this it was like this error did not exist anywhere. 

### Solution

My solution to this was to change the code for mongoUri to exactly what is in azure microsoft primary connection string.

Thought i would share this for someone who might encounter this challenge when connecting their Azure Cosmos DB API for MongoDB. 


Thank you for reading this.
Isomorphic Strings
Tags: leetcode, dsa, theabbie
Published: 2022-06-04 12:00:40

Given two strings `s` and `t`, _determine if they are isomorphic_.

Two strings `s` and `t` are isomorphic if the characters in `s` can be replaced to get `t`.

All occurrences of a character must be replaced with another character while preserving the order of characters. No two characters may map to the same character, but a character may map to itself.

**Example 1:**

**Input:** s = "egg", t = "add"
**Output:** true

**Example 2:**

**Input:** s = "foo", t = "bar"
**Output:** false

**Example 3:**

**Input:** s = "paper", t = "title"
**Output:** true

**Constraints:**

*   `1 <= s.length <= 5 * 104`
*   `t.length == s.length`
*   `s` and `t` consist of any valid ascii character.

**SOLUTION:**

    class Solution:
        def isIsomorphic(self, s: str, t: str) -> bool:
            smap = {}
            tmap = {}
            slist = []
            tlist = []
            i = 0
            for c in s:
                if c not in smap:
                    smap[c] = i
                    i += 1
                slist.append(smap[c])
            i = 0
            for c in t:
                if c not in tmap:
                    tmap[c] = i
                    i += 1
                tlist.append(tmap[c])
            return slist == tlist
Flapper - Your new first class
Tags: travel, flights, marketplaces, mobileapp
Published: 2022-06-04 11:53:04

Flapper draws together Latin America's best helicopter and private jet fleets to deliver a revolutionary private flight experience. Have it your way —indulge in a private jet charter or join other Flapper members on a shared flight. Flapper guarantees the most complete private aviation offer, including jets, turboprops, and helicopters.

https://www.flyflapper.com
Find Closest Number to Zero
Tags: leetcode, dsa, theabbie
Published: 2022-06-04 11:30:46

Given an integer array `nums` of size `n`, return _the number with the value **closest** to_ `0` _in_ `nums`. If there are multiple answers, return _the number with the **largest** value_.

**Example 1:**

**Input:** nums = \[-4,-2,1,4,8\]
**Output:** 1
**Explanation:**
The distance from -4 to 0 is |-4| = 4.
The distance from -2 to 0 is |-2| = 2.
The distance from 1 to 0 is |1| = 1.
The distance from 4 to 0 is |4| = 4.
The distance from 8 to 0 is |8| = 8.
Thus, the closest number to 0 in the array is 1.

**Example 2:**

**Input:** nums = \[2,-1,1\]
**Output:** 1
**Explanation:** 1 and -1 are both the closest numbers to 0, so 1 being larger is returned.

**Constraints:**

*   `1 <= n <= 1000`
*   `-105 <= nums[i] <= 105`

**SOLUTION:**

    class Solution:
        def findClosestNumber(self, nums: List[int]) -> int:
            return min(nums, key = lambda x: (x * x, -x))
How to get 52 free domains per year...
Tags: webdev, beginners
Published: 2022-06-04 11:30:03

This week I was considering hardships I experienced when starting my developer journey, one of which being free domains and the difficult nature of procuring them. When thinking of this I decided I should share one of the easiest and most secure ways to get 52 free domains in 52 weeks!

## The value of domains...
Domain names are strings that often translate to physical server addresses such as matt.lgbt or mjdws.com; they allow you to connect to a web server and gain access to the site’s content. As well as being a simple path to access a web server, domains allow you to put your brand name against your website as well as being another part of the endless customisation of these assets and the construction of a consistent brand identity. With the power that a domain has to drive traffic to a site and connect a brand with their website, they can be worth anywhere from $5-$1M+ with the average domain name costing between $10-$20.

## How can a domain be free?
Domains always cost someone, whether it’s the central registry, the registrar, or the customer, there is almost always a cost for all of these parties with the registration of a new domain. Usually free domains are immediately guessed to have the .ga, .gq, .tk, .ml, or .cf, TLD, but what if I told you that you could get a TLD such as .co, .tech, .study, .biz, .courses, .us, .tel, .design, .club, .compare, or .select completely free for a year as many as 52 times per year as well?

If a domain is free, it’s still being paid for by someone somewhere. This is where hackathons come into this! Almost every hackathon you ever compete in will have a domain sponsor, this could be GoDaddy Registry, Domain.com, Verisign or any other licensed domain registrar. In most hackathons at least one registrar will be offering a free domain for use in your hackathon project. Hackathon organisations such as MLH host a hackathon every weekend and with 52 weeks in a year that means 52 opportunities to get a free domain!

## So how do I claim my free domain?
To claim a free domain all you need to do is participate in a hackathon with free domain sponsor. You can claim a free domain with a provided code or URL and set your project underway by immediately claiming your name and setting out a thorough and consistent brand identity.

## What if I wanted a different TLD?
While it is difficult to get alternative TLDs for free, there are still options to get them affordably! I recommend using Dynadot and if you use my referral link (http://www.dynadot.com?s8i6L8pAu9Br7M) and spend $10, you automatically get $5 back on your Dynadot account to spend on more domains or ready for your domain renewal!

## Disclaimer
While it is definitely possible to register 52 domains per year and potentially more please remember that these domains are meant for projects entered in hackathons and should not be registered for alternative purposes.
While these domains are free you may still be subject to alternative privacy fees and/or renewal costs.
Python while loop
Tags: beginners, programming, python, tutorial
Published: 2022-06-04 11:10:34

An iteration or loop is the repetition of a sequence of instructions or statements performed until a certain condition is reached.
These are used in complex calculations or projects that required a block of code to be performed more than once based on certain conditions that will be stopped based on the program.
An example of a while loop is this:
Code:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olkf17i1t6afd82lnbpd.png)
Output:

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

To walk you through the code above 
It starts by assigning the integer 10 to the variable number.
The next line shows the use of the statement which can be read as "while number is not equal to 10, run this program"
The program will print "No" until the condition is reached 
And the final line, which increments the number( number+=1 is also the same as number =number +1)
This is done to get the program to run for a finite number of time and avoid an infinite loop
An Infinite loop is a program in a loop that will keep running endlessly cause there is no increment or decrement made to ensure the number gets to a specified value to stop
An infinite loop can be created from the code above by removing the last line:
Code:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sixvzx35zducnmlck53k.png)
Output:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/anmdq20kcsasknpssv21.png)
Or a simple infinite loop like 
While(True):
Print("yes")

To perform a more flexible program 
The if statement and be added in a while loop 
Code:

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/erw4henejpvfgj3fnms1.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dl56ibyl8uxndnz2qq52.png)
Hope you enjoyed this lesson and learned from it 
Read, like, share, comment, and see you in the next lesson
Clojure Tutorial Part 6 -- repl で ring-jetty-adapter でワンラインで サーバーを起動する
Tags: clojure
Published: 2022-06-04 11:10:13


## 参考

https://scrapbox.io/ayato-p/Part1_Web%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AF%E3%81%98%E3%82%81%E3%81%AE%E4%B8%80%E6%AD%A9

引き続き、ayato-p さんの記事を参考に Clojure で web を書いていく。

## project.clj の dependencies に Ring を追加する

root/project.clj を開いてみる

```clj
(defproject cljblog "0.1.0-SNAPSHOT"
  :description "CLJ web app"
  :dependencies [[org.clojure/clojure "1.10.3"]]
  :main ^:skip-aot cljblog.core
  :target-path "target/%s"
  :profiles {:uberjar {:aot :all
                       :jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})
```

デフォルトではこうして description や dependencies、profiles
並んでいる

project.clj というファイルは Node.js の pakcage.json のようなライブラリを管理するファイルだと解釈する。

また、Clojure では Node.js で `npm i {packagaName}` でインストールするのと違って、ライブラリを追加するときはファイルに直接書き込むらしい。

```clj
  :dependencies [
    [org.clojure/clojure "1.10.3"]
    [ring/ring-core "1.8.0"]
    [ring/ring-jetty-adapter "1.8.0"]
  ]
```

- ring-core
- ring-jetty-adapter

これらのライブラリを dependencies に追加する

カッコのスタイルは まだ慣れないので、一時的に JS と同じにしてます。

---

## lein repl で動作確認する

```php
lein repl

Retrieving 
ring/ring-core/1.8.0/ring-core-1.8.0.jar from clojars
Retrieving ring/ring-jetty-adapter/1.8.0/
ring-jetty-adapter-1.8.0.jar from clojars
Retrieving ring/ring-codec/1.1.2/
ring-codec-1.1.2.jar from clojars
Retrieving ring/ring-servlet/1.8.0/
ring-servlet-1.8.0.jar from clojars

cljblog.core=> 
```

lein repl で CLI 起動した際、依存関係がダウンロードされる。

```clj
(require '[ring.adapter.jetty :as jetty])
```

依存関係に追加した ring jetty adapter を import して

```clj
(def server (jetty/run-jetty \
(fn [_] {:body "Hello, world!"}) \
{:port 3000 :join? false})) \
```

即時関数で 引数の 
body に Hello World の文字列を指定して
port に 3000 を指定して
実行する。

```php
2022-06-04 19:58:12.556:INFO:
oejs.Server:nREPL-session-123abc: 
Started @341863ms
#'cljblog.core/server
```

すると、サーバーが起動して

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

ブラウザで確認できる。

---

## サーバーの停止

```clj
(.stop server)

2022-06-04 22:07:42.958:INFO:
oejs.AbstractConnector:nREPL-session-1234: 
Stopped ServerConnector@5ec4d432
{HTTP/1.1,[http/1.1]}{0.0.0.0:3000}

nil
```

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

これで先ほど起動させたサーバーを停止できる。

---

## 今後

https://scrapbox.io/ayato-p/Part1_Web%E3%82%A2%E3%83%97%E3%83%AA%E3%82%B1%E3%83%BC%E3%82%B7%E3%83%A7%E3%83%B3%E3%81%AF%E3%81%98%E3%82%81%E3%81%AE%E4%B8%80%E6%AD%A9

参考記事の続きの、サーバーを起動、停止、再起動するファイルを作って
それを使ってコマンドとして使えるようにするところをやる

---

## まとめ

Clojure と lein でサーバーを起動するには

project.clj ファイルに 

- ring-core
- ring-jetty-adapter

これらを追加して

repl を起動して

run-jetty に body と port を渡す即時関数を動かす

すると、ブラウザで確認できる。
Convert BST to Greater Tree
Tags: leetcode, dsa, theabbie
Published: 2022-06-04 11:00:46

Given the `root` of a Binary Search Tree (BST), convert it to a Greater Tree such that every key of the original BST is changed to the original key plus the sum of all keys greater than the original key in BST.

As a reminder, a _binary search tree_ is a tree that satisfies these constraints:

*   The left subtree of a node contains only nodes with keys **less than** the node's key.
*   The right subtree of a node contains only nodes with keys **greater than** the node's key.
*   Both the left and right subtrees must also be binary search trees.

**Example 1:**

![](https://assets.leetcode.com/uploads/2019/05/02/tree.png)

**Input:** root = \[4,1,6,0,2,5,7,null,null,null,3,null,null,null,8\]
**Output:** \[30,36,21,36,35,26,15,null,null,null,33,null,null,null,8\]

**Example 2:**

**Input:** root = \[0,null,1\]
**Output:** \[1,null,1\]

**Constraints:**

*   The number of nodes in the tree is in the range `[0, 104]`.
*   `-104 <= Node.val <= 104`
*   All the values in the tree are **unique**.
*   `root` is guaranteed to be a valid binary search tree.

**Note:** This question is the same as 1038: [https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/](https://leetcode.com/problems/binary-search-tree-to-greater-sum-tree/)

**SOLUTION:**

    # Definition for a binary tree node.
    # class TreeNode:
    #     def __init__(self, val=0, left=None, right=None):
    #         self.val = val
    #         self.left = left
    #         self.right = right
    class Solution:
        def revinorder(self, root):
            if root:
                self.revinorder(root.right)
                self.curr += root.val
                root.val = self.curr
                self.revinorder(root.left)
        
        def convertBST(self, root: Optional[TreeNode]) -> Optional[TreeNode]:
            self.curr = 0
            self.revinorder(root)
            return root
Process Github webhooks with GCP Cloud Functions
Tags: serverless, gcp, python, github
Published: 2024-06-19 20:25:10

---
title: Process Github webhooks with GCP Cloud Functions
published: true
date: 2022-06-04 10:55:17 UTC
tags: serverless,GCP,Python,GitHub
canonical_url: https://blog.gkomninos.com/process-github-webhooks-with-gcp-cloud-functions
---

Process github webhooks when a Pull Request is approved and write some data in a Google Sheet using Python and GCP Cloud Functions.
1 million Developer Club
Tags: discuss
Published: 2022-06-04 10:50:48

## Dev community size (millions) >10M

1. Github 73
2. Apple 28
3. StackOverflow 17
4. Javascript 16.4
5. Python 11.3
6. Bitbucket 10
7. Postman 10

## Dev community size (millions) 5-10M

1. Java 9.6
2. C/C++# 7.5
3. PHP 7.3
4. C# 7.1
5. HackerRank 6
6. Twilio 5
7. Salesforce 5
8. Celebros (NLP technology) 5
9. J-Frog Artifactory 5

## Dev community size (millions) 2-5M

1. Digital Ocean 3.5
2. Visual Tools 3.6
3. NVIDIA 3
4. HackerEarth 2.9
5. SAP Cloud Platform 2.8
6. Kotlin 2.9
7. Swift 2.5
8. DZone 2.2
9. Go 2
10. Docker 2
11. HERE 2
12. Kaggle 2
13. Tencent Cloud 2
14. BrowserStack 2

## Dev community size (millions) 1-2M


1. Mapbox 1.6
2. WeChat Apps 1.5
3. Dart 1.4
4. Objective C 1.4
5. Topcoder 1.4
6. Ruby 1.4
7. Cocos2d-x 1.3
8. Rust 1.1
9. Google Cloud 1

## Dev community size (millions) 1-2M

1. Lua 0.8
2. Cisco 0.5
3. Cisco DevNet 0.5
4. Adobe 0.5
5. Lens | The Kubernetes Platform 0.5
6. Amazon Game Tech 0.3
7. GitGuardian 140K
8. App Developer Magazine 90K
9. 4Scotty 50K
10. Dgraph 30K
11. Circle CI 25K
12. IOHK 16K
13. Turing 5K
14. Open Networking Foundation 2K
15. Meili Search 1K
16. Symbl.ai 1K

## New Startup 

1. videosdk.live 1k+
2. Dhiwise.com 1k+
3. flutterflow.com 1k+

Reference - https://www.1milliondeveloperclub.com/

Comment your favorite dev tool
باربری آنلاین اصفهان اصفهان بار sfahanbar
Published: 2022-06-04 10:49:14

باربری آنلاین اصفهان  اصفهان بار sfahanbar
[باربری آنلاین اصفهان ](https://www.sfahanbar.com/%D8%A8%D8%A7%D8%B1%D8%A8%D8%B1%DB%8C-%D8%A2%D9%86%D9%84%D8%A7%DB%8C%D9%86-%D8%A7%D8%B5%D9%81%D9%87%D8%A7%D9%86-05-%D9%86%DA%A9%D8%AA%D9%87-%D8%A8%D8%B1%D8%A7%DB%8C-%D9%81%D9%87%D9%85%DB%8C%D8%AF)یک سال جدید اینجاست همه این قوانین جدید از 1 ژانویه 2022 به اجرا در می‌آیند، مگر اینکه خلاف آن بیان شود. فکر می‌کنید ما یک تغییر بزرگ را از دست داده‌ایم؟ لطفا در نظرات زیر به ما اطلاع دهید. سال نو مبارک! آیا می توان احتکار را محکوم کرد؟
اگر اوضاع به اندازه کافی بد شود، هیئت بهداشت محلی می تواند ملک را محکوم کند. اگر زباله، زباله و زباله های دیگری در حیاط شخصی وجود داشته باشد که دیگران را تحت تأثیر قرار دهد، احتمال آن بیشتر است.افراد با این سطح از احتکار را می توان همسایه بد نامید. زمانی می توان اقدام کرد که وضعیت به اندازه کافی جدی باشد که بر ارزش ملک محله تأثیر بگذارد.