teleren/devto huggingface dataset:
Send Push Notifications without Hassles of FCM Token Generation
Tags: firebase, android, reactnative, flutt
Published: 2024-05-21 14:56:07

Handling FCM tokens and marking the user state is a hassle that businesses doesn't want to get into. To solve for this, SuprSend provides you with all the popular languages SDK, with point install and integration. 

## Token Generation and Notification handled By SDK
You may use this option if all of your android push notifications are to be handled via SuprSend SDK. We recommend you use this method as it is just a single-step process to just register the service in your application manifest and everything else will be ready.

```AndroidManifest.xml

<!--If you are targeting to API 33 (Android 13) you will additional need to add POST_NOTIFICATIONS -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

<service
    android:name="app.suprsend.fcm.SSFirebaseMessagingService"
    android:enabled="true"
    android:exported="false">
    <intent-filter>
        <action android:name="com.google.firebase.MESSAGING_EVENT" />
    </intent-filter>
</service>
```


Full documentation here: 
1. React Native - [Docs](https://docs.suprsend.com/docs/react-native-firebase-fcm-push-integration%C2%A0)
2. Android - [Docs](https://docs.suprsend.com/docs/android-firebase-fcm-push-integration)
3. Flutter - [Docs](https://docs.suprsend.com/docs/flutter-firebase-fcm-push-integration)
Rust ： String and chart set and code type
Published: 2024-05-21 14:54:58

1.
how to splice multiple string types？

```
 let s1 = String::from("Hello");
 let s2 = String::from("World");
 let s3 = s1 + &s2;

```
s1 will be destroied in this way。 So this way is not recommonded。

```
  let s1 = String::from("Hello");
  let s2 = String::from("World");
  let s3 = s1.clone() + &s2;
```
this way is so complicated，let us see it's simple way;

```
        let mut s1 = String::from("Hello");
        let s2 = String::from("World");
        let s3 = format!("========={}{}", s1, s2);
```

2.
 rust string use  unicode character set，and the rule of encode and 
 decode useing utf-8, So the string's every char may be occupy 
 different numer of bytes。

```
     let s1 = String::from("नमस्ते");
     println!("{}",s1.len())

       let s1 = String::from("智");
       println!("{}",s1.len()) ;

      let s1 = String::from("123");
       println!("{}",s1.len()) ;

```
you will find different char; they occupy different number of bytes。
 

```
 let s1 = String::from("नमस्ते");
let s2= &s1[2..5];
```
remember  this index is in the string splice'process is bytes index.

```
let start_byte = s.char_indices().nth(start).map(|(i, _)| i).unwrap_or(s.len());

let end_bytes = s.char_indices().nth(start).map(|(i, _)| i).unwrap_or(s.len());

```
Identify unused Routes in Ruby on Rails before Rails 7.1 and with 7.1
Tags: rails, webdev, ruby
Published: 2024-05-21 14:47:18

Identify unused Routes in Ruby on Rails before Rails 7.1 and with 7.1

There are some things that can't be found and you have to know why. See my post [Identify unused Routes in Ruby on Rails before Rails 7.1 and with 7.1](https://qameta.com/posts/identify-unused-routes-in-ruby-on-rails/).
Default Parameter Value in JavaScript Functions
Tags: javascript, beginners, tutorial
Published: 2024-05-21 14:46:44

In JavaScript, we can define default values in the function's parameter to safeguard it from returning NaN.

Let me give you an example of this,

Let's say, we are using a function called `sum`:


```javascript
function sum (a, b) {
    return(a + b);
}
```

This function simply receives two values as arguments and returns their summation value.

Therefore, we get:

```javascript
sum(2, 3) // returns 5
```


![sum function](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d4dohkazno7ncfdsysx1.png)

However, for some reason, if the user does not provide the value of any parameter as an argument, then it becomes **NaN** as the default value of all the parameters is **Undefined** in JavaScript.

Therefore, the following scenario can happen:


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

Here, as we didn't provide the value for the second parameter in the argument, it takes the default value for variable `b` as `Undefined`. Therefore, `5` `+` `Undefined` returns `NaN`.

However, let's say, we provide a default parameter value for the second variable for now (`b`) to ZERO (b = 0), then we get the following output for the same input:


```javascript
function sum (a, b = 0) {
    return(a + b);
}

sum (5);
```



![With default parameter value](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8wzi5jke95iezkrngq14.png)

Here, you see that we have explicitly specified the initial (default) parameter value for the variable `b` as `0`. Therefore, if we do not pass any value during function calls, the default argument value for variable `b` becomes 0. 

As `5` `+` `0` = `5`, we get `5` as the output. 

However, this does not change anything crucial other than safeguarding the function. 

If we call the function with all the values in it via arguments, it works flawlessly.


```javascript
function sum (a, b = 0) {
    return(a + b);
}

sum (2, 10);
```


![all argument values with default parameter value](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqit0wv685tag0owt8ne.png)

Here, although the initial (default) value for the second variable was zero (`0`), the updated value was `10` which was passed during the function call as argument value. The updated value overwrites the initial/default value. Therefore, all the calculation works seamlessly.


Sometimes, we like to provide default values in all the function parameters if we want to avoid these `Undefined` type calculations in the output.


I hope you have learned something new today! Thank you for reading. 😊
Analogia receita de bolo VS algoritmo VS linguagem de programação
Tags: novice, beginners, braziliandevs
Published: 2024-05-21 14:37:45

Olá, Mentes Tech!

Hoje me peguei pensando no que uma receita de bolo, algoritmos e linguagens de programação tem em comum.

Uma receita de bolo é um guia com passos bem definidos com um objetivo final de te entregar um bolo, desde que a receita seja seguida conforme descrito.

Na receita diz 2 ovos, mas eu só tenho 1, vai assim mesmo.
Pouts, deu errado, é culpa da receita.

O Algoritmo é uma sequencia lógica bem definida com instruções para máquina.

A linguagem de programação nesta analogia pode ser visto como os ingredientes para executar a receita que neste caso é o algoritmo.

Conclusão, se você possuir um bom raciocínio lógico para propor bons algoritmos, para resolver problemas complexos, a linguagem de programação será seu ingrediente premium para conclusão dos melhores "bolos".

E quanto mais linguagens conhecer, melhor será sua proposta para execução da "receita de bolo" e até mesmo aprimoramento da mesma.
What kind of programmer are you?
Published: 2024-05-21 14:34:02


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

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

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

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

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

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

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

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

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/exyix32dj56buzqv196a.png)
Pokies Casino
Tags: pokies, pokiesnewzealand, onlinepokiescasino, pokiesgames
Published: 2024-05-21 14:27:02

[](url)https://pokiescasino.live/

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i2j31mn6acf5zu7hiq42.png)
The Pokies New Zealand Therefore, without having to travel to a land-based casino. The pokies New Zealand various symbols add to the thrill of the game, where you simply choose the greyhound that you think will win the race. The slot games at Pokies Casino are the most popular among players, you should choose a low volatility slot machine.
Download your Mern stack app Using scp (Secure Copy)
Published: 2024-05-21 14:16:31

**Step 1: Create Backup on Server**
Connect to Your Server:
Use SSH to connect to your server. Replace <remote-user> and <remote-ip> with your server's username and IP address.
```
ssh <remote-user>@<remote-ip>
```
**Step 2: Create a Backup Directory (if not already created):**
Create a directory to store your backups. For example, let's create a directory named backups in your home directory.
```
mkdir -p ~/backups
```
**Step 3: Create the Backup:**
Assuming your application files are in /var/www/websiteFolder/, create a backup of the portfolio directory.

```
tar -czvf ~/backups/app-backup-$(date +%F).tar.gz /var/www/portfolio/
```

**Step 4: Download Backup to Local Machine**
Open a **New Terminal Window** (on your local machine):
Open a new terminal window or tab on your local machine.

**Download the Backup:**
Use the scp command to download the backup file from the server to your local machine. Replace <remote-user>, <remote-ip>, and <local-path> accordingly.

```
scp <remote-user>@<remote-ip>:~/backups/app-backup-$(date +%F).tar.gz <local-path>
```
for Mac

```
mkdir -p /Users/username/backup
scp <remote-user>@<remote-ip>:~/backups/app-backup-$(date +%F).tar.gz /Users/username/backup
 app-backup-$(date +%F).tar.gz is file name. Also you can verify the name.
```
**Step 5: Extract Backup file**
Open terminal in /Users/username/backup and run command

```
tar -xzvf app-backup-2024-05-21.tar.g
 app-backup-2024-05-21.tar.g is file name, it can different in your case
```
Capybara Math Privacy Policy
Published: 2024-05-14 03:05:50

Privacy Policy for Capybara Math

Effective Date: 2024-05-13

1. Introduction Stanislav Berkov is committed to protecting the privacy of children who use our Capybara Math (“Application”). This Privacy Policy explains our information practices for our Application, which is designed for children under the age of 13.

2. Information Collection and Use Our Application does not collect any personal information from its users, including children under the age of 13.

3. Parental Consent Although we do not collect personal information, we still provide information about our practices for parents and guardians to review.

4. Log Data We do not collect information that is automatically generated by the use of our Application, such as IP addresses or device identifiers.

5. Cookies Our Application does not use cookies or similar tracking technologies.

6. Third-Party Access Since our Application does not collect personal information, we do not share any user data with third parties.

7. Data Security We are committed to protecting the security of our users’ information. As we do not collect personal information, we focus on preventing unauthorized access to our Application.

8. Changes to This Privacy Policy We may update our Privacy Policy from time to time. Parents will be notified of any significant changes to our practices regarding children’s data.

9. Contact Us If you have any questions about our privacy practices or this Privacy Policy, please contact us at https://twitter.com/StasBerkov.
How Many Bluetooth Speakers Can You Connect to Your Phone?
Published: 2024-05-21 14:04:56

Bluetooth technology has revolutionized the way we listen to music and interact with our devices. With the increasing popularity of portable Bluetooth speakers, many users are curious about [how many speakers they can connect to their phone ](https://metabluetoothspeakers.com/how-many-bluetooth-speakers-can-you-connect-to-your-phone/)simultaneously.

## Understanding Bluetooth Connections

Bluetooth connections are typically one-to-one, meaning that a single device connects to another single device at a time. However, advancements in Bluetooth technology, such as Bluetooth 5.0 and beyond, have introduced the ability to connect multiple devices for a richer audio experience.

## Connecting Multiple Bluetooth Speakers

1. - Dual Audio on Samsung: Samsung phones with Bluetooth 5.0 and higher have a feature called Dual Audio, allowing users to connect two Bluetooth speakers at the same time. This feature is perfect for creating a surround sound effect or playing music in two different rooms.
2. - Audio Sharing on Apple Devices: Apple offers a similar feature called Audio Sharing on iOS devices, starting from iOS 13.2. This allows users to connect two pairs of AirPods or compatible Beats headphones to one iPhone or iPad. Although this doesn’t extend to multiple Bluetooth speakers directly, using compatible products can enhance your audio experience.
3. - Bluetooth Adapters and Apps: For phones without native support for multiple Bluetooth connections, Bluetooth adapters can be used. These adapters can connect to multiple speakers simultaneously. Additionally, some apps, like AmpMe, enable you to synchronize multiple devices to play the same music, although these solutions may not be as seamless as built-in features.

## Practical Limitations and Tips

1. Latency Issues: When connecting multiple Bluetooth speakers, be aware of potential latency issues. This can cause a delay in audio playback, which might be noticeable and disrupt your listening experience.
2. Battery Drain: Connecting multiple Bluetooth devices can drain your phone’s battery faster, so it's wise to keep an eye on your battery level and have a charger handy.
3. Distance and Obstructions: The effective range of Bluetooth is around 30 feet (10 meters). Walls and other obstructions can reduce this range, so for the best performance, keep your speakers within the recommended distance.

## Conclusion

While traditional [Bluetooth technology](https://metabluetoothspeakers.com/) limits you to one speaker at a time, modern advancements and creative solutions enable you to connect multiple Bluetooth speakers to your phone. Whether through built-in features on newer devices or using external adapters and apps, you can enjoy a versatile and immersive audio experience.
Getting to Know TypeScript - : A Beginner's Guide
Tags: typescript, webdev, javascript
Published: 2024-05-21 14:04:38

Welcome to the world of TypeScript! If you're here, chances are you're familiar with JavaScript and are looking to enhance your skills with TypeScript, a powerful superset of JavaScript. TypeScript adds static typing to JavaScript, helping you catch errors early and write more maintainable code. 

## What is TypeScript?
TypeScript is an open-source language developed by Microsoft that builds on JavaScript by adding static type definitions. These types help catch errors during development, leading to more robust and reliable code. Unlike JavaScript, TypeScript code needs to be compiled into JavaScript before it can be run in the browser or Node.js runtime.

## Setting Up TypeScript
Before you start, ensure you have Node.js installed on your machine. You can download it from <a href="https://nodejs.org">nodejs.org

## Installation
To install TypeScript, you can use npm (Node Package Manager). Open your terminal and run:

```
npm install -g typescript
```
This command installs TypeScript globally on your machine, making the tsc (TypeScript compiler) command available.

## Initializing a TypeScript Project
Navigate to your project directory and run:
Let's start with a simple example. Create a new file called index.ts:

```
function greet(name: string): string {
    return `Hello, ${name}!`;
}

const user = 'World';
console.log(greet(user));
```
In this code, we define a greet function that takes a name parameter of type string and returns a string. The : string after the parameter and the function name is TypeScript's way of defining types.

## Compiling TypeScript
To compile your TypeScript code to JavaScript, run:
```
tsc
```
This command reads the tsconfig.json file and compiles the index.ts file into index.js. You can then run the generated JavaScript file using Node.js:

```
node index.js
```
You should see the output:

```
Hello, World!
```
Congratulations! You've taken your first steps into TypeScript. On your first day, you've learned how to set up TypeScript, write and compile basic code.

We will dive more into typescript language in the upcoming blogs, so kindly follow me to get updated with my blogs.

Thanks for reading.

Happy coding!
Comprehensive Mobile App UI/UX Design Services for Exceptional User Experiences
Published: 2024-05-21 14:04:01


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

Boost User Engagement with Expert Mobile UI/UX Design!
Discover how our comprehensive Mobile App UI/UX Design Services can transform your app's user experience. Check out our infographic to learn more! Visit us here to learn more: https://mobisoftinfotech.com/services/mobile-app-ui-ux-design-services #UIUXDesign #MobileAppDesign #UserExperience
Bas' Take on Tech: OpenAI, e/acc, PyCon
Tags: community, techtalks, python
Published: 2024-05-21 14:00:00

## 🤖 (Open)AI (again)

In a probably unnoticed act of honesty, OpenAI has admitted that “AI” is probably still miles away from being “intelligent”. As I have written here several times, LLMs are a remixing of content, not a deliberate creation by an intelligence. Admittedly, this looks very impressive, but it is a far cry from the dystopian rule of machines. However, OpenAI set up a team to [prevent precisely this rule by machines - and has now fired them. Obviously a marketing stunt that was no longer needed](https://www.businessinsider.com/openai-ends-superalignment-team-manage-ai-risks-2024-5).

But in case anyone was wondering why remixing works so well and what role “Whisper” speech recognition played in this, although speech recognition has less to do with LLMs and more to do with traditional machine learning: By the [end of 2021, OpenAI had read the internet and moved on to transcribing all sorts of YouTube videos and also using them as training data](https://economictimes.indiatimes.com/tech/technology/how-tech-giants-cut-corners-to-harvest-data-for-ai/articleshow/109093168.cms). Please support this channel by hitting the subscribe button! 

Meanwhile, while some people have jumped off the OpenAI bandwagon (Ilya Sutskever, Jan Leike, Evan Morikawa), it has come to light that OpenAI, which has just released GPT 4o, is committing its employees to a lifetime ban on criticism. 

I’m not the only one who is [bearish on OpenAI](https://stovetop.substack.com/p/im-bearish-openai). Here is another [hot take](https://garymarcus.substack.com/p/hot-take-on-openais-new-gpt-4o).

## 🐍 PyCon & Python 3.13

Three years ago, the Python Language Summit 2021 was about making CPython faster. A lot of improvements have been made since. Most notably, PEP 703 adds an experimental flag to remove the GIL in Python 3.13. 

PyCon 2024 was happening last week in Pittsburgh, PA. I would have loved to attend, but I couldn’t make it. Glyph Lefkowitz has an interesting field guide on “How to Pycon” on his blog. This applies to other conferences equally well and is a great bookmark for your next one.

For now, I have heard some great things about these talks in particular:

[Read More](https://open.substack.com/pub/basc/p/bas-take-on-tech-openai-eacc-pycon?r=20mg42&utm_campaign=post&utm_medium=web&showWelcomeOnShare=true)
Why Learn Web Development? Top Reasons to Start Today
Published: 2024-05-21 13:58:18

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

As technology continues to advance and integrate into every aspect of our lives, learning web development has become more valuable than ever. Whether you're considering a career change, looking to enhance your skill set, or just curious about the field, here are some compelling reasons why you should start learning web development:

#### 1. **High Demand for Web Developers**
The demand for skilled web developers is consistently high across various industries. Businesses of all sizes need websites and web applications, making web development a stable and lucrative career choice.

#### 2. **Creative Expression**
Web development combines creativity with technical skills. You get to design and build visually appealing websites, bringing your artistic visions to life while solving complex problems.

#### 3. **Flexibility and Remote Work Opportunities**
Web development offers flexibility in terms of work environment and hours. Many web developers work remotely, giving you the freedom to work from anywhere in the world and often set your own schedule.

#### 4. **Continuous Learning and Growth**
Technology is always evolving, and web development is no exception. This field offers endless opportunities for learning and growth as new languages, frameworks, and tools emerge regularly. Staying up-to-date keeps your job interesting and challenging.

#### 5. **Ability to Build Your Own Projects**
Learning web development empowers you to create your own websites and applications. Whether you want to launch a personal blog, an online store, or a startup, having the skills to build it yourself is incredibly rewarding and cost-effective.

#### 6. **Problem-Solving Skills**
Web development enhances your problem-solving abilities. Debugging code, optimizing performance, and creating user-friendly interfaces require analytical thinking and a keen eye for detail.

#### 7. **Community and Collaboration**
The web development community is vast and supportive. From online forums to local meetups, you can connect with other developers, share knowledge, and collaborate on projects. This sense of community can be a great source of inspiration and support.

#### 8. **Good Salary Potential**
Web development is known for offering competitive salaries. As you gain experience and specialize in certain areas, your earning potential increases significantly.

---

I'd love to hear your thoughts on this! What motivated you to learn web development, or what benefits have you experienced since you started? If you're just beginning, what are you most excited about?

Let's discuss!

---

**Asheel Ahmed Siddiqui**

*Front-End Developer*

*GitHub: [github.com/asheelahmedsiddiqui](https://github.com/asheelahmedsiddiqui) | Twitter: [@asheelsiddiqui](https://twitter.com/asheelsiddiqui)*
"Premier Plumbing Contractors in Lorton, VA"
Published: 2024-05-21 13:41:32

With extensive experience in the field, Liberty Plumbing stands out as a trusted **[Plumbing Contractors Lorton VA.](https://www.libertyplumbinginc.com/services/plumbing/)** Our knowledgeable team delivers reliable solutions for residential and commercial plumbing projects. From installations to repairs, count on Liberty Plumbing for expertise and professionalism in every aspect of plumbing services.
"Top Residential Plumbing Services in Gainesville, VA"
Published: 2024-05-21 13:32:07

Liberty Plumbing is a top Residential **[Plumbing Company Gainesville VA](https://www.libertyplumbinginc.com/services/plumbing/)**, known for its exceptional service and commitment to customer satisfaction. With a focus on reliability and quality, our skilled team delivers comprehensive plumbing solutions tailored to meet the needs of homeowners. Trust Liberty Plumbing for professional service and peace of mind in every residential plumbing project.