teleren/devto huggingface dataset:
#1.React and ReactDOM
Tags: javascript, react, discuss, beginners
Published: 2022-08-05 09:16:00

## React and ReactDOM :
React is a javascript library. React allows to create reusable ui components with functionality. React is scaleable. We change the state like increment the number of state at the same time react update the dom. We don't need to access manually the dom and update the dom. 

This React library generates HTML
```jsx
import React from "react" //create element
const divElement = React.createElement("div", null, "hellow world")
```
This ReactDOM render the HTML in the #root div of browser.
```jsx
import ReactDOM from "react-dom"
ReactDOM.render(divElemnt, document.getElementById("#root"));
```

Babel: Web pack like Babel compile the jsx into React.createElement because javascript can't understand jsx.
```jsx
// jsx
<div className="newDiv">
  <p className="para">This is paragraph</p>
  <p className="para">Let's checkout</p>
</div>
// jsx to react
React.createElement("div", {
  className: "newDiv"
}, React.createElement("p", {
  className: "para"
}, "This is paragraph"), React.createElement("p", {
  className: "para"
}, "Let's checkout"));
```
Combination Sum IV
Tags: leetcode, programming, python
Published: 2022-08-05 09:09:13

Given an array of distinct integers nums and a target integer target, return the number of possible combinations that add up to target.

The test cases are generated so that the answer can fit in a 32-bit integer.

Solution: 


```py
class Solution:
    def combinationSum4(self, nums: List[int], target: int) -> int:
        dp = [0] * (target+1)
        dp[0] = 1
        for i in range(1, target+1):
            for num in nums: 
                num_before = i - num
                if num_before >= 0:
                    dp[i] += dp[num_before]
        return dp[target]

```
Using APIs to leverage 'wikipedia-query' in JS
Published: 2022-01-31 05:09:02

Using APIs can be super powerful in making a website and today we are going to learn how to use APIs to be able to use the `wikipedia-query` tag so we can display a wikipedia article for whatever your heart desires. Before we go further, what is an API?

An API is short for _application programming interface_ is a connection between computers or programs that allows it to communicate with a server or data base.

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

My repository that I will be referring to is linked [here](https://github.com/IST402GroupB/ip-project)

#Getting started with Fetch
We are going to communicate with the API by using fetch. What this brick of code does is basically ask to go get the data from the users IP and then store it in variables that we will use later.

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

#Using the <wikipedia-query> tag
Once we have the data we can use it to put the search terms directly into the search. Here we have some basic set up and "backbone" that powers the search but then the wikipedia query just follows the format of `<wikipedia-query search="${this.city}, ${this.state} "></wikipedia-query>` with an option to exclude a city or a state to have a more specific article brought up as shown in the code3 below.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9vwo5l69v902uv6sv3pl.png)

In summation, we are accessint the data from the users IP, using the API to dissect the information returned and storing it, then we use the wikipedia query to search for the article. Happy coding :)
What's your top YouTube channels for developers?
Tags: discuss
Published: 2022-08-05 08:53:37

Hey there!
Recently, our team made a survey among top developers from the U.S. and Europe. One of the questions was about YouTube bloggers they subscribed to. We put together the answers and select IT Influencers who share video programming tutorials and thoughts on technology trends, talk about passing a job interview and making startups in Silicon Valley. And we've added a useful podcast about web development at the end of the article.

Read more in article: https://serverspace.io/about/blog/top-youtube-channels-for-developers-from-serverspace-cloud-provider-experts/
What IDE and code editors do you use?
Tags: discuss
Published: 2022-08-05 08:51:57

Hey there 🖐
Developers and testers from our Serverspace team prefer using Visual Studio Code. This editor allows working not only with Windows and macOS, but also with Linux OS. It has a lot of extensions, and we can customize the workspace with formatting and code highlighting. And a nice bonus is that you can get all these tools for free.

We are interested in what tools other companies and developers use. Please, share your favorite code editors and IDEs and say why you use them?

You also can read a selection of IDEs and code editors from our specialists: https://serverspace.io/about/blog/best-ide-and-code-editors-for-developers/
Poll: Would you publish your package in a closed registry (e.g., not npmjs.com) to monetize your open-source library?
Tags: monetize, javascript, opensource, programming
Published: 2022-08-05 08:12:00

Dear OSS library maintainers: 

Would you publish your package in a closed registry (e.g., not npmjs.com) to monetize your open-source library?

The sourcecode would still be open in GitHub etc. but the build/compiled package would be closed. 

Please vote on:
[Twitter](https://twitter.com/paydevs_com/status/1555447983436697603) and/or [Reddit](https://www.reddit.com/r/polls/comments/wgp5sw/to_oss_maintainers_would_you_publish_your_package/)
opengauss_2.0.1_enterprise_active_standby_installation error
Published: 2022-08-05 08:07:27

Opengauss 2.0.1 Enterprise Edition: One master, one backup, one-level backup.
Environment: Try to install in 3 virtual machines of VBOX on the notebook, each virtual machine has 4G memory.
Error during installation: It is probably a problem with memory allocation, and the database cannot be started.
After manually adjusting the shared_buffers to 256M, execute
gs_om -t start to start
each node library, but there is still a memory problem at startup (but not the same as when gs_install was initially installed)
and the cluster status is abnormal, indicating that it needs to be repaired. Don't know how to deal with it.
The specific information is shown in the figure

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

, please tell me what is the reason and how to fix it?
Join our beta for 12months free subscription analytics
Tags: android, news, mobile, ios
Published: 2022-08-05 08:04:00

Hey dear developers,

This is Surie, GTM & business dev manager of Appflow.ai. We are happy to announce that our in-app subscription analytics platform is open for beta testing now, we would need your help to deliver a helpful & insightful analytic tool for subscription business. Your feedback on fixes and improvement would be greatly appreciated and followed up. 

Welcome to join us and you could have a **12-month free trial for the subscription analytics!** 😍😍

For your information, appflow.ai is a in-app subscription analytics platform, which supports:

- **[Subscription Analytics](https://www.appflow.ai/)** to show you up-to-date subscription metrics cross platforms, like MRR, LTV, Top SKUs by revenue…
- **App Cohort Analysis** to help you understand your user behaviors and demographics;
- **A/B Testing** for pricing & paywall design with flexible user segmentation;
- **Remote Configuration** on push notification and paywalls;
- **Integrations** with third-party attribution & mobile analytics tools (Adjust, Webhooks…);
- Intelligent Suggestions（Upcoming）
- Funnel Analysis (Upcoming)

➡️ sign up here 👉 https://bit.ly/3bxU3ck 👈
If you have any questions,please feel free to leave a message here or drop me an email at surie@appflow.ai.

![supscription analytics](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xk59nomwkavoqlnmi5rn.png)
A Nice Developer Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-08-05 08:00:06

---
title: "A Nice Developer Joke For Today"
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/5e1258922d1b9.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:
I’ve been hearing news about this big boolean.

Huge if true.
 -->
Fixed: WHM (CPanel) + Laravel Timezone Issue
Tags: laravel, timezone, whm
Published: 2022-08-05 07:34:00

While hosting Laravel on WHM control panel, you need to make sure to set correct timezone at 4 places:

**1. MySql Timezone**
MySql time zone is taken from server time which can be update from:

```
WHM Login > Server Configuration > Server Time
```

After update the Timezone you need to restart the server.

**2. PHP Timezone**
This will come from `php.ini` file. To update `php.ini` file you need to visit:

```
WHM Login > MultiPHP Manager > Editor Mode > Choose the PHP Version
```

Update following variable:
```
date.timezone = "UTC"
```

Restart `apache` and `php-fpm` service.

**3. Laravel Timezone**
Update laravel timezone in `config/app.php`:

```php
...
'timezone' => 'UTC',
...

```

**4. Serialize Datetime**
In your Laravel models, use following code:
```php
protected function serializeDate(\DateTimeInterface $date)
{
    return $date->format('Y-m-d H:i:s');
}
```

You can also create a `Base.php` model with the above code and extend all your `models` to `Base` model.
11 Open Source projects for you to contribute👨‍💻
Tags: javascript, opensource, beginners, html
Published: 2022-08-05 07:24:00

###Hello there 👋
 It's Codeitdoc7 this side! So you want to contribute to open source projects but don't know where to find one, worry not I got you covered here's a list of projects to contribute.

### Awesome🔥

1. [FPGA bitcoin Miner](https://github.com/progranism/Open-Source-FPGA-Bitcoin-Miner)

2. [Tessel](https://github.com/tessel/project)

3. [Udacity](https://github.com/udacity/self-driving-car)

4. [Dhanthareja](https://github.com/danthareja/contribute-to-open-source)

5. [Tapaswenip](https://github.com/tapaswenipathak/Open-Source-Programs)

6. [Bigbluebutton](https://github.com/bigbluebutton/bigbluebutton)

7. [Feathericons](https://github.com/feathericons/feather)

8. [Odoo](https://github.com/odoo/odoo)

9. [Frappe](https://github.com/frappe/gantt)

10. [Medusa](https://github.com/medusajs/medusa)

11. [First contribution](https://github.com/firstcontributions/first-contributions)

Edit - Udacity is now deprecated.

[All suggestions are welcome 💞]

###You are Awesome where can I Connect with you😎?
🚀[Github](https://github.com/Coditdoc)

🌱[Instagram](https://instagram.com/jay_g.7?igshid=YmMyMTA2M2Y=)

📨[Email] - loficode777@gmail.com

🐦[Twitter]- Soon



<a href="https://www.buymeacoffee.com/codeitdoc7" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/v2/default-red.png" alt="Buy Me A Coffee" style="height: 60px !important;width: 217px !important;"></a>
NodeJS PostgreSQL (Bahasa Indonesia) Bagian 1
Tags: javascript, node, postgres
Published: 2022-08-05 07:21:00

Tulisan pertama ini kita akan membahas bagaimana cara melakukan CRUD menggunakan NodeJS dan database PosgreSQL. Sesuai judulnya tulisan ini menggunakan bahasa indonesia.

Tulisan ini akan dibagi menjadi dua bagian yaitu bagian utama dan tambahan.

Bagian utama terdiri dari:

1. Persiapan dan Instalasi
2. Koneksi ke Database
3. Modifying data (create, update dan delete)
4. Fetching data (select)

Bagian tambahan terdiri dari:

1. Repository
2. Usecase
2. Async/Await
3. HTTP
4. Controller
5. Common Response
6. Middleware 

Tulisan berikutnya adalah [Persiapan dan Instalasi](https://dev.to/jutionck/nodejs-postgresql-bahasa-indonesia-bagian-2-5gfd)


**_[by] Jution Candra Kirana_**
Longest Palindromic subsequence (Same as Lcs)
Published: 2022-08-05 07:20:41

Given a string `s`, find the longest palindromic subsequence's length in `s`.

A subsequence is a sequence that can be derived from another sequence by deleting some or no elements without changing the order of the remaining elements.

 

**Example 1**:

```
Input: s = "bbbab"
Output: 4
Explanation: One possible longest palindromic subsequence is "bbbb".
```
**Solution**:
**Memoization approch**:
Time complexity : o(n*m) and space complexity : o(n*m) + o(n) (o(n) is extra stack space utilized)
```java
//intuition
/*
normal or brute force way: generate all possible subsequences and find the largest subsequence that is palindrome;
optimal approach : 
Using Logic of longest common subsequence;
example : if s = bbbab, lets reverse it as r = babbb
now the we can perform longest common subsequence to get result as 3 (bbb) and that will be the required result;


*/
class Solution {
    public int longestPalindromeSubseq(String s) {
        //bottom up approach
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        String r= sb.reverse().toString();
        int dp[][] = new int[s.length()][r.length()];
        for(int row[]: dp){
            Arrays.fill(row,-1);
        }
        return longestPalindromicSubsequence(s.length()-1,r.length()-1,s,r,dp);
    }
    
    //Memoization approach
    public int longestPalindromicSubsequence(int i,int j, String a, String b,int dp[][]){
        if(i<0 || j<0){
            return 0;
        }
        if(dp[i][j]!=-1) return dp[i][j];
        if(a.charAt(i)==b.charAt(j)){
           return dp[i][j] = 1 + longestPalindromicSubsequence(i-1,j-1,a,b,dp);
        }
        return dp[i][j]= 0 + Integer.max(longestPalindromicSubsequence(i,j-1,a,b,dp),
                              longestPalindromicSubsequence(i-1,j,a,b,dp));
    }
}
```
**Tabulation Approach**:
Time complexity : o(n*m) and space complexity : o(n*m)

```java
class Solution {
    public int longestPalindromeSubseq(String s) {
        //bottom up approach
        StringBuilder sb = new StringBuilder();
        sb.append(s);
        String r= sb.reverse().toString();
        int dp[][] = new int[s.length()+1][r.length()+1];
        
        //base case
        //its 1 base indexing
        //lets put first row and first column as 0
        for(int i = 0;i<=s.length();i++){
            dp[i][0] = 0;
            dp[0][i] = 0;
        }
        for(int i =1;i<=s.length();i++){
            for(int j =1;j<=r.length();j++){
                if(s.charAt(i-1)==r.charAt(j-1)){
                    dp[i][j] = 1 + dp[i-1][j-1];
                }
                else dp[i][j] = 0 + Integer.max(dp[i][j-1],dp[i-1][j]);
            }
        }
        return dp[s.length()][r.length()];
    }
}
```
Podcast – Generating random game events
Tags: gaming, podcast, unity3d
Published: 2022-08-07 14:16:24

---
title: Podcast – Generating random game events
published: true
date: 2022-08-05 06:59:30 UTC
tags: Gaming,Podcasts,Unity
canonical_url: https://peterwitham.com/podcasts/podcast-generating-random-game-events/?utm_source=rss&utm_medium=rss&utm_campaign=podcast-generating-random-game-events
---

Podcast Episode - Random game events can bring players a sense of freshness and discovery. Here's my solution to finding the right balance.

{% spotify spotify:episode:0xVtlEQRBPnHGOC0QNijkq %}

The post [Podcast – Generating random game events](https://peterwitham.com/podcasts/podcast-generating-random-game-events/) appeared first on [Peter Witham](https://peterwitham.com).
Installing Tomcat on an EC2 instance
Tags: aws, ec2, tomcat, apache
Published: 2022-08-05 06:50:00

Prerequisite: You will need to have an Amazon account
Log into your amazon account and launch and EC2 instance. I chose the free tier here and launched the EC2 instance will be running Amazon Linux 2. I have a detailed article on how to launch and EC2 machine here.
Make sure that we have Java JDK11 also installed on our Amazon EC2 instance. Only after that, we can proceed with the installation.
Tomcat runs on port number 8080 so make you have that open in your instance Security Group.

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

I used MobaXterm to SSH into my EC2 instance, but you are free to use whatever tool you like. Start and SSH session, enter your remote host IP, username and then under advance tab, load your privatKey


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

Make sure that you have root access on your EC2 instance and then proceed with Java JDK11 installation and check your Java version after the the installation to make sure. 

```
amazon-linux-extras install java-openjdk11
java -version
```


![Java](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/doal3rhf0exwhjahdvpg.JPG)



 After that, install TomCat by grabbing the link on TomCat official website


```
wget https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.65/bin/apache-tomcat-9.0.65.tar.gz
```

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

Extract and install it with the line bellow 


```
tar -xvzf apache-tomcat-9.0.65.tar.gz
```

 cd to Tomcat and run ll to see the content. From the content cd to the bin folder and from  there you will be able to start your tomcat server with ./startup or shut it down with the ./shutdown  command 


```
cd apache-tomcat-9.0.65
ll
cd bin
ll
./shutdown
./startup

```

 Form there you will be able to access your tomcat server with your instance IP fronted by port 8080, which is the default for Tomcat 

![TomCatHome](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o4lc2pt5qw6l24xknjg1.JPG)

 Happy install TomCatUp!
Quill Forms | New open source Typeform alternative based on React JS and Typescript
Tags: javascript, react, typescript, wordpress
Published: 2022-08-05 06:43:06

Hi Folks,
We have created an open source Typeform alternative based on React and Typescript. 

## Github: 

https://github.com/quillforms/quillforms

## Codesandbox:

{% embed https://codesandbox.io/embed/quill-forms-example-20uuf?fontsize=14&hidenavigation=1&theme=dark"

 %}

## WordPress
We have also a free WordPress version for Quill Forms: https://wordpress.org/plugins/quillforms

Please let us know your thoughts!
Hope you enjoy the project!
5️⃣ Free VS Code Extension You Must Know 👨‍💻
Tags: vscode, javascript, webdev, beginners
Published: 2022-08-05 06:35:08

🌟 Rapid ApiClient 🌟

🌟 Better Comments 🌟

🌟Peacock 🌟 

Follow @devkshitij7  
For More Amazing Posts ✌️🌟
What to use instead of SWIFT technology?
Tags: cryptoprocessing, cryptocurrency, swift
Published: 2022-08-05 06:23:26

The use of bank cards has become more difficult: both ordinary users and global businesses suffer from restrictions in different countries. People refuse to buy because of high commissions, companies receive fewer orders — the economy suffers as a result.

People try to use alternative methods of payment, but they don’t remedy the situation:

— Wise’s service requires Russian citizens to confirm that they no longer reside in the country. To make a transfer, you need to provide a driver’s license, a residence permit, or a visa valid for more than six months;

— The European neobank Revolut uses the same scheme, but it can be deposited from a Binance account (which must be created in advance);

— “Golden crown” remains the most popular way, but because of the double conversion of currencies, users lose a large percentage of the amount.

The most profitable way in the current circumstances is cryptocurrency — the interest in this case is much lower, and the withdrawal of funds is very simple. This option is comfortable for both people and businesses: an online application is connected to the brand’s website or app, which allows paying for goods and services using wallets with digital assets.

0xprocessing is an innovative cryptoprocessing service that integrates easily into any business. The service:

— Works worldwide;

— Supports payment volatility risk control system;

— Works with 40+ types of cryptocurrencies;

— Integrates Web 3.0 wallets;

— Has a high level of confidentiality;

— Conducts recurring payments.

The team behind the project is constantly working on easy user access to the product and carefully responds to incoming requests. With a tight connection to the business, 0xprocessing creates a truly friendly product and is considered one of the market leaders.

If you want to connect cryptoprocessing to your business, contact us:
http://0xprocessing.com
pr@0xprocessing.com
JavaScript Ternary Operator
Tags: javascript, beginners
Published: 2022-08-05 06:10:00

Ternary operator 

Ternary operator can help you make your code easier to read while making it super effective when using a truthy or falsy value. This operator is the only JavaScript operator that takes in three operands. A condition followed by a question mark then an expression that executes if the statement is truthy, followed by a colon and an expression that executes if the statement is falsy.


Syntax
The syntax for the ternary operator is short, that’s why using the ternary operator over an if else statement has its pros.
Condition ? exprIfTrue : exprIfFalse

**Example**
const age = 15
const canDrive = age >= 16 ? "You can drive" : "Not old enough"
console.log(canDrive)


In the example, we declared a variable called age and had that equal 15. After that we declared another variable that takes in the age variable and a condition if age is greater than or equal to 16 the truthy expression “you can drive” get executed if the number is below that then the falsy expression will execute. 

**Why use a ternary operator over an if else statement**
It is great to use a ternary operator over an if else statement because when you use an if else statement those run multiply lines of codes and can get messy and hard to read. While if you use a ternary operator you only have to use one line of code to execute the same thing your if else statement was doing but making it easier to read and using fewer lines of codes.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5p3se7yo0haxrscr8o5x.jpeg)
Bootcamp Prework Project
Tags: webdev, beginners, html, devjournal
Published: 2022-08-05 06:05:43

08.04.2022 | Thursday

Hello World ! today marks 4 days until the first day of bootcamp!

As a boot camp student, I want to have a Prework Study Guide website, so that I can review all the information throughout this bootcamp. This includes topics like HTML, CSS, Git, and JavaScript :)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvs1mhy1piuyi8x1y5c7.jpg)

Right now I am currently working on the HTML section of this project.

I will keep you guys up to date!
Career Advice!
Tags: career, beginners, productivity, discuss
Published: 2022-08-05 05:49:47

## Friendly advice.

⚡ Please invest your time more in building an attractive-looking **LinkedIn profile**. 

-
-


⚡ You showcase more of yourself on LinkedIn better than your _CV/Resume_ as it put a very limited part of your **career in the limelight.** 

-
-


⚡Any reputable organization would like to consider you to join them if they get to observe your **LinkedIn interactions**, your **feeds interactions**( likes and comments), and your **perspective and vision.**
.
.
.
It helps you a lot in your career. Trust me, it really does.

---------------------------