teleren/devto huggingface dataset:
Encoding genetic algorithms
Tags: beginners, algorithms
Published: 2021-09-01 10:57:27

Genetic algorithms are a fascinating technique for solving optimisation problems. If you can create a set of rules that can measure a solution's performance, you can probably use a GA to help solve the problem. Here are some ways to encode solutions.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4oc1gojv1ra5m1ao5k7.gif)

If you missed my article on the intuition of genetic algorithms, check this out before continuing: [https://rhurbans.com/genetic-algorithms-for-beginners/](https://rhurbans.com/genetic-algorithms-for-beginners/).

Real-value encoding represents a gene with numeric values, strings, or symbols. The solution is expressed in its natural state. This encoding is used when potential solutions contain continuous values that cannot be encoded easily with binary encoding.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t53raepegqyh7r43m7m1.png)

Order encoding, also known as permutation encoding, represents a chromosome as a sequence of elements. Order encoding usually requires all elements to be present in the chromosome. It's useful for problems where the sequence in the solution is important.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6ui055kj5xvmsozonopf.png)

Tree encoding represents a chromosome as a tree of elements. Tree encoding is versatile for representing potential solutions where the hierarchy of elements is important or required. Tree encoding can even represent code functions, which consist of a tree of expressions.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j04dne5drlrz2w690izh.png)

Encoding solutions is the first step in setting up a genetic algorithm for success. It can solve interesting problems on its own or even be used with artificial neural networks, like in this Super Mario example.

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x5cfbijj3ggn448yn2wj.gif)

If you're interested in more details about genetic algorithms, see Grokking AI Algorithms with Manning Publications: [http://bit.ly/gaia-book](http://bit.ly/gaia-book), consider following me - [@RishalHurbans](https://twitter.com/RishalHurbans), or join my mailing list for infrequent knowledge drops: [https://rhurbans.com/subscribe](https://rhurbans.com/subscribe).
MVP Project
Published: 2021-08-25 04:19:13

It's the end of day 1 on the MVP project. Our assignment is to complete a full-stack mini-app in two working days. I like the energy of a project like this: bang-bang, what can you think up and execute on with a super quick turnaround.

When the assignment was introduced, I asked our Tech Mentor whether I could just continue on with my side-project and kill two birds with one stone. He suggested an alternative. Make something that could serve as a stand-alone version of the feature I'd like to create -- something that I could later improve upon in the full project. That's what I intend to do.

###What feature will I build? 

I've started work on the Question/Answers section of the blog project. You can think of it as a Stack Overflow wannabe.

I had to do a little re-reading on Mongo schema design and two options fell under the scope of the one-to-many relationship that describes the one-question-to-many-answers dynamic.

The two options:
 - Embed the answers in each question...or
 - Reference the child answer in each parent

I decided to do the latter.

It requires more work if you want to reassign the question to a different asker - but when would I need that?

More commonly, I'd need to relate the answer with the answer-er - like to list the answers they've provided in their profile. In this case, it'd be a lot easier to look up the answer by its author than to go through the every question for every answer, and then search by user.

In my next post I'll show how I implement that design in a schema that contains ObjectID references.
Copy SSH key onto remote server
Published: 2021-09-18 17:49:56

---
title: Copy SSH key onto remote server
published: true
date: 2021-09-01 10:16:00 UTC
tags: 
canonical_url: https://dcblog.dev/copy-ssh-key-onto-remote-server
---

Setting up a new project or starting work on a project which is new to you? Read on to discover the quick and pain-free way of enabling password-less ssh login.

## Step-by-step guide

Run this command in your terminal to have your default identity public key copied across to the server of choice.

```

ssh-copy-id user@hostname.example.com
```

Now try

```

ssh user@hostname.example.com
```

Success.

You can read more on the topic at [https://askubuntu.com/questions/4830/easiest-way-to-copy-ssh-keys-to-another-machine.](https://askubuntu.com/questions/4830/easiest-way-to-copy-ssh-keys-to-another-machine)
Hi! I'm Weekend_Ghost.
Tags: introduction, career, frontend, indiehacker
Published: 2021-09-01 10:11:48

## Introduction

Hi! 👋🏻

I'm David, a developer from Perth, Australia with an insatiable hunger to learn!

I've been creating websites, web-apps and all kinds of interesting projects outside of that space for over 15 years now, since I was a young teenager. I remember picking up an odd '*Learn How to Build Websites*' book in around ~2003 and it cascaded from there. ⏳

My earliest project - a fan-site for *Sonic the Hedgehog* - didn't allow me to live the Indie-Hacker lifestyle as you can imagine. My highschool friends didn't care so much about subscribing to my forum for a monthly fee. 🦔

## My Experience

Since then though, I've directed my skills through loads of avenues and thoroughly enjoy building web-apps! I exist with Social Anxiety Disorder and some other interesting problems that have guided my experience through this career in unique ways (and you can find out what those are in '[Part 1.0](https://dev.to/weekend_ghost/path-to-indie-hacker-part-1-0-2fpl)', live now). 💻

I've been a full-time developer for nearly 10 years and have built applications that moved **AUD$25M in a month** sometimes! Other work I've done includes **government-driven** initiatives for the environment, **large-scale farming** business dashboards and massive websites for **tertiary education**. I've even made **games with 40k+ users** that you might have played in the early days of the web! 📈

Some time ago I decided I was done working under the pressure of someone else's business. The lack of creative freedom is a heavy fog. I wanted to wake up and have the day ahead of me under my own direction. I wanted to get excited for new customers using the applications I build and thrive on a passionate user-base that are personally attached to the things I've made for them. 😘

Some years ago I learned about people like [Pieter Levels](https://twitter.com/levelsio), [Wes Bos](https://twitter.com/wesbos), [Warp World](https://twitter.com/warpworld) and other more mainstream entrepeneurs - and it really inspired me to learn about that lifestyle. If I can grasp just a bit of it and achieve my goals, I'll be the happiest little ghost. 👻

## And so it starts now! 

I'm detailing all my progress and processes as I go, fully-transparent, and hope you'll join me along the way. You can find the first part of my blog [here](https://dev.to/weekend_ghost/path-to-indie-hacker-part-1-0-2fpl), where I describe the 'What, How and Why' of my pathway. You'll discover how I'm choosing to start my own journey and how you could start your own based on that. 

I can't wait to see your comments and questions and hopefully we'll have many more interactions in the future.

-----

You can find Weekend_Ghost all across the web! 
- [Website](https://www.weekendghost.com) 💬
- [Twitter](https://twitter.com/weekendghost) ⚡
- [Instagram](https://www.instagram.com/weekend_ghost/) ⛰
- [Twitch](https://www.twitch.tv/weekend_ghost) 🎙
- [Dev.to](https://dev.to/weekend_ghost/) 🖊
Why every business needs effective knowledge management?
Tags: management, webdev, productivity, programming
Published: 2021-09-01 09:51:43

Knowledge management is a system of established processes for collecting and sharing knowledge and skills within a company. Proper knowledge management in companies ensures that all employees have access to the information they need to perform at their best and grow their skills.

It also makes it easier to onboard new hires and transfer projects to other individuals or teams. In addition, good knowledge management helps prevent situations where only one employee knows how to carry out a critical task, which can be detrimental if they take an extended or permanent leave. [Read the full article.](https://evrone.com/knowledge-sharing)
Writing test in Nuxt project
Tags: help, testing, vue, discuss
Published: 2021-09-01 09:50:58

Hi guys, I have some HTTP requests in one of my Nuxt plugins and I want to know, is it right to test that HTTP requests?

When I want to write test for my component, do I need to test those HTTP requests? like:

```javascript
describe('--> TestComponent:', () => {
  // #01
  it('fetched data should have ID, first_name and last_name', async () => {
    console.log('TODO: Should find a what to test plugins')
  });

  // #02
  it('should have loading', async () => {
    await wrapper.setData({
      loading: true
    })
    expect(wrapper.find('.loading').exists()).toBe(true)
  });

  // #03
  it('should have fullName', async () => {
    await wrapper.setData({
      loading: false,
    })
    expect(wrapper.find('.fullName').exists()).toBe(true)
  });
});
```

Or it's not right to do this?
HTTPS
Published: 2021-08-12 16:19:18

## What is HTTPS?
 
HyperText Transfer Protocol Secure, the extension of HyperText Transfer Protocol, is used for secure network communication. The implemented communication protocol encrypts web communication using Transport Layer Security (TLS) formerly known as Secure Socket Layer (SSL). The protocol is often referred to HTTP over TLS or SSL.

## Why is HTTPS important?
 
The protocol is used to protect web page authenticity regarding secure accounts, user communication, identity, and private web browsing.

## How Does it work?
 
The protocol authentication requires a trusted certificate authority (CA) to sign a server-side digital certificate. Web browsers play a critical role in this protocol by checking a website's certificate to make sure it belongs to the domain it says it was issued to, and verifying that the certificate was signed by a trusted CA. If these conditions hold, then the web traffic for this site between client and server is encrypted using TLS handshakes. TLS uses symmetric encryption to encrypt web traffic between server and client.

## How will we implement HTTPS manually?
 
Implementing HTTPS is offered as a service by many certificate authorities and web hosting services for a price. As developers we have the skills to implement HTTPS manually at no cost and should take advantage of the open-source intelligence on how to do so. The steps required to implement the HTTPS protocol will vary depending on what your website is running and what type of server it is running on. 
 
Let’s Encrypt is a reasonable way to obtain a certificate, activate, install, and deploy it. Let’s Encrypt is a free, automated Certificate authority (CA) for the public. Let’s Encrypt runs the internet security research group and aims to provide a free, automatic, secure, and transparent CA to the public for the goal of creating a more secure and privacy-respecting web.
CertBot
 
Let’s Encrypt issues it’s certificate via CertBot which is a free and open-source software tool for automatically using Let’s Encrypt certificates on manually administered websites to enable HTTPS. Use of CertBot requires
- some familiarity with the command line
- HTTP website already online with port 80 open
- deployment to a dedicated server, virtual private server, or a cloud-hosted server accessible by SSH and navigable with root privileges.
 
## Deploying our certificate via CertBot
 
I am hosting my web application on an Ubunto 18.04 LTS (Bionic) Headless server the steps to implement HTTPS using CertBot are as follows.
- SSH into our server running your HTTP website (make sure to have root privileges)
- Run the following commands to add the Personal Package Archives (PPA) for CertBot to your repositories.
- Install your Certificate in the configuration file for your webserver

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ygpz44yuiv61bucrpr23.png)
Hello World with Go!
Tags: go
Published: 2021-09-01 09:11:15

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9dr91kmyorfo73w9e7g9.png)
Hello everyone,

today i will show you, how to print "hello World" with GoLang

before starting this tutorial, make sure you have installed golang.

i'll show you how to install golang firts.

1.Download golang at web [Golang](https://golang.org)
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/t06fo4m0hz36jg8k9vxk.png)
red for Windows, yellow for MacOs, and Green for Linux 

i'll show you how to install golang at Windows

2.After you finished download go , setting gopath in your computer like this 
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nq48vja7i8q39bkxeff4.png)

3.Now you can start coding!

4.Open Your VS Code , make new folder for code golang

5.Open CMD with ctrl + j , and type like this 
`go mod init belajar-golang` 
for make go mod

6.after typing it, there are will be a new file called name **go.mod**
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9qm9m19v749kcmctvnzb.png)

7.then create new file named **main.go** 
8.then type code like this 
```go
package main

import "fmt"

func main(){
	fmt.Println("Hello World!")
}
```
9.and after type code , run the file main.go with command like this
`go run main.go`

10.The result will be like this
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e8w4pon5vsqfsyjckypn.png)


And that the way to print "Hello World" with Golang
Highlight Values Below or Above Average in Excel Using Java
Tags: java, excel, api
Published: 2021-09-01 08:35:32

This article demonstrates how to highlight the values below average or above average, and how to calculate the number of these values respectively using Free Spire.XLS for Java.

**Installation (2 Method)**
**1#** Download the [free library](https://www.e-iceblue.com/Download/xls-for-java-free.html) and unzip it, then add the Spire.Xls.jar file to your project as dependency.
**2#** You can also add the jar dependency to maven project by adding the following configurations to the pom.xml.
```xml
<repositories>
        <repository>
            <id>com.e-iceblue</id>
            <name>e-iceblue</name>
            <url>http://repo.e-iceblue.com/nexus/content/groups/public/</url>
        </repository>
</repositories>
<dependencies>
    <dependency>
        <groupId>e-iceblue</groupId>
        <artifactId>spire.xls.free</artifactId>
        <version>3.9.1</version>
    </dependency>
</dependencies>
```

**Sample Code**
```java
import com.spire.xls.*;
import com.spire.xls.core.IConditionalFormat;
import com.spire.xls.core.spreadsheet.collections.XlsConditionalFormats;

import java.awt.*;

public class HighlightBelowAboveAverage {

    public static void main(String[] args) {

        //Create a Workbook object
        Workbook workbook = new Workbook();

        //Load a sample Excel file
        workbook.loadFromFile("C:\\Users\\Administrator\\Desktop\\data.xlsx");

        //Get the first worksheet
        Worksheet sheet = workbook.getWorksheets().get(0);

        //Use conditional formatting to highlight the values below average in the range "B2:B9"
        XlsConditionalFormats format1 = sheet.getConditionalFormats().add();
        format1.addRange(sheet.getCellRange("B2:B9"));
        IConditionalFormat cf1 = format1.addAverageCondition(AverageType.Below);
        cf1.setBackColor(Color.red);

        //Use conditional formatting to highlight the values above average in the range "B2:B9"
        XlsConditionalFormats format2 = sheet.getConditionalFormats().add();
        format2.addRange(sheet.getCellRange("B2:B9"));
        IConditionalFormat cf2 = format1.addAverageCondition(AverageType.Above);
        cf2.setBackColor(Color.yellow);

        //Get the count of values below average
        sheet.getCellRange("D12").setFormula("=COUNTIF(B2:B9,\"<\"&AVERAGE(B2:B9))");

        //Get the count of values above average
        sheet.getCellRange("D13").setFormula("=COUNTIF(B2:B9,\">\"&AVERAGE(B2:B9))");

        //Save the file
        workbook.saveToFile("BolowOrAboveAverage.xlsx", ExcelVersion.Version2016);
    }
}
```
**Before**
![average1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mn4a4w84r2ckeankygwq.jpg)

**After**
![average2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/moavagfhdnjln02xjyez.jpg)
createContext vs. createObjectContext
Tags: react, javascript, performance, reactnative
Published: 2021-09-01 06:30:51

So, in the last few days I have uploaded some of the helpers I have created for myself, for public use.

One of the issues I encountered was when I used the original React.js 'useContext' hook.

So if you know, using the context API, you can share a state between components in your React application.

In theory you can share a primitive value between the components. But used in the real world, most of the time you are going to share an object with some state data.

For example: If you have a user list, you want to send an object with a key that contains the user array and some more data about the users state, such as 'isLoading', etc.

The problem: When you use the React ecosystem, you really do not want all the components to get re-render in any application change. So you use something like 'React.memo' to prevent a re-render of a component if there is no change in data that have relation to the component.

But in this situation, using a memo not going to save you. Because, when you share an object using the React context API, whenever something happens on the context provider wrapper, the object will be re-created. And even if it's not related to your component, and you included the context in your component just for a small thing that depends on some property of the context object, your component will be get re-render!

Sounds scary, doesn't it?

So, I created a tiny library to help us in this situation. I decided to call it 'createObjectContext' because it would take care of the object context.

You can look at it and start using it, if the performance is something that interests you.

I would love to hear your opinion in the comments !!

https://www.npmjs.com/package/create-object-context
thiết bị định vị xe máy tại Vĩnh Phúc
Tags: dinhvixemayvinhphuc
Published: 2021-09-01 08:20:33

Có phải bạn đang muốn gắn Định Vị Xe Máy Tại Vĩnh Phúc ? để giám sát người thân như con cái đi học, nhân viên giao hàng, theo dõi theo nghĩa vợ chồng. Chúng tôi là nhà phân phối và lắp đặt thiết bị GPS với nhiều năm kinh nghiệm với nhiều sản phẩm được chọn lựa chất lượng tốt nhất.

Bảng giá một số thiết bị định vị xe máy tại Vĩnh Phúc
Tên thiết bị Giá bán Ưu đãi
Thiết bị định vị Wetrack Lite 1.250.000 VNĐ – Lắp đặt tận nơi
– Tặng sim 4G
– Phần mềm Giám sát 1 năm
Định vị xe máy Lite Pro 1.500.000 VNĐ
Định vị xe máy Nghe Âm Thanh 1.800.000 VNĐ
Định vị xe máy Không dây TR21 1.800.000 VNĐ
Đối với khách hàng tại yên bán muốn sử dụng thiết bị định vị xe máy quý khách có thể đặt hàng từ chúng tôi bằng cách vào nút đặt hàng của bài viết này hoặc gọi ngay cho chúng tôi để tư vấn đặt hàng. Chúng tôi sẽ đóng gói và gửi hàng nhanh nhất cho bạn và thanh toán khi nhận hàng.

Cách Lắp đặt định vị khi đã nhận được hàng?​
Sản phẩm có cách lắp đặt vô cùng đơn giản, bạn có thể tự lắp đặt tại nhà hoặc bạn có thể mang thiết bị và xe ra tiệm sửa xe nhờ lắp đặt. Hoặc bạn có thể liên hệ trực tiếp với nhân viên của chúng tôi đến để lắp đặt.

Sau đây là sơ đồ lắp đặt, bạn có thể đấu nối trực tiếp với 2 cực của bình Ắc quy của xe máy.

Cách Lắp đặt định vị 

Chức Năng Của Thiết Bị định Vị​
» Xác định vị trí phương tiện 24/24
» Báo cáo địa chỉ số nhà, tên đường, caffe, nhà hàng, khách sạn
» Báo cáo trạng thái dừng hay di chuyển
» Báo cáo thời gian dừng đỗ
» Xem lại lịch sử hành trình
» Báo cáo tổng KM trong ngày
» Báo cáo tắt máy hay nổ máy
» Giám sát âm thanh nếu có
Ngoài Ra bạn có thể tham khảo bài viết Định vị ô tô tại Vĩnh Phúc nếu có nhu cầu.
Hotline: 0903108661
Zalo/Viber: 0923652365
https://dinhvixemay.org/dinh-vi-cho-xe-may-tai-vinh-phuc.html
https://dinhvixemay.org/lap-dinh-vi-o-tai-vinh-phuc.html
How much data is missing from Google Analytics due to adblockers?
Tags: analytics
Published: 2021-09-01 07:49:00

I looked at the analytics of a website that had a post trending on Hacker News and Reddit last week with more than a thousand upvotes and more than a thousand comments. The idea was to find out how much data is missing from Google Analytics due to adblockers and privacy-friendly browsers that the more tech-savvy audiences use more frequently.

I compared stats between [Plausible Analytics](https://plausible.io/) (the startup that I'm working on) and Google Analytics. Google Analytics was installed using the default method. Plausible was installed [using a proxy](https://plausible.io/docs/proxy/introduction) to get the most accurate data on the level of blockage. Plausible proxy runs as a first-party connection and is only blocked by those visitors who block JavaScript entirely. It is not blocked by any browser or adblocker.

Here’s the data Plausible Analytics shows for the three days in late August 2021 when the site got a lot of traffic (you can explore the stats in [this public dashboard](https://plausible.io/markosaric.com?period=custom&from=2021-08-26&to=2021-08-28)):

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ylx6twgdxcsn3m3a5lno.png)

And here’s the Google Analytics data for the same site and the same period:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5wraiaseflcw39pb5e5r.png)

It turns out 58% of Hacker News readers, Reddit users and other techies block Google Analytics. Google Analytics is not showing all traffic. It is missing data from 58.67% of all visitors and 58.38% of all page views. Google Analytics is underreporting the tech-savvy audiences by almost 60%.

## Which browser users block Google Analytics most frequently? 

88% of Firefox users
50% of Chrome users
41% of Safari users

## Which operating system users block Google Analytics most frequently?

82% of Linux users
74% of Windows users
61% of Mac users
54% of Android users
41% of iOS users

More stats and other details in the blog post: [58% of Hacker News, Reddit and tech-savvy audiences block Google Analytics](https://plausible.io/blog/google-analytics-adblockers-missing-data)
Google Analytics + TYPO3 CMS (Complete Tutorial)
Published: 2021-09-01 07:37:45

Do you want to integrate Google Analytics code at your TYPO3 website? This article will find simple to advanced level Google Analytics integration into TYPO3 CMS - with and without TYPO3 extensions. Keep reading!

Google Analytics is one of the most popular and loved for website owners and marketers. Even after GDPR, the popularity of Google Analytics does not have any effect. TYPO3 CMS is very flexible to integrate third-party tools easily.  Let’s figure out what/why/how about Google Analytics and TYPO3.

Guide to TYPO3 Google Analytics 

10 Reasons your site need to have Google Analytics
The New Google Analytics 4
Where To Get Google Analytics Code?
Google Analytics in TYPO3 (without Extensions)
TYPO3 Extensions for Google Analytics
TYPO3 Google Analytics (without GTM)

Excited about Google Analytics? Find out the blog here, https://t3terminal.com/blog/typo3-google-analytics/