teleren/devto huggingface dataset:
How to Install Golang on WSL/WSL2
Tags: go, linux, ubuntu, beginners
Published: 2022-06-13 18:30:16

One of the best feature that Windows 10 or 11 Pro support is [WSL](https://www.omgubuntu.co.uk/how-to-install-wsl2-on-windows-10) or [WSL2](https://docs.microsoft.com/en-us/windows/wsl/install), using this you can run any Linux OS like a windows application.

If you want to install GoLang on WSL/WSL2 and setup your development environment, please follow these steps

## Check Latest Go Version
You can check latest Go Version for any OS like: Linux, macOS or Windows at [https://go.dev/dl/](https://go.dev/dl/)

## Install Go
At the time of writing this blog, the most recent LTS version of Go is 1.18.3.

`wget https://dl.google.com/go/go1.18.3.linux-amd64.tar.gz	
sudo tar -xvf go1.18.3.linux-amd64.tar.gz
sudo mv go /usr/local`

## Edit .bashrc file
You have to edit .bashrc file before making further changes, you can follow below steps to open .bashrc file

`cd ~
explorer.exe .`

Open **.bashrc** file and add following lines at the bottom and save the file.
`export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH`

Refresh your terminal using **bash **command

## Check Go Version
`go version`

Make sure it returns the same version that you installed.
Cloud Resume Challenge, Days 4-5
Tags: cloudresumechalleng, aws, showdev
Published: 2022-06-13 18:18:05

Front end 99.9% completed now. Still have a little permissions problem when trying to download a copy of my actual resume - so not quite ready to let it loose in the wild yet.

One thing I learned - AWS Cloudfront and Route53 'A' records do not play well together unless the SSL cert the Cloudfront distribution uses has only 1 hostname in it. Or maybe, the order of the names in the cert matter.... ie: the simple solution is - don't use/create a SAN (subject alternate name) certificate

![Resume Challenge Front End](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3zjcgosagyiuyifzyr54.png)

Resources used to complete this phase of the project:

FontAwesome for the icons I used in my resume.
{% embed https://fontawesome.com/ %}

W3 Schools for a couple of HTML and CSS lessons.
{% embed https://www.w3schools.com %}

Diagrams.net for the drawing above.
{% embed https://app.diagrams.net/ %}

And this Github repo for YUI information, since that was already in use in the HTML code I used.
{% embed https://yui.github.io/yui2/docs/yui_2.9.0_full/ %}
Computers pollute ?
Published: 2022-06-13 18:16:07

It might sound very anti-intuitive that you doing a google search about carbon emissions in the atmosphere can actually release a tiny amount of carbon too. It might be negligible but when we sum it all up, in processing almost 3.5 billion searches a day, the world’s most popular website accounts for about 40% of the internet’s carbon footprint. Now that’s a big part in the Carbon emission and can’t be neglected.

**Digital Carbon Footprint**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4pf4e3tx5rvyadlbcz20.jpg)

The face of Digital world has changed massively and the generation, processing and consumption of data has scaled up exponentially in the last decade. But what we miss under the picture is the load on the massive hardwares and their processing power.
The kind of speed with which these servers process data and the energy consumption required to keep these systems cool is massive. Now you can imagine the amount of carbon footprint created with such energy, because high powers rely on fossil fuels.
Google’s net energy consumption in a year is about 12.5 Terawatt, where Bitcoin mining accounts to more than 10times, 130 Terawatt per year. It is found that training certain Machine Learning models  accounts to release of carbon equal to that of 5 cars in their lifetime.

**What can we do?**
From the coding perspective:
•	**Use efficient Algorithm:** An efficient algorithm can minimize the CPU consumption and in result reduce energy consumption.
•	**Event based over Rest based:** Prefer using Event driven architectures because Rest architectures use unending loops waiting to receive instructions.
•	**Fonts:** Even using optimal fonts reduces file size to a large scale. Fonts like WOFF reduces file size upto 97%.

From electronics user perspective:
•	**Emails:** One email sent releases about 4g of Carbon. Globally each individual accounts for about 136kg of C02 in a year. So we can reduce email transactions by unsubscribing to unwanted websites and avoid spams and advertisements.
•	**Energy Saver modes** should be enabled while using any device.
•	**Online shopping:** Online shopping adds up to releasing less carbon compared to driving to store.

The **_Green Software Foundation_** is a nonprofit founded by Accenture, GitHub, Microsoft and ThoughtWorks established with the Linux Foundation and the Joint Development Foundation Projects LLC to build a trusted ecosystem of people, standards, tooling and leading practices for building green software.

If you find other ideas to reduce carbon emissions, do mention in the comment section.
The Mycelium Network Podcast
Tags: webdevelopers, codenewbie, learntocode, podcast
Published: 2022-06-13 18:10:06

---
title: The Mycelium Network Podcast
published: true
description: An introduction to The Mycelium Network and the The Mycelium Network podcast.
tags: webdevelopers, codenewbies, learntocode, podcast
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zyz8npe3fyjc2rd9kutt.jpg
---

I have a personal mission that reads as follows:

> I believe in the opportunities the internet can offer to empower people and communities. When you combine the reach of the web with skills in engineering, design, and compassion for others, we can impact our own lives and those of others. One of my life goals is to build a community of curious people who share knowledge and experience. To inspire each other to create opportunities using their creativity, the web, and related technologies.

To work towards this goal, I have started [The Mycelium Network](https://github.com/The-Mycelium-Network/the-mycelium-network), a growing community of early-stage web developers and mentors with the aim of fostering a welcoming and diverse community.

I am ready for the next phase in building this community and am excited to announce The Mycelium Network podcast. The goal is to learn what people’s pain points and questions are directly from the source. What works well in the education sector, what does not, and how we can work together to improve. This will also be a platform for early-stage developers to talk about themselves and highlight their work.

I also want to dig into a thorny topic a lot of early-stage web developers find daunting. Finding work.

The flip side of the coin is having conversations with teachers and mentors and presenting them with the identified challenges. Talking through some existing solutions and brainstorming ideas for improvement. The ultimate goal is to create a valuable resource for learners and teachers that will positively impact the web developer industry for everyone.

I am not ready to launch just yet, but I invite everyone to join the community on Discord and share your suggestions. While I am putting together the content schedule, I have a question for you all. If you are new to web development and have had the opportunity to speak to a teacher or mentor in this space, what questions would you most like to ask them?

Thank you in advance for your contributions!
Critical Connections in a Network
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 18:00:47

There are `n` servers numbered from `0` to `n - 1` connected by undirected server-to-server `connections` forming a network where `connections[i] = [ai, bi]` represents a connection between servers `ai` and `bi`. Any server can reach other servers directly or indirectly through the network.

A _critical connection_ is a connection that, if removed, will make some servers unable to reach some other server.

Return all critical connections in the network in any order.

**Example 1:**

![](https://assets.leetcode.com/uploads/2019/09/03/1537_ex1_2.png)

**Input:** n = 4, connections = \[\[0,1\],\[1,2\],\[2,0\],\[1,3\]\]
**Output:** \[\[1,3\]\]
**Explanation:** \[\[3,1\]\] is also accepted.

**Example 2:**

**Input:** n = 2, connections = \[\[0,1\]\]
**Output:** \[\[0,1\]\]

**Constraints:**

*   `2 <= n <= 105`
*   `n - 1 <= connections.length <= 105`
*   `0 <= ai, bi <= n - 1`
*   `ai != bi`
*   There are no repeated connections.

**SOLUTION:**

    from collections import defaultdict
    
    class Solution:
        def DFS(self, graph, node, v, parent, disc, low):
            v.add(node)
            disc[node] = self.t
            low[node] = self.t
            self.t += 1
            for j in graph[node]:
                if j not in v:
                    parent[j] = node
                    self.DFS(graph, j, v, parent, disc, low)
                    low[node] = min(low[node], low[j])
                elif j != parent[node]:
                    low[node] = min(low[node], disc[j])
        
        def criticalConnections(self, n: int, connections: List[List[int]]) -> List[List[int]]:
            graph = defaultdict(list)
            for a, b in connections:
                graph[a].append(b)
                graph[b].append(a)
            self.t = 0
            parent = defaultdict(lambda: -1)
            disc = defaultdict(lambda: float('inf'))
            low = defaultdict(lambda: float('inf'))
            v = set()
            for i in range(n):
                if i not in v:
                    self.DFS(graph, i, v, parent, disc, low)
            return [[u, v] for u, v in connections if low[u] > disc[v] or low[v] > disc[u]]
What I Learned This Week. Week 16.
Tags: python, datascience, weeklyretro
Published: 2022-06-13 17:53:19

So I want to start this off with addressing that I didn't post last week. Like I said in the past these have been becoming routine and feeling disingenuous and I wanted that to change. So instead I am writing this over the weekend. Last weekend I started using a new app to keep track of everything. It's called Notion. It is extremely customizable and felt like a breathe of fresh air. In it I have a daily entry where I talk about my intentions, happenings, what I am grateful for and my action items. So I journal everyday using those now. And I come here to just talk. So don't expect it to be extremely coherent, but it will be honest, and real. I do want to touch on my interview last week Monday, it went very well. I do feel as if I could have answered for longer. I always seem to end early. I pride my self at being able to be clear and concise but sometimes I get nervous and am unable to elaborate on my ideas. I did answer all the questions correctly and well, but wish I would have said more. I haven't heard from them now and it has been a couple weeks. But the next step doesn't start for 6 days so I feel like no news is good news. This past week was a bit slower and more routine. Using my new tracker I was able to record what happened everyday and love the fact that I can go back and see where my strengths are, and my weaknesses. I noticed the trend that I fall short on my nightly stuff a lot more than my morning stuff. I started a couple new for fun projects as well. One of them is an exploratory analysis of League of Legends games. I have been playing for over 10 years now and love the idea of deep diving into how to win more often. I also am starting a new NLP project with my friend from Harvard. Right now our plan is to take millions of Amazon reviews and perform sentiment analysis. But we are having issues getting access to the data set. So if we need to use a smaller dataset it shouldn't be an issue. The important part is getting a proof of concept and showing that we can do complex analysis on complicated datasets. Anyways, my train of thought has officially entered the station and I think it is time to call it. I hope you enjoyed my much less structured take on my week. It's different, but it feels like more me.
Ubuntu を 75Hz から 144Hz にする
Tags: ubuntu
Published: 2022-06-13 17:40:25




## 問題

Mac と比べて同じモニターを使っていても、動作が遅くてイライラした。

Ubuntu はデフォルトでは モニターの最大周波数に OS の周波数を合わせてくれないようだ。

## 解決策

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

Settings/Displays/RefreshRate 

これを 144Hz (私のモニターの最大値) にすることで解決した。

動作が機敏で死ぬほど作業が捗る♡
Dynamic Module Imports in javascript
Tags: javascript, webdev, programming, tutorial
Published: 2022-06-13 17:39:49

If you are reading this article then you are most likely aware of static module imports.

![static import syntax](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o7u0ymwv16bfy0p5p681.png) The above code allows you to split up your JavaScript across multiple files and import them only when needed. The issue, though, is this code is always downloaded immediately by the browser leading to potentially slow page loads. This is where dynamic module imports come in.

**<u>How To Use Dynamic Module Import?</u>**

Dynamic module imports are very similar to static module imports, but the code is loaded only when it is needed instead of being loaded right away. This means your page load speed will be much quicker and the user will only ever load JavaScript code that they are actually going to use.
 
Here is a simple example of how to download the above module using dynamic module imports.

![Dynamic import syntax](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mhv02ayhj62729irsych.png) As you can see this code is pretty similar to using a normal import but instead, this import is a function that returns a promise. This promise contains all the details of the module.

You will notice, though, that the default export of the module must actually be destructured from the promise return value. This is why we have the code default: User which is mapping the default export to the User variable.

**<u>You can also use async/await to clean this up even more.</u>**

![Dynamic import using async/await](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u1gkibmczghy9xrwal7t.png) This code works the same as the promise-based version, but in my opinion, is a bit cleaner and easier to work with.
How to Solve Cors Error in Frontend
Tags: javascript, webdev, programming, tutorial
Published: 2022-06-13 17:31:18


![Cors Error](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kj1dordc1rzz9frmr9n7.jpg)
CORS, also known as Cross-Origin Resource Sharing, is something every web developer has to deal with at some point. Chances are if you are reading this article then you are probably dealing with a CORS error right now. In this article I will tell you what CORS is and how you can fix CORS errors.

**<u>Solution</u>**
**1. Install CORS plugin**

![Cors Plugin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/feevlzq9se8dslel6xkd.png)

**2.Install Above plugin And Enable CORS plugin**

**3.plugin interface will be like below image**


![Enable/ Turn on Cors](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nyodwfl5ecxwzjyswhst.png)
Flood Fill
Tags: leetcode, dsa, theabbie
Published: 2022-06-13 17:30:41

An image is represented by an `m x n` integer grid `image` where `image[i][j]` represents the pixel value of the image.

You are also given three integers `sr`, `sc`, and `newColor`. You should perform a **flood fill** on the image starting from the pixel `image[sr][sc]`.

To perform a **flood fill**, consider the starting pixel, plus any pixels connected **4-directionally** to the starting pixel of the same color as the starting pixel, plus any pixels connected **4-directionally** to those pixels (also with the same color), and so on. Replace the color of all of the aforementioned pixels with `newColor`.

Return _the modified image after performing the flood fill_.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/06/01/flood1-grid.jpg)

**Input:** image = \[\[1,1,1\],\[1,1,0\],\[1,0,1\]\], sr = 1, sc = 1, newColor = 2
**Output:** \[\[2,2,2\],\[2,2,0\],\[2,0,1\]\]
**Explanation:** From the center of the image with position (sr, sc) = (1, 1) (i.e., the red pixel), all pixels connected by a path of the same color as the starting pixel (i.e., the blue pixels) are colored with the new color.
Note the bottom corner is not colored 2, because it is not 4-directionally connected to the starting pixel.

**Example 2:**

**Input:** image = \[\[0,0,0\],\[0,0,0\]\], sr = 0, sc = 0, newColor = 2
**Output:** \[\[2,2,2\],\[2,2,2\]\]

**Constraints:**

*   `m == image.length`
*   `n == image[i].length`
*   `1 <= m, n <= 50`
*   `0 <= image[i][j], newColor < 216`
*   `0 <= sr < m`
*   `0 <= sc < n`

**SOLUTION:**

    class Solution:
        def ff(self, image: List[List[int]], i, j, newColor: int, currColor) -> List[List[int]]:
            m = len(image)
            n = len(image[0])
            if i >= 0 and j >= 0 and i < m and j < n and image[i][j] == currColor:
                image[i][j] = newColor
                self.ff(image, i - 1, j, newColor, currColor)
                self.ff(image, i + 1, j, newColor, currColor)
                self.ff(image, i, j - 1, newColor, currColor)
                self.ff(image, i, j + 1, newColor, currColor)
        
        def floodFill(self, image: List[List[int]], sr: int, sc: int, newColor: int, currColor = None) -> List[List[int]]:
            currColor = image[sr][sc]
            if currColor != newColor:
                self.ff(image, sr, sc, newColor, currColor)
            return image
Make your React Native app 3x smaller with one simple command
Tags: reactnative, javascript, programming, tutorial
Published: 2022-06-13 17:25:36

## <u>Ways to Reduce React Native APK Size</u>

1. - Migrating to React Native from Expo
2. - Make Changes in android/app/build.gradle
   - 2.1 Set def enableProguardInReleaseBuilds = true
   - 2.2 Set def enableSeparateBuildPerCPUArchitecture = true 
 

## <u>1.Migrating to React Native from Expo</u>

I Love everything about Expo except the size of the binaries. Each binary weighs around 25 MB regardless of your app.

So the first thing to do is migrate the existing Expo app to React Native. This is the simplest and coolest method to reduce your APK

To migrate the expo app 1st step to follow is

open your root directory and execute the following the command

![expo eject](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/saz548jezpcq7xc6wcm6.png)

This will download the required dependencies and build native projects under the ios and android directories.

**<u>2.Make Changes in android/app/build.gradle</u>**
This is what you have been waiting for, I know.

- Open up android/app/build.gradle
- Set def enableProguardInReleaseBuilds = true

 this would enable Progaurd to compress the Java Bytecode. This reduces the app size by a tad bit

- Set def enableSeparateBuildPerCPUArchitecture = true.

Android devices support two major device architectures armebi and x86. By default, RN builds the native libraries for both these architectures into the same apk.

   Setting the last function creates two distinct apk in the build folder. You have to upload both of these apk to Play Store and Google would take care of distributing the app to the correct architectures

Using this split generates version numbers for both apk's in the order of 104856 and such. This is auto-generated by the build to avoid version conflicts, so dont freak out (i did).

This split reduced the apk size from around 7mb to 3.5mb for arm and 5mb for x86 respectively.

**<u>yeah</u>**
so thats how you lose weight. Reducing the size of your app has many added benefits, the best being more users will be willing to download your app. And the app won't consume more space in the user device
Common Voice dataset tops 20,000 hours
Tags: webdev, opensource, speechrecognition, community
Published: 2022-06-13 17:22:27

The latest Common Voice dataset has achieved a major milestone: More than 20,000 hours of open-source speech data that anyone, anywhere can use. The dataset has nearly doubled in the past year.

**Why should you care about Common Voice?**

- Do you have to change your accent to be understood by a virtual assistant? 
- Are you worried that so many voice-operated devices are collecting your voice data for proprietary Big Tech datasets?
- Are automatic subtitles unavailable for you in your language?

Automatic Speech Recognition plays an important role in the way we can access information, however, of the 7,000 languages spoken globally today only a handful are supported by most products.

[Mozilla’s Common Voice](https://commonvoice.mozilla.org/) seeks to change the language technology ecosystem by supporting communities to collect voice data for the creation of voice-enabled applications for their own languages. 

**Common Voice Dataset Release**
This release wouldn’t be possible without our contributors — from voice donations to initiating their language in our project, to opening new opportunities for people to build voice technology tools that can support every language spoken across the world.

Access the dataset:(https://commonvoice.mozilla.org/datasets)

Access the metadata:(https://github.com/common-voice/cv-dataset)

#### Highlights from the latest dataset:

- The new release also features six new languages: Tigre, Taiwanese (Minnan), Meadow Mari, Bengali, Toki Pona and Cantonese.
- Twenty-seven languages now have at least 100 hours of speech data. They include Bengali, Thai, Basque, and Frisian.
- Nine languages now have at least 500 hours of speech data. They include Kinyarwanda (2,383 hours), Catalan (2,045 hours), and Swahili (719 hours).
- Nine languages now all have at least 45% of their gender tags as female. They include Marathi, Dhivehi, and Luganda.
- The Catalan community fueled major growth. The Catalan community’s Project AINA — a collaboration between Barcelona Supercomputing Center and the Catalan Government — mobilized Catalan speakers to contribute to Common Voice. 
- Supporting community participation in decision making yet. The Common Voice language Rep Cohort has contributed feedback and learnings about optimal sentence collection, the inclusion of language variants, and more.
 
**Create with the Dataset**

How will you create with the Common Voice Dataset?

Take some inspiration from technologists who are creating conversational chatbots, spoken language identifiers, research papers and virtual assistants with the Common Voice Dataset by watching this talk: 
(https://mozilla.hosted.panopto.com/Panopto/Pages/Viewer.aspx?id=6492f3ae-3a0d-4363-99f6-adc00111b706)

Share with us how you are using the dataset on social media using #CommonVoice or sharing on our Community discourse.