teleren/devto huggingface dataset:
Information out: search and analyze
Published: 2024-04-07 14:01:19

- **Elasticsearch Overview**:
  - Elasticsearch serves as a document store and allows retrieval of documents and metadata.
  - Its true power lies in accessing a comprehensive suite of search capabilities built on the Apache Lucene search engine library.
  - Provides a coherent REST API for cluster management, indexing, and data search.
  - Supports various client languages: Java, JavaScript, Go, .NET, PHP, Perl, Python, or Ruby.

- **Searching Data**:
  - Elasticsearch REST APIs handle structured queries, full-text queries, and complex queries.
  - Structured queries resemble SQL constructs (e.g., searching gender and age fields).
  - Full-text queries find documents matching query strings, sorted by relevance.
  - Additional features: phrase searches, similarity searches, prefix searches, and autocomplete suggestions.
  - Supports high-performance geo and numerical queries for non-textual data.

- **Query Languages**:
  - Elasticsearch's comprehensive JSON-style **Query DSL** for search capabilities.
  - Construct SQL-style queries for native search and aggregation within Elasticsearch.
  - JDBC and ODBC drivers enable third-party applications to interact via SQL.

- **Data Analysis**:
  - **Aggregations** provide complex data summaries and insights.
  - Answer questions like needle count, average needle length, and manufacturer-specific metrics.
  - Analyze data in real time; reports and dashboards update dynamically.
  - Aggregations work alongside search requests, allowing simultaneous search, filtering, and analytics.
  - Machine learning features automate time series data analysis without specifying algorithms or models.
  - Detect anomalies, statistical rarity, and unusual behaviors.
Data in: documents and indices
Tags: elasticsearch, developer, devops, beginners
Published: 2024-04-07 14:00:00

- **Elasticsearch Overview**:
  - Elasticsearch serves as a distributed document store.
  - Stores complex data structures serialized as JSON documents.
  - Documents are indexed and fully searchable in near real-time (within 1 second).
  - Utilizes an **inverted index** for fast full-text searches.
  - Each unique word in any document is listed in the inverted index, linking to the relevant documents.

- **Index and Document Structure**:
  - An **index** is an optimized collection of documents.
  - Each **document** contains fields (key-value pairs) with data.
  - Elasticsearch indexes all data in every field by default.
  - Indexed fields have dedicated, optimized data structures (e.g., inverted indices, BKD trees).

- **Schema Flexibility**:
  - Elasticsearch is **schema-less**; documents can be indexed without explicit field definitions.
  - **Dynamic mapping** automatically detects and adds new fields to the index.
  - Easy exploration: Start indexing documents, and Elasticsearch maps data types (booleans, floats, dates, etc.) automatically.

- **Custom Mappings**:
  - Define your own mappings to take control:
    - Distinguish between full-text and exact value string fields.
    - Perform language-specific text analysis.
    - Optimize fields for partial matching.
    - Use custom date formats and non-detected data types (e.g., geo_point, geo_shape).

- **Flexible Indexing**:
  - Index the same field differently for various purposes (e.g., full-text search vs. sorting).
  - Apply multiple language analyzers to process user input in string fields.

- **Analysis Chain**:
  - Full-text field analysis during indexing is also used at search time.
  - Query text undergoes the same analysis before term lookup in the index.
Magic .mp3 Burner
Tags: mp3, burn, base64, html
Published: 2024-04-07 13:50:37

###### Many argue mp3s are dead. The internet is not. Here is mp3 to html  <br><br>

[Magic Mp3 Burner](https://mp3-burn.pages.dev)<br>

{% codepen https://codepen.io/sudo-self/pen/zYXWNgj %}<br>
Production <a href="https://magic.JesseJesse.com">
Magic Mp3 Burner</a><br>

CodePen <a href="https://codepen.io/sudo-self/pen/zYXWNgj">
  Magic MP3 Burner</a><br><br>

html download

```
      <!DOCTYPE html>
          <html lang="en">
          <head>
            <meta charset="UTF-8">
            <meta name="viewport" content="width=device-width, initial-scale=1.0">
            <title>Mp3 Player</title>
          </head>
          <body style="background-color: #f0f0f0;">
            <center>
              <h2>Mp3 Playlist</h2>
              <audio controls>
                <source src="data:audio/mp3;base64,${base64Data}" type="audio/mp3">
                Your browser does not support the audio element.
              </audio>
            </center>
            
            <div style="position: fixed; bottom: 0; left: 0; right: 0; background-color: black; color: white; padding: 10px; text-align: center;">
              <a href="https://mp3-burn.pages.dev" style="color: white; text-decoration: none;">made with&nbsp;&#10084;&nbsp;Magic Mp3 Burner&nbsp;&nbsp;&copy;2024</a>
            </div>
          </body>
          </html>
``
[Magic Mp3 Burner](https://mp3-burn.pages.dev)<br>
Elastic Search Intro
Tags: elasticsearch, devops, developer, beginners
Published: 2024-04-07 13:48:44

- **What is Elasticsearch?**
  - Elasticsearch is the search and analytics engine that powers the **Elastic Stack**.
  - It provides near real-time search and analytics for all types of data, whether structured or unstructured.

- **Key Features and Concepts:**
  - **Inverted Index**: Elasticsearch uses an inverted index data structure for fast full-text searches.
  - **Text Analysis**: Converts unstructured text into a structured format optimized for search.
  - **Query DSL, ES|QL, EQL, SQL**: Various query languages to retrieve data.
  - **Search Applications**: Building search applications with Elasticsearch.
  - **Search Analytics**: Analyzing search patterns and behaviors.
  - **Aggregations**: Performing complex data aggregations.
  - **Geospatial Analysis**: Handling geospatial data.
  - **Machine Learning**: Integrating machine learning capabilities.
  - **Alerting**: Setting up alerts based on specific conditions.
  - **Data Management**: Downsampling, snapshot, and restore.
  - **REST APIs**: Accessing Elasticsearch programmatically.

For detailed information, refer to the [official Elasticsearch documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html). 🚀🔍
RECOMMENDABLE RECOVERY FIRM
Published: 2024-04-07 13:44:43

PRO ADVANCED RECOVERY is a private investigative, financial regulation, and funds recovery company. Cryptocurrency-related scenarios, phony investment
 schemes, recovery scams, and ethical hacking are among our specialties. We look into the things that impact your score because we are experts in
 credit restoration as well. All the software needed to do RECOVERIES from start to finish is available. Please be aware that the tools that are being
 supplied are not eligible for CREDIT FIX. Be wary of fraudulent online reviews and testimonials. Together, the authors and Criminals form a syndicate.
 Please use the email address below to contact our team as soon as possible to arrange a mail meeting with an ethical hacker.
 EMAIL:proadvancedrecovery@webname.com
 TELEGRAM:@proadvancedrecovery
 WHATSAPP:+1(657)5436038 


![Uploading image](...)
Simple NextJS GraphQL client
Tags: nextjs, approuter, javascript, graphql
Published: 2024-04-07 12:55:55

Since Next.js introduced the new app router, there have been many problems integrating existing GraphQL clients such as Apollo or Urql with projects.

Most of the problems occur when dealing with server-side components, where we can't use useMutation as expected, and there are many other issues that are frustrating for developers.

During my last projects, I faced many problems using these clients, so I decided to build something from scratch to improve my experience.

Using the JavaScript Fetch API, I managed to resolve these issues, resulting in a client that works seamlessly with both server-side and client-side components.
Let's dive in.

Assuming the API URL to be:

const API_URL = "https://bul-api-url.com/api/graphql";

For queries, I used the following code:

```
const bulQuery = async ({ query, cookies, variables, apiUrl }) => {
  const Cookie = cookies
    ? cookies
        .map((cookie) => [cookie?.name, cookie?.value].join("="))
        .join("; ")
    : undefined;
  const res = await fetch(apiUrl || API_URL, {
    credentials: "include",
    method: "POST",
    body: JSON.stringify({
      query: `${query}`,
      variables,
    }),
    headers: {
      "Content-Type": "application/json",
      Cookie,
    },
  }).then((res) => res.json());
  return res;
};

```

For mutations, I used this code:

```
const bulMutation = async ({ query, cookies, variables, apiUrl }) => {
  const Cookie = cookies
    ? cookies
        .map((cookie) => [cookie?.name, cookie?.value].join("="))
        .join("; ")
    : undefined;
  return await fetch(apiUrl || API_URL, {
    cache: "no-cache",
    credentials: "include",
    method: "POST",
    body: JSON.stringify({
      query: `${query}`,
      variables,
    }),
    headers: {
      "Content-Type": "application/json",
      Cookie,
    },
  }).then((res) => res.json());
};

```

Here's how I declared a query:

```
const GET_POST = `
query GetPost($where: PostWhereUniqueInput!) {
  post(where: $where) {
    id
    title
    slug
  }
}
`;

```

If you still prefer using gql, I added this method to return the string part of the query:


```
const bulgql = (query) => {
  return query.loc.source.body;
};

```

By the way, I have published the code on a GitHub repository with examples
https://github.com/miladamirvafa/bulGraphQL
Preserving Tucson's Canopy: A Guide to Responsible Tree Cutting
Tags: treeservice, treeremoval, treecare, treepruning
Published: 2024-04-07 12:51:56

**Introduction:**

Nestled in the sun-kissed landscape of Arizona lies Tucson, a city renowned for its vibrant culture and stunning natural scenery. Amidst the desert backdrop, trees serve as oases of shade and beauty, enhancing the city's allure. However, as with any urban environment, the need for tree cutting arises to maintain safety, aesthetics, and ecological balance. In this guide, we explore the importance of responsible tree cutting in Tucson, AZ, and how expert services like Tree Cutting Tucson can help preserve the city's cherished canopy.

**Understanding the Need for Tree Cutting:**

While trees provide numerous benefits, including shade, oxygen production, and habitat for wildlife, there are instances where tree cutting becomes necessary. Diseased or damaged trees pose safety hazards, while overgrown vegetation can encroach on structures or obstruct visibility. Additionally, strategic pruning is vital for maintaining tree health and promoting optimal growth.

**The Role of Tree Cutting Tucson:**

Tree Cutting Tucson specializes in professional tree care services tailored to the unique needs of Tucson's urban forest. With a team of certified arborists and skilled technicians, they offer a range of solutions, including tree trimming, pruning, and removal. Their expertise extends to hazard assessment, ensuring that trees are managed safely and responsibly.

**Safety First: Tree Risk Assessment and Removal:**

Safety is paramount when it comes to tree cutting, especially in a city like Tucson prone to extreme weather conditions. Tree Cutting Tucson employs rigorous risk assessment protocols to identify potential hazards and mitigate risks effectively. In cases where removal is deemed necessary, they utilize advanced techniques and equipment to ensure the process is conducted safely and efficiently, minimizing disruption to the surrounding environment.

**Promoting Sustainable Practices:**

In alignment with Tucson's commitment to sustainability, Tree Cutting Tucson emphasizes eco-friendly tree care practices. They prioritize selective pruning methods that enhance tree health and longevity while minimizing environmental impact. Additionally, they promote tree preservation whenever feasible, advocating for alternatives to removal whenever possible.

[READ MORE HERE..](https://gitea.com/WildcatTree/WildcatTreeService/wiki/Tree-Cutting-Tucson%2C-AZ)
Spring Boot : ProblemDetailsExceptionHandler
Tags: java, springboot, exceptionhandling, problemdetails
Published: 2024-04-07 12:27:14

## ProblemDetail

ProblemDetail은 Spring Framework 6.0에 추가된 REST API의 에러 응답 표준이다.
RFC 7807에 정의되어 있다.

- 참고: https://docs.spring.io/spring-framework/docs/6.0.7/reference/html/web.html#mvc-ann-rest-exceptions

아래는 간단히 Spring Boot의 기본 에러 응답을 ProblemDetail로 설정하는 방법을 설명한다.

## ProblemDetailsExceptionHandler

### 에러 응답 예시

아래는 Spring Boot의 기본 에러 응답을 ProblemDetail로 설정했을 때의 에러 응답 body이다.

```json
{
    "type": "about:blank",
    "title": "Method Not Allowed",
    "status": 405,
    "detail": "Method 'POST' is not supported.",
    "instance": "/"
}
```

### Spring Boot 설정

아래 설정을 추가하면 ProblemDetailsExceptionHandler가 자동 구성된다.
이를 통해 Spring Framework에서 제공하는 웹 예외들은 자동으로 ProblemDetail 형식의 response body로 에러 응답을 한다.

```properties
spring.mvc.problemdetails.enabled=true
```

### 자동 구성

위의 설정이 되어있으면 아래 클래스에서 ProblemDetailsExceptionHandler가 자동 구성된다.

```java
package org.springframework.boot.autoconfigure.web.servlet;

public class WebMvcAutoConfiguration {

    @Configuration(proxyBeanMethods = false)
    @ConditionalOnProperty(prefix = "spring.mvc.problemdetails", name = "enabled", havingValue = "true")
    static class ProblemDetailsErrorHandlingConfiguration {

        @Bean
        @ConditionalOnMissingBean(ResponseEntityExceptionHandler.class)
        @Order(0)
        ProblemDetailsExceptionHandler problemDetailsExceptionHandler() {
            return new ProblemDetailsExceptionHandler();
        }

    }
}
```

### 자동 구성되는 ProblemDetailsExceptionHandler

ResponseEntityExceptionHandler를 확장한 구현 클래스일 뿐이다.

```java
package org.springframework.boot.autoconfigure.web.servlet;

@ControllerAdvice
class ProblemDetailsExceptionHandler extends ResponseEntityExceptionHandler {
}
```
How Much Does It Cost to Rent a Person in Dubai 2024?
Published: 2024-04-07 12:01:27

Living in Dubai is a dream for many, with its luxurious lifestyle, modern amenities, and thriving job market attracting expats from around the world.

What is the average cost of living in Dubai?

The average cost of living in Dubai can vary depending on a person’s lifestyle and needs. On average, the monthly [cost of living in Dubai](https://staybetterdxb.ae/property-portfolio/) ranges from AED 8,000 to AED 12,000, including rent, food, dining out and entertainment.

Utilities such as electricity, water and internet can cost between AED 800 and AED 1,000 per month. The cost of public transportation in Dubai is also relatively affordable: a monthly pass for the metro and bus system costs around AED 350.

Monthly cost of living

The average cost of living in Dubai varies depending on individual lifestyle and choices. For a single person, the monthly cost of living excluding rent is estimated to be between AED 3,000 and AED 4,000. For a family of four, expenses can range from AED 15,000 to AED 20,000 per month.

Utility costs

Utility costs in Dubai, including electricity, water, cooling and garbage collection, can amount to around AED 500 to 700 per month for a standard two-bedroom apartment. These costs can vary slightly depending on the area and the lifestyle of the residents.

Public transportation costs

Dubai has an efficient and modern public transportation system. The monthly cost of public transportation, including metro, buses and streetcars, averages between AED 200 and 300 per person.

See Our Social Accounts
Day 7/366
Tags: 1percentplusplus, 100daysofcode
Published: 2024-04-07 12:01:18

🚀 **Today's Learning:**

🌟 DSA

- Validate a string
- Reversing a string

🌟 Dev

- Difference b/w <window.onload> and <onDocumentReady>
- Newly introduced feautures in HTML5.

🔍 **Some Key Highlights:**

DSA

Validate a string

→ A string is valid if it only contains letters and numbers (No special characters should be present) → Iterate through the string and for each pass check if (!(s[i] ≥ 65 && s[i] ≤ 90) && !(s[i] ≥ 97 && s[i] ≤ 122) && !(s[i] ≥ 48 && s[i] ≤ 57)). So if any of the condition to the check letters and numbers fail return false, otherwise return true.

Reversing a string

Approach 1 → Iterate through the string and move i to last element → now reverse travel original array and copy each element in the new array. Return the new array. (T.C. O(n) | S.C. O(n))

Approach 2 → Take two pointers i and j. i starts from first character of string and j from last. They both move towards each others and swap characters at each pass (till i<j). (T.C. O(n) | S.C. O(1))

DEV

The `onload` executes a block of code after the page is completely loaded while `$(document).ready`(function) executes a block of code once the DOM is ready.

Input types, including Date, Date Time-local, time, week, month, email, tel, URL, search, range, color, and number, are among the new ones introduced by HTML5. to enhance user interaction and make forms more engaging. However, a browser will interpret these new input types like a standard text box if it is unable to recognize them.

 #100daysofcode #1percentplusplus #coding #dsa
ARCore For Android
Tags: arcore, android
Published: 2024-04-07 11:46:17

**Introduction**
     In this post, I would like to introduce a simple way to display 3D models supported by native Android. However. 3D models can be displayed in AR in a variety of ways. Using Scene Viewer with intents directly from your Android native app is one of those methods. In this topic will see how we can display the model using Explicit Intent and Scene viewer.


**Using Scene Viewer**
     Scene Viewer is an immersive viewer that enables 3D and AR experiences from your website or Android app. It lets users of Android mobile devices easily preview, place, view, and interact with web-hosted 3D models in their environment.


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

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




**Launch Scene Viewer Using an Explicit Intent to Google Play Services for AR**
     Google Play Services for AR is used to power the AR functionality in Scene Viewer.
     You can use an explicit Android intent from a website or native Android app to launch Scene Viewer via the com.google.ar.core package and supply a browser fallback URL to ensure that AR is supported in Scene Viewer. Using Scene Viewer, you can ensure that every user either has a native AR experience or a fallback experience you have created yourself. You may create a gracious error message or your 3D viewer as examples of fallback experiences.

**Scene Viewer Using an Explicit Intent Example**


```
val sceneViewerIntent = Intent(Intent.ACTION_VIEW)
            val intentUri =
                Uri.parse("https://arvr.google.com/scene-viewer/1.0").buildUpon()
                    .appendQueryParameter("file", "https://storage.googleapis.com/ar-answers-in-search-models/static/Tiger/model.glb")    //Working
                    .appendQueryParameter("mode", "ar_only")
                    .appendQueryParameter("title", "Tiger")
                    .build()
            sceneViewerIntent.data = intentUri
            sceneViewerIntent.setPackage("com.google.ar.core")
            sceneViewerIntent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
            startActivity(sceneViewerIntent)
```

**Github Link**
https://github.com/SandeepSatpute9271/Simple_AR
Laravel SMS Channels
Tags: laravel, smsapi, php, opensource
Published: 2024-04-07 11:44:18

I am very excited to share an open-source laravel package named "Laraflow/SMS". A library of SMS channel collections ready for production on the laravel application. 

**Features of the package**

1. Doesn't depend on bulky third-party libraries; the program can grow with your project.
2. Capability to swap drivers without impacting the code
3. The developer can add their channel to the configuration file to expand the collection.

Right now, We have integrated these SMS gateway APIs
1. AfricasTalking
2. Clickatell
3. ClickSend
4. Infobip
5. MessageBird
6. SMSBroadcast
7. Telnyx
8. Twilio

**For whom this package is appropriate**

1. Desire to finish the assignment quickly
2. Not a full library is needed; just a basic API integration is desired.
3. Have the option of regularly switching SMS vendors

**Packagist Link**: [Packagist](https://packagist.org/packages/laraflow/sms)

**Documentation Link**: [Documentation](https://laraflow.github.io/sms/)

Having someone interested in reviewing my implementation or contribution to the codebase would appreciated.
Settling with Sets 2.0 - Python
Tags: python, computerscience, beginners, tutorial
Published: 2024-04-07 11:30:38

### Python Unleash'd 11

Consider reading [this](ttps://dev.to/bellatrix/settling-on-sets-python-1b3g) first


## 1. Access elements

You can not access elements using index, so the only way is to loop through the elements, takes O(n) time.

## 2. Removing Elements

We have a 'remove' method to serve this purpose. It throws error if element is not in the set. To use remove(), first check if element is present. It take O(n) time to check element's presense.

Better to use 'discard()', as it does not throw any error even if element is not present.


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

## 3. Pop

Pop() function can also be used to remove and return an element from the set, but it removes only the last element of the set. 

As set is unordered there is no way to tell which element is removed. :D


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

## 4. clear()

To remove all elements from set, use clear() method.

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

### DO YOU KNOW

1. There is something 'frozenset' which makes a set immutable and then only those methods are applied which does not affect elements

2. All mathematical operations are valid on these sets : union, intersection, difference, issubset, issuperset  etc

3. It does not support append()

4. Consumer more memory than lists

THANKS FOR READING GUYS 

keep reading :)


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