teleren/devto huggingface dataset:
How to convert an int type value to a uint type value in Go or Golang?
Tags: go
Published: 2022-08-18 22:50:36

---
  title: How to convert an int type value to a uint type value in Go or Golang?
  published: true
  tags: Go
  date: Fri Aug 19 2022 04:20:36 GMT+0530 (India Standard Time)
  canonical_url: https://melvingeorge.me/blog/convert-int-type-value-to-uint-type-value-go-golang
  cover_image: https://melvingeorge.me/_next/static/images/main-fa457fe890a819b4bad7d99f0b652f44.jpg
  ---
  [Originally posted here!](https://melvingeorge.me/blog/convert-int-type-value-to-uint-type-value-go-golang)
  
To convert an `int` type value to a `uint` type value in Go or Golang, you can use the built-in `uint()` function and pass the `int` type value as an argument to the function. The function returns the value as the `uint` type.

For example, let's say we need to convert an `int` type value of `3000` to a `uint` type.

To do that we can use the `uint()` built-in function and pass the value of `3000` as an argument to the function like this,

```go
package main

import "fmt"

func main() {
    // a `int` type value
    intNum := 3000

    // convert the `int` type value of 3000
    // to `uint` type value using the
    // `uint()` built-in method
    uintNum := uint(intNum)

    // log to the console
    fmt.Println(uintNum) // `3000` and the type is `uint`
}
```

As you can see from the above code we have converted the `int` type value of `3000` to a `uint` type value. Yay 🥳!

See the above code live in [The Go Playground](https://go.dev/play/p/M4xo3NqcDyx).

That's all 😃.

### Feel free to share if you found this useful 😃.

---
Day 131: Hello Express!
Published: 2022-08-18 22:46:07

Hi!
Today I got back to the personal project I'm currently working on and I was working on the task of setting up code quality assurance with Eslint, Prettier, Lint-staged and Husky and this is a task I had worked on before actually I even have a guide article for setting these Technologies but I struggled because there had been changes made in the packages from the last time I tried them. but I finally got it done and now I'm now working on Setting up Express project and now It's my chance to learn and understand Express at least better than I do now
I have already found some of the best practices to follow and some of the things I didn't truly understand before so I will be digging deeper tomorrow

Tomorrow I don't have plans I will just go with the flow (it's Friday anyway) but I also have a major application to do but there is a possibility that I may not do it

Signing off...
Upcoming (Nov/Dec 2022) enforcement of limits for SharePoint lists & libraries in Site Collection
Tags: spfx
Published: 2022-08-18 22:32:44

On Jul 26, 2022, MC405984 was published that states Microsoft will start enforcing hard limits on the number of list and libraries a site collection can have instead of just a recommendation as it is now. I have developed a SPFx solution (single page web part) for my company's legal department that provides a UI for managing contract metadata (across several lists), and creates a library for each revenue generating client as soon as they have documents to upload. We currently have over 20,000 clients, and nearly 20,000 libraries in the site collection (single site). We were forced to use this model instead of a single library because the requirements demand unique permissions which in a single library would exceed the existing rule of 5,000 maximum unique permission per library. The SPFx web part is extremely fast, and creates libraries quickly with no throttling. The user's experience within the site are limited to the SPFx web part app which has been thoughtfully created to avoid throttling-prone queries. The one place that is slow is the Site Contents page, but users are never using it because their entire experience is within the UI of my app. **So my question: does this change have to happen?** My app was developed in 2020 and at the time this was not a rule, but a suggestion that was part of the Listview Threshold guidance. I went out of my way to craft an app that would work given the limits in the SharePoint online platform because it's great for document storage, identity management and security. This rule enforcement will cripple my application. Since the reason for the rule is to improve user experience (which I have to imagine is affecting Site Contents mostly), **I wonder if it would make more sense to find a way to work with the few sites that contain a large number of lists/libraries rather than hamstringing the platform. Perhaps there could be an administrative setting to allow a site to opt-in to have more than 2000 lists/libraries with the default that it is not allowed.** That would give me and other developers/admins a viable path forward, and would also enforce the 2000 limit for all other sites by default.
LB Labs: Solving The Pull Request Problem w/ Continuous Merge
Tags: devops, management, podcast, productivity
Published: 2022-08-18 22:15:09

Fact: The state of pull requests is broken and we finally have the data to prove it. In our latest LinearB Labs episode we reveal the information that has led us to the inevitable conclusion that pull requests have become a massive source of toil, bottlenecks and a huge barrier to shipping.

Better yet, two people who have been thinking about how to attack this dev workflow issue – Dan Lines and Ori Keren of LinearB – are ready to actually propose a solution: continuous merge.

The next step in CI/CD, continuous merge is the concept of creating lanes where pull requests can be merged based on their risk. Plain and simple, pull requests should not all be treated the same.

The first step in continuous merge proposed in the episode is the dev tool gitStream, which automates and optimizes merging pull requests based on risk and level of attention required.

A game-changing conversation, this episode is the first time you might hear about continuous merge but it certainly won’t be the last.

{% spotify spotify:episode:4nKy9KeGnCm1vShtDYC8O9 %}

## Episode Highlights Include:
* (3:10) A history of CI/CD
* (10:15) The #1 undiagnosed problem in developer experience
* (15:00) What's happening industry-wide in VSM
* (18:32) Giving devs a better tool: [Continuous Merge](https://linearb.io/dev/gitstream/)
* (24:09) Not all PRs should be treated the same
* (28:21)  75-80% of all PRs have no changes being made 
* (34:40) What is [gitStream](https://linearb.io/dev/gitstream/)?

## [You're Invited to Interact on October 25th](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog)
Over $100 billion in engineering wisdom will be at your fingertips at [**Interact**](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog) on **October 25th.**

Join engineering leaders from **Shopify, Stripe, Slack** and more at Interact, a free, virtual, community-driven engineering leadership conference.

**1 day, 25 speakers, all selected by the thousands of engineering leaders in the [Dev Interrupted community.](https://discord.com/invite/tpkmwM6c3g)**

## [Learn more here](https://devinterrupted.com/event/interact/?utm_source=dev.to&utm_medium=referral&utm_campaign=202210%20-%20Event%20-%20Interact%20-%20Referral%20-%20Distro%20-%20Podcast%20Blog)

![Register now!](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/csnkg6ypq9z2czg4xl0m.jpg)
Fastest start of YugabyteDB for a small lab
Tags: yugabytedb, microvm, distributed, sql
Published: 2022-08-18 22:05:00

For starting a YugabyteDB lab, the best is running [yugabyted](https://docs.yugabyte.com/preview/reference/configuration/yugabyted/). However, it takes some time (few seconds) to check the OS prerequisites. If you want a faster start, you can run directly one [yb-master](https://docs.yugabyte.com/preview/reference/configuration/yb-master/) and [yb-tserver](https://docs.yugabyte.com/preview/reference/configuration/yb-tserver/) with `--replication_factor=1` (no need for HA in a lab) and the mandatory `--fs_data_dirs` for the location of logs and data.

The following goes to `/var/tmp` (it must be clear at this point that this is not for production), downloads the latest preview version, if not already there, and starts YugabyteDB `yb-master` and `yb-server` with all defaults.

```sh
# needs the following to download the latest version
sudo yum install -y curl jq
# go to working directory
cd /var/tmp

# get the latest preview version (from the docker hub... why not?)
tag=$( curl -Ls "https://registry.hub.docker.com/v2/repositories/yugabytedb/yugabyte/tags?page_size=999" |
 jq -r '."results"[]["name"]' | sort -V | tee /dev/stderr |
 awk -F. '!/latest/ && ($2/2)==preview/2+int($2/2){tag=$0}END{print tag}' \
 preview=1 ) # set preview=0 for stable release

# download and install
[ -f yugabyte-${tag%%-*}/version_metadata.json ] ||
curl -s https://downloads.yugabyte.com/releases/${tag%%-*}/yugabyte-${tag}-linux-x86_64.tar.gz | tar zxvf -
yugabyte-${tag%%-*}/bin/post_install.sh

# kill previous execution if any
pkill yb-tserver ; pkill yb-master ; rm -rf /var/tmp/{yb-,pg_}data

##################################
# Here is the start of YugabyteDB
##################################

# start master
yugabyte-${tag%%-*}/bin/yb-master --fs_data_dirs=/var/tmp   \
 --master_addresses=$(hostname):7100 --replication_factor=1 \
 --default_memory_limit_to_ram_ratio=0.30 &
# start tserver
yugabyte-${tag%%-*}/bin/yb-tserver --fs_data_dirs=/var/tmp \
 --tserver_master_addrs=$(hostname):7100 \
 --default_memory_limit_to_ram_ratio=0.30 &
# show the logs in case it fails
timeout 10 tail -F /var/tmp/yb-data/*/logs/yb-*.INFO &
# wait until available
until yugabyte-${tag%%-*}/bin/ysqlsh -v ON_ERROR_STOP=on -c "
-- you can run any initialization here
select * from yb_servers()
" ; do sleep 0.1
done

```
This should start in one or two seconds maximum, exposes the UI on `http://$(hostname):7000` and PostgreSQL endpoint on `postgres://$(hostname):5433/yugabyte`. As I run the `yb-master` and `yb-tserver` on the same (small) VM, I have limited their memory allocation by adding `--default_memory_limit_to_ram_ratio=0.30`, which also leaves some memory for the system (including the filesystem cache). A fixed value can also be set with `memory_limit_hard_bytes`.
Install Kali Linux on Windows
Tags: linux, tutorial, devjournal, security
Published: 2022-08-18 21:42:40

Hi there! today i will walk you through the process of installing and setting up Kali Linux on your windows laptop.

In this article, you will learn how to use virtual box to setup Kali Linux on your windows laptop.

## Download Virtual Box
1. click [here](https://download.virtualbox.org/virtualbox/6.1.36/VirtualBox-6.1.36-152435-Win.exe) to download virtual box

## Download Kali Linux
1. click [here](https://www.kali.org/get-kali/#kali-virtual-machines) to download Kali Linux
1. Kali Linux is available for both 64-bit and 34-bit windows. select either of these two depending on your windows laptop.
1. click on the icon labelled Virtual box and start downloading. 

![Kali Linux on windows](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5qcscief4c40v47w5nlt.png)

**congratulation!!!** you have successfully downloaded Kali Linux and Virtual box.
## Setup Kali Linux on windows laptop
1. Go to your download folder and install virtual box.
1. launch virtual box
1. Click on the button labelled import.
1. Click on the yellow icon by the right. 
1. Go to folder you downloaded Kali Linux to (download folder)
1. Select and Click on kali-linux
1. Click on the button labelled. 
1. Click on the button labelled next. You should see an interface similar to this. 
1. Click on the button labelled import. A dialogue box appears, 
1. Click on the button labelled Agree

congratulation! you have successfully installed Kali Linux on windows.
Encountered two children with the same key, `62fda94ce53d65269326e97b`.
Tags: react, redux, webdev, devops
Published: 2022-08-18 21:42:18

In the line no 38 I have added the key and in the line 17-24 I have used to call the profile But when I go to search any profile it show me an error and if I go to my profile and then after search anything from above search box then it will now not show error
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ew1aoedg4nfz6q18gbuv.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5vhcy837ihe0r4s2nv53.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vaz6enkoqvy0z6jh9fvk.png)
Navigator share API - Can we track in which application, user has choosen to share? eg: facebook, whatsapp
Tags: javascript, shareapi, webdev, sharetarget
Published: 2022-08-18 21:16:02

The share() method resolves a Promise with undefined, once the data has successfully been passed to the share target. But I want to track in which application the user has shared the content for analytical purpose.

Is there any possible way to achieve this?

[Doc reference](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/share)
How to Post Your Local Code to a Remote Github Repository the Efficient Way Without the Github CLI
Tags: github, repository, local, remote
Published: 2022-08-18 21:06:00

Create some code in VScode or some other code editor or IDE? Want to post it to Github? Want to know an efficient way to do it specifically for this use case? Then this is the article for you!

If you're like me, you never create a repository on Github first and then link it to your local project before you even begin said project. Kudos to those that do, but for the rest of us mere mortals here is what I like to think of as the definitive simple way to post your existing local project to Github.

step 1 - git init -b main 
step 2 - git add . && git commit -m "initial commit"
step 3 - (create repo on Github + copy url - ie. .git thing)
step 4 - git remote add origin (theurl.git thing)
step 5 - git push origin main

That's it. Hope this helps.
Questions? DM me.
@adamtimuraslan on Twitter
Filebeat config on k8s after switching to containerd
Tags: kubernetes
Published: 2022-08-18 20:55:00

You can not ignore it, dockershim (layer for using Docker Runtime in Kubernetes) [will be removed starting 1.24](https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/). Do not worry, it's a change pretty seamless and your images built with Docker will still be fully functional.

But it's pretty sure that if your current cluster nodes are running through Docker Runtime, then you have some hardcoded configuration tight to Docker.

In this article we will focus on a **filebeat** configuration originally setup for Docker Runtime, and what needs to be done after the switch to **containerd** in order to keep getting your precious logs.

The main steps are updating your **filebeat** config file :
- activating `symlinks` option
- update the path of the logs files
- use together `dissect` and `drop_fields` processor to only parse and keep the necessary

Then after that update the _volumeMounts_ section of your **filebeat** _DaemonSet_ definition :
- each existing _mountPath_ or _path_ with value `/var/lib/docker/containers` will need to be changed to `/var/log/containers`

Here is a snippet of a **filebeat** config file that worked for me, do not hesitate to let us know if it helped you in some way or if you have a suggestion for improvement :

```
apiVersion: v1
kind: ConfigMap
metadata:
  name: filebeat-config
  namespace: kube-system
data:
  filebeat.yml: |-
    setup.ilm.enabled: false
    filebeat.inputs:
    - type: log
      symlinks: true
      paths:
        - /var/log/containers/*.log
      processors:
        - add_kubernetes_metadata:
            host: ${NODE_NAME}
            in_cluster: true
            default_matchers.enabled: false
            matchers:
            - logs_path:
                logs_path: /var/log/containers/

    processors:
      - add_cloud_metadata:
      - drop_event:
          when:
            equals:
              kubernetes.namespace: "kube-system"
      - dissect:
          tokenizer: "%{timestamp} %{std} %{capital-letter} %{parsed-message}"
          field: "message"
          target_prefix: ""
      - decode_json_fields:
          fields: ["message","log","logs.log","parsed-message"]
          target: "logs"
          process_array: true
      - drop_fields:
          when:
            regexp:
              message: "^{\""
          fields: ["message"]
          ignore_missing: true
      - drop_fields:
          fields: ["log.file.path","timestamp","std","capital-letter","parsed-message"]
          ignore_missing: true

...
```

Have a great day!
EU4UA: a platform that helps Ukrainians to find housing and jobs in Europe
Published: 2022-08-18 20:41:48

# EU4UA: a platform that helps Ukrainians to find housing and jobs in Europe

[EU4UA](https://fr.eu4ua.org/) was launched in only 48 hours on February 28th by 4 tech entrepreneurs: the co-founders of [Jobgether](https://www.jobgether.com/), [Arnaud Devigne](https://www.linkedin.com/in/arnauddevigne/) based in France, [Alexandre Hernandez](https://www.linkedin.com/in/alexandrehernandez/) based in Spain, [Juan Bourgeois](https://www.linkedin.com/in/juan-bourgois/) based in Belgium, and the CTO [Alexis Rodriguez](https://www.linkedin.com/in/alexis-rodr%C3%ADguez-a9743910b/) based in Colombia. 

[EU4UA](https://fr.eu4ua.org/) allows Ukrainian refugees to connect with European citizens willing to provide free emergency accommodation and find a job in no more than a click. Users can share their own housing in Europe available while companies can post their job openings. It is thanks to the mobilization, in less than five days, of two hundred people around the world from Tech that this initiative was able to see the light of day.

The project founders aim to enable all refugees to find decent housing for free and therefore avoid the harsh conditions faced in refugee camps. Once arriving in Europe many Ukrainians started looking for a job to have a stable and reliable source of income without relying much on government social support. After numerous interviews and surveys of what the refugees' needs are, the additional feature of job search was added to the website. 

To do so, the EU4UA team seeks to use the internet and technologies to activate decentralized, spontaneous manifestations of solidarity in response to the unprecedented international crisis we are currently facing.

Thanks to this solution, over 50 000 Ukrainian families have registered to find emergency accommodation and 23% of them have already found European hosts via EU4UA. 

To date, most hosts are located in France, the United Kingdom, and Spain, followed by Germany, Benelux, and Italy. 64% of them have hosted or are still currently hosting a refugee family.

In terms of jobs, there are currently over 11,000 vacancies in the industries where Ukrainian talents desire to work the most: the hospitality industry (38%), housekeeping / caregiving / cleaning (30%), catering and restaurant business (26%), followed by administrative and office jobs, sales, IT, culture, and design as well as wellness and beauty sectors. 

The EU4UA team believes that the tech for solidarity can become a gamechanger in tackling any future potential crisis and leveraging civil society mobilization to address any kind of challenges.
Time
Published: 2022-08-18 20:39:29

Not much has changed since the last entry. My partner and I have decided on our tech stack for our Umbrella Project so I'm excited to get that rolling. On our host company days I'm still learning some Java. Not being on a project yet has made it difficult to properly manage my time. Having no idea what I will be working on, and having to set my own learning goals is a challenge for me. I've always worked off goals that others have set for me when it comes to work. The past week has been better. I've put my mind on one goal as opposed to hopping around between topics and that has helped tremendously. Overall I think I'm using my time well as of late, but it's something I need to continue to work on as I continue on through the course.
I created a 🔥blazingly🔥 fast blog template with Astro and NetlifyCMS
Tags: astro, medium, dev
Published: 2022-08-18 20:39:14

This article was written and published on my [blog](https://christopherkapic.com). I _did not_ interact with Medium or dev.to except to check that it was republished correctly.

## What is [Astro Devblog](https://astro-devblog.netlify.app/)?
### A serverless (JAMstack) blog template intended to be deployed to Netlify which republishes articles to [Medium](https://medium.com/@christopherkapic) and [dev.to](https://dev.to/christopherkapic).

Read about how to deploy the template for yourself [here](https://astro-devblog.netlify.app/article/how-to-use-astro-devblog), or see [this YouTube video](https://youtu.be/8c7_vX3XPDc). Or, better yet, dive into the [git repo](https://github.com/christopher-kapic/astro-devblog).

## Why Astro?
### [Astro](https://astro.build/) is the hot new kid on the block, with compelling features like zero JavaScript by default and the Islands architecture.

Previously, I was using [11ty](https://www.11ty.dev) for my blog. However, Astro offers several advantages, including...
- Islands architecture allows me to incorporate UI frameworks/libraries when necessary or helpful
- SSR futureproofs my stack

I have not yet rebuilt all of the features associated with my old blog, but I am optimistic that Astro is a good choice for my blog's future. In the near future, I will share the aspects of Astro that I enjoyed, as well as the pieces with which I found frustration. If you're interested in that, consider following me on [Dev](https://dev.to/christopherkapic), [Medium](https://medium.com/@christopherkapic), [YouTube](https://www.youtube.com/channel/UCuXgDzDJhNAwvzvc62GnYwA), and/or [Twitter](https://twitter.com/kapicode).

Thanks for reading!
Git Force Push Current Branch Only
Tags: git, alias
Published: 2022-08-18 20:38:12

So recently I found out there's a good reason to use a particular syntax for force pushing a branch to the backend.  

I was doing this for a force push:

`git push -f`

Why would I force push a branch?  Because I often end up squashing lots of small commits on the branch into a single commit to make the commit history easier to read.  When I do that I need to force push to overwrite the existing history. Mind you I'm only doing this on _my own branches_.  

However, I found out much to my distress that if you've got multiple references to your backend (that is multiple branches tracking to origin) they _all_ get force pushed when you do -f.  If you're curious about this it's [here](https://git-scm.com/docs/git-push#Documentation/git-push.txt---force:~:text=Note%20that%20%2D%2Dforce,above%20for%20details.) in the git documentation.

There is an alternative that works just fine if you're only meaning to force push your current branch.  What you can do is this:

`git push origin +<branch>`

This will only force push the named branch.  However since I need to do this fairly often (as I say after I squash all the commits on a branch I force push so that instead of having 12 commits on a PR, I've got one) I want a git alias to make this easier for me.  And so I came up with this:

`fp = "!p() { CURRENT_BRANCH=$(git branch --show-current); git push origin +$CURRENT_BRANCH; }; p
`
(I'm indebted to Phil Haack for demonstrating this technique of using a shell function in a git alias to allow for trickier stuff!) 

First I get the current branch name into the CURRENT_BRANCH environment variable.  Next I create the git push command substituting the CURRENT_BRANCH name.  Finally the shell function is invoked.  

This does a force push but only on the current branch so I don't have to worry about inadvertently forcing other branches to the backend.