teleren/devto huggingface dataset:
Increasing API Reliability: Adding Timeouts to Node.js Fetch
Tags: fetch, api, request, http
Published: 2023-09-20 13:14:25

When consuming external APIs and services you need to ensure they won't cause trouble to other parts of your system.

When an external API is down, you can try to switch to another provider if you have a fallback.

When an API is very slow, you can't be sure if the API is down or just too slow.

## Adding timeout to external APIs

My recommendation is to have a timeout limit when calling any external API.

```jsx
export class TimeoutError extends Error {
  constructor(message) {
    super(message); // (1)
    this.name = 'TimeoutError'; // (2)
  }
}

export const isTimeoutError = (err: Error) =>
  err instanceof TimeoutCallError;

export const timeout =
  (ms: number) =>
  (f: fetchFn): fetchFn =>
  (input: RequestInfo, init?: RequestInit) =>
    new Promise((resolve, reject) => {
      const controller = new AbortController();

      setTimeout(() => {
        reject(new TimeoutError(prettyFormat({ ...(init ?? {}) })));
        controller.abort();
      }, ms);

      f(input, { ...(init ?? {}), signal: controller.signal }).then(
        resolve,
        reject,
      );
    });
```

The code above creates a custom error that will be thrown when a timeout happens.
This higher-order function is just a race condition from a setTimeout and the fetch request.

The usage with `fetch` is like this:

```jsx
const TIMEOUT = 10000; // API timeouts 10 seconds

export const fetchWithTimeout = async (...args) => {
  try {
    const response = await timeout(TIMEOUT)(fetch)(...args);

    return response;
  } catch (err) {
    const createdResponse = createResponse({
      status: 408,
      ok: false,
    });

    return createdResponse;
  }
};
```

We create a new Response with the status code 408 (Request Timeout) to make it easy for the product code to handle a request timeout, without needing to handle with try-catch. 

## In Summary

As your services grow, you need to keep adding more and more protection to avoid incidents.
Adding a fixed timeout for all external API calls increases the reliability of your services.

What else are you using to increase the reliability of your services?


---
Woovi
[Woovi](https://www.woovi.com) is a Startup that enables shoppers to pay as they like. To make this possible, Woovi provides instant payment solutions for merchants to accept orders.

If you want to work with us, we are [hiring](https://woovi.com/jobs/)!

---
Photo by <a href="https://unsplash.com/@neonbrand?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Kenny Eliason</a> on <a href="https://unsplash.com/photos/KYxXMTpTzek?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
Guide to Docker Logging: Best Practices and Tools
Tags: webdev, docker, devops, javascript
Published: 2023-09-20 13:13:46

Docker has revolutionized containerization, making it easier than ever to package, distribute, and deploy applications. Effective logging is a crucial aspect of managing Docker containers in production environments. Proper logging ensures that you can monitor, troubleshoot, and analyze your containers effectively. To maximize the benefits of Docker logging, follow these best practices:

**1. Use Standard Output and Error Streams**
Docker containers are designed to write logs to their standard output (stdout) and standard error (stderr) streams. By following this convention, you make it easier to collect and manage logs using Docker-native tools.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g7ip3wk0h8a06373mx1d.png)
**2. Containerize Your Logging Solution**
Consider running a logging agent as a sidecar container within your application stack. This approach ensures that logging is an integral part of your containerized applications.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0qtpu7lqlmv90srdb2i8.png)
**3. Implement Log Rotation**
Configure log rotation settings to prevent log files from consuming excessive disk space. Docker provides built-in log rotation options, but you can also use external log rotation tools.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j72ugdb2j6gvc3qsf6hc.png)
**4. Centralize Log Storage**
Store your container logs centrally, preferably in a dedicated log management system or a centralized location. Popular choices include Elasticsearch, Logstash, and Kibana (ELK stack), or managed services like AWS CloudWatch or Google Cloud Logging.

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

**5. Centralized Log Storage with Fluentd**
In this Docker Compose configuration, Fluentd is used as a logging driver to collect logs from the myapp service and forward them to Elasticsearch and Kibana for centralized log storage and analysis.
version: '3'

**6. Apply Log Labels and Metadata**
Use Docker labels and metadata to add contextual information to your logs. This makes it easier to filter and search for specific log entries.

**7. Secure Your Logs**
Ensure that your log data is adequately protected. Encrypt log transmission and storage, and implement access controls to restrict who can view the logs.

**Conclusion**
Effective Docker logging is essential for maintaining the reliability, security, and performance of your containerized applications. By adhering to best practices and leveraging the right tools, you can ensure that your Docker logs are a valuable asset rather than an afterthought. Invest in a robust logging strategy from the beginning to streamline troubleshooting, monitoring, and maintaining your Docker containers in production.
How do you find Hacktoberfest issues?
Tags: discuss, hacktoberfest23, opensource, github
Published: 2023-09-20 13:07:06

Hey all!

With [Hacktoberfest](https://dev.to/t/hacktoberfest) just around the corner, let's discuss our favorite strategies for discovering those Hacktoberfest-worthy open source issues.

> 
Got a pro tip or a go-to method for finding the perfect project to contribute to?

Share it in the comments below and help fellow devs and newcomers make the most of this awesome event!
Test on Chrome 66 Beta and Firefox 60 Beta at LambdaTest
Tags: beta, chrome, automation, testing
Published: 2023-09-20 13:00:47

Testing in latest environment decreases the risk of unexpected errors for users in the latest tech that they are using. So, today we have released latest versions of Chrome, Firefox, and Opera for you to test on. With this, you can test your web applications and websites on Google Chrome 65, Google Chrome 66 Beta, Firefox 59, Firefox 60 Beta, Opera 51, Opera 52, and Opera 53 for Win 10, Win 8.1, Win 8, Win 7, Mac High Sierra, Mac Sierra, Mac El Capitan, and Mac Yosemite.

## What To Expect In Chrome 65 Beta?

Chrome 65 provides you material design changes and new and enhanced developer features. Chrome 66 provides you with more enhanced devtools including blackboxing in the networking panel, local overrides with styles inside of HTML, Pretty-printing in the Preview and Response tabs, Auto-adjust zooming in Device Mode, and Previewing HTML content in the Preview tab.

## What To Expect In Firefox 60 Beta?

You can [test on firefox browser](https://www.lambdatest.com/test-on-firefox-browsers?utm_source=devto&utm_medium=organic&utm_campaign=sept_20&utm_term=bw&utm_content=webpage) with a ton of new improvements to the previous version. This includes improved page load times, added tools to annotate and crop your Firefox Screenshots, and easier to arrange your Top Sites on the Firefox Home page. Also some of the still left bugs are planned to be updated in the final release of firefox 60 which includes changed reader view, no more than single bookmarking of same pages, enhanced camera privacy indicators.

## What’s New in Opera 53?

Opera 51 adds to your browsing speed making it faster than before and enhanced scrolling features where you just need to click on tab, easy import of bookmarks, Collapsible lists of opened and closed tabs in tabs menu, updated private mode, added back to tab option for pop-up videos, easy browser settings reset.

In Opera 52, you’ll find faster ad blocking to save your time, select and copy multiple tab addresses, and error pages showing fun animations.

Opera 53 will show you updated speed dial page with featured images below it.

Now, you can test all these updated features with LambdaTest’s latest update with just one click. So, go ahead. Fire up the latest browser with the supported OS and test your website, web application for the latest builds in browsers.

Happy Testing!
What repos would you recommend to new contributors for Hacktoberfest?
Tags: discuss, hacktoberfest, opensource, hacktoberfest23
Published: 2023-09-20 13:00:15

---
title: What repos would you recommend to new contributors for Hacktoberfest? 
published: true
description: 
tags: discuss, hacktoberfest, opensource
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-09-20 12:50 +0000
---

![woman with binoculars searching for something](https://media.giphy.com/media/26u4arvdZ1v42ZVBK/giphy.gif)

I'm making a list of repositories that are friendly to new contributors for Hacktoberfest. **If your project is participating in Hacktoberfest or if you have one you'd recommend, drop it below.** 

If you're not sure what makes it friendly, I'm a (biased) fan of [Virtual Coffee's](https://virtualcoffee.io/) checklist to help identify those repos:


[![Repo checklist](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jhzvz5w0hp5ohvacgoxw.png)](https://virtualcoffee.io/resources/developer-resources/open-source/maintainer-guide#repository-checklist)
Learn Software Testing with Strong Foundations
Tags: testing, beginners
Published: 2023-09-20 12:48:55

Tester Academy is the leading Software Testing Training Institute in Ahmedabad, offering comprehensive courses in manual and automated testing. Our expert instructors provide hands-on training, preparing students for a successful career in software testing. Enroll now and become a certified software tester! At Tester Academy, we prioritize hands-on practical experience, ensuring that our students can confidently verify software quality, identify defects, and opt Software Testing Course in Ahmedabad 1) Foundation of Software Testing (Manual Testing) 2) Automation Testing using Selenium + Java. We provide with best software training in ahmedabad. Get yourself enrolled today and start your career in [software testing](https://testeracademy.com/).
React native Search In SectionList
Published: 2023-09-20 12:47:13

[SectionList with Search](https://snack.expo.dev/@sahilkash/sectionlist-example-with-search)
Requirement: Add search in SectionList of react native

Here's [Js code for filtering](https://playcode.io/1580772) used

```js
const sectionList = [{
    caption: 'caption1',
    data: [{
        id: '1',
        title: 'Payment',
        description: 'Pay info',
    }, {
        id: '2',
        title: 'Refund',
        description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Dicta et ipsam voluptate commodi nulla asperiores corporis, sapiente quasi obcaecati quae totam consequatur cum, perspiciatis pariatur !',
    }, {
        id: '3',
        title: 'Mobs',
        description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Dicta et ipsam voluptate commodi nulla asperiores corpori!',
    }, {
        id: '4',
        title: 'test',
        description: 'Lorem ipsum dolor sit amet consectetur adipisicing elit. Dicta et ipsam voluptate commodi nulla',
    }, ],
}, 
{
    caption: 'caption2',
    data: [{
        id: '5',
        title: 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Recusandae eveniet?',
        description: 'Custom desc',
    },{
        id: '9',
        title: 'Lorem ipsum, dolor sit amet consectetur adipisicing elit. Recusandae eveniet?',
        description: 'Lorem ipsum Custom desc',
    }, ],
}, ];
const query = 'Lorem ipsum' // Not working

const res = sectionList
  .map(d => ({ ...d, data: d.data.filter(c => c.description.includes(query)) }))
  .filter(d => d.data.length)

console.log(res);
```
Compile PHP Swoole and test Swoole http server
Tags: swoole, php
Published: 2023-09-20 12:32:40



**INSTALL SWOOLE **

```
apt install php-dev libc-ares-dev libcurl4-openssl-dev
```

```
sudo pecl install -D 'enable-sockets="yes" enable-openssl="yes" enable-http2="yes" enable-mysqlnd="yes" enable-swoole-json="yes" enable-swoole-curl="yes" enable-cares="yes"' swoole
```

```
echo "extension=swoole.so" > /etc/php/8.1/cli/conf.d/20-swoole.ini
```
**CHECK SWOOLE EXTENSION LOADED**  
```
php -m | grep swoole 
```
 
```
php --ri swoole 
```

**TEST SWOOLE**


```
<?php
    
    $http = new Swoole\Http\Server('0.0.0.0', 9501);
    
    $http->on("request", function ($request, $response) {
        $response->header("Content-Type", "text/plain");
        $response->end("Hello, Swoole!");
    });
   
     $http->start();
    ?>
```

```
curl localhost:9501
```
<a href="https://www.buymeacoffee.com/hardyweb" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
#7 Example of Intent and Switch Activity using Intent | Android Studio Tutorial | #SoftwareTechIT
Tags: android, beginners, programming, development
Published: 2023-09-20 12:30:00

{% embed https://www.youtube.com/watch?v=4ZKn7-X0loI&list=PLmwJLue37PZfiGUAwQ6uhh5bbYkeFUOpj&index=7&ab_channel=SoftwareTechIT %}

Subscribe Channel SoftwareTechIT 
And Visit:- https://SoftwareTechIT.com
More Here:- https://home.softwaretechit.com
Buy Anything From Here :-https://shop.softwaretechit.com

Questions:- 
What is an Intent in Android ?
What is Intent in android with example?
What are the types of Intent?
What is Intent syntax in Android?
What is Android activity and Intent?
why we use intent in android
Why do we use Intent?
What is Intent in Android with example?
Why is Intent used to communicate between activities?
What are the types of intents in Android?
How do you start an Intent?
What is Intent and example?
How do you use Intent?
What are the components of Intent?

Download Our App:- https://play.google.com/store/apps/details?id=com.softwaretechit
Read More Here :- https://softwaretechit.com/top-10-quetions-on-ai-and-chatgpt-ai-tool-can-ai-is-new-future-of-world/
https://softwaretechit.com/what-is-chatgpt-develope-chatgpt-11-things-you-can-do-with-chatgpt/
Watch Other Video:-https://youtube.com/shorts/7MmZi6GHizM?feature=share
🌎 Website :- https://softwaretechit.com
📰 Blog:- https://blog.softwaretechit.com
🛒 Shopping :- https://shop.softwaretechit.com 
📑 Product Review :- https://productsellermarket.softwaretechit.com
🔎 Business & More:- https://golbar.net/
🏡 https://home.softwaretechit.com

💬 https://instagram.com/softwaretechit

LeetCode Playlist :- https://www.youtube.com/playlist?list=PLmwJLue37PZeATQcUaHddx4-TJ5cjkT0t
Angular Project Playlist :- https://www.youtube.com/playlist?list=PLmwJLue37PZfQTgu-AXNee3EDj7oIlqeh
Android Playlist :-https://www.youtube.com/playlist?list=PLmwJLue37PZcEUyMLhaa3jnfyq3lETiSe
Python Flask Project Playlist :- https://www.youtube.com/playlist?list=PLmwJLue37PZdqqr9wj6c5uY2iXQsSVxZK
Java Project Link :- https://www.youtube.com/playlist?list=PLmwJLue37PZcvpGWO8tjlFzXCRS7FDfwA
Installation Tutorial Playlist :- https://www.youtube.com/playlist?list=PLmwJLue37PZeRGo1hOc3Mh4QcHVSIKQ9Y
Kali Linux Installation:- https://youtu.be/7uqH2om9itY
Revolutionise Your Campus Hiring with Superset: Virtual Hiring Made Effortless
Tags: campusrecruitment, campushiringstrategy, virtualrecruitmentplatform
Published: 2023-09-20 12:29:43

In an age where virtual hiring and campus placements have become the norm, Superset emerges as the ultimate solution for universities, employers, and fresh graduates alike. With our cutting-edge campus hiring automation software and virtual hiring platform, we're here to transform the way you approach talent acquisition and campus placements.
https://joinsuperset.com/
State - Next Js App Directory 13.4
Tags: nextjs, webdev, tutorial, react
Published: 2023-09-20 12:20:48

## What is State?

State is a updatable variable in React/Next js that will cause a rerender of the component

Define state in functional component use useState()

```jsx
'use client'

function App() {
  const [name, setName] = useState('');
  return <div className="App">{name}</div>;
}
export default App;
```

in this example we have state namely 'name'. We can update the name value use setName

```jsx
'use client'

function App() {
  const [name, setName] = useState('');

  function updateName() {
    setName('Bayu');
  }

  return <div className="App">{name}</div>;
}
export default App;
```

So when updateName function is executed, the name value will updated from ' ' to 'Bayu'

> State in client site event. So, you can't use it on server component. Make sure to add 'use client' on the top your component.

Hope this helps!
Wednesday Links - Edition 2023-09-20
Tags: java, spring, dns, archunit
Published: 2023-09-20 12:18:58

Java 21 is now available! (30 sec)🎉
https://twitter.com/java/status/1704127335983644701

Hello, Java 21 (16 min)🎉
https://spring.io/blog/2023/09/20/hello-java-21

DNS requests in Java (13 min)➡️
https://coderambling.com/2023/09/java-dns-requests/

Quality Outreach Heads-up - JLine is now the Default Console Provider (1 min)🖥️
https://inside.java/2023/07/31/quality-heads-up/

Java Records are "Trusted" and Consequently Faster (1 min)🏰
https://minborgsjavapot.blogspot.com/2023/09/java-records-are-trusted-and.html

Awaitility in Spring Boot 3.2 (30 sec)🎉
https://twitter.com/maciejwalkowiak/status/1702038479071273117

Online MongoDB migration (11 min)🧳
https://blog.allegro.tech/2023/09/online-mongodb-migration.html

Monkey-patching in Java (7 min)🐒
https://blog.frankel.ch/monkeypatching-java/

ArchUnit vs. Konsist. Why Did We Need Another Kotlin “Linter”? (6 min)🤖
https://proandroiddev.com/archunit-vs-konsist-why-did-we-need-another-linter-972c4ff2622d

The GitHub Actions Worm: Compromising GitHub Repositories Through the Actions Dependency Tree (5 min)🪱
https://www.paloaltonetworks.com/blog/prisma-cloud/github-actions-worm-dependencies/

In a git repository, where do your files live? (7 min)🗄️
https://jvns.ca/blog/2023/09/14/in-a-git-repository--where-do-your-files-live-/
Soochow University Unveils OpenBA, a Pioneering 15B Bilingual seq2seq Model in NLP
Tags: news, machinelearning, ai, nlp
Published: 2023-09-20 12:17:13

Researchers from Soochow University have introduced OpenBA, a groundbreaking 15 billion-parameter bilingual sequence-to-sequence (seq2seq) model for natural language processing, focusing on Chinese language processing. Distinct from predecessors like BLOOM and AlexaTM, OpenBA enhances the encoder-decoder framework and optimally balances English and Chinese tokens. Its unique architecture, favoring a shallow encoder and deep decoder, has shown notable efficacy in denoising tasks. Impressively, OpenBA performs commendably across benchmarks, especially in tasks like translation and summarization.

Read the full story — https://news.superagi.com/2023/09/20/soochow-university-unveils-openba-a-pioneering-15b-bilingual-seq2seq-model-in-nlp/
Researchers Unveil Crosslingual Annotation Methodology, Boosting Clinical French NLP Resources
Tags: medicine, nlp, machinelearning, ai
Published: 2023-09-20 12:15:50

Researchers from the University Hospitals of Geneva and the University of Geneva have developed a groundbreaking crosslingual annotation projection methodology to address the shortage of high-quality annotated datasets in specialized fields like medicine. Utilizing a language-agnostic approach based on BERT technology, they effectively transferred annotations between languages. This led to the creation of FRASIMED, a vast French annotated resource containing over 2,000 synthetic clinical cases, integrated with datasets like CANTEMIST and DISTEMIST.

Read the full story — https://news.superagi.com/2023/09/20/researchers-unveil-crosslingual-annotation-methodology-boosting-clinical-french-nlp-resources/
PixNav Technique Set to Enhance Robotic Navigation in Unfamiliar Environments
Tags: robotics, llm, ai, machinelearning
Published: 2023-09-20 12:13:53

Researchers have developed a novel pixel-guided navigation method called PixNav, enabling robots to navigate unfamiliar environments using visual cues rather than conventional map-based techniques. Traditional robotic systems rely heavily on map-based planning, which necessitates costly equipment and often fails to seamlessly transfer knowledge from visual recognition to practical navigation. PixNav, on the other hand, uses image pixels as navigation markers, streamlining the process and facilitating adaptable navigation strategies. To address objects out of sight, the method incorporates large-language models (LLMs) to inform robots based on human-like context understanding.

Read the full story — https://news.superagi.com/2023/09/20/pixnav-technique-set-to-enhance-robotic-navigation-in-unfamiliar-environments/
An open source platform aiming to be the WordPress for React
Tags: opensource, react, webdev, javascript
Published: 2023-09-20 12:04:46

We're excited to introduce you to Webcrumbs—an open-source, community-driven endeavor that aspires to be the "WordPress for React." Whether you're a developer, designer, or just tech-curious, Webcrumbs offers an intuitive, no-code admin panel to help you build, manage, and scale React applications.

**Why Webcrumbs?**

- **Plugin Platform**: Extend your React site's functionality with our plugin platform.
- **No-Code Admin Panel**: Manage your site easily, no coding required.
- **Fully Customizable**: Tailor Webcrumbs to meet your specific needs.
- **Community-Driven and Free**: Open-source and powered by contributions like yours.

**Why We Need You**

Webcrumbs aims to serve as a comprehensive solution that streamlines collaboration across various departments and enables developers to showcase and monetize their expertise. The best part? It's designed to adapt and integrate future technologies like AI.

And we can't do this without your help!

**How You Can Contribute**

1. **Star the Repository on GitHub** Show your support and help us gain visibility by starring the repository. [Star Webcrumbs on GitHub
](Star Webcrumbs on GitHub)

2. **Join the Discussions** Your thoughts, ideas, and suggestions can shape the future of Webcrumbs. [Join Discussions
](https://github.com/webcrumbs-community/webcrumbs#:~:text=a%20new%20one.-,Go%20to%20Discussions,-Check%20Open%20Issues)

3. **Check Open Issues** Looking to contribute code? Check the open issues and see where you can help. [Check Open Issues
](https://github.com/webcrumbs-community/webcrumbs#:~:text=you%20can%20contribute.-,View%20Open%20Issues,-Read%20the%20Contributing)

4. **Read Our Contributing Guide** For a step-by-step guide on how to contribute, read our Contributing Guide. [Read Contributing Guide
](https://github.com/webcrumbs-community/webcrumbs#:~:text=Read%20Contributing%20Guide)

**We're Waiting for You!**

This is a call to all developers, designers, and tech enthusiasts to join us in shaping the future of React-based web development. Every contribution, no matter how small, brings us closer to making Webcrumbs a game-changing platform.

Feel free to ask any questions in the comments below or reach out to us through our GitHub repository.

Let's make something amazing together!