teleren/devto huggingface dataset:
Kotlin Coroutines for Asynchronous Programming
Tags: kotlin, mobile, beginners, programming
Published: 2024-01-27 00:29:11

## Introduction

Asynchronous programming has become increasingly important in the world of software development, as applications continue to become more complex and require multiple tasks to be performed simultaneously. Kotlin, a popular programming language, has introduced a new way of handling asynchronous operations called coroutines. In this article, we will explore the advantages, disadvantages, and features of Kotlin coroutines.

## Advantages

1. **Simplicity**: Kotlin coroutines provide a simpler and more intuitive approach to asynchronous programming compared to traditional methods such as callbacks and threads.

2. **Efficient resource usage**: Unlike threads, coroutines are lightweight, which means they consume fewer system resources, resulting in faster and more efficient code.

3. **Sequential code**: Coroutines allow developers to write code sequentially, making it easier to read and maintain compared to nested callbacks.

## Disadvantages

1. **Learning curve**: Kotlin coroutines require some learning and understanding, which may be daunting for beginners or developers with no prior experience with asynchronous programming.

2. **Limitations**: Coroutines are not suited for all kinds of asynchronous operations, and certain scenarios may still require the use of traditional methods.

## Features

1. **Suspend functions**: Coroutines use suspend functions, which can be paused at any time and resumed later without blocking the main thread.

2. **Coroutine scope and context**: These features of Kotlin coroutines allow developers to specify which thread the coroutine should run on, enabling better control over concurrency.

### Example Code Snippet

```kotlin
import kotlinx.coroutines.*

fun main() = runBlocking { // this: CoroutineScope
    launch { 
        // launch a new coroutine and continue
        delay(1000L) // non-blocking delay for 1 second (default time unit is ms)
        println("World!") // print after delay
    }
    println("Hello,") // main coroutine continues while a previous one is delayed
}
```

This code snippet demonstrates the basic use of Kotlin coroutines with **runBlocking**, **launch**, and **delay** functions to perform asynchronous operations without blocking the main thread.

## Conclusion

Kotlin coroutines bring significant improvements to asynchronous programming and offer a more concise and efficient way of handling concurrent tasks. Although they may have a slight learning curve, coroutines provide many advantages and are a valuable addition to the Kotlin language. Asynchronous programming is becoming increasingly crucial, and coroutines are a fantastic tool to have in any developer's arsenal.
Best Scammed Bitcoin Recovering Crypto From Scammer
Tags: cryptocurrency, recovery, firm
Published: 2024-01-27 00:15:54

I pen this account today, aiming to alert those who may have fallen victim to the same fraudulent platform, “STOCKAXEL,” or any other counterfeit platforms, that TECHNOCRATE RECOVERY stands as the solitary dependable recourse to extricate oneself from the labyrinth of financial chaos. Trust me, for I have experienced such adversity and triumphed, not solely through personal efforts but with their invaluable support.

COMPANY INFORMATIONS:
(https://Www.technocraterec overy.site) (Technocratrecovery@contractor.net)
How to make a basic Roblox Studio GUI Play Button.
Tags: robloxstudio, beginners
Published: 2024-01-27 00:09:55


Step 1 - Insert a ScreenGui inside of StarterGui.

Step 2 - Insert a Frame inside of the ScreenGui.

Step 3 - Insert a TextButton inside of the frame.

Step 4 - Insert a script inside of the TextButton

Step 5 - Put this code in the script - 

```
local btn = script. Parent --The TextButton
local frame = btn.Parent

btn.MouseButton1Click:Connect(function()
  frame.Visible = false -- sets Frame and TextButton invisible
end)
```
What Leadership Lessons Beyond Books Impact You?
Tags: discuss
Published: 2024-01-27 00:00:00

---
published_at : 2024-01-27 00:00 +0000
---
What valuable leadership insights have you gained outside of traditional management books, and how have they shaped your approach to effective leadership?
Follow the DEVteam for more discussions and online camaraderie!
{% embed https://dev.to/devteam %}
gitignore - inclusive or exclusive?
Published: 2024-02-03 08:04:37

---
title: gitignore - inclusive or exclusive?
published: true
date: 2024-01-27 00:00:00 UTC
tags: 
canonical_url: https://www.oliverdavies.uk/archive/2024/01/27/gitignore-inclusive-or-exclusive
---

Add everything and ignore what you don't want, or ignore everything and explicitly add what you need.

There are two ways to structure a .gitignore file.

The default approach is that all files can be added, and you specify the files and directories you want to ignore.

For example, if my `.gitignore` file was this, these two directories would be ignored:

```
vendor
web

```

The other approach is to ignore everything and unignore the things to add. For example:

```
*
!build.yaml
!Dockerfile
!docker-compose.yaml
!web/*/custom

```

Both approaches work and are regularly used.

Which approach do you prefer and why?

Reply and let me know.

 P.S. Are you still using Drupal 7 and don’t know what’s involved to upgrade to Drupal 10? [Book a Drupal 7 upgrade consultation call](https://www.oliverdavies.uk/call) or [an upgrade roadmap](https://www.oliverdavies.uk/drupal-upgrade).
Science is fun
Published: 2024-01-20 15:58:34

The Earth, despite rotating on its axis at a speed of 1000 miles per hour, surprisingly moves forward at a velocity of approximately 67,000 miles per hour. 

Earth experiences over 100,000 earthquakes annually, but most are brief and go unnoticed. Lightning strikes the Earth about 100 times per second, causing approximately 1000 fatalities annually on average.

The DNA was first discovered in 1869 by Swiss scientist Friedrich Miescher. Galileo discovered the thermometer in 1607 for measuring fever. In 1250, Roger Bacon discovered spectacles. Alfred Nobel invented dynamite in 1866.

The first Nobel Prize was awarded to Wilhelm Roentgen in 1895 for the discovery of X-rays (Physics). The tallest tree known is an Australian Eucalyptus, reaching a height of around 435 feet. Electric eels can produce shocks of approximately 650 volts.

In 1962, the Telstar communication satellite successfully transmitted the first telephone and television signals. Giraffes sleep for only about 20 minutes within a 24-hour period, occasionally extending to 2 hours, which is rare. It takes about 60 seconds for a red blood cell to circulate throughout the entire body.

One rubber molecule contains around 65,000 atoms. A male body produces approximately 1000 sperm cells per second, totaling around 86 million in a day.read more http://tinyurl.com/2ycm3e93
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/1h5ncfx8uu66tmid8h6l.jpeg)
Harnessing the Power of Article Extractor APIs: A Deep Dive into Modern Content Curation
Tags: articleextractorapi, webscraping, dataanalysis, contentcuration
Published: 2024-01-26 23:58:03


In today's digital era, where content is king, the ability to efficiently extract and analyze web-based articles is more crucial than ever. Enter the world of **Article Extractor APIs**, a game-changing technology that is reshaping the landscape of online content curation and data analysis.

**What Are Article Extractor APIs?**
Article Extractor APIs are advanced tools designed to automate the process of fetching and extracting articles from various web pages. They leverage cutting-edge technologies like web scraping and natural language processing (NLP) to ensure the content is not only extracted but also contextually relevant and accurate.

**Why Are They a Game-Changer?**
These APIs are revolutionizing several industries by providing a swift and precise method of content aggregation. Whether it's for digital marketing, market research, or academic purposes, Article Extractor APIs offer a plethora of benefits including enhanced efficiency, accuracy, and scalability.

**The Evolution and Future Trends**
From their humble beginnings to now being powered by machine learning and AI, Article Extractor APIs have come a long way. This article takes you through their journey, the challenges faced, and the exciting future trends in article extraction technology.

**Real-World Applications and Success Stories**
Discover how various sectors are implementing these APIs to transform their operations. From digital marketing agencies increasing content production efficiency to academic researchers streamlining their study processes, the impact is profound and widespread.

**Navigating Challenges and Limitations**
While these APIs are powerful, they come with their own set of challenges. The article discusses potential drawbacks like website layout changes and legal considerations, and how to effectively overcome them.

**FAQs Demystified**
Got questions? We've got answers! The article addresses common queries and misconceptions about Article Extractor APIs, providing clarity and insights.

Dive into the full article to explore how **Article Extractor APIs** are becoming an indispensable tool in the digital world. Whether you're a tech enthusiast, a digital marketer, or someone curious about the latest in tech innovation, this piece offers valuable insights into a technology that's transforming the way we handle online information.

🔗[ Read the full article here](https://codewithnazam.com/unlocking-content-with-ease-the-top-article-extractor-apis-of-2024/)
The Power of Nullish Coalescing and Optional Chaining in JavaScript
Published: 2024-01-26 23:52:43

The Nullish Coalescing Operator (??) is a relatively recent addition to JavaScript (introduced in ECMAScript 2020). Unlike the logical OR operator (||), which evaluates to the right-hand side if the left-hand side is falsy (including undefined and null), the nullish coalescing operator only considers null or undefined as falsy.
```js
// Using ?? to provide a default value
const username = userInput ?? 'Guest';
```

In the above example, `username` is assigned the value of `userInput` if it's not null or undefined. Otherwise, it defaults to 'Guest'.

**Optional Chaining and Nullish Coalescing**
Now, let's combine the Nullish Coalescing Operator with Optional Chaining to navigate through nested properties safely.
```js
// Data from API
const userData = {
  id: 1,
  username: 'devmatsu',
  shippingInfo: {
    address: {
      city: 'São Paulo',
      country: 'Brazil'
    }
  }
};

// Using Optional Chaining and ?? to access and provide default values
const userCity = userData?.shippingInfo?.address?.city ?? 'Unknown City';
const userPostalCode = userData?.shippingInfo?.address?.postalCode ?? 'No Postal Code';

console.log(userCity);         // 'São Paulo'
console.log(userPostalCode);   // 'No Postal Code'
```

In this example, if any of the nested properties is `null` or `undefined`, the nullish coalescing operator steps in to provide default values.

**Creating Robust Code with the Duo**
Combining Optional Chaining and the Nullish Coalescing Operator empowers you to write more robust and concise code. This duo ensures that your application gracefully handles undefined or null values, offering default values when needed.
```js
const userDetails = apiResponse?.userDetails ?? getDefaultUserDetails();
```
In this scenario, `getDefaultUserDetails()` is called only if `apiResponse?.userDetails` is `null` or `undefined`.

Whether you're fetching data from APIs or dealing with user inputs, the Nullish Coalescing Operator and Optional Chaining allow you to sail through JavaScript seas with confidence. Embrace these modern JavaScript features to enhance the reliability and readability of your code.

**Console You Later!**
Writing a SSG in Go
Tags: go, ssg, html
Published: 2024-01-26 23:50:37

---
title: Writing a SSG in Go
published: true 
description: Created a simple static site generator in Go
tags: Go,SSG,HTML
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-01-26 23:20 +0000
---

## Overview

Ever since I read this article [Writing a Static Blog Generator in Go](https://www.zupzup.org/static-blog-generator-go/index.html) by [@zupzup](https://github.com/zupzup) a few years ago, I've been wanting to do the same. 

After not doing it for a few years just like a lot of things in my life rn, I finally gave it a try.

## What I Created

Here is the core package(SSG)

{% embed https://github.com/K-Sato1995/go-simple-ssg %}

and here is a static site I created using the ssg.

https://go-simple-ssg.vercel.app

## Structure

The core package mainly consists of two parts

- Generator: Generate static files based on Markdown and Templates(HTML) files.
- CLI: Allows anyone to bootstrap a project.


The core packages looks like this

```
./
├── parser/ (Part that parses Markdown into HTML)
│ ├── mdToHTML.go
│ └── parseMetaData.go
├── builder/ (Part that generates static files based on the given md and templates)
│ ├── bundleCss.go
│ ├── copyStaticFiles.go
│ ├── generateDetail.go
│ └── generateList.go
├── simple-ssg-cli/ (CLI that allows anyone to bootstrap a project)
├─ example/
├── config/ (Part that makes the project custamizable for users)
└── engine.go 
```


To use it, install the `simple-ssg-cli` and execute the `init` command.


```
$ go install github.com/K-Sato1995/go-simple-ssg/simple-ssg-cli@latest
$ simple-ssg-cli init
```

Doing this will create a new project with the following structure:

```
./
├── contents/ (Stores markdown files)
├── templates/ (Stores template html files and style files)
├── generated/ (Stores generated files)
├── go.mod
├── go.sum
└── main.go
```


Lastly, move to the newly created project and run it to build static contents and stuff.

```
$ cd your_project && go run main.go
```


## Random Thoughts

Doing this made me appreciate existing SSGs like [Hugo](https://gohugo.io/) and [Next.js](https://nextjs.org/) even more👏👏

## Cool existing SSGs written in Go

- [Hugo](https://gohugo.io/)
- [zupzup/blog-generator](https://github.com/zupzup/blog-generator)
- [plentico/plenti](https://github.com/plentico/plenti)
- [darccio/zas](https://github.com/darccio/zas)
- [zserge/zs](https://github.com/zserge/zs)
How to make a button open a different page when clicked in html.
Tags: html, howto
Published: 2024-01-26 23:48:12

step 1 - * Open up your coding software.
step 2 - Create a new html file.
step 3 - Put in the following code below - 
```
<html>
   <body>
      <a href="Your_Link_Here" <!-- make sure to put https:/ -->
         <button>Your Text Here</button>
      </a>
   </body>
</html>
```
What a Character
Tags: unicode, international
Published: 2024-01-26 23:46:59

---
title: What a Character
published: true
description: Comprehensive programmer's guide to handling international text in code, with an introduction to Unicode
tags: Unicode, international
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2024-01-26 23:44 +0000
---

I've developed a comprehensive programmer's guide for managing international text in code. It features detailed examples in Java, JavaScript, and Python, with each slide offering easily digestible information. The ["What a Character"](https://github.com/sualeh/What-a-Character) guide begins with a thorough introduction to character representation concepts and Unicode. Following that are practical code demonstrations covering international text handling using regular expressions, case conversion, and numeric data extraction. Additionally, there's a section dedicated to encoding with UTF-8 and UTF-16, including detailed bit-level insights for those interested. Whether you prefer reading or watching, there's even a video presentation available for your convenience.

On GitHub, [sualeh/What-a-Character](https://github.com/sualeh/What-a-Character)

I would love to have your comments!
React Native Stocks App Tutorial
Published: 2024-01-26 23:35:49

{% embed https://www.youtube.com/watch?v=VWqGHUKh3bo %}

## The Project
This project goes through the basics of creating and styling components in React Native. You will learn how to take JSON data and turn that into something meaningful and pretty for your users.

## What You'll Implement/Learn

- React Native Gesture Handler
- Images
- FlatLists
- FlexBox
- React Native Gifted Charts
- Expo Router
- Expo
- Expo Image

and the list goes on.

This project uses version 50 of Expo, so in the future things may look different.

Documentation:
- React Native Paper: https://callstack.github.io/react-native-paper/docs/guides/getting-started
- React Native Paper Theming: https://callstack.github.io/react-native-paper/docs/guides/theming
- Gestures: https://docs.expo.dev/tutorial/gestures/
- React Native Gifted Charts: https://gifted-charts.web.app/
- Async Storage: https://react-native-async-storage.github.io/async-storage/docs/install
- Expo: https://docs.expo.dev/get-started/installation/
- Expo Icons: https://icons.expo.fyi/Index
- Data: https://revesta.net
Como montar um disco de Swap no Ubuntu
Tags: ubuntu, linux, tutorial, aws
Published: 2024-01-26 22:50:21

Se você se encontra em uma instância com recursos de memória limitados, mas deseja melhorar o desempenho, este tutorial é para você.Adicionar um disco de swap pode ser a solução ideal para otimizar o uso da memória.

**Montando uma Partição Swap em um Disco:**

1.Atualize o sistema para garantir que você tenha as versões mais recentes dos pacotes:

   ```bash
   sudo apt-get update && sudo apt-get upgrade -yqq
   ```

2.Configure o fuso horário para garantir registros de tempo precisos:

   ```bash
   sudo timedatectl set-timezone America/Sao_Paulo
   ```

3.Liste os discos disponíveis para identificar o disco desejado:

   ```bash
   lsblk
   ```

4.Crie uma partição Swap no disco desejado (substitua `/dev/nvme1n1` pelo nome do seu disco):

   ```bash
   sudo mkswap /dev/nvme1n1
   ```

5.Abra o arquivo `/etc/fstab` para configurar a montagem automática da Swap no sistema:

   ```bash
   sudo nano /etc/fstab
   ```

   Adicione a seguinte linha ao final do arquivo:

   ```bash
   UUID=<UUID_do_disco>     swap swap defaults 0 0
   ```

6.Ative a partição Swap:

   ```bash
   sudo swapon /dev/nvme1n1
   ```

7.Para confirmar se o Swap está ativo, digite o seguinte comando:

   ```bash
   free -m
   ```
react switsh view
Published: 2024-01-26 22:42:36

  const [view, setView] = useState('productList')

  const switchView = (option) => {
    setView(option)
    setSelectedProduct(null) // Reset selectedProduct when switching views
  }

{view === 'productList' && <ProductsList addToCart={addToCart} />}
      {view === 'cart' && <CartList cartItems={cartItems} removeFromCart={removeFromCart} total={0} checkout={checkout} />}
      {view === 'productDetails' && selectedProduct && <ProductDetails product={selectedProduct} addToCart={addToCart} />}
Day 903 : The List
Tags: hiphop, code, coding, lifelongdev
Published: 2024-01-26 22:28:59

_liner notes_:
- Professional : Really productive day. Created separate demos to showcase the different Web Components. Did a quick pull request review. Had some conversations on some features coming later. Followed up on some community questions. Spoke with some folks about an upcoming conference. Pretty full day. Went by quick! Feeling good going into the weekend!

- Personal : I put together the tracks for the radio show. I even got the social media accounts for the playlist together. For the quick proof of concept that I'm going to build, I created a project in an online IDE. It took a second to get things in place, but I got it working. Cool thing is that I can use it as a template for the next time. I want to see if I can get this project deployed only using online resources without needing to do anything locally on my machine. Also watched an episode of "Rurouni Kenshin" to end the night.

![﻿This is a scenic view of the Great Bear Rainforest in British Columbia, Canada. The image shows a body of water surrounded by several small islands. The water is a deep blue color and the islands are covered in lush green trees. The sky is a light blue color and there are some clouds in the distance.﻿](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xshfzgd9gs7ucnbe7r8v.jpg)

Going to put the tracks on the audio player for the radio show tomorrow. Just checked and there's a basketball game, so I don't need to go into the station. I can spend that time working on this proof of concept. I drew up the list and made a game plan of some of the tech I'll be using. I think it gave me an idea to kind of shift some functionality to use something I already have signed up for, so I think that'll possibly save me some money cause I'm already paying for it. This will also be an opportunity to try some new stuff I've been meaning to use. Going to do some quick layout mockups and start trying to put things together. Maybe I'll have something to show on the study sessions. Since the radio show in online only this week, I'll probably stay up late and then watch an episode of "Rurouni Kenshin".

Saturdays: https://kNOwBETTERHIPHOP.com
Sundays: https://untilit.works

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube n7DSAwki16M %}
Trying to update my self
Tags: webdev, beginners, programming, productivity
Published: 2024-01-26 22:28:03

As i have mentioned before I am just a beginner and I am from developing countries so today I am very excited to join this as we don't have any access to international credit cards to attend premium courses. I would like to participate your help in advance for your help in advance for giving me such a great chance to interact with this community to fill up my dream of software developer by following the ideas generated from you and references I get. Last but not list please I want to get step by step methods now I finished html and css tutorial on w3school.and from this little tutorial I gained from w3schools I want to design my personal blog website what do you advise me to do thanks 🙏 again.