teleren/devto huggingface dataset:
Why is ICO Crowdfunding a Game-Changer for Businesses?
Tags: ico, crowdfunding, webdev, fundraising
Published: 2023-05-06 06:41:38

In recent years, ICO crowdfunding has become an increasingly popular way for businesses or startups to raise capital. But what is it, and why is it so important for businesses? Now, let us explore the benefits of ICO crowdfunding and how it can help businesses of all sizes thrive.

**What is ICO Crowdfunding?**

ICO stands for Initial Coin Offering, which is a type of fundraising method that involves offering digital tokens on a blockchain platform. These tokens can be bought and sold, and they often have some sort of utility within a specific company or ecosystem.

ICO crowdfunding is similar to traditional crowdfunding but with a few key differences. Instead of offering backers a physical product or equity in the company, businesses offer digital tokens. These tokens can be used to access the company's products or services, or they can be traded on cryptocurrency exchanges.

**Benefits of ICO Crowdfunding**

Now let us discuss the basic understanding of ICO crowdfunding, let's explore why it's important for businesses. Here are just a few of the benefits:

**Access to Non-Traditional Funding Sources**

ICO crowdfunding allows businesses to tap into a global pool of investors who are interested in buying digital tokens. This means that businesses can reach a much wider audience than traditional fundraising methods like venture capital or bank loans.

**Faster Fundraising Process**

ICO crowdfunding campaigns can be launched quickly, and they can often reach their fundraising goal in just a few weeks or months. This is much faster than traditional fundraising methods, which can take months or even years to complete.

**Increased Transparency**

Since ICO crowdfunding campaigns are often conducted on blockchain platforms, they offer a high level of transparency. Investors can see exactly where their money is going and how it's being used by the company.

**Potential for Viral Marketing**

ICO crowdfunding campaigns often go viral on social media and other online platforms. This can lead to a huge influx of investors and customers who are interested in the company's products or services.

All this considered, **[ICO crowdfunding platform](https://www.zabtechnologies.net/ico-development-company/?utm_source=dev&utm_medium=icob&utm_campaign=LA)** is a powerful tool that can help businesses raise capital, reach new customers, and grow their brands. 

If you're interested in using this innovative fundraising method for your business, consider partnering with a reputable ICO development company in the crypto market.  Our team of experienced developers are dedicated to creating innovative and effective solutions for all your business needs. They can help you to stand ahead of others in the crypto industry.

Ride the crypto wave and launch your fundraising campaign on the world's fastest technology.
AWS CDK : Create new Lambda Versions with Alias pointing to $LATEST
Published: 2023-05-06 06:02:12

Greetings,

Today, I would like to discuss my experience in writing AWS CDK code for Lambda versioning, with an alias pointing to either the latest version or a custom version of choice.

One of my clients requested a Lambda implementation that would generate a new version with each deployment. At first, it seemed like a straightforward task: simply import the Lambda version and create it as follows:

```javascript
import { Alias, Version } from "aws-cdk-lib/aws-lambda";

new Version(this, `version-identifier-id`, {
  lambda,
  description: "v1",
  removalPolicy: RemovalPolicy.RETAIN,
});
```

However, this approach overrides the previous Lambda version, which is undesirable in case we need to roll back to an earlier version. Despite extensive research, I couldn't find a solution online. I experimented with different combinations of the removalPolicy attribute, but to no avail.

After several trials and errors, I discovered that the `cdk diff` command reports a change, implying that there must be some alteration. This command only worked when I modified the `version-identifier-id` in the stack. I updated the code as follows:

```javascript
import { Alias, Version } from "aws-cdk-lib/aws-lambda";

new Version(this, `${Math.random()}`, {
  lambda,
  description: "v1",
  removalPolicy: RemovalPolicy.RETAIN,
});
```

This solution worked perfectly. Now, each time a deployment is executed via the `cdk deploy` command, a new Lambda version is generated. While this approach functions well, there is an inherent issue: creating a new version even when there are no changes in the Lambda code.

Addressing this challenge will be the focus of the next blog post. Stay tuned for more insights into AWS CDK and Lambda versioning.
Redundancy and Availability
Tags: systemdesign, redundancy, availability, beginners
Published: 2023-05-06 05:54:02

Availability is the time portion when the system is up and running for a particular mission time. It is usually represented in percentages. For example, 99.99% availability means the system has four nines availability which is a high percentage.

To calculate the availability,

`Availability = Uptime / (Uptime + Downtime)`

To have 100% availability, we need a mission time of 24/7 for six months with no downtime. If we get one day of downtime, the availability decreases to 99.4% automatically. So, if we intend to develop strategies for availability, we must also know and face the fact that we will deal with occasional failures at some point. That’s why we should focus more on providing high availability with reduced downtime and make the repair time as short as possible.

If there is no [redundancy](https://dev.to/pragyasapkota/redundancy-1h72), the system downtime depends on,

1. How fast can you detect the failure?

2. How fast can you diagnose the problem?

3. How fast can you repair or replace the failed part of the system?

4. How fast can you make the system back to its full operational status?

Apart from these, in case of hardware failures, we can just replace the bad component or systems instead of trying to repair them. Depending on the accessibility and availability of the replacement, the time of replacement takes minutes up to several days.

In case of a software failure, the system needs to reboot for temporary repair work. But the reboot activity can take seconds to hours depending on the system’s complexity.

Redundancy makes the system downtime depend on the time we take to detect the failure and then switch over to the backup unit. It’s better if we can pull this off within seconds so the system can have sub-millisecond downtimes.

This way, redundancy improves the availability of your system by several orders of magnitude. For example, if there is a system that runs 24/7 for one whole year and has an hour of downtime during the mission, the availability goes down to 99.9% — three nines. Likewise, if the downtime is one second, the availability is 99.99999%, i.e., seven nines.

[Redundancy](https://dev.to/pragyasapkota/redundancy-1h72) on a system leads to fast switchovers where the system is not noticeably affected by downtime. Hence, in the practical world, the system doesn’t show the outage by showing 100% availability.

**_I hope this article was helpful to you._**

**_Please don’t forget to follow me!!!_**

**_Any kind of feedback or comment is welcome!!!_**

**_Thank you for your time and support!!!!_**

**_Keep Reading!! Keep Learning!!!_**
O que são técnicas de mock em testes, e quais os principais tipos?
Published: 2023-05-06 05:35:04

As técnicas de mock são usadas para simular o comportamento de objetos ou componentes que não estão disponíveis durante o teste ou não estão realmente disponíveis. O objetivo é isolar a unidade de código em teste para poder ser testada independentemente.
Uma simulação é uma implementação simulada de um objeto ou componente que substitui o objeto real durante o teste. Pode ser usado para simular o comportamento de objetos ou componentes que executam operações externas como acesso ao banco de dados, chamadas de API, comunicação de rede, etc. Ao simular esse comportamento, os testes podem ser executados de forma mais rápida, previsível e repetitiva sem depender de recursos externos lentos ou instáveis.

**Qual é a diferença entre mocks e stubs?**

Um stub é uma implementação simples de uma interface ou classe usada durante o teste de unidade para substituir o comportamento de objetos do mundo real. Um  stub fornece uma resposta predefinida para uma chamada de método específica, portanto, você não precisa chamar o objeto real durante o teste. Por exemplo, você pode usar stubs para substituir objetos de acesso a dados. Um objeto de acesso a dados normalmente lê e grava informações em um banco de dados externo e fornece valores predefinidos que simulam a resposta do banco de dados.

Mocks, por outro lado, são objetos que simulam o comportamento de objetos reais de uma forma mais complexa do que stubs, e são normalmente usados ​​para testar interações mais sofisticadas entre objetos. Você pode configurar simulações para ver se um determinado método foi chamado, com quais parâmetros e quantas vezes. Isso permite que você use mocks para testar o comportamento de outro objeto ou um objeto que depende de um sistema externo.
Existem várias técnicas de simulação para testes, incluindo:

- **Stubbing**: Uma técnica de criação de um objeto fictício para fornecer uma resposta predefinida a uma determinada chamada de método. Por exemplo, um objeto fictício pode ser configurado para sempre retornar um determinado valor quando seu método é chamado.

- **Mocking**: A técnica de criar objetos simulados para simular o comportamento de objetos reais. Por exemplo, você pode configurar um objeto fictício para registrar chamadas de método de entrada e verificar se elas correspondem ao que seu teste espera.

- **Forge**: Uma técnica para criar objetos fictícios para simular objetos reais com implementações simplificadas. Por exemplo, em vez de usar um banco de dados real, você pode criar um banco de dados simulado e armazenar os dados na memória.

Você pode combinar essas técnicas para criar testes mais robustos e abrangentes que isolam a unidade de código em teste e simulam o comportamento de objetos ou componentes externos.
Checkbox.com - Run surveys, capture insights and improve experiences.
Tags: survey
Published: 2023-05-06 05:17:23

Since 2002, we’ve been developing professional survey software and feedback tools that help our customers gather the data they need to make improvements. We started out as a two person company with a love for technology. Today, Checkbox is a remote team made up of people from all over the world with different talents and backgrounds.

[https://www.checkbox.com](https://www.checkbox.com)
SFTP using the ssh2-sftp-client in Node JS
Tags: node, typescript, ssh2sftpclient, programming
Published: 2023-05-06 05:11:40

Here we will be checking on how to get the files over the sftp, As there is alot of confusion on how to fetch the files in the required format, it can be a file path or a stream or just a Buffer.

We would be using the [ssh2-sftp-client](https://www.npmjs.com/package/ssh2-sftp-client#org252a716) library of the node js.

There are two methods for getting the file and these methods are async in nature.

**_- get(path, dst, options) ==> String|Stream|Buffer
- fastGet(remotePath, localPath, options) ===> string_**

Let us go with the Get.
Here if we are just giving the path of the file which needs to be fetched and not providing dst and the options then the output would be in the form of buffer, so if we want to transfer this buffer as a stream to the output then We would be adding this to the Readable stream. This readable stream can be piped to the response and can be sent out. This readable stream can also be added to the zip stream and that zip stream can be piped to response, if we want to zip the files before sending, this is useful if we are fetching multiple files.

Along with the Path if we are giving the dst as the path which is the local path where the data needs to be saved into, then it automatically adds the data to the file. it doesnt give any call back if the dst is provided.
if we are giving a stream for dst then it has to be a writestream and then that writestream can be piped to readstream and again here we can pipe it to response.

If we are fetching only one file then we can directly pass in the response and the data is directly giving into response

The fastget is useful when we are downloading single file and upon that we want to save it directly then we can just give the path.


This is some basic details on the get. As many a times we tend to send the stream as response and saving of the file happens at different place and the fetching happens at another place so the local path is not aware, so for this purpose an stream has to be created without the file, for that purpose we would be passing in the buffer.

This is my first technical post. Do let me know any suggestions if any.
Critter Corner #1
Tags: crittercorner
Published: 2023-05-06 05:04:20

---
title:Critter Corner #1
published: true
description: Weekly series where we invite all of you to share adorable photos of your companions in the comments below
tags: crittercorner
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-05-03 17:32 +0000
---
I hope I'm not the only one who's noticed that [Sloan the DEV Moderator](https://dev.to/sloan) seems to be the only animal companion on DEV. Let's change that!

Introducing our new weekly series where we invite all of you to share adorable photos of your companions in the comments below. From the antics of your mischievous cat or dog to the fascinating habits of your feathery friends or scaly pals, we want to see it all! 

But here's the thing... Ignore this, and you risk facing the most terrifying thing in the world... 😱... A very, very lonely sloth. Trust me, you don't want to see Sloan when they're upset. It's the kind of slow, soul-crushing sadness that only a sloth can muster.

So, let's avoid that, shall we? Share your favorite snapshots of your companions below and bring some more animal friends into our DEV community. We can't wait to see all the cute faces that make your days brighter! And, hey, if you happen to know any other sloths looking for work, do send them our way. Sloan could use some company!
Python爬虫如何爬wss数据
Tags: python, crawler, websocket
Published: 2023-05-06 04:53:53

### 目标站点
`https://dexscreener.com`

### 目标数据
列表页数据

### 问题
- 看到网上有不少推荐使用该库的`aiowebsocket `，测试下来该库无法实现，也是耽误了我一天的时间，各种调试，一开始只是以为是我没有过风控的问题，其实并不是，问题在库上；该项目已经4年没有更新了，废掉了，不建议使用
```
# from aiowebsocket.converses import AioWebSocket
#https://github.com/asyncins/aiowebsocket
```
- **Sec-WebSocket-Key** 加密参数；该参数是根据一定规则随机生成的，只要按照规则生成即可，不按规则就无法连接成功；
代码示例
```
function generateWebSocketKey() {
  // 生成一个16字节的随机值
  const buffer = new Uint8Array(16);
  window.crypto.getRandomValues(buffer);

  // 将随机值进行Base64编码
  const key = btoa(String.fromCharCode.apply(null, buffer));

  return key;
}
```
```
import os
import base64

def generate_websocket_key():
    # 生成一个16字节的随机值
    buffer = os.urandom(16)

    # 将随机值进行Base64编码
    key = base64.b64encode(buffer).decode('utf-8')

    return key
print(generate_websocket_key())
```
- headers 是需要对UA进行校验的

### 解决代码示例
```
class ListPage:
    def __init__(self):
        self.base_url = 'wss://io.dexscreener.com/dex/screener/pairs/h24/{}?rankBy[key]=txns&rankBy[order]=desc&filters[liquidity][min]=100000&filters[marketCap][min]=200000&filters[txns][h24][min]=100'

    def generate_websocket_key(self):
        # 生成一个16字节的随机值
        buffer = os.urandom(16)
        # 将随机值进行Base64编码
        key = base64.b64encode(buffer).decode('utf-8')
        return key
    def open_connection(self,num):
        """
        建立连接
        """
        header = {
                # 用户唯一性校验+风控识别校验，可以理解为mac地址的作用，该值有一定的规范，是随机生成的，但是得符合一定的标准，在标准之外的随机数是不被认可的，无法建立连接
                "Sec-WebSocket-Key": self.generate_websocket_key(),
                # 和http请求的用途一样，用于校验客户端角色；主要风控
                "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
            }

        ws = websocket.WebSocket(sslopt={"cert_reqs": ssl.CERT_NONE})
        # remote = 'wss://io.dexscreener.com/dex/screener/pairs/h24/4??rankBy[key]=txns&rankBy[order]=desc&filters[liquidity][min]=100000&filters[marketCap][min]=200000&filters[txns][h24][min]=100'
        url = self.base_url.format(num)
        logger.info(f'request {num}: {url}')
        # 必须得携带头部信息，Python代码实现的wss通信自动生成的Sec-WebSocket-Key 很多服务器会不支持
        ws.connect(url, header=header)
        return ws

    def get_data(self, num):
        """
        发起请求获取数据
        """
        retry_num = 0
        while True:
            retry_num += 1
            if retry_num > 3:
                logger.error('重试超过次数！')
                return
            try:
                ws = self.open_connection(num)
                # message = input("Enter message: ")
                # 测了下好像不会过期(约20个小时)   该行代码有可能报错
                ws.send('pong')
                break
            except:
                logger.warning('wss通信失败，重试...')
                time.sleep(1)
        response = ws.recv()
        logger.info(f'response: {num}')
        data = json.loads(response)

```
React Form Validation with Formik and Yup
Tags: formik, yup, react, form
Published: 2023-05-06 04:21:26

Form validation is an important part of any web application. It ensures that users provide valid input before submitting a form. In this blog post, we will learn how to implement form validation using Formik and yup in a React application.

## Getting Started
To get started, we need to install the required packages. We will be using formik for managing our form state and yup for validation.

```
npm install formik yup
```

## Setting up the form
Let's start by creating a simple form with two fields - name and email.

```
import React from 'react';
import { Formik, Form, Field, ErrorMessage } from 'formik';

const initialValues = {
  name: '',
  email: '',
};

const onSubmit = (values) => {
  console.log(values);
};

const App = () => {
  return (
    <div>
      <h1>Form Validation Example</h1>
      <Formik initialValues={initialValues} onSubmit={onSubmit}>
        <Form>
          <div>
            <label htmlFor="name">Name:</label>
            <Field type="text" id="name" name="name" />
            <ErrorMessage name="name" />
          </div>
          <div>
            <label htmlFor="email">Email:</label>
            <Field type="email" id="email" name="email" />
            <ErrorMessage name="email" />
          </div>
          <button type="submit">Submit</button>
        </Form>
      </Formik>
    </div>
  );
};

export default App;

```
In the code above, we have defined a form with two input fields - name and email. We have also defined an onSubmit function that will be called when the form is submitted.

## Adding validation
Now, let's add validation to our form using yup. We will start by creating a validation schema for our form.

```
import * as Yup from 'yup';

const validationSchema = Yup.object({
  name: Yup.string().required('Name is required'),
  email: Yup.string().email('Invalid email address').required('Email is required'),
});

```
In the code above, we have defined a validation schema using yup. We have specified that the name field is required and the email field must be a valid email address.
Next, we will update our Formik component to use the validation schema.

```
<Formik initialValues={initialValues} onSubmit={onSubmit} validationSchema={validationSchema}>

```
Finally, we will update our form inputs to display validation errors.

```
<div>
  <label htmlFor="name">Name:</label>
  <Field type="text" id="name" name="name" />
  <ErrorMessage name="name" />
</div>
<div>
  <label htmlFor="email">Email:</label>
  <Field type="email" id="email" name="email" />
  <ErrorMessage name="email" />
</div>

```
In the code above, we are using the ErrorMessage component from formik to display validation errors for each input field.

## Conclusion
In this blog post, we have learned how to implement form validation using Formik and yup in a React application. Formik and yup provide a simple and powerful way to manage form state and validation. With these tools, you can easily create forms that are robust and user-friendly.
Zoetrope Global’s Big Move: Expanding to Malaysia’s Multicultural Market
Tags: malaysia, productivity
Published: 2023-05-06 03:23:21


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

> Zoetrope Global, a leader in online ticketing and movie-related investment opportunities, is expanding its operations to Malaysia.

The move comes as Zoetrope Global seeks to expand its reach into the fast-growing Southeast Asian market and tap into the country’s diverse and vibrant entertainment industry.


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

The entertainment industry in Malaysia encompasses various forms of entertainment such as film, music, television, and theatre. Malaysia’s film industry, in particular, has experienced significant growth in recent years, with the Malaysian government introducing policies and incentives to attract foreign investment.


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

**Zoetrope Global’s app incorporates blockchain technology to provide a secure and transparent platform for pre-sale ticket purchases, daily movie ticket sales, and movie-related investment opportunities. With this technology, Zoetrope Global aims to revolutionize the film industry and bring innovative solutions to moviegoers and investors.**

In addition, collaborating with a local film company helps bring its services to the Malaysian market. This collaboration will allow the company to better understand the needs of the local film industry and tailor its services to meet those needs.


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


Zoetrope Global’s loyalty rewards, membership levels, and team income program offer secure, transparent, and trustworthy engagement and income opportunities for its users. With these incentives, we aim to build a loyal user base in Malaysia and create a sustainable business model.

**The official launch date in Malaysia is still to be announced, but moviegoers and investors alike can look forward to the arrival of this innovative platform. With its focus on pre-sale tickets, exceptional user experience, and exclusive access to highly anticipated films.**

Stay tuned for more updates on the official launch date in Malaysia!