teleren/devto huggingface dataset:
A Quick 10-Second Programming Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-07-23 08:00:11

---
title: "A Quick 10-Second Programming 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/5e1258dec9298.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:___ What airline do developers prefer when they're in a rush?

___A:___ Delta.
 -->
10 interesting packages for Svelte.
Tags: javascript, svelte, npm, programming
Published: 2022-07-23 07:57:42

Today we have a weekend so I would like to show some npm packages for Svelte:

1) Formula - This is a package to create forms with svelte:
[Formula](https://tanepiper.github.io/svelte-formula/)

2) Do you want to create a drag and drop application? Now It's easy?
[svelte-dnd-action](https://github.com/isaacHagoel/svelte-dnd-action?ref=svelte.news)

3) Sometimes we need a map in an application, but GoogleMaps can quickly be very expensive, so this is a solution:
[leaflet](https://ngyewch.github.io/svelte-leaflet/getting-started/)

4) How to document a Svelte application? This package will help you:
[svelte-docs](https://alexxnb.github.io/svelte-docs/getting-started/)

5) Do You want to build an application for smartphones? Nothing easier: 
[svelte native](https://svelte-native.technology/)
And here there is a tutorial on how to use it:
[How svelte native works](https://dev.to/deotyma/how-svelte-native-works-2pel)

6) Do You want to use a typewriter effect in your app? So this is an answer:
[svelte-typewriter](https://github.com/henriquehbr/svelte-typewriter#readme)

7) Maybe you want to speak with your app? Why not:
[svelte-speech-recognition](https://github.com/jhubbardsf/svelte-speech-recognition#readme)

8) Sometimes it is easier to have some elements ready to use:
[Fluent svelte](https://fluent-svelte.vercel.app/docs/getting-started)

9) Modals are not always easy to create...
[svelte-modals](https://svelte-modals.mattjennings.io/)

10) And now confetti...
[svelte-confetti](https://mitcheljager.github.io/svelte-confetti/)

This is some interesting packages (confetti is my favorite) for this weekend.
NextAuth: Custom user data
Tags: nextjs, webdev
Published: 2022-07-23 07:31:06

I want to use custom user data but, I faced a trap. So I want to show you.

```
export default NextAuth({
  providers: [
    // ...some probiders
  ],
  callbacks: {
    async signIn({ user, account, profile, email, credentials }){
      // You cannot use spread syntax
      // user = {...[Your variable]}
      user.[Your variable] = {
        // ...some properties
      }
    },
    async jwt({ token, user }){
      // You cannot use spread syntax
      // token = {...user.[Your variable]}
      token.[Your variable] = user.[Your variable]
    },
    async session({ session, token }){
      // You cannot use spread syntax
      // session = {...token.[Your variable]}
      session.[Your variable] = token.[Your variable]
    }
  }
})
```
Xbox Will Get Discord Voice Chat Soon
Tags: xbox, news, socialmedia
Published: 2022-07-29 04:39:02

---
title: Xbox Will Get Discord Voice Chat Soon
published: true
date: 2022-07-23 07:30:09 UTC
tags: Xbox,News,SocialMedia
canonical_url: https://www.geekgreenish.eu.org/xbox-will-get-discord-voice-chat-soon/
---

 ![Xbox Will Get Discord Voice Chat Soon](https://digitalpress.fra1.cdn.digitaloceanspaces.com/drzf32y/2022/07/Xbox-y-Discord-vincular-cuentas.webp)

Who really is ready for Discord? Discord Voice Chat will be coming to the Xbox platform, and Microsoft and the Xbox team have announced that it will begin rolling out to Xbox Insiders today by becoming to the general public "soon."

For example, the update will be accessible to "select" Insiders today and to more Insiders in the upcoming weeks. You may "directly initiate group calls or voice channels to chat with anyone on Discord from your console."

> Halo Infinite multiplayer matches are intended to be played with friends on PC and consoles. With your friends, are you exploring new biomes in Minecraft? Do you see them already playing a cross-play game? Join their voice channel and have a chat as you all play.

When the function becomes available to you, you must link your Discord account with Xbox in order to start using it. To do this, press the Xbox guide button, go to Parties & chats, and then select Try Discord Voice on Xbox.

However, it becomes a bit unclear after that. To connect to a Discord Voice Chat via your gaming console, you first must scan a QR code on your phone, establish up a two-way link between both the Discord and Xbox apps, and then use the Discord app's "Join on Xbox" feature. At least, that's the general feeling we have of the instructions so far.

Below are a few screenshots showing the feature in use

 ![Xbox Will Get Discord Voice Chat Soon](https://digitalpress.fra1.cdn.digitaloceanspaces.com/drzf32y/2022/07/discord-voice-chat-is-coming-to-xbox-starting-today-for-insiders-1.webp)

 ![Xbox Will Get Discord Voice Chat Soon](https://digitalpress.fra1.cdn.digitaloceanspaces.com/drzf32y/2022/07/discord-voice-chat-is-coming-to-xbox-starting-today-for-insiders-2.webp)

<!--kg-card-begin: markdown-->

> Source: [PureXbox](https://www.purexbox.com/news/2022/07/discord-voice-chat-is-coming-to-xbox-starting-today-for-insiders) and [Xbox News](https://news.xbox.com/en-us/2022/07/20/discord-voice-chat-for-xbox-insiders/)

<!--kg-card-end: markdown-->
What was your win this week?
Tags: discuss, weeklyretro
Published: 2022-07-23 07:19:42

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

Hey there! 


Looking back on this past week, what was something you were proud of accomplishing?

All wins count — big or small 🎉

Examples of 'wins' include:

- Starting a new project
- Fixing a tricky bug
- Trying out a new hobby... or whatever else might spark joy ❤️ 

---

Have a wonderful weekend!


![Resting cat with the words "happy weekend" above](https://media.giphy.com/media/W2b8JkhIwnVH7Sr1zl/giphy.gif)
What is RedwoodJS?
Published: 2022-07-23 07:14:26

RedwoodJS is a full-stack serverless web application framework built by Tom Preston Werner (co-founder of Github) et al. This framework provides the mechanism to build JAMstack applications very fast. Such applications can be deployed with ease just with a git push command.

Being a full-stack framework means that the frontend code and backend code are all maintained in the same RedwoodJS project. The frontend is a React application while the backend is a GraphQL server. RedwoodJS follows best practices in folder structures, it has pre-defined places where codes are kept. In the below sections we will first learn how to scaffold a RedwoodJS project and we will go through the features in a RedwoodJS [project](https://www.informasirumahdijual.com/).
1179. Leetcode Solution in Mysql
Tags: mysql
Published: 2022-07-23 07:09:34

```
# Write your MySQL query statement below
select id, 
	sum(case when month = 'jan' then revenue else null end) as Jan_Revenue,
	sum(case when month = 'feb' then revenue else null end) as Feb_Revenue,
	sum(case when month = 'mar' then revenue else null end) as Mar_Revenue,
	sum(case when month = 'apr' then revenue else null end) as Apr_Revenue,
	sum(case when month = 'may' then revenue else null end) as May_Revenue,
	sum(case when month = 'jun' then revenue else null end) as Jun_Revenue,
	sum(case when month = 'jul' then revenue else null end) as Jul_Revenue,
	sum(case when month = 'aug' then revenue else null end) as Aug_Revenue,
	sum(case when month = 'sep' then revenue else null end) as Sep_Revenue,
	sum(case when month = 'oct' then revenue else null end) as Oct_Revenue,
	sum(case when month = 'nov' then revenue else null end) as Nov_Revenue,
	sum(case when month = 'dec' then revenue else null end) as Dec_Revenue
from department
group by id
order by id
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/reformat-department-table/
Simak Tips Simpel Mendekorasi Kamar Tidur
Published: 2022-07-23 07:06:21

Ada suatu waktu ketika kita melihat sekeliling kamar tidur dan menyadari bahwa ada kebutuhan untuk melakukan dekorasi ulang. Tapi Anda mungkin memikirkan anggaran yang harus dikeluarkan. Anda tetap bisa mendapatkan kamar tidur yang lebih baik dengan anggaran lebih sedikit atau bahkan tanpa mengeluarkan anggaran. Lihatlah disekitar Anda dan carilah hal-hal yang dapat Anda gunakan untuk mendesain ulang kamar tidur Anda. Yang pasti, ada begitu banyak cara dan ide kreatif untuk membuat suasana kamar tidur tampak lebih baru.

Bukan berarti hanya karena Anda memiliki anggaran yang lebih rendah, Anda tidak bisa mendapatkan jenis kamar tidur yang Anda inginkan. Pertama, dengan melihat beberapa inspirasi dekorasi kamar tidur kemudian mencoba untuk membayangkan bagaimana jika desain tersebut diimplementasikan dikamar tidur rumah Anda. Selain itu, ada hal-hal lain yang masih bisa Anda lakukan untuk mendekorasi kamar tidur. Berikut ini beberapa [tips untuk mendekorasi kamar tidur dengan pengeluaran yang minim](https://auliajavaland.com/tips-mudah-mendekorasi-kamar-tidur-dengan-pengeluaran-yang-minim/).
1053. leetcode solution in Cpp
Tags: cpp
Published: 2022-07-23 07:00:35

```
class Solution {
 public:
  vector<int> prevPermOpt1(vector<int>& A) {
    const int n = A.size();
    int l = n - 2;
    int r = n - 1;

    while (l >= 0 && A[l] <= A[l + 1])
      l--;
    if (l < 0)
      return A;
    while (A[r] >= A[l] || A[r] == A[r - 1])
      r--;
    swap(A[l], A[r]);

    return A;
  }
};

```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/previous-permutation-with-one-swap/
1403. leetcode solution in Cpp
Tags: cpp
Published: 2022-07-23 06:58:05

```
class Solution {
public:
    vector<int> minSubsequence(vector<int>& nums) {
        if(nums.size() == 0) return vector<int>();
        sort(nums.rbegin(), nums.rend());
        
        int sum = accumulate(nums.begin(), nums.end(), 0);
        int curSum = 0;
        int i = 0;
        vector<int> ans;
        
        while(curSum <= sum/2.0){
            ans.push_back(nums[i]);
            curSum += nums[i];
            i++;
        }
        
        return ans;
    }
};
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/minimum-subsequence-in-non-increasing-order/
1304. Leetcode Solution in Java
Tags: java
Published: 2022-07-23 06:53:45

```
class Solution {
  public int[] sumZero(int n) {
        int[] A = new int[n];
    for (int i = 0; i < n; i++) {
      A[i] = i * 2 - n + 1;
    }

    return A;
  }
}
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/find-n-unique-integers-sum-up-to-zero/
1160. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-23 06:51:53

```
class Solution {
 public:
  int countCharacters(vector<string>& words, string chars) {
    int ans = 0;
    vector<int> count(26);

    for (const char c : chars)
      ++count[c - 'a'];

    for (const string& word : words) {
      vector<int> tempCount(count);
      for (const char c : word)
        if (--tempCount[c - 'a'] < 0) {
          ans -= word.length();
          break;
        }
      ans += word.length();
    }

    return ans;
  }
};

```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/find-words-that-can-be-formed-by-characters/
1030. Leetcode Solution in Cpp
Tags: cpp
Published: 2022-07-23 06:49:31

```
class Solution {
public:
    //https://www.educative.io/edpresso/how-to-sort-a-map-by-value-in-cpp
    static bool val_comparator(pair<vector<int>, int>& a, pair<vector<int>, int>& b){
        return a.second < b.second;
    };
    
    vector<vector<int>> allCellsDistOrder(int R, int C, int r0, int c0) {
        vector<pair<vector<int>, int>> distances;
        vector<vector<int>> ans;
        
        for(int i = 0; i < R; i++){
            for(int j = 0; j < C; j++){
                distances.push_back(make_pair(vector<int>{i, j}, abs(i-r0)+abs(j-c0)));
            }
        }
        
        sort(distances.begin(), distances.end(), val_comparator);
        
        for(vector<pair<vector<int>, int>>::iterator it = distances.begin(); it != distances.end(); it++){
            ans.push_back(it->first);
        }
        
        return ans;
    }
};
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/matrix-cells-in-distance-order/
1923. Leetcode Solution in Java
Tags: java
Published: 2022-07-23 06:39:34

```
class Solution {

    private static int mod1 = 1000000007;
    private static int mod2 = 1000000009;
    private static int base1, base2;

    public int longestCommonSubpath(int n, int[][] paths) {
        int ans = 0;
        int m = paths.length;
        int len = 1000005;
        Random random = new Random();
        base1 = random.nextInt(10000000 - 1000000 + 1) + 1000000;
        base2 = random.nextInt(10000000 - 1000000 + 1) + 1000000;
        System.out.println(base1 + " " + base2);
        for (int i = 0; i < m; i++)
            len = Math.min(len, paths[i].length);
        int l = 1, r = len;
        while (l <= r) {
            int mid = (l + r) / 2;
            if (check(n, paths, mid)) {
                ans = mid;
                l = mid + 1;
            } else
                r = mid - 1;
        }
        return ans;
    }

    private static boolean check(int n, int[][] arr, int len) {
        int m = arr.length;
        long mul1 = 1, mul2 = 1;
        for (int i = 1; i <= len; i++) {
            mul1 = mul1 * base1 % mod1;
            mul2 = mul2 * base2 % mod2;
        }
        Set<Long> s = new HashSet<>();
        for (int i = 0; i < m; i++) {
            long hash1 = 0, hash2 = 0;
            for (int j = 0; j < len; j++) {
                hash1 = (hash1 * base1 + arr[i][j]) % mod1;
                hash2 = (hash2 * base2 + arr[i][j]) % mod2;
            }
            Set<Long> t = new HashSet<>();
            long val = hash(hash1, hash2);
            if (i == 0 || s.contains(val))
                t.add(val);
            for (int j = len; j < arr[i].length; j++) {
                hash1 = ((hash1 * base1 % mod1 - (long) arr[i][j - len] * mul1 % mod1 + arr[i][j]) % mod1 + mod1) % mod1;
                hash2 = ((hash2 * base2 % mod2 - (long) arr[i][j - len] * mul2 % mod2 + arr[i][j]) % mod2 + mod2) % mod2;
                val = hash(hash1, hash2);
                if (i == 0 || s.contains(val))
                    t.add(val);
            }
            if (t.isEmpty())
                return false;
            s.clear();
            for (Long ss : t)
                s.add(ss);
        }
        return true;
    }

    private static long hash(long hash1, long hash2) {
        long val1 = String.valueOf(hash1).hashCode();
        long val2 = String.valueOf(hash2).hashCode();
        return val1 << 16 ^ val2;
    }
}
```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/longest-common-subpath/
This week’s newsletter is out! (23-07-2022) - Stop bullying me peoples of Vietnam and the Network States
Tags: javascript, tech, webdev, discuss
Published: 2022-07-23 06:47:06

---
title: This week’s newsletter is out! (23-07-2022) - Stop bullying me peoples of Vietnam and the Network States
published: true
description: Another week of great javascript, tech and web development links.
tags: javascript, tech, webdev, discuss
---

Stop bullying me peoples of Vietnam and the Network States

https://markjgsmith.substack.com/p/mark-smiths-newsletter-23-07-2022

Would love to hear any comments and feedback you have.

[@markjgsmith](https://twitter.com/markjgsmith)
2328. Leetcode Solution in Python3
Tags: python
Published: 2022-07-23 06:43:59

```
class Solution:
    def countPaths(self, grid: List[List[int]]) -> int:
        final=0
        mod=10**9+7 
        stack=[]
        n=len(grid)
        m=len(grid[0])
        visited=defaultdict(bool)
        def toposort(v):
            visited[v]=True 
            neighbours=[(v[0]+1,v[1]),(v[0]-1,v[1]),(v[0],v[1]+1),(v[0],v[1]-1)]
            for i,j in neighbours:
                if 0<=i<n and 0<=j<m and visited[(i,j)]==False and grid[i][j]>grid[v[0]][v[1]]:
                    toposort((i,j))
            stack.append(v)
        for i in range(n):
            for j in range(m):
                if visited[(i,j)]==False:
                    toposort((i,j))
        stack.reverse()
        dp=defaultdict(int)
        for i in range(len(stack)):
            x,y=stack[i]
            v=(x,y)
            dp[(x,y)]+=1
            neighbours=[(v[0]+1,v[1]),(v[0]-1,v[1]),(v[0],v[1]+1),(v[0],v[1]-1)]
            for i,j in neighbours:
                if 0<=i<n and 0<=j<m and grid[i][j]>grid[v[0]][v[1]]:
                    dp[(i,j)]+=dp[(x,y)]
                    dp[(i,j)]%=mod
            final+=dp[(x,y)]
            final%=mod
        return final
            
        
```

#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/number-of-increasing-paths-in-a-grid/
Google Developer Student Clubs.
Tags: googledeveloperstudentclub, community
Published: 2022-07-23 06:43:37

## **Google developer student club **
is important for all students who want to enhance their skills practically as a developer. It allows and gives the students free opportunity to face real-life challenges. Students study theoretical things in their universities and colleges all the time, and it is helpful in a way, but most students don’t know how to imply that in their careers ahead. Those students who are motivated to create a great future ahead but internally are introverts and want to think out of the box but are just going with the flow of their life, mostly they get confused and shy away from their problems and don’t seek help, afraid they might get hurt, or what if they are wrong? But GDSC appreciates them asking about their problems freely from their mentors, provided by GDSC, for students from time to time on different levels. It is a great advantage for all levels of students to seek guidance from their seniors and build personal and professional connections, which can help them in their future ahead. They can access all Google Developer resources and work together on small problems in a friendly but learning environment.
Python Input / Output
Tags: python, programming, beginners, tutorial
Published: 2022-07-23 06:40:00

To write output to the screen in Python, use the print() function. The data type of the output message is always converted to the data type string. Other data types like integer or float must therefore be converted to a string by the str() or repr() function.

str() and repr() are both functions used to get a string representation of an object.
str() is used to create the output for the end user, while repr() is mainly used for debugging and development. The str() Function thus returns a user friendly string representation of an object. The repr() Function returns a developer friendly description of the object.


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


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

Source: [Python Input / Output](https://codevisionz.com/lessons/python-input-output/)
Comments in Java Programming Language
Tags: java, programming, tutorial, beginners
Published: 2022-07-23 06:31:12

A comment is text that the compiler ignores but is useful for programmers. Comments are typically used to annotate code for reference. The compiler treats them as spaces. You can use comments during the test to make certain lines of code inactive.


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


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4fg85oruznoh5l6oj59r.png)
Best Programming Practices in Python.
Tags: programming, python, discuss, beginners
Published: 2022-07-23 06:28:00

Here are some things to keep in mind while writing python codes.

1. Comment on your code.
2. Create and use functions to make your program smarter and more flexible.
3. Use of proper identifiers.
4. Space your code so it would be easier to read.
5. Properly Indent your condition, loop, and when defining functions and classes.
6. Code regularly.

**1. Comment on your code.**
 This might seem unnecessary at first but commenting on your code is a good step in programming, anyone else that reads your code will understand what it does easier and so would you, I am personally guilty of not regularly commenting on code but I'm working on it to develop myself, so should you, I saw changes when I do so and separate the code to parts to understand what easy line or statement does and why it does that, commenting is thus a good programming practice. This can be done by using "#".

**2. Create and use functions to make your program smarter and more flexible.**
Python is regarded as a multi-paradigm programming language since it can be used for structural, functional, object-oriented, and so on. It is therefore a good practice to use functions as regularly as possible, to minimize repetition of codes written beforehand and make the code more understandable.

**3 . Use of proper identifiers**
 Use names and not letters when programming so it can be easily read and understood, avoid the use of letters like "I"," a", "j", even when creating loops its unprofessional, instead use words that relate to the program so it will be understood by you and anyone else who reads your code, use your English wisely and your code will be more mature and professional.
 
**4 . Space your code so it would be easier to read.**
 The interface in vs code, pydroid, pycharm, or any other python programming interface is closely limitless, so why write code on every single line that makes it quite difficult to know which path does what? A single space in between parts of the code goes a long way and looks more pleasing to the eye as much as you can leave space don't leave too much, that is, about 4 to 5 lines in a row, space smartly and see how your code looks.
 
**5. Properly Indent your condition, loop, and when defining functions and classes.**
Make sure you indent your conditional statements as well as your loops also when defining functions and classes to avoid generating an error and to know when the statement begins and when it ends to avoid a statement being under a such when it wasn't intended.
 
**6. Code regularly.**
 The need for consistency cannot be overemphasized, code regularly, follow steps on programming, try challenges and problems, and soon writing code will be easier.

Thanks for reading, comment your thoughts and more practices you feel will make programming easier and more professional.