teleren/devto huggingface dataset:
Implementing Firebase Cloud Messaging (FCM) in Android Studio with Kotlin | Step-by-Step Tutorial
Tags: firebase, android, kotlin, tutorial
Published: 2024-04-12 18:45:12

{% embed https://youtu.be/Ywn5FwTQwOU %}

Welcome to this tutorial where we'll explore the powerful capabilities of Firebase Cloud Messaging (FCM) in Android Studio using Kotlin. FCM enables you to send and receive push notifications effortlessly in your app. From setting up Firebase in your project to implementing FCM messaging, this tutorial covers everything you need to know to leverage the full potential of Firebase in your Android app development journey.

Step 1: Setting Up Firebase in Your Project
Firstly, we'll guide you through the process of setting up Firebase in your Android Studio project. You'll learn how to create a Firebase project, add your app to the Firebase project, and configure the necessary dependencies.

Step 2: Configuring FCM in Firebase Console
Next, we'll show you how to configure Firebase Cloud Messaging in the Firebase console. You'll understand how to generate and retrieve the necessary credentials for integrating FCM into your app.

Step 3: Integrating FCM into Your App
In this step, we'll dive into the implementation details of integrating FCM into your Android app using Kotlin. You'll learn how to handle device registration, receive FCM messages, and process them to display push notifications.

Step 4: Sending Push Notifications from Firebase Console
We'll demonstrate how to send push notifications from the Firebase console to your app using FCM. You'll understand the various options available for targeting specific devices and user segments with personalized notifications.

Step 5: Testing and Debugging FCM Integration
Finally, we'll cover testing and debugging techniques to ensure the seamless integration of FCM into your app. You'll learn how to verify the delivery of push notifications and troubleshoot common issues.

Conclusion:
Congratulations! You've successfully learned how to implement Firebase Cloud Messaging (FCM) in Android Studio using Kotlin. This tutorial has equipped you with the knowledge and skills to leverage FCM for sending and receiving push notifications in your Android app. We hope you found this tutorial helpful in enhancing your app's engagement and user experience.

If you have any questions or comments, please feel free to leave them below. Don't forget to subscribe to our channel for more tutorials on Android app development with Kotlin and Firebase integration.

Now, armed with the capabilities of Firebase Cloud Messaging, you're ready to enhance communication with your app users through timely and relevant push notifications. Happy coding!

**Build android apps without coding** 
Start for free: https://try.draftbit.com/buildwithoutcode

Feel free to reach out to me with any questions or opportunities at (aahsanaahmed26@gmail.com)
**LinkedIn** (https://www.linkedin.com/in/ahsan-ahmed-39544b246/)
**Facebook** (https://www.facebook.com/profile.php?id=100083917520174).
**YouTube** (https://www.youtube.com/@mobileappdevelopment4343)
**Instagram** (https://www.instagram.com/ahsanahmed_03/)
Lightning Network, Mempool and SegWit
Tags: lighting, btc, beginners, bitcoin
Published: 2024-04-12 18:11:07

## Introduction

Segregated Witness, or SegWit, is a protocol upgrade that was activated on the Bitcoin network in August 2017. It was implemented to improve the efficiency and scalability of the network by separating the signature data from the transaction data in a block, effectively increasing the block size limit from 1 MB to 4 MB. This has several key benefits that have greatly improved the efficiency of the Bitcoin network, particularly in regards to the mempool.

The mempool, short for memory pool, is where unconfirmed transactions are stored before being added to a block by miners. When there are a large number of unconfirmed transactions, the mempool can become congested, causing delays and higher transaction fees. The implementation of SegWit has helped alleviate this congestion in the following ways:

[Unveiling High-Frequency Trading Strategies](https://www.amazon.com/dp/B0CM6W78Q1)

1. Increased transaction capacity: By separating signature data from transaction data, the size of each transaction is reduced. This allows more transactions to fit into a block, increasing the overall transaction capacity of the network.

2. Reduced transaction fees: With more transactions fitting into a block, users have the option to pay lower fees and still have their transactions confirmed quickly. This reduces the overall cost of using the network and makes it more accessible to everyone.

3. Faster confirmation times: As more transactions can fit into a block, the time it takes for a transaction to be confirmed is reduced. This is especially beneficial during periods of high network activity when the mempool is congested.

4. Enhanced security: SegWit also includes a fix for a known vulnerability in the Bitcoin protocol called “transaction malleability”, which allowed users to manipulate transaction IDs. This has improved the security of the network and made it less susceptible to potential attacks.

5. Overall, the implementation of SegWit has greatly improved the efficiency of the Bitcoin network, with transaction fees and confirmation times reducing significantly since its activation.

The Lightning Network is another proposed solution for scaling the Bitcoin network. It is a layer-2 protocol that allows for off-chain transactions, meaning that transactions can be processed without being recorded on the main blockchain. This has the potential to greatly increase the transaction capacity of the network while also reducing fees and confirmation times. The Lightning Network has already been successfully tested and is currently being used on the Bitcoin network, with more nodes and channels being added every day.
Only now and never again
Tags: gamedev, testing, web3, blockchain
Published: 2024-04-12 18:33:39

QQ everyone, my name is Jasper and I'm the project manager of web3. Our project is growing very fast and we can't afford not to hire new team members. Right now we have open positions for a tester and a developer.
`About`
In Dinoverse you can explore different locations, breed and manage dinosaurs, find ancient fossils, build and develop your settlements. The game features mysterious obelisks that can take you back in time, spawning unique tasks, quests and rewards, as well as unlocking access to new areas and events in the game. Your own farm, where you can grow plants and eggs - your faithful companions as you travel through vast biomes in minutes. Of course now we use cars for travelling, instead of equipment we use everyday clothes, and instead of weapons and getting provisions we have a keyboard and food delivery. In general, this is a game about the prehistoric world and its development to what we now modestly call Generation `Z`.
How to classify landmarks using Tensorflow , Tensor-Hub and Python ?
Tags: python, computervision, tensorflow
Published: 2024-04-12 18:27:13

Hi,

This is a Tensorflow tutorial that enables you to classify world landmarks using the pre-trained Tensor-Hub platform.
We will how install the relevant Python libraries , look for the right pre-trained model , and learn how to use it for classify landmark images in Europe.


The link for the video tutorial is here : https://youtu.be/IJ5Z9Awzxr4

I also shared the link for Python code in the video description.

Enjoy

Eran

#Python #Cnn #TensorFlow #AI #Deeplearning #TensorFlow #ImageClassification #TransferLearning #Python #DeepLearning #ArtificialIntelligence #PretrainedModels #ImageRecognition #OpenCV #ComputerVision #Cnn
How to write tests with Typescript and jest
Tags: typescript, programming, node, testing
Published: 2024-04-12 18:24:29

**Step 1: Set Up Your TypeScript Project**

Create a new folder
```
mkdir test
cd test
```

Create a new TypeScript project.

Initialize your project and create a `package.json` file if you don't have one already:

```
pnpm init

pnpm init -y
```

Install TypeScript and Jest as development dependencies:

```
npm i jest typescript ts-jest ts-node @types/jest @types/node -D

pnpm add jest typescript ts-jest ts-node @types/jest @types/node -D
```

**Step 2: Configure TypeScript**

Create a `tsconfig.json` file to configure TypeScript. 
You can use the `tsc --init` command or create it manually.
```
{
  "compilerOptions": {
    "target": "ES6",
    "module": "CommonJS",
    "outDir": "./dist",
    "rootDir": "./src"
  }
},
  "include": [
    "src"
  ]
```

Create a `jest.config.ts` file to configure Jest 

```
pnpm create jest 
```
```
import type {Config} from 'jest';

  const config: Config = {
  collectCoverage: true,
  coverageProvider: "v8",
  preset: 'ts-jest',
  roots: [
     "<rootDir>"
   ],
  testEnvironment: "node",
  verbose: true,
  transform: {}
}
```
Create a `src` directory for your TypeScript source files and a `tests` directory for your test files.

Creates a file insider the folder `src` you migh named `operation.ts`

```
export function Sum(a: number, b: number): number {
  return a + b;
}
```
import the file we created in the test location into a new file named `operation.test.ts` or `operation.spec.ts`
```
import { Sum} from "../src/operation";

describe("Math functions", () => {
  test("should add two numbers correctly", () => {
    expect(add(1, 2)).toEqual(3);
  });
});
```

**Step 3: Run Your Tests**

Add a script to your `package.json` to run the tests:

```
"scripts": {
  "test": "jest"
}
```

Run your tests using:
```
npm run test

pnpm run test
```
Updates from the 101th TC39 meeting
Tags: javascript
Published: 2024-04-12 18:23:43

There were several items on the agenda, this post focuses on feature proposals and their progress from the 101th TC39 meeting [8-11th April 2024].

__Stage 1:__

* [Error.isError](https://github.com/tc39/proposal-is-error): `Error.isError` tests if a value is an `Error` instance, irrespective of its Realm origin.

* [Signals](https://github.com/tc39/proposal-signals): A declarative programming model for updating based on changes to state.

* [Strict `using`](https://github.com/rbuckton/proposal-using-enforcement): Proposal to mandate the use of `using` for certain resources.

__Stage 2.7:__

* [Math.sumPrecise](https://github.com/tc39/proposal-math-sum): summation method.

* [Promise.try](https://github.com/tc39/proposal-promise-try"): an ergonomic, readable, and intuitive way to invoke a function and always get a Promise.

__Stage 3:__

* [Redeclarable global eval-introduced vars](https://github.com/tc39/proposal-redeclarable-global-eval-vars 
): Make eval-introduced global vars redeclarable.

* [Dynamic code brand checks](https://github.com/tc39/proposal-dynamic-code-brand-checks):Flexible brand checks before dynamic code loading.

__Stage 4:__

* [Set Methods](https://github.com/tc39/proposal-set-methods): New Set methods

* [Duplicate named capture groups](https://github.com/tc39/proposal-duplicate-named-capturing-groups): allow regex capturing group names to be repeated

<hr />
<center>
[Hemanth HM](https://h3manth.com)
<center />
Transform Your Landscape Safely: Tree Removal Services in New Bern, NC
Published: 2024-04-12 18:10:56


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xp62u07kqrt3vfk75dl0.png)
Nestled in the heart of North Carolina, New Bern boasts a picturesque landscape characterized by lush greenery and majestic trees. While these trees undoubtedly contribute to the city's natural beauty, there are times when tree removal becomes necessary for safety, aesthetics, or practical reasons. If you find yourself in need of professional tree removal services in New Bern, NC, you've come to the right place.

Tree removal is a task best left to the experts, as it requires specialized knowledge, equipment, and safety protocols to ensure a smooth and hassle-free process. Attempting to tackle tree removal on your own can be not only challenging but also dangerous, posing risks to yourself, your property, and surrounding structures. That's where professional tree removal services in New Bern, NC, come into play, offering a range of benefits that make the process efficient, safe, and stress-free.

First and foremost, safety is paramount when it comes to tree removal. Professional arborists have the expertise and experience to assess the condition of trees and identify potential hazards such as weak branches, disease, or structural instability. By entrusting your tree removal needs to skilled professionals in New Bern, NC, you can rest assured that the job will be carried out safely and responsibly, minimizing the risk of accidents or property damage.

In addition to safety, efficiency is another key advantage of hiring professional tree removal services. Equipped with state-of-the-art tools and equipment, arborists can efficiently remove trees of all sizes and varieties, even in tight or confined spaces. Whether you need a single tree removed or multiple trees cleared from your property, professional tree removal services in New Bern, NC, can handle the task with precision and efficiency, saving you time and effort in the process.

Furthermore, professional tree removal services don't just stop at cutting down trees. They also include comprehensive cleanup and debris removal, ensuring that your property is left neat, tidy, and free of any tree remnants.

[READ MORE HERE..](https://gitea.com/ahprecisiontreeservicellc/A_H_Precision_Tree_Service/wiki/Tree-Removal-New-Bern%2C-NC)
Web Extract Worker, a service with text-to-image worker AI models!
Tags: cloudflarechallenge, devchallenge, ai
Published: 2024-04-12 17:44:36

---
title: Web Extract Worker, a service with text-to-image worker AI models!
published: true
tags: cloudflarechallenge, devchallenge, ai
---

## What I Built

In our web service, we can fill the prompt and generate image with one of the text-to-image worker AI model randomly.

The user scenario image is as folows:

![User Scenario](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/63qennb786p0ikqvdc8n.png)

## Demo

Our front-end worker is deployed at the [Cloudflare Pages](https://web-extract-worker.pages.dev).

### Try out our web service!

Firstly, open the web page and browse the above link:

![Step 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g816fes8ydmp5efprrpk.png)

Input the `corgi` to be the prompt and click "Generate" button:

![Step 2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bcwysylxm1r6fb769n1z.png)

After waiting for about whiles, it will present generated image:

![Step 3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ll0y46i80dx4qg07zt9k.png)

You're done for our web service tutorial now!

## My Code

Our source code is available here:

{% embed https://github.com/peter279k/web-extract-worker %}

And our techniques are as follows:

- Front-end: The `index.html` is the main page to let users input their prompts and see generated image.
- Back-end: The `extract.php` is the main PHP program to handle user prompt and respond generated image.

## Journey

We used these following models and the PHP program will choose them randomly when retrieving user prompts:

- Image-to-text: [@cf/lykon/dreamshaper-8-lcm](https://developers.cloudflare.com/workers-ai/models/dreamshaper-8-lcm)
- Image-to-text: [@cf/stabilityai/stable-diffusion-xl-base-1.0](https://developers.cloudflare.com/workers-ai/models/stable-diffusion-xl-base-1.0)
- Image-to-text: [@cf/bytedance/stable-diffusion-xl-lightning](https://developers.cloudflare.com/workers-ai/models/stable-diffusion-xl-lightning)

It's the dead simple for PHP developers to learn how to use the native PHP codes to develop a extract text to image service via the Cloudflare worker AI models :).
Do's and Don'ts in Django
Tags: django, webdev, beginners, programming
Published: 2024-04-12 17:34:42


 

## Do’s 

Use meaningful variables: We should use clear, concise, and self-explanatory variables, functions, and classes name. 

**DRY:** Don’t Repeat Yourself. We should reuse code as much as possible. Once you are done with the code, take 10 minutes to think what the possibilities are to improve it further and make it optimal. 

**Use Django features:** On daily basis, we receive unique requirements which is consist of unique business logic for those cases we often write flexible code to solve a problem, which is fine but again it might not be the optimal solution. So again, take 10 minutes extra to research how could you have done this differently keeping a standard approach and solution.  

**Quick related note:** It is very normal to think of a custom solution first, however it helps or comes to your head. No one solves a problem in the first go with the best possible solution and standards. It is always the next set of iteration which makes the difference. 

**Do a security check:** Always do a security check once you are done with a task.  Think of edge cases which can eventually create a problem. If needed get on a call with someone and share your thoughts and understanding, you will get more clarity with another set of eyes. 

**Follow PEP8:** Since so many people are working on the same code, and we are trying to make it more readable and understandable. It is especially important that we make use PEP 8 style guide for Python code. 

 

## Don’ts 

**Do not write Complex Queries on serializers:** Avoid writing complex queries on serializers or any serializer methods. Prefetch data in views instead. 

**Don’t write generic views all the time:** Generic views are super useful and powerful but do not use it when it is not required. If the requirement is simple and straightforward write Functional views instead. 

**Don’t keep unlimited access to endpoints (Rate Limiting): **Implement rate limiting to protect APIs.  

**Don’t write nested serializers:** Nested serializers can produce inefficient queries and effect performance. Create different endpoints for these cases or change the data structure. 

**Don’t write business logic inside views or serializers:** It is one of most important things to consider when building a huge project consists of lots of business logic. Business logic should be written in service layer, model property methods etc.
Day 12/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-04-12 17:30:04

🚀 **Today's Learning:**

🌟 DSA

- Insert a node at the end in DLL
- Delete last node in DLL

🌟 Dev

- TestFlight

🔍 **Some Key Highlights:**

DSA

Insert a node at the end in DLL → Move to last node using a pointer tail. Create a new node called newNode. Make its next point to NULL and prev point to tail. Make tail → next point to newNode. Return head.


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

Delete last node in DLL → Traverse to last node using tail. Make secondLastTail pointer. Tail→prev = secondLastTail. secondLastTail→next = NULL. Tail→prev=NULL. Delete tail to free memory. Return head. Check for edge cases if list is empty(head == NULL) or just one node to delete(head→next == NULL). Return NULL in these cases.


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

DEV

TestFlight is a platform developed by Apple that allows developers to distribute pre-release versions of their iOS, watchOS, and tvOS apps to testers. It enables developers to gather feedback, identify bugs, and refine their apps before releasing them to the wider public through the App Store. TestFlight makes it easier for developers to manage the testing process and for testers to provide feedback directly within the app.

 #100daysofcode #1percentplusplus #coding #dsa
Learning AWS Day by Day — Day 35 — CloudFormation — Part 2
Tags: aws, cloud, cloudcomputing, beginners
Published: 2024-04-12 17:05:43

Exploring AWS !!

**Day 35:**

**CloudFormation — Part 2**

Stacks: A stack is a group of related AWS resources that we manage as a single unit. A stack for instance, can include al resources required to run a web application, such as web server, database, networking rule. If we no longer require a web application, we can delete the stack and all of its related resources will be deleted. If a resource cannot be created, AWS CloudFormation rolls back and automatically deletes any resources that were created.
We can use AWS CLI, or management console to create it.

Nested Stacks: created as part of other stacks. We can create a nested stack within another stack by using AWS::CloudFormation::Stack-resource.

For first level of nested stack, the root stack is also the parent stack. So lets say, A is the parent and root for B, for C the B is parent stack.

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

CloudFormation Stack Sets: extends the functionality of stacks by enabling us to create, update or delete stacks across multiple accounts and regions with single operation. an administrator account is AWS account in which we can create stack sets. A target account is AWS account in which we can create, update or delete one or more stacks in our stack set. A stack instance is a reference to a stack in target account within a region. A stack instance can exist without a stack, example if stack cannot be created for some reason, the stack instance shows the reason for stack creation failure.

CloudFormation Template Anatomy:
Format version → “AWSTemplateFormatVersion”:”2010–9–9"
Description → “Description”:”AWSCloudFormationTemplate”
Metadata → Object to provide details of template
Parameter → Input parameters to pass user values in template.
Mappings → To map a name to its corresponding value
Conditions → The condition under which resources should be created
Transform → User macros to process our templates
Resources → resources which will be in the stack to be launched
Outputs → declares output values, which can be later used

Parameters: they enable us to input custom values to our template each time we create or update a stack.

Syntax:
“Parameters”: {
“Type”: “DataType”,
“ParameterType”: “value”
}