teleren/devto huggingface dataset:
How to Build Express JS Server with Typescript
Tags: express, node, typescript, beginners
Published: 2023-10-23 05:12:29

If you're looking for a quick and easy way to get started with Express JS, then this video is for you! We'll walk you through the steps necessary to build an Express JS server with Typescript, and by the end of the video, you'll have a working server ready to go!

{% embed https://www.youtube.com/watch?v=Xu-1q9ZkqIQ %}

## Setup
#### Initialize NPM Project
```
npm init -y
npm install --dev typescript ts-node @types/node
```

#### Adding tsconfig.json
```
npx tsc --init
```
tsconfig.json
```json
{
  "compilerOptions": {
    "module": "NodeNext",
    "moduleResolution": "NodeNext",
    "target": "ES2020",
    "sourceMap": true,
    "outDir": "dist"
  },
  "include": [
    "src/**/*"
  ]
}
```

#### Configure nodemon to restart the server automatically when adding changes to files.
```
npm install --dev nodemon
```
nodemon.json
```json
{
    "watch": [
        "src/**/*"
    ],
    "exec": "npm run start:dev",
    "ext": "js,ts,json"
}
```

#### Scripts on package.json
```json
"scripts": {
    "build": "tsc",
    "start:dev": "ts-node src/index.ts",
    "dev": "nodemon",
    "start":"npm run build && node ./dist/index.js"
}
```
#### Install and config Express Js
```
npm install express dotenv
```
type definitions for express
```
npm install --dev @types/express
```

src/index.ts
```ts
import express from 'express';
import dotenv from 'dotenv'

dotenv.config()

const app = express()

app.get('/', (req, res) => {
    res.send("Welcome to TS Server Updated!!!")
})

app.listen(process.env.PORT,() => {
    console.log(`TS Server listening on ${process.env.PORT}`)
})
```
.env
```
PORT=3000
```

#### Finally
`npm run dev` to run dev mode
`npm start` to production mode
Manufacturer of Prefabricated Structures - Siddhi Infra
Published: 2023-10-23 05:12:22

Siddhi Infra is a leading manufacturer of pre-fabricated structures, employing modern facilities and methods to offer solutions for the construction of high quality buildings. Our aim is to provide our clients with high quality materials and installation services at an affordable cost.for more information visit our website:-https://www.siddhiinfra.co.in/our-products
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8skmlqt6a4ijniv5bawb.jpg)
4 Benefits of Teeth Whitening: A Brighter Smile Awaits
Tags: teethwhiteninginathens
Published: 2023-10-23 05:06:25

Have you ever gazed at your reflection only to feel disappointed with the color of your teeth? You're certainly not alone. Teeth whitening has become a famous solution for those seeking a brighter, more attractive smile. In this article, we'll explore the four significant benefits of teeth whitening in Athens and how it can boost not only your appearance but also your overall well-being.
Learn more - https://justpaste.it/aznw0
Multiple applications in multiple containers vs Multiple applications in single container
Tags: docker, container
Published: 2023-10-23 05:06:16

---
title: Multiple applications in multiple containers vs Multiple applications in single container
published: true
description: Running multiple applications in multiple containers vs. a single container depends on the specific use case and the architecture of the applications
tags: docker, container
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-10-23 04:44 +0000
---


As a beginner in Docker or container, people always ask why I can't put all the application in a single container and deploy it to anywhere?
Well, technically you can but here are some considerations. 


|   | Multiple Applications in Multiple Containers | Multiple Applications in a Single Container |
|---|---|---|
| **Isolation** | Each application runs in its own environment | All applications share the same environment |
| **Scaling** | Different parts of an application can be scaled independently | All applications must be scaled together |
| **Upgrades** | One part of an application can be upgraded without affecting the rest | Upgrading one application may require restarting all applications |
| **Reuse** | Easier to reuse prebuilt images | Not as straightforward to reuse prebuilt images |
| **Simplicity** | Need to manage networking between containers | No need to manage networking between containers |
| **Tightly-Coupled Processes** | Not a concern if applications are loosely coupled | Might be a requirement if applications are tightly coupled |


Source:
- [Why multi-container docker apps are built? - Stack Overflow.] (https://stackoverflow.com/questions/66100027/why-multi-container-docker-apps-are-built)
- [Multi container apps | Docker Docs.] (https://docs.docker.com/get-started/07_multi_container/)
- [Containers: one single process, or multiple processes?.] (https://www.tutorialworks.com/containers-single-or-multiple-processes/.)
- [Best way to run multiple flask apps in a single docker container.](https://stackoverflow.com/questions/53051686/best-way-to-run-multiple-flask-apps-in-a-single-docker-container)
- [Tutorial: Create a multi-container app with Docker Compose.] (https://learn.microsoft.com/en-us/visualstudio/containers/tutorial-multicontainer?view=vs-2022)
How to Send Files over SCP
Tags: network, tutorial, linux, tooling
Published: 2023-10-23 04:59:58

SCP means Secure Copy Protocol, a network protocol that copies data from one remote place to another through a secure connection. Let's copy a file from one place to another.

To scp a file over, you must include a source and a destination.

```bash
scp [source] [destination]
```

For the source, you type a file path to the file you want to copy. 

For the destination, you type the username and host of the remote device to connect to. 
Then, you type the file path to the destination you want your file to be in.

```bash
scp /path/to/file username@host:/path/to/destination
```

You can use a port number too.

```bash
scp -P 80 /path/to/file username@host:/path/to/destination
```

To learn more, you can always `man scp` for more details.

What esoteric terminal command did you discover?
Introduction to Python Part-1
Tags: python, programming, beginners
Published: 2023-10-23 04:56:57



## শুরু

`Simplicity is the best` আপনি যদি এই উক্তিটি ফলো করেন তাহলে পাইথন প্রোগ্রামিং লাংগুয়েজ আপনার জন্য। 

পাইথন একটি বহুল ব্যবহৃত general purpose এবং high level language। ১৯৯১ সালে `Guido van Rossum` পাইথন উদ্ভাবন করেন। প্রথম দিকে তিনি পাইথনের কোড মেইনটেন্যান্স করতেন কিন্তু পরবর্তী `Python Software Foundation` পাইথনের সকল কিছু নিয়ন্ত্রন করে। 

## পাইথন কেন?

পাইথন ল্যাঙ্গুয়েজ কি জন্য এসেছে সেটা যদি জানতে হলে  তার আগে জানতে হবে , ওই সময়ে বিদ্যমান থাকা প্রোগ্রামিং ল্যাঙ্গুয়েজ। যখন সি প্রোগ্রামিং ল্যাঙ্গুয়েজ মার্কেটে আসে এবং সেটা কম্পিউটার সাইন্স এক ধরনের revolution বলা যেতে পারে কারণ  এর আগে যেসব প্রোগ্রামিং ল্যাঙ্গুয়েজ বিদ্যমান ছিল সেগুলো অনেক লো লেভেলে কাজ করতো। প্রোগ্রামের প্রোগ্রামিং করতে অনেক সমস্যা হতে হতো । C  আসার পরে এসকল সমস্যা অনেকাংশে সমাধান হয়ে গেছে। 

 সি প্রোগ্রামিং ল্যাঙ্গুয়েজ দিয়ে কোন সমস্যা সমাধান করতে গেলে তা অনেক সময় লেগে যেত যা একজন প্রোগ্রামারের সময় নষ্ট করত।  এজন্য C এর সকল Feature আর নতুন কিছু Feature, এক করে  C++ উদ্ভাবন করা হয়।  C++-এ অনেক নতুন নতুন feature সংযুক্ত করা হয়।  কিন্তু C++ -এ C এর মত অনেক কোড লেখা লাগত আর developer friendly ও ছিল না। একজনের লেখা কোড অন্য জনের বুঝতে একটু সময় লেগে যেত। 

এই সমস্যাটা সমাধান করার জন্যই পাইথন উদ্ভাবন করেছিলেন। পাইথন কে ডেভেলভ করা মূল উদ্দেশ্য ছিল  ডেভলপার ফ্রেন্ডলি করা। সহজ সহজ সিনট্যাক্স ব্যবহার করা। কম কোড করে  বড় বড় সমস্যার সমাধান করা। 

## পাইথনের বৈশিষ্ট্য

- **Interpreted:** পাইথন একটি Interpreted ল্যাঙ্গুয়েজ। যার কারনে কোডকে খুব সহজে  রান যায়। সরাসরি সোর্স কোড থেকে রান হওয়ার হয়। কম্পাইল করার প্রয়োজন হয় না।
- **প্লাটফর্ম অনির্ভশীলতাঃ**  যেকোন প্লাটফর্ম (windows , linux , mac etc) -এ পাইথন ব্যবহার করা যায়। পাইথন Interpreter সোর্স কোডকে প্রথমে বাইট কোডে রুপান্তর কর। তারপর  Machine এর জন্য Native machine কোড-এ রুপান্তর করে।
- ওপেন সোর্সঃ পাইথন সবার জন্য উন্মুক্ত। আপনার যথেষ্ট knowledge এবং Skill থাকলে আপনি Python এ contribute করতে পারবেন।
- **High Level:** পাইথন মেশিনের অনেক উপরে থেকে কাজ করে। পাইথন হাই লেভেল হওয়ায় অল্প কোড  লিখে বড় বড় সমস্যার সমাধান করা যায়।

## ব্যবহার ক্ষেত্র

- Web Development
- Software Development
- Machine Learning
- AI (Artificial Intelligence)
- Data Science
- Desktop Application Development
- Console Application etc.

উপরেরর ক্ষেত্র গুলো ছাড়াও অনেক কাজে পাইথন ব্যবহার করা হয়। তবে এসবে ভিতর থেকে Machine Learning , AI এবং Data Science এর জন্য পাইথন সেরা। কারন এখানে অনেক কোড লেখার প্রয়োজন হয় যদি পাইথন ব্যবহার না করে অন্য কোন language ব্যবহার করেন। 

## পাইথনে অসুবিধা

- পাইথনের সবচেয়ে বড় অসুবিধা হচ্ছে কোড রান হতে C , C++ এর তুলনায় বেশি সময় নেই।
- ব্লক তৈরি করতে  কোড-এ Indentation (1 tab or 4 space) ব্যবহার করতে হয়। নতুবা হলে Error রিটার্ন করবে।
- কোড রান করতে অনেক মেমরীর প্রয়োজন হয়।
- প্যাকেজ ম্যানেজ করা অন্যান্য language এর তুলনায় অনেক কঠিন।

পাইথনের কোড অনেক সময় নেয়, যে কারনে backend development  সেরা পছন্দ না। তাছাড়া যেখানে অ্যাপ্লিকেশান এর speed প্রথম priority থাকে সেখানে python suitable না। 

## শেষ

পরিশেষে একটা কথাই বলব, Python (language) is python (Snake)। কারন Python সাপের মত python language  খুবই শক্তিশালি এবং বিশাক্ত।
Placeholder Maintainer
Published: 2023-10-23 04:41:53

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->

### Intro
<!-- Share a bit about yourself as a maintainer. Is this your first Hacktoberfest, or have you maintained in others? Feel free to embed your GitHub account by using {% embed LINK %} -->

### Project
<!-- Tell us about the repository that you hosted. What processes did you set up to review and merge pull requests? Feel free to embed your GitHub repo by using {% embed LINK %} -->

### Highs and Lows
<!-- What were some of your biggest accomplishments or light-bulb moments this month? Did any problems come up that seemed impossible to fix? How did you adapt in those cases?  -->

### Growth
<!-- What was your skillset before Hacktoberfest 2023 and how did it improve? Have your project goals changed since publicly maintaining it? -->
Anil K Tiwari
Published: 2023-10-23 04:40:53

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title, structure, and words! ✨ -->

### Intro
<!-- Share a bit about yourself as a contributor. Is this your first Hacktoberfest, or have you contributed to others? Feel free to embed your GitHub account by using {% embed LINK %} -->

### Highs and Lows
<!-- What were some of your biggest accomplishments or light-bulb moments this month? Did any problems come up that seemed impossible to fix? How did you adapt in those cases?  -->

### Growth
<!-- What was your skillset before Hacktoberfest 2023 and how did it improve? Have your learning or career goals changed since working on these new projects? -->
Spread the love for contributors.
Tags: hack23contributor, hacktoberfest23, hacktoberfest, opensource
Published: 2023-10-23 04:26:20

September is the perfect time to prepare for Hacktoberfest. Get a jump start by finding projects to contribute to, adding the ‘hacktoberfest’ tag to your projects, or familiarizing yourself with Git.

### Intro
Hacktoberfest has grown from 676 participants in 2014 to nearly 147,000 participants last year. To help ensure Hacktoberfest can be sustained for another decade, we’re moving away from a free t-shirt reward to a digital one.

We’re celebrating 10 years of open-source love this year and want to hear your Hacktoberfest story!
'

No Hacktoberfest is complete without joining the community to learn and explore together. Save the dates and connect!

### Growth
Open source projects, maintained by community-minded coders, make the modern internet function. Supporting that essential work, and the folks behind it is what Hacktoberfest is all about.
5 lines of Python code to change the posture of photography
Tags: stablediffusion, ai, api, sdk
Published: 2023-10-23 04:01:38


![Mix Pose API novita.ai](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4kume0457bhe1szr00lx.png)

You can install the Novita Python SDK using just one command
```bash
pip install novita-client
```

then you can get `NOVITA_API_KEY` from https://novita.ai/get-started/

Finally, you can try the mix pose demo by following this code.

```python
import os

from novita_client import NovitaClient
from novita_client.utils import base64_to_image

client = NovitaClient(os.getenv('NOVITA_API_KEY'))
res = client.mixpose(
    image="https://image.uniqlo.com/UQ/ST3/my/imagesgoods/455359/item/mygoods_23_455359.jpg?width=494",
    pose_image="https://image.uniqlo.com/UQ/ST3/ca/imagesgoods/455359/item/cagoods_02_455359.jpg?width=494",
)

base64_to_image(res.image_file).save("./mixpose.png")

```

novita-client is the Python SDK of Novita.AI, which provides the following features.

- [cleanup](./examples/cleanup.py) - remove all your generated images
- [remove-background](./examples/remove-background.py) - remove background from image
- [remove-text](./examples/remove-text.py) - remove text from image
- [reimagine](./examples/reimagine.py) - reimagine image
- [doodle](./examples/doodle.py) - doodle image
- [merge-face](./examples/merge-face.py) - merge face
- [mix-pose](./examples/mix-pose.py) - mix pose
- [outpainting](./examples/outpainting.py) - outpainting
- [replace-object](./examples/remove-object.py) - remove object
- [replace-background](./examples/replace-background.py) - replace background
- [replace-sky](./examples/replace-sky.py) - replace sky
- [create-tile](./examples/create-tile.py) - create tile
Simplifying Database Interactions with Django's ORM
Published: 2023-10-23 03:12:42

As a Django enthusiast, I've always been fascinated by the power and simplicity of the Django ORM (Object-Relational Mapper). In my recent project, I encountered a significant challenge that highlighted the elegance of the Django ORM in simplifying complex database interactions.

The project involved building a robust content management system for a growing e-commerce platform. One of the crucial requirements was to implement a dynamic product recommendation feature based on customer browsing history. This necessitated efficient data retrieval and manipulation from multiple database tables.

Django's ORM came to the rescue with its intuitive querying capabilities. Leveraging the ORM's expressive syntax, I swiftly constructed a complex query that aggregated customer data, their purchase history, and browsing patterns. By utilizing Django's filter, annotate, and aggregate functions, I could extract the relevant data points and compute personalized product recommendations for each user.

A particular snippet that I am proud of is the concise yet powerful query I used to retrieve top-selling products within a specific category. Here's a simplified version of the code:


```
from django.db.models import Count

def get_top_products_in_category(category_name, limit=5):
    top_products = Product.objects.filter(category__name=category_name) \
        .annotate(num_purchases=Count('purchases')) \
        .order_by('-num_purchases')[:limit]
    return top_products
```


This snippet efficiently fetches the top products in a given category by counting the number of purchases for each product and ordering the results based on the purchase count. The seamless integration of filters, annotations, and ordering exemplifies the elegance of the Django ORM in simplifying complex database operations.

Through this experience, I solidified my appreciation for Django's robust ORM and its ability to streamline intricate database interactions. Its clear and expressive syntax not only facilitated the implementation of intricate features but also enhanced the overall maintainability and scalability of the project.

In conclusion, Django's ORM remains a fundamental pillar in my development toolkit, consistently empowering me to build efficient and scalable web applications while keeping the focus on delivering exceptional user experiences.
Leetcode 342. Power of Four (Easy)
Tags: 100dayschallengeleet, c, leetcode
Published: 2023-11-06 17:14:14

---
title: Leetcode 342. Power of Four (Easy)
published: TRUE
date: 2023-10-23 03:56:12 UTC
tags: 100DaysChallengeLeet,C,leetcode
canonical_url: https://www.nileshblog.tech/leetcode-342-power-of-four/
---

LeetCode 342. Power of Four :Hey there, coding enthusiasts! Welcome back to another exciting coding session. Today’s problem is a treat—literally! We’re going to solve the “Power of Four” or “LeetCode 342. Method we are using are Mathematical approach and Bit Manipulation. Approach : Mathematical Line Explanation n x fmod(x, 1.0) Output 1 Check if n <= 0. 16 – ... [Read more](https://www.nileshblog.tech/leetcode-342-power-of-four/ "Leetcode 342. Power of Four (Easy)")

The post [Leetcode 342. Power of Four (Easy)](https://www.nileshblog.tech/leetcode-342-power-of-four/) appeared first on [NileshBlog.Tech](https://www.nileshblog.tech).
Placeholder Contributor
Tags: hack23contributor, webdev, hacktoberfest23, hacktoberfest
Published: 2023-10-23 03:07:30

Intro
As a second-year undergraduate studying Information Systems in Sri Lanka, this Hacktoberfest has been an incredible learning experience for me. This was my very first Hacktoberfest, and I was eager to dive into the world of open source contributions. If you're curious to see my contributions, feel free to explore my GitHub profile.

Highs and Lows
Throughout the month, I encountered numerous highs and lows. One of my most significant accomplishments was successfully contributing to open source projects in Java and JavaScript. These moments were like light bulbs going off in my understanding of these technologies. However, it wasn't always smooth sailing. I faced challenges that, at first, seemed impossible to overcome. The key was adaptability. I learned to approach problems from different angles, seek help from the open source community, and ultimately turn roadblocks into stepping stones.

Growth
Before Hacktoberfest 2023, my skillset in Java and JavaScript was decent, but I wouldn't call myself an expert. After this month of intense contributions, my skills have undoubtedly improved. I now have a deeper understanding of coding standards, collaborating with developers from around the world, and using version control tools effectively. My learning and career goals have evolved since I started working on these new projects. I'm more confident in my abilities, and I can see a future where I contribute to open source projects regularly, even after Hacktoberfest. It has opened up new career possibilities in the tech world that I'm excited to explore.
My Wagtail Adventure
Published: 2023-10-23 02:24:01

I've been learning about Wagtail. Their website, https://www.wagtail.io/, helped me understand the basics, and their code on GitHub, https://github.com/wagtail/wagtail, showed me how it works.

I got interested in their "Adopt generic class based views across the Wagtail admin" project. They want to organize their code better. I know a bit about Django and Python, so I want to help.

I learned that working together and talking to others is really important. The Wagtail community is all about helping each other, and it inspired me.

I can't wait to start helping with the Wagtail project. I'm sure I'll learn a lot and make a difference. I'll be focusing on the project to use generic class-based views in the admin: https://github.com/wagtail/wagtail/issues/8365. It's just right for me!
Checking version updates in package.json
Tags: node, javascript, npm
Published: 2023-10-23 01:10:49

There is a nice tool to check the project dependencies automatically. As for now, it reaches 8k+ stars on Github, and 300k+ weekly downloads. Well liked by the community.


Here are the steps:

`npm install -g npm-check-updates`
`ncu`
`ncu -u`
Introduction:
Tags: interview
Published: 2023-10-23 01:04:23

Lucky Holders is more than just an NFT project, it is a gateway to a world of possibilities.



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


By leveraging the power of the Bitcoin blockchain and the innovative Ordinals protocol, we aim to create a vibrant ecosystem that rewards and empowers our community of lucky holders.


Join us...🧡
The Efficacy of Psychometric Tests in Identifying Proficient Software Engineers
Tags: pyschometricte, aptitudetest
Published: 2023-10-23 00:10:47



In the recent past, I found myself taking a psychometric test that emphasized speed and accuracy. This approach seemed somewhat out of place to me. Is the essence of engineering truly about speed? Has the discipline been diminished to mere instincts, much like foreign exchange trading? While I recognize that engineering involves solving problems, I question whether reaching a solution more quickly is synonymous with reaching the safest solution.

Engineering is not merely about finding solutions at a rapid pace. Accuracy is indeed a factor to consider, but it is not the sole determinant of a good engineering solution. Safety and resource efficiency must also be taken into account.

Interestingly, psychometric tests seem to reduce engineering to an analytical approach, while in reality, engineering is largely a classical discipline.

So, are psychometric tests the most effective way to determine if an engineer excels in their work? I would challenge this approach to some extent. From my own engineering experience, I have come to realize that solutions can arise from various perspectives and that quick thinking contributes minimally to effective engineering solutions.

I believe that speed and accuracy only measure certain aspects of an individual engineer's quick thinking abilities. While these traits might be beneficial in certain fields like aviation engineering, I believe that they represent an inner layer - something innate - that has minimal influence on the overall effectiveness of an engineer.

Finally, psychometric tests can be gamed. There are many resources available online and in books that teach people how to improve their performance on psychometric tests. This means that candidates who are good at taking tests may score higher than candidates who are more skilled in engineering.

While there may not be a universally accepted approach to determine a good engineer, I am skeptical about the inclusion of psychometric tests in the hiring process. These tests may provide some insights but should not be the sole or primary determinant in the hiring decision.
A Flight Tracker Map with React.js
Tags: maps, tracker
Published: 2023-10-27 06:37:08

---
title: A Flight Tracker Map with React.js
published: true
date: 2023-10-23 00:10:00 UTC
tags: Maps,Tracker
canonical_url: https://reactjsexample.com/a-flight-tracker-map-with-react-js/
---

# Flight Radar: on Map
 ![A Flight Tracker Map with React.js](https://reactjsexample.com/content/images/2023/10/Code_2023-10_10-05-02.jpg)

![A Flight Tracker Map with React.js](https://github.com/mehmetpolat46/FlightRadar/raw/main/fly.gif)

# Kütüphaneler

- @reduxjs/toolkit
- react-redux
- thunk için harici indrimeye gerek yok yanında geliyor toolkitin
- axios
- react-leaflet
- leaflet
- react-paginate

# Kaynaklar

- API: [https://rapidapi.com/apidojo/api/flight-radar1](https://rapidapi.com/apidojo/api/flight-radar1)

# FlightRadar

## GitHub

[View Github](https://github.com/mehmetpolat46/FlightRadar?ref=reactjsexample.com)
Experience vs.Knowledge?
Tags: discuss, codenewbie, beginner
Published: 2023-10-23 00:00:00

---
published_at : 2023-10-23 00:00 +0000
---
How does experience compare to knowledge in the role of a software engineer?

Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
What Innovative Possibilities Does Generative AI Unlock?
Tags: discuss, ai, chatgpt
Published: 2023-10-23 00:00:00

---
published_at : 2023-10-23 00:00 +0000
---
What do you think are some of the most exciting and innovative use cases of Generative AI? 

Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}