teleren/devto huggingface dataset:
Go Channel Patterns - Wait For Task
Tags: go, programming
Published: 2021-12-13 07:39:41

---
series: [Go Channel Patterns]
---

To improve my Go Programming skills and become a better Go engineer, I have recently purchased an excellent on-demand education from [Ardan Labs](https://www.ardanlabs.com/education/). Materials are created by an expert Go engineer, [Bill Kennedy](https://twitter.com/goinggodotnet).

{% twitter 1443663502808395780 %}


I have decide to record my process of learning how to write more idiomatic code, following Go best practices and design philosophies. 

This series of posts will describe channel patterns used for orchestration/signaling in Go via goroutines.


## Wait For Task Pattern

The main idea behind **Wait For Task** pattern is to have:
- a channel that provides a signaling semantics
- a goroutine that **waits for task** so it can do some work 
- a goroutine that sends work to the previous goroutine

### Example

In this example we have an `employee` (`a` goroutine) that doesn't know immediately what to do. The `employee` waits for `manager` to give him some work to do. 
Once `manager` finds some work for the `employee`, it notifies `employee` by sending a signal (`paper`) via communication channel `ch`.

Feel free to try the example on [Go Playground](https://play.golang.com/p/WUrCw1C8d7C)

```go
package main

import (
	"fmt"
	"math/rand"
	"time"
)

func main() {
	// make channel of type string which provides signaling semantics
	// unbuffered channel provides a guarantee that the 
	// signal being sent is received
	ch := make(chan string)

	// goroutine 'a' that waits for some work => employee
	go func() {
		// employee waits for signal that it has some work to do
		p := <-ch
		fmt.Println("employee : received signal : ", p)
	}()

	// simulate the idea of unknown latency (do not use in production)
	// e.g. manager is thinking what work to pass to the employee
	time.Sleep(time.Duration(rand.Intn(500)) * time.Millisecond)
	
	
	// when work is ready, send signal form manager to the employee
	// sender (employee) has a guarantee that the worker (employee)
	// has received a signal
	ch <- "paper"
	
	fmt.Println("manager : sent signal")

	time.Sleep(time.Second)
}

```

### Result (1st execution)
```sh
go run main.go
manager : sent signal
employee : received signal :  paper
```

## Conclusion
In this article, wait for task channel pattern was described. In addition, simple implementation was provided.

Readers are encouraged to check out excellent [Ardan Labs](https://www.ardanlabs.com/education/) education materials to learn more.

#### Note
Depending on the country you are coming from, [Ardan Labs](https://www.ardanlabs.com/education/) education might be a little bit expensive. In that case you can always contact them and they will provide you a link to their scholarship form. 

Resources:
1. [Ardan Labs](https://www.ardanlabs.com/)
2. [Cover image by Igor Mashkov from Pexels](https://www.pexels.com/photo/radio-telescope-against-sky-with-stars-6325001/)
🧭How to create a content explorer view in Microsoft Lists
Tags: microsoftlists, lists, sharepoint, giulianodeluca
Published: 2021-12-13 09:16:14

---
title: 🧭How to create a content explorer view in Microsoft Lists
published: true
description: 
tags: MicrosoftLists, Lists, SharePoint, GiulianoDeLuca
cover_image: https://raw.githubusercontent.com/giuleon/MicrosoftListsContentExplorer/master/Thumbnail.png
---

🎬NEW VIDEO N. 154🎬 
In this video tutorial, you’ll learn how to create a content explorer view in Microsoft Lists. 
I’ll walk you through every step to create a dynamic list filtering to have a content navigator that displays the content in detail according to the button clicked, in this way the list will be more readable. 

Preview:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/77c4jm4s6xekv94hbxbx.gif)

🔗Check out my demo:
https://github.com/giuleon/MicrosoftListsContentExplorer

{% youtube fWYntPmwCac%}
If you're uncomfortable with RxJS, this article is for you!
Tags: programming, webdev, javascript, react
Published: 2021-12-13 10:10:14

RxJS patterns are popular nowadays as data management and manipulation in a web app are crucial for every app.
Who didn’t retrieve data from an API or whatever the source is in their app? 

This article covers:

- The context and data

- RxJS and why is it used?

- When to use it?

This article had successfully made my junior mentees more comfortable with RxJS and even started implementing solutions with RxJS, that's why I'm sharing it with #dev.to community.
I hope you'll find it useful…

[RxJS like you've never seen it!](https://javascript.plainenglish.io/if-the-word-rxjs-makes-you-uncomfortable-this-article-is-for-you-b27780240b28)


![Mental view](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gr9go7wxbcbimaw5w8i8.gif)
 

My today's story ends here, I hope you enjoyed it and learned from it ❤

---

Dear reader, thank you for existing in my life. Let's get in touch on [Medium](https://medium.com/@famzil/), [LinkedIn](https://www.linkedin.com/in/fatima-amzil-9031ba95/), [Instagram](https://www.instagram.com/the_frontend_world/), [YouTube](https://www.youtube.com/channel/UCaxr-f9r6P1u7Y7SKFHi12g), or [Twitter](https://twitter.com/FatimaAMZIL9).

See my [e-book](http://www.fam-front.com/) about web essentials and general culture.
Launching the M.V.P.
Tags: javascript, programming, webdev, showdev
Published: 2021-12-13 14:14:55


# [Devshub](https://devshub.netlify.app/)

Coming to the point. I am launching a MVP called [Devshub](https://devshub.netlify.app).
Basically, I am building a social network for developers to share their projects and view what other developers built.
Currently, it is a small MVP and running on a free tier. Slowly and gradually when it will grow I will keep introducing many features


### Some features that I am focusing on:
- Messaging feature
- Timeline feature
- Analytics dashboard feature
- Badgeing feature
- ...and many more amazing features.

So I want developers like you to join and help me with this and we can make this big thing for the developer community.

If you find any bug or problem or report on the site there is a section or if you want to work together mail me at [Tazim Mail](mailto:rahbartazim@gmail.com)

Its time to look forward.

Thank you
Use Symbolic Links to version control your config files
Tags: dotfiles, shell, config, stow
Published: 2021-12-14 01:26:00

Coming from Windows based OS, I thought of symbolic links in Unix based OS as a way of creating shortcuts like "Create a Desktop shortcut for ..." and so I never paid much attention to it.

I have now (15 years late) discovered its value. 

Usually, you have your configuration (*dotfiles*) files for shell, text editors, git etc in your home directory (or `~/.config`). 
It is not convenient to version control your home directory to backup some of these config files.

The solution is to create symbolic links. Create any directory like `~/.dotfiles` and move all the config files from your home directory to `~/.dotfiles`. Then create a symbolic link in the home directory. Now you can version control `~/.dotfiles` with ease.

I wrote this short article just to draw attention to the value of symbolic links. 
For implementation details, you can watch these excellent videos which also introduces `GNU Stow` to avoid the pain of creating symbolic links manually. 

1. [Create dotfiles folder and use symoblic links](https://www.youtube.com/watch?v=gibqkbdVbeY)
2. [GNU Stow](https://www.youtube.com/watch?v=CxAT1u8G7is)
Automatically and intelligently processing SMS with attachments?
Tags: twilio, help
Published: 2022-08-31 18:41:48

Hi there.  Doesn't seem like it's asking too much, but I'm not sure.

I'd like to be able to assign a webhook to a recipient phone number that would automatically fire off whenever an SMS was received.  I'd like that webhook to contain the details of the SMS, including the message itself, the sending mobile number, as well as download url's for any attachments (typically photos).

On my (the webhook processing page) end, I'd then parse the details and save the attachments to a sending mobile number specific folder on our server (the server where the webhook processing page is found).

It doesn't really sound all that complicated to me - my end isn't, assuming that I can get the full contents of the SMS send via webhook - but I'm having difficulty getting a straight enough answer from any possible SMS processing vendor.

Thanks!
Getting Started with the React AutoComplete Component
Tags: react, reactnative, webdev, webcomponents
Published: 2021-12-14 04:59:47

Learn how easily you can create and configure the [React AutoComplete component](https://www.syncfusion.com/react-ui-components/react-autocomplete) of Syncfusion using the create-react-app command. This video also explains how to configure a few of the control’s basic features like binding list and remote data and customizing pop-up height and width.

 Download an example from GitHub: https://github.com/SyncfusionExamples... 

Refer to the following documentation for the Syncfusion React AutoComplete component: https://ej2.syncfusion.com/react/docu... 

Check out this online example of the React AutoComplete component: https://ej2.syncfusion.com/react/demo... 
 
{% youtube qpnnfN_E8PY %}
Parallelizing Tasks Using MongoDB
Tags: mongodb, typescript, node, backend
Published: 2021-12-14 06:50:58

Recently I published a [post](https://medium.com/zencity-engineering/parallelizing-tasks-using-mongodb-d788429b2b67) on our company's engineering blog.

Check it out if you work with MongoDB and want to find out how you can use it for parallel processing.
get user in AppServiceProvider Laravel
Tags: laravel
Published: 2021-12-14 07:49:50

Laravel session is initialized in a middleware so you can't access the session from a Service Provider, because they execute before the middleware in the request lifecycle

If for some other reason you want to do it in a service provider, you could use a view composer with a callback, like this:

`view()->composer('*', function($view)
        {
            if (Auth::check()) {
                // $view->with('currentUser', Auth::user());
                dd(Auth::user());
            }else {
                // $view->with('currentUser', null);
                dd('nope not logged in');
            }
        });`
Under the Lid: How AtomicJar is Reshaping Testcontainers
Tags: testing, cloud, techtalks, podcast
Published: 2021-12-16 17:32:39

Let’s get nerdy with it.

On this week’s episode of Dev Interrupted, Dan gets technical with Sergei Egorov, co-founder and CEO of [AtomicJar](https://www.atomicjar.com/).

With the mission to make integrated testing simpler and easier, AtomicJar created the Testcontainers Cloud which allows developers to test their code against real dependencies, not mocks. Today, Testcontainers powers over a million builds per month, helping developers build and release their software with confidence.

Dan and Sergei also talk about the difficulty of finding time to code once you become a CEO, the challenges of building a product for developers, and the culture differences between Russian devs and U.S. devs.

If you’re a developer or enjoy learning about [dev tools](https://linearb.io/blog/workerb-developer-automation/?__hstc=75672842.b37abbbdf4f34a742895a6b2675da07e.1632418321637.1639602501081.1639674868896.174&__hssc=75672842.5.1639674868896&__hsfp=1615045989), this is the episode for you!

{% spotify spotify:episode:53pBC3LXms5PUoBrrSA4qq %}

## Episode Highlights Include:
* How Sergei became a [Java champion](https://dev.java/community/jcs/)
* What it's like to grow up in [Siberia](https://www.google.com/search?q=siberia&rlz=1C1CHBF_enUS949US949&oq=siberia&aqs=chrome..69i57j46i433i512l4j46i131i433i512j0i131i433i512j46i512j0i433i512j46i433i512.2072j0j4&sourceid=chrome&ie=UTF-8)
* Cultural differences between U.S. and Russian devs
* Letting go of writing code when you become CEO
* Why it's hard to build a product for developers

## Join the Dev Interrupted Community
With over 2000 members, the Dev Interrupted Discord Community is the best place for Engineering Leaders to engage in daily conversation. No sales people allowed. [Join the community >>](https://discord.com/invite/devinterrupted)

![https://discord.com/invite/devinterrupted](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9f92oxpg6kabpujnv12n.png)
Colon Broom Reviews – What is Colon Broom? | Is Colon Broom safe to take?
Published: 2021-12-17 05:43:18

[Colon Broom](https://colonbroomus.wixsite.com/colonbroom) may assist address the issues with the gastrointestinal systems. Colon Broom is an supplement that might assist with overseeing stomach-related issues and keeping up with stomach-related wellbeing. Colon Broom is a dietary supplement detailed and sold by Max Nutrition LLC. The supplement is powerful in treating obstruction, swelling, sporadic defecations, and other stomach-related issues. Colon Broom supplement may likewise assist with advancing weight loss and further develop assimilation processes and the overall support of stomach-related wellbeing.

https://colonbroomus.wixsite.com/colonbroom
https://colonbroomus.jimdosite.com/
https://colonbroom.godaddysites.com/
https://promosimple.com/giveaways/colon-broom-reviews-what-is-colon-broom-is-colon-broom-safe-to-take/
https://promosimple.com/ps/18876/colon-broom
https://sites.google.com/view/colon-broom-us/home
https://sites.google.com/view/colonbroomus/home
https://fetchbinarydog.com/colon-broom/
https://www.provenexpert.com/colon-broom/
https://colon-broom.footeo.com/actualite/2021/12/17/colon-broom-reviews-what-is-colon-broom-is-colon-broom-safe-to-.html
https://colonbroom.clubeo.com/news/2021/12/17/colon-broom-reviews-what-is-colon-broom-is-colon-broom-safe-to-
https://caramellaapp.com/colonbroom/jOzuKkJYB/colon-broom-reviews-what-is-colon-broom
https://caramel.la/colonbroom/jOzuKkJYB/colon-broom-reviews-what-is-colon-broom
https://mymediads.com/articles/90399
https://telescope.ac/colonbroom
https://en.gravatar.com/colonbroompill
https://www.beatstars.com/colonbroom/about
https://linktr.ee/colonbroom
https://www.quora.com/What-is-a-colon-broom/answer/Colon-Broom-1
https://twitter.com/Colon_Broom
https://twitter.com/Colon_Broom/status/1471712811306860552
Ensuring Santa's Success With Automated Tests (C# Advent 2021)
Tags: csharp, dotnet, nunit, xunit
Published: 2021-12-19 03:49:47

---
title: "Ensuring Santa's Success With Automated Tests (C# Advent 2021)"
published: true
description: "An exploration of TDD in the spirit of the season."
tags: 
  - csharp
  - dotnet
  - nunit
  - xunit
canonical_url: https://seankilleen.com/2021/12/santa-sleigh/
cover_image: https://seankilleen.com/images/overlays/santa-sleigh-g6328721e2_1920.jpg
---

Happy Holiday season, everyone! I'm happy to have snagged one of the spots in this year's [C# Advent Calendar](https://www.csadvent.christmas). Be sure to check out the other 49 great posts when you're done here!

_____

I'm a big fan of automated testing, but I know that many developers in the C# space are still getting used to some of the concepts, so I figured we'd take this time to do a gentler introduction to test automation with a slightly contrived scenario, and solve it using NUnit and xUnit.

If you're already very used to automated testing, or have very strong opinions on it, this post likely won't be for you as it's meant to be a gentle introduction to applying some of the concepts. But I hope you'll get something useful out of it regardless!

_____

You can read the rest of these tutorials -- covering examples in both NUnit and xUnit -- at <https://seankilleen.com/2021/12/santa-sleigh/>.
Sort String by Flipping
Tags: java, programming, algorithms, 100daysofcode
Published: 2021-12-25 12:52:27

# [Description](https://binarysearch.com/problems/Sort-String-by-Flipping)

You are given a string `s` consisting of the letters `"x"` and `"y"`. In addition, you have an operation called `flip`, which changes a single `"x"` to `"y"` or vice versa.

Determine the smallest number of times you would need to apply this operation to ensure that all `"x"`'s come before all `"y"`'s.

**Constraints:** 

- `0 ≤ n ≤ 100,000` where `n` is the length of `s`

## Example 1

### Input

```
s = "xyxxxyxyy"
```

### Output

```
2
```

### **Explanation**

```
It suffices to flip the second and sixth characters.
```

---

# Intuition

# Implementation

```java
import java.util.*;

class Solution {
    public int solve(String s) {
        int length = s.length();
        int[] x = new int[length];
        int currX = 0;
        for (int i = length - 1; i >= 0; i--) {
            if (s.charAt(i) == 'x') {
                currX++;
            }
            x[i] = currX;
        }
        int ans = Integer.MAX_VALUE;
        int currY = 0;
        for (int i = 0; i < length; i++) {
            if (s.charAt(i) == 'y') {
                ans = Math.min(ans, currY + x[i]);
                currY++;
            }
        }

        return Math.min(currY, ans);
    }
}
```

## Time Complexity

- Time: O(n)
- Space: O(n)
MySQL query timeouts on big database
Tags: mysql, laravel, aws, bigdata
Published: 2021-12-27 10:29:52

Hi devs

I have a question. I'm maintaining a laravel/MySQL application that has a lot of custom reports that are generated using raw sql queries. As the usage grows, we are experiencing a lot of query timeouts because the data keeps growing, despite all our best efforts to optimize the queries, index the tables, etc. 

Is there an AWS solution (or otherwise solution) that can help in querying big data and generate reports?

Thanks
"Kem kẹp sandwich là một trong những món ăn vặt đường phố được người dân Singapore rất yêu thích.
Tags: webdev, beginners
Published: 2021-12-27 14:01:48

"Kem kẹp sandwich là một trong những món ăn vặt đường phố được người dân Singapore rất yêu thích.
Vì thế Hawker Star ra đời để đem đếm món kem kẹp sandwich chuẩn vị Singapore tại Việt Nam! 

Website: https://kemkepsingapore.com 
Hotline: 097 908 24 69
Email: hawkerstar.kinhdoanh@gmail.com
Địa chỉ: 38 Nguyễn Huệ, Bến Nghé, Quận 1, TP.HCM
Chỉ đường:  https://goo.gl/maps/qNVDwyk16ZXjoVdd9 

Liên kết Mạng Xã Hội: https://goo.gl/maps/qNVDwyk16ZXjoVdd9 
Fanpage: https://www.facebook.com/hawkerstar 
Youtube: https://www.youtube.com/channel/UC5oQklAd-c-VrBZIxH5kLzw
Linkedin: https://www.linkedin.com/in/singapore-kemkep-594323229/
instagram: https://www.instagram.com/hawkerstar/ "
Single method accessors and mutators in laravel
Tags: webdev, laravel, accessor, mutator
Published: 2021-12-27 16:10:33

We have already known the usage of accessors and mutators. We use accessors in laravel model to modify any field data while retrieving the records and mutators to modify any field data while inserting to database.

So, to modify any field before, we needed two separate methods for a single filed i.e. one method for accessor and one for mutator but in latest laravel release I mean in laravel 8.77.0, we can use a single method for both accessor and mutator using closure .

Given below is the syntax for single mehtod accessor and mutator:

```
<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Carbon\Carbon;
class Order extends Model
{

    /**
     * Get the order tax.
     */
    protected function order_date(): Attribute
    {
        return new Attribute(
            fn ($value) => Carbon::parse($value)->format('d-m-Y'), // accessor
            fn ($value) => Carbon::parse($value)->format('Y-m-d'), // mutator
        );
    }
}
```
In the above closures, the first closure is for accessor and the next for mutator.
Nagios Plugins for Linux v31
Tags: nagios, c, linux, monitoring
Published: 2022-08-31 19:56:45

What's new in version v31 "Counter-intuitive"

### Fixes

- Libraries

 * `lib/container_docker_memory`: fix an issue reported by _clang-analyzer_.
 * Make sure `sysfs` is mounted in the plugins that require it.

### Enhancements / Changes

- Plugin `check_filecount`

 * New plugin `check_filecount` that returns the number of files found in one or more directories.

-  Plugin `check_memory`

 * `check_memory`: support new units kiB/MiB/GiB.
   Feature asked by [mdicss](https://github.com/mdicss).
   See discussion [#120](https://github.com/madrisan/nagios-plugins-linux/discussions/120).

- `contrib/icinga2/CheckCommands.conf`

 * Contribution from Lorenz [RincewindsHat](https://github.com/RincewindsHat): add _icinga2_ command configurations.

- Build

 * configure: ensure libprocps is v4.0.0 or better if the experimental option `--enable-libprocps` is passed to `configure`.

- Test framework

 * Add some unit tests for `lib/xstrton`.
 * New unit tests `tslibfiles_{filecount,hiddenfile,size}`.

- Package creation

 * Add Linux Alpine 3.16 and remove version 3.13.
 * Do not package experimental plugins in the rpm `nagios-plugins-linux-all`.
 * Add Fedora 36 and drop Fedora 33 support.
 * CentOS 8 died a premature death at the end of 2021. Add packages for CentOS Stream 8 and 9.

- GitHub Workflows

 * Build the Nagios Plugins Linux on the LTS Ubuntu versions only. The version 21 seems dead.
 * Add build tests for all the supported oses.
 * Update the os versions used in tests.
 * CentOS 8 died a premature death at the end of 2021. Remove it from the list of test oses.
 * Add CodeQL analysis
Practicing Data Structures and Algorithms Daily!
Tags: programming, beginners, tutorial, algorithms
Published: 2021-12-27 19:10:33

## Boring but worthy 
Data structures and algorithms as important as your communication skills if you're into programming. If it's your dream to work as full time software engineer, well this thing should be your playground.
For software engineers, understanding of different types of algorithms is important. So if you had some similar planning get ready for them.

## Where to start
First things first! make sure to first get a average or good command over some programming languages like C++, Java, Python or else. Once you're good to go, try going deeper into their some concepts like pointers and structures like stacks, vectors, arrays, dictionaries and queues.
It's recommended that you have some mentor for guidance.

## Now comes the painful part
Get ready for some brain damage and mental pain, once dived deep into above things you'll be introduced to some terms like recursion and iterations. Talking about my own experience I had a huge confusion and problems while understanding algorithms full of recursions. Terms like Time and Space complexity will be one factor judging your algorithms.

## Resources for practice
Learning data structures and algorithms can get a little easy if you solve more and more questions and knowing the best way to solve them.
Which algorithms fits the best and why? some things that one should have a good knowledge of.
I've been doing some of these algorithms since few days as well my repo:- [CPP-Data-structures-and-algorithms](https://github.com/Seek4samurai/DSA-Cpp)
Here are some websites I use for practicing questions :- [Hackerrank](https://www.hackerrank.com/) and [Leetcode](https://leetcode.com/). Check these websites for questions and try solving them.
_Hope this helps and motivates._