teleren/devto huggingface dataset:
How to write an effective solution design?
Tags: architecture, beginners, programming
Published: 2023-04-17 01:24:25

In today’s rapidly evolving technological landscape, businesses must create effective solution designs to remain competitive.

Writing a proper solution design involves several key steps to ensure that the solution meets the requirements of the problem, is feasible to implement, and is effective in solving the problem. Here are some steps to follow when creating a solution design:

**Define the problem**: Start by clearly defining the problem you are trying to solve. This should include the scope of the problem, the objectives you want to achieve, and the constraints that you need to work within.

**Analyze the requirements**: Once you have defined the problem, analyze the requirements that the solution must meet. These requirements should be specific, measurable, achievable, relevant, and time-bound (SMART).

**Identify potential solutions**: Brainstorm potential solutions that could meet the requirements. Consider the pros and cons of each solution and evaluate how well it meets the requirements.

**Choose a solution**: Based on your analysis, choose the solution that best meets the requirements. Be sure to consider factors such as feasibility, cost, and resource availability when making your decision.

**Define the solution**: Once you have chosen a solution, define it in detail. This should include a description of the solution, the technologies or tools that will be used, the processes involved, and any necessary documentation.

**Create a design document**: Create a design document that outlines the solution in detail. This document should include a description of the problem, the requirements, the chosen solution, and the design of the solution. Be sure to include diagrams, flowcharts, and other visual aids to help clarify the design.

**Test the solution**: Before implementing the solution, test it thoroughly to ensure that it meets the requirements and works as expected. This may involve creating prototypes, running simulations, or conducting user testing.

**Implement the solution**: Once you are satisfied that the solution works as expected, implement it. This may involve installing software, configuring systems, or deploying hardware.

**Monitor and maintain the solution**: Finally, monitor the solution to ensure that it continues to work effectively. This may involve tracking performance metrics, conducting user surveys, or performing regular maintenance and updates.


By following these steps, you can create an effective solution design that effectively solves the problem at hand.
To Copy or Not to Copy: Understanding Shallow and Deep Copying in Code
Tags: objectorientedprogrammin, cpp, programming, coding
Published: 2023-04-17 01:00:54

Shallow Copy:-

A shallow copy in C++ is a copy that creates a new object and copies the member variables' addresses of the original object to the new object.

However, the memory locations pointed to by the pointers in the new object are not copied, but rather their addresses are simply copied. This means that both the original object and the new object will point to the same memory locations, which can lead to unintended consequences if changes are made to the shared data.

A shallow copy can be made by simply copying the reference.

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


Deep Copy:-

A deep copy in C++ is a copy that creates a new object and copies all member variables of the original object to a new object, including copying the memory pointed to by the pointers to new memory locations.

A deep copy means creating a new array and copying over the values. Changes to the array values referred to will not result in changes to the array data refers to.

Example:-

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


it's good programming practice to use a deep copy when you need to create a new object that is independent of the original object and does not share any data with it.

On the other hand, shallow copying is useful when you want to create a new object that shares data with the original object.

In general, if you need a new object that is independent of the original object, a deep copy is recommended, while if you need a new object that shares data with the original object, a shallow copy may be applicable.

Don't forget to follow for more amazing programming content.
Configuring dind (docker in docker) with VSCode Remote Development
Tags: docker, vscode
Published: 2023-04-17 00:30:59

It was as simple as adding a single line to the devcontainer.json configuration file.

- devcontainer.json
```
	"features":{
		"ghcr.io/devcontainers/features/docker-in-docker:2": {}
	},
```

There are various features available for dev containers, such as AWS CLI and Python. 
It seems that for future container development, there may no longer be no need for trial and error with creating Dockerfiles.


https://containers.dev/features
Announcing the Mux + Contenda integration
Tags: announcement, video, blog, contentcreation
Published: 2023-04-17 17:38:57

---
title: Announcing the Mux + Contenda integration
published: true
date: 2023-04-17 00:00:00 UTC
tags: announcement, video, blog, contentcreation
canonical_url: https://blog.brainstory.ai/mux/
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0e0smuu6le6ieqhi87p.png
---

Mux Video is how developers build online video, and we love that! Contenda is built with a developer-first belief. We imagine a world where manual content processes can be automated, just like code deployment. So, naturally, partnering with Mux Video means our developers get to automate more, with less work!

![Contenda and Mux graphic](https://contenda.co/blogimages/mux.png)

> _“We’re used to telling developers that Mux makes adding video capabilities to your application easy work. Now, we’re thrilled to be able to point to an integration for the rest of the content generation process. Contenda is a great way to reduce the friction in generating companion content for your videos.”_

_- Dave Kiss, Community Engineer at Mux_

## How do I get started?

Starting today, Contenda natively accepts Mux `PLAYBACK_ID` in the `source_id` field for all video jobs submitted with our API! Take this example request body and drop in `mux PLAYBACK_ID`:

```json
{
  "status_update_webhook_url": "",
  "status_update_email": "",
  "source_id": "mux PLAYBACK_ID",
  "type": "presentation",
  "overrides": {}
}
```

Ba-da-bing, ba-da-boom. These changes **don’t** disrupt any of your existing Contenda workflows, so you can continue to reuse and recycle content ‘til the cows come home without anything breaking!

You’re well on your way to making blogs from _any_ of your Mux Videos. Read the API docs [here](https://prod.contenda.io/docs#/Jobs/post_video_to_blog_job_api_v2_jobs_video_to_blog_post) to get started!
Easy blogging
Tags: blog
Published: 2023-04-17 20:01:31

---
title: Easy blogging
published: true
date: 2022-12-11 00:00:00 UTC
tags: blog
canonical_url: https://tinygame.dev/posts/Easy-blogging/
---

## I've got a great blog, where do I host it?

Well, you don't need to host it, you can use [dev.to](https://dev.to/), obviously! But let's say you like to tinker and do want to maintain your own blog.

If you’re a dev, or a bit techy and don’t mind getting your hands dirty, there’s a nice and quick way to set up a blog deployment system with [GitHub](https://github.com/) and [Cloudfare](https://www.cloudflare.com/). It’s simple, free, and relatively quick. There’s better ways to get a blog out there if you want simplicity, but I’ve found doing it this way to be more fulfilling.

We’re only talking about deploying the blog here, so I’m assuming you have a way to build the content already. [My own blog](https://tinygame.dev), for example, uses the terrific [Astro](https://astro.build/) framework.

First step, once you have your blog code set up and you can create your posts, is to chuck everything onto GitHub. With the repo ready to go, create a project in Cloudflare Pages and connect to Git. Get the GitHub and Cloudflare accounts connected, make sure the Cloudflare app on GitHub has permission to see your blog repo, and select it in your Pages project. Lastly, set up the build settings for your project if relevant (e.g. `npm run build` for the build command and select the destination folder).

That’s basically it. All you need to do now is create your blog posts and push to GitHub. The Cloudflare app will sync, build, and deploy the new content for each commit.
Improving User Experience: Enabling Both Contractors and Clients to Use Contractr Platform
Tags: webdev, javascript, programming, react
Published: 2023-04-16 23:41:47

Hello everyone,

I am excited to provide an update on the progress I've made on the Contractr project. As a quick recap, Contractr is a web application that connects freelancers with potential clients.

Today, on day 76 of #100DaysOfCode, I made significant progress on the app's logic. Up until now, I had created the logic for sign-up, login, creating a profile, and other functionalities only for contractors. However, I realized that I needed to do the same for clients to ensure that both parties have a smooth experience using the app.

I spent the day creating and refining the logic for clients to sign up, log in, and create a profile. Once they complete these steps, their profile information is stored in the appropriate database collection, and they are redirected to the correct page. This way, clients only see freelancer cards to swipe on and vice versa.

While I didn't do much UI-wise besides what you see on the homepage, I am pleased with the progress I've made on the logic side of things. It's satisfying to see how everything is coming together and how each piece is starting to function as it should.

As always, there is still plenty of work to be done. But I'm excited to continue building out this app. I'm grateful for the support and encouragement from everyone following along with the project.

Stay tuned for more updates on the Contractr project!
Flarum: The Modern, Open-Source Forum Platform for Building Engaging Communities
Tags: opensource, elestio, flarum, communities
Published: 2023-10-11 13:06:34

---
title: Flarum: The Modern, Open-Source Forum Platform for Building Engaging Communities
published: true
date: 2023-04-16 23:20:38 UTC
tags: opensource, elestio, flarum, communities
canonical_url: https://elestio.hashnode.dev/flarum-the-modern-open-source-forum-platform-for-building-engaging-communities
---

If youre looking for a modern, open-source platform to build your own online forum or Q&A site, [Flarum](https://elest.io/open-source/flarum?ref=blog.elest.io) is a great option. This innovative forum software is designed to be easy to use and highly customizable, making it perfect for everyone from small business owners to enterprise-level organizations.

One of the key advantages of Flarum is its modern interface, which is designed to be both intuitive and visually appealing. The software also comes with a range of powerful features that make it easy to manage your community, including categories, user profiles, trust levels, authentication, and moderation tools.

One of the most attractive aspects of Flarum is its flexibility when it comes to customization. The platform is highly customizable and comes with a range of powerful plugins and themes that you can use to tailor your forum to your exact specifications. This means that you can easily create a unique look and feel for your forum, whether you want it to be sleek and modern or more traditional.

Flarum has already been adopted by a range of high-profile companies and its popularity is only continuing to grow ( [check its 6k stars on Github)](https://github.com/flarum/framework?ref=blog.elest.io).

Whether youre a small business owner or a large enterprise, Flarum is a great choice for building an engaging online community that will help you connect with your customers, clients, or fans.

If you want to start growing your community, [try Flarum here](https://elest.io/open-source/flarum?ref=blog.elest.io) or if you want to discover more about it, watch our platform tour available below 👇

<iframe src="https://www.youtube.com/embed/OsX89_GJGdg" width="700" height="393"></iframe>

_Originally published at_ [_https://blog.elest.io_](https://blog.elest.io/build-modern-forums-with-flarum/) _on April 16, 2023._
ChatGPT Prompt splitting
Tags: ai, tutorial, productivity
Published: 2023-04-16 22:39:32


- How to overcome ChatGPT too long message limit?
- how to easily split long texts for better ChatGPT results?

> The message you submitted was too long, please reload the conversation and submit something shorter.

---

Here is the video explaining the whole concept of text chunking with an easy to use UI tools to try out:

---

{% embed https://www.youtube.com/watch?v=JHKs5jwnAhc&list=PL-ciccwnzEooZVQhUGafF5pEEIZgQFD0f&index=2 %}

Opensource repo:
{% embed https://github.com/jupediaz/chatgpt-prompt-splitter %}

---

For a fully automated solution without manually splitting, [the chat bot example](https://vercel.com/templates/next.js/ai-gpt3-chatbot) from here can be taken, and [this approach can be taken further](https://github.com/vercel/examples/blob/main/solutions/ai-chatgpt/components/Chat.tsx#L9-L14) and implemented as a starting point (pre-generated messages):


```
export const initialMessages: ChatGPTMessage[] = [
  {
    role: 'assistant',
    content: 'Hi! I am a friendly AI assistant. Ask me anything!',
  },
  {
    role: 'user',
    content: 'Do not answer yet. This is just another part of the text I want to send you. Just receive and acknowledge as Remember not answering yet. Just acknowledge you received this part with the message "Part 1/n received" and wait for the next part.',
  },
  {
    role: 'assistant',
    content: 'Part 1/n received.',
  },
]
```

---

Godspeed

PS. Follow me on Twitter or LinkedIn
[https://twitter.com/dom_sipowicz](https://twitter.com/dom_sipowicz)
[https://www.linkedin.com/in/dominiksipowicz/](https://www.linkedin.com/in/dominiksipowicz/)
Doramas Tv
Published: 2023-04-16 22:20:49

Ver [Our Skyy Season 2 Capítulo 1](https://doramastv.es/episodes/our-skyy-season-2-capitulo-1/) en español

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gg8a8c87aa5s7pgxz3ex.jpg)
Dorama in Sub Espanol
Tags: dorama, doramas, doramastv, doramasmp4
Published: 2023-04-16 22:17:50

Ver online [DoramasTv](https://doramastv.es/) coreanas, chinos, Tailandia, Japones, Estrenos Doramas con subtítulos en español gratis

Ver dramas coreanos, chinos, Tailandia, Japones, Estrenos Doramas Online gratis en emision y finalizados, capitulos completos, aqui encontraras muchos doramas, peliculas y novelas de asia gratis en hd solo en **doramastv.es**

Si está buscando el mejor sitio web para obtener entretenimiento, simplemente vaya a [Doramas_Tv](https://doramastv.es/)

[The Witch: Part 1. The Subversion](https://doramastv.es/movies/witch-part-1-the-subversion/), Ja-yoon is a high school student who struggles with memory loss after she endured some unknown trauma
The One Where [Bottled] Conflicts with: [Formulae] (because both install [Those] binaries)
Tags: cheatsheets, worksonmymachine, macos
Published: 2023-04-16 21:54:33

> [GoTask](https://taskfile.dev) is a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make - [https://taskfile.dev](https://taskfile.dev)

That (Go|Task)/**/* is just great is [no wonder](https://awesome-go.com/).

What just a few lucky ones would learn, though, **[is that it might conflict with other binaries, sometimes](https://github.com/Homebrew/homebrew-core/issues/119921)** -  which might not be that great.

```sh
brew info go-task
# =>
#     go-task: stable 3.24.0 (bottled), HEAD
#     ..
#     Conflicts with:
#       task (because both install `task` binaries)
```

A quick workaround is changing the GoTask's binary - in just a few steps..

```sh
## unlink `Taskwarrior`
brew unlink task

## install the `GoTask`
brew install go-task

## unlink the `GoTask`
brew unlink go-task

## relink `taskwarrior`
brew link task

## find out the symlinks that Brew ought to create
brew link go-task --dry-run
# =>
#    Would link:
#    /usr/local/etc/bash_completion.d/task
#    /usr/local/bin/task
#    /usr/local/share/fish/vendor_completions.d/task.fish
#    /usr/local/share/zsh/site-functions/_task

## Then manually links the binary as `gotask` - or whatever fits best
ln -s /usr/local/Cellar/go-task/3.24.0/bin/task /usr/local/bin/gotask

## Next, checks the folders under `$FPATH`
echo "${FPATH:?}" | sed 's/:/\n/g' | uniq -c
# =>
#   1 ~/.config/zsh/opt/completions
#   1 /usr/local/share/zsh/site-functions
#   1 /usr/local/Cellar/zsh/5.9/share/zsh/functions

## Copy the shell-completion file to any directory listed in `$FPATH`
## while applying a few changes
cat /usr/local/Cellar/go-task/3.24.0/share/zsh/site-functions/_task | sed s/task/gotask/g > ~/.config/zsh/opt/completions/_gotask

## Finally, resource ZSH files - or restart the terminal
exit
```

And **presto!**

Id' just ensure that the binary is working just fine..

```sh
## after all, this is IT and not - you know - exact science!
gotask --version
# =>
#   Task version: 3.24.0

## And don't forget the completions..
## for anybody who, like me, may have no life but.. **_TAB!_**
gotask
# =>
#   |  build
#   |  format
#   |  lint
#   |> nobody?
```

{% embed https://gfycat.com/speedyamazingindianpalmsquirrel %}

I wonder whether _<REALLY-BOLD>_ a similar approach would potentially _<REALLY-BOLD>_ work out for similar formulae. **_To be continued.._**

## REFERENCES

- [Go Task][0]
- [HomeBrew: Formula conflict: task (taskwarrior) and go-task][1]
- [HomeBrew: Configuring Completions in zsh][2]
- [ZSH: Autoloading Functions][3]

[0]: https://taskfile.dev/ "Go Task - a task runner / build tool that aims to be simpler and easier to use than, for example, GNU Make"
[1]: https://github.com/Homebrew/homebrew-core/issues/119921 "Formula conflict: task (taskwarrior) and go-task"
[2]: https://docs.brew.sh/Shell-Completion#configuring-completions-in-zsh "Brew: Configuring Completions in zsh"
[3]: https://zsh.sourceforge.io/Doc/Release/Functions.html#Autoloading-Functions "ZSH: Autoloading Functions"
HackerRank: Birthday Cake Candles Solution using PHP (Algorithm)
Tags: php, algorithms, hackerrank, hackathon
Published: 2023-04-16 21:38:54

## Problem
You are in charge of the cake for a child's birthday. You have decided the cake will have one candle for each year of their total age. They will only be able to blow out the tallest of the candles. Count how many candles are tallest.

**Example**

> candles = [4,4,1,3]

The maximum height candles are 4 units high. There are 2 of them, so return 2.

**Function Description**
Complete the function birthdayCakeCandles in the editor below.

birthdayCakeCandles has the following parameter(s):

> int candles[n]: the candle heights

**Returns**

int: the number of candles that are tallest

**Input Format**

The first line contains a single integer, n, the size of candles[].

The second line contains n space-separated integers, where each integer i describes the height of candles[i].

**Constraints**

> 1 <= n <= 10^5
> 1 <= candles[i] <= 10^7

## Solution (How i solved it)

```PHP
$mostFreq = -1;
    $maxFreq = 0;
    $size = sizeof($candles);
    $count = array_count_values($candles);
    for ($i = 0; $i < $size; $i++){
        $countFreq = 1;
        for ($j = 0; $j < $size; $j++){
            if ($candles[$i] == $candles[$j]){
            $countFreq++;
        }
        if ($maxFreq < $countFreq){
            $maxFreq = $countFreq;
            $mostFreq = $candles[$i];
            
        }else if ($maxFreq == $countFreq){
            $mostFreq = min($mostFreq, $candles[$i]);
        }
        return array_count_values($candles)[$mostFreq];
    }
}
```
Link to the HackerRank: [Birthday Cake Candles](https://www.hackerrank.com/challenges/birthday-cake-candles/problem)
Don't miss out on #CitusCon 2023 - the virtual event for Postgres developers!
Published: 2023-04-16 21:15:22

Don't miss out on #CitusCon 2023 - the virtual event for Postgres developers! 🐘💻 Join on April 18-19 for 37 sessions and 40 amazing speakers. Plus, win Citus Con swag and join the "virtual hallway track" on Discord.  #CitusCon #PostgreSQL #developer #Citus #Azure

[aka.ms/cituscon](https://aka.ms/cituscon)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8qi9hegz158hf9w2k85w.jpeg)
A tiny bash file viewer with line numbering
Tags: bash, beginners, tuto
Published: 2023-04-16 21:06:57

SSometimes when you build and run a Javascript file in Node, some TypeErrors can pass through ESBuild checks and they're difficult to understand directly... l

To visualize a screen portion of code you can try writing this:

```
#!/bin/bash
max=$(( $1+10 ))
length=20
cat -n $2 | head --lines=${max} | tail --lines=${length}

```

save it to "see-lines.sh" and setup it in your project structure and invoke it with the error stack trace line number:

```
./see-lines 421 dist/index-bundled.js
```

Et voilà !
Join my talk @ Citus Con 2023 [ Microsoft ] - Troubleshooting High CPU Utilization in PostgreSQL Databases
Tags: postgres, cituscon2023, database, devops
Published: 2023-04-16 20:53:38

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

After seeing a high CPU of the PostgreSQL DB instance, it’s essential to find the root cause of the issue. 

Queries can be poorly written, too frequent, or heavy.

During my session, I will demonstrate useful SQL queries that can be run on the PostgreSQL DB instance to investigate the high CPU utilization.

https://www.citusdata.com/cituscon/2023/schedule/#od-session-romanoff
Declare and version control you tmux sessions
Tags: webdev, programming, productivity, tooling
Published: 2023-04-16 20:40:42


Anyone who spends a significant amount of time in the command line understands how tedious and cumbersome managing multiple tmux sessions can be. Many programmers find themselves switching between a variety of projects of different languages and sizes on a daily basis. With [`tmuxp`](https://www.github.com/tmux-python/tmuxp) you can declare what a tmux session for a project should look like using json/yaml.

A simple declaration that fetches from a remote repo and opens `neovim` in one window with `bottom` running in a second.
```yaml
# ~/example/.tmuxp.yaml
session_name: Swoll Sesh
start_directory: ~/example
windows:
    - window_name: nvim
      panes:
        - shell_command:
          - git fetch
          - nvim .
    - window_name: monitor
      panes:
        - shell_command:
          - btm
```

To start this session just run:
```shell
tmuxp load ~/example
```

This file can then be version controlled, keeping your developer environment organized, consistent and reusable. You can find more examples in the [documentation](https://tmuxp.git-pull.com/configuration/examples.html)

Combining this with one of the session management plugins for neovim/vim means that your editor will automatically open where you want it.

This can be even further expanded with [`nix`](https://nixos.org/), [`flakes`](https://nixos.wiki/wiki/Flakes), [`direnv`](https://direnv.net/), and [`nix-direnv`](https://github.com/nix-community/nix-direnv) to give you a fully automated and reproducible developer environment complete with the environment variables and dependencies needed to start hacking on a project.