teleren/devto huggingface dataset:
Dispenso: high-performance concurrency, enabling highly parallel computation
Published: 2024-01-05 02:08:17

Dispenso, a library developed under the Facebook Incubator program, represents a significant advancement in the field of task parallelism for C++ programming. The library is designed for efficient execution of tasks in parallel, offering a range of features that facilitate high-performance concurrency. This makes it a powerful tool for highly parallel computation.

Key Features of Dispenso:
1. **Thread Pools and Task Sets**: Dispenso provides mechanisms for creating and managing thread pools and sets of tasks, enabling efficient parallel execution of work.
2. **Parallel Loops**: It includes parallel versions of `for_each` and `for_each_n` loops, as well as a `parallel_for` construct for efficient iteration over ranges in parallel.
3. **Futures and Pipelines**: The library offers a futures implementation for asynchronous programming and facilities for parallel pipelining of workloads.
4. **Concurrent Data Structures**: Dispenso includes concurrent versions of common data structures, such as vectors, and provides an object arena for fast allocation of objects of the same type.

Comparison with Other Libraries:
- **TBB (Threading Building Blocks)**: While there is significant overlap with TBB, Dispenso offers better integration with modern C++ standards and improved performance in some scenarios, especially for small and medium-sized loops.
- **OpenMP**: Dispenso generally outperforms OpenMP for medium and large workloads, although OpenMP has an edge in small loops due to direct compiler support.
- **Folly**: Another library from Meta, Folly lacks parallel loop constructs and task sets that Dispenso offers. Dispenso's futures are also faster and lighter-weight compared to Folly's for compute-bound applications.

When Not to Use Dispenso:
It's important to note that Dispenso is optimized for compute-bound tasks and might not be the best choice for scenarios involving high-latency task offload, such as networking or disk operations. In such cases, it may result in suboptimal performance.

Examples and Documentation:
Dispenso's documentation provides a variety of examples demonstrating its capabilities, such as how to use `parallel_for` for transforming sequential loops into parallel ones, how to manage task sets, and how to utilize futures for asynchronous operations.

In conclusion, Dispenso offers a robust set of tools for task parallelism in C++, making it a valuable resource for developers looking to leverage parallel computing in their applications. Its design for minimal dependencies and compatibility with modern C++ standards makes it a versatile choice for a wide range of projects.

For more detailed information and examples, you can visit the Dispenso documentation at [facebookincubator.github.io/dispenso](https://facebookincubator.github.io/dispenso/).
$1k Perday Review
Published: 2024-01-05 01:44:02

$1K PAYDAYS Review – Features

    We’ve Made $$$,$$$ In PROFIT In 30 Days…

    Five Minutes Setup…

    100% FREE TRAFFIC INCLUDED…

    Beta-Testers Made Money…

    Works GREAT For Beginners…

    We’re Earning Payments Of $997+…

    ZERO Experience or Skills Required…

    Fully Ethical & Legal…

    PLUS: Get Private Coaching If You Fail…
https://sites.google.com/view/kdijndn/
FIFA 23 TOTW 17 Abounding Bandage Released
Published: 2024-01-05 01:41:42


Cons:With Tele broadcast, you are added air-conditioned to [FC 24 Coins](https://www.mmoexp.com/Fc-24/Coins.html) atom breath players because you accepting a apprenticed adeptness of the pitch.You may accusation your anxiety added to achieve passes or accretion alone players.Your accurateness of the acreage is limited, so you may not calmly achieve decisions based on the all-embracing accretion structure.Pros:It is easier to aim in this accepting as the afterpiece adeptness can exhausted finishing accuracy.Passing, dribbling, and arrest feel added engaging.
Ideal for ashamed you are amphitheatre alone to enjoy/career accepting vs. AI

FIFA 23 Best Camera Settings: Co-Op
Co-op is the best acclimatized advantage amidst players ashamed amphitheatre with friends. You can see accidental lanes and complete affiliated passes added easily. Clashing added FIFA 23 camera settings like Tele broadcast, Address allows you to see added of the angle and achieve bigger acclimatized and in-game decisions.

BUY NOW:5% off FIFA 23 Believability at Blooming Man Gaming

For instance, you can see players that are added fatigued and areas of the angle across players are not tracking enough, and players that abstract themselves like wingers and changeabout affray to them faster and added efficiently.

If you are amphitheatre alone. Amphitheatre competitively. Watching a adventuresome as a spectator, the address adeptness is able ashamed amphitheatre with an audience.

How to Change Camera Settings in FIFA 23? Battery the gameGo to options calendar Go to Camera Now change the settings as you see fitFIFA 23 TOTW 17: Manchester City Midfielder Stars - VideoGamer.com

FIFA 23 TOTW 17 Abounding Bandage Released: Ashamed Does TOTW 17 Absolution in FIFA 23? What Time Does FIFA 23 TOTW 17 Release? FIFA 23 TOTW 17 Predictions:

We are now over bisected way through the assay and it shows no signs of slowing bottomward with the weekend alms affluence of abounding moments and games. PSG managed to accepting ashamed to able ways, accepting the advise anxiety of [cheap EA FC 24 Coins](https://www.mmoexp.com/Fc-24/Coins.html) a adventuresome they were circuitous in with Lille. Whilst Armory and Liverpool alternating to able assay too in the Able League.
How to install & enable OLED Color Scheme in Sublime Text
Published: 2024-01-05 01:20:03

Here's how to do the above:

1. [Install Package Control](https://packagecontrol.io/installation)
2. In Sublime Text, press `Ctrl` + `Shift` + `p` (or `Cmd` + `Shift` + `p` on macOS) to bring up the command palette
3. In the command palette, search for `install`
4. Highlight `Package Control: Install Package`
5. Press `Enter`
6. In the dialog that pops up, search for `oled color scheme`
7. Highlight the matching result
8. Press `Enter`. OLED Color Scheme is now installed! To enable it:
9. Go to `Preferences` -> `Select Color Scheme...`
10. Highlight `OLED Color Scheme`
11. Press `Enter`
Coaching and Self Development (feat. Dan Tudorache)
Published: 2024-01-05 01:17:05

In this podcast episode, Dan Tudorache at empacITy discusses game-based learning and its implementation in the tech industry. He shares insights on how game-based learning can be applied to software teams and how it can benefit different roles within an organization. Dan also explains how his coaching and gaming sessions are structured and the typical audience composition.

**Takeaways**

- Game-based learning is an effective approach to training and development in the tech industry.
- Game-based learning can be implemented to improve collaboration and problem-solving skills within software teams.
- Training sessions should be tailored to the specific needs and interests of different roles within an organization.
- Gaming sessions can be organized for groups of various sizes and should include participants from different departments and roles.

{% embed https://youtu.be/zCYbC4g_nWQ %}
{% embed https://youtu.be/hfJrOOoNMYc %}
Use ChatGPT to Get SQL Help For **Your** Database Schema
Tags: database, chatgpt
Published: 2024-01-05 01:01:58

---
title: Use ChatGPT to Get SQL Help For **Your** Database Schema
published: true
description: 
tags: database, chatgpt
---

ChatGPT offers almost magical help with coding questions. You can use it to get help with SQL questions, but then you have to adapt that SQL to match your database tables and schemas.

What if ChatGPT could act as an expert on your database, and give you valid SQL that would work for you? Guess what - with a little help from SchemaCrawler, it can. You can use SchemaCrawler to "teach" ChatGPT what your database schema looks like.

SchemaCrawler is a relational database exploration tool. It obtains database schema metadata such as tables, stored procedures, foreign keys, triggers and so on. SchemaCrawler can output this information in a compact format that ChatGPT can consume. Once you have provided this information to ChatGPT, you can ask ChatGPT to generate SQL for you, and more. ChatGPT can even summarize the purpose of your database, tell you the function of each table.

You can try prompts such as the following ones:

- "Get me the SQL statement to find all the tracks and their artists' names"
- "Get me the SQL statement to find the number of tracks for each artist, for artists that have more than 25 tracks, sorted by those who have the most"
- "List all tables"
- "Describe the Tracks table, with its columns and foreign keys"
- "What is the purpose or function of this database?"

To generate the database schema information, you will need Docker installed. Download a SQLite database called ["chinook-database-2.0.1.sqlite"](https://github.com/schemacrawler/chinook-database/releases/download/v16.11.7/chinook-database-2.0.1.sqlite) into your current directory.

Run this command:

```sh
docker run \
--mount type=bind,source="${PWD}",target=/home/schcrwlr \
--rm -it \
schemacrawler/schemacrawler \
/opt/schemacrawler/bin/schemacrawler.sh \
--server=sqlite \
--database=chinook-database-2.0.1.sqlite \
--info-level=standard \
--command=serialize \
--output-format=compact_json \
--output-file=schema.json
```

(If you are using PowerShell on Windows, replace the trailing backslash on each line with a back-tick, and map the current directory differently.)

Fire up ChatGPT in your browser (even the free one will do if you do not have a subscription). At the prompt, paste in the contents of your "schema.json" file. Then you can try out the prompts (questions) above. Enjoy exploring your database!

After you have got this working, use the SchemaCrawler command-line to connect to your own database, and explore it using a natural language interface courtesy of ChatGPT.
What I am doing?
Published: 2024-01-05 00:15:59

## The fck. PHP Framework for Freestylers

This fck. framework (bruh!) build with of course PHP "duh" with [TaildwinCSS](https://tailwindcss.com/) and [DaisyUI](https://daisyui.com/). If you don't want to? Just get the fck. off or broke everything.

### Mad & Angry

This framework is crafted upon the foundation of anger and ego that tumultuously reside within the soul of an idealistic and somewhat disheveled individual.

### Messy & Un-aesthetic

Constructed without a plan, it flows like turbid water in a polluted river, meandering towards the vast ocean.

### (Don't) Frequently Asked Questions
_Questions that should not be raised in this project._

_How to Getting Started with This Framework?_
> As you know, fck. PHP Framework does not have documentation similar to other frameworks, as it is purely a work of art from the most messy point of view. Is there anything chaotic that actually complies with the guidelines? Honestly, no!

_Can I Ask Any Question in GitHub Issues?_
> Hmm… have you carefully read the answer to the question on the above of this question you are currently reading? However, it is possible if you have the time and have a concrete (even if not spectacular) idea; feel free to continue. Otherwise, it will be a waste!

_If Any Other Question?_
> Enough, no need! I'm not one to devote all my time here. If you are looking for an interactive and conducive community, this is not the place. Stop it, and don't ask any further!

This framework Build with 😡 Software Freestyle Engineer to Freestylers

### Don't Open This Repository!
{% github https://github.com/darkterminal/fck %}
React component for wavesurfer.js
Tags: audio
Published: 2024-01-08 07:32:09

---
title: React component for wavesurfer.js
published: true
date: 2024-01-05 00:13:00 UTC
tags: Audio
canonical_url: https://reactjsexample.com/react-component-for-wavesurfer-js/
---

# @wavesurfer/react
 ![React component for wavesurfer.js](https://reactjsexample.com/content/images/2023/12/Code_2023-12_11-08-00.jpg)

A React component for [wavesurfer.js](http://github.com/katspaugh/wavesurfer.js).

It makes it easy to use wavesurfer from React. All of the familiar [wavesurfer options](https://wavesurfer.xyz/docs/types/wavesurfer.WaveSurferOptions) become React props.

You can subscribe to various [wavesurfer events](https://wavesurfer.xyz/docs/types/wavesurfer.WaveSurferEvents) also via props. Just prepend an event name with on, e.g. ready -> onReady. Each event receives a wavesurfer instance as the first argument.

## Installation

With yarn:

```
yarn add @wavesurfer/react
```

With npm:

```
npm install @wavesurfer/react
```

## Usage

As a component:

```
import WavesurferPlayer from '@wavesurfer/react'

const App = () => {
  const [wavesurfer, setWavesurfer] = useState(null)
  const [isPlaying, setIsPlaying] = useState(false)

  const onReady = (ws) => {
    setWavesurfer(ws)
    setIsPlaying(false)
  }

  const onPlayPause = () => {
    wavesurfer && wavesurfer.playPause()
  }

  return (
    <>
      <WavesurferPlayer
        height={100}
        waveColor="violet"
        url="/my-server/audio.wav"
        onReady={onReady}
        onPlay={() => setIsPlaying(true)}
        onPause={() => setIsPlaying(false)}
      />

      <button onClick={onPlayPause}>
        {isPlaying ? 'Pause' : 'Play'}
      </button>
    </>
  )
}
```

Alternatively, as a hook:

```
import { useRef } from 'react'
import { useWavesurfer } from '@wavesurfer/react'

const App = () => {
  const containerRef = useRef()

  const { wavesurfer, isReady, isPlaying, currentTime } = useWavesurfer({
    container: containerRef,
    url: '/my-server/audio.ogg',
    waveColor: 'purple',
    height: 100',
  })

  const onPlayPause = () => {
    wavesurfer && wavesurfer.playPause()
  }

  return (
    <>
      <div ref={containerRef} />

     <button onClick={onPlayPause}>
       {isPlaying ? 'Pause' : 'Play'}
     </button>
    </>
  )
}
```

## Docs

[https://wavesurfer.xyz](https://wavesurfer.xyz)

## GitHub

[View Github](https://github.com/katspaugh/wavesurfer-react?ref=reactjsexample.com)
A UI library for React projects that allows users to choose a value through scrolling
Tags: scroll
Published: 2024-01-08 07:31:57

---
title: A UI library for React projects that allows users to choose a value through scrolling
published: true
date: 2024-01-05 00:09:00 UTC
tags: Scroll
canonical_url: https://reactjsexample.com/a-ui-library-for-react-projects-that-allows-users-to-choose-a-value-through-scrolling/
---

# React-Hook-Scroll · 
 ![A UI library for React projects that allows users to choose a value through scrolling](https://reactjsexample.com/content/images/2023/12/Code_2023-12_11-04-28.jpg)

React-Hook-Scroll is a UI library for React projects that allows users to choose a value through scrolling. It is designed to be compatible with both desktop and mobile environments.

### Install

```
npm i react-hook-scroll
```

### Example

```
import { useState } from "react";
import { VirtualScroll } from "react-hook-scroll";

function App() {
  const [selected, setSelected] = useState(null);

  return (
    <div className="App">
      <VirtualScroll list={[1, 2, 3, 4, 5]} onItemSelected={setSelected} />
    </div>
  );
}
```

![A UI library for React projects that allows users to choose a value through scrolling](https://private-user-images.githubusercontent.com/71740032/293127128-8da48170-0516-4f49-bff8-f23d5fbf8d70.gif?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDM5OTIxNDksIm5iZiI6MTcwMzk5MTg0OSwicGF0aCI6Ii83MTc0MDAzMi8yOTMxMjcxMjgtOGRhNDgxNzAtMDUxNi00ZjQ5LWJmZjgtZjIzZDVmYmY4ZDcwLmdpZj9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyMzEyMzElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjMxMjMxVDAzMDQwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNjMjE4ODlkNGE3YjI5MjAzZGJjMjhhMjNkY2U1YmVmMDU3YmI4MzZjM2E5ODQzMTI2NWIzMjY4Yzk0MzkyNGMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.FiJs_v5IkEn8aN7G-RU2jvD3fT7p0kIoeWNjm3U6LtI)

The VirtualScroll component requires two required profiles.

- list: need a list to let the user choose.
- onItemSelected: The action to be taken with the item selected by the user is required.

### Contributing

Development happens in the open on GitHub and we are grateful for contributions including bug fixes, improvements, and ideas.

### License

React-Hook-Scroll is [MIT licensed](https://github.com/imb96/react-hook-scroll/blob/main/LICENSE).

## GitHub

[View Github](https://github.com/imb96/react-hook-scroll?ref=reactjsexample.com)
How Has a DEV Friendship Enriched Your Experience?
Published: 2024-01-05 00:00:00

---
published_at : 2024-01-05 00:00 +0000
---
Share a meaningful connection or friendship you formed within the DEV community. How has this connection enriched your overall DEV experience?
<br>
Follow the DEVteam for more discussions and online camaraderie!
{% embed https://dev.to/devteam %}
Software Architecture: Influential Development Patterns?
Published: 2024-01-05 00:00:00

---
published_at : 2024-01-05 00:00 +0000
---
Discuss the most common software architecture patterns you've encountered in your projects. How have they influenced your approach to software development?
<br>
Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
limits for ease of writing interactive stories
Tags: gamedev, writing
Published: 2024-02-25 21:27:25

---
title: limits for ease of writing interactive stories
published: true
date: 2024-01-05 00:00:00 UTC
tags: [ 'gamedev', 'writing' ]
canonical_url: https://onwriting.games/daily/20240105-2210-limits-for-ease-of-writing-interactive-stories/
---

Another strategy to [tame the rhizome](https://dev.to/onwritinggames/taming-the-rhizome-4jcp) is to define limits.

We all want our games to be deep, and to give the player the ability to do whatever they want.

Perhaps soon we will be able to do this with LLMs, but for now the results are not so good.

For now, we have to accept that our ability to create variety is limited.

Defining the limits of variety from the beginning can help us write better stories.

- How long do we want the story to last?
- How many words should it have?
- How many possible arcs will each player character have?
  - And the NPCs?
- How many locations does our game have?
  - In how many ways can they be modified based on the player's choices?
- How many main or secondary conflicts will be addressed?

In turn, to prevent our games from getting out of control, I suggest minimizing all these numbers, setting low limits.

We can create a version with these minimized quantities, and only when the game fails, we can try to increase them.

For me, defining the limits even helps me maintain momentum and not lose motivation so much.

Thinking about writing a 200,000-word game is overwhelming, but knowing the main limits helps to tackle the necessary work.
Optimized Dockerfile for Rust
Tags: docker, rust, debian
Published: 2024-01-06 00:26:35

---
title: Optimized Dockerfile for Rust
published: true
date: 2024-01-05 00:00:00 UTC
tags: docker, rust, debian
canonical_url: https://justin.poehnelt.com/posts/rust-optimized-docker-file/
---

Below is a simple Dockerfile for a Rust project. It uses a multi-stage build to first build the project and then copy the binary into a new image. This is a common pattern for compiled languages.

The first stage is named `builder`. It caches the dependencies with a dummy `src/main.rs` file. This allows the dependencies to be cached and reused when the source code changes.

```docker
# Build dependencies
COPY Cargo.toml Cargo.lock ./
RUN mkdir ./src && echo 'fn main() {}' > ./src/main.rs
RUN cargo build --release
```

The `main.rs` file is then deleted and the real source code is copied in. This forces the build to recompile the source code, but not the dependencies.

```docker
# Replace with real src
RUN rm -rf ./src
COPY ./src ./src
# break the Cargo cache
RUN touch ./src/main.rs
# Build the project
RUN cargo build --release
```

The `run` stage uses the `debian:bookworm-slim` image which is a minimal Debian image. The `bookworm` tag is the codename for the next Debian release. The `-slim` tag is a minimal version of the image.

```docker
# Run stage
FROM debian:bookworm-slim as run
RUN apt-get update && apt install -y openssl && rm -rf /var/lib/apt/lists/* && apt-get clean
COPY --from=builder /usr/src/app/target/release/app /usr/local/bin
ENTRYPOINT ["/usr/local/bin/app"]
```

The full Dockerfile is below.

```docker
# Build stage
FROM rust:bookworm as builder
WORKDIR /usr/src/app
# Build dependencies
COPY Cargo.toml Cargo.lock ./
RUN mkdir ./src && echo 'fn main() {}' > ./src/main.rs
RUN cargo build --release
# Replace with real src
RUN rm -rf ./src
COPY ./src ./src
# break the Cargo cache
RUN touch ./src/main.rs
# Build the project
RUN cargo build --release
# Run stage
FROM debian:bookworm-slim as run
RUN apt-get update && apt install -y openssl && rm -rf /var/lib/apt/lists/* && apt-get clean
COPY --from=builder /usr/src/app/target/release/app /usr/local/bin
ENTRYPOINT ["/usr/local/bin/app"]
```
OpenCV 的 waitKey() 與 0xFF
Tags: opencv, python
Published: 2022-10-06 13:34:16

使用過 OpenCV 的人想必都寫過類似以下的程式：

```python
>>> cap = cv2.VideoCapture(0)
>>>
>>> while True:
...     ret, f = cap.read()
...     cv2.imshow('hello', f)
...     k = cv2.waitKey(1) & 0xFF
...     print(k)
...     if k == ord('q'):
...         break
```

大部分的教學都告訴你要在叫用 [`waitKey()`](https://docs.OpenCV.org/4.x/d7/dfc/group__highgui.html#ga5628525ad33f52eab17feebcfba38bd7) 後與 0xFF 做 `&` 運算, 把高位元內容清掉, 只留下最低一個位元組的按鍵碼。這是因為過去 `waitKey()` 傳回值中除了最低位元組的 ASCII 碼以外, 在高位元可能會包含有像是 <kbd>Ctrl</kbd> 等其他按鍵的旗標, 因此必須將高位元清除。不過在 [OpenCV 3.2](https://github.com/opencv/opencv/commit/4e7b5214387e74b8df1c847d64b68e4bb3876d91) 之後, `waitKey()` 預設就會幫你清除高位元資料, 只留下最低一個位元組, 這可從[原始碼](https://github.com/OpenCV/OpenCV/blob/b77330bafc497ddf65074783c0e3fb989604b555/modules/highgui/src/window.cpp#L666)中看到：

```c++
int cv::waitKey(int delay)
{
    CV_TRACE_FUNCTION();
    int code = waitKeyEx(delay);
#ifndef WINRT
    static int use_legacy = -1;
    if (use_legacy < 0)
    {
        use_legacy = getenv("OpenCV_LEGACY_WAITKEY") != NULL ? 1 : 0;
    }
    if (use_legacy > 0)
        return code;
#endif
    return (code != -1) ? (code & 0xff) : -1;
}
```

所以其實現在叫用 `waitKey()` 已經不需要將傳回值與 0xFF 做 & 運算了。如果你還是想要原本的 `waitKey()`, 可以改用在原始碼裡面看到的 [`waitKeyEx()`](https://docs.OpenCV.org/4.x/d7/dfc/group__highgui.html#gafa15c0501e0ddd90918f17aa071d3dd0), 它傳回的就是沒有經過 `&` 運算的值。