teleren/devto huggingface dataset:
Send WhatsApp messages without adding contacts. Simple WA
Tags: nextjs, vercel, react, javascript
Published: 2023-08-07 02:13:40

Hi everyone, I made a super simple web app to send WhatsApp messages without adding contacts. 



![Simple WA form print](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ze2lfem08rrqf97m5r7t.png)

Feel free to check the source code [here ](https://github.com/cperazal/simple-wa)

Try the app [here](https://simplewa.carlosperaza.dev/)
Creating a blockchain based digital passport
Tags: web3, blockchain, mobile, react
Published: 2023-08-07 02:10:14

## Our client

Proof of Meet(POM) is what started as a hackathon project and grew into a full-scale startup. We worked with the client from the beginning, supporting them at every step with savvy developers. Our expertise went way beyond just code, as we saw the business value as well and were able to connect that to tech.

## Project description

POM is a Polygon blockchain-based digital passport (a DID wallet), used to share credentials, such as identity and employment history.

![Polygon design](https://cdn-images-1.medium.com/max/3840/1*7_lN4ah1AYnUqn9fRHcfAQ.jpeg)

![POM interface/concept](https://cdn-images-1.medium.com/max/3840/1*bbWJXnG_o4F5SNV_7JhM2w.jpeg)

Working in a tight timeframe, we had to pick the right tools to develop bug-free code while being extremely agile. The frontend stack was simple yet efficient — TypeScript & NextJs. This allowed us not to spend any time configuring the boilerplate and get straight to work. At first, we didn’t have a designer, so our team used Tailwind — a performant CSS framework for the web, which also has a component library(TailwindUI).

![TailwindUI logo](https://cdn-images-1.medium.com/max/2432/0*tFOJtRR7sHHp_rTP.jpg)

As our Decentralized Identity(DID) provider, we used PolygonId, which enables you to build trusted and secure relationships between users and dApps, following the principles of self-sovereign identity and privacy by default. PolygonId allows users to use zero-knowledge proofs to interact with smart contracts, solving the "trust " problem in web3.

![PolygonId logo](https://cdn-images-1.medium.com/max/4048/1*iJg4nEPQfFAXyTW6kS_vqQ.png)

As POM is scaling, we’re continuing to support it and growing our development team with them. Attracting skilled talent is extremely hard for a startup, but at MiKi, we can add up to 5 talented developers to the team in a matter of 4 days.

## The result

Working together, we created a stunning MVP for POM, which won multiple hackathons and got the attention of investors. We won EthSeoul2023, the Polygon DevX hackathon, and more.
In the future, we plan to support POM even more and help them develop awesome functionality.
Docker 20.10 on Devuan 4: Install and Run container
Tags: docker, virtualization, devuan, vm
Published: 2023-08-07 01:56:16

## Summary

This post shows how to install [Docker](https://www.docker.com/) and run vm on [Devuan](https://www.devuan.org/), a [systemd](https://www.freedesktop.org/wiki/Software/systemd/)-free fork of [Debian](https://www.debian.org/).

### Environment

- OS: Devuan [Chimaera](https://www.devuan.org/os/announce/chimaera-release-announce-2021-10-14) (4)
- Virtualization: Docker [20.10](https://docs.docker.com/engine/release-notes/20.10/)

## Tutorial

All [`doas`](https://wiki.archlinux.org/title/Doas) from [OpenBSD's](https://man.openbsd.org/doas) can be replaced with [`sudo`](https://wiki.archlinux.org/title/Sudo).

### Install package

Just run:

```console
$ doas apt install docker-compose
```

### Configure user

It is necessary to [use Docker without sudo](https://scqr.net/en/blog/2020/06/09/docker-1903-without-sudo/index.html).

```console
$ doas /usr/sbin/usermod -a -G docker ${MY_USER}
```

Then reboot your machine. Now you are ready.

### Get container image

For example, get [the official MariaDB image](https://hub.docker.com/_/mariadb):

```console
$ docker pull mariadb
```

### Create container

It is optional. In case of MariaDB, files in the specific path should be stored in volume to be permanent:

```console
$ docker volume create mariadb-dev
```

Well, run `docker run`:

```console
$ docker run \
      --name mariadb-dev \
      -v mariadb-dev:/var/lib/mysql \
      -e MARIADB_ROOT_PASSWORD=${DB_SECRET} \
      -d \
      mariadb:latest
```

### Work with your vm

You will be able to connect to your database 😉 with:

- host = localhost
- port = 3306
- db user = root
- db password = ${DB_SECRET}

## Conclusion

As to [Podman](https://podman.io/), which can be alternative to Docker, it is available, too, whose version is, however, [3](https://github.com/containers/podman/blob/v3.0.0/RELEASE_NOTES.md) on current Devuan although the latest is [4](https://cloud.redhat.com/blog/podman-4.0-arrives).

🌱 🤖 Happy virtualization 🤖 🎶
Longest palindromic substring in s
Tags: javascript, beginners, programming, interview
Published: 2023-08-07 01:39:54

## This problem was asked by Uber.

**You are given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000.**

**Example**

```
function longestPalindrome(s) {

}

console.log(longestPalindrome('babad')); // bab
console.log(longestPalindrome('cbbd')); // bb
```



**Solution**

```
function longestPalindrome(s) {
  let longest = "";
  for (let i = 0; i < s.length; i++) {
    const oddStr = expandFromMiddle(s, i, i);
    if (oddStr.length > longest.length) {
      longest = oddStr;
    }

    const evenStr = expandFromMiddle(s, i, i + 1);
    if (evenStr.length > longest.length) {
      longest = evenStr;
    }
  }

  function expandFromMiddle(str, left, right) {
    while (left >= 0 && right < str.length && s[left] === s[right]) {
      left--;
      right++;
    }
    return str.slice(left + 1, right);
  }
  return longest;
}
```

**Explanation**

- Iterate through each character in the string
- For each character, expand outwards to find odd and even length palindromes centered at that character
- Use a helper function to expand from the middle, incrementing left and right pointers until reaching different characters
- Keep track of the longest palindrome seen so far
- After checking all characters, return the longest palindrome
What is binary search?
Tags: algorithms
Published: 2023-08-07 01:33:43

## What is binary search?
binary search is an algorithm to efficiently find a specific target value within **a sorted array or list**.
For instance, If I decide to number from 0 to 100, you have to guess the number that I decided as few times as possible.
I will say you "This number is low" or "This number is high", when you guess the number and it is't correct.
If you use simple search, you have to guess max 99times.
It's not good.

### How to specific target value more efficiently?
There is a better way to specific target more efficiently.
This is starting at 50.
If I decided 99, 50 is too small.
Therefore, You can exclude from 0 to 50.
Next, You guess 75, the middle between 51 and 100 is 75, 75 is too small.
Therefore, You can also exclude from 50 to 75.
When you do this some times, you will specify the number I decided!
This is a binary search.

## How many times can the target number be found if a binary search is used?
For a list of elements, in the worst case, a binary search requires `log2n` steps.

### Logarithm
Logarithm is x when `x = loga b`
We use it when we think What power of 'a' will result in 'b'?
Therefore, `log10 100` means "What power of 10 will result in 100?".
The answer is 2 because of `10 * 10 = 100`.

## How to write in Rust
We can implement this algorithm in Rust like this.
```rust
fn binary_search(list: &[i32], item: i32) -> Option<usize> {
    let mut low = 0;
    let mut high = list.len() - 1;
    
    while low <= high {
        let mid = (low + high) / 2;
        let guess = list[mid];
        
        if guess == item {
            return Some(mid);
        }
        
        if guess > item {
            high = mid - 1;
        } else {
            low = mid + 1;
        }
    }
    
    None
}

fn main() {
    let my_list = vec![1, 3, 5, 7, 9];
    println!("{:?}", binary_search(&my_list, 3)); // Output: Some(1)
    println!("{:?}", binary_search(&my_list, -1)); // Output: None
}
```

## Summary
Binary search is a one of basis of algorithms.
Let's use it well!
Commands for RabbitMQ
Tags: rabbitmq, kubernetes, programming, cluster
Published: 2023-08-07 01:25:54

```bash
brew install kind     # install kind for Mac
kind create cluster - name rabbitmq
kubectl config get-contexts
kubectl apply -f https://github.com/rabbitmq/cluster-operator/releases/latest/download/cluster-operator.yml
```

```yaml
# rabbit-cluster.yaml
apiVersion: rabbitmq.com/v1beta1
kind: RabbitmqCluster
metadata:
 name: rabbitmq-cluster
spec:
 replicas: 2
 rabbitmq:
 additionalConfig: |
 default_user=arnold
 default_pass=password
```

```bash
kubectl apply -f rabbit-cluster.yaml
kubectl get pods -w
kubectl krew install rabbitmq # install rabbitmq plugin
kubectl rabbitmq list
kubectl rabbitmq get rabbitmq-cluster
kubectl rabbitmq manage rabbitmq-cluster
kubectl port-forward “service/rabbitmq-cluster” 15672
kubectl rabbitmq secrets rabbitmq-cluster
kubectl rabbitmq rabbitmq-perf-test rabbitmq-cluster # testing
kubectl delete pod/rabbitmq-perf-test
```

```bash
# download files from https://github.com/rabbitmq/cluster-operator/tree/main/observability
# run this if you need permission: chmod +x quickstart.sh

./quickstart.sh
```
Contenda Studio and New Pricing
Published: 2023-08-08 00:02:08

---
title: Contenda Studio and New Pricing
published: true
date: 2023-08-07 00:00:00 UTC
tags: 
canonical_url: https://blog.brainstory.ai/studio-and-pricing/
---

Today we’re releasing Contenda 2.0: Contenda Studio, Electric Boogaloo, 2 Contenda 2 Studio, The Remix, The Special Edition.

To save time, we’ll just be calling it **Contenda Studio**. Contenda Studio is a generative AI tool that writes in your voice and with your content. Use it to for tutorials, recaps, essays, marketing blogs, and more!

We’re also **launching a paid plan and updating our free tier**! We heard your concerns about future surprise bills (nobody likes that), and we’re here to ease your minds and give you details.

## How do I use Contenda Studio?

When you log into Contenda, the Studio will now be the default view. We wrote a more in-depth tutorial [here](https://contenda.co/blog/contenda-studio-tutorial). One of our favorite use cases that popped up is for [The Logan Barlette Show](https://www.youtube.com/channel/UCugS0jD5IAdoqzjaNYzns7w).

They were promoting their podcast on LinkedIn through this [recap](https://www.linkedin.com/posts/loganbartlett_laela-sturdy-is-the-managing-partner-at-capitalg-activity-7094315148311412736-QxM_?utm_source=share&utm_medium=member_desktop) format, which took their producer an hour to write. Using Contenda, the same recap can be created in _under 5 minutes_. All you need is to upload the transcript file (or you can give the video file if you don’t have the transcript handy!) into Contenda, and choose the “Recap” format! Contenda digests the podcast into key points and you drop the relevant topics into the provided template.

## Paid Plans

Our new pricing will have a single paid tier at $20 that gives 100 video or text submissions per month. We were able to dramatically reduce our costs with the new Contenda Studio approach, and we’re passing those savings onto you.

If you are interested in guaranteed priority support, higher rate limits, and/or business capabilities, [learn more and contact us here](https://contenda.co/enterprise)!

## Free Tier

We’ll be shifting our free tier from 300 minutes a month to 6 total file ingestions in an account’s lifetime. You can remix those 6 files with Contenda Studio into **as many different outputs as you want** with no added cost!

As a heads up, the free tier has lower rate limits than the paid plan, as well.

## What’s next?

Contenda Studio isn’t just for podcasters! We’ll be releasing case studies and more all month long.

If you have a story to share, let us know! We would love to feature you. Message us on [Discord](https://discord.gg/bYda4pQz2v), [Twitter](https://twitter.com/ContendaCo), or email us: support(at)contenda.co!
Carbon PHP Quick Tip
Tags: php, laravel, webdev, coding
Published: 2023-08-06 23:42:33

---
canonical_url: https://seankegel.com/carbon-php-quick-tip
---

![Using Carbon::make](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ezip6scjprwc0agmnqpo.jpg)


Recently, I was working on handling API responses and I wanted to pass them into a DTO. One of the fields was an optional `deleted_at` column. In my DTO, I wanted that to be converted to a [Carbon](https://carbon.nesbot.com/) `datetime` object.

Carbon comes packaged with Laravel, but can also be used standalone for other PHP packages and adds excellent extensions to the PHP `datetime` object.

To build the DTO, my first go at it was to have something like below:

```php
new DataDto(
   ...
   deleted_at: isset($data['deleted_at']) ? Carbon::parse($data['deleted_at']) : null,
   ...
);
```

I needed to first check if `$data['deleted_at']` is not null, otherwise, `Carbon::parse` would return a new Carbon instance with the current date and time.

The above code works fine but it is kind of hard to look at, especially with the full object instantiation. So instead, I found I can use `Carbon::make`. It returns `null` if the value passed in is `null`.

```php
new DataDto(
   ...
   deleted_at: Carbon::make($data['deleted_at']),
   ...
);
```
Understanding and Manipulating the Document Object Model (DOM) with JavaScript
Published: 2023-08-06 23:33:54

The Document Object Model, or DOM, is a programming interface for HTML and XML documents. It provides a structured representation of the document as a tree format, which can be manipulated by languages like JavaScript. The DOM is what allows JavaScript to interact with HTML, changing the document's structure, style, and content.

Accessing Elements

Before manipulating the DOM, you need to know how to access the elements within it. You can use various methods like getElementById(), getElementsByClassName(), getElementsByTagName(), and querySelector(). Here's an example using getElementById:

```
var titleElement = document.getElementById('title');
console.log(titleElement);

```

This will select the HTML element with the id "title" and log it to the console.

Modifying Content

Once you've selected an element, you can modify its content using properties like textContent or innerHTML.

```
var titleElement = document.getElementById('title');
titleElement.textContent = 'Hello, World!';

```
This code will change the text of the 'title' element to 'Hello, World!'.

Adding and Removing Elements

You can also add and remove elements from the DOM using methods like createElement(), appendChild(), removeChild(), and others. Here's an example:

```
var newElement = document.createElement('p'); // Create a new <p> element
newElement.textContent = 'This is a new paragraph.'; // Add text to the new element

var parentElement = document.getElementById('parent'); // Get the parent element
parentElement.appendChild(newElement); // Add the new element to the parent element

```
This code will create a new paragraph element, set its text, and append it to the parent element.

Event Listeners

One of the most powerful features of the DOM is the ability to listen for and respond to user events like clicks, keyboard input, form submission, and more. Here's an example of a click event:

```
var button = document.getElementById('myButton');

button.addEventListener('click', function() {
  alert('Button was clicked!');
});

```
This will display an alert whenever the button with id "myButton" is clicked.

Conclusion

These are just some of the basics of working with the DOM in JavaScript. There are many more methods and properties available, and some third-party libraries like jQuery offer their own interfaces for interacting with the DOM. By understanding the DOM, you can create dynamic, interactive websites that respond to user input. Happy coding!
React JS
Published: 2023-08-06 23:18:04


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6w2u44rywpl7vefdyhb9.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iccc79lz12uqydx10e3e.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q8ls5xsaraf1ka8yh3hf.png)
Day 8 of #100 days of health and study.
Tags: 100daysofhealthandstudy
Published: 2023-08-06 23:10:44

So far so good, but more work needs to be done.  

As a recovering perfectionist, prior to being a project manager, I now look at errors and processes differently than I did in the past.  Monitoring and Controlling this learning project, I have to remember you are entitled to the work, but not the reward.  Somewhat paradoxically, if you put in the work, you have the best chance of receiving the reward.  As Steven Pressfield said, "Put your ass where your heart wants to be."  Whether it be a higher power or the probability improving as you put in more iterations; something outside ourselves (some people call it luck), the universe improves with smarter work.  To use a legal term, perfected in the process for the benefit of the party. 

The measurement of the online training is better than the measurement of the book training, because the book training involves story problems.  Story problems are the bane of some people's existence.  Improving familiarity with the way they are asking the questions will increase the understanding and improve the quiz scores.  Make a note to push forward into another subject and work on the story problems by fast tracking the processes. 

What about the health part of the #100daysofhealthandstudy challenge?  My qigong is the same, but nothing in addition to that yet.  At least the progress isn't getting worse.  Witnessing older people in nursing homes underlines the importance of developing strength in your legs and keeping mobile, like waking, which I do.  It will help contribute to living a better life.  

Onward and upward!
Using AtomicHub
Tags: atomichub, wax, blockchain, tutorial
Published: 2023-08-06 22:34:15

## Introduction

Now that we have created a collection, schema, and templates, and minted some NFTs, let’s explore how those NFTs will show up in the most popular NFT platform for WAX: AtomicHub.

## What is AtomicHub

Throughout these tutorials, we’ve mentioned AtomicAssets as a contract that we have used to mint NFTs. Built on top of AtomicAssets is AtomicHub - a web-based marketplace that shows collections, templates, schemas, and NFTs.

For our purposes, we are going to work with the testnet version of AtomicHub: https://wax-test.atomichub.io/.

AtomicHub allows creators, collectors, and traders to buy, sell, and trade NFTs. It acts as a marketplace as well, letting users buy, sell, and bid on NFTs.

## Interacting on AtomicHub

When we created out NFT on AtomicAssets, the collection, schemas, and templates automatically show up on AtomicHub. Here we can see the collection:

https://wax-test.atomichub.io/explorer/collection/wax-testnet/babychicknft.

![Collection on AtomicHub](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/navvjpq3o41rk68ji7z2.png)

You can see that the IPFS images that we set up before when creating our templates are being used and displayed on the AtomicHub site. 

If we click on an asset, such as this one https://wax-test.atomichub.io/explorer/asset/1099558399043, we get to see the IPFS image and all of the details as well.

![Example NFT on AtomicHub](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s6iysvq32yg4u5al52pb.png)

By using a template with a max minting, users also get to see a nice “3 of 3 (max: 100)” for the mint number. Some users covet having lower mint numbers, and knowing how many are left is important to understanding the market for the given collection and NFT.

## Conclusion

In this section, we went over AtomicHub and how collections end up being displayed on it. Making sure you setup your collection correctly so that it displays all the relevant information on AtomicHub is important. It acts as the face of your NFT to most users and AtomicHub can serve as additional advertising for your project.

Next post: [Hatching NFTs with the WAX RNG Oracle](https://dev.to/idmontie/hatching-nfts-with-the-wax-rng-oracle-2k10)

## E-book

Get this entire WAX tutorial as an [e-book on Amazon](https://amzn.to/3ZjwaK7).
The Cookies Hash
Published: 2023-08-06 22:21:09

Cookies: server stores a set of key-value pairs in the client

Server must include the `Set-Cookie` header in a response

add `gem "sinatra-contrib"` to our `Gemfile`, `bundle install`, and within `app.rb`:

`require "sinatra/cookies"`

Within an action, we can use the `cookies` hash with `Hash` methods like `.store`, `.keys`, `.fetch`, `[ ]`, etc.

Cookies are used for many things: analytics, ad targeting, etc, signing in a user, etc.

Only store strings in cookies

Store an `Array` or `Hash` of values within a single cookie. Convert the Ruby `Array` or `Hash` into a JSON string, and then store the string

`JSON.generate()` accepts an `Array` or a `Hash` as an argument and returns a `String`
R, beyond Statistical Programming
Tags: r, programming, statistics, app
Published: 2023-08-06 21:34:56

<small>_Image from www.unsplash.com_</small>

R was specifically created for Statistical Programming (for Data Analysis) and is currently great for Data Science and Machine Learning. However, what it can be used for is far beyond those mentioned above. The following are examples of what R can be used for.

## 1. Games
Wait a minute R? Yes, R! R may look like the most unlikely program for such a thing, but it can be used to develop games. Well, what type of games? You can see some games developed in R here.

## 2. Web Applications
Ever heard of Shiny? Yes, with the R package called Shiny, you could build your own website. Although it is true that JavaScript frame works like: Angular and React (for frontend development) and Express.js (which is based on Node.js for backend) are great and specifically designed for web development, but you can take advantage of R to build a website that will serve a similar purpose. However, the draw back is that you may not be able to separate concerns, which was the main idea behind the frontend and backend developments, so that: full stack = frontend + backend.  With the help of some other packages, you can also write web APIs and manage your Database. Find out more about shiny here.

## 3. Animations
While you may not be able to make  animated movies like those from Disney, you could really make a lot of real animations using R. You could animate graphs, charts, pictures e.t.c. Find out more about R animations here.
Finally, while there are programming languages that were primarily designed to handle the three things discussed above, using R is of great advantage to an R programmer who may want to do such things, as the time that would have been spent learning a new language can be saved, provided the programmer is not under compulsion to use any particular tools. Now you know that R is really useful beyond Arithmetic. 

If you find this article useful, please leave your comments and share with other people and Thank you.