teleren/devto huggingface dataset:
I created Pycowin: An app which alerts you when vaccine slots are available in your area
Tags: python, linux, opensource, api
Published: 2021-08-31 16:04:46

Indian Government is providing free vaccines to all of its citizens. India is very densely populated and its very hard to vaccinate everyone at once. Therefore, Indian government created Cowin portal through which you can book a slot for your vaccination. But due to the high demand its very tough to book a slot because the slots are updated throughout the day and are booked within seconds. 

I too had to book a vaccination appointment for myself and had to check the website every now and then. I got tired of doing this, then I decided to create **Pycowin**.
_____________________________________________________________
# Pycowin

**Pycowin** searches for slots every ten minutes and alerts you whenever vaccination slots are available at the selected location. It sends a desktop notification as well as plays an audio track "Vaccines found" on successful searches.

The app is written using **Cowin** apis, **Python** and **Qt** libraries and is completely opensource. You can either download the binary executable or  just run it from source. The app is packaged for Linux and Windows with all of its dependencies included.

### Github : [Pycowin](https://github.com/drunckj/Pycowin)

## Screenshots
### Windows
![Windows](https://user-images.githubusercontent.com/50874358/131214892-7a4a0e49-dfd8-435a-8c7d-f0bd8044b728.png)
### Linux
![Linux](https://user-images.githubusercontent.com/50874358/131214934-8c88f087-cd19-4d8d-8523-02f0e0171825.png)
## Notifications
### Windows
![windows](https://user-images.githubusercontent.com/50874358/131215136-3fcd3ba7-3c19-4aa1-9377-895d6877b8bb.png)
### Linux
![Linux notification](https://user-images.githubusercontent.com/50874358/131215051-24888252-68ff-4ff8-9d29-2d7f13897363.png)
# Installation 
### Windows and Linux
Download the respective zip file from [releases](https://github.com/drunckj/Pycowin/releases/tag/pycowin_0.1).Extract and directly run from there.
#### Running from terminal
```
cd <extracted_folder_name>
./pycowin
```
## Running from source
### Requirements
#### Windows
```
pip install pyqt5 requests win10toast playsound
```
#### Linux
### Requirements
spd-say : it is usually found in all distros by default. If not found install from your package manager
```
pip3 install requests PyQt5
```
## Running 
```
git clone https://github.com/drunckj/Pycowin.git
cd Pycowin/src/<windows or linux>
python3 pycowin.py
```

## Want to buy me a coffee : [Paypal](https://www.paypal.com/paypalme/drunkcj) || [Crypto(preferred)](https://drunckj.github.io/drunkcj-crypto-donation/)
Using ES Modules with Fastify
Tags: node, fastify, webdev, javascript
Published: 2021-08-31 16:04:06

---
title: Using ES Modules with Fastify
published: true
description: Using ES modules in Node framework Fastify
tags: Node, Fastify, webdev, JavaScript
//cover_image: https://direct_url_to_image.jpg
---

Documentation for Fastify, as well as for all official Fastify plugins, uses the older Node CommonJS module syntax. You can however, make use of ES modules.  

To use ES modules in Node, you can set `"type": "module"` in your package.json. Then, instead of `const fastify = require('fastify')({ logger: true })` you can do:
 
```javascript
import Fastify from 'fastify';
const fastify = Fastify({ logger: true });
```
The same is true for the official plugins:

```javascript
import fastifyFormbody from 'fastify-formbody';
fastify.register(fastifyFormbody);
```


## `__dirname` and `__filename`
One difference between CommonJS modules and ES modules is that `__filename`  and `__dirname` are [not available in ES modules](https://nodejs.org/api/esm.html#esm_no_filename_or_dirname). As the official Node docs suggest, they can be replicated with via [`import.meta.url`](https://nodejs.org/api/esm.html#esm_import_meta_url)

```javascript
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
    
import fastifyStatic from 'fastify-static';
    
fastify.register(fastifyStatic, {
    root: path.join(__dirname, 'public'),
    prefix: '/public/',
});
```
What is API ?
Tags: programming, api
Published: 2021-08-31 15:53:51

**Have you ever wondered how things work in a backend? Did you know how you are able to book tickets online?** 

I will give answers of all this questions in this blog with detailed explaination in an easy way. 

First let's understand **What is API?** 

API stands for Application Programming Interface which acts as interface between two applications (Client and server). Now, it seems so much technical let's understand it by simple real life example. 

Let's consider that we are sitting in a restaurant for dinner. So, first to order a food we see what's available on menu. Then we ask waiter that the item is available or not. If item is available waiter will take our order and ask chef which is present in a kitchen to prepare food for us. After preparing food chef will give our order to waiter and then waiter will give it back to us. So, this is how actually an API works. In terms of API, we can say that we as application or user which sends request, Waiter as API which takes our request and send it to chef and chef or kitchen as backend or server which takes action according to our request and send it back to api i.e. waiter. This is how actually things work in backend. 

Now, let's understand API with some technical example. Suppose we have to book an Air ticket from any third party websites like **goibibo, makemytrip, etc.** Lets consider Goibibo here. First we have to select date, time, and location from goibibo's website. Then they show us available flights with respect to airline. Support we have selected Air India then goibibo will send our request to Air India's API with proper authentication which Air India has provided to goibibo. After recieving request goibibo will take appropriate actions and then send it back to goibibo and then we can see the status of our booking that whether it is confirmed or not. 

I think now you understood how things work in backend with the help of API. 

If you are interested in building API's and have some amazing idea to solve real life problem then participate in HackThisFall 2.0 Global level Hackathon which helds from 22nd October to 24th October (48 Hours). The theme of this hackathon is innovate for good, so if you have any innovative idea then please bring it to HackThisFall 2.0. To participate in it kindly register at https://hackthisfall.devpost.com/ and don't forget to use my referral code HTFHE084. Already around 1k+ hackers are participated in this hackathon.
What does it take to build an unconventional REST API in Python?
Tags: django, webdev, python
Published: 2021-08-31 15:48:13

#What is this about?
This is my first article/post on https://dev.to. So I would appreciate all suggestions and tips relevant to my article . Now diving into the topic.

Let us say, you are assigned for a project and now you need to make an API along with a <u>Django backend</u>. It needs to be RESTful in nature and your goal is speed. What would an ideal solution be?<em>(Graphene and related integration pertinent to GraphQL can be done, I might do it in the future and when I do, I shall update the community with another post)</em> Most likely, everyone from your seniors to google would suggest Django-REST-Framework because it is more convenient and more widely used. 
But then why should you consider this option?

##Reasons why you must give it a chance:
 
   <li> Speed: </li>
I know Python and Django are usually criticized for their speeds but FastAPI promises us something different. As such it is flexible, fast and intuitive. It is easier to make an API if you know how to make REST-API methods in python. It is quite similar to writing methods in Flask. It might be a little bit of a stretch when you are starting out with the models because you might need to translate a few parameters using Pydantic. After this is set up, all API endpoints and all HTTP methods can be converted into functions in python seamlessly.

<u>It is a promising avenue where both rapid development and speed can be simultaneously achieved.</u>

   <li>Power of a Strong and Solid Back-end:</li>
With this project , One can quickly utilize the features provided by the Django Framework without any additional worries. Sessions, User-Authentication, ORM and all other salient features can be seamlessly integrated with the power of FastAPI resulting in the best of the two worlds. Apart from this, you get the Django-Admin Panel which grants access to essential/data of higher relevance and importance

<u>With little effort, One gets the best of the two worlds and a project which is truly reliable</u>

<li>Documentation:</li>
One can access the Documentation for the App they've developed through by going to <em> project-url/redoc</em> and see an Open API documentation for the methods they've defined. Clearly an additional perk which will be helpful to all the stakeholders on the longer run.


##Conclusion
This project was an amazing journey in my opinion and I believe it might be used in some future projects and I believe this exploration has satisfied my quest. Nevertheless one must keep experimenting like this and try bringing something new to the world.

To learn about the technical aspects of the project visit
<a href = "github.com/AbhijithGanesh/FastAPI-Django-Integration"> Click Here 
</a>
And to view the deployment (The UI is not optimized for Mobile Devices)
<a href = "https://fastapi-django.herokuapp.com/Application"> Click Here
</a>
How to setup CD for AWS Elastic Beanstalk using CodePipeline?
Published: 2021-08-31 15:45:31

## Introduction
So, Now you have your code running on AWS. It's secure and cheap, but you still have to upload your code in zip files. How archaic😱!! Let's fix this in this article using another awesome AWS Service called the CodePipeline. This is gonna be a short one guys.

> This article is a sequel to the previous one called  [How to setup a https server in elastic beanstalk](https://kavii.hashnode.dev/how-to setup-a-https-server-in-elastic-beanstalk-the-cheap-way). It's not required to read the previous one, but I would recommend doing so before reading this. 

## What is Code Pipeline?
It is an AWS Service that provides fully managed, continous devlivery that helps you automate the release pipelines for fast and reliable application and infrastructure.
You can automate various phases like 
- Build
- Test
- Deploy
and this automation will run every time there is a code change.

It supports various source code sources, we'll be using github but there is very little difference in how to use any other service if you need to.

## How to Setup CD
Go to code pipeline option in your console and press "Create New Pipeline". 

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l5xr2o1ndjr2bp5cbjsr.png) 

Enter the name and leave everything as default. Click "Next"

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjmtel12omp65lidki6e.png)
 

In the source stage, select the provider and fill in the details. We'll be using Github (Version 2) here.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/30qd6tklfe9l0s1yz1hv.png)
 

If you require a build stage, configure this step. We'll be skipping this stage.


![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eia5on9qbs6zgbebwf1z.png)
 

In the deploy stage, select AWS Elastic Beanstalk and fill other details.
Click "Next" and review everything. 

## Conclusion

Once you submit, your pipeline will be active. Now, as soon as you push code to github, it'll reflect in your deployment very soon.

### Readme Badges
If you need github readme badges, refer to [this article] (https://medium.com/swlh/aws-ci-cd-dynamic-build-badge-display-on-github-1e9a3b76db5a) for how to set it up. You can also use  [this npm library](https://www.npmjs.com/package/cdk-pipeline-status)  for monitoring the status.
5th Anniversary of the Excelize Open Source 🎉
Tags: go, excel, xlsx
Published: 2021-08-31 15:44:38

---
title: 5th Anniversary of the Excelize Open Source 🎉
published: true
description: Excelize is a library written in pure Go and providing a set of functions that allow you to write to and read from XLSX files. 
tags: Go,Excel,Golang,XLSX
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iyxd7d8irxj29ie5fjym.png
---

Excelize ([github.com/xuri/excelize](https://github.com/xuri/excelize)) since 2016 has become the popular choice to process spreadsheets documents among cloud-native and especially among Go language developers. Deep in essence and known for their professional support and well capabilities, Excelize is being widely used by large Internet companies, SME customers, and startup companies. Now, for the 5th anniversary of the Excelize open source, it has been released 16 versions, more than 100 contributors have participated in code contributing. I would like to thank all those who support the development and contributions of the project, and I'm very happy to be able to help anyone in need it. For me personally, creating and maintaining an open-source project requires not only the ability to write code, write documentation, and community management, the more important thing is how to keep the enthusiasm, happy, energetic, and efficient output state.

> Excelize Star History

<img class="aligncenter size-full wp-image-3327" src="https://xuri.me/wp-content/uploads/2021/08/excelize_5th_stargazers.png" alt="Excelize Star History on 5th Anniversary" />

> Excelize Contributors

<img class="aligncenter size-full wp-image-3326" src="https://xuri.me/wp-content/uploads/2021/08/excelize_5th_contributors.png" alt="Excelize Contributors on 5th Anniversary" />


In the future, I'll continue to work with developers in the community to optimize functions, capabilities, and performance, including to:
<ul>
    <li>Make more API support concurrency safety</li>
    <li>Keep to optimization performance for generating or reading data from a worksheet with huge amounts of data</li>
    <li>More formula functions support in the calculation engine</li>
    <li>Complex conditional format settings, data prediction support, etc.</li>
    <li>Support more Chart style settings</li>
    <li>PivotTable, PivotChart, Slicer</li>
    <li>Number format parsing</li>
    <li>Workbook encryption</li>
    <li>More API will be support in the streaming reading and writing mode</li>
</ul>

At last, welcome to contribute to Excelize.
Conections, conections and conections
Published: 2021-08-31 15:22:59

Without a doubt, one of the coolest moments of the entire development process is the time to join the front in the back, because that's what I'm going to do today.
I wanted to use the axios, as I'm used to it, but the whole project is using fetch so I think I'll stick to this pattern.

I usually start this process by registering the routes in insomnia to test and to make future queries and things like that. As the project was built with Redux (😑) I step the construction of reducers and actions.
With these things ready what I do next is to check if the answers coming from the API are correct and as expected, like see if everything went well if it's not coming undefined and bla bla bla.

From there, I make the necessary modifications on the front so that it receives the information from the API and as I'm dealing with many components that need to be dynamic, I make the modifications for this

After that, just go up and wait for the PR's approval!🚀🔥

Well I think that was the content of today, anything I'm around here just call.
I hope it helped you in some way.
Remember that no matter what you do if you do it with love you are already legendary!
How to read and write a pom in Jenkins ?
Published: 2021-08-31 15:20:03

When I started to work with Jenkins with Java apps, I quickly have these questions
> **How to be able to read a pom?**
> **How to update it?**
> **Am I able to update the pom version from Jenkins??**

So today, we will see how to do it!

## Read
```groovy
pom = readMavenPom(file: 'pom.xml')

def pom_version = pom.version
```

The reading part looks like all the other **read** functions in Jenkins *(like readYaml, readJSON...)*

### Links
- Jenkins documentation : https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#readmavenpom-read-a-maven-project-file

---

## Write
```groovy
def pom = readMavenPom file: 'pom.xml'
 
//Do some manipulation
pom.version = "x.x.x"
... 

writeMavenPom model: pom
```

The write part is really simple and you just have to give back the **pom** object you retrieve from reading;

### Links
- Jenkins documentation : https://www.jenkins.io/doc/pipeline/steps/pipeline-utility-steps/#writemavenpom-write-a-maven-project-file

---

## Bonus - Update pom version
Once we know that, we can automatically change the version in the pom!

```groovy
def pom = readMavenPom file: 'pom.xml'
 
pom_version_array = pom.version.split('\\.')

// You can choose any part of the version you want to update
pom_version_array[1] = "${pom_version_array[1]}".toInteger() + 1

pom.version = pom_version_array.join('.')

writeMavenPom model: pom

```

---

I hope it will help you!
Why use mobx - Flutter
Published: 2021-08-31 00:35:07

### This article is intended to explain and list some reasons for you to use mobx. I apologize if during the explanation I get a little confused, this is my first article.

   But come on. After all, what is Mobx? Before listing the reasons for using it, it's good to understand its concept. Mobx is a package to manage Flutter application states in a very simple way. Unlike other packages, using mobx you don't need to write several lines of code.

   With basically three words you can make the app reactive. It uses the concepts of @observable (which is placed on top of the variable, every time it changes it will notify you), @action (the function that will change an observable) and we have @reactions which are what to be do(side effects) when an observable to modified.

![Observable, Action and Reaction Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lb0we835u3ujrh1e3hcx.png)

   With these three words we were able to assemble a reactive app and eliminate those various setStates of your app that, with the growth of your app, can cause some bottlenecks.

Now, let's go to the reasons to use mobx as your state management (although only the explanation above is justified).

* Easy to implement, as explained above, mobx uses a code manager behind the scenes making the developer's job much easier, besides improving the readability of your code.

* Package constantly updated by the community and with a lot of content on the internet.
* Efficient in 90% of cases. Like every package, Mobx also has its limitations, but its use is sufficient in most cases and for you who are developing a small/medium-term application it will be very efficient.

### We've come to the end, I know there are several other reasons, but as this is the first article I preferred to write just these. I apologize again if I got confused at some point. I am open to constructive criticism and suggestions.
Perform tests on a route calling another

Published: 2021-08-31 15:12:34

As I know performing a functional test is done with an app context. This-for I am using this modular fixture:

@pytest.fixture(scope='module')
def test_client():
    flask_app =  create_app("ENV_FILE_LOCATION")    
    # Create a test client using the Flask application configured for testing
    with flask_app.test_client() as testing_client:
        # Establish an application context
        with flask_app.app_context():
            yield testing_client  # this is where the testing happens! 


And I am after calling the test_client to do tests on each route, for example:

c = app.test_client()
response = c.get('/test/url')
# test response



When performing the tests on some routes the process works well. However, I have a one that is calling another route I get this error

requests.exceptions.ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=5500): Max retries exceeded with url: /test/nested_route_call (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f56f3c30580>: Failed to establish a new connection: [Errno 111] Connection refused'))

It is logical since the app is not running and the call is performed to the closed app. When doing the tests while the app is running, all things goes rightly. However as I must incorporate my tests in a pre-build process, it must be closed, so is there any solution to fix the issue.
PK compuesta con Micronaut-R2DBC
Tags: micronaut, r2dbc, postgres, java
Published: 2021-08-31 14:56:33

Con Micronaut-Data, tenemos **ComposeId** _out-of-the-box_. El manejo es muy similar que JPA. 

La tabla de ejemplo contiene una llave primaria formada por dos campos.
```sql
CREATE TABLE "author_detail_entity" (
"author_id" BIGINT NOT NULL,
"book_id" BIGINT NOT NULL, 
PRIMARY KEY("author_id","book_id"));
```
Debemos usar las anotaciones provistas para tal fin: **EmbeddedId**, **Embeddable**.
```java
import io.micronaut.data.annotation.*;

@MappedEntity
public class AuthorDetailEntity {
    @EmbeddedId
    private AuthorDetailId authorDetailId;

    public AuthorDetailEntity(AuthorDetailId authorDetailId) {
        this.authorDetailId = authorDetailId;
    }

    public AuthorDetailId getAuthorDetailId() {
        return authorDetailId;
    }
}

@Embeddable
class AuthorDetailId {
    @MappedProperty("author_id")
    private final Long authorId;
    @MappedProperty("book_id")
    private final Long bookId;

    public AuthorDetailId(Long authorId, Long bookId) {
        this.authorId = authorId;
        this.bookId = bookId;
    }

    public Long getAuthorId() {
        return authorId;
    }

    public Long getBookId() {
        return bookId;
    }
}
```
Extendemos la interface para obtener un CRUD reactivo.
```java
@R2dbcRepository(dialect = Dialect.POSTGRES)
public interface AuthorDetailRepository 
        extends ReactiveStreamsCrudRepository<AuthorDetailEntity, AuthorDetailId> {
}
```
Algunos métodos provistos son _find*_, _delete*_, etc.
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p8rges4p28s8aghqimtg.png)
![alt text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/95z8td0731pfjsafg85h.png)
 
---
#Documentación
https://micronaut-projects.github.io/micronaut-data/lates/guide/#sqlCompositeId
https://gitlab.com/edgar.gs/mn-r2dbc.git
Have You Considered These Costs When Starting Your Own Company?
Tags: beginners, startup
Published: 2021-08-31 14:16:07

Starting a new business is both thrilling and costly. Calculating the beginning costs, wondering about whether it will be successful in the long run, and putting together the cash to launch may be quite stressful. Some firms, such as micro-businesses and those that run out of one's house, have a reduced financial entry barrier, but others might cost upwards of $300,000 to get started.

We'll take a look at a few of the costs to consider while starting a new business.

Creating a detailed business plan is the best way to estimate your company's launch expenses. Your strategy should include financial projections for the next three to five years, including sales, profit, and costs.
Load an image from assets folder inside src in React
Published: 2021-08-31 14:13:47

Hello friends ! I  recently started to learning React and now i am building a project of my own! I am trying to save users uploading images inside an assets folder on src folder! I can do that! The problem is how to reference the images inside this folder on my Component on an img tag! i tried src="../../_assets/post_images/myimage.png" where this path is where my images are stored , but when i am viewing the Component on broswer , the image dont loaded!! Any idea how to load the image inside no public folder? Ty in advance!