teleren/devto huggingface dataset:
Mastering Asynchronous Programming in JavaScript
Published: 2024-01-02 09:12:21

Asynchronous programming is an essential concept in JavaScript that allows non-blocking execution of code. This means JavaScript can perform multiple operations concurrently without getting blocked. Asynchronous JS relies primarily on callbacks, promises and async/await. In this article, we'll understand how to use these tools to write asynchronous code.

## Callbacks

Callbacks are functions that are passed as arguments to other functions to be executed at a later time. For example:

```js
function doTask(callback) {
  // do something
  callback(); // execute callback
}

doTask(function() {
  // this is the callback  
});
```

Callbacks are used in many asynchronous JavaScript operations like fetching data, event handling, timeouts etc. A drawback is callback hell or pyramid of doom caused by nesting several callbacks.

## Promises

Promises represent the future value of an asynchronous operation. They can have three states - pending, fulfilled or rejected. We handle promises with `.then()` and `.catch()`:

```js
function asyncFunc() {
  return new Promise((resolve, reject) => {
    if (success) {
      resolve(value); // fulfilled
    } else { 
      reject(error); // rejected
    }
  });
}

asyncFunc()
.then((result) => {
  // handle fulfillment 
})
.catch((error) => {
  // handle rejection
});
```

Promises avoid callback hell and make asynchronous code linear using chaining. Multiple promises can be executed concurrently with `Promise.all()`.

## Async/Await

Async/await makes asynchronous code look like synchronous code. The `async` keyword before a function designates it as asynchronous and `await` pauses execution until a promise resolves or rejects. 

```js
async function asyncFunc() {
  const result = await promiseBasedFunc(); 
  // other sync operations
  const value = await someOtherFunc();
  return result;
}
```

Try/catch blocks can be used for error handling. Async/await makes asynchronous code very readable compared to callbacks and chaining promises.

So in summary, callbacks offer basic asynchronous capabilities, promises improve code structure, and async/await make it sync-like. Mastering these techniques will help you write efficient asynchronous JavaScript code.
Kenapa Pentingnya mendapatkan Sertifikasi di bidang IT/sebagai programmer
Published: 2024-01-02 09:07:56

Saat ini teknologi informasi (IT) menjadi salah satu bidang yang berkembang pesat. Banyak perusahaan membutuhkan tenaga-tenaga terampil di bidang IT untuk mengembangkan sistem dan aplikasi mereka. Tidak heran jika kebutuhan programmer dan profesional IT lainnya terus meningkat dari tahun ke tahun.

Untuk menjadi profesional IT yang kompeten, sertifikasi merupakan salah satu hal penting yang perlu dimiliki. Berikut beberapa alasan mengapa sertifikasi IT/programmer penting bagi karir Anda:

1. Menambah kredibilitas Dengan memiliki sertifikasi yang diakui secara internasional, kredibilitas Anda sebagai profesional IT akan meningkat di mata para recruiter dan perusahaan. Sertifikasi menjadi bukti bahwa Anda memiliki kompetensi tertentu di bidang IT.
2. Meningkatkan skill Ujian sertifikasi biasanya mengharuskan Anda mempelajari suatu subyek secara mendalam. Proses belajar dan persiapan untuk ujian sertifikasi akan mengasah skill Anda di bidang IT tertentu. Anda juga harus up to date dengan teknologi terbaru untuk lolos ujian.
3. Meningkatkan skill Ujian sertifikasi biasanya mengharuskan Anda mempelajari suatu subyek secara mendalam. Proses belajar dan persiapan untuk ujian sertifikasi akan mengasah skill Anda di bidang IT tertentu. Anda juga harus up to date dengan teknologi terbaru untuk lolos ujian.
4. Lebih kompetitif Dengan semakin banyaknya profesional IT, persaingan untuk mendapatkan pekerjaan menjadi semakin ketat. Sertifikasi memberi nilai tambah pada CV Anda dan membuat Anda lebih kompetitif dibanding kandidat lain yang tidak memiliki sertifikasi.
5. Meningkatkan gaji Perusahaan IT umumnya menawarkan gaji yang lebih tinggi kepada kandidat dengan sertifikasi. Bahkan, beberapa sertifikasi tertentu bisa membuat gaji Anda naik signifikan dibanding rekan kerja dengan kualifikasi yang sama namun tanpa sertifikasi.
6. Pengembangan karir Sertifikasi merupakan salah satu faktor yang dipertimbangkan perusahaan dalam promosi jabatan dan pengembangan karir karyawannya. Dengan memiliki sertifikasi yang relevan, Anda memiliki peluang lebih besar untuk maju di karir IT Anda.
I created a vite&vue plugin that quickly generates styles
Published: 2024-01-02 08:59:48

This is a plugin that can automatically generate style code according to the style written directly in the class. There is no need to declare the class name in the tag and then go to a specific style area to write the style code, as in traditional development.
However, you need to follow the plugin's authoring rules to write class names that carry styled content. Please click the following link to see the specific use:
[vite-plugin-vue-ecss](https://www.npmjs.com/package/vite-plugin-vue-ecss)
Elevating my Ruby on Rails knowledge
Tags: rails, webdev, programming, productivity
Published: 2024-01-02 08:56:54

## Introduction
Embarking on a journey to become a better programmer is an exciting endeavour. To help me hone my Ruby on Rails skills, I've curated a list of 12 projects, each designed to take approximately one month to complete. By dedicating time to one project each month, I'll not only deepen my understanding of Ruby on Rails but also build a strong portfolio showcasing my versatility as a developer.

## Projects
1. Blog Platform
2. Task Manager
3. E-Commerce Website
4. Social Media Dashboard
5. Job Board
6. Event Calendar
7. Forum or Discussion Board
8. Authentication System
9. API Integration
10. File Upload Manager
11. RSS Feed Aggregator
12. Real Time Chat Application

## Monthly Progress Updates
As I tackle each project, I'll consider documenting my journey in monthly blog posts. Sharing my challenges, triumphs, and the lessons learned. This not only provides a record of my progress but also contributes to the developer community. I'll be able to discuss the technologies I used, the design decisions I made, and any optimisations I implemented.

## Conclusion
By committing to a new project each month, I'll not only enhance my Ruby on Rails skills, but also build a robust portfolio that showcases my growth as a developer. Remember, the key is to enjoy the learning process and celebrate victories, big or small.
NBA All-Star Game 2024 Live
Tags: games, sports
Published: 2024-01-02 08:44:52

NBA All Star Game will be held on Sunday, February 18, 2024 at Gainbridge Fieldhouse, Indianapolis, Indiana.

The NBA All-Star Game is an annual exhibition basketball game that serves as the culmination of the NBA All-Star Weekend. The game features the league’s star players, selected through a combination of fan voting, coaches’ selections, and media voting. The All-Star Weekend is a celebration of basketball and includes various events such as the Rising Stars Challenge, Skills Challenge, Three-Point Contest, and Slam Dunk Contest.

The format of the NBA All-Star Game has undergone changes over the years. Traditionally, the Eastern Conference All-Stars faced the Western Conference All-Stars. However, in recent years, the league has adopted a format where team captains, usually the top vote-getters from each conference, select their teams in a playground-style draft. This format was introduced to add excitement and competitiveness to the game.

The All-Star Game is known for its high-scoring and entertaining nature, as the best players in the league showcase their skills in a more relaxed and fun atmosphere. The event is not just about the game itself but also serves as a platform for the NBA to engage with fans and showcase the talent and personalities of its players.

The location of the [NBA All-Star Game](https://hsffootballcast.com/watch-nba-all-star-game-2024-live-free/) changes each year, with different cities hosting the event. The selection of the host city is typically made several years in advance. The game provides a platform for basketball fans to see their favorite players in action and has become a significant event in the NBA calendar.
The Best AI Content Writer Plugin For WordPress
Published: 2024-01-02 08:38:38

[WP AI Copilot](https://wpaicopilot.com/)–the ultimate. Say goodbye to the mess, with WP AI Copilot, create, edit, and publish effortlessly in one place. Take control of your WordPress content creation, simplify your workflow, enjoy seamless control & watch your content soar to new heights on Google.
Tkinter Library in Python - Make your own Desktop App
Tags: webdev, python, beginners, programming
Published: 2024-01-02 08:29:02

Tkinter is a Graphical User Interface (GUI) toolkit you should try out if you want to explore the power of Python in creating desktop apps.

Typically, you don't need to install tkinter separately if you've installed a later version of Python, starting with Python 3. The library may not work with old Python versions, though. This is a common problem for Mac and Linux users, as these OSes usually come with older versions of Python by default.

Generally, to use the tkinter module, ensure that you download and install the latest compatible version of Python on your PC from the official python.org website.

[](https://www.youtube.com/watch?v=KvKwTEoMgJo)
Using Faker Module in Django
Tags: beginners, django, faker
Published: 2024-01-02 08:27:51

When ever we are working on some application and testing on it , we need some data which are harder to type often so using this faker data module , we can save time and helpful to do productive work.

pip install Faker

Below is the documentation of FAKER module
[https://faker.readthedocs.io/en/master/]

This is the code we can use in Django application.

create a file in project folder any name faker_data.py

```
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crudproject.settings') # crudproject is your project name 
import django
django.setup()
import random
from crudapp.models import Student #this is application name and model
from faker import Faker
fake = Faker()
country = ['India', 'Sweden', 'England', 'Italy', 'Brazil', 'Austria'] 

def lazy_name():
  fname = fake.first_name()
  lname = fake.last_name()
  email = fake.email()
  mobile = fake.ean(length=13)
  location = random.choice(country)
  student = Student.objects.get_or_create(fname=fname, lname=lname, email=email, mobile=mobile, location=location)
  return student

def generate_times(N):
  for _ in range(N):
  lazy_name()

if __name__ == '__main__':
print("Generating please wait..")
generate_times(10)
print("Names generated")
```

Thank you
The story of PVR
Tags: startup, business, pvr, success
Published: 2024-01-02 08:24:41

The story of PVR Cinemas began in 1995, when Ajay Bijli, the founder, saw an opportunity to bring a new level of entertainment to India. At the time, the cinema industry in India was largely stagnant, and the movie-going experience was often uncomfortable and lacking in amenities. Bijli saw an opportunity to change that, and he set out to create a cinema chain that would offer a world-class movie-watching experience.


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

Bijli joined hands with an Australian company named Village Roadshow, a company that is one the largest exhibition companies in the world with more than 1,000 screens under operation. This 60:40 joint venture between Priya Exhibitors (The name "Priya" in the original name referred to a cinema hall in Delhi that was owned by Ajay Bijli's family,)and Village Roadshow formed Priya Village Roadshow (PVR) which was first to introduce the concept of multiplexes in India.

Bijli's journey started with the renovation of a single-screen cinema in Delhi namely PVR Anupam Saket. He transformed the theatre, adding comfortable seats, air conditioning, and a state-of-the-art sound system. The renovation was a success, and the theatre quickly became a popular destination for movie-goers.

From there, Bijli continued to expand his cinema chain, opening new locations across India and incorporating new technologies and amenities. In 1997, PVR Cinemas opened its first multiplex, which offered multiple screens, a range of food and beverage options, and a more immersive movie-watching experience.

In November 2002, Village Roadshow sold all of its holdings to Priya Exhibitors in order to liquidate its investment. The name was later changed to PVR Cinemas, but the acronym PVR was retained as the brand name, as an ode to the Australian cinema and entertainment company that partnered with PVR Cinemas in its early days.

The story of PVR Cinemas is a testament to the power of innovation and perseverance. Through his passion for cinema and his willingness to take risks and embrace new technologies, Ajay Bijli has transformed the movie-going experience in India and created a brand that is beloved by movie-goers across the country.

Follow Sidramaraddy[](https://www.linkedin.com/in/sidramm/) for more success stories.
📌 What is a Cloud architecture on Brainboard?
Tags: cloud, architecture, design
Published: 2024-01-02 08:00:00

## Description

Cloud architecture represents a real infrastructure that is either deployed or to be deployed.

- It is the container and the graphical face of your cloud resources.
- Architectures are located within an environment inside a project.
- In terms of Terraform, it has its own Terraform state file.
- It supports modules and private git repository natively.
- It has its own CI/CD pipelines to allow you to check its security posture, pricing, policies...before introducing any change.

## Components
Think of the architecture as a git repository containing all cloud resources of your infrastructure.

## 1. Architecture information
All high-level information related to the architecture are accessible from the list of projects, environments and architectures.

![Architecture information](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lsm453blk95cvrpg6aqg.png)

Here is the explanation of all fields:

a. Name of the architecture.

b. Status of the architecture:

![Status of the architecture](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r53oo9u0znk55o6gw4dx.png)



c. Description of the architecture.
d. Tags: list of tags.
e. Created at is a read-only field. The creation time stamp is in UTC.
f. Updated at is a read-only field. The last time this architecture has been updated in UTC format.
g. UUID: architecture unique identifier. This number is useful when you reach out to support.

## 2. Nodes

The node is a fundamental component of the architecture, it represents (in most cases) a cloud resource of a given cloud provider.

- Every node has an identity card that contains its cloud configuration.
- This identity card represents the Terraform configuration parameters of the node. Eg:
azurerm_lb
aws_instace
google_app_engine_application

You can connect nodes by using the connectors from any selected node.

There are 5 types of nodes:
1. Cloud resource: this resource will be created when you provision the infrastructure.
2. Data source: it refers an existing cloud resource.
3. Module: Terraform module.
4. Container: it can contain other resource and give them its properties. For e.g. AWS VPC, or Azure virtual network.
5. Icon only: this resource is just graphic and has no Terraform representation.

## 3. Variables
These are Terraform variables and locals that you can define and use both on the design and during deployment.

## 4. Output
This is Terraform output that you can define and use both on the design and during deployment.

## 5. Readme file
You can write documentation for your infrastructure in markdown, and Brainboard generates the HTML version of it.

## 6. Versions
You can track every change you do to the infrastructure by creating as many versions as you want.

Design your cloud architectures here 👉 https://app.brainboard.co
Google Cloud
Published: 2024-01-02 07:57:01

---
title: Google Cloud
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-12-30 11:35 +0000
---
Google Cloud es uno de los gigantes dentro de los servicios de hosting en la nube, usando sus servicios podemos montar una infraestructura flexible y escalable para cualquier tamaño de proyecto.

Google Cloud es el proveedor de servicios de cloud, tanto PaaS, como SaaS, como laaS, de google.

Recursos informáticos:
-Compute Engine:
El mas conocido para lanzar máquinas virtuales, instancias.

-App Engine:
Es una plataforma como servicio para lanzar aplicaciones

- Kubernetes Engine:
Es un sistema de gestión y orquestado de aplicaciones en contenedores.

- Container Registry:
Es para gestionar el almacenamiento y servir nuestros contenedores a nuestras aplicaciones.

Almacenamiento y Bases de Datos:
-Cloud Storage:
Es la plataforma de gestion de almacenamiento de google,
Discover APIs Like Never Before with APIHUNT.io 🚀
Tags: api, apigateway, productivity, ai
Published: 2024-01-02 07:54:27

As a consultant immersed in digital transformation, I've experienced firsthand the complexities and time-consuming nature of API discovery and integration. That's why I created **APIHUNT.io**, a platform dedicated to simplifying the process for developers and enterprises alike.

## Why [APIHUNT.io](https://apihunt.io)? 🤔

- **Curated API Collections:** Browse through our handpicked lists of APIs, organized for various needs and industries.
- **Community Insights & Reviews:** Learn from the experiences and advice of other professionals.
- **Integration Guides:** Step-by-step tutorials and tips to help you understand and use APIs effectively.
- **Weekly Newsletter:** Stay updated with the latest in API trends and technologies.

## Who is it for? 👥

Whether you're a developer tired of sifting through countless APIs or an enterprise looking for efficient integration solutions, APIHUNT.io is your go-to resource. My aim is to foster a community where sharing knowledge and tools is the norm, driving innovation and efficiency in projects of all sizes.

## Join the Newsletter! 🌟

Ready to simplify your API discovery and integration process? Join us at [APIHUNT.io Newsletter](https://apihunt.io/newsletter) and sign up for our weekly newsletter to never miss out on the latest APIs and insights.

Let's embark on this journey together! 🚀
Andrew

#APIHunt #DevCommunity
Simplified: Penulis Blog Perancang Korporat Dalam Talian Percuma untuk Pertumbuhan Perniagaan Anda
Published: 2024-01-02 07:53:49

Dapatkan penulis blog percuma yang **profesional dan kreatif untuk **perancang korporat dalam talian daripada Simplified. Kami menyediakan kandungan yang menarik dan informatif untuk meningkatkan visibiliti korporat anda di platform digital.
https://simplified.com/ms-ai-blog-writer/corporate-planner
Advent of Code 2023 - December 25th
Tags: advent, adventofcode, python, december
Published: 2024-01-02 07:53:45

---
title: Advent of Code 2023 - December 25th
published: true
description: My progress with the 2023 version of Advent of Code
tags: advent, adventofcode, python, december
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/36qayk14ewje7rvykeg5.jpg
series: Advent of Code 2023
# published_at: 2023-12-01 17:41 +0000
---

In this series, I'll share my progress with the 2023 version of [Advent of Code](https://adventofcode.com/2023).

Check the first post for a short intro to this series.

You can also follow my progress [on GitHub](https://github.com/robvanderleek/adventofcode).

## December 25th

[The puzzle of day 25](https://adventofcode.com/2023/day/25) is straightforward _if_ you know about [Karger's algorithm](https://en.wikipedia.org/wiki/Karger%27s_algorithm) (which I didn't, needed to Google it.) 

__My pitfall for this puzzle:__ Solving this puzzle required me to do a few searches on graph theory. It's always less satisfactory if I need to do that instead of coming up with something (horribly bloated and inefficient) myself. 

{% spoiler Solution here, do not click if you want to solve the puzzle first yourself %}

```python
#!/usr/bin/env python3
import random

def parse():
    nodes = set()
    edges = []
    with open('input.txt') as infile:
        lines = infile.readlines()
        for line in lines:
            parts = line.strip().split(': ')
            from_node = parts[0]
            nodes.add(from_node)
            to_nodes = parts[1].split(' ')
            for to_node in to_nodes:
                nodes.add(to_node)
                edges.append((from_node, to_node))
    return [nodes, edges]

while True:
    nodemap = {}
    [nodes, edges] = parse()
    while len(nodes) > 2:
        e = random.choice(edges)
        from_node = e[0]
        to_node = e[1]
        updated_edges = []
        for edge in edges:
            if edge[0] == from_node and edge[1] == to_node or \
               edge[1] == from_node and edge[0] == to_node:
                continue
            elif edge[0] == to_node:
                updated_edges.append((from_node, edge[1]))
            elif edge[1] == to_node:
                updated_edges.append((edge[0], from_node))
            else:
                updated_edges.append(edge)
        edges = updated_edges
        nodes.remove(to_node) 
        nodemap[from_node] = nodemap.get(from_node, 1) + nodemap.get(to_node, 1)
        nodemap.pop(to_node, None)
    
    if len(edges) == 3 and len(nodemap) == 2:
        items = list(nodemap.items())
        print(items[0][1] * items[1][1])
        break
```

{% endspoiler %}

That's it! See you again tomorrow!