teleren/devto huggingface dataset:
What is All-in-One-Cluster’s Clubhouse Clone?
Tags: clubhouse, webdev, productivity, software
Published: 2022-06-06 10:56:55

[All-in-One-Cluster](https://allinonecluster.com/)’s (AiOC) [Clubhouse clone](https://allinonecluster.com/clubhouse-clone) app is designed and developed by our professional that is similar to that of the original Clubhouse app. Our developers have put in several man hours in making Clubhouse clone more efficient and better equipped to provide the users with the best possible audio chat experience.

Our professionals at AiOC have put in the extra effort to make our Clubhouse clone script more than just a replica of the original app. Keeping the business and revenue model of the Clubhouse app as the foundation apps like Clubhouse of AiOC has reinvented other aspects of the app such as UI/UX design, features list, payment gateway, functionalities, etc. 

This makes AiOC’s Clubhouse clone a lot more proficient than the original app itself. With a long list of features, robust functionality, and excellent tech stack apps like Clubhouse of AiOC is everything you want for an audio social media app.
What is your favorite thing about open source solutions
Tags: opensource, watercooler, programming, discuss
Published: 2022-06-06 10:44:31

Open source solutions are widely loved by the developer community as they have many advantages. We've also seen a rise in the number of open source alternatives like [Medusa](https://github.com/medusajs/medusa) that provide similar services as proprietary solutions.

What's your favorite thing about open source solutions? And if you could recommend one open source solution to other developers which one would it be?

P.S: Medusa is holding a small context to win a free t-shirt! [Check it out before it ends next week](https://dev.to/medusajs/customize-the-homepage-of-our-nextjs-storefront-and-win-a-t-shirt-from-medusa-2fde)!
Build your own X
Tags: discuss, sideprojects, showdev
Published: 2022-06-06 10:42:42

---
title: Build your own X
published: true
description: 
tags: discuss, sideprojects, showdev
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
If you are looking to build anything cool, I think this repo is helpful for you:
https://github.com/codecrafters-io/build-your-own-x

Build anything in your favorite languages!
Headless ExpressionEngine: Using Bones to Create a Static Site
Tags: expressionengine, eecms, headless, jigsaw
Published: 2022-06-06 13:56:58

---
title: Headless ExpressionEngine: Using Bones to Create a Static Site
series: Headless ExpressionEngine
published: true
date: 2022-06-06 10:34:00 UTC
tags: ExpressionEngine,eecms, headless, Jigsaw
canonical_url: https://u.expressionengine.com//article/headless-expressionengine-using-bones-to-create-a-static-site
cover_image: https://u.expressionengine.com/asset/article-images/bones-banner.jpg
---

ExpressionEngine is so powerful under the hood when it comes to managing content. In this example, we’ll use [Bones](https://expressionengine.com/add-ons/bones) to use the data from our EE site to build out a static site, using a static site generator called [Jigsaw](https://jigsaw.tighten.co/). We’ll explore a bit of API safety, as well as managing data coming from EE.

If you haven’t, watch the first part of our series on Bones here: [Using ExpressionEngine To Power Your JavaScript Frontend Using Bones](https://u.expressionengine.com/course/headless-expressionengine/using-expressionengine-to-power-your-javascript-frontend-using-bones)

YouTube: {% youtube h5OdDCKr9po %}

Bones is a super simple way to utilize ExpressionEngine as a headless content management system for use in javascript frontends, static site builders, and more!

Bones Hello World: [https://github.com/dougblackjr/bones-hello-world](https://github.com/dougblackjr/bones-hello-world)

 -- 

Originally published by [Doug Black](https://u.expressionengine.com/author/doug-black) at [u.expressionengine.com](https://u.expressionengine.com//article/headless-expressionengine-using-bones-to-create-a-static-site)
multiple filter
Published: 2022-06-06 10:31:43

AND
```py
class Product(models.Model):
    id = models.CharField(max_length=10, primary_key=True)
    title = models.CharField(max_length=225)
    slug = models.SlugField()
    description = models.TextField()
    # 9999.99
    unit_price = models.DecimalField(max_digits=6, decimal_places=2)
    inventory = models.ImageField()
    last_update = models.DateTimeField(auto_now=True)
    # then reference collection class here
    # PROTECT -> if accidentally delete Collection(Parent), PROTECT will protect our all Products (Child)
    collection = models.ForeignKey(Collection, on_delete=models.PROTECT)
    # we use plural because we have multiple promotions
    # many to many
    promotions = models.ManyToManyField(Promotion)
```

```py 
from django.shortcuts import render
from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from .models import Product, OrderItem
# Create your views here.


def test_model(request):
    # inventory < 10 AND price < 20
    queryset = Product.objects.filter(inventory__lt=10, unit_price__lt=20)
    return render(request, 'test.html', {'products': list(queryset)})

```

Q object (OR)
```py
from django.shortcuts import render
from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from .models import Product, OrderItem
# Create your views here.


def test_model(request):
    # inventory < 10 OR price < 20
    queryset = Product.objects.filter(Q(inventory__lt=10) | Q(unit_price__lt=20))
    return render(request, 'test.html', {'products': list(queryset)})
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8j8irf3g3e993cx7u4r6.png)

Q - AND IS NOT
```py
from django.shortcuts import render
from django.db.models import Q
from django.core.exceptions import ObjectDoesNotExist
from .models import Product, OrderItem
# Create your views here.


def test_model(request):
    # inventory < 10 AND - IS NOT - price < 20
    queryset = Product.objects.filter(Q(inventory__lt=10) & ~Q(unit_price__lt=20))
    return render(request, 'test.html', {'products': list(queryset)})
```
uses of useNavigate instead of useHistory
Tags: react, hooks, javascript
Published: 2022-06-06 10:24:25

> Github Repository : 
[Github](https://github.com/Remonhasan/react-ecomBox)

The useHistory hook gives you access to the history instance. In General useHistory is used for redirect to particular route after fetch api data or anything else with history. We used it as: 

```
const history = useHistory()
history.push("/path")
```
sometimes it fails to give you the access to the history instance. As per, useNavigate is the best way to redirect the particular route with your history instance. Here we go: 

```
const history = useNavigate();
history("/path");
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tzeeabvu26avzybfjbh9.png)
Linked List Random Node
Tags: leetcode, dsa, theabbie
Published: 2022-06-06 10:00:46

Given a singly linked list, return a random node's value from the linked list. Each node must have the **same probability** of being chosen.

Implement the `Solution` class:

*   `Solution(ListNode head)` Initializes the object with the head of the singly-linked list `head`.
*   `int getRandom()` Chooses a node randomly from the list and returns its value. All the nodes of the list should be equally likely to be chosen.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/03/16/getrand-linked-list.jpg)

**Input**
\["Solution", "getRandom", "getRandom", "getRandom", "getRandom", "getRandom"\]
\[\[\[1, 2, 3\]\], \[\], \[\], \[\], \[\], \[\]\]
**Output**
\[null, 1, 3, 2, 2, 3\]

**Explanation**
Solution solution = new Solution(\[1, 2, 3\]);
solution.getRandom(); // return 1
solution.getRandom(); // return 3
solution.getRandom(); // return 2
solution.getRandom(); // return 2
solution.getRandom(); // return 3
// getRandom() should return either 1, 2, or 3 randomly. Each element should have equal probability of returning.

**Constraints:**

*   The number of nodes in the linked list will be in the range `[1, 104]`.
*   `-104 <= Node.val <= 104`
*   At most `104` calls will be made to `getRandom`.

**Follow up:**

*   What if the linked list is extremely large and its length is unknown to you?
*   Could you solve this efficiently without using extra space?

**SOLUTION:**

    # Definition for singly-linked list.
    # class ListNode:
    #     def __init__(self, val=0, next=None):
    #         self.val = val
    #         self.next = next
    
    import random
    
    class Solution:
    
        def __init__(self, head: Optional[ListNode]):
            self.head = head
    
        def getRandom(self) -> int:
            res = self.head.val
            n = 2
            curr = self.head.next
            while curr:
                isSwap = random.randrange(0, n)
                if isSwap == 0:
                    res = curr.val
                curr = curr.next
                n += 1
            return res
    
    
    # Your Solution object will be instantiated and called as such:
    # obj = Solution(head)
    # param_1 = obj.getRandom()
Find All Anagrams in a String
Tags: leetcode, dsa, theabbie
Published: 2022-06-06 09:00:45

Given two strings `s` and `p`, return _an array of all the start indices of_ `p`_'s anagrams in_ `s`. You may return the answer in **any order**.

An **Anagram** is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.

**Example 1:**

**Input:** s = "cbaebabacd", p = "abc"
**Output:** \[0,6\]
**Explanation:**
The substring with start index = 0 is "cba", which is an anagram of "abc".
The substring with start index = 6 is "bac", which is an anagram of "abc".

**Example 2:**

**Input:** s = "abab", p = "ab"
**Output:** \[0,1,2\]
**Explanation:**
The substring with start index = 0 is "ab", which is an anagram of "ab".
The substring with start index = 1 is "ba", which is an anagram of "ab".
The substring with start index = 2 is "ab", which is an anagram of "ab".

**Constraints:**

*   `1 <= s.length, p.length <= 3 * 104`
*   `s` and `p` consist of lowercase English letters.

**SOLUTION:**

    class Solution:
        def findAnagrams(self, s: str, p: str) -> List[int]:
            np = len(p)
            ns = len(s)
            op = []
            if np > ns:
                return op
            pctr = [0] * 26
            for c in p:
                pctr[ord(c) - ord('a')] += 1
            sctr = [0] * 26
            for i in range(np):
                sctr[ord(s[i]) - ord('a')] += 1
            i = 0
            while i < ns - np:
                if pctr == sctr:
                    op.append(i)
                sctr[ord(s[i]) - ord('a')] -= 1
                sctr[ord(s[i + np]) - ord('a')] += 1
                i += 1
            if pctr == sctr:
                op.append(i)
            return op
Web GIS Technology
Tags: webdev, webgistechnology, geolocation
Published: 2022-06-06 09:44:58

A **geographic information system** (GIS) is a computer program that captures, stores, checks, and displays data about locations on the Earth's surface. GIS may help individuals and organizations better understand geographical patterns and relationships by connecting seemingly unconnected data. GIS can use any information that includes location. The location can be expressed in many different ways, such as latitude and longitude, address, or ZIP code.


Web GIS is similar to the usual client/server three-tier architecture when it comes to executing GIS analysis operations. The geoprocessing is being broken out into server and client processes. Typically, a client is a web browser. A web server, web GIS software, and a database make up the server side.

![client server flowchart](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7z57bsgr6shvzcodsilv.png)

This network paradigm is common in businesses, with some computers acting as servers and others as clients. To interact between the client and proprietary GIS software, the server simply runs proprietary GIS and adds a client interface on the client side and middleware on the server side.
Can we publish Power Apps Portal to App Source like Power Apps?
Tags: powerapps, powerappscourse, javascript, programming
Published: 2022-06-06 09:36:10

Do we have a functionality to publish Power Apps Portals on Microsoft's App Source?

Posting this rather very simple question here since I am unable to find any concrete resource stating if it is possible to publish power app portals to app source like we normally do with canvas or model-driven power apps.
iOS Developer (based in HCMC)
Tags: ios, developer, swifts
Published: 2022-06-06 09:31:16

## Why You'll Love Working Here

- Learning and leisure budget. Free Music classes. Monthly team building.
- Working from home policy. Performancae bonus. Global focus.

## Job Description
Where we are going:
Growth:

- Scale our music platform to retain the top position in the industry in terms of functionality, user experience, and performance
- Take a high level of ownership to get the job done and coach junior guys.
- Explore and evaluate the practicality of new technologies to improve existing processes and/or products
- Brainstorm to make clear product ideas and technical solutions
- Proactively manage tasks and processes using the JIRA suite.
Daily Work:

- We are looking for a talented Senior iOS Developer to help us build and scale the music entertainment platforms which will serve millions of users.
- Collaborate with the Product, UX/UI, and Backend teams to design, build and ship new features very quickly
- Write clean and maintainable code that is properly tested and reviewed
- Have the ability to balance high response, stable and efficient code with attractive and functional aesthetics
- Monitor the performance of the live apps and continuously improve them on both code and experience levels.
What you can expect:

- Silicon Valley-style work culture: move fast, break things, make mistakes, learn quickly, and grow.
- Work from Home policy and Flexible Time Management as well
- Opportunity to learn and extend the roles within the engineering team whatever it is, like research, analytics, automated test, business development, product management, DevOps,...
- Open, direct, collaborative, and no-politics working environment
- Dealing with many challenging engineering problems to build, scale, and secure the data platform
- Apply the Grow-at-Work package from Gambaru
- Free ticket to Gambaverse where you can grow your skills, your emotion, and your finance as well.

Required Skills and Experience: [https://gambaru.io/en/job-detail/iOS-Developer-Based-in-HCMC-1653359741957](https://gambaru.io/en/job-detail/iOS-Developer-Based-in-HCMC-1653359741957)
Insert Interval
Tags: leetcode, dsa, theabbie
Published: 2022-06-06 09:30:50

You are given an array of non-overlapping intervals `intervals` where `intervals[i] = [starti, endi]` represent the start and the end of the `ith` interval and `intervals` is sorted in ascending order by `starti`. You are also given an interval `newInterval = [start, end]` that represents the start and end of another interval.

Insert `newInterval` into `intervals` such that `intervals` is still sorted in ascending order by `starti` and `intervals` still does not have any overlapping intervals (merge overlapping intervals if necessary).

Return `intervals` _after the insertion_.

**Example 1:**

**Input:** intervals = \[\[1,3\],\[6,9\]\], newInterval = \[2,5\]
**Output:** \[\[1,5\],\[6,9\]\]

**Example 2:**

**Input:** intervals = \[\[1,2\],\[3,5\],\[6,7\],\[8,10\],\[12,16\]\], newInterval = \[4,8\]
**Output:** \[\[1,2\],\[3,10\],\[12,16\]\]
**Explanation:** Because the new interval \[4,8\] overlaps with \[3,5\],\[6,7\],\[8,10\].

**Constraints:**

*   `0 <= intervals.length <= 104`
*   `intervals[i].length == 2`
*   `0 <= starti <= endi <= 105`
*   `intervals` is sorted by `starti` in **ascending** order.
*   `newInterval.length == 2`
*   `0 <= start <= end <= 105`

**SOLUTION:**

    import bisect
    
    class Solution:
        def insert(self, intervals: List[List[int]], newInterval: List[int]) -> List[List[int]]:
            bisect.insort(intervals, newInterval)
            n = len(intervals)
            i = 0
            while i < len(intervals) - 1:
                if intervals[i][1] >= intervals[i + 1][0]:
                    if intervals[i][1] <= intervals[i + 1][1]:
                        intervals[i][1] = intervals[i + 1][1]
                    intervals.pop(i + 1)
                else:
                    i += 1
            return intervals
How do you register your Vuex Modules?
Tags: vue, vuex
Published: 2022-06-06 08:53:22

**Vuex** is a state management pattern + library for **Vue.js** applications. It serves as a centralized store for all the components in an application, with rules ensuring that the state can only be mutated in a predictable fashion.

You can register modules in your Vuex store as follows:

```js
import Vue from 'vue'
import Vuex from 'vuex'

// modules
import users from './users'
import posts from './posts'

Vue.use(Vuex)

export default new Vuex.Store({
  modules: {
    users,
    posts
  }
})

```

This structure is good for smaller projects, but what if you have lots of modules? Large applications can have equally large number of modules. As you can imagine, the file will eventually get bloated. 

What I usually do in my projects is create an auto import for my modules which then makes creating and using the modules in your app, a walk in the beach. 

Your modules directory might look like this:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/50fo4z52pdaxujzt0sez.PNG)

Now for the exciting part, how do you actually register all of this like a walk in the beach? Here's what I do:

```js
// modules.js
import _kebabCase from 'lodash/kebabCase'

const files = require.context(
  // the directory of your modules
  './modules', 
  // whether to look deep into each folder or not
  false, 
  // regexp to know which files to look for
  /\.js$/
)

const modules = {}

files.keys().forEach(fileName => {
  // I decided all of my modules should be kebab, but you can change it if you want.
  const moduleName = _kebabCase(fileName.replace(/(\.\/|\.js)/g, ''))
  modules[moduleName] = files(fileName).default
})

export default modules

```

And in your **store**, import the `modules.js`:
```js
// index.js
import Vue from 'vue'
import Vuex from 'vuex'

import modules from './modules'

Vue.use(Vuex)

export default new Vuex.Store({
  modules
})

```

And voila! You can now use your modules in the app without even manually importing them in your vuex store.

```js
import { mapState } from 'vuex'

export default {
  computed: {
    ...mapState('auth', {
      authUser: 'authUser'
    })
  }
}
```
Iterative Inorder Traversal - Leetcode
Published: 2022-06-06 09:11:09

```
class Solution {
public:
    vector<int> inorderTraversal(TreeNode* root) {
        //first, we create a stack 
        stack<TreeNode*>st;
        //create a node and assign it to root 
        TreeNode*node = root;
        //declare a vector which stores inorder 
        vector<int>inorder;
        while(true){
        //if the node that is the root is not null, we take that and insert it into stack
            if(node != NULL){
                st.push(node);
        //after pushing into stack, move to the left 
                node = node->left;
            }
            else{
            //if you traverse a tree and end up getting null, this is what you need to do 
            //if stack is empty there are no nodes to travel
                if(st.empty() == true) break;
            //else if the st is not empty, whatever is at the top we will take it 
                node = st.top();
                st.pop();
            //and this is eventually inorder
                inorder.push_back(node->val);
                node = node->right;
            }
                
        }
        return inorder;
    }
};

//TC :O(n) , as we traverse every node 
// SC :O(h) , height of the binary tree, in worst case it is skewed tree
```
Generating random strings with Ruby
Tags: ruby, webdev
Published: 2022-06-06 09:06:20

When you need to generate a random alphanumeric string of a specified length in ruby you have a couple of options.

If you are using Ruby version >= 2.5 you can simply go with:

```ruby
SecureRandom.alphanumeric(length)
```

For older versions you can utilize a little numeric convertion hack: `Integer#to_s` method accepts an argument representing the base. 
For example:

```ruby
13.to_s(2)  # => "1101" in binary
13.to_s(16) # => "d" in hex
```


```ruby
def alphanumerical_code(length)
  # 36 is used here as base: we want 10 digits plus 26 letters
  (36 ** (length - 1) + rand(36 ** length - 36 ** (length - 1))).to_s(36) 
end

def digital_code(length)
  (10 ** (length - 1) + rand(10 ** length - 10 ** (length - 1))).to_s(10)
end
```

## More custom generator

In case if you need to build something more specific and have more control, you can create your own generator.
Let's say we need a random alphanumeric string generator, which excludes some of the letters, so the strings are more easily distinguished by customer in printed media.


```ruby
class Generator
  CHARSET = [('0'..'9'), ('a'..'z'), ('A'..'Z')]

  def initialize(length:, exceptions: [])
    @length = length
    @allowed_charset = CHARSET.flat_map(&:to_a) - exceptions
  end

  def perform
    (0...@length)
      .map { @allowed_charset[rand(@allowed_charset.size)] }
      .join
  end
end

generator = Generator.new(
  length: 10, 
  exceptions: ['1', 'I', 'l', '0', 'o', 'O']
)
generator.perform
(1..3).map { better_generator.perform } 
# => ["FXCpz9evUj", "JP3uGhF35i", "rP4wv8Q5rm"]

```
Outreachy Blog #1: Introduce Yourself
Tags: outreachy, internship
Published: 2022-06-06 09:05:40

  I'm Kuthumi Pepple, I studied Computer Science at Obafemi Awolowo University, Nigeria. I'm a firm believer in the power of technology to improve lives. I like coding, gaming and learning about new technologies. Recently, I've bought into the ideas of the open-source movement and enjoy making contributions to open-source projects. I'm currently an Outreachy intern in Apache (more about this below)

##                  My Core Values

### Competence
> _Anything worth doing is worth doing well_ (Philip Stanhope) 

I try my best to uphold this standard in every area of my life, especially in my career as a software developer where incompetence can be costly either in the present or future. I try never to submit work that I've judged to be subpar.
### Contribution
> _Measure your life not by its duration but by its contribution_ (Peter Marshall)

This is important to me for several reasons. Firstly, making contributions helps others and makes the world a better place. Secondly, there is a gratifying feeling that comes with making contributions to either a project, community or cause. Finally, it is my way of giving back. Given that I've benefited from the contributions of others, whether its free online learning resources, free software or a mentor showing me a thing or two, it's only right that I make contributions that benefit others as well.
### Pleasure
> _I finally figured out that the only reason to be alive is to enjoy it_ (Rita Mae Brown)

I don't believe in the afterlife, so I try to experience all the happiness that this life has to offer. I try to have fun or at the very least derive some mental satisfaction in most things I choose to do. Life is too short to spend it on things that are non-stimulating.
## What motivated me to apply to Outreachy
I've always wanted to make some impact as a software developer so when I first learned about the Outreachy Internship Program, I applied in a heartbeat. Outreachy provides paid internships in open source to underrepresented groups in the tech industry (find out more [here](https://www.outreachy.org/)). Although I wasn't successful in my first attempt, I got some valuable experience which led to me being successful in a subsequent attempt.