teleren/devto huggingface dataset:
Writing Simple RestAPI in Nim With HappyX #2
Published: 2023-05-24 05:20:34

Previously we added `/hello-world` method that responds `"Hello, world!"` ✌

In this series, we'll attempt to write methods for working with simple posts (without connecting to a database for now). 🙂

Let's open `/tutorial/src/main.nim` 🍍

Rewrite this
```nim
# Setting up our server at `127.0.0.1:5000`
serve("127.0.0.1", 5000):
```
to this
```nim
# Setting up our server at `127.0.0.1:5000`
serve("127.0.0.1", 5000):
  var posts = %*[
    {
      "title": "Hello",
      "text": "world"
    }, {
      "title": "Bye",
      "text": ":("
    }, {
      "title": "Perfect nim web framework?",
      "text": "it's HappyX 🍍"
    },
  ]
```

After this we add a new method that responds all posts 🔨
Try recompile `/src/main.nim` and open ✌`http://localhost:5000/posts` 
```nim
  # on GET HTTP method at 127.0.0.1:5000/posts
  get "/posts":
    # will responds all posts
    return posts
```

Add method that responds only one post also 🛠
```nim
  # on GET HTTP method at 127.0.0.1:5000/post
  get "/post$index:int":  # index is post index
    if posts.len > index:
      # try open 127.0.0.1:5000/post0
      return posts[index]
    else:
      # try open 127.0.0.1:5000/post10
      return {
        "error": "post index is wrong"
      }
```
And open `http://localhost:5000/post1` as example 🙂

That's all, good luck ✨

[Source code](https://github.com/HapticX/happyx-tutorial-series/tree/95a67a9d165dcccadbe4d34858b4ec1ae0a1a44e/simple_rest_api)
Make a website and deploy it to GitHub Pages!
Tags: webdev, github, beginners, tutorial
Published: 2023-05-24 05:08:29

Ever wondered how you can deploy your static HTML site for free and seamlessly? Now you can do it with GitHub Pages!

GitHub Pages is a feature of GitHub that enables you to deploy your static site and get a free domain based on your username. The domain name format is `<USERNAME>.github.io`. So if your username is faizbyp, it will be `faizbyp.github.io`.

In this article we'll use Visual Studio Code. **So let's get started!**

## Let's make the site

First, make a directory named `<USERNAME>.github.io`, this will also be the name of your repository. Then open the folder in Visual Studio Code or any text editor that you prefered.

> If you already have a repo named `<USERNAME>.github.io`, the next repo you deploy to GitHub Pages will be available in the same domain in `<USERNAME>.github.io/<REPO_NAME>` format.

Then, create an `index.html` file and make changes to the file as you want. I will make a simple 3 section site page with Bootstrap 5.3 Alpha.

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
  <title>A Site Page</title>
</head>
<body>
  <header class="vh-100 d-flex justify-content-center align-items-center bg-primary">
    <h1 class="text-white">Hello, DEV!</h1>
  </header>
  <section class="vh-100 d-flex justify-content-center align-items-center">
    <h1>This is just a simple site</h1>
  </section>
  <section class="vh-100 d-flex justify-content-center align-items-center bg-dark">
    <h1 class="text-white">A simple footer</h1>
  </section>
</body>
</html>
```

Preview the code [here](https://codepen.io/faizbyp/pen/KKGJooy)

## Publishing to GitHub

Now the HTML is done. The next thing is, initialize the repo and publish it to GitHub.

Simply go to `Source Control` tab in VS Code, and then click `Publish to GitHub`. Don't forget to login to your GitHub account (if you haven't). Then publish it as a public repository.

> Free GitHub account doesn't allow a private repo to be deployed to GitHub Pages. So don't forget to make it public if your account is on a free tier.

Then go to your GitHub repo link. Go to `Settings`. Click `Pages` menu in "Code and automation". Select your deployment source and wait for a few seconds.

Voila! Your site is now live on the internet. Now share it to your friends and colleagues so they know you've made a site.

## Conclusion

There are a lot of opportunity to the GitHub Pages. Technologies are growing so fast nowadays, so it's up to you to utilize the technologies available. Keep learning, and as Steve Jobs said, **"Stay hungry, stay foolish"**.
Magento 2 Change Admin URL: How to Set a Custom Admin URL
Tags: webdev, magento, magento2tutorials
Published: 2023-05-24 04:15:40

Magento 2 is a famous online business stage that stands apart for its wide scope of customization choices. One basic part of guaranteeing the security of any web-based store is to get the backend or administrator board from unapproved access. Magento 2 gives an indispensable element that empowers clients to tweak the default administrator URL with a favored URL of their decision. This extra security layer makes it altogether harder for programmers to suppose and get to the administrator board, subsequently shielding the site from potential digital assaults.

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

This blog entry takes a top to bottom glance at the course of **_Magento 2 Change Admin URL: How to Set a Custom Admin URL_**, featuring the essential strides exhaustively to give a thorough comprehension of the technique.

Subsequent to perusing this post, you will have the information and certainty to get your web-based store's administrator board with a custom URL, improving the general security of your online business site.

For more info, visit **_https://webguru.dev/magento-2-change-admin-url-how-to-set-a-custom-admin-url/_**
Functions in JavaScript | JavaScript #9
Tags: javascript, programming, tutorial, chatgpt
Published: 2023-05-24 04:15:02

// Function in JavaScript 
// A JavaScript function is a block of code designed to perform a particular tast 

function onePlusAvg(x,y){
  console.log("Done")
  return 1 + (x+y)/2
}

// function onePlusAvg(x,y){
//   console.log("Done")
//   return Math.round(1 + (x+y)/2)
// }

let a = 1;
let b = 2;
let c = 3;

// console.log("Average of a and b is ", (a + b)/2)
// console.log("Average of b and c is ", (a + b)/2)
// console.log("Average of a and c is ", (a + b)/2)

// console.log("One plus Average of a and b is ", onePlusAvg(a,b))
// console.log("One plus Average of a and b is ", onePlusAvg(b,c))
// console.log("One plus Average of a and b is ", onePlusAvg(a,c))

console.log("One plus Average of a and b is ", onePlusAvg(a,b))
console.log("One plus Average of a and b is ", onePlusAvg(b,c))
console.log("One plus Average of a and b is ", onePlusAvg(a,c))

[](https://replit.com/@SkSage/Functions-in-JavaScript-11#index.js)
How to Communicate with the native component from React native using bridge
Tags: reactnative, android, ios
Published: 2023-05-24 04:14:01

To communicate with native components using a bridge, you'll typically need to follow a few steps. Here's a general overview of the process

**Set up the bridge**: Depending on the platform you're working with (e.g., Android, iOS, React Native), you'll need to set up a bridge that enables communication between the native code and your JavaScript code.

Define the communication protocol: Determine how you want to exchange data and messages between the native components and your JavaScript code. This could involve defining methods, events, or callbacks that can be accessed through the bridge.

implement the native component: Write the native code component using the appropriate programming language (e.g., Java or Kotlin for Android, Objective-C or Swift for iOS). This component should expose the methods or events you want to communicate with from JavaScript.

Expose the native component to JavaScript: Use the bridge to expose the native component to your JavaScript code. This typically involves registering the component with the bridge and providing a unique identifier.

Access the native component from JavaScript: Once the native component is exposed, you can access its methods or listen to its events from your JavaScript code. This is typically done using the bridge's API, which allows you to call native methods or subscribe to events.

Handle communication: Use the bridge to send messages or data between the native component and your JavaScript code. This could involve invoking native methods, passing parameters, receiving and processing callbacks, or emitting events.

It's important to note that the exact implementation details may vary depending on the platform and bridge you're using. For example, React Native provides its own bridge called "React Native Bridge," while frameworks like Flutter or Xamarin have their own mechanisms for native code integration.

Attaching the few doc's which visualize how the bridge is created.


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

The above image shows both the meta and header files created successfully, Now you can connect the those bridge using native modules from the React.

Thanks for Reading....
Concurrency Vs Parallelism
Tags: webdev, javascript, beginners, programming
Published: 2023-05-24 03:55:50

Imagine you and your friends are playing on a playground, and there are different activities to do: swinging on the swings, sliding down the slide, and climbing on the jungle gym.

Concurrency is like taking turns doing these activities one by one. First, you swing on the swings for a little while, then you go down the slide, and then you climb on the jungle gym. You're doing each activity separately, and you give your attention to one activity at a time.

Parallelism is like playing with your friends, and each of you chooses a different activity to do at the same time. One friend swings on the swings, another friend slides down the slide, and a third friend climbs on the jungle gym. Each of you is doing a different activity simultaneously, and it's like the playground is being used by multiple people all at once.

So, to summarize with the playground example:
- Concurrency is like taking turns doing different activities one after the other.
- Parallelism is like playing with friends, where each person is doing a different activity at the same time.

Just like playing on a playground can be done by taking turns or playing simultaneously with friends, computer programs can use concurrency or parallelism to do their work in different ways too.

Reference:
1.https://devopedia.org/concurrency-vs-parallelism
2.https://www.google.com/amp/s/www.geeksforgeeks.org/difference-between-concurrency-and-parallelism/amp/
3.https://medium.com/@itIsMadhavan/concurrency-vs-parallelism-a-brief-review-b337c8dac350
5 Essential Soft Skills for Developers 🚀🔥
Tags: community, developers, tutorial, career
Published: 2023-05-24 03:50:00

Developers require a blend of technical expertise and essential soft skills to thrive in their roles. These skills contribute to effective collaboration, communication, and overall professional success. Here are some crucial soft skills that developers should cultivate:

## 🗣️ Effective Communication
Clear communication is indispensable for developers. They must convey ideas coherently to both technical and non-technical stakeholders, actively listen to others, and grasp technical concepts while articulating them effectively.

## 🤝 Collaboration
Since developers often work in teams, strong collaboration skills are paramount. This includes the ability to collaborate harmoniously with others, actively participate in discussions, share knowledge, and resolve conflicts constructively.

## ⏰ Time Management
Developers often face multiple tasks and tight deadlines. Proficient time management skills enable them to prioritize tasks, meet deadlines, and maintain productivity without compromising quality.

## 🔄 Adaptability
Given the ever-changing nature of the technology sector, developers must be adaptable. They should readily embrace shifting goals, be open to new approaches, and exhibit a willingness to learn and adopt new technologies.

## 📚 Continuous Learning
The tech landscape evolves rapidly, necessitating developers' commitment to continuous learning. Staying updated with emerging technologies, frameworks, and industry trends ensures ongoing professional growth and enhances problem-solving capabilities.
C++ Switch (Tanlash Operatori).
Tags: webdev, beginners, programming, tutorial
Published: 2023-05-24 03:42:04

Здравствуйте, сегодня мы познакомим вас с оператором выбора в языке программирования C++. Мы используем ключевое слово switch для использования оператора выбора. Вы можете использовать оператор условия без использования этого оператора, но переключение намного проще. Итак, приступим к разбору кодов.

`Синтаксическое представление оператора выбора Switch.`

```
#include <iostream>
using namespace std;

int main()
{


switch(qiymat) 
{
  case x:
    // code block
    break;
  case y:
    // code block
    break;
  default:
    // code block
}

return 0;
}
```

- switch Данное выражение оценивается один раз.

- Значение выражения сравнивается со значениями каждого ключевого слова `case`.

- Если есть совпадение, выполняется соответствующий блок кода.

- `break `завершает оператор выбора.

- `default:` для значения, где ключевые слова являются необязательными.

- работает. Если ничего из вышеперечисленного не соответствует, то будет работать значение по умолчанию.

`Ниже в качестве примера приведены 3 числа, если это число равно 10, 20, 30, то будет выведено сообщение, что это число равно 10, 20, 30, а если оно не совпадает с этими 3 числами, то он будет установлен по умолчанию, и сообщение будет отображаться как none.`

```
#include <iostream>
using namespace std;

int main()
{

int son;
cin >> son;

switch(son)
{
 case 10:
 cout << "Bu son 10 ga teng";
 break;

 case 20:
 cout << "Bu son 20 ga teng";
 break;

 case 30:
 cout << "Bu son 30 ga teng";
 break;

 default:
  cout << "none";
  break;
}


return 0;
}
```
✨RIO66- Nhà Cái Cá Cược Trực Tuyến An Toàn Nhất
Tags: rio66, rio66ltd, conggamerio66, gameslotrio66
Published: 2023-05-24 02:52:20

✨RIO66- Nhà Cái Cá Cược Trực Tuyến An Toàn Nhất
✨RIO66 -Sân chơi uy tín- chất lượng và cực an toàn
✨Khuyến mãi hấp dẫn - giao dịch nhanh
✨Tỉ lệ thắng cao
👇chi tiết👇
🌐web: https://rio66.ltd/gioi-thieu-rio66/
🌐Fanpage: https://www.facebook.com/rio66ltd
📌Địa chỉ: Ng. 84 Đ. Đại Tự, Kim Chung, Hoài Đức, Hà Nội, Việt Nam
☎️sdt: 0562204890
📧Email: rio66ltd@gmail.com
#rio66 #rio66ltd #conggamerio66 #gameslotrio66 #rio66_uy_tín #nhà_cái_rio66 #rio66_cá_cược #rio66_xóc_đĩa #link_rio66
[번역]2023-04-12, Node.js 버전 18.16.0 'Hydrogen'(LTS), @danielleadams
Tags: javascript, node
Published: 2023-05-24 02:29:40

### 주요 변경 사항

#### 단일 실행 파일 애플리케이션에 대한 초기 지원 추가

JavaScript 파일을 단일 실행 파일 애플리케이션으로 컴파일하세요:

```console
$ echo 'console.log(`Hello, ${process.argv[2]}!`);' > hello.js

$ cp $(command -v node) hello

# macOS 이외의 시스템에서:
$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2

# macOS에서:
$ npx postject hello NODE_JS_CODE hello.js \
    --sentinel-fuse NODE_JS_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
    --macho-segment-name NODE_JS

$ ./hello world
Hello, world!
```

Darshan Sen이 기여함 <https://github.com/nodejs/node/pull/45038>

#### URL 파서를 Ada로 교체

Node.js에는 WHATWG URL 명세에 준수하고 기존 구현보다 100% 이상의 성능 향상을 제공하는 새로운 URL parser인 Ada가 도입됩니다.

Yagiz Nizipli이 기여함 <https://github.com/nodejs/node/pull/46410>

#### 기타 주목할 만한 변경 사항

* **buffer**:
  * **(SEMVER-MINOR)** Buffer.copyBytesFrom(...) 추가 (James M Snell) [#46500](https://github.com/nodejs/node/pull/46500)
* **doc**:
  * marco-ippolito를 협업자로 추가 (Marco Ippolito) [#46816](https://github.com/nodejs/node/pull/46816)
  * debadree25를 협업자로 추가 (Debadree Chatterjee) [#46716](https://github.com/nodejs/node/pull/46716)
  * deokjinkim을 협업자로 추가 (Deokjin Kim) [#46444](https://github.com/nodejs/node/pull/46444)
* **events**:
  * **(SEMVER-MINOR)** listenerCount에 listener 인수 추가 (Paolo Insogna) [#46523](https://github.com/nodejs/node/pull/46523)
* **lib**:
  * **(SEMVER-MINOR)** AsyncLocalStorage.bind() 및 .snapshot() 추가 (flakey5) [#46387](https://github.com/nodejs/node/pull/46387)
  * **(SEMVER-MINOR)** aborted() 유틸리티 함수 추가 (Debadree Chatterjee) [#46494](https://github.com/nodejs/node/pull/46494)
* **src**:
  * **(SEMVER-MINOR)** node::Stop()에서 선택적 Isolate 종료 허용 (Shelley Vohr) [#46583](https://github.com/nodejs/node/pull/46583)
  * **(SEMVER-MINOR)** 임베더 코드 생성 정책 제어 허용 (Shelley Vohr) [#46368](https://github.com/nodejs/node/pull/46368)
* **stream**:
  * **(SEMVER-MINOR)** ReadableStream 및 WritableStream에 대한 중단 신호 추가 (Debadree Chatterjee) [#46273](https://github.com/nodejs/node/pull/46273)
* **tls**:
  * **(SEMVER-MINOR)** 자동 DHE 지원 (Tobias Nießen) [#46978](https://github.com/nodejs/node/pull/46978)
* **url**:
  * **(SEMVER-MINOR)** URLSearchParams 크기 getter 구현 (James M Snell) [#46308](https://github.com/nodejs/node/pull/46308)
* **worker**:
  * **(SEMVER-MINOR)** 검사기 및 trace\_events에서 작업자 이름 지원 추가 (Debadree Chatterjee) [#46832](https://github.com/nodejs/node/pull/46832)

---

이 번역된 문서는 원본 Node.js 공식 문서에 기반하며, MIT 라이선스에 따라 사용됩니다. 라이선스 정보는 [여기](https://github.com/nodejs/node/blob/main/LICENSE)에서 확인할 수 있습니다.

[원문 &rarr;](https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#2023-04-12-version-18160-hydrogen-lts-danielleadams)
Dia 1 - #100DaysOfSwift
Tags: todayilearned, swift, ios
Published: 2023-05-24 02:29:31

Swift é uma linguagem type-safe, isso significa que ela obriga o código a respeitar os contratos estabelecidos.

Quando criamos uma variável em Swift não precisamos dizer o tipo da variável, o Swift pode inferir o tipo de acordo com o que for armazenado.

`var greeting = "Hello"`

Mas se preferir, podemos ser mais explícitos e especificar na declaração da variável o seu tipo:

`var greeting: String = "Hello"`

Depois disso o valor pode mudar quantas vezes for preciso, mas o tipo da variável não pode mais ser mudado.
Connect with the Dev Community Assignment Pt.1
Published: 2023-05-24 02:01:42

After reading the article, "5 Things the Internet May Have Ruined" located on HONGKIAT.com, I have learned more about how the internet may be impacting humanity's genuine communication with one another. Due to the lack of body language, physical touch, eye contact, and facial expressions involved in text or email it can be difficult to interpret what one's intent may be with their words. In addition, the easy accessibility of contact through the internet can result in someone becoming too comfortable with it to advance to in-person conversations. 

https://www.hongkiat.com/blog/things-internet-may-have-ruined/







https://www.hongkiat.com/blog/things-internet-may-have-ruined/
Cross-Region Database Synchronization Solution on Alibaba Cloud
Tags: database, security, cloudskills, alibabacloud
Published: 2023-05-24 01:58:01

**Overview**
In today's digital world, companies often need to transfer or sync data across borders for different reasons, including collaborating with international partners, developing new local markets for business globalization strategy, or storing information in overseas servers for disaster recovery. There are many methods for cross-border data transfer (such as public networks and VPN). No matter what approach you choose, you cannot turn a blind eye to the huge costs and the risk of cyberattacks, which can lead to data breaches, loss of confidential information, and reputational damage for companies.

The article explains the best practice of using a cutting-edge product combo to help users transfer data in a safe, reliable, and cost-effective way.

**Who Should Read This**
You should follow this best practice if you want to do any of the following:

- Perform cross-border database migration and synchronization
- Build disaster recovery (DR) ability for business-critical databases

**Topology & Workflow**
The diagram below shows the resources and topology used in this best practice. It is performed based on the following workflow:

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


- Creating secure network conditions for data transfer through Cloud Enterprise Network (CEN)
- Configuring synchronization tasks between databases with Data Transmission Service (DTS)
- Verifying data and performing performance evaluation

**About CEN**
Cloud Enterprise Network (CEN) is a highly available network built on the global private network of Alibaba Cloud. CEN uses transit routers to establish inter-region connections between virtual private clouds (VPCs). This enables VPCs to communicate with data centers and builds flexible, stable, enterprise-class networks on the cloud.

**About DTS**
Data Transmission Service (DTS) is a real-time data streaming service. DTS supports data transmission between data sources (such as relational, NoSQL, and online analytical processing (OLAP) databases). DTS provides data synchronization, data migration, change tracking, data integration, and data processing features. This enables you to manage data within a secure, scalable, and high-availability architecture.

Read the rest part of the article:
https://www.alibabacloud.com/blog/best-practice-cross-border-database-synchronization_599989

✨ Database Free Trial:
https://www.alibabacloud.com/product/databases#J_2463051000