teleren/devto huggingface dataset:
In this together.
Published: 2022-08-10 21:14:45

This weeks blog prompt is collaboration. Prior to my time in the Develop Carolina apprenticeship I really had no idea how important teamwork and collaboration is in software development. Getting a glimpse of how actual software and actual teams go from idea to product was absolutely mind blowing and it involves 100% collaboration from several teams.

From my perspective, I think the key to successful collaboration is having a safe open environment. Everyone should feel comfortable sharing their ideas and thoughts. This leads to trust and you can't have collaboration without trust. That's how I plan to approach working with my partner Shaun 🤜🤛 `(virtual fist bump Shaun)` on our Umbrella Project. Up until this point through the ideation and planning steps I developed this idea solo. That only provided me with only one perspective and a single set of ideas. Having someone to collaborate with provides new perspectives and of course double the ideas!  I think communication and further getting to know one another will be the key to a successful umbrella project. Learning each others strengths and weaknesses and utilizing that will allow us to be more productive and successful. I think this really applies to the project as well as in our host company teams.

I'm not a writer and sometimes I find it hard to put thoughts into words! So I hope this makes sense. 😆
Building a Go REST client in 2022
Published: 2022-08-12 11:14:33


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

It’s 2022, and RESTful APIs are still being consumed by developers. With over 90% of developers implementing or integrating it, REST APIs have lived up to Roy Fielding’s ambitions. The introduction of Generics in Go simplifies the REST API integration. In this post, I’ll walk you through my approach to building a type-safe API client with Go. I’ll be using https://reqres.in’s API to get test data. The types defined in this post represent reqres’ API data.

Read the rest : [here](https://blog.devgenius.io/building-a-go-rest-client-in-2022-1ba8bb4c2201)
Getting impatient? Know that:
Tags: motivation, webdev, beginners, programming
Published: 2022-08-12 11:13:04


👉 The shortest path is not always the easiest or quickest.
👉 You can never know if the path you have chosen is the one to make you successful.
👉 Do your best, control what you can and leave the rest to God/ fate.
👉 Keep your mind open to learning new lessons, accept that you can be wrong, so you may improve.

Have patience. It will happen!
Don't abstract code too early
Tags: programming, productivity, codequality
Published: 2022-08-12 11:02:30

When we first learn to code we learn that abstracting is a good thing.

> "You should avoid repeating duplicate code. Follow DRY (Do not Repeat yourself"

This advice is well-intentioned and wholly correct in many cases. But not all cases.

The readability, timing and usefulness of abstraction are just as important to consider as DRY.

## Some good reasons to make you think twice before abstracting

1. If you abstract too early you won't really understand the different facets of how the code should be used.

2. You can over-engineer/over-predict what you need. This seems innocuous but from my experience this causes some of the most catastrophic bugs and tech debt.

3. Sometimes they really should be different blocks of code or functions. They may seem similar - but it may just work better if they are separate.

4. They can be harder to test. And as an extension harder to maintain.

## Some useful things to consider before abstraction

1. Do I need this abstraction now? If it only used in one scenario don't anticipate a scenario that hasn't arrived yet.

2. Do I sufficiently know what I need to abstract?

3. Are the cases I am wanting to accomodate with the abstracted code really simpler using the same code?

4. Can I easily test the abstracted code and make sense of what it does?
What Is Webflow?
Published: 2022-08-12 10:56:00

Webflow is a web-development platform; used for creating websites without coding skills, which makes it efficient for people who have no desire to learn how to code. It allows designers to build websites using HTML, CSS, and JavaScript in a visual canvas. Designers can put together a professional looking website in a matter of minutes without having to do to much.  
With Webflow, there's more room for customization compared to other platforms like Wix or Squarespace. Also, you can create a website from scratch or  use a template provided on Webflow. 


**How To Get Started?** 

To get started, first using the browser of your choice, you have to create an account on webflow.com. After signing up, create a new project, and click on the "Designer" page or the "Editor" . 
Before getting started, there are a guides to show you the different tools and their uses. These guides are available to help you settle in more quickly, and if you're familiar with web design using html, CSS and JavaScript, you'll find that the tools are similar. 

The image reveals the blank canvas. Here's the section where  you'll be doing all the work. 

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

Let's start with the add element option,  situated at the left corner of the page. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xfdprl7vkuvl6e13savv.png)
This sections contains various options to help you set up your page. Examples are layout, grid, column, and container. 
We can create a section on the page, and add different things within the section. What this means is,  If we give the entire section a background we can also add different things on-top of it. 

On the right corner of the page is where we can edit everything from the background, to the font-size to the borders and effects etc. 

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

To be able to use Webflow efficiently, you must first understand the dashboard and all it entails, and the best part is that as a beginner, web-flow provides a guide to show you the necessary steps to take when creating a website from scratch. 

I would suggest that before you begin, take a few minutes to examine the use of all the tools on the editor. 
You probably would not be able to learn all at once until you start putting it into practice, and a little introduction to the basic would help you find your way.
How to Give Users the Power to Query Their Own Data
Tags: php, laravel, vue
Published: 2022-08-12 10:50:28

---
title: How to Give Users the Power to Query Their Own Data
series: Byte-Sized Examples
published: true
description: 
tags: php, laravel, vue
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e5axnw1984nbv2tt15z0.png
# Use a ratio of 100:42 for best results.
---

Be a hero, and give your Users the power to filter and query their own data.

The feature I've most often been asked for is some sort of ability to filter and search data. 

Users love to have control and insight into their data, and often this doesn't take the form of complex graphs and charts but simple lists with search fields and filter options.

## Part 1: Text Search && Tag Filtering

We'll start with a simple client list, and then add on a text search field and select box to send `filters` to the server that will be used in our `clients` database query.

1. Search Text will apply to name fields, email, and description.
2. Selected Client Tags will apply to any Clients that have matching tags.

In future videos we will cover other filters and options that can make our Client Grid more user-friendly.

{% youtube 6NXyDSu9kqQ %}
Job Announcement Website: Creating Superuser
Tags: javascript, webdev, react, opine
Published: 2022-08-12 10:37:00

{% embed https://dev.to/sokhavuth/table-of-contents-2o4e %}
GitHub: [https://github.com/Sokhavuth/opine-job](https://github.com/Sokhavuth/opine-job)
Deno Deploy: [https://khmerweb-job.deno.dev/users](https://khmerweb-job.deno.dev/users)
<br/>
<p>
Login is the process of verifying or authenticating certain registered users for them to get into some forbidden pages. As the result, first of all, we need to register those special users in the database so that when they try to log into the dashboard or some other forbidden pages, we can check in the database if they are registered or not. If they are registered, we can write code to let them get into those forbidden areas, otherwise, we will not.
</p>
<p>
Before achieving this goal, we need to create a user collection in MongoDB database to register a superuser or manager for him/her to register other special users and control the dashboard.
</p>
<p>
On the other hand, for the security of user's password, we can use bcrypt package to hash user's passwords so that nobody can read and understand those passwords even the administrator(s) of the website.  Here is an example of a hashed password: $2a$08$zuHtXr2ITSIHYfLL/kaj9uo7XTZiL/rNJV0jdJB/7HIHFmuSGWb7C.
</p>

```js
// controllers/users/login.js

import login from "../../views/users/login.jsx";
import userdb from "../../models/user.ts";


class Login{
    async getForm(req){
        const config = req.mysetting();
        config.page_title = "Login Page";
        config.route = '/users/login';

        userdb.createRootUser(req);

        return await login(config);
    }
}


export default new Login();
```

```ts
// models/users.ts

import { bcrypt } from '../deps.ts';


interface UserSchema {
    _id: ObjectId;
    id: string; 
    title: string;
    content: string;
    thumb: string;
    date: string;
    role: string;
    email: string;
    password: string;
}

class User{
    async createRootUser(req){
        const id = Date.now() + Math.round(Math.random() * 1E9).toString();
        const salt = await bcrypt.genSalt(8);
        const hashPassword = bcrypt.hashSync('xxxxxxxxx', salt);

        let newUser = {
            id: id, 
            title: 'Sokhavuth',
            content: '',
            thumb: '',
            date: '',
            role: 'Admin',
            email: 'vuthdevelop@gmail.app',
            password: hashPassword,
        }
 
        const users = req.mydb.collection<UserSchema>("users");
        await users.insertOne(newUser);
    }
}


export default new User();
```
Universal passwordless authentication - The beginning
Tags: authenticaton, passwordless, mfa, webauthn
Published: 2022-08-12 10:34:00

Since quite some time now, I've toyed around the idea of making an authentication platform ...and I'm starting doing it! I'm currently on a parental leave, freed from the corporate life and in my evening hours, when the kids are sound asleep, I thought I would give this a shot.

I always found the authentication landscape kind of broken. For both users and developers. On one side, for users, you have to register separately on every damn website, with frustratingly complex passwords while your grandma is again the victim of a phishing attack anyway. On the other side of the fence, just implementing a secure authentication system a time consuming piece of work ...and with a lot of unexpected complexity (yeah, I look at you OAuth2!). And if you want something really safe with MFA, oh boy ...well, no wonder there are so many paid identity providers. Just for what? Just to authenticate users.

So here it goes, let's simplify that for everyone! Global identities with passwordless authentication. Just put your finger on your phone sensor or look at your laptop's camera to register/login, that's it. If you want to try it out, here it is:

{% embed https://dagnelies.github.io/passwordless-www/ %}

This is all thanks to a recent w3c protocol called webauthn. However, no matter how great this protocol is, it also has a big shadow side: its sheer complexity. Hundreds of pages of specs, obscure binary data structures, unintuitive corner cases and so on.

So well, that's why making a "working out of the box service" would make sense to me, and that is what I'm attempting to build here. Ideally for free for everyone, sustained by some magical sponsorships, but this sounds like utopia to me right now. Currently, it's, ahem, just at its early infancy. It's like a baby just looking around, waiting to grow up in a fine service. Heck, it does not even have a proper domain name yet!

So why am I showing such an early, far from finished, completely messy thing? Well, to gather interest. As a solo dev, it's kind of lonely to just develop in the void without any feedback ...and your head is haunted with questions like "is it worth it?" and "will anybody use it anyway?". So, if you like what you see so far, please cheer for me! :D You are very welcome to also tell me what you would like to see next, or just tell me you liked it so far. Thank you for reading!
Map Dropbox as a network drive on Mac and Windows with Commander One
Tags: dropbox, mount
Published: 2022-08-12 10:16:47

Today, FTP  is the file transfer system that offers greater security. There is a variety of amazing FTP client software available, but the best free FTP client for Mac is below.

Commander One is an FTP client for Mac that makes it quick and easy to map multiple Dropbox accounts to your computer, so you can easily manage all your files from your Windows or Mac computer. Enjoy better online file management directly from Finder on macOS, and map Dropbox as a network drive without the need for installation.

Therefore, you can read this article in detail and know more:
https://ftp-mac.com/mount-dropbox-mac/
Introduction
Tags: intro
Published: 2022-08-12 10:08:38

---
title: Introduction
published: true
description: Introduction to my blog
tags: intro
cover_image: 'https://raw.githubusercontent.com/boulix3/devblog/main/posts/assets/matrix-header.jpg'
id: 1165813
---

Hello, I'm starting this blog to keep track of my progress.

Starting september, I'll try to post a few times per week over the following few months.

A few themes I'll be bloging about include : 
- Custom [avalanche subnets](https://support.avax.network/en/articles/4064861-what-is-a-subnet) using [.NET](https://github.com/dotnet/runtime)
- IOT related tutorials - I just purchased two of these [boards](https://github.com/Xinyuan-LilyGO/T-ZigBee/) and I am starting with zero knowledge.
- Random stuff

Hope you have fun following me :)
Intro to TypeScript Part 2
Published: 2022-08-11 15:47:00

**Classes in TypeScript** - TypeScript supports access modifiers (private, public and protected) (it will be public by default) In this example, we do not access to firstName and lastName because they are private only to the class, User. 
readonly- makes a property as read-only(value cannot change once it is set). 
Interface- In the interface, UserInterface, TypeScript expects the function getFullname in class User or their will also be an error.
Static property- only accessible on the class itself and not the instance
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xinkt9wb8mvlzmwapsnn.png)
**Generics, interfaces, and functions in TypeScript**
Generics- all generic datatypes are written inside <> (instead of using any, you use generics) Instead of using multiple interfaces, we used generics (allows use to provide different data types)
Interfaces- set rules and syntax that any entity must adhere to.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tui8yoz8stzshvndtqei.png)
**Enums(enumerable) in TypeScript** 
Enum is the reserved word to create enumerable (should be all capitalized)
*values should be assigned with an equal sign instead of a : *![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kriczm2on8x8of38uyao.png)
Next blog: Typescript in React
Reference:
TypeScript official documentation:
https://www.typescriptlang.org/docs/handbook/intro.html
https://www.youtube.com/watch?v=gp5H0Vw39yw&ab_channel=freeCodeCamp.org
Lowest Common Ancestor of a Binary Search Tree
Tags: python, programming, leetcode
Published: 2022-08-12 09:44:00

Given a binary search tree (BST), find the lowest common ancestor (LCA) node of two given nodes in the BST.

According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).”


```py
class Solution:
    
    def lowestCommonAncestor(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode') -> 'TreeNode':    
        if root == None:
            return None
        
        node = root
        
        while node:
            
            if node.val < p.val and node.val < q.val:
                node = node.right
            
            if node.val > p.val and node.val > q.val:
                node = node.left
            else:
                break
                
        return node
        
        
        
        

```
Linux Command: apt
Tags: linux, linuxcommand, command, parrotsec
Published: 2022-08-12 09:39:50

apt 2.2.4 (amd64)
Usage: apt [options] command

apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.

Most used commands:
- list - list packages based on package names
- search - search in package descriptions
- show - show package details
- install - install packages
- reinstall - reinstall packages
- remove - remove packages
- autoremove - Remove automatically all unused packages
- update - update list of available packages
- upgrade - upgrade the system by installing/upgrading 
  packages
- full-upgrade - upgrade the system by 
  removing/installing/upgrading packages
- edit-sources - edit the source information file
- satisfy - satisfy dependency strings

See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
                        
<!---This APT has Super Cow Powers.-->
Longest Common Prefix-Solution in Dart
Tags: dart, leetcode, programming
Published: 2022-08-12 09:35:08

## Question - Difficulty -Easy

Write a function to find the longest common prefix string amongst an array of strings.

If there is no common prefix, return an empty string "".

Example 1:

Input: Strings = ["flower","flow","flight"]
Output: "fl"

Example 2:

Input: Strings = ["dog","raceCar","car"]
Output: ""
Explanation: There is no common prefix among the input strings.

Constraints:

1 <= Strings.length <= 200
0 <= Strings[i].length <= 200
Strings[i] consists of only lowercase English letters.

## Theoretical Description

1. Iterate through the string one by one from S1 till SN.
1. Start comparing the 0th index, 1st index … ith index simultaneously for each string.
1. In case, any of the ith index characters doesn’t match, terminate the algorithm and return the LPS(1,i)
1. Else, continue and after scanning of N strings, the LCP(S1…SN) can be obtained.

## Reminder:-

Both solution are perfect but the thing with the first solution is it take too much time  to execute. so it end up with Time Exceed Error.

### BUT

Second Solution works like a charm.

```dart
class A {
  // Not Working - Horizontal Scan
  String longestCommonPrefix(List<String> strs) {
    // Checking if the list is empty
    if (strs.length == 0 || strs.isEmpty || strs.length == '') return "";

// Storing the first index value in a variable
    String prefix = strs[0];

// looping the whole length of list inside the list
// like how many strings are available
    for (var i = 0; i < strs.length; i++) {
      // storing the whole list in a variable
      String c = strs[i];
      if (c.length == 0 || prefix == "") return "";
      // setting the first index starting point in subString 0 is first string
      // AND  entire length of the remaining list
      prefix = prefix.substring(0, min(prefix.length, c.length));
      for (var j = 0; j < c.length && j < prefix.length; j++) {
        if (c[j] != prefix[j]) {
          prefix = prefix.substring(0, j);
          break;
        }
      }
    }
    return prefix;
  }
}

class B {
  // Vertical scan -Working
  String longestCommonPrefix(List<String> strs) {
    if (strs.length == 0 || strs.isEmpty || strs.length == '') return "";

    // looping through the length of list
    for (int i = 0; i < strs[0].length; i++) {
      // storing the value of first index and the other strings
      String c = strs[0][i];

      // looping again the entire length without index
      for (int j = 1; j < strs.length; j++) {
        // if the the length is same as  the length of the above loop
        //OR indexes of the list is not same as above
        if (i == strs[j].length || strs[j][i] != c)
          // returning the first index and subString starting
          // from first index and the remaining index
          return strs[0].substring(0, i);
      }
    }
    return strs[0];
  }
}
```

Runtime: 426 ms, faster than 100.00% of Dart online submissions for Longest Common Prefix.
Memory Usage: 141.9 MB, less than 100.00% of Dart online submissions for Longest Common Prefix.
Run Python code on AWS Batch.
Published: 2022-08-12 09:23:48


## Run Python code on AWS Batch.

![AWS Batch Logo](https://cdn-images-1.medium.com/max/2000/1*z8AdjOXd-OaWruIHYF779g.png)

I have published 3 articles on how to run our basic python code on AWS batch, it is a step-by-step approach to how to create python code and then how to run our python code on Docker, and how to upload containerized solution on AWS Repository.

After that, how to run the containerize solution on AWS batch.

And here is the flow Diagram of AWS Batch

![Block Diagram of the whole project.](https://cdn-images-1.medium.com/max/2088/1*J93wFX4zh92OYxBuxm7BCQ.png)

 1. [**Run a Python code on AWS Batch Part — 1: Creation of Python Script and Docker Container.](https://medium.com/codex/run-a-python-code-on-aws-batch-part-1-creation-of-python-script-and-docker-container-1b01dc89eaed)**

 2. [**Run a Python code on AWS Batch Part — 2: Uploading Data to ECR and Creation of Computing Environment.](https://medium.com/codex/run-a-python-code-on-aws-batch-part-2-uploading-data-to-ecr-and-creation-of-computing-c5dab12cd3eb)**

 3. [**Run a Python code on AWS Batch Part — 3: Creation of Job Queues, Job definitions and Run Jobs.](https://medium.com/codex/run-a-python-code-on-aws-batch-part-3-creation-of-job-queues-job-definitions-and-run-jobs-6ee0dd49e582)**