teleren/devto huggingface dataset:
A Quick 10-Second Programming Joke For Today
Tags: jokes, dailydeveloperjokes
Published: 2022-05-30 08:00:20

---
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/5e1259d7cf335.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 went to a street where the houses were numbered 8k, 16k, 32k, 64k, 128k, 256k and 512k.

It was a trip down Memory Lane.
 -->
GA4 - Firebase integration
Tags: firebase, googleanalytics
Published: 2022-05-30 07:55:53

Hello, with the Firebase and Google Analytics 4 integration, I have  the following situation:

- we have created one Firebase project with 20 application, which is linked with **one** Google Analytics property.
- The next step is to send a **Country event**, which means that when a user downloads the app from the Android or iOS store and opens it for the first time, the user will be given the option of selecting the country. This option of selecting a country will trigger an event.
- This event must be parsed to a specific Google Analytics property when the user picks a country from the drop-down menu, for which we created **24 Google Analytics properties for each country**.
- I'm wondering what the ideal method is for sending the **event for Country specific from Firebase to a certain Google Analytics property from those 24 property.**
What Games can Make you a Better Developer? 🎮
Tags: watercooler, productivity, discuss
Published: 2022-05-30 07:54:20

I believe in the power of YES... concerning, if you want to take away something from everything, you can! Recently, I treated myself with the indie game [Papers, please!](https://store.steampowered.com/app/239030/Papers_Please/), which in its core is about being in a boarder checkpoint, checking papers of travelers and potentially finding forgeries. 

So, what does this have to do with my professional career as a software developer? Easy, doing code reviews, comparing files and finding mistakes in them 😄📝!

What games do you feel let you practice some handy skill, not only speaking of professional situations and not only thinking of *video* games? 💭

Photo by [Francesco Ungaro](https://www.pexels.com/de-de/@francesco-ungaro/?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels) on [Pexels](https://www.pexels.com/de-de/foto/mosaik-alien-an-der-wand-1670977/?utm_content=attributionCopyText&utm_medium=referral&utm_source=pexels) 🎉
Creating Golang CRON Jobs
Tags: automation, go, cron
Published: 2022-05-30 07:52:35

Scheduled tasks allow you to run specific code at a specified interval of time and are primarily used within a CI/CD system to perform a variety of operations like nightly builds, GitHub repository cleanup, newsletters, and service monitoring, among others. You can use scheduled jobs to send notifications when a process succeeds or fails and to perform batch tasks without any human involvement.

In this article, you'll learn to create CRON jobs in Golang, a statically typed, compiled programming language designed by engineers at Google. Golang contains the best features from C and Python, like memory safety, automatic garbage collection, structural typing, and concurrency, to name a few. Specifically, you'll learn to use **gocron** and **cron.v2** to schedule tasks, explore the limitations of using these packages, and then consider a serverless and easy-to-use approach to task scheduling using Airplane.

Read the full blog on [Airplane](https://www.airplane.dev/blog/creating-golang-cron-jobs).

Thanks for reading 💜

---

I publish a [monthly newsletter](https://www.ravsam.in/newsletter/) in which I share personal stories, things that I am working on, what is happening in the world of tech, and some interesting dev-related posts which I come across while surfing on the web.

Connect with me through [Twitter](https://twitter.com/ravgeetdhillon) • [LinkedIn](https://linkedin.com/in/ravgeetdhillon) • [Github](https://github.com/ravgeetdhillon) or send me an [Email](mailto:ravgeetdhillon@gmail.com).

— [Ravgeet](https://www.ravgeet.in/), *Full Stack Developer and Technical Content Writer*
How to find max number in an array using tail recursion in java
Published: 2022-05-30 07:46:25

What exactly is tail recursion?

Let’s understand this, in traditional recursion, we perform our recursive calls first and during this, each recursive call gets stored in a stack. When it reaches the base case it starts returning to previous calls, each recursive call returns some values, we use these returned values to calculate the end result. Also, during the backtracking, each stored recursive call gets popped up from the stack.

In this manner, we don’t get the result of your calculation until we have returned from every recursive call.

The problem with this approach is the size of the stack is fixed, and when there are so many calls JVM may throw a stackoverflow error.

The solution to the above problem is tail recursion.

In tail recursion, we perform our calculations first, and then we execute the recursive call, passing the results of our current step to the next recursive step. This results in the last statement being in the form of

```
 return recursive-function (params))
```
. Basically, the return value of any given recursive step is the same as the return value of the next recursive call.

```
public class LargestNumber {
    public static void main(String[] args) throws Exception {
        int[] arr = new int[] {1, 10, 9, 5, 9, 4, 15, 12, 19};
        System.out.println(largestNumber(arr, arr.length, 0));
    }

    private static int largestNumber(int[] arr, int length, int result) {
        if (length == 1) return Math.max(arr[0], result);
        else return largestNumber(arr, length - 1, Math.max(arr[length - 1], result));
    }
}
```
In our above example, we are calculating the max in each step and then passing the result as the parameter of the recursive call.

```
Math.max(arr[length-1],result)
```
Google maps: MarkerClusterer and GridAlogrithm example
Tags: maps, cluster, example, google
Published: 2022-05-30 07:45:26

Here is an example of how to use the "@googlemaps/markerclusterer":

```javascript
// ...other imports and then,
import { MarkerClusterer, GridAlgorithm } from "@googlemaps/markerclusterer";

// ... your other map code here

/* Note:
GridAlgorithm seems to be better then the default or 
standard algorithm which is SuperClusterAlgorithm
*/
const algorithm = new GridAlgorithm({
  gridSize: 60
});
new MarkerClusterer({map, markers, algorithm});
```
"Property pattern"lar haqida...
Tags: csharp, dotnet
Published: 2022-05-30 07:45:20

C# 8 dan boshlab ifodani property yoki fieldarini 'property pattern' orqali solishtirish mumkin bo'ldi:

```
static bool IsConferenceDay(DateTime date) => date is { Year: 2020, Month: 5, Day: 19 or 20 or 21 };
```
Property pattern - ifoda natijasi null bo'lmaganda ifodaga mos keladi va har bir ichki o'rnatilgan pattern ifoda natijasining tegishli xususiyati yoki maydoniga mos keladi.

```
Console.WriteLine(TakeFive("Hello, world!"));  // output: Hello
Console.WriteLine(TakeFive("Hi!"));  // output: Hi!
Console.WriteLine(TakeFive(new[] { '1', '2', '3', '4', '5', '6', '7' }));  // output: 12345
Console.WriteLine(TakeFive(new[] { 'a', 'b', 'c' }));  // output: abc

static string TakeFive(object input) => input switch
{
    string { Length: >= 5 } s => s.Substring(0, 5),
    string s => s,

    ICollection<char> { Count: >= 5 } symbols => new string(symbols.Take(5).ToArray()),
    ICollection<char> symbols => new string(symbols.ToArray()),

    null => throw new ArgumentNullException(nameof(input)),
    _ => throw new ArgumentException("Not supported input type."),
};
```
Property pattern -  rekursiv patterndir. Ya'ni, har qanday patternni ichki pattern sifatida ishlatishingiz mumkin. Quyidagi misolda ko'rsatilganidek, ma'lumotlar qismlarini ichki o'rnatilgan patternlarga moslashtirish uchun property patterndan foydalanilgan:

```
public record Point(int X, int Y);
public record Segment(Point Start, Point End);

static bool IsAnyEndOnXAxis(Segment segment) =>
    segment is { Start: { Y: 0 } } or { End: { Y: 0 } };
```
Yuqoridagi misolda C# 9.0 va undan keyingi versiyalarida mavjud bo'lgan ikkita xususiyatdan foydalaniladi: `or` [pattern combinator](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/patterns#logical-patterns) va [record types](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/record).


C# 10 dan boshlab, siz ichki xususiyatlar yoki maydonlarga to'gridan-to'g'ri murojaat qilishingiz mumkin. Masalan, oldingi misoldagi usulni quyidagi ekvivalent kodga qayta tiklashingiz mumkin:

```
static bool IsAnyEndOnXAxis(Segment segment) =>
    segment is { Start.Y: 0 } or { End.Y: 0 };
```
Usha gap uncha chunmagan bosela mamittan ko'rvorurasila [property pattern](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-8.0/patterns#property-pattern)!
Looking for CV improvement suggestions.
Published: 2022-05-30 07:05:49

Hello, Greetings to Everyone. I aspire to be a Frontend web developer. At the moment I am thinking about applying for jobs but before applying, I want to improve my CV. Any kind of suggestions to improve my CV would be much appreciated. TIA
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5la77ih5skjl9gvdqmfc.png)
How To Use Web Components in React
Tags: react, javascript, webdev, programming
Published: 2022-05-30 06:56:58

![Shaking Hands](https://miro.medium.com/max/1400/1*_DkdD2OIUAxz8M_0_8lDxw.png)

Web Components enable us to develop entirely independently of frontend frameworks.
{% medium https://medium.com/@mariusbongarts11/how-to-use-web-components-in-react-54c951399bfd %}
C# da ifodalarni tekshirishning ustuvorligi va tartibi
Tags: csharp, dotnet
Published: 2022-05-30 06:46:49

Quyidagi roʻyxatda pattern kombinatorlarinig ustuvorligi kamayib borish tartibida ko'rsatilgan:

- `not`
- `and `
- `or`

Quyidagi misolda ko'rsatilganidek, ustuvorlikni aniq belgilash uchun qavslardan foydalanilgan:

```
static bool IsLetter(char c) => c is (>= 'a' and <= 'z') or (>= 'A' and <= 'Z');
```
Qo'shimcha malumot olish uchun [pattern combinators](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-9.0/patterns3#pattern-combinators ) bo'limiga qarang.
How to Create a Static Web App in Azure Portal
Tags: azureappfunction, creatresource, azureaccount
Published: 2022-05-30 06:41:41

1. Create an Azure account.
2. Create a Resource group .
3. Create a Function App.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9lpteslrnvovqsyfbx2q.png)
 
Click on the Function App, a requirement form will cm up fill the page, after filling up the required details on the form, slide down to the blue button at the bottom and click create. There will be a validation process don't worry just give it a few minutes and you will see your function app.
**Note** you must not forget to leave your function app running, as this will finish your subscription on the Azure portal.
kindly go to the bar above on the function app and click stop. This will keep the Function App there till when you log on to your Azure account again and your subscription will be safe.
How to add TailwindCSS to Vue Storefront 2
Tags: javascript, vue, tailwindcss, typescript
Published: 2022-05-30 06:37:27

TailwindCSS is becoming a number one CSS framework on the market. Whether you like it or not, it is being used in more and more applications and it is also coming as a default for some popular projects. Due to its simplicity and many Developer Experience improvements, Tailwind joined a DX Gang and has a safe position there.

In this article, I would like to guide you through the process of adding TailwindCSS to your Vue Storefront project. It can be used as an alternative to Storefront UI styles or be used with it.

## Vue Storefront

If you are not yet familiar with Vue Storefront, it is Lightning-Fast Frontend Platform for Headless Commerce. Boost your site performance, shape the customer journey and free your developer's creativity with Vue Storefront, the last frontend you will ever need. 

![Vue Storefront](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1adt9yw9byndirxn6ymt.png)
 

You can check out more about it here:
* [Portfolio](https://www.vuestorefront.io/)
* [Docs](https://docs.vuestorefront.io/)

## Storefront UI

Vue Storefront uses by default a really useful UI Library called Storefront UI. It was designed based on Google for Retail report and specifically for E-Commerce. It is really customizable and allows to accelerate the development of your e-commerce application by a mile!

![Storefront UI](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36sbfljy4cqxdcouvsz4.png)

You can read more about it here: 
* [Portfolio](https://www.vuestorefront.io/storefront-ui)
* [Docs](https://docs.storefrontui.io/)

## Adding TailwindCSS to VSF

As Vue Storefront uses Nuxt.js under the hood, the process of adding it to your project is relatively simple. Especially with the recent release of a new version of [Tailwind Module for Nuxt](https://tailwindcss.nuxtjs.org/) that you can check the code [here](https://github.com/nuxt-community/tailwindcss-module). In this version, you do not need to register tailwind config nor postcss config in your nuxt application in order to make it work. How briliant is that?

In order to install the Tailwind module in Vue Storefront application we need to run:

```bash
yarn add @nuxtjs/tailwindcss # npm install @nuxtjs/tailwindcss
```

Then, we need to register it in the `modules` array of our `nuxt.config.js` file:

```ts
  modules: [
    // Other modules
    '@nuxtjs/tailwindcss'
  ],
```

Finally, to test if it works, we can add some Tailwind styles to our wrapper component:

```html
<div id="home" class="bg-blue-300">
```

And this should be a result:

![Demo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsz43mslhkl3zexs2muw.png)
 
## Summary

Well done! You have successfuly added TailwindCSS to your Vue Storefront project. Keep in mind however, that Storefront UI wasn't designed to work with TailwindCSS out of the box so in order to replace the styles you would have to adjust several CSS variables and this process is described [here](https://docs.storefrontui.io/?path=/docs/getting-started-integrations-tailwindcss--page#customizing-variables)
An online no-code tool to create Flutter apps.
Tags: flutter, nocode, beginners
Published: 2022-05-30 06:32:00

In today’s blog, I would like to share an online no-code tool to create Flutter apps. So without further delay let’s start.

Many people don’t know much about Flutter app development, but they still want to create the app in Flutter. For those people, there is an online no-code Flutter app development tool called FlutterFlow.

FlutterFlow is founded by two Google developers to create custom Flutter apps using the drag and drop feature. It is backed by Y Combinator and was featured at Google I/O.

Here are some features of FlutterFlow:

- FlutterFlow is an online no-code tool. So you can create a small app in a few hours.
- FlutterFlow supports the drag and drops feature. So you can easily add and remove any element.
- FlutterFlow supports Firebase integration.
- FlutterFlow supports third-party APIs integration also.
- After completion of your app, you can easily export your code. If you know Flutter app development then you can edit also.

It has a free basic plan but in that plan, major features are not available. You can check out the platform from the below link.

Link: [FlutterFlow](https://flutterflow.io/)

I hope this blog found you well.
The blog is sponsored by: [UniqueApps](https://uniqueapps.net/)
FoalTS framework - Version 2.9 is here 🎉
Tags: typescript, node, javascript
Published: 2022-05-30 06:31:00

---
title: FoalTS framework - Version 2.9 is here 🎉
published: true
description: Version 2.9 release notes
tags: TypeScript, NodeJS, JavaScript
cover_image: https://foalts.org/blog/twitter-banners/version-2.9-release-notes.png
---

Version 2.9 of [Foal](https://foalts.org/) has been released! Here are the improvements that it brings.

## New OAuth2 Twitter Provider

After LinkedIn, Google, Github and Facebook, Foal now supports Twitter for social authentication.

👉 [Link to the documentation](https://foalts.org/docs/authentication-and-access-control/social-auth/)

A big thanks to [@LeonardoSalvucci](https://github.com/LeonardoSalvucci) for having implemented this feature.

```typescript
// 3p
import { Context, dependency, Get } from '@foal/core';
import { TwitterProvider } from '@foal/social';

export class AuthController {
  @dependency
  twitter: TwitterProvider;

  @Get('/signin/twitter')
  redirectToTwitter() {
    // Your "Login In with Twitter" button should point to this route.
    // The user will be redirected to Twitter auth page.
    return this.twitter.redirect();
  }

  @Get('/signin/twitter/callback')
  async handleTwitterRedirection(ctx: Context) {
    // Once the user gives their permission to log in with Twitter, the OAuth server
    // will redirect the user to this route. This route must match the redirect URI.
    const { userInfo, tokens } = await this.twitter.getUserInfo(ctx);

    // Do something with the user information AND/OR the access token.
    // If you only need the access token, you can call the "getTokens" method.

    // The method usually ends with a HttpResponseRedirect object as returned value.
  }

}
```

## OAuth2 Providers support PKCE Code Flow

OAuth2 abstract provider now supports PKCE code flow. If you wish to implement your own provider using PKCE, it's now possible!

## Support for version 15 of `graphql` and latest version of `type-graphql`

Foal's dependencies have been updated so as to support the latest version of [TypeGraphQL](https://typegraphql.com/).

> _Original publication: https://foalts.org/blog/2022/05/29/version-2.9-release-notes_
"Logical pattern"lar haqida..
Tags: csharp, dotnet
Published: 2022-05-30 06:24:21

C# 9.0 dan boshlab, biz quyidagi 'logical pattern'ni yozish uchun `not`, `and` , va `or` pattern kombinatorlaridan foydalanamiz:

- Negated(inkor) `not` pattern :

```
if (input is not null)
{
    // ...
}

```

- Conjunctive `and` pattern - ikkala qolip ham ifodaga mos kelganda ishlatiladi:

```
Console.WriteLine(Classify(13));  // output: High
Console.WriteLine(Classify(-100));  // output: Too low
Console.WriteLine(Classify(5.7));  // output: Acceptable

static string Classify(double measurement) => measurement switch
{
    < -40.0 => "Too low",
    >= -40.0 and < 0 => "Low",
    >= 0 and < 10.0 => "Acceptable",
    >= 10.0 and < 20.0 => "High",
    >= 20.0 => "Too high",
    double.NaN => "Unknown",
};
```
Disjunctive `or` pattern - har qanday qolip ifodaga mos kelganda ishlatiladi:

```
Console.WriteLine(GetCalendarSeason(new DateTime(2021, 1, 19)));  // output: winter
Console.WriteLine(GetCalendarSeason(new DateTime(2021, 10, 9)));  // output: autumn
Console.WriteLine(GetCalendarSeason(new DateTime(2021, 5, 11)));  // output: spring

static string GetCalendarSeason(DateTime date) => date.Month switch
{
    3 or 4 or 5 => "spring",
    6 or 7 or 8 => "summer",
    9 or 10 or 11 => "autumn",
    12 or 1 or 2 => "winter",
    _ => throw new ArgumentOutOfRangeException(nameof(date), $"Date with unexpected month: {date.Month}."),
};
```
Yuqoridagi misoldan ko'rinib turibdiki, siz pattern kombinatorlarini pattern ichida qayta-qayta ishlatishingiz mumkin.
PowerApps for application development
Published: 2022-05-30 06:22:21

After the release of Microsoft PowerApps, many Microsoft subscribers are thinking that Microsoft PowerApps is designated as a replacement for InfoPath. Microsoft PowerApps provides many features that are available in InfoPath and enables enterprise users to create, collaborate, communicate and manage mobile apps without having developer skills. Also, Microsoft PowerApps can be integrated easily with any other services of the Office365 ecosystem such as Azure AD, Power Automate, MySql, PowerBI, Planner, Microsoft Teams, SharePoint, etc. From this perspective, Microsoft PowerApps. can be hyped as the successor of InfoPath. some of its special features include,
*Drag and Drop control
*Offline Capability
*View, create and modify SharePoint lists and libraries
*Native mobile features including camera controls
*No code required
I'd love to know your thoughts on the PowerApps. I found it helpful especially the Workflow Automation, Are you using other tools/app to replace InfoPath? I'm curious to know your experience, add a comment below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/08pzzhcsmqgpgppljrkj.jpg)
Digital Transformation at it's best
Published: 2022-05-30 06:19:52

Business process automation is highly appreciated by enterprises that deal with multiple interrelated processes like document and asset management. With business process automation tools, companies can decrease operational costs and increase employee productivity.

Welcome to the Era of full Digital Automation.
With Microsoft SharePoint, paperless communication, file documentation management, enterprise integration & collaboration, business intelligence, and other business process automation can be achieved faster, simpler and it remains the most secure way to store and share your documents.


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