teleren/devto huggingface dataset:
Data-to-Knowledge Transformation with AI Insights
Tags: webdev, javascript, beginners, programming
Published: 2023-07-30 03:30:00

Welcome to [Babelstreet](https://www.aiforme.wiki/ai/tools/Babelstreet), the world's leading AI-enabled data-to-knowledge platform. With Babelstreet, you can stop managing knowledge and start utilizing it automatically.

**Harness the Power of Real-Time Insights:**
Babelstreet offers a unique blend of patented AI-enabled linguistics technology and unmatched expertise, supported by exceptional customer service. This powerful combination enables you to tap into real-time insights that transcend language barriers, providing valuable information about people, places, and connections that are relevant to your needs.

**Multilingual Insights:**
Break through language barriers with our advanced AI capabilities. Discover crucial information across diverse languages, enabling you to gain a comprehensive understanding of global events and trends.

**Predictive Security and Threat Intelligence:**
Stay ahead of potential dangers with Babelstreet's predictive security features. Our intelligent extraction and prioritization of insights help you identify and respond to threats effectively, ensuring the safety and security of your organization.

**Reliable Protection and Risk Mitigation:**
Babelstreet goes beyond mere insights by empowering you to take proactive measures. Uncover fraud, detect abuse, and identify threats while maintaining the highest levels of security and compliance.

**Conclusion:**
With Babelstreet, you have access to a cutting-edge platform that transforms raw data into actionable knowledge. Embrace the power of AI-driven insights, and leverage our advanced linguistic technology to make informed decisions in real-time.

Whether you seek to enhance national security or improve your business operations, [Babelstreet](https://www.aiforme.wiki/ai/tools/Babelstreet) is the ultimate solution. Join the ranks of those benefiting from our unmatched AI, predictive security, and reliable risk mitigation services. It's time to unlock the true potential of your data with Babelstreet.
iota คืออะไรและวิธีใช้
Tags: go, programming, beginners
Published: 2023-07-30 03:26:15

สำหรับคนที่เขียน Go บางคนอาจจะเคยเห็นวิธีการทำ Enum ของ Go ด้วยการใช้ `iota` เข้ามาช่วย ยกตัวอย่างเช่น

```go
type weekday int

const (
    sunday weekday = iota
    monday
    tuesday
)
```

มีบางคนสงสัยว่า `iota` คือคำย่อหรือเปล่า แล้วมันย่อมาจากคำว่าอะไรกันแน่ บางคนไปตั้งกระทู้ใน stackoverflow ถามก็มี ซึ่งคำตอบก็คือ นี่ไม่ใช่คำย่อแต่อย่างใด

iota เป็นตัวอักษรกรีกโบราณในลำดับที่ 9
[Iota (/aɪˈoʊtə/; uppercase: Ι, lowercase: ι; Greek: ιώτα)](https://en.wikipedia.org/wiki/Iota)

ซึ่งถูกนำมาใช้เป็นสัญลักษณ์ทางคณิตศาสตร์ เช่นตัว i ที่เราใช้ในการอ้างถึงจำนวนจินตภาพ หรือเป็นตัวแทนฟังก์ชั่นของ [Inclusion Map](https://en.wikipedia.org/wiki/Inclusion_map)

ในทาง programming ของเรา การนำ iota มาใช้ จากที่อ่านเจอน่าจะถูกนำมาใช้ในภาษา [APL](https://en.wikipedia.org/wiki/APL_(programming_language)) เนื่องจากภาษานี้ถูกสร้างขึ้นโดย [Kenneth E. Iverson](https://en.wikipedia.org/wiki/Kenneth_E._Iverson) ซึ่งเป็นนักคณิตศาสตร์ และได้นำเอาสัญลักษณ์ iota เข้ามาใช้เป็นฟังก์ชั่นสำหรับสร้าง vector ของตัวเลข เริ่มที่เลข 1 ไปจนถึงเลขที่ระบุ (ลองอ่านดูใน Wiki เพิ่มเติม)
ต่อมาก็ถูกนำมาใช้ใน C++ และแม้ว่า Rob และ Ken จะแสดงตัวชัดเจนว่าไม่ค่อยจะชอบ C++ เท่าไรนัก ทำให้การที่ Go มี iota มาใช้ในลักษณะเดียวกัน คนก็ตั้งข้อสงสัยว่า อาจจะได้แรงบันดาลใจมาจาก APL มากกว่า

เล่ามาซะยาว มาดูวิธีใช้งานมันดีกว่า

iota ใช้สร้าง const เท่านั้น เรียกได้ว่าเป็นตัวช่วยทำ Enum ของ Go ก็ได้เช่นกัน โดยเมื่อเราสร้าง const แล้วระบุค่าเป็น iota มันจะสร้างลำดับตัวเลขเริ่มต้นที่เลข 0 และเพิ่มค่าทีละ 1 ไปเรื่อยๆให้เช่น

```go
const (
    zero = iota
    one
    two
)
```

แบบนี้เราจะได้ค่า constant ตามนี้

> zero = 0
> one = 1
> two = 2

หากต้องการ skip ค่าไหนก็สามารถใช้ `_` ไปคั่นบรรทัดนั้นๆได้เลยเช่น

```go
const (
    zero = iota
    _
    two
)
```

แบบนี้เราก็จะยังได้ค่า two = 2 เหมือนเดิม

และเราสามารถแทก บรรทัดว่างๆหรือ comment ในระหว่างบรรทัดได้โดยไม่กระทบกับลำดับเลขเช่น

```go
const (
    zero = iota

    one
    // comment
    two
)
```

แบบนี้ เราก็ยังคงได้ลำดับ

> zero = 0
> one = 1
> two = 2

เหมือนเดิม และอีกตัวอย่างการใช้การที่เห็นบ่อยก็คือการประกาศค่า data storage unit

```go
const (
	_ = 1 << (iota * 10) // = 1 << 10
	KB
	MB
	GB
)
```

หากต้องการเริ่มต้นลำดับใหม่ ก็เพียงแค่สร้าง const() กลุ่มใหม่ มันก็จะเริ่มต้นนับ 0 ใหม่ให้เอง
เห็นแบบนี้แล้วก็พอจะนึกวิธีใช้งานกันได้บ้างนะครับ หวังว่าจะเป็นประโยชน์
How to Generate Dynamic Sitemaps in Next.js
Tags: nextjs, javascript, markdown, tutorial
Published: 2023-07-30 02:27:38

# Introduction 

Let's say you have folder containing markdown files which are used as individual blog posts in the Next.js blog website.

This is exactly what I did to generate sitemap.xml file for my Next.js website https://notionworkspaces.com/

## Steps to generate sitemap.xml (only 3 steps)

1. Create a `sitemap.xml.js` file inside src/pages/ folder from the Next.js home directory
2. Add this code inside it
```javascript
import fs from 'fs';
import matter from 'gray-matter';

const postsDirectory = path.join(process.cwd(), 'posts');

const URL = "https://yourwebsitedomain.com";

function generateSiteMap(posts) {
  return `<?xml version="1.0" encoding="UTF-8"?>
   <urlset xmlns="https://www.sitemaps.org/schemas/sitemap/0.9">
     <!-- Add the static URLs manually -->
     <url>
       <loc>${URL}</loc>
     </url>
     ${posts
       .map(({ id }) => {
         return `
           <url>
               <loc>${`${URL}/posts/${id}`}</loc>
               <lastmod>${new Date().toISOString()}</lastmod>
           </url>
         `;
       })
       .join("")}
   </urlset>
 `;
}

export function getSortedPostsData() {
  // Get file names under /posts
  const fileNames = fs.readdirSync(postsDirectory);
  const allPostsData = fileNames.map((fileName) => {
    // Remove ".md" from file name to get id
    const id = fileName.replace(/\.md$/, '');

    // Read markdown file as string
    const fullPath = path.join(postsDirectory, fileName);
    const fileContents = fs.readFileSync(fullPath, 'utf8');

    // Use gray-matter to parse the post metadata section
    const matterResult = matter(fileContents);

    // Combine the data with the id
    return {
      id,
      ...matterResult.data,
    };
  });
  // Filter out draft posts
  const livePosts = allPostsData.filter((postData) => {
    return postData.draft == false
  })
  // Sort posts by date
  return livePosts.sort((a, b) => {
    if (a.date < b.date) {
      return 1;
    } else {
      return -1;
    }
  });
}

export async function getServerSideProps({ res }) {
  const posts = getSortedPostsData();

  // Generate the XML sitemap with the blog data
  const sitemap = generateSiteMap(posts);

  res.setHeader("Content-Type", "text/xml");
  // Send the XML to the browser
  res.write(sitemap);
  res.end();

  return {
    props: {},
  };
}

export default function SiteMap() {}
```
3. Run `npm run dev` locally to verify that the `http://localhost:3000/sitemap.xml` is created successfully.


That's it!

# Conclusion

You can deploy your Next.js app and verify the sitemap with all 'posts' links **dynamically generated for you without any additional effort**.

Your website's sitemap should have the same structure as mine.

Here is how my sitemap looks → https://notionworkspaces.com/sitemap.xml


You can also modify the above code to add/delete parts that are unique to your blog.

I hope you found this useful!


👋 [-- @TnvMadhav](https://tnvmadhav.me/contact)
(WIP) sed personal reference
Tags: sed
Published: 2023-07-30 01:56:07

# dry run

Without any option, running sed doesn't update files. So, normal mode is dry run mode.

# dry run with diff

```shell
sed 's/hoge/fuga/g' sample.txt | diff sample.txt -
```

dry run with beauty diff
```shell
sed 's/hoge/fuga/g' sample.txt | diff --color -u sample.txt -
```

# update file
`-i`(--in-place)

```shell
sed -i 's/hoge/fuga/g' sample.txt
```

# update with backup
```shell
sed -i.bak 's/hoge/fuga/g' sample.txt
```

# use multiple orders
```shell
sed -e 's/hoge/fuga/g' -e 's/xxxx/aaaa/g' sample.txt
```
Jokeday Funday Part #4
Tags: jokes, programming, coding, codenewbie
Published: 2023-07-30 01:35:29


  <h2>Jokeday Funday: Part 4 - More Programming Jokes to Make Your Day</h2>

  <p><strong>Joke 1: The Lazy Developer</strong></p>
  <p>Why do programmers prefer to work in shortcuts?</p>
  <p>Because they believe in optimizing their efforts for maximum laziness!</p>

  <p><strong>Joke 2: The Unseen Error</strong></p>
  <p>Why do programmers always look frustrated while reading code?</p>
  <p>Because they are searching for an error that seems to be hiding from them!</p>

  <p><strong>Joke 3: The Ancient Codebase</strong></p>
  <p>Why did the archaeologist become a programmer?</p>
  <p>To dig through ancient code and decipher the secrets of the past!</p>

  <p><strong>Joke 4: The Code Translator</strong></p>
  <p>Why do programmers make good linguists?</p>
  <p>Because they know how to speak in multiple programming languages!</p>

  <p><strong>Joke 5: The Mysterious Email</strong></p>
  <p>Why did the developer's email always go to the spam folder?</p>
  <p>Because it had a suspicious attachment - an "exe" file named "LoveLetter"!</p>

  <p><strong>Joke 6: The Restaurant Error</strong></p>
  <p>Why did the programmer go hungry at the restaurant?</p>
  <p>Because their fork was stuck in an infinite loop with the spaghetti!</p>

  <p><strong>Joke 7: The Parallel Universe Revisited</strong></p>
  <p>Why do programmers believe time travel is possible?</p>
  <p>Because they often encounter versions of their code from the past and future!</p>

  <p><strong>Joke 8: The Alien Encounter</strong></p>
  <p>Why did the alien refuse to talk to the programmer?</p>
  <p>Because they didn't understand the programmer's strange language - "Code"!</p>

  <p><strong>Joke 9: The Web Developer's Pun</strong></p>
  <p>Why did the web developer break up with their internet connection?</p>
  <p>It had too many "lags" in the relationship!</p>

  <p><strong>Joke 10: The Algorithm's Complaint</strong></p>
  <p>Why do algorithms hate visiting art museums?</p>
  <p>Because they can't stand all the "abstract" art!</p>

  <p><strong>Bonus Joke: The Inquisitive Coder</strong></p>
  <p>Why did Soumya become a programmer?</p>
  <p>Because he was always curious about what makes the digital world tick!</p>
Bandit Level 7 Level 8
Tags: bandit, ctf, overthewire, writeup
Published: 2023-07-30 00:04:57

### Introduction

Bandit level 8 is all about finding a specific word in a file and extracting its value. In this level, we are given a file called `data.txt` and are tasked with finding the value of a specific word.

### Steps

1. Connect to the Bandit server using SSH with the following command:

```
ssh bandit7@bandit.labs.overthewire.org -p 2220
```

1. Enter the password for Bandit level 8 when prompted: `z7WtoNQU2XfjmMtWA8u5rN4vzqu4v99S`.
2. We are given a file called `data.txt`. Use the `cat` command to view the contents of the file:

```
cat data.txt
```

1. We are tasked with finding the value of the word "millionth" in the file. To accomplish this, we can use the `grep` command to search for the word, and then use the `awk` command to extract its value. The command to do this is as follows:

```
cat data.txt | grep millionth | awk -F " " '{print $2}'
```

1. After running the command, the value of the word "millionth" will be displayed in the terminal.

```
TESKZC0XvTetK0S9xNwm25STk5iWrBvP
```

### Conclusion

In this level, we learned how to search for a specific word in a file using the `grep` command and how to extract its value using the `awk` command. With this knowledge, we were able to successfully complete the level and obtain the password for the next level.
Island architecture, should you use it?
Tags: javascript, typescript, webdev
Published: 2023-07-29 11:14:39

## Introduction
Lately i've been researching about island architecture and how some people say it's the future for javascript "0kb", but is it the future? is javascript "0kb" even possible? Well i would try to answer this questions here and explain a little about it and what i have discovered after my research on it.

## What is island architecture?
I will try to introduce you with island architecture even though i'm not a expert on the field.
What island architecture is trying to achieve is basically avoid having enormous chunks of javascript in every render but instead having isolated by the components that actually need javascript such as buttons, etc.
For instance, let's say we have a navBar with a title and then a little button that if you click it will send you a notification. 
The navbar since it's stateless it will be static server renderer and the button will have it's own script since its interactive and after an action it will be rehydrated to be updated.
And this is basically island architecture but it's probably not the best explanation so i will leave a link where i found the best explanation [explanation](https://www.patterns.dev/posts/islands-architecture).

## Is it the future?
Well yes and no, let me elaborate.
I think that is the future for specific cases, since in apps where you have literally all stateful components is not useful neither recommended to use it, an example would a social media where there is basically no static components. However i think this type of architecture could be really helpful on ecommerce's and blog's for example where it will give a better performance for it and will a provide a better experience for the user.

## Is javascript "0kb" possible?
Short answer: no.
Why i think that is not possible? Well several of reasons, first of all, why did we start even using javascript? Ask yourself that.
We started using it for big websites where state is a really important thing, to provide things that can probably can be achieve without it but at what cost?
So, no i don't think is possible at least not yet, but i would love to know your opinion about it.

## Conclusion
I would encourage you to do your research about it and the other possibilities out there. I hope this was useFul and if you have any questions you can drop a comment and i would try to help you out. 

Cheers, Lautaro.
Ubie: A Revolutionary Health Quiz Tool for Diagnosing Symptoms
Tags: ai, programming
Published: 2023-07-29 23:30:27


_Greetings, valued readers! It's a pleasure to have you with me as I delve into the fascinating world of healthcare technology, spotlighting Ubie, a transformative health quiz tool_






**Here we go!!**

Introducing Ubie, a cutting-edge health quiz tool designed to provide tentative diagnoses based on user-reported symptoms. Accessible to both medical professionals and the general public, Ubie is transforming the way we understand and approach health diagnostics.

![preview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gfj892bo4t9l91hmzcf.png)

Ubie functions as a virtual health detective, guiding users through a series of questions to offer a possible diagnosis. While not a replacement for professional medical advice, Ubie serves as a preliminary guide, suggesting conditions to investigate further with healthcare providers.

For medical professionals, Ubie offers a fresh perspective on patient interaction and preliminary diagnosis. It's a valuable tool for gaining quick insights into potential health conditions that may require further examination.

For the general public, Ubie is a user-friendly health companion. Its intelligent questioning system makes it a valuable tool for understanding symptoms, whether common or complex.

Ubie is an innovative tool that bridges the gap between medical professionals and the general public. It's a step towards a future where technology and healthcare work in harmony.

**This is not meant to replace doctors** - any results should be confirmed by a healthcare professional. However, in my testing I found it extremely easy to use and helpful for suggesting possible conditions to investigate further. I encourage you to go and try it out - https://ubiehealth.com/

LMK what you think about this tool.
_Until next time....._

![cheers](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9z97krk8hwg1u6rzg06j.jpeg)
Top 5 AI Tools For Programmers
Tags: ai, programming, chatgpt
Published: 2023-07-29 21:20:03

As the world of programming continues to evolve, so does the need for efficient and intelligent tools to assist developers in their daily tasks. Artificial Intelligence (AI) has stepped into this realm, revolutionizing the way programmers work and helping them streamline their workflows. In this blog, we'll explore the top 5 AI tools that have become indispensable for programmers, empowering them to write better code, debug with ease, and enhance overall productivity.

GitHub Copilot :
It is the leading AI coding assistant that helps developers write better code faster. Powered by OpenAI Codex, it uses a vast collection of public code to suggest lines, functions, comments, and even helps with debugging and security.

Amazon CodeWhisperer :
Amazon CodeWhisperer is an advanced code generator that uses machine learning. It provides real-time code suggestions within developers' IDEs, trained on a vast dataset of open-source code. From snippets to full functions, it recommends code based on comments and existing code.

Tabnine :
Tabnine is an AI-powered coding assistant that enhances developer productivity by enabling fast and efficient code writing. It supports multiple programming languages, including Python, Java, JavaScript, PHP, Go, and Rust. Using a neural network trained on a vast collection of open-source code, Tabnine provides accurate code completions, even in complex coding scenarios.

CodeWP :
CodeWP is an AI-powered WordPress code generator that simplifies coding for all skill levels. It swiftly creates valid code for custom post types, plugins, and more. Trained on a vast WordPress code dataset, CodeWP ensures high accuracy, saving time and improving productivity.

AskCodi
AskCodi is an AI-powered coding partner that offers quick and accurate coding solutions. Powered by OpenAI Codex, it generates code, answers programming questions, and provides helpful suggestions. Simply install the AskCodi extension on your preferred IDE like Visual Studio Code, PyCharm, or IntelliJ IDEA to supercharge your coding process. It also assists with SQL query generation and creating DocStrings.

Conclusion :
AI tools have become invaluable assets for programmers, enabling them to code smarter, faster, and with greater confidence. As AI technology continues to advance, we can expect even more innovative tools to reshape the landscape of programming, making it an exciting time to be a developer. Embracing these AI-powered tools can undoubtedly lead to enhanced productivity and better software development outcomes.
How to add Ads.txt in the NextJS project to fix the AdSense alert?
Tags: nextjs, adsense, adstxt, commonerror
Published: 2023-07-29 20:58:17



In a new website, once Google AdSense approves the website for Ads, getting the below warning message to add “Ads.txt” is very common. In this article let's see how “Ads.txt” can be added to a NextJS project.

![](https://cdn-images-1.medium.com/max/5056/1*TGxi4HcAknbeEqco4oZpNw.png)

**What is Ads.txt?**

*Below is the definition from the [AdSense link](https://support.google.com/adsense/answer/12171612?hl=en-GB#:~:text=Authorised%20Digital%20Sellers%2C%20or%20ads,you've%20identified%20as%20authorised.)*

[Authorised Digital Sellers or ads.txt](https://iabtechlab.com/ads-txt/) is an IAB Tech Lab initiative that helps ensure that your digital ad inventory is only sold through sellers (such as AdSense) who you’ve identified as authorized.

**How to fix Ads.txt issue?**

 1. create ads.txt in the root path of the NextJS project.

    touch ads.txt   // note the case of ads.txt file

2. [Sign in](http://www.google.com/adsense) to your AdSense account.

3. Click “Sites” on the sidebar

![](https://cdn-images-1.medium.com/max/2000/1*AnPZheEIj9uIY_icTvOCDA.png)

4. Select the site with the ‘Not found’ ads.txt status.

5. Here you can get the contents required for the “Ads.txt” file, copy and paste them into the file.

![](https://cdn-images-1.medium.com/max/3496/1*HkzoxoZjKm36xO34DXsORQ.png)

6. In the “ads.txt” file, we can add not only the Google AdSense details but also other Ad networks can also be added.

7. Upload your ads.txt file to the root directory of your site.

8. To verify that you published your file correctly, check that you successfully see your file’s content when you access the ads.txt URL (*https://example.com/ads.txt*) in your web browser. If you can see the file in your web browser, it’s likely that AdSense will successfully find it.

9. If you are already using Google Search Console, submit the path of “ads.txt” in the “URL Inspector” to expedite the crawling.

10. It would take at least 7 days for AdSense to crawl and verify the “ads.txt” file. In a few days, the site status would be updated like below

![](https://cdn-images-1.medium.com/max/4392/1*85DMS_tZ0V0ektJ0PORl4w.png)

You are all set! Happy Earning 💰💲

----

Visit [https://quizessforyou.com](https://quizessforyou.com) for programming quizzes.
Stuck in Tech
Tags: webdev, softwaredevelopment, programming, discuss
Published: 2023-07-29 20:44:55

## My Story:
I'm a student of Software Engineering (3rd year) and a self taught full stack developer recently when the time came to build projects i found myself stuck in building eCommerce app , blog website etc , _long story short_ I found web development boring ..
**How can I discover my passion?** 
I want to build cool stuff that actually helps people and solves there problem ..
what options do I have ?
ReQuest: Embracing the Future of Requirement Management
Tags: showdev, opensource, typescript, programming
Published: 2023-07-29 20:41:21

![ReQuest Logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxbeutsnkmy2xr3d5lik.png)

As students venturing into the world of software development, we often find ourselves faced with the challenge of managing requirements effectively. Existing tools in the market can be overwhelming and complex, making the learning process more arduous than it needs to be. But fear not, I have a solution – **ReQuest**!

## The Student-Centric Solution

**User-Friendly Interface**: ReQuest is designed with students in mind. I've streamlined the user interface to make it intuitive and straightforward, eliminating unnecessary complexities. No extensive training is required – simply jump in and get started!

**Engaging Gamification**: I know that motivation is crucial for success. That's why I've incorporated gamification elements into ReQuest. Earn trophies, create avatars, and tackle challenges as you manage your software requirements. Learning has never been this fun!

**Collaboration at Its Core**: Collaboration is key to growth and knowledge sharing. ReQuest facilitates real-time collaboration among students, enabling teamwork, feedback, and brainstorming. Together, we can create better software requirements!

**AI-Driven Insights**: ReQuest goes beyond basic requirement management. With intelligent AI integration, the platform provides valuable insights and recommendations based on proper prompting and industry best practices. Let AI be your guide to optimizing your software requirements.

## Empowering the Student Community

I understand the importance of open-source collaboration. That's why ReQuest is open-sourced! Join me on GitHub at https://github.com/carvalho28/ReQuest to contribute, customize, and shape the future of software requirements management.

## Embrace Simplicity, Empower Your Learning

ReQuest is here to bridge the gap between complex requirement tools and student developers. We want to empower you to excel in software development without unnecessary hurdles.

Ready to embrace simplicity and take control of your software requirements?  Let's come together as a community, where learning is enjoyable, collaboration is celebrated, and software development is made easier. 

Join me on this transformative journey with ReQuest, and let's embrace the future of requirement management together! 🚀