teleren/devto huggingface dataset:
Introduction to LangChain
Tags: langchain, openai, programming, openapi
Published: 2024-01-28 09:23:00

Today we are going to learn about most trending framwork Langchain. We are starting Introduction to langchain then step by step we can create many realworld application.Artificial intelligence and natural language processing, LangChain appears as a powerful and universal tool, revolutionizing the way we interact with language models.

In this blog post, I launch on a journey to explore the vast abilities of LangChain starting Introduction to LangChain, unraveling its potential applications and use cases. Let’s dive into the world of LangChain and discover how it is reshaping the future of language processing.

```
Table of Contents

Introduction to LangChain
Capabilities of LangChain
1. Conversational Agents
2. Natural Language Understanding (NLU)
3. Integration with External Tools and APIs
Applications of LangChain
Conclusion
```
## Introduction to LangChain
LangChain is a remarkable improvement in language models. It’s a modern framework designed for simplicity and efficiency, creating language processing easy for developers and businesses. Unlike older methods, LangChain uses a minimalistic code approach, enabling fast development of complex language applications.

**📌Read Full Article on [bhylu.com](https://bhylu.com/introduction-to-langchain/)**


### Capabilities of LangChain
1. Conversational Agents
2. Natural Language Understanding (NLU)
3. Integration with External Tools and APIs

### Applications of LangChain
1. Content Creation

LangChain proves to be a valuable asset in content creation. Developers can harness its capabilities to generate creative and contextually relevant text, streamlining the content creation process. Whether it's writing articles, generating marketing copy, or crafting social media posts, LangChain offers a versatile solution.

2. Language Translation

The framework's robust language models make it well-suited for language translation tasks. LangChain's ability to understand and generate human-like language allows for the development of efficient and accurate translation applications.

🔹**Contact priteshbhoi18@gmail.com** to integrate website using Hugging Face Spaces, Open Al, own data.
- Chatbot App
- Find Similar Things App
- Marketing Campaign App
Software Testing - Things to Know
Published: 2024-01-28 09:22:28

**_What is Software Testing?_**

# Evalution of function of a software application/build to find any bug/error
# Checking whether software is having all the necessary/ specified requirements given by clients/customers
# Identify defects and reporting them to develop a quality application software
# Finding the gaps or missing requirements against actual requirements

**_Things to know about Software Testing:
# Lifecycle:_**
            Requirement Analysis
                       | 
                Test Planning
                       |
             Test case development
                       |
             Test Environment setup
                       |
                 Test Execution
                       |
               Test cycle closure


# **_Testing Types_**
              1) Manual Testing
              2) Automated Testing

**_Relevance of Software Testing_**
# Development of a quality product/service
# Customer satisfaction
# Reduction of Cost and time used for development and testing
# Finding issues and rectifying them at beginning itself
Riflesso - Multipage agency theme. Built with Astro, Tailwind CSS
Tags: webdev, javascript, tailwindcss, astro
Published: 2024-01-28 09:21:32

Riflesso - Multipage agency theme.
Built with Astro, Tailwind CSS

Includes:
- Pages 22
- Sections 50+
- Components 100+

This theme is included on the bundle.
See it live and learn more:
- https://lexingtonthemes.com/info/riflesso/

A monochromatic design with a sophisticated and clean layout, ideal for a portfolio or professional services website. It combines grayscale photography with minimalist text for an elegant and modern look.

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

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

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dk7l2g583oun64cl9gel.png)
Enlightr - E-learning multipage theme. Built with Astro, Tailwind CSS & MDX
Tags: webdev, javascript, tailwindcss, astro
Published: 2024-01-28 09:20:37

Enlightr - E-learning multipage theme
Built with Astro, Tailwind CSS & MDX

- 44 Pages
- 50+ Sections
- 80+ Components

See it live and learn what's included:
https://lexingtonthemes.com/info/enlightr/

A bright and inviting design with a mix of pastel colors, tailored for an e-learning platform, providing a friendly and approachable feel.
The Interesting Issue with Syncing Google Account in Ubuntu 22.04/23.10 and Its Simple Solution
Tags: ubuntu, google, 2fa, onlineaccounts
Published: 2024-01-28 09:00:33

Hello everyone!

Today, I want to share an experience that demonstrates how we can solve a frequently frustrating issue for Ubuntu users, especially when trying to sync Google accounts with two-factor authentication (2FA) enabled.

Here’s a common scenario: You enter your password and then are faced with a continuously loading screen. The widely recommended command found online, WEBKIT_DISABLE_COMPOSITING_MODE=1 gnome-control-center, often does not work.

One day, after entering my password, I encountered this endless loading screen. I right-clicked and selected 'reload', and suddenly, the 2FA screen appeared. I entered my 2FA verification code and was able to sync my Google account with Ubuntu. Yes, the solution was that simple: Just right-click and reload! :)

Sometimes the simplest solutions can solve the most complex problems. I hope this information will be helpful to others facing similar issues.
Weekly reading digest #24
Tags: php, backend, symfony, softwareengineering
Published: 2024-01-28 09:00:00

[All the recursive Functions in PHP](https://www.exakat.io/en/all-the-recursive-functions-in-php/)

[GitAttributes for PHP Composer Projects](https://php.watch/articles/composer-gitattributes)

[The infamous Repository Pattern in PHP](https://doeken.org/blog/repository-pattern)

[Designing fine-grained independent features using Symfony and Strategy Pattern](https://medium.com/@mounir.mouih/designing-fine-grained-independent-features-using-symfony-and-strategy-pattern-084a0740fa5d)

[How to ensure that all the routes on my Symfony app have access control](https://blog.theodo.com/2023/10/ensure-that-symfony-routes-have-access-control/)

[How Standard Ebooks serves millions of requests per month with a 2gb vps; or, a paean to the classic web](https://alexcabal.com/posts/standard-ebooks-and-classic-web-tech)

[Testing tips](https://testing-tips.sarvendev.com/#/)
How to setup PostgreSQL and DBeaver on WSL.
Tags: wsl, postgres, postgressql, dbeaver
Published: 2024-01-28 08:26:05

Spent a few hours trying to configure PotgreSQL and DBeaver on wsl. Hope this helps. 


## Installing postgresql on wsl terminal

```
$ sudo apt update
$ sudo apt install postgresql postgresql-contrib
$ psql --version
```

- Give it a password that we will use in Dbeaver when testing connection.

`$ sudo passwd postgres`

- Restart Terminal.


- Check status and start PostgreSQL service.

```
$ sudo service postgresql status
$ sudo service postgresql start
```
 - You should get a prompt asking for your password.

If you didn't, then type :

```
$ su - postgres
$ psql
```
- After entering your password you should see this

`postgres=#`

- Keep terminal open

## DBeaver Setup

- Open DBeaver after installing from [here](https://dbeaver.io/download/)

- Ctrl - Shift - N to make a new connection and select PostgreSQL.

- Fill your password you entered earlier and click test connection.

![DBeaver postgres pop up](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xpcg0yjf15cvy6igs9u7.png)

- It should ask you to download some drivers. After downloading it should be working.

![Test Success](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pfus2l5uwzwgwm008i8u.png)


If you get an error, lets try reseting password and creating dummydb.

- go back to your terminal \q out and

```
$ sudo -u postgres createuser <username>
$ sudo -u postgres createdb <dummydbname>
$ sudo -u postgres psql
```

```
psql=# alter user postgres with encrypted password '<password>'
psql=# grant all privileges on database <dbname> to postgres 
```

- Close DBeaver and retry testing your connection.

- If you get an connection error

```
sudo ufw allow 5432/tcp
# You should see "Rules updated" and/or "Rules updated (v6)"
sudo service postgresql restart
```

- Open powershell as admin
`wsl --shutdown`

Start postgresql service and Retry connection.
Ubuntu 22.04/23.10 Google Hesabını Eşlemede Yaşanan İlginç Sorun ve Kolay Çözümü
Tags: ubuntu, google, 2fa, onlineaccounts
Published: 2024-01-28 08:58:54

Herkes merhaba!

Bugün, Ubuntu kullanıcılarının sıkça başını ağrıtan bir durumu, aslında ne kadar basit bir şekilde çözebileceğimizi gösteren bir deneyimimi anlatmak istiyorum. Özellikle iki faktörlü kimlik doğrulaması (2FA) aktif olan Google hesaplarında Ubuntu ile eşleme yaparken sorun yaşıyoruz.

Genelde şöyle bir durum oluyor: Şifrenizi giriyorsunuz ve ardından sürekli yüklenen bir ekranla karşı karşıya kalıyorsunuz. İnternette biraz araştırma yaparsanız bulabileceğiniz, herkesin önerdiği `WEBKIT_DISABLE_COMPOSITING_MODE=1 gnome-control-center` komutu da çoğu zaman işe yaramıyor.

Bir gün, şifremi girdikten sonra karşıma çıkan bu sonsuz yüklenme ekranında, sağ tıklayıp 'reload' (yenile) dedim ve  2FA ekranı hemen açıldı, ardından 2FA Doğrulama kodumu girerek Google hesabımı Ubuntu'ya eşleyebildim. Evet, çözüm bu kadar basitti: Sağ tıklayıp yenilemek! :)

Bazen en basit çözümler, en karmaşık sorunları çözebiliyor. Umarım bu bilgi, benzer sorunları olanlara da yardımcı olur.
NestJs uuid 설치, 2024-01-28
Tags: nestjs
Published: 2024-01-28 08:57:17

데이터를 저장할 때 id는 유니크 해야한다. 그래서 데이터베이스에 데이터를 넣어 줄 때는 데이터베이스가 알아서 유니크한 값을 준다. 하지만 현재는 데이터베이스를 안쓰기 때문에 임의로 유니크한 값을 줘야해서 uuid를 사용한다.

```
npm install uuid --save
```
Implementing Google AdMob Banner Ads in Android Studio with Java | Easy Step-by-Step Guide
Tags: admo, android, monetization, java
Published: 2024-01-28 08:38:19

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


Welcome to this step-by-step tutorial where we'll dive into the world of app monetization. In this video, you'll learn how to implement Google AdMob Banner Ads in Android Studio using Java. We'll cover the integration of three distinct banner ad sizes—Simple Banner Ad, Medium Rectangle Banner Ad, and Large Banner Ad. Whether you're a seasoned developer or just starting with app monetization, this tutorial offers valuable insights into maximizing revenue through AdMob ads.

**Step 1: Setting Up Google AdMob Account and Creating Ad Units**
To begin, we'll guide you through the process of setting up a Google AdMob account and creating ad units. You'll learn how to configure different banner ad sizes to suit your app's layout.

**Step 2: Adding Google AdMob Dependency to Your Project**
In this step, we'll demonstrate how to add the Google AdMob dependency to your Android Studio project using Java. You'll understand the importance of integrating the AdMob SDK for seamless ad functionality.

**Step 3: Implementing Simple Banner Ads**
Next, we'll guide you through the implementation of simple banner ads. You'll learn how to seamlessly integrate banner ads into your app's layout, providing a non-intrusive monetization strategy.

**Step 4: Implementing Medium Rectangle and Large Banner Ads**
We'll cover the implementation of medium rectangle and large banner ads, offering you flexibility in choosing ad formats that complement your app's design and layout.

**Step 5: Maximizing Revenue and User Experience**
In this step, we'll discuss strategies for maximizing revenue while ensuring a positive user experience. You'll gain insights into ad placement, frequency, and other best practices.

**Conclusion:**
Congratulations! You've successfully learned how to implement Google AdMob banner ads in Android Studio using Java. This tutorial has equipped you with practical insights to monetize your app effectively and enhance user engagement through well-integrated ads.

If you have any questions or comments, please feel free to leave them below. Don't forget to subscribe to our YouTube channel for more exciting tutorials on Android app development and monetization strategies.

Now, armed with the knowledge of Google AdMob implementation, you're ready to boost your app's revenue and provide users with a seamless ad experience. Happy coding!

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

**Source Code:** https://github.com/AhsanAhmed03/AdMob-Ads-Java

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/)
How to connect to a MongoDB database in Sveltekit
Tags: webdev, javascript, sveltekit, mongodb
Published: 2024-01-28 08:23:36

While a database like Mongo is not the go-to choice for a lot of devs, It has gained quite alot of honest users and a thriving community. If you’re here, you are likely part of this community.

MongoDB is a document-oriented database, which means it allows for flexible and dynamic schema design. This flexibility is particularly beneficial in scenarios where the data structure evolves over time.

In this article, we will take a look at a non-obvious trick that many Sveltekit users have used to securely connect to their Mongo database.

## How?

We will be utilizing the Sveltekit hook for this, as it allows us to create the connection only once, before starting the server.

Sounds confusing? here is an example.

### 1. Create our MongoDB client

`mongo.ts`

```js
import { MONGO_URL } from '$env/static/private';
import { MongoClient } from 'mongodb';

const client = new MongoClient(MONGO_URL);

// connect to the database
export async function connect(): Promise<void> {
	await client.connect();
}
```

> If you’re not familiar with Sveltekit `$env` management — Environment variables in `process.env` are also available via `$env/static/private`.

### 2. Execute the connection in Sveltekit hook.

`hooks.server.ts`

```js
import { connect } from '$db/mongo';

// Connect to MongoDB before starting the server
connect()
	.then((): void => {
		console.log('MongoDB started');
	})
	.catch((e) => {
		console.log('MongoDB failed to start');
		console.log(e);
	});
```

This will allow the database connection to happen only once, and that too before starting the app. _Most_ of us are familiar with using the hook with the handle function that can intercept requests and is used to secure routes.

But that only happens to stuff in the handle functions, every other thing invoked outside of the handle function will be executed only once before the app starts.

There you have it, how to connect your MongoDB in Sveltekit. Good luck playing around with NoSQL 😅

Peace ✌️
Mastering Symbolic Links: A Quick Guide
Tags: learning
Published: 2024-01-28 08:12:09

Hey there tech enthusiasts! Let's get started with this sweet and short guide!

## What Are Symbolic Links?
Symbolic links, or symlinks, are special files that act as pointers to other files or directories. They're like shortcuts, allowing you to access a file from a different location without duplicating it.

**How to Create a Symbolic Link on Unix/Linux/macOS:**

**1. Open the Terminal:**
Use your preferred terminal application.


**2. Create a file at desired location**
When creating a symbolic link, you typically point it to an existing file or directory. So, you should have the original file or directory already created before a symbolic link to it.

```
touch hello.txt
```


**3. Navigate to the Desired Location:**

```
cd /learn/file
```


**4. Symlink creation command**

ln -s /path/to/original/file_or_directory symlink_name

**Example: **

For file
```
ln -s /learn/file/hello.txt new.txt
```
It will create a new.txt file in the current directory you are in.


For folder
```
ln -s /learn/file newFolder
```
It will create a newFolder folder in the current directory.


**5. Verify**
Spot the symlink with the linked file or folder.

```
ls -l
```
**output: **

Folder
```
lrwxrwxrwx 1 user user 12 Jan 28 13:26 newFolder -> file
```

File
```
lrwxrwxrwx 1 user user 14 Jan 28 13:12 new.txt -> learn/hello.txt
```

**6. To delete a symbolic link you can use the rm (remove) command:**
Deleting a symbolic link is a straightforward process, and it involves removing the link file itself.

`rm symlink_name`

**Example:**
```
rm new.txt
```

And that's it! These little shortcuts are perfect for organizing files, creating quick access points, and streamlining your workflow. Experiment, have fun, and enjoy the power of symbolic links! 🚀
Your insights matter! If you spot any errors or have suggestions in my symbolic links guide, drop a comment - let's make it even better together!
Matching a character in a Character-set | Regular expressions for The Absolute Beginner
Tags: beginners, programming, tutorial, regex
Published: 2024-01-28 08:04:34

In this video, we'll learn to use regular expressions to match specific characters in a set, helping us find similar but differently spelled text. We'll start with a simple example, making it easy to understand and apply to your projects
{%youtube Ra1lWrYj9Dw%}
Matching Special Characters (metacharacters) | Regular Expressions for the Absolute Beginner
Tags: regex, programming, tutorial, beginners
Published: 2024-01-28 07:58:32

In this video, we'll see how to match special characters, starting with a quick look at the dot (.) character. We'll learn how to include the dot in a regex without its usual wildcard function by using escape characters. Stay tuned for more examples and tips on handling special characters in regular expressions.
{%youtube A0N3-5lu-g0%}
Finding Characters at Positions in Text | Regular Expressions for the Absolute Beginner
Tags: regex, programming, tutorial
Published: 2024-01-28 07:51:21

In this video, we'll learn how to use the dot (.) in regular expressions to find characters at specific positions in text. The dot acts like a wildcard, helping us match any single character. By incorporating the dot strategically in our regex patterns, we can pinpoint and extract characters at desired positions. Join us for practical examples and insights into using the dot for effective and flexible text pattern matching. {%youtube kPS-Dx9mElU%}
Matching literal Strings | Regular expressions for The Absolute Beginner
Tags: regex, programming, basics
Published: 2024-01-28 07:45:31

In this in this video will look at how to construct the same place regular expressions, using regular text. We also look at how we can set up our VS code text editor to use regular expressions to match text. In regex, matching literal characters means finding exact words or letters in a piece of text. For example, if you're looking for "apple," the regex will find that exact word.  Matching literal characters helps you find specific words or letters in a text exactly as they are.
{% youtube 6UbGX7jK_uw%}
Differences Between Keyword, Sparse and Dense Vector Indexes
Published: 2024-01-28 07:35:37

**Differences Between Keyword, Sparse and Dense Vector Indexes**

Aspect	Sparse Vector Index	Dense Vector Index	Keyword Index
Storage Principle	Only non-zero elements are stored.	All elements are stored, including zeros.	Keywords or terms are stored, often as a mapping to their data locations.
Space Efficiency	High, due to storage of only non-zero values.	Lower, all values including zeroes take up space.	Varies, depends on the number of unique keywords and their storage method.
Data Representation	Represents data with many zeroes (e.g., document-term matrices).	Represents data with few or no zeroes (e.g., image pixels).	Represents text data through specific terms used for retrieval.
Lookup Speed	Slower, indirect lookup through index mappings.	Faster, direct access due to continuous memory allocation.	Fast for text searches, depends on the efficiency of the indexing algorithm.
Ideal Use Case	High-dimensional data with sparsity, like text data in NLP.	Data with dense representations, like colored images in graphics.	Text retrieval systems, like search engines and database searches.
Index Complexity	More complex due to the need for mapping structures.	Simpler, as it uses sequential storage.	Complexity depends on the indexing algorithm and the data structure used (e.g., hash tables, inverted indexes).
Examples	Text vectorization with TF-IDF, one-hot encoding for categorical data.	RGB values in images, continuous sensor data.	Inverted indexes in full-text search engines, keyword-based queries in databases.

Factor	Sparse Vector Index	Dense Vector Index
Storage	Stores only non-zero elements	Stores all elements, including zeros
Space Efficiency	High, as it only records non-zero elements	Lower, as it records all elements
Access Time	Slower, as it requires mapping to find an element	Faster, as elements are in a continuous block
Update Time	Can be slower if changing the sparsity structure	Typically faster for updates
Use Case	Ideal for data with many zeros	Ideal for data with few zeros
Complexity	More complex data structure	Simpler data structure
Examples	Text frequency in documents, adjacency matrices in graphs	Image data, audio signal processing
Categories
jan ai api example
Published: 2024-01-28 07:33:55

**Tools-Jan AI API Example**





import requests
import json

# Endpoint URL
url = "http://localhost:1337/v1/chat/completions"

# Headers
headers = {
    "Content-Type": "application/json",
}

# Payload
payload = {
    "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Give me meal plan for today."},
    ],
    "model": "mistral-ins-7b-q4",
    "stream": False,
    "max_tokens": 2048,
    "stop": None,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "temperature": 0.7,
    "top_p": 0.95
}

# Make the request
response = requests.post(url, headers=headers, data=json.dumps(payload))

# Extracting 'content' value from response
result = response.json()
content = result['choices'][0]['message']['content']
print(content)
...



import requests
import json

def create_chat_completion(messages, model, stream=False, max_tokens=2048, stop=None, frequency_penalty=0, presence_penalty=0, temperature=0.7, top_p=0.95):
    url = "http://localhost:1337/v1/chat/completions"

    headers = {
        "Content-Type": "application/json",
    }

    payload = {
        "messages": messages,
        "model": model,
        "stream": stream,
        "max_tokens": max_tokens,
        "stop": stop,
        "frequency_penalty": frequency_penalty,
        "presence_penalty": presence_penalty,
        "temperature": temperature,
        "top_p": top_p
    }

    response = requests.post(url, headers=headers, data=json.dumps(payload))
    return response.json()

# Example usage
messages = [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "Tell me a joke."}]
model = "mistral-ins-7b-q4"

result = create_chat_completion(messages, model)

# Extracting 'content' value
content = result['choices'][0]['message']['content']
print(content)