teleren/devto huggingface dataset:
I open sourced Jasper.ai alternative
Published: 2023-03-17 10:52:56

Jasper raises $125M at a $1.5B valuation on October 2022, building an AI platform that helps you be more creative and grow your brand. 

On March 1st 2023, OpenAI has released its ChatGPT 3.5 API, that facilitates operations such text completion models and a very long training process in order to get great results. 

So I was thinking, "why not trying to build a Jasper alternative using ChatGPT?" 

So I started working on it, 4 days ago. I never thought I would actually build a working product, but worth trying..

I knew that since no training is needed, the hard part will be building a nice UI and later just talk to my brother 😉 ChatGPT nicely, and get the job done. 


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

4 days later - https://jema.ai is alive, and an open source!

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

I build a lot of web applications, writing dozens of components every week. ChatGPT IS changing the world

Check the full open source repo :

https://github.com/yuvalsuede/jasper-alternative-gpt

Please give me a star so I know I did something good 🙌🏻

Love you all :)
Notes on Code Review
Tags: codereview
Published: 2023-03-17 10:51:43


---
title: Notes on Code Review 
published: true
description: 
tags: codereview
---

"Build thing right" is motivation for code reviews. Depending on context, each of following point can be extended to any review.
My base understanding about reviewing someone code comes (Programmer Competency Matrix)
[https://sijinjoseph.com/programmer-competency-matrix/], which serves 

Here is  checklist I noted down from 2 finest engineers.

* Size of Code Review
	- Is this Single Objective change?
	- Multiple Objective Change
		 + is it time consuming and simple enough to review >15 min?
	  + Else break it down
	  + check anti-pattern, clubbing multiple checking?
  
* Requested Functionality Check
	- Unit tests 
		+ are complete and correct ?
		+  Missing tests?
    -  Algorithm
		+ Time Complexity
		+ Space Complexity
	   + Contextual Appeal of Algorithm
	- Data Structure
	  + New Data Structure
		  - Data Layout  ?
		  - Interfaces are stable?
		  - Is there exposed state?
	  + Existing Data structure
		  + Is Data Structure Abused in usage?
	  - Domain of Application
  - Find Assumptions hidden in place-sight?
  - Are there unhanded cases for assumptions?
  
* Coding Anti-Patterns
	
- Code Style Consistency
  - Style in Sync with existing style?
  - tool clang-format
  
- Language features
  + Are there any Language Features abused?
  + Can there be scope for using language features?  
  
- Memory Issue
  + Is there chance of memory corruption?
  + Are there any data races?
  + tool val-grind

- Performance Issue
  + Deterioration due to integration of Algorithmic Functionality	
  + Performance Test
- Concurrency Issue
  + Multi-threaded
  + Distributed
  
- Contextual Appeal for Integration
  + Environment variable vs command line options
  
* Risk of Code Change
	- Change affects area that is only requested , Guarded by Option with Default
	- is there a disaster scenario ?
	- are there deployment issues?

* Architectural Change
  + Is there library dependency ? is it explicitly mentioned or implicit?
  + Is Architectural change adding value over time/ maintainance?
   
* Review of  "Language" (C++ in this Context)
  + Check Data types used, CV qualifiers, storage specifiers
  + Overflow and underflow conditions?
  + New Class
    - Checklist of Default constructors, operators
    - check behaviors are mocked with coverage
  +  and follow up on guideline based on use cases.
  
Although this is checklist learnt from experienced programmer and awesome engineer known to me,
It may be possible to think of general framework after deep thought, which any rookie can use.
 
HTH!
VS Code Extensions to improve your productivity
Tags: webdev, programming, productivity
Published: 2023-03-17 10:44:19

1. Auto Rename Tag
Auto rename paired HTML/XML tag.

2. Live Server
Launch a development local Server with a live reload feature for static & dynamic pages.

3. Visual Studio IntelliCode
AI-assisted development.

4. Project Manager
Easily switch between projects.

5. Prettier - Code Formatter
Code formatter using prettier.
Secure Instant Messaging
Tags: secure, messaging, rsa, encryption
Published: 2023-03-17 10:40:03

All data within these conversations is encrypted, sent over a secure channel, and managed by RSA asymmetric key encryption. Discover secure & encrypted IP messaging. Create secure communication with no server while messaging.
Secure Instant Messaging has following features:
- Secure IP messaging with private\public keys
- RSA decryption/encryption
- Generate key pair and save keys as files

![Secure Instant Messaging](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5h9euqzh6ykv7iiqxtyh.png)

![Secure Instant Messaging](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sb8orxls3vqhcv5846mr.png)

![Secure Instant Messaging](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/se0p2dcaz3q12zisoqfx.png)

[Get](https://www.microsoft.com/store/apps/9pff4mx38j1z)
How to work on a notebook while traveling
Published: 2023-03-17 10:17:06

Traveling with a laptop can be a great way to stay productive on the go. Whether you're a digital nomad, a business traveler, or just someone who wants to stay connected on the go, having a laptop can make your journey a lot easier. But how do you work on a laptop while traveling?

The first step is to make sure you have the right hardware. You will need a light and portable laptop, as well as a reliable power source. Investing in a good laptop bag is also a good idea, as it will help protect your device from bumps and scratches.

Once you have the right hardware, you will need to make sure you have a reliable internet connection. If you are staying at a hotel, you can access their Wi-Fi network. If not, you can purchase a mobile hotspot or USB tethering to access the Internet.

When you're on the road, it's important to stay organized. Get a good laptop stand or lap desk so you can work comfortably. If you work in a public place, consider using a privacy screen to keep your work private.

It's also important to stay safe while working on the go. Make sure you have a good antivirus program installed on your laptop and use a VPN to protect your data when you're connected to public Wi-Fi networks.

Finally, make sure you take regular breaks. Working on a laptop can be tiring, so be sure to take the time to stretch your legs and get some fresh air. This will help you stay productive and focused while you're on the go.

Working on your laptop while traveling can be a great way to stay productive and connected. With the right equipment and a few simple tips, you can make the most of your travel and get your work done on the go.
Life with Coding!!!
Tags: wecoded
Published: 2023-03-17 10:05:19

At my Advance Level Learnings always I needed to be a Accountant or Manager. But my results on Advanced Level Exams makes me enter to do IT related degree. Currently I am an third year Undergraduate of State University.

At the initial level I did not have that much idea about what is going on here ,because I am very new to this field. In my first year I did not know about any technology or IT Related companies. Therefore I joined with some industry oriented projects and got to know about IT Industry and Positions.

In the last year I have participated for many hackathons with assist of my university mates. After participating for that I was enthusiastic for participate for many more hackathons and earn new swags also. Therefore I looked for hackathons time to time and participated for hackathons and designathon also with my team members. It was a great pleasure to have group of friends who are interested in IT Facts. And we were able to compete up to semi final round and final round.


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



In the last year I was able to start my internship in a company which in IT industry. It was very new experience for me, cause i have never worked in industry before. They make me more aware about technical aspects and I try my best to develop my knowledge using that chance and assets.
How not to start a software project
Tags: webdev, programming, beginners, productivity
Published: 2023-03-17 09:50:01

A mistake I made a lot during my university years: Starting a project without a plan, continuing it, then quitting and starting another project after a while because I couldn't cope.

I explained the detail of the flow I made in the image step-by-step below, I hope it will be useful ⚡️


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

### Finding Ideas
- You should do a brainstorming for this. It may also be useful for you to visit sites such as Producthunt and betalist and examine what the world is doing.


### Planning
- The most important stage. Here you need to do a detailed planning. Which technology will be used, how much time will be allocated, what will be the size of the project, budget allocated etc etc. When this stage is over, you can clearly understand whether you will continue the project or not.


### Start Project
- Don't believe too much in the saying "starting a project is half the finish" and believing that the main thing is to start. The main thing is to keep the project going.


### Development
- If you have done the planning properly, you will now only have the workload of coding. You will apply the roadmap you drew during the planning phase step by step.


### Publish
- Congratulations, your project is complete. You can now go to Production and share this project in places such as Product Hunt, Twitter, LinkedIn, Instagram ... and watch the incoming interactions.
Real-time Graph Processing with "Apache Age"
Tags: apache, apaceage, postgres, sql
Published: 2023-03-17 09:48:48


Real-time graph processing is a powerful technique that allows businesses to analyze data in real-time. Apache Age which is a graph database management system built on top of PostgreSQL, can be used with Apache Kafka to implement real-time graph processing applications. Applications of graph processing is in social networks and fraud detection systems.

In this blog post, we will discuss how to use real-time graph processing pipeline using Apache Age and Apache Kafka.


## 1. Setting up Apache Kafka: 
Apache Kafka is a distributed streaming platform that allows you to publish and subscribe to streams of records in real-time. You can install "Apache Kafka" by clicking [here](https://kafka.apache.org/quickstart).

## 2. Defining Schema: 
Before starting, you will need to define the schema for your graph. This will include defining the vertices and edges in your graph, as well as any associated properties or metadata.

## 3. Insert Data into Kafka: 
Once Kafka cluster is up and running, you can start inserting your graph data into Kafka topics. Each topic should correspond to a specific type of graph data (i.e., vertices or edges).

## 4. Build an Apache Age Pipeline: 
Apache Age is a graph database built on top of Apache Arrow and PostgreSQL. You can use it to build a pipeline that processes your graph data in real-time. Your pipeline should consist of one or more Age queries that perform graph transformations or analytics.

## 5. Connect Age to Kafka:
You can use the Kafka Connect framework to connect Apache Age to your Kafka cluster. This allows you to consume graph data in real-time from Kafka topics and write it to Age tables.

## 6. Process Graph Data in Real-time:
With Apache Age and Kafka connected, you can start processing your graph data in real-time. Any changes to the graph will be immediately reflected in Age, and you can use Age queries to perform real-time graph analytics.



##Conclusion:
Overall, real-time graph processing with Apache Age and Apache Kafka requires a solid understanding of both tools, as well as the graph data you're working with. But with the right setup and configuration, you can build a powerful real-time graph processing pipeline that can be used for a variety of applications.
Sidecar pattern use cases
Tags: cloud, kubernetes, patterns
Published: 2023-03-17 09:30:00

## Sidecar pattern use cases

Essence of pattern is that you have **main** container and **sidecar** container. They run on the same Pod, so they share networking and storage resources. Let’s discuss in what cases it can be useful. 

### Proxy server

Sidecar pattern behave like proxy for main container. It does not perform any business logic. For example, you can add HTTPS to your old service without changing service itself.

![sidecar container as proxy server](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k21irj9mvwd0hoybti8n.png)

### Dynamic configuration

Sidecar container acts like API for changing configuration. Service, in turn, should have some mechanism to fetch changes. 

![sidecar container as configuration manager](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/huflhybcvycz9qz2p3hu.png)

### Reusable functionality

Sometimes it is useful to extract some common (more likely technical) service logic into separate container. You can implement, for example, resource monitoring service once and use it for all services, regardless technologies they based on.

![sidecar container as monitoring service](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bba0glz0gbckteezpl8c.png)

### Extending service API

You can implement new API in separate service and deploy it as sidecar. It is useful if:

- you have not access to application sources
- application based on legacy technologies
- application sources are too legacy to try change it


![sidecar container extends application API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/y7eyisxjvu34w8ow3881.png)

## Summary

Basically, Sidecar pattern is useful when you can’t modify container, but want to implement some new functionality or want to implement some reusable technology-agnostic functionality.
Increment operator
Published: 2023-03-17 09:29:19

C++ dasturda matematik va mantiqiy bayonotlar va ifodalarni hisoblash uchun har xil turdagi Operatorlarni taqdim etadi. O'sish operatori va kamaytirish operatori C++ tilidagi birlik operatorlarning bir turi bo'lib, ular mos ravishda operandga 1 qiymatini qo'shish yoki ayirish uchun ishlatiladi. Ushbu maqola ushbu 2 Unary operatorlarining chuqur kontseptsiyasiga qaratilgan va tushuntirishga harakat qiladi.

**Definition**

`O'sish operatori operand qiymatini 1 ga oshirish uchun ishlatiladi, pasaytirish operatori esa operand qiymatini 1 ga kamaytirish uchun ishlatiladi.`

C++ da o'zgaruvchining qiymati Increment operatori va Decrement operatori yordamida 1 ga oshiriladi yoki kamayadi.

O'stirish va kamaytirish operatorlari faqat butun sonli o'zgaruvchilar va sonli qiymatlarga ega operandlar bilan qo'llaniladi. Ularni Belgi yoki satr qiymatlarini o'z ichiga olgan o'zgaruvchi bilan ishlatib bo'lmaydi.


O'stirish operatori va kamaytirish operatori operandning Prefiks va Postfiks pozitsiyasida ishlatilishi mumkin. O'stirish/kamaytirish operatori tomonidan dastur bayonotida foydalaniladigan Lavozim operator qanday ishlashini hal qiladi.

Postfix operatori pozitsiyasi Prefiks operatori pozitsiyasidan yuqoriroq ustunlik darajasiga ega. Postfiks operatorlari chapdan o'ngga assotsiativlikdan baholanadi va prefiks operatorlari o'ngdan chapga assotsiativlikdan baholanadi.



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



`O'sish operatori **++** bu operator bitta qiymat qo'shib beradi`

**rule**

`Prefiks va Postfix Increment operatorlari pozitsiyalari bir xil funktsional qiymatlarga ega va agar ular hech qanday ifoda formatida ishlatilmasa, bir xil natijalarni beradi.`


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

int main()
{

int x = 20, y = 40;

++x;
y++;

cout << x << endl << y;

return 0;
}
```


**The result**

```
21
41
```

**rule**

`Prefiks va Postfiks pozitsiyalari, agar ular ifodada ishlatilsa, turli xil hisoblash natijalarini beradi

Agar o'sish operatorlari Prefiks pozitsiyasida ishlatilsa, u holda O'sish funktsiyasi ifodadan oldin bajariladi.

Agar o'sish operatorlari Postfix pozitsiyasida ishlatilayotgan bo'lsa, unda O'sish funktsiyasi ifodani baholashdan keyin amalga oshiriladi.`

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

int main()
{

int x =  10;

int a;

x = ++x;

cout <<"qiymati x = "<< x << endl;

a = x++;

cout << "qiymati a = "<< a << endl;

cout << "yangi qiymati x = "<< x << endl;

return 0;

}
```

**The result**

```
x = 11;
a = 11;
x = 12;
```


**Tushuntirish**

`Birinchi "cout" iboramizda Pre-Increment operatori ishlatiladi. Shunday qilib, "x" qiymati 1 ga oshiriladi, ya'ni x = x + 1 = 10 + 1 = 11`

`Keyin ‘a = x++’ ifodasidagi ‘a’ o‘zgaruvchisiga qiymat beramiz.`

`Bu shuni anglatadiki, avval "x" qiymati "a" ga tayinlanadi, keyin esa "x" 1 ga oshiriladi. Demak, a = 11 chiqdi, x = 12 ning yangi qiymati`
Given, When, & Then - Adult version vs Child version
Tags: beginners, tutorial
Published: 2023-03-11 04:22:40

Here's the adult version:

"Given/When/Then" is a format used in software development and testing to write test cases in a structured way.

In this format:

Given: describes the preconditions or the initial state of the system being tested. It sets up the context of the test case.

When: describes the action or the event that is being tested. It represents the behavior being tested.

Then: describes the expected outcome or result of the test case. It represents the verification step.

By using the Given/When/Then format, it helps to make test cases more structured, clear, and easier to understand. This format helps to ensure that all necessary aspects of the test case are covered and helps to prevent missing out any important scenarios that may cause issues in the software.

In addition to software development, this format can also be used in other contexts, such as in business requirements or user stories, to help define and clarify the expected behavior of a system.

Here's the child version: 

"Given/When/Then" is a way to make sure we test something very carefully.

Given: means we start with a certain situation, like setting up a toy.

When: means we do something to the toy, like push a button.

Then: means we check what happens next, like the toy lights up or makes a sound.

This helps us make sure we tested everything we need to, and we didn't forget anything. It's like following a recipe to make sure we don't miss any ingredients!

I hope that helps you when you're thinking about what to write for the issues.
Code Coverage with React, Vite, RTL & Cypress
Tags: typescript, cypress, codequality
Published: 2023-03-17 09:22:18

My newest post involves one of our recent projects to move our react microfrontend to use Vite. I will summarise in this post how we managed to collect code coverage statistics from RTL and Cypress tools to have a combined coverage level for our development process. But before jumping to technical details let's review the background story.

Initially using Webpack and decided to move to Vite for reasons that you may already know like:

- It aims to provide a **faster** and more **efficient** development experience for developers by using the native ES modules feature in the browser
- Ability to handle **large** JavaScript projects with ease
- **Excellent** documentation

The above are just some few key features of Vite that makes it stand out from other solutions.

**We already know what is Cypress?**

With Cypress, you can easily create tests for your modern web applications, debug them visually, and automatically run them in your continuous integration builds. It can easily be integrated in your react projects and run both component and integration tests at ease as part of your development pipeline.

**But what about your component tests?**

If the team is more flexible you can use Cypress even to test your react components but most of the teams are more aware of RTL(react testing library) so in our projects as well we stick to use this to drive our component tests. 

**And what about code coverage?**

When it comes to code coverage we picked Instanbul.
Istanbul instruments your ES5 and ES2015+ JavaScript code with line counters, so that you can track how well your unit-tests exercise your codebase. The nyc command-line-client for Istanbul works well with most JavaScript testing frameworks: tap, mocha, AVA, etc.

Now that we had some few introductions lets deep dive into the setup needed to start measuring code coverage on your react project. 

First install the needed tool to instrument your react app as Vite plugin `yarn add vite-plugin-istanbul -D`. 

After we installed the package we need to change the **vite.config.ts** file accordingly

{% embed https://gist.github.com/Gpap84/57c8774a3c0c246cc2df746932453ec3.js %}

From the configuration above you will see that we used instanbul for both cypress e2e & rtl tests. 

But we will not see all the files because Istanbul by default uses coverage only for those files for which there are tests, in order to configure Istanbul reports more flexibly, add the following package:

`yarn add @istanbuljs/nyc-config-typescript -D`

Now create the .nycrc.json to store settings for cypress tests.

{% embed https://gist.github.com/Gpap84/bbf9e870872119b5dd5446d1a6aa2d27.js %}

Ok great we can now generate reports for each tests (RTL & Cypress) but it would be extremely useful to merge both under one single report.

{% embed https://gist.github.com/Gpap84/19c7d7a528c95aca63d9acfeaf709f26.js %}

**Conclusion**
That’s all, thanks for reading, in this article we figured out how to add code coverage support to our application using React and Vite for both unit and e2e tests.
openGauss Typical Application Scenarios and Configurations
Tags: opengauss
Published: 2023-03-17 09:15:52

Log Diagnosis Scenario
ODBC logs are classified into unixODBC driver manager logs and psqlODBC driver logs. The former is used to trace whether the application API is successfully executed, and the latter is used to locate problems based on DFX logs generated during underlying implementation.

The unixODBC log needs to be configured in the odbcinst.ini file:

""
[ODBC]
Trace=Yes
TraceFile=/path/to/odbctrace.log

[GaussMPP]
Driver64=/usr/local/lib/psqlodbcw.so
setup=/usr/local/lib/psqlodbcw.so
You only need to add the following information to the odbc.ini file:

""
[gaussdb]
Driver=GaussMPP
Servername=10.10.0.13 (database server IP address)
...
Debug=1 (Enable the debug log function of the driver.)
 NOTE: The unixODBC logs are generated in the path configured by TraceFile. The psqlODBC generates the mylog_xxx.log file in the /tmp/ directory.

High Performance
If a large amount of data needs to be inserted, you are advised to perform the following operations:

You need to set UseBatchProtocol to 1 in the odbc.ini file and support_batch_bind to on in the database.
The ODBC program binding type must be the same as that in the database.
The character set of the client is the same as that of the database.
The transaction is committed manually.
odbc.ini configuration file:

""
[gaussdb]
Driver=GaussMPP
Servername=10.10.0.13 (database server IP address)
...
UseBatchProtocol=1 (enabled by default)
ConnSettings=set client_encoding=UTF8 (Set the character code on the client to be the same as that on the server.)