teleren/devto huggingface dataset:
In-context AI chat with GitHub Copilot
Tags: ai, chatgpt, editors
Published: 2023-08-02 10:00:17

---
title: In-context AI chat with GitHub Copilot
published: true
description: Using the CMD or Ctrl and I shortcut you can chat with AI using GitHub Copilot about a certain part of code. When you ask to modify the code, you get an inline code view.
tags: ai,chatgpt,editors
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/flv75zqo2o0gtj1ew543.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-08-02 09:49 +0000
---

Generative AI is only as good as its integration in your work environment. GitHub Copilot Chat in Visual Studio Code is a great example how to do that right. 

![Recording showing the interaction in Visual Studio Code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8l05vbfvnih2gz3o5fn0.gif)

You can highlight code in the editor and press `CMD + I` on Mac or `Ctrl + I` on Linux/Windows and you get a text box to chat about this piece of code. For example, you can ask Copilot to explain it.

If you ask Copilot to modify the code, for example by asking it to add step-by-step instructions, it won't replace the code immediately, but give you a diff view to see and change the recommendations before applying them.

Together with an extension to verify the validity of your code, like [webhint](https://webhint.io) this becomes a safe and thoroughly enjoyable way of working.

Generative AI is amazing - but good UX makes it even better.
React Performance Boost: An Introduction to Million.js
Tags: react, javascript, webdev, performance
Published: 2023-08-02 09:56:02

---
title: "React Performance Boost: An Introduction to Million.js"
tags: #react #javascript #webdev #performance
series: "Performance Optimization with Million.js"
published: true

---

## Table of Contents
1. [What is Million.js?](#what-is-millionjs)
2. [How to Install Million.js](#how-to-install-millionjs)
3. [Basic Usage of Million.js](#how-to-use-millionjs)
4. [Performance Improvement with Million.js](#performance-improvement-with-millionjs)
5. [Conclusion](#conclusion)

## <a name="what-is-millionjs"></a>1. What is Million.js?

Million.js is a library to speed up React components. It's touted that React component performance can be improved by up to 70%[^1^].

## <a name="how-to-install-millionjs"></a>2. How to Install Million.js

Million.js can be easily installed via npm. Just run the command below.

```bash
npm install million
```

## <a name="how-to-use-millionjs"></a>3. Basic Usage of Million.js

The basic usage of Million.js is to simply wrap your React component with a function called `block`. Here's an example.

```jsx
import { block } from "million";

function Lion() {
  return (
    <img src="https://million.dev/lion.svg" />
  );
}

const LionBlock = block(Lion);
```

In this way, you can speed up your React components using Million.js.

However, at this point, it cannot be used with UI component libraries, and there are some restrictions such as the spread syntax cannot be used when passing props to components[^1^].

## <a name="performance-improvement-with-millionjs"></a>4. Performance Improvement with Million.js

Million.js is not a substitute for React. It works with React to improve React's performance. It uses its own virtual DOM to increase rendering speed and optimize re-rendering.

Optimization of re-rendering is realized by a mechanism called block virtual DOM. This consists of 'static analysis' that parses the virtual DOM and extracts dynamic parts, and 'dirty check' where the DOM is directly updated when the state changes[^1^].

As for the specific performance improvement values, it may greatly depend on the type of application, the complexity of the React components used, and how you use Million.js. Therefore, the best way to get specific figures is to conduct benchmark tests on your own application.

## <a name="conclusion"></a>5. Conclusion

Million.js is a powerful library to speed up React components. It optimizes rendering speed using its own block virtual DOM and makes re-rendering efficient. Further performance improvements and relaxation of restrictions can be expected in future updates.
Wednesday Links - Edition 2023-08-02
Tags: java, jvm, architecture, git
Published: 2023-08-02 09:45:42

G1 String Deduplication Doesn't Fully Deduplicate Strings (8 min)🏷️
https://justinblank.com/experiments/g1stringdeduplication.html

The Inner Workings of Safepoints (8 min)✴️
https://mostlynerdless.de/blog/2023/07/31/the-inner-workings-of-safepoints/

Sliced Onion Architecture (9 min)🧅
https://www.odrotbohm.de/2023/07/sliced-onion-architecture/

Build Rot: The Hidden Technical Debt in Maven and Gradle Builds (5 min)🐛
https://foojay.io/today/build-rot-tech-debt/

Why is DNS still hard to learn? (7 min)🪨
https://jvns.ca/blog/2023/07/28/why-is-dns-still-hard-to-learn/

Is software getting worse? (6 min)📉
https://blog.ploeh.dk/2023/07/24/is-software-getting-worse/

Lazy Git (1 min)🦥
https://github.com/jesseduffield/lazygit
Meet Me
Tags: webdev, javascript, programming, beginners
Published: 2023-08-02 09:41:53

Introduction:
Hello, everyone! I'm delighted to introduce myself as Hamish Leahy, a passionate and dedicated software developer with a love for all things tech. With a strong background in programming and a curious mind, I thrive on the challenges that the ever-evolving world of software development brings. Whether it's crafting elegant code, solving complex problems, or building innovative solutions, I am always eager to explore and learn new technologies. Let me take you on a journey through my experience and expertise as a software developer.

About Me:
As a software developer, my journey began with a deep-rooted fascination for computers and technology. From an early age, I found myself captivated by the endless possibilities that programming could offer. I pursued this passion and obtained a degree in Computer Science, which laid the foundation for my career.

Over the years, I've had the privilege of working on a diverse range of projects, from web applications to mobile apps and everything in between. My experience has allowed me to become proficient in various programming languages, including Python, Java, JavaScript, and C#. Additionally, I'm well-versed in popular frameworks and libraries, such as React, Django, and Node.js.

What sets me apart as a software developer is my ability to bridge the gap between creativity and functionality. I take great pride in crafting clean, efficient, and maintainable code, while also understanding the importance of user experience and design aesthetics.

Collaboration is at the core of my approach to development. I enjoy working in dynamic teams where diverse perspectives come together to create exceptional products. My strong communication skills and adaptability enable me to engage with stakeholders, understand project requirements, and deliver solutions that align with business goals.

Outside of coding, you'll find me exploring new technologies, attending tech meetups, and constantly seeking ways to enhance my skills. I strongly believe in the power of continuous learning and growth, and I'm always eager to share my knowledge and learn from others.

In summary, I am Hamish Leahy, a software developer driven by a passion for innovation and an unwavering commitment to excellence. I strive to make a positive impact through technology and create solutions that make life easier, better, and more enjoyable for people all around the world. I am excited to collaborate, learn, and contribute to the ever-evolving landscape of software development.
Welcome Thread - v236
Tags: welcome
Published: 2023-08-02 09:30:00

---
title: Welcome Thread - v236
published: true
description: Welcome to DEV! A thread of hellos and intros.
tags: welcome
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9gl6twd8r59cvwqlllw7.jpg
published_at: 2023-08-02 09:30
---

![emoji hand waving hello on a blue background](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5qe80u1ocv3f179dq1mn.gif)

---

1. Leave a comment below to introduce yourself! You can talk about what brought you here, what you're learning, or just a fun fact about yourself.

2. Reply to someone's comment, either with a question or just a hello. 👋 

3. If you are new to coding, want to help beginners in their programming journey, or just want another awesome place to connect with fellow developers, check out the [CodeNewbie Org](https://dev.to/codenewbieteam)!
The limitation of legacy security tools
Published: 2023-08-02 09:09:57

SAST & DAST
Static Application Security Testing (SAST), though having full code coverage, generates too many false positives. Dynamic Application Security Testing(DAST), despite its high accuracy, has no code-level visibility.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o0h2ivt5gu0xejsnyqqh.png)
Solving the 'Palindrome Number' on LeetCode with C++
Tags: leetcode
Published: 2023-08-02 09:08:18

## Problem
https://leetcode.com/problems/palindrome-number/

## Answer 
```
class Solution {
public:
    bool isPalindrome(int x) {
        if (x < 0) return false;

        long reversedX = 0;
        int originalX = x;
        while (x != 0) {
            reversedX = reversedX * 10 + x % 10;
            x /= 10;
        }

        return originalX == reversedX;
    }
};
```

Let's consider a solution to this problem.

We want to know whether an integer is a palindrome or not.

It's simple. If an integer and its reversed form are the same, we know the integer is a palindrome.

Let's analyze the solution as code.

```
        if (x < 0) return false;
```
Firstly, if the integer is negative, it's not a palindrome.

```
        long reversedX = 0;
        int originalX = x;
```
We define a long variable, reversedX, because it might exceed -2^31 or 2^31.

We define an int variable, originalX, because the value of x will change during the subsequent processes.

```
        while (x != 0) {
            reversedX = reversedX * 10 + x % 10;
            x /= 10;
        }
```
We want to reverse x. x % 10 gets the last digit of the integer.
For example, if x is 123, 123 % 10 gives us 3.
Then, we don't need the 3 of 123 and remove it using x /= 10.

This process continues until x is 0.

In the second loop, reversedX already has a value, so we need to add reversedX * 10 to x % 10.
For example, if x is 12 and reversedX is 3, 3 * 10 + 12 % 10 equals 30 + 2 = 32.

If we continue this process until x is 0, we will have reversed the integer.

Lastly, we can determine whether the original integer is a palindrome by comparing reversedX and originalX.
What do you do when you are burnt out but can't take a leave?
Tags: discuss, development
Published: 2023-08-02 09:03:58

This is my desperate call for help, I've been working at this company non-stop for 11 months now, it's been an endless cycle of working on projects round the clock.

I enjoyed the job at first, especially, been the founding backend developer on the team, however, recently, it has taken a toll on me as I have endlessly and tirelessly worked on a variety of projects simultaneously over the months, which is bad in my own perspective. The product managers only want to see projects completed without taking into consideration the technical details.

**Now, here's my big question**
How do you cope as a burnt out developer that still needs to deliver on projects? I need answers, hopefully, I'll get some inspiration from here.
The Default Environment: Dos & Dont's
Tags: powerplatform, powerautomate, powerapps, powerfuldevs
Published: 2023-08-02 09:02:23

Power platform developers often find themselves scratching their heads when they deploy crucial applications/automations to the default environment. As my C# professor use to say "It's like the Bermuda Triangle" of environments – easy to get lost in! The lack of clear documentation adds an extra layer of mystery, making us feel like we're deciphering ancient hieroglyphics.

So, let's unravel the enigma and find out what this default environment is all about and why it might not be the best choice for production purposes.

## What exactly is the default environment?

Think of the default environment as a pre-set production zone automatically generated for each tenant. It's like a communal playground where everyone's invited to play and they get an all-access pass to the default environment, like entering a cool club!

But beware! There are some pitfalls to avoid if you're considering the default environment for production.


## Why not risk it all on the default environment?

First of all, to keep your data and apps separate from other environments. You don't want unauthorized peeps poking around your important stuff, right? Plus, in the default environment, everyone has permission to create apps and flows, and there's no way to block that. Non-default environments give you more control over who can do what. Another reason is that you can't back it up or restore it, which can be risky for your data.

## Tips

- Create clear procedures and instructions for users to ensure proper usage of the default environment

- Implement a governance framework to oversee its operations



## Conclusion

The default env. is perfect for first-party integrations, like turning a boring SharePoint list into a bold app. But don't put your super important or business-critical apps there and remember to give it a good name to make its purpose clear.
Ask the Experts: Understanding the API Context Maturity Model - Level 1 - Authenticated API Calls
Published: 2023-08-02 09:00:00

**By: Mayur Upadhyaya & Jamie Beckland**

Welcome back to 'Ask the Experts: Understanding the API Context Maturity Model.' In our [first post of the series](https://bycontxt.com/blog/g9t2130mj7gn23bu32drhtesqzuny8?utm_source=DevTo), we explored the foundation of the model: Open, Public API calls. Now, we will move up a rung on the ladder to Level 1 - Authenticated API calls. As a reminder, we are distilling key comments from the hundreds of technology leaders we consulted to develop the [Context Maturity Model](https://bycontxt.com/blog/introducing-the-api-context-maturity-model?utm_source=DevTo), and we are sharing their thoughts anonymously to give you the most unfiltered view of the current state of APIs.

As organizations become more aware of the inherent security risks associated with entirely open APIs, they begin to implement authentication measures. API calls at Level 1 require valid credentials, adding a basic layer of security and control over who can access the API.

Drawing from our expert interviews, a CIO from a healthcare tech firm shared their experiences navigating Level 1. They remarked, "The addition of authentication measures provided a much-needed layer of security. It marked our first step towards a more secure API environment, but it quickly became clear that authentication alone was not enough."

While authenticated API calls significantly reduce the risk of unauthorized access, they do not provide granular access control, i.e., what specific data or functions a particular user can access. Therefore, while Level 1 improves upon the openness of Level 0, it still poses limitations.

An executive from a data scaleup echoed this sentiment. They stated, "Despite implementing authentication, we still faced incidents where users could access more data than necessary. The issue was not about who could access our API but about what they could access once they were in."

It's important to note that these limitations aren't indicative of any failing at Level 1. Instead, they highlight the incremental nature of the API Context Maturity Model. Each level is a step forward, addressing limitations of the previous level while setting the stage for more advanced practices.

Join us for our next installment where we'll delve into Level 2 - Authorized API Calls - where we will discuss how organizations can enhance their security measures by controlling not just who can access the API, but also what they can access.

As always, if you're looking for more insights on API security and best practices, we're here to help. Until next time!
Pathology Reporting Software: Revolutionizing Healthcare Data Management
Tags: writing, management, web, community
Published: 2023-08-02 08:32:49

[Pathology reporting software](https://www.saralpath.com) has emerged as a game-changing solution that streamlines the process of recording, analyzing, and sharing critical medical data. In this article, we will delve into the world of pathology reporting software and explore its impact on modern [healthcare](https://www.saralpath.com/saral-prohims.html) systems.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ph1e671cneegvhj06lm6.png)
**How Pathology Reporting Software is Revolutionizing Healthcare**
Pathology reporting software serves as a comprehensive solution that empowers healthcare professionals with real-time data access, automation, and intelligent insights. By digitizing and centralizing pathology data, the software offers an array of benefits that revolutionize healthcare practices.
Building a Deep Nested CLI Application with Cobra in Golang
Tags: go, cli, cobra
Published: 2023-08-02 08:30:01

---
title: Building a Deep Nested CLI Application with Cobra in Golang
published: true
description: 
tags: golang, go, cli, cobra
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/peg8amigr3g8bf2mbh99.png
# Use a ratio of 100:42 for best results.
# published_at: 2023-08-02 07:59 +0000
series: Getting Started with Cobra - Creating Multi-Level Command Line Interfaces in Golang
---

Continuing my previous [article](https://dev.to/frasnym/getting-started-with-cobra-creating-multi-level-command-line-interfaces-in-golang-2j3k) about Cobra , the powerful Golang library for building command-line interfaces, we're diving deeper into the world of CLI development. 

In this installment, we'll explore how to take advantage of Cobra's capabilities to create a deeply nested CLI application. By organizing commands and subcommands in a hierarchical structure, we can make our CLI more user-friendly, intuitive, and flexible for handling complex tasks. Join me as we embark on this journey of building a feature-rich CLI tool that showcases the true power of Cobra in Golang. Let's get started!

Implementing Deep Nesting
------------
To achieve deep nesting, we'll add subcommands under the existing config command. Let's create subcommands under `subcommand`: `deepsubcommand`.

```
// cmd/deepsubcommand.go
package cmd

import (
	"fmt"

	"github.com/spf13/cobra"
)

var deepSubCmd = &cobra.Command{
	Use:   "deepsubcommand",
	Short: "A brief description of the deepsubcommand",
	Long: `A longer description that explains the deepsubcommand
in detail. For example, you can mention how it complements
the main command and what options it supports.`,
	Run: func(cmd *cobra.Command, args []string) {
		// This function will be executed when the "deepsubcommand" is called
		fmt.Println("Running the deepsubcommand!")
	},
}

func init() {
	subCmd.AddCommand(deepSubCmd)
}
```
Lest try it with:
```
$ go run main.go subcommand deepsubcommand
> Running the deepsubcommand!
```

Conclusion:
----
In this blog post, we explored how to create a deep nested CLI application using the Cobra library in Golang. By organizing commands and subcommands hierarchically, we can build user-friendly CLIs that enhance the overall user experience. Cobra's intuitive API and support for commands, subcommands, and flags make it a powerful choice for building CLI applications in Golang.

In your own projects, you can extend this deep nested CLI application further and customize it to suit your specific use cases. Have fun experimenting with different configurations and commands to create a versatile and user-friendly CLI tool!

Footnote:
---
Full code is available on [github](https://github.com/frasnym/basic-cobra-cli/tree/feature/deep-nested-command)
OPPO ColorOSHack 2023
Tags: hackathon
Published: 2023-08-02 08:26:24

📣 Calling all developers and tech pioneers! Join the ColorOSHack 2023 Info Session to be the first to know all the details and register now to embark on this exciting journey! Stand to win up to USD$20,000 and gain the opportunity to be mentored by the OPPO R&D team and industry experts! 🤩

Develop intelligent perception solutions, create user-centered service experiences, and revolutionize smart scenario interactions using the cutting-edge OPPO Pantanal platform. Don't miss this opportunity to be at the forefront of the tech revolution!

OPPO ColorOSHack 2023 Info Session | 15th August 2023 | 11:00am - 12:00pm | Register now 👉https://plugandplay.zoom.us/webinar/register/4616909637743/WN_30AzVEg4Q56vNUYCjwq1ig 

Are you ready to be part of this tech revolution? Sign up now and unleash your potential 👉https://www.oppo.com/en/events/coloroshack-2023/
Take your performance optimization to the next level with live actionable insights from Blackfire Monitoring! 🔥
Tags: tooling, performance, news, tutorial
Published: 2023-08-02 08:22:16

Kickstart your continuous observability strategy with a 360 overview of your applications’ health with Blackfire Monitoring. Your indispensable ally–enabling you to stay ahead of issues, prioritize optimization, and respond promptly to any performance-related problems.
 
With our unique approach to continuous observability, Blackfire you will receive live actionable insights, which will equip you to make informed decisions about the health and performance of your applications.

It’s time to **[launch into continuous observability](https://blog.blackfire.io/launching-into-continuous-observability-with-blackfire-monitoring-empowering-developers-with-live-actionable-insights.html?utm_source=devto&utm_medium=organic_social&utm_campaign=blackfire_blog&utm_id=blog)**, let’s go! 🚀
Weather App: An app that fetches and displays the weather information of a given location using an API with JavaScript
Tags: javascript, api, beginners, webdev
Published: 2023-08-02 07:46:46

Building a Weather App that fetches and displays weather information using an API is an excellent project to practice working with asynchronous data and APIs in JavaScript. Below, I'll guide you through the steps to create this Weather App with code blocks for each step:

### 1. Set Up the HTML Structure:

Create the HTML structure with input fields for the user to enter the city name and a button to fetch the weather information.

![html](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e3pw3792gh7v0s1r6uzi.png)

## 2. Style the Weather App (Optional):

![css](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/spolb92dmvt8llx2zwh1.png)

![css](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lw43r9moal3qctqox57e.png)

## 3. Fetch Weather Data from API:
 In this example, we will use the `OpenWeatherMap API (https://openweathermap.org/api)` to fetch weather data.

![api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b207vr8n29t7uvk67jc0.png)

![api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dm7lugw9ipaci7rlwp28.png)

![api](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j8n9bckvlksrfe2w79f1.png)

## 4. Display Weather Information:
The display of weather information is already covered in the fetchWeatherData function.

## 5. Test the Weather App:
Test the Weather App by entering different city names and checking if it fetches and displays the weather information correctly.

## 6. Deploy (Optional):
If you want to share your Weather App with others, consider deploying it to a web hosting service or using a code sharing platform.

By following these steps and using the code blocks provided, you'll have a functional Weather App that fetches and displays weather information using `JavaScript `and the `OpenWeatherMap API`. Happy coding! 🌦️🚀