teleren/devto huggingface dataset:
Namaste Uttrakhand Trip
Published: 2024-01-28 06:13:55

Embark on a heartfelt journey with Namaste Uttarakhand Trip – your doorway to the captivating landscapes of Uttarakhand. Our thoughtfully designed tours seamlessly blend cultural richness with the natural beauty of this Himalayan paradise, providing an authentic experience. Immerse yourself in the gracious hospitality of Uttarakhand through our carefully planned itineraries that highlight the best of the region. From the awe-inspiring peaks of the Himalayas to tranquil lakes and vibrant local culture, Namaste Uttarakhand Trip ensures an unforgettable adventure. Secure your journey with us and allow Namaste Uttarakhand Trip to be your reliable companion, creating enduring memories for a lifetime.
Visit: https://namasteuttarakhandtrip.in/
Namaste Uttrakhand Trip
Published: 2024-01-28 06:13:47

Embark on a heartfelt journey with Namaste Uttarakhand Trip – your doorway to the captivating landscapes of Uttarakhand. Our thoughtfully designed tours seamlessly blend cultural richness with the natural beauty of this Himalayan paradise, providing an authentic experience. Immerse yourself in the gracious hospitality of Uttarakhand through our carefully planned itineraries that highlight the best of the region. From the awe-inspiring peaks of the Himalayas to tranquil lakes and vibrant local culture, Namaste Uttarakhand Trip ensures an unforgettable adventure. Secure your journey with us and allow Namaste Uttarakhand Trip to be your reliable companion, creating enduring memories for a lifetime.
Visit: https://namasteuttarakhandtrip.in/
Demystifying Python Constructors: Understanding the Roles of __new__ and __init__
Tags: programming, beginners, python, productivity
Published: 2024-01-28 06:05:00


Mastering Python Constructors: A Comprehensive Guide to Utilizing __new__ and __init__ for Optimal Object Creation and InitializationIn Python, the constructor method is invoked with new for object creation and init for initialization. Quoting from the Python documentation, new is used when you need to control the creation of a new instance, while init is used when you need to control the initialization of a new instance.

new is the first step in creating an instance. It is called initially and is responsible for returning a new instance of your class.

In contrast, init does not return anything; it is only responsible for the initialization of the instance after it has been created.
**Usage of new and init:** The distinction between new and init is crucial.
new is typically used when you want to customize how an instance is created, whereas init is used for customizing the initialization process after the instance is created.

**Returning Values:** new should return an instance of the class, while init does not return anything. init is focused on setting up the initial state of the object.

**Order of Execution:** new is called first, followed by init. Understanding this order is important when working with class constructors.

**Initialization Logic:** init is the place to put code that sets up the object's initial state, such as initializing attributes or performing other setup tasks.

```
class MyClass:
    def __new__(cls, *args, **kwargs):
        # Custom logic for creating a new instance
        instance = super(MyClass, cls).__new__(cls)
        print("Creating a new instance")
        return instance

    def __init__(self, value):
        # Initialization logic after the instance is created
        self.value = value
        print("Initializing instance with value:", value)

# Creating an instance of MyClass
obj = MyClass(value=42)
```


Output:
Creating a new instance
Initializing instance with value: 42


1. Custom __new__ Method: The __new__ method is called first, and it should return an instance of the class. In this example, it prints a message and returns the instance.
2. super().__new__(cls): It calls the __new__ method of the parent class to ensure proper object creation.
3. Custom __init__ Method: The __init__ method initializes the created instance. In this example, it sets the value attribute and prints a message.
4. Usage of Constructor: The last line creates an instance of MyClass by passing a value of 42. This triggers both __new__ and __init__ methods.

If you need further information or have specific questions, feel free to ask! Tahsin Soyak tahsinsoyakk@gmail.com
TaskWeaver Browserless Plugin
Published: 2024-01-28 06:00:52

**TaskWeaver Browserless Plugin**



scrape_website.py

import os
import json
import requests
from taskweaver.plugin import Plugin, register_plugin
from unstructured.partition.html import partition_html

@register_plugin
class ScrapePlugin(Plugin):
    def __call__(self, website: str):
        url = f"https://chrome.browserless.io/content?token={os.environ['BROWSERLESS_API_KEY']}"
        payload = json.dumps({"url": website})
        headers = {'cache-control': 'no-cache', 'content-type': 'application/json'}
        response = requests.request("POST", url, headers=headers, data=payload)
        elements = partition_html(text=response.text)
        content = "\n\n".join([str(el) for el in elements])
        return content

scrape_website.yaml

name: scrape_website
enabled: true
required: false
description: >
  The ScrapePlugin scrapes website content.
  Pass a URL to receive the raw content of the website.

parameters:
  - name: website
    type: str
    required: true
    description: The full URL of the website to scrape.

returns:
  - name: scraped_content
    type: str
    description: >
      A string containing the raw content of the scraped website.
Functional Languages are Fad
Tags: functional, ocaml, f, javascript
Published: 2018-10-09 04:44:54

---
title: Functional Languages are Fad
published: true
description: Arguments against trying a functional language
tags: functional, ocaml, f#, javascript
---

I don't understand the functional language fad. As much as those liberal nerds despise the term IT, it is my career as much as it is theirs. And in IT, you only use what works. Programming for fun? With passion? I have to put food on the table! I never get those who keep writing code in weird theoretical languages after work.

Let me put it in terms of code, because that's how we will understand the uselessness of learning a functional language.

### Functional languages are concise
And that's the problem. In the IT world, especially with contractors, we get paid by the number of lines of code we deliver. Look at this beautiful code written in Java, my favorite language:

```java

public static class SumOfSquaresHelper
{
   public static int Square(int i)
   {
      return i * i;
   }

   public static int SumOfSquares(int n)
   {
      int sum = 0;
      for (int i = 1; i <= n; i++)
      {
         sum += Square(i);
      }
      return sum;
   }
}

```

That counts 16 lines of code. With a couple more classes and that's a payday. Here is the equivalent in F#, a .NET's own functional spinoff of one of the most hideous languages of all time, Ocaml (Frankly, Microsoft inventing this language to replace C# is downright disappointing):

```fsharp

let square x = x * x
let sumOfSquares n = [1..n] |> List.map square |> List.sum

```

Holy moly! Two lines of code to do the same? How do you expect people like us to get paid, let alone anyone reading the code? You can even go further and make that a one liner with, ugh, lambda.

```fsharp

let sumOfSquares n = [1..n] |> List.map (fun x -> x * x) |> List.sum

```

What abomination! What's worse is that language designers these days tend to get brainwashed by this functional cult and can't help hacking some functional features into their language. Even Javascript, which has been around since the birth of the internet, wants to be functional.

```javascript

let sumOfSquares = n => [...Array(n).keys()].map(x => x * x).reduce((x, y) => x + y);

```

Indeed, these are dark days to be a legit, serious programmer.

> Inspired by [Ten reasons not to use a statically typed functional programming language](https://fsharpforfunandprofit.com/posts/ten-reasons-not-to-use-a-functional-programming-language/).
TaskWeaver DuckDuckGo Browserless
Published: 2024-01-28 05:59:39

**TaskWeaver DuckDuckGo Browserless **



internet_search.py

import requests
from duckduckgo_search import DDGS
from taskweaver.plugin import Plugin, register_plugin
import os, json
from unstructured.partition.html import partition_html

@register_plugin
class InternetSearchPlugin(Plugin):
    def __call__(self, query: str, max_results=2): 
        with DDGS() as ddgs:
            results = [r for r in ddgs.text(query, max_results=max_results)]
            scraped_results = []
            for result in results:
                url = self.sanitize_url(result.get('href'))
                scraped_content = self.scrape_website(url)
                scraped_results.append({'url': url, 'content': scraped_content})
            return scraped_results

    @staticmethod
    def sanitize_url(url):
        """Sanitize the URL by removing any trailing slashes."""
        return url.rstrip('/') if url else url

    def scrape_website(self, website: str):
        """Just pass a string with
        only the full url, no need for a final slash `/`, eg: https://google.com or https://clearbit.com/about-us"""
        sanitized_url = self.sanitize_url(website)
        url = f"https://chrome.browserless.io/content?token={os.environ['BROWSERLESS_API_KEY']}"
        payload = json.dumps({"url": sanitized_url})
        headers = {'cache-control': 'no-cache', 'content-type': 'application/json'}
        response = requests.request("POST", url, headers=headers, data=payload)
        elements = partition_html(text=response.text)
        content = "\n\n".join([str(el) for el in elements])
        content = [content[i:i + 8000] for i in range(0, len(content), 8000)]
        return content

internet_search.yaml

name: internet_search
enabled: true
required: false
description: >-
  The InternetSearchPlugin performs internet searches using DuckDuckGo and scrapes the content of the search results.

parameters:
  - name: query
    type: str
    required: true
    description: The search query for retrieving and scraping internet search results.

returns:
  - name: search_results
    type: list
    description: >-
      A list of dictionaries containing the URL and scraped content of each search result.
Crew AI Screenplay Writer
Published: 2024-01-28 05:58:22

**Crew AI Screenplay Writer**



git clone https://github.com/joaomdmoura/crewAI-examples/
cd crewAI-examples/screenplay_writer
pip install langchain-community langchain crewai langchain-openai langchain-core langchain_mistralai

export MISTRAL_API_KEY=xxxxxxxxxxxxxxx

Dataset: https://www.kaggle.com/datasets/crawford/20-newsgroups/data?select=rec.sport.hockey.txt

python screenplay_writer.py
TaskWeaver Beginners Guide
Published: 2024-01-28 05:53:15

**TaskWeaver Beginners Guide**







git clone https://github.com/microsoft/TaskWeaver
cd TaskWeaver
conda create -n taskweaver python=3.11
conda activate taskweaver
pip install -r requirements.txt
cd project

taskweaver_config.json

{
  "llm.api_base": "https://api.openai.com/v1",
  "llm.api_key": "sk-xxxxxxxxxxxxxxxxxxxx",
  "llm.model": "gpt-3.5-turbo-1106"
}

Text Generation Web UI

Models

TheBloke/Orca-2-7B-GGUF
orca-2-7b.Q4_K_M.gguf

Config

{
  "llm.api_base": "http://0.0.0.0:5000/v1",
  "llm.api_key": "null",
  "llm.model": "orca2",
  "llm.response" : "text"
}
Crew AI Application Generator
Published: 2024-01-28 05:52:33

**Crew AI Application Generator**

import os, json
from crewai import Agent, Task, Crew, Process
from langchain_openai import ChatOpenAI
from langchain_community.llms import Ollama
from langchain_mistralai.chat_models import ChatMistralAI
from langchain_google_vertexai import VertexAI
from tempfile import TemporaryDirectory
from langchain_community.agent_toolkits import FileManagementToolkit
from langchain.tools import tool
from langchain.pydantic_v1 import BaseModel, Field

class FileManagerTools:
    @tool("Write code to disk")
    def write_file(self, code):
        """Write code to disk. Input is code as a string."""
        print(code)
        with open("output.py", "w") as file:
            file.write(code)
        return "File written successfully."

# Create FileManagerTools instance
file_manager_tools = FileManagerTools()
mistral_api_key = os.environ.get("MISTRAL_API_KEY")
working_directory = TemporaryDirectory()
toolkit = FileManagementToolkit(
    root_dir=str(working_directory.name),
    selected_tools=["write_file", "list_directory"]
)
write_file_tool, list_directory_tool = toolkit.get_tools()

# Create Agents
coder = Agent(
  role='Software Engineer',
  goal='Develop innovative software solutions',
  backstory='A skilled software engineer who writes python code.',
  verbose=True,
  allow_delegation=False,
)

files_manager = Agent(
    role='File Manager',
    goal='Efficiently manage and save files',
    backstory='Specialized in organizing and storing files securely and accessibly.',
    verbose=True,
    allow_delegation=False,
    tools=[file_manager_tools.write_file]
)

# Create Tasks
software_development_task = Task(
  description='Write python code for a Flask application to find the stock of a company using yfinance',
  agent=coder
)

files_management_task = Task(
  description='Save received python code from coder in a file',
  agent=files_manager,
  tools=[file_manager_tools.write_file]
)

# Create Crew
tech_crew = Crew(
  agents=[coder, files_manager],
  tasks=[software_development_task, files_management_task],
  process=Process.sequential  # Sequential task execution
)

# Execute tasks
result = tech_crew.kickoff()
print(result)

Categories
Open Interpreter FastAPI
Published: 2024-01-28 05:50:59

**	
Open Interpreter FastAPI**


Streaming

from fastapi import FastAPI
from fastapi.responses import StreamingResponse
from interpreter import interpreter
interpreter.auto_run = True
interpreter.llm.model: "gpt-4-1106-preview"

app = FastAPI()

@app.get("/chat")
def chat_endpoint(message: str):
    def event_stream():
        for result in interpreter.chat(message, stream=True):
            yield f"data: {result}\n\n"

    return StreamingResponse(event_stream(), media_type="text/event-stream")

@app.get("/history")
def history_endpoint():
    return interpreter.messages

Note: stream=False to stop streaming.
Run

export OPENAI_API_KEY=st-xxxxxxxxxxxxxxxxxxx
pip install fastapi uvicorn
uvicorn server:app --reload

Test

curl http://localhost:8000/chat\?message\=list+files+in+desktop
TaskWeaver Arxiv Latest Papers Plugin
Published: 2024-01-28 05:50:48

**TaskWeaver Arxiv Latest Papers Plugin**



latest_papers.yaml

name: latest_papers
enabled: true
required: false
description: >-
  The LatestPapersPlugin connects to the arXiv API to fetch information about the latest papers on a specified topic.

parameters:
  - name: topic
    type: str
    required: true
    description: The topic for which the latest papers are to be retrieved.

returns:
  - name: papers_data
    type: str
    description: >-
      A string containing the latest papers' information on the specified topic, returned as XML data from arXiv.

latest_papers.py

import requests
from taskweaver.plugin import Plugin, register_plugin

@register_plugin
class LatestPapersPlugin(Plugin):
    def __call__(self, topic: str): 
        url = "http://export.arxiv.org/api/query"
        params = {
            "search_query": f"all:{topic}",
            "sortBy": "submittedDate",
            "sortOrder": "descending",
            "max_results": 5
        }
        response = requests.get(url, params=params)
        return response.text
Open Interpreter Setup
Published: 2024-01-28 05:49:50

**Open Interpreter Setup**+


Setup

conda create -n openinterpreter python=3.11 -y
conda activate openinterpreter
pip install open-interpreter
export OPENAI_API_KEY=sk-xxxxxxxxxxxxxx
interpreter
interpreter -y (To Auto Approve the request)

Open Source

Ollama

ollama run mistral
interpreter --model ollama/mistral

LM Studio

interpreter --local
Booklystore
Published: 2024-01-28 05:39:37

Sứ mệnh của Bookly Store là tạo ra trải nghiệm, dịch vụ cũng như không gian đọc sách tuyệt vời, ý nghĩa đến với các bạn độc giả, chúng tôi sẽ luôn đồng hành cùng bạn trong hành trình khám phá tri thức của nhân loại. Chúng tôi cam kết sẽ đem đến giá trị thực sự cũng như chất lượng dịch vụ cao nhất đến với khách hàng của mình.
[]( https://booklystore.com/)
Booklystore
Published: 2024-01-28 05:38:29

Sứ mệnh của Bookly Store là tạo ra trải nghiệm, dịch vụ cũng như không gian đọc sách tuyệt vời, ý nghĩa đến với các bạn độc giả, chúng tôi sẽ luôn đồng hành cùng bạn trong hành trình khám phá tri thức của nhân loại. Chúng tôi cam kết sẽ đem đến giá trị thực sự cũng như chất lượng dịch vụ cao nhất đến với khách hàng của mình.
Chi tết xem tại đây : [](https://booklystore.com/)
𝐃𝐨𝐜𝐮𝐦𝐞𝐧𝐭 𝐑𝐞-𝐫𝐚𝐧𝐤𝐢𝐧𝐠 𝐢𝐬 𝐚𝐧 𝐢𝐦𝐩𝐨𝐫𝐭𝐚𝐧𝐭 𝐚𝐝𝐝𝐢𝐭𝐢𝐨𝐧 𝐭𝐨 𝐑𝐀𝐆 𝐩𝐢𝐩𝐞𝐥𝐢𝐧𝐞𝐬
Published: 2024-01-28 05:25:27

**𝐃𝐨𝐜𝐮𝐦𝐞𝐧𝐭 𝐑𝐞-𝐫𝐚𝐧𝐤𝐢𝐧𝐠 𝐢𝐬 𝐚𝐧 𝐢𝐦𝐩𝐨𝐫𝐭𝐚𝐧𝐭 𝐚𝐝𝐝𝐢𝐭𝐢𝐨𝐧 𝐭𝐨 𝐑𝐀𝐆 𝐩𝐢𝐩𝐞𝐥𝐢𝐧𝐞𝐬**

The absence of a domain-specific Ranker can potentially diminish the quality of your initial ranked outputs. Additionally, obtaining sufficient training data for your ranker can be challenging in many cases ⬇️

This paper from Google Research proposes a 𝐏𝐚𝐢𝐫𝐰𝐢𝐬𝐞 𝐫𝐚𝐧𝐤𝐢𝐧𝐠 𝐩𝐫𝐨𝐦𝐩𝐭𝐢𝐧𝐠 (𝐏𝐑𝐏) 𝐩𝐚𝐫𝐚𝐝𝐢𝐠𝐦, which uses the query and a pair of documents as the prompt for LLMs to perform ranking tasks optimized to O(n) time 🤯

They also show that PRP based on the FLAN-UL2 model with 20B parameters is comparative with the previous best approach in the literature, based on the black box commercial GPT-4 that has (an estimated) 50X model size 😵

Interested? Then check the paper summary here https://lnkd.in/gKQbicDd

#machinelearning #rag #llms #deeplearning #naturallanguageprocessing #largelanguagemodels #education #technology #datascience #research
![Uploading image](...)
Best security guard service company in Bangladesh
Published: 2024-01-28 05:22:32


Best Security Company in Dhaka Bangladesh
Best Security Company in Dhaka Bangladesh
Secureline Ltd ( [security company](https://securelines.net/security-company/) in Dhaka / security company in Bangladesh) is one of the leading security service oriented companies in Bangladesh also known as Secure Line Security Services.

Secureline Ltd ([security guard](https://securelines.net/security-company/) service) has been rendering our professional security guard services to different government and non-government establishments with excellent reputation in Dhaka and all over Bangladesh.

Since Secureline Ltd founding  as [Secure Line Security Services](https://www.security.com.bd/) in 2015, We has been known for quality services, exceptional efficiency and the highest level of professionalism as best security company for best security guard service in Bangladesh. Our corporate office is situated in Dhaka.

Secureline Ltd  has a group of professional security guards who are selected and recruited from the Ex-army, Ansar and also from the pool of young energetic people who are trained by Ex-army person.

Our vision to provide top-class security services all over Bangladesh at a very affordable price. Secureline Ltd has grown rapidly and is currently over 5000+ strong well trained professional security guards and located in every major region in Bangladesh.

Our security personnel is being deployed Dhaka and all over the Bangladesh. Our success comes from making your needs our top priority and giving you the best service possible regardless of the circumstance.

In terms of manpower, management, organizational setup & prompt response, Secureline Ltd can be considered the leading security guard company in Dhaka, Bangladesh.

When you choose us over another security company, you’re working with one of the most successful companies in Bangladesh that have been best  in customer service more than once. With options like that available, how could you not choose us?

Contact us (the best security company in Bangladesh) today to learn more about our services and how we can help you make your business safe and secure.

Expertise of Secureline Ltd as the best Security Company
At Secureline Ltd, we provide complete security solutions. Our services include providing Security guards, Supervisors, Body Guards, Cash Carrying Services, Armed Guards, Female Security Personnel, Embassy Security, Traffic Control,  ATM Management, Background Checks/ Security Checks to just to name a few.

Copyright © 2024 SECURELINE LIMITED

Scroll to Top
📖 Complete Architecture for Building Enterprise RAG 🛠️
Published: 2024-01-28 05:21:56

📖 Complete Architecture for Building Enterprise RAG 🛠️

This architecture by 🔭 Galileo provides a reference on both the algorithmic and system-level components needed to build production RAG 💫. There’s a lot in here 👇:

It covers everything from the following broad categories:
✅ Handling user input: user auth 🔐, input guardrails, query understanding
✅ Core advanced chunking/retrieval techniques: the bread and butter of LlamaIndex 
✅ How to store embeddings/documents/chat history/user feedback, and vector db tradeoffs
✅ How to choose a proper LLM inference solution 
✅ Handling output: output guardrails, collecting user feedback, observability 
✅ Other system-level improvements: Caching, multi-tenancy

Check it out as your weekend reading! https://lnkd.in/g74cH7Pu
A
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vl97omeqsttzcsb4m7z.jpeg)
Running Mistral LLM locally with Ollama's
Published: 2024-01-28 05:18:25

🦙 new Python 🐍 library inside a dockerized 🐳 environment with the allocation of 4 CPUs and 8 GB RAM. It took 19 sec to get a response 🚀. The last time I tried to run LLM locally, it took 10 minutes to get a response 🤯#llm #mistral #python #ollama
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oy6ouibm3b66z0slnkxx.jpeg)
Tell runtime/cgo to not thread warnings as errors
Tags: go, cgo, emacs, delve
Published: 2024-01-28 05:13:22

---
title: Tell runtime/cgo to not thread warnings as errors 
published: true
description: A reminder for the Golang developers out there
tags: golang, cgo, emacs, delve
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-01-28 05:05 +0000
---

Occasionally, you want to debug (with delve) your project, but when you attempt to do so, you are greeted with the following error:

```
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)
    ^~~~~~~
cc1: all warnings being treated as errors
```

To resolve this, just export `CGO_CFLAGS` with the value `"-O2 -g -Wno-error"`.
iPhone 15 pro max giveaways
Published: 2024-01-28 04:17:35

iPhone 15 pro max Giveaway 

3 people giveaways 

I advise you to be wary of online giveaways, especially those that seem too good to be true. Scammers often use such tactics to collect personal information or exploit unsuspecting users. It's safer to participate in official giveaways organized by reputable companies.
Giveaways results:1/02/2024
https://showstyle013.blogspot.com/2024/01/iphone-15-pro-max-giveaway-3-people.html
![**Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tmtyjospsyf1kks8k60g.jpeg)**