teleren/devto huggingface dataset:
What is Kafka? How Kafka works?Instllation steps.
Published: 2023-05-11 13:40:39


 
What is Apache Kafka?
Apache Kafka is an open-source distributed streaming platform that ingests and processes streaming data in real-time. It is designed to handle high volume of data from different sources. Apache Kafka uses a Publish and Subscribe model to read and write streams of records.  Kafka reads and writes messages asynchronously.
 
Topics: Kafka topics is a feed name to which messages are published. It is used to organize and categorize in a distributed and scalable manner.
Its logical categorization of messages in Kafka
 
Partition: A topic can be devided into multiple partions which allow for parallelism & scalability. Each partition is an ordered and immutable sequence of records
Producer / Publisher: are clients which generate message and queue them into Kafka model.
Consumer / Subscriber: are ones who consume message from Kafka model
 
Prerequisite:
Download & install JDK
  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l0w2k5s0wr4lpovlc9z1.png)


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


 
Download the kafka latest stable version from official apache websites.
 
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rrsw1q95k555yjds7inp.png)


 
Extract the tgz file as below
tar xvfz kafka_2.12-3.4.0.tgz
Rename the kafka directory & put it in opt/kafka directory.
mv kafka_2.12-3.4.0 kafka
/opt/kafka/bin
 
Before starting kafka we need to start the zookeeper.
Run the following commands in order to start all services in the correct order:
 
 
/opt/kafka$ bin/zookeeper-server-start.sh config/zookeeper.properties
 
 
Start the kafka server.
/opt/kafka$ bin/kafka-server-start.sh config/server.properties
These services will be running on Linux active prompt .to run it as systemd services so that when you restart Linux these services will be restarted automatically.
Now create a service file for both Kafka & zookeeper
 
sudo vi /etc/systemd/system/zookeeper.service
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t6sm286hwh4mn12p5pn.png)


 
Same for kafka
 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4h5zsmjrs2vdfuz3r6lj.png)


 
 
 enable the service for systemd & realod the daemon
 
 
 sudo systemctl daemon-reload
sudo systemctl start zookeeper to check sudo systemctl status zookeeper
sudo systemctl start kafka
 
Topic creation
bin/kafka-topics.sh --create --topic test --bootstrap-server localhost:9092
Created topic test.

to check if topic is created

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


 Congratulations ,Kafka is installed in system & topic is created.
 Now we can publish & consume messages
How to Fix 'AssetManifest' is imported from both 'package:flutter...' and 'package:google_fonts...' error
Tags: flutter, dart
Published: 2023-05-11 13:38:50

## Indroduction

In this article I'll share with you how to fix'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and 'package:google_fonts/src/asset_manifest.dart'.

When you run your flutter app you might notice this error in your debug console.
```
Launching lib/main.dart on SM A225M in debug mode...
main.dart:1
Warning: Errors limit exceeded. To receive all errors set com.sun.xml.bind logger to FINEST level.
Warning: unexpected element (uri:"", local:"extension-level"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>
: Error: 'AssetManifest' is imported from both 'package:flutter/src/services/asset_manifest.dart' and 'package:google_fonts/src/asset_manifest.dart'.
google_fonts_base.dart:14
import 'asset_manifest.dart';
^^^^^^^^^^^^^
```





## Solution

Fortunately this is a simple fix, update your `google_fonts:` package in `pubspec.yaml` to the [latest version](https://pub.dev/packages/google_fonts) 



Run your flutter app and your code should be fine.

## Connect with me

Thank you for reading my post. Feel free to like, comment, subscribe or connect with me on [LinkedIn](https://www.linkedin.com/in/curtlycritchlow/) and [Twitter](https://twitter.com/CritchlowCurtly). You can also [buy me a book](https://www.buymeacoffee.com/curtlycritchlow) to show your support.
Idea: A Command-Line Chat Application - GitHub + DEV Hackathon Progress Update
Tags: githubhack23, node, hackathon, sideprojects
Published: 2023-05-11 13:36:58

Hello DEVs. I'm excited to participate in my first hackathon. I got the idea for a command-line chat application a few weeks ago and have been procrastinating on it. But the **GitHub + DEV Hackathon** has reignited my interest in building the application.

The goal of this project is to create a real-time chat application that allows users to create and join room chats from the command line. The project is mostly targeted at anyone who is not afraid of the command line (lol).

The project falls under the **Wacky Wildcards** category of the hackathon. And I'm looking forward to building a silly and fun application.

I hope to learn new technologies and become a better developer while also winning some cool prizes by the end of the hackathon.
FREE e-book: The Python Interview Handbook 2023 - 112 Q & A
Tags: programming, python, free, books
Published: 2023-05-11 13:25:05

Here is a FREE version of our best selling Python e-book with preview of 112 FREE interview questions and answers in 2023 for all of you who are actively searching for a new job.

For a full version please [click here](https://withkoji.com/@nezirz/su7d) and you will get more than 500+ interview questions and answers for your next Python developer job role.

As you could note before few days we published full version of the e-book The [Python Interview Handbook 2023 - 500+ Q&A](https://nezirzahirovic.gumroad.com/) and now we are offering a shorter version of the same book with 112 FREE Interview Questions and Answers which should be a nice intro into final and full version of our newest e-book product. 

Please check the book and our other books on [interviewbible.com](https://www.interviewbible.com) 

And more details about this book and the full version book you can find clicking on the cover below.

[![python interview bible](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1uorb10ay4cvg1djmjfy.png)](https://dev.to/nezirzahirovic/the-python-interview-handbook-2023-your-ultimate-guide-to-crack-any-python-interview-5f6m)
![python interview bible](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hvelj4wyjulzwqw9kz1y.png)
![python interview bible](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iedgxw5ppdp033q0d4gb.png)
![python interview bible](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a4bsy3c6rud05zf3r1u2.png)
Hiring Developers!
Published: 2023-05-11 13:20:23

FactWise is #hiring. We are looking for talented lead #softwareengineers to join our team! While there have been massive layoffs due to companies overreaching, FactWise has been prudent and is leaning in now. 
 
We are hoping to be joined by an experienced individual who can lead a team of 6-10 developers immediately and up to 20+ developers a year from now. Our current tech stack is Python/Django, React with Typescript in an AWS environment. All our positions are onsite (at least for the first 6 to 12 months) in our Mumbai office (Dadar).

If you are a proficient, passionate engineer (backend, frontend or full stack) excited about making real, quantifiable impact, we’d love to know you better! If you have been affected by the layoffs, please let us know so that we can prioritize you.

Below is the link -- looking forward to having you join us! 
 
#sde #jobhelp #jobopening #hiring #startup #saas #mumbai #startupjobs #softwaredevelopment #layoffs #techhiring

[](https://www.linkedin.com/jobs/view/3595807506)
Kafka Topic issue
Tags: kafka, java, springboot
Published: 2023-05-11 10:39:46

Hi 
when am writing a Kafka consumer in spring boot 
Kafka callback will receive in Kafka server and my consumer will consume that data from Kafka server. But when am trying the same  after several days( means within 1 or 2 weeks) my consumer will not pick that callback from Kafka server. To solve that issue I need to change the topic in both consumer and producer level. then after some days it will follow the same.
can some one please help on this 


my sample Kafka consumer

@EnableKafka

@Configuration
public class KafkaPaymentSummaryConsumer {

	private static final Logger logger = LogManager.getLogger(KafkaPaymentSummaryConsumer.class);

	@Autowired
	ManualTaskManagerService service;

	@Autowired
	ManualTaskDao manualTaskDao;

	@KafkaListener(topics = "${rom.manualTask.payment.summary.kafka.topic}", groupId = "${rom.manualTask.kafka.groupId}")
	public void listen(String message, Acknowledgment acknowledgment) {
		logger.info("Received Message: " + message);

		acknowledgment.acknowledge();
		ObjectMapper mapper = new ObjectMapper();
		String transactionId = null;

		Map<String, Object> readValue = null;
		try {
			logger.info("PaymentSummary with ID:" + transactionId + ":" + message);
			readValue = mapper.readValue(message, Map.class);

			transactionId = String.valueOf(readValue.get("extRefId"));
			ManualTask task = manualTaskDao.getByTransactionId(transactionId);

			logger.info("ManualTask: " + task);

			if (task != null && task.getOrderId() != null) {
				logger.info("orderId " + task.getOrderId());
				readValue.put("orderId", task.getOrderId());

			}

			logger.info("Map data: " + readValue);
			service.processTransaction(transactionId, readValue);

		} catch (JsonMappingException e) {
			logger.error("JsonMappingException occured:", e);
		} catch (JsonProcessingException e) {
			logger.error("JsonProcessingException occured:", e);
		} catch (Exception e) {
			logger.error("Exception occured:", e);
		}

	}

}
Mojo Lang: the Python Killer? Pfft, Maybe!
Tags: python, mojo, computerscience, programming
Published: 2023-05-11 12:53:29

It’s like when your favorite series introduces a new character. You’re not sure if you’re going to like them or if they’re going to stick around for long. That’s kind of how we feel about Mojo Lang. It’s the new character in the programming world, and we’re not sure if it’s going to become a fan favorite or get written off after a few episodes.

Mojo is like the younger, cooler sibling of Python. Sure, Python has been around for a while and is a bit of a legend, but let’s face it, it can be slow. Enter Mojo, the new kid on the block designed for AI development. It’s a superset of Python, so you can still use all those old Python libraries you know and love. But, it’s got a few tricks up its sleeve that make it faster and more efficient.

Mojo has automatic type inference, static typing, and compile-time optimizations. Sounds fancy, right? Well, it is! These features make Mojo faster and more efficient than Python for those computationally intensive tasks. And it’s already being used by bigwigs like Google, Facebook, and Amazon.

But, before you jump ship and start learning Mojo, let’s talk about the pros and cons.

## Pros:
* It’s easy to learn: Mojo is a superset of Python, so if you know Python, you can learn Mojo pretty easily.
* It’s flexible: Mojo is a general-purpose language, so you can use it for a variety of tasks.
* It’s fast: Mojo is designed for performance, so it’s great for those CPU-intensive tasks.
* It’s extensible: It’s open source, so you can customize and extend it to your heart’s content.

## Cons:
* It’s still under development: It’s not quite as stable or feature-rich as some other programming languages.
* It’s not as widely used: Python is pretty much the king of the * hill when it comes to programming languages, so there may be less support available for Mojo.
* There’s a learning curve: If you’re not already familiar with Python, there might be a bit of a learning curve.


So, is Mojo Lang the Python killer? Eh, maybe. It’s got some great features and potential, but it’s still a bit of a newbie. It’s like when your little cousin starts bragging about how cool they are because they learned to ride a bike without training wheels. Sure, it’s impressive, but they’ve still got a long way to go before they can keep up with the big kids.

So, maybe give Mojo a try, see how it works for you, but don’t abandon Python just yet. It’s still got a lot of life left in it.
14 Essential Linux Commands Every Developer Should Know
Tags: webdev, beginners, programming, linux
Published: 2023-05-11 12:50:38

As a junior developer, I faced a common problem: my laptop was working slowly and I needed to free up system resources by terminating unnecessary processes. 

However, I wasn’t sure how to identify which processes were running and which ones I could safely terminate in Ubuntu.

That’s when I started exploring some advanced commands that could help me identify and manage system processes more effectively.

Today, I will be sharing some commands that may be helpful in improving your knowledge and productivity.

The Linux operating system offers a vast array of powerful tools and commands that can be used to streamline workflows and enhance productivity.

While many developers may be familiar with common commands like **ls, cd,** and **grep**, there are many lesser-known commands that can provide valuable functionality for a variety of use cases.

Whether you’re struggling with system performance issues like I was, or simply looking to improve your productivity and efficiency, these commands will help you work more effectively on Linux systems.

## Table of contents

1. tree - Learn directory structure
2. ncdu — NCurses Disk Usage
3. colordiff — The difference between two files
4. nohup — Run a script in the background
5. tac — Reverse of cat
6. units — Unit conversions
7. find — Searching files
8. locate — Quick searching files
9. xxd — Hex dumps of binary files
10. sed — Stream Editor
11. jq — Parse JSON data
12. awk — Data processing and extractions
13. strace — Diagnose program issues
14. scp — Secure copy

That’s it for today. If you have come across any other commands, that you find particularly useful, feel free to share them in the comments section.

For an in-depth exploration with examples, head over to our original blog post [here](https://blog.canopas.com/14-must-know-linux-commands-to-improve-your-efficiency-as-a-developer-85a2ee07eb7b).
Containerizing a QR Code Reader
Tags: perl, qrcodes, docker
Published: 2023-05-11 12:41:03


![Credit: Flavio Polleti](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jikrg1v2yb8z3loanj99.png)

[Flavio Poletti](https://github.com/polettix) recently blogged about using `Barcode::ZBar` for reading QR codes. In a previous life I have written applications for workflows that involved reading QR codes from documents and have also used `Barcode::ZBar` very effectively...highly recommended.

Back then, iirc I had quite a struggle satisfying all of the dependencies required to get it actually work. I spent a little time after reading his article to see I could successfully build it once more, this time in a Docker container. The result is this project:

[docker-barcode-zbar](https://github.com/rlauer6/docker-barcode-zbar)

It was a little difficult piecing together the required packages, but in the end it works!

Next, I may create a webservice from the container and install it on a Fargate cluster. The service will allow you to upload `.png` files and scan them for QR codes. Stay tuned!

## Other Links of Interest

* [Javascript based scanner](https://github.com/nimiq/qr-scanner)
* [zbar library](https://github.com/mchehab/zbar)
* [Reading QR Codes from Perl](https://github.polettix.it/ETOOBUSY/2020/01/22/zbar/)
* [`Barcode::ZBar`](https://metacpan.org/Barcode::ZBar)
* [Two-Factor Authentication using QR code](https://github.com/rlauer6/perl-Authen-TOTP-WebApp)
List of Best React Developer Tools For Software Developers In 2023
Tags: react, reactjsdevelopment, developer
Published: 2023-05-11 12:32:01

In today's Time of multiple developers and programming languages, effective developers make a huge difference. Every developer needs a set of tools to work, and if they are not good, the developer cannot fully demonstrate his skills. In such cases, the product sent also does not meet expectations. 

To protect against this kind of underbidding, developer communities often help each other. They do this by creating apps or plugins that make it easier to work with a particular technology.

**What is React?**

React is a user interface library developed, maintained, and open-sourced by Facebook. It's about building component-based user interfaces for web applications. The library is built in JavaScript and works with all technologies. It helps build dynamic user interfaces quite quickly and follows many best practices to help maintain applications in the long term.

**Why is React so Popular Among Developers?**

1.   Easy to Understand
2.   Huge Community Support
3.   Increases Productivity
4.   Virtual DOM
5.   Builds Dynamic Interfaces
6.   Offers Multiple Developer Tools
7.   Excellent Code Stability

**What are Developer Tools?**

Developer tools help increase development efficiency. Such tools speed up the development process and also help developers do meaningful things with less effort.  

**10 Best React Developer Tools**

1. React Developer Tools Browser Extension
2. Create React App
3. React 360
4. BIT
5. Reactide
6. Jest
7. Storybook
8. Evergreen
9. React Redux
10. React Extension Pack for VS Code

There are many powerful React developer tools that can simplify your development process. However, we have found 10 of the best responsive developer tools that you cannot miss in 2023. [This article](https://techshill.com/best-react-developer-tools-for-software-developers/) will help you to find the Best React Developer Tools For Software Developers.
Looking for Software Integration Partners
Published: 2023-05-11 12:31:51

Hello, I am looking to find a partner with software integration skills to start selling the capabilities to companies I'm sure some of you are adept and capable of creating such software. I am a salesman and consultant. In partnership with your services, I believe we can monetize our capabilities on a higher level and make a big difference in how these companies operate Thanks for reading, and I look forward to hearing your replies.
collections.Counter() | HackerRank | Python
Tags: hackerrank, codenewbie, beginners, python
Published: 2023-05-11 12:19:00

## The Problem

Raghu is a shoe shop owner with X number of shoes available. He has a list containing the size of each shoe in his inventory. There are N customers, each willing to pay {% katex inline %} x_1 {% endkatex %} amount of money, but only if they get the shoe of their desired size.

Your task is to calculate the total amount of money Raghu will earn based on these conditions.

## The Input

The first line contains X, the total number of shoes.
The second line contains a space-separated list of all the shoe sizes in the shop.
The third line contains N, the total number of customers.
The next N lines contain space-separated values of the `shoe size` desired by the customer and {% katex inline %} x_1 {% endkatex %}, the price they are willing to pay for the shoe.

### Constraints

- {% katex inline %} 0 \lt X \lt 10^3 {% endkatex %}
- {% katex inline %} 0 \lt N \le 10^3 {% endkatex %}
- {% katex inline %} 20 \lt x_1 \lt 100 {% endkatex %}
- {% katex inline %} 2 \lt shoe  size \lt 20 {% endkatex %}

Sample Input:

```
10
2 3 4 5 6 8 7 6 5 18
6
6 55
6 45
6 55
4 40
18 60
10 50
```

## The Output

The output should be the total amount of money earned by Raghu.

Sample Output:

```
200
```

### Explanation

Customer 1: Purchased size 6 shoe for $55.
Customer 2: Purchased size 6 shoe for $45.
Customer 3: Size 6 is no longer available, so no purchase.
Customer 4: Purchased size 4 shoe for $40.
Customer 5: Purchased size 18 shoe for $60.
Customer 6: Size 10 is not available, so no purchase.

Total money earned {% katex inline %} = 55 + 45 + 40 + 60 = 200 {% endkatex %}

## The Solution

To solve this problem, we need to keep track of the shoe sizes available and sell them to customers if we have their desired size. This can be accomplished efficiently using the Python `collections.Counter` class, which counts the number of occurrences of elements in a list.

### The Code

Here is the Python code that solves this problem:

```python
from collections import Counter as ctr

_ = input()
shoe_sizes_counter = ctr(map(int, input().split(' ')))
earning = 0

for _ in range(int(input())):
    size, price = tuple(map(int, input().split(' ')))
    if shoe_sizes_counter.get(size, 0):
        earning += price
        shoe_sizes_counter[size] -= 1

print(earning)
```

This code maintains a counter of available shoe sizes. For each customer, it checks whether the desired shoe size is available. If so, the customer's price is added to the total earnings and the shoe size is decremented from the counter. The final earnings are then printed.

[Original Source](https://www.hackerrank.com/challenges/collections-counter/problem?isFullScreen=true)

For more insightful solutions and tech-related content, feel free to connect with me on my [Beacons page](https://beacons.ai/ranggakd).

{% embed https://beacons.ai/ranggakd %}