teleren/devto huggingface dataset:
Getting Started with Go: A Quick Guide.
Tags: programming, go, performance, backenddevelopment
Published: 2023-08-19 17:50:50

**Go**, also known as **Golang**, is a statically typed, compiled programming language designed for simplicity, efficiency, and ease of use. Developed by Google, it has gained significant popularity for its clean syntax, strong standard library, and excellent support for concurrency. Whether you're a seasoned programmer or just starting your coding journey, this guide will help you take your first steps in the world of Go programming.

🖥 **Installation:** 
The first step is to install the Go programming language on your system. Visit the official Go Downloads page [https://go.dev/dl/](https://go.dev/dl/) and download the installer suitable for your operating system. Follow the installation instructions to set up Go on your machine.

⚙ **Setting Up Your Workspace:**
Go has a unique way of organizing your projects. You'll want to set up your workspace properly. It uses a **GOPATH** environment variable to specify the **root** of your workspace. Create a directory structure like this:

```
├── src
│   └── yourApp
├── bin
└── pkg
```
👩‍💻  **Your First Go Program:** 

While learning a new programming language, the iconic **"Hello, World!"** 🙌🏻 program serves as the inaugural step. 
So, Create a file named **main.go** inside the **src/yourapp** directory. Open the file in a text editor and write a simple code : 

```
package main

import "fmt"

func main() {
    fmt.Println("Hello, World!")
}

```
To run your program, open a terminal, navigate to the myapp directory, and execute:
```
go run main.go
```

**Go Basics:**

- 
**Packages:**
Go programs are composed of packages. Each file belongs to a package, and the **'main'** package is required for executable programs.

- 
**Imports:**
Use the **import** statement to include packages from the Go standard library or external packages.

- 
**Functions:**
Functions are the building blocks of a Go program. The **'main'** function is the entry point for executable programs.

- 
**Variables and Types:**
Declare variables with their type **explicitly**. Go has basic types like **int**, **string**, **float64**, and more.

- 
**Control Flow:**
Go supports familiar control flow statements like **if**, **for**, and **switch**.

📌 **Concurrency:**
One of Go's standout features is its built-in support for concurrency using Goroutines and Channels. Goroutines are lightweight threads, and channels allow safe communication between them.

🔍 **Exploring the Standard Library:**
Go comes with an extensive standard library that covers everything from file handling to networking. Familiarize yourself with the official [Go Documentation](https://pkg.go.dev/) to leverage these powerful tools.

---
With its clean syntax, strong standard library, and emphasis on concurrency, **Go** is a fantastic language for both beginners and experienced developers. 
Explore the official documentation, engage with the community, and start building amazing applications with Go!.
🧠 👩‍💻
charts load faster on chainparser now.
Tags: webdev, javascript, python, blockchain
Published: 2023-08-19 17:26:48

it's been like a week-ish since we launched [chainparser](https://chainparser.com) knowing fully well that it was nowhere near fit to tackle the audacious problem of making blockchain data simple and accessible. however, a journey of a thousand miles begins with a step, so we decided to take the initial step and iterate the product regularly over time. this approach to product development falls in-line with the _"lean startup"_ principle.

after the first deployment, it was clear that it takes a considerable amount of time (~3+ seconds) to display the charts in their various cards. the worst part was that, the whole process was synchronous so the last chart to load may do so after an aggregate of 20 seconds or more. this was a major letdown for our initial users. 

the chainparser backend reads blockchain data from a third-party _"indexer"_ ([flipside](https://flipsidecrypto.com)) which executes queries in [FCFS](https://www.techopedia.com/definition/23455/first-come-first-served-fcfs#:~:text=First%20Come%2C%20First%20Served%20(FCFS)%20is%20a%20type%20of,the%20order%20of%20their%20arrival.) fashion. therefore queries have to queue up, and are executed in the order in which they were added. this made the asynchronous requests sent from the frontend to the backend all look like synchronous requests and because of the latency it became very obvious to end users.

the challenge was simple, to setup our own mini database that would serve as an intermediary for the data we read from the indexer. the science behind it was that, since the intermediary database is on-site, the travel time for data moving from the backend to the frontend will be shorter than getting the data directly from the indexer. 

we explored various options like Memcached, Memorystore, Redis, and others. but the goal was to use a simple cost-effective solution that requires less maintenance, so we settled with Datastore. [Datastore](https://cloud.google.com/datastore) is a NoSQL database product offered by Google Cloud which provides a highly scalable data storage solution via an API.

we implemented Datastore and deployed a cron job which periodically updates the database. now charts on chainparser load much faster and asynchronously. with this needed update out of the way, we can focus on adding solana data to the pack which should be ready by the end of next week. 

we encourage users to use the feedback form to file any complaints or bugs and we will diligently fix every issue over time.

if you stumbled upon this post with no idea of what chainparser is, then welcome, we are a startup with an audacious goal of making blockchain data simple and easily accessible. we currently have our website showing key metrics of [ethereum](https://chainparser.com/ethereum) with more chains to be added soon. 

we're live on X too, so [follow us](https://twitter.com/chainparser) to get updated on exciting new features and updates. 

chainparser, blockchain data made simple.
A/B testing: should you use it?
Tags: abtesting, abtest
Published: 2023-08-19 17:15:38

---
title: A/B testing: should you use it?
published: true
description: 
tags: #abtesting #abtest
# cover_image: ![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ygo3jlazmv8phv55gq3.jpg)
# Use a ratio of 100:42 for best results.
# published_at: 2023-08-19 16:28 +0000
---

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

If you decided to read this post, I hope you know what an A/B test is. Probably you either work at a startup or at some Big Company with thousands of users.

If you work at a Big Company, you just have to go with the company flow and do the A/B testing. Here are two things that might be useful for you:

- The famous [Sample Size Calculator](https://www.evanmiller.org/ab-testing/sample-size.html)
- Look at your KPIs and think about whether you can afford to [test something more interesting](https://growrevenue.io/trivial-vs-radical-ab-testing/) than the button colours.

If you work for a startup, probably you don't have much traffic. Also the majority of traffic doesn't correspond to real people...So A/B testing doesn't make much sense. In my opinion, the best option in this case would be catch some people in the hall and make videos how they use different versions of your website or app. Try to make the videos that would capture not only what's happening on the screen, but also record user's face and what he/she is saying while working with your product. When you rewatch these videos, there will be a lot of interesting discoveries!
Introduction to PostMan
Tags: postmanstudent, postmanapi, postman
Published: 2023-08-19 17:13:11

In The World of Computers, we have a lot of interconnected parts, the hardware, the software, even the data ware(just emerging). As the world of humans, a key concepts which will allow all these parts to work together is communication. As humans have their own languages( English, Spanish, Chinese.....), computers too have a means to communicate.
When two components of a software communicate, they must define some standards according to which they'll exchange data. That is where an API comes in.
Application Programming Interfaces (APIs) allow 
services to communicate with each other, exchanging data. A service is like a black box, when we have lots of black boxes they can't and shouldn't really access their internals, So an API provides a way for them to exchange data.

Postman is a collaborative API development platform that simplifies 
creating, using, and testing APIs with a UI. Basically its an API testing tool.


![Services Communication](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qkrta86f99b4w03fwqp.jpg)

In conclusion, APIs play a vital role in today's interconnected software landscape, allowing different applications to communicate and share data effectively. Postman, with its powerful features and intuitive interface, simplifies the process of designing, testing, and documenting APIs, making it an essential tool for developers and teams working with APIs.
Tired of approving dependency PRs?
Tags: automation, github, typescript, valtown
Published: 2023-08-19 17:01:56

## Dependency PRs?

I'm a huge fan of https://www.mend.io/renovate/ for updating dependencies PR by PR for multiple reasons.

So much that I even created a [shared config at work](https://github.com/bettermarks/renovate-config) with some nice docs.

## Well, they have a automerge option, right?

Yes, and recently it is implemented by enabling "automerge" in GitHub!

But for most repositories it is reasonable to require somebody to review code changes before they land, which is why we have branch protection with some status checks and at least one reviewer approval.

And since we don't want the dependency PRs to get into the way, the default option we use is to only automatically create and update them outside of office hours.

And to reduce cost for GitHub actions that are run for each dependency update PR, we only ever create one at a time.

## Repeated manual work...

So
- the creation of dependency update PRs is automated
- and the testing is automated
- for landing them it still requires a human to approve. Outside of office hours. (So it's either unlikely to get more than a handful landed per day, or it encourages people to work outside of office hours.)

And this means they usually pile up, as it visible on the nice Dependency Dashboard renovate offers.

## ... should be automated

I had some attempts on researching different options to solve this problem, like adding some github app and configuring them or adding github actions that would take care of it, but it all sounded quite complicated, so I never really did something about it.

Recently I listened to https://changelog.com/jsparty/287 and learned about https://val.town
I registered during listening to the episode (using my GitHub account) and went through the short introduction tour.

I didn't immediately have an idea what to do with it, but I was sure it wouldn't take long.

Last week it hit me:
How difficult would it be to create a val that acts as a webhook for github that would automatically approve PRs that are qualified?

{% embed https://www.val.town/v/karfau.githubWebhookApproveDependencyPRs %}

Turns out, it wasn't that difficult, even though I was new to the platform.

And I received some quick and helpful support on Discord when I was stuck. Thx for that.

And the best thing about it is, that you can fork it an use it on your own.
Heard about DENO?
Tags: typescript, deno
Published: 2023-08-19 16:55:54


**Disclaimer**; I'am a backend developer, and try to keep up with frontend, so this (my first) article can be basic for many frontend developers.

**Deno** has the same creator as NODEJS (Ryal Dahl), Deno was a project started because Ryal had many things he learned working with Nodejs, and like to change, but it was easier to start over.

Focus in Deno is Security, and it is ALL CLOSED BY  DEFAULT, so a script has to get ok, for write, read .. , and latest version access can be set on domain level.

Another big thing  is DENO doesn't have a package handler, like node, you don't download stuff, you access them the same way as you do in webpages. But.. to make transit from Node easy today Deno understands NPM, so you can slowly rewrite if you like.

But, the big thing for me is deno runs TypeScript out-of-the-box, without setting up anything,  just have an .ts extension and you can do a  
``` deno run myscript.ts ``` 
of course 
``` deno run myscript.js ``` 
for javascript works to.

## Example myscript.js

```javascript
console.log("Hello World");
```
## Example myscript.ts

```typescript
function addHello(data: string) {
	return `Hello ${data}`;
}
console.log(addHello("World"));
```

But there is another nice thing, you can write scripts for terminal, and make a standalone binary, which runs without deno, but don't forget to allow access rights, like if your script likes to read a folder, else it will not be allowed to do this.

``` deno compile myscript.ts ```
Om my windows machine it gives me a **myscript.exe**
This is just a scratch what Deno can do, read more at deno homepage 
Link: [deno.land](deno.land)

Happy hacking!
Anders
Mobile développement
Published: 2023-08-19 16:28:20

Im looking to join or form a group focused on building Flutter projects to gain practical experience. As a budding Flutter developer with 1+ years of self-directed learning, I am eager to collaborate with other developers to turn ideas into functioning apps. If you have a programming project concept and need help bringing it to life in Flutter, let's team up! I am passionate about leveling up my skills and can dedicate 7 hours per day toward our efforts. Ideal projects involve integrating with REST APIs, state management, responsive UIs, and deploying to app stores. If you have an existing Flutter project that needs fresh contributors, I would also love to dive in. Please get in touch if you are interested in starting a focused development group where we can learn, build portfolio projects, and expand our Flutter abilities together.
What makes a great API?
Tags: discuss, api, product
Published: 2023-08-19 16:08:44

What are things you look for in a great API?

I’d love to hear your thoughts on various aspects like a spec, e.g. [OpenAPI](https://www.openapis.org/), where you think is a great place to host your API, resilience, handling errors, observability, testing etc.

If you have examples of great APIs even better! And if you have recommendations for tools to help with your awesome API share those as well.

I’m curious to see people’s stacks and tools!
Bài tập chéo hoá ma trận có lời giải
Published: 2023-08-19 16:07:58



Trong đại số và hình học giải tích, chéo hoá ma trận là quá trình tìm ma trận nghịch đảo T và ma trận chéo B. Các ma trận chéo hóa rất dễ tính toán, sau khi đã tìm được các giá trị riêng và vectơ riêng của chúng. Bài viết dưới đây sẽ giúp các bạn hiểu rõ hơn định nghĩa, điều kiện và cách giải bài tập về chéo hoá ma trận.

>Tham khảo: https://ttnguyen.net/cheo-hoa-ma-tran/

#ttnguyen #ttnguyenblog #daisotuyentinh #daisovahinhhocgiaitich
How to bypass wireguard client for local network on openwrt
Published: 2023-08-19 16:00:26

Assuming your local network is 192.168.0.0/24, you should do this:

`nano /etc/config/network`

and add the following to your wireguard peer config section:

        

```
        list allowed_ips '0.0.0.0/1'
        list allowed_ips '128.0.0.0/2'
        list allowed_ips '192.0.0.0/9'
        list allowed_ips '192.128.0.0/11'
        list allowed_ips '192.160.0.0/13'
        list allowed_ips '192.168.1.0/24'
        list allowed_ips '192.168.2.0/23'
        list allowed_ips '192.168.4.0/22'
        list allowed_ips '192.168.8.0/21'
        list allowed_ips '192.168.16.0/20'
        list allowed_ips '192.168.32.0/19'
        list allowed_ips '192.168.64.0/18'
        list allowed_ips '192.168.128.0/17'
        list allowed_ips '192.169.0.0/16'
        list allowed_ips '192.170.0.0/15'
        list allowed_ips '192.172.0.0/14'
        list allowed_ips '192.176.0.0/12'
        list allowed_ips '192.192.0.0/10'
        list allowed_ips '193.0.0.0/8'
        list allowed_ips '194.0.0.0/7'
        list allowed_ips '196.0.0.0/6'
        list allowed_ips '200.0.0.0/5'
        list allowed_ips '208.0.0.0/4'
        list allowed_ips '224.0.0.0/3'
        option route_allowed_ips '1
```

You can calculate allowed IPs using the following calculators:

[Wireguard's AllowedIPs calculator
 by Savely Krasovsky's](https://krasovs.ky/2021/07/04/wireguard-allowed-ips.html)

[Pro Custodibus calculator](https://www.procustodibus.com/blog/2021/03/wireguard-allowedips-calculator/)
How to make postgresql queries case insensitive
Tags: postgres
Published: 2023-08-19 15:58:54

Scenarios when we want postgresql to act as case insensitive. We can convert columns to uppercase or lowercase using upper()/lower() to make comparisons case insensitive.
Scenarios where we would need to make such changes -
- where conditions
- Join conditions
- group by — here if put lower/upper on column then that column in select statement should have either lower/upper or other aggregate like max.
- order by columns
- having conditions
- ilike to make like case insensitive
- instead of select distinct lower(col1) from… use select distinct on (lower(col1)) col1 from… as it won’t convert value to lower case while being case insensitive.
- unique constraints are case sensitive. if using on conflict clause in insert queries then it would be case sensitive. the only solution is to remove the conflict and add extra where condition of “AND NOT EXISTS ( select 1 from … where unique constriants columns wrapped by lower())”. If on conflict () update then add update query before the insert query with extra conditions of lower() wrapped the unique constraint columns and “NOT EXISTS …” in the afterward insert query.
Curly’s Law
Tags: java, bestpractices, programming, development
Published: 2023-08-19 13:22:52

> You should answer to one thing, or do one thing only.

Curly’s law is a good concept to be used on software architecture because it reminds you that is always interesting to have your code loosely coupled and as simple as possible so you can reuse as much as you can.

You shouldn’t mix different levels of code (e.g. business rules with database access).

One simple example would be:

```java
public class ImcCalculator {
    
    public static void main(String args[]) {
      double weightInPounds = 200;
      double heightMeters = 1.70;
      
      double weightInKg =  weightInPounds / 2.205;
      double imc = weightInKg / (heightMeters * heightMeters);

      System.out.println("Your IMC is " + imc);
    }
}
```

Here you can see that there is transformation from pounds to kg and also IMC calculation, so applying the concept of Curly’s Law the result is:

```java
public class ImcCalculator {
    
    public static void main(String args[]) {
      double weightInPounds = 200;
      double heightInMeters = 1.70;
      
      final double imc = calculateImc(poundsToKg(weightInPounds), heightInMeters);

      System.out.println("Your IMC is " + imc);
    }
    
    public static double poundsToKg(final double weightInPounds) {
        return weightInPounds / 2.205;
    }
    
    public static double calculateImc(final double weightInKg, final double heightInMeters) {
        return weightInKg / (heightInMeters * heightInMeters);
    }
}
```

You could even go further and create two different classes, one as converter of weights and the second as calculator.

In conclusion, having it separated will help you reuse on different places, make it easier to test it and understand it all in general.

---

**If there is anything else that you would like to discuss leave a comment down bellow, see ya.**
What are some things that one has to be ready with before starting a side project?
Tags: discuss, programming
Published: 2023-08-19 15:56:29

I am currently building a [simple readme generator](https://github.com/khairalanam/GPRG) website as one of my personal projects. By almost at the end of the project, I realized I could have done some testing before every component is coded. And also realized I could have automated some workflows.

Sometimes I feel they are unnecessary and are just a waste of time if the project is small. But at the same time, these are some of the most underrated skills of a professional developer.

Anyways, what are your thoughts on this? And what are some things that a developer has to keep note of before or during the building of the side project?
latest() vs oldest() vs orderBy() in Laravel
Tags: laravel, database, php, webdev
Published: 2023-08-19 15:24:01

To fetch sort data, we use _latest_, _oldest_ and _orderBy_ methods in **laravel**. The difference of these methods is: _latest_ and _oldest_ methods sort data according to the _created_at_ column whereas _orderBy_ methods sort data by the lexically. 

Suppose, you have a table called post and you want to use _latest_ methods, the syntax will be: 

```
$posts = DB::table('posts')->latest()->get();
```

It will sort data based on _created_at_ column. And the syntax of the oldest methods is:  

```
$posts = DB::table('posts')->oldest()->get();
```

You can pass a column as a parameter. Let's say, I want, the data will be sorted based on title column. So, the syntax will be:

```
$posts = DB::table('posts')->latest('title')->get();
\\or
$posts = DB::table('posts')->oldest('title')->get();
``` 

On the contrary, _orderBy_ sort data lexically. 

```
$posts = DB::table('posts')->orderBy('title')->get(); \\ascending
\\or
$posts = DB::table('posts')->orderBy('title', 'desc')->get(); \\ descending
``` 

Thanks. happy coding!
An Introduction to Postgres Enterprise Manager
Tags: postgres, database, postgressql, beginners
Published: 2023-08-19 14:51:54

## Introduction
Postgres Enterprise Manager (PEM) is an all-in-one database administration solution which offers management, monitoring, and performance tuning capabilties.
This blog will attempt to briefly explain what PEM is and the core features it offers.

## Understanding Postgres Enterprise Manager (PEM)
When you install PostgreSQL, you are given the option of also installing pgadmin. If you've ever used pgadmin before, you may already be familiar with PEM. PEM can be described as a more advanced version of pgadmin 4.
PEM provides database administrators with a browser-based console platform for monitoring, performance tuning, backup management, and security enhancement.

## Key Features of Postgres Enterprise Manager
Performance Monitoring and Tuning: PEM provides key insights into database performance, identification of bottlenecks, and query optimization.
- **Alert Management**: PEM empowers database adiministrators to proactively tackle issues by allowing them to create customized alerts and notifications of critical events and potential issues.
- **Database Diagnostics**: PEM's diagnostic tools help administrators troubleshoot by highlighting performance problems. This allows for speedy root cause analysis and easy identification of effective solutions.
- **Backup and Recovery Management**: PEM simplifies backup and recovery, safeguards data integrity, and minimizes downtime through features such as Barman, Bart, and Failover Manager.
- **User Management and Security**: PEM provides extensive capabilities to efficiently manage user access and fine-tune security controls.
- **Query Analysis**: PEM can help administrators optimize database performance by analyzing complex SQL queries and pinpointing where improvements could be made. This is a crucial feature for improving query response times and increasing efficiency.
- **Capacity Planning**: PEM can provide forecasts and predictions to aid in resource planning. This can help administrators anticipate growth and allocate resources efficiently.

## Learn More
- [PEM official documentation](https://www.enterprisedb.com/docs/pem/latest/)
- [Official PEM Demo Videos](https://youtube.com/playlist?list=PLownlFUq_rL6rhJZTQJY6f_jGDZRV51Ot)