teleren/devto huggingface dataset:
Thanks ChatGPT!
Tags: chatgpt, archlinux, productivity
Published: 2023-04-13 03:05:27

Thanks for providing mind-blowing alternate endings to some of my favorite movies!

Thanks for providing me Haskell (a cryptic language which I know nothing of) code to configure my Xmonad Window Manager to my liking!

Thanks for saving my time on all the little daily annoyances which I always wanted to fix "later"! (Fixing non-english fonts, Arch Linux incorrect system time, systemd units and more)

Thanks for allowing me to tell you that your response was not helpful and thereby chaining a discussion which made me understand what I really wanted!

Thanks for giving my brain a break from all the thinking required to connect the information dots which some call "imagination" and "creativity" (also "gut feeling" and what not)!

Thanks for adding some excitement to a slightly bored developer every single day!
946. Leetcode Solution in cpp
Tags: cpp
Published: 2023-04-13 03:04:28

```cpp
class Solution {
 public:
  bool validateStackSequences(vector<int>& pushed, vector<int>& popped) {
    stack<int> stack;
    int i = 0;  // popped's index

    for (const int x : pushed) {
      stack.push(x);
      while (!stack.empty() && stack.top() == popped[i]) {
        stack.pop();
        ++i;
      }
    }

    return stack.empty();
  }
};

```
#leetcode
#challenge
Here is the link for the problem:
https://leetcode.com/problems/validate-stack-sequences/
Integrate GPT-X with Google Search by using Langchain
Tags: langchain, ai, gpt3, gpt4
Published: 2023-04-13 02:56:59

GPT-3/GPT-4 are fantastic technologies but as of now, they come with a few limitations. One of these limitations is that the large language model that this technology is based, only has knowledge up to a certain date. That's where Langchain comes in. Langchain provides tools to increase GPT-X's capabilities. And one of those capabilities is allowing GPT-X to perform Google searches in order to retrieve up-to-date information. Check out [this simple example that can get you up and running in no time!](https://colab.research.google.com/drive/1XgsoFXyL01cEEGozeNJww_WZUIIs5zV6#scrollTo=iu_--FLXbCQM)
Using MOT Overview
Tags: opengauss
Published: 2023-04-13 02:54:21

MOT is automatically deployed as part of openGauss. You may refer to the MOT Preparation section for a description of how to estimate and plan required memory and storage resources in order to sustain your workload. The MOT Deployment section describes all the configuration settings in MOT, as well as non-mandatory options for server optimization.

Using MOT tables is quite simple. The syntax of all MOT commands is the same as for disk-based tables and includes support for most of standard PostgreSQL SQL, DDL and DML commands and features, such as Stored Procedures. Only the create and drop table statements in MOT differ from the statements for disk-based tables in openGauss. You may refer to the MOT Usage section for a description of these two simple commands, to learn how to convert a disk-based table into an MOT table, to get higher performance using Query Native Compilation and PREPARE statements and for a description of external tool support and the limitations of the MOT engine.

The MOT Administration section describes how to perform database maintenance, monitoring and analysis of logs and reported errors. Lastly, the MOT Sample TPC-C Benchmark section describes how to perform a standard TPC-C benchmark.

Read the following topics to learn how to use MOT –
MOT Performance Benchmarks
Tags: opengauss
Published: 2023-04-13 02:52:20

Our performance tests are based on the TPC-C Benchmark that is commonly used both by industry and academia.

Ours tests used BenchmarkSQL (see MOT Sample TPC-C Benchmark) and generates the workload using interactive SQL commands, as opposed to stored procedures.

 NOTE: Using the stored procedures approach may produce even higher performance results because it involves significantly less networking roundtrips and database envelope SQL processing cycles.

All tests that evaluated the performance of openGauss MOT vs DISK used synchronous logging and its optimized group-commit=on version in MOT.

Finally, we performed an additional test in order to evaluate MOT's ability to quickly and ingest massive quantities of data and to serve as an alternative to a mid-tier data ingestion solutions.

All tests were performed in June 2020.

The following shows various types of MOT performance benchmarks –

MOT Hardware

MOT Results – Summary

MOT High Throughput

MOT Low Latency

MOT RTO and Cold-Start Time

MOT Resource Utilization

MOT Data Ingestion Speed

Previous
Certified Kubernetes Administrator (CKA) - Practice Question with Complete Details Lab
Tags: cka, kubernetes, certification, devops
Published: 2023-04-13 02:46:45

If you're looking to become a certified Kubernetes administrator, then our CKA course is an absolute must-watch! Kubernetes has become the de facto standard for container orchestration, and a CKA certification is a valuable asset to have on your resume. 

Our course is designed to give you the knowledge and skills you need to pass the CKA exam with flying colors.

In this course, you will learn to answer, how to deploy and manage Kubernetes clusters, configure networking, and use Kubernetes APIs to automate tasks. 

You'll gain hands-on experience with important concepts like containerization, pod deployment, and service management. 

As an expert instructors, I will guide you through each step of the process, giving you the confidence you need to succeed on exam day.

Whether you're just starting out with Kubernetes or looking to take your skills to the next level, our CKA course on complete hands-on is the perfect choice. 

With comprehensive lab session, real-world examples, and interactive labs, this course is designed to help you master the skills you need to become a successful Kubernetes administrator. 

Sign up today and take your first step towards CKA certification!

This is 100% Lab Series with proper solution to each questions.

Remember that this course gives you more than 90% guarantee that, you will pass the Certified Kubernetes Administrator Exam. 

You need to understand, each and every question carefully and try to answer your own first, in case you feel difficulties in solving it.

A proper solution, provided to that problem in details in next video.

After achieving great success on [YouTube](https://www.youtube.com/@AlokKumar), I'm bringing this valuable course to a wider audience.
 
Don't miss out on this amazing opportunity - click on the link below to enroll now and take your career to the next level with the Certified Kubernetes Administrator - CKA certification.

Your satisfaction is my top priority, and your positive rating and feedback are incredibly valuable to me. 

Not only do they give me a boost of confidence, but they also help me improve my skills and better serve you in the future. 

So, please don't hesitate to leave a rating and share your thoughts - I am eager to hear what you have to say!


[My Udemy Course Link](https://www.udemy.com/course/certified-kubernetes-administrator-cka-lab-course/?couponCode=CKA-NOV-2)
Creating and Managing Sequences
Tags: opengauss
Published: 2023-04-13 02:45:22

Background
A sequence is a database object that generates unique integers. Sequence numbers are generated according to a certain rule. Sequences are unique because they increase automatically. This is why they are often used as primary keys.

You can create a sequence for a column in either of the following methods:

Set the data type of a column to sequence integer. A sequence will be automatically created by the database for this column.
Run the CREATE SEQUENCE statement to create a sequence. Set the initial value of the nextval('sequence_name') function to the default value of a column.
Procedure
Method 1: Set the data type of a column to a sequence integer. For example:

""
CREATE TABLE T1
(
    id    serial,
    name  text
);
If the following information is displayed, the table has been created:

""
CREATE TABLE
Method 2: Create a sequence and set the initial value of the nextval('sequence_name') function to the default value of a column.

Create a sequence.

""
CREATE SEQUENCE seq1 cache 100;
If the following information is displayed, the sequence has been created:

""
CREATE SEQUENCE
Set the initial value of the nextval('sequence_name') function to the default value of a column.

""
CREATE TABLE T2 
( 
    id   int not null default nextval('seq1'),
    name text
);
If the following information is displayed, the default value has been specified:

""
CREATE TABLE
Associate the sequence with a column.

Associates a sequence with a specified column included in a table. In this way, the sequence will be deleted when you delete its associated column or the table where the column belongs to.

""
ALTER SEQUENCE seq1 OWNED BY T2.id;
If the following information is displayed, the column has been specified:

""
ALTER SEQUENCE
 NOTE:
The preceding methods are similar, except that the second method specifies cache for the sequence. A sequence having cache defined has inconsecutive values (such as 1, 4, and 5) and cannot maintain the order of its values. After the dependent column of a sequence has been specified, once the sequence is deleted, the sequence of the dependent will be deleted. A sequence shared by multiple columns is not forbidden in a database, but you are not advised to do that.
In the current version, you can specify the auto-increment column or set the default value of a column to nextval('seqname') when defining a table. You cannot add an auto-increment column or a column whose default value is nextval('seqname') to an existing table.
What is debugging? 🐞
Tags: programming, beginners, tutorial
Published: 2023-04-13 02:41:46

## Introduction 🐞

- Programming is a complex process, and because it is done by human beings, it often leads to errors.
- Programming errors are called ***bugs*** and the process of tracking them down and correcting them
is called ***debugging***.
- Use of the term bug to describe small engineering difficulties dates back to at
least 1889, when Thomas Edison had a bug with his phonograph.
- Three kinds of errors can occur in a program: [syntax errors](https://en.wikipedia.org/wiki/Syntax_error), [runtime errors](https://en.wikipedia.org/wiki/Runtime_(program_lifecycle_phase)), and [semantic errors](https://en.wikipedia.org/wiki/Logic_error)
- It is useful to distinguish between them in order to track them down more quickly.


### Syntax errors

- [Python](
https://youtu.be/2VRXU2H4q0c) can only execute a program if the program is syntactically correct; otherwise, the process fails and returns an error message.
- ***Syntax*** refers to the structure of a program and the rules about
that structure. 
- For example, in English, a sentence must begin with a capital letter and end with a period. this sentence contains a ***syntax error***. So does this one
- For most readers, a few syntax errors are not a significant problem, which is why we can read the poetry of E. E. Cummings without problems.
- [Python](
https://youtu.be/2VRXU2H4q0c) is not so forgiving If there is a single syntax
error anywhere in your program, [Python](
https://youtu.be/2VRXU2H4q0c) will display an error message and quit, and you will not
be able to run your program. 
- During the first few weeks of your programming career, you will
probably spend a lot of time tracking down syntax errors.
- As you gain experience, though, you will make fewer errors and find them faster.

### Runtime errors

- The second type of error is a runtime error, so called because the error does not appear until you run
the program.
- These errors are also called ***exceptions*** because they usually indicate that something
exceptional (and bad) has happened.

### Semantic errors

- The third type of error is the semantic error.
- If there is a semantic error in your program, it will
run successfully, in the sense that the computer will not generate any error messages, but it will not
do the right thing.
- It will do something else specifically, it will do what you told it to do.
- The problem is that the program you wrote is not the program you wanted to write.
- The meaning of the program (its semantics) is wrong. 
- Identifying semantic errors can be tricky because it requires
you to work backward by looking at the output of the program and trying to figure out what it is
doing.

### Connect with Me 😊

#### 🔗 Links

[![linkedin](https://img.shields.io/badge/linkedin-0A66C2?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/in/mahmoud-el-kariouny-822719149/)

[![twitter](https://img.shields.io/badge/twitter-1DA1F2?style=for-the-badge&logo=twitter&logoColor=white)](https://twitter.com/Mahmoud42275)
Creating and Managing Views
Tags: opengauss
Published: 2023-04-13 02:40:57

Background
If some columns in one or more tables in a database are frequently searched for, an administrator can define a view for these columns, and then users can directly access these columns in the view without entering search criteria.

A view is different from a base table. It is only a virtual object rather than a physical one. Only view definition is stored in the database and view data is not. The data is stored in a base table. If data in the base table changes, the data in the view changes accordingly. In this sense, a view is like a window through which users can know their interested data and data changes in the database. A view is triggered every time it is referenced.

Managing Views
Creating a view

Run the following command to create MyView:

""
postgres=# CREATE OR REPLACE VIEW MyView AS SELECT * FROM tpcds.web_returns WHERE trunc(wr_refunded_cash) > 10000;
CREATE VIEW
 NOTE:
The OR REPLACE parameter in this command is optional. It indicates that if the view exists, the new view will replace the existing view.

Querying a view

Run the following command to query MyView:

""
SELECT * FROM MyView;
Viewing details about a specified view

Run the following command to view details about the dba_users view:

""
postgres=# \d+ dba_users
                      View "PG_CATALOG.DBA_USERS"
  Column  |         Type          | Modifiers | Storage  | Description
----------+-----------------------+-----------+----------+-------------
 USERNAME | CHARACTER VARYING(64) |           | extended |
View definition:
 SELECT PG_AUTHID.ROLNAME::CHARACTER VARYING(64) AS USERNAME
   FROM PG_AUTHID;
Deleting a view

Run the following command to delete MyView:

""
postgres=# DROP VIEW MyView;
DROP VIEW
Deleting Data from a Table
Tags: opengauss
Published: 2023-04-13 02:35:54

Outdated data may need to be deleted when tables are used. Data can be deleted from tables only by row.

SQL statements can only access and delete an independent row by declaring conditions that match the row. If a table has a primary key, you can use it to specify a row. You can delete several rows that match the specified condition or delete all the rows from a table.

For example, to delete all the rows whose c_customer_sk column is 3869 from the table customer_t1, run the following command:

""
DELETE FROM customer_t1 WHERE c_customer_sk = 3869;
To delete all rows from the table, run either of the following commands:

""
DELETE FROM customer_t1;
""
or,
TRUNCATE TABLE customer_t1;
 NOTE:
If you need to delete an entire table, you are advised to use the TRUNCATE statement rather than DELETE.

To delete a table, run the following command:

""
DROP TABLE customer_t1;
N
Viewing Data
Tags: opengauss
Published: 2023-04-13 02:34:47

Viewing Data
Run the following command to query information about all tables in a database in the system catalog pg_tables:

""
SELECT * FROM pg_tables;
Run the \d+ command of the gsql tool to query table attributes:

""
\d+ customer_t1;
Run the following command to query the data volume of table customer_t1:

""
SELECT count(*) FROM customer_t1;
Run the following command to query all data in the table customer_t1:

""
SELECT * FROM customer_t1;
Run the following command to query only the data in the column c_customer_sk:

""
SELECT c_customer_sk FROM customer_t1;
Run the following command to filter repeated data in the column c_customer_sk:

""
SELECT DISTINCT( c_customer_sk ) FROM customer_t1;
Run the following command to query all data whose column c_customer_sk is 3869:

""
SELECT * FROM customer_t1 WHERE c_customer_sk = 3869;
Run the following command to collate data based on the column c_customer_sk:

""
SELECT * FROM customer_t1 ORDER BY c_customer_sk;
Previous
Creating Tables
Tags: opengauss
Published: 2023-04-13 02:31:32

Background
A table is created in a database and can be saved in different databases. Tables under different schemas in a database can have the same name. Before creating a table, refer to Planning a Storage Model.

Procedure
Run the following statement to create a table:


```
CREATE TABLE customer_t1
(
    c_customer_sk             integer,
    c_customer_id             char(5),
    c_first_name              char(6),
    c_last_name               char(8)
);
```
If the following information is displayed, the table has been created:

 

```
CREATE TABLE
```
c_customer_sk, c_customer_id, c_first_name, and c_last_name are the column names of the table. integer, char(5), char(6), and char(8) are column name types.
Fixing the "SetThreadContext failed" Assertion Failure in Delphi 2007 on Modern Windows Machines, Including Windows 11
Tags: delphi, delphi2007, windows11
Published: 2023-04-13 02:31:22

So the content of this article is readily available on other forums and places like Stack Overflow, but they all talk about this error in the context of much earlier versions of Windows. The information in those articles is still relevant, but you might like me hesitate to even try those solutions because they look so old. I'm writing this basically to put something online that says, "Yup, this fix works for Windows 11 too," for anyone else working on legacy Delphi applications here in the roarin' 2020s. 

If you're working with Delphi 2007 on a modern Windows machine, you might have come across this error while attempting to close a VCL Forms application. You're greeted with an assertion failure saying, "SetThreadContext failed" in ..\win32src\thread32.cpp at line 412. 

![Assertion failure: "(!"SetThreadContext failed")" in ..\win32src\thread32.cpp at line 412 Continue execution?](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/65h6lbhunexmcki8brx5.png)

Luckily there's a straightforward fix to this issue. The problem is caused by an outdated version of bordbk105N.dll that comes bundled with Delphi 2007. To resolve this, you need to replace it with an updated version of the file.

Here's what you need to do:

1. First, download the updated version of bordbk105N.dll from Embarcadero's website: https://cc.embarcadero.com/item/27521. This file was initially released as a fix for Windows 7, but it works for Windows 11 as well.
2. Next, locate the folder where your Delphi 2007 installation is. The default installation path is typically C:\Program Files (x86)\CodeGear\RAD Studio\5.0.
3. Navigate to the bin folder within the Delphi 2007 installation folder.
4. Find the existing bordbk105N.dll file and create a backup copy of it (e.g., bordbk105N.dll.bak). This step is essential in case you need to revert any changes.
5. Replace the existing bordbk105N.dll file with the updated version you downloaded earlier.
6. Restart the Delphi 2007 IDE and run your VCL Forms application again.

That's it! You should no longer encounter the "SetThreadContext failed" assertion failure when closing your VCL Forms application.
How to make Weather Animation Button HTML&CSS only
Tags: webdev, html, css
Published: 2023-04-13 02:20:32

Today, I will introduce how to create a weather animation button using only HTML and CSS.

{% codepen [https://codepen.io/YMCAts/pen/BaqoRJw](https://codepen.io/YMCAts/pen/BaqoRJw) %}
5 Differences you must know between Cloud Engineer and Kubernetes Engineer
Tags: devops, kubernetes, cloud, devjournal
Published: 2023-04-13 01:42:00

As a DevOps engineer, you should get your hands with both Cloud Engineering and K8s Development. But as companies are looking for more specialized roles here are 5 differences that can help you out:


## Difference 1:
Cloud Engineer manages the organisation's cloud computing environment, while Kubernetes Engineer manages containerised applications within K8s environment.


## Difference 2:
Cloud Engineer broadly focuses on hardware, software and networking components of the cloud provider. While Kubernetes Engineer only focuses on managing components related to Kubernetes.



## Difference 3:
Cloud Engineer has a strong understanding of cloud computing platforms like AWS, GCP, Azure. While Kubernetes Engineer has a strong understanding of containers and K8s components in particular.



## Difference 4:
Cloud Engineer designs and implements cloud-based solutions and ensures their availability.  While Kubernetes Engineer configures and maintains K8s environment and troubleshoots issues related to containerised applications.


## Difference 5:
Cloud engineers can grow into roles of Cloud Architects or Solution Architects. While Kubernetes Engineers can get into more specialised roles that is focused into deploying and managing container applications.



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



Thanks for reading this.

If you have an idea and want to build your product around it, schedule a call with [me](https://calendly.com/pragyanatvade).

If you want to learn more about DevOps and Backend space, [follow me](https://dev.to/pragyanatvade).

If you want to connect, reach out to me on [Twitter](https://twitter.com/pragyanatvade) and [LinkedIn](https://www.linkedin.com/in/pragyanatvade/).
New boost
Add Sql Server Database Projects To CI & CD pipelines
Published: 2023-05-19 13:07:17

---
title: Add Sql Server Database Projects To CI & CD pipelines
published: true
date: 2023-04-13 01:03:00 UTC
tags: 
canonical_url: 
---

Sql Server Database projects are a great way to define your database structure and keep in in source control. Instead of maintaining a large list of migration scripts, you can instead define your database declaratively in the Sql Project as if you were creating a .net solution. This project style also facilitates the publishing of changes to Sql Servers. The publish process automatically detects what needs to change and creates the necessary Sql code to perform those changes.

One of the challenges of using Sql Server Database projects is to include the Sql Project in your CI/CD pipeline so that it can automatically publish the changes to a Sql Server.

Microsoft has migrated the Sql Server Database project format to the new “SDK style” project (introduced by .NET core).

A generic way to integrate it is to call the commands from the command line as most CI/CD pipelines support some sort of command line invocation. The steps to run from the pipeline are:

1. Build the project so that it generates a dacpac file
2. Install the SqlPackage dotnet tool
3. Run the SqlPackage tool with the “publish” option to publish the dacpac to the desired Sql Server.

The actual commands look like the following (assuming your database is named MyDb and your project is called MyDb.sqlproj):

```
Cd <folder where your sql project is>
dotnet build /p:NetCoreBuild=true
dotnet tool install -g microsoft.sqlpackage
SqlPackage /Action:Publish /SourceFile:"C:\AdventureWorksLT.dacpac" /TargetConnectionString:"ConnectionString to the db you want to publish to” /UniversalAuthentication=True
```

The “/UniversalAuthentication=True” is required if you need to use integrated windows authentication to authenticate with the target sql server, i.e. if you use **Integrated Security=True** in your connection string.

## References

[Build a Project from the Command Line - Azure Data Studio | Microsoft Learn](https://learn.microsoft.com/en-us/sql/azure-data-studio/extensions/sql-database-project-extension-build-from-command-line?view=sql-server-ver16)

[SqlPackage Publish - SQL Server | Microsoft Learn](https://learn.microsoft.com/en-us/sql/tools/sqlpackage/sqlpackage-publish?view=sql-server-ver16)