teleren/devto huggingface dataset:
Top Reasons Why you should Learn to Code?
Tags: coding, career
Published: 2022-12-29 10:11:55

If you are thinking about Why everyone is inclined to be a software developer? We at SynergisticIT will provide you with the top reasons why you should learn to code.

For more info. visit: [https://www.synergisticit.com/why-you-should-learn-to-code/](https://www.synergisticit.com/why-you-should-learn-to-code/)

Watch: [https://www.youtube.com/watch?v=VZnmT1N8dNY](https://www.youtube.com/watch?v=VZnmT1N8dNY)
Telnyx API buy number
Tags: kentucky, 606
Published: 2022-12-29 10:07:25

Telnyx is a communications platform that offers a range of APIs and services for voice, messaging, and phone numbers. You can use the Telnyx API to search for and purchase phone numbers in the 606 area code, as well as manage and route calls and messages to and from those numbers.

To get started with the Telnyx API, you'll need to sign up for an account and obtain an API key. You can then use the API to search for phone numbers in the 606 area code and make a purchase.

Here's an example of how you might use the Telnyx API to search for and purchase a phone number in the 606 area code:

First, make a GET request to the /v2/phone_numbers/search endpoint, passing in the area_code parameter set to 606 and the type parameter set to local. This will return a list of available phone numbers in the [606 area code](https://my9digits.com/606-area-code-overview-get-local-phone-number/).

Select the phone number you want to purchase, and make a POST request to the /v2/phone_numbers endpoint, passing in the phone_number parameter set to the selected phone number and the billing_method parameter set to prepaid. This will initiate the purchase of the phone number.

If the purchase is successful, you'll receive a response containing the details of the purchased phone number, including its phone number, country code, and call flow ID.

You can then use the Telnyx API to manage and route calls and messages to and from the purchased phone number.
Deep copy object in JS / ES6
Tags: webdev, javascript
Published: 2022-12-29 09:45:08

This is a thing I'm running into pretty often. In a test or whatnot i want clean data for each test. I usually just use the spread syntax.

```javascript
const mockEvent = {...testData.events.defaultEventRegularSite }
```

But the problem with this is that it actually just do a shallow copy. If you want to get a totally clean object this wont work if the object has more nested properties.

If you want a deep copy, you can use JSON like this.

```javascript
const mockEvent = JSON.parse(
   JSON.stringify(testData.events.defaultEventRegularSite)
);
```

Reference: [Stack Overflow](https://stackoverflow.com/questions/38416020/deep-copy-in-es6-using-the-spread-syntax)
CustomTkinter training
Tags: programming, beginners, python, tutorial
Published: 2022-12-29 09:38:10

Hello everyone today we want to learn about CustomTkinter.

**1.Making main window**

```python
import customtkinter

app = customtkinter.CTk()
app.geometry("600x500")
app.title("CTk example")


app.mainloop()
```

output:


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


**2.Making Frame**

**master**:   root
**width**:    width (px)
**height**:   height (px)
**border_width** : setting width of border (px)
**fg_color** : (foreground color) setting background color.
**corner_radius** : setting border radius

**How to make a frame?**

```python
import customtkinter

app = customtkinter.CTk()
app.geometry("600x500")
app.title("CTk example")

frame = customtkinter.CTkFrame(master=app,
                               width=200,
                               height=200,
                               corner_radius=10,
                               fg_color="red")
frame.place(x=20, y=20)


app.mainloop()

```


output:


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

**3.Making Label**

```python
import customtkinter
import tkinter

app = customtkinter.CTk()
app.geometry("600x500")
app.title("CTk example")

simple_label = customtkinter.CTkLabel(master=app, text="CTkLabel")
simple_label.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)


app.mainloop()

```

output:


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


**4.Making Button**

```python
import customtkinter
import tkinter
app = customtkinter.CTk()
app.geometry("600x500")
app.title("CTk example")

button = customtkinter.CTkButton(master=app,
                                 width=120,
                                 height=32,
                                 border_width=0,
                                 corner_radius=8,
                                 text="CTkButton")
button.place(relx=0.5, rely=0.5, anchor=tkinter.CENTER)

app.mainloop()
```

output:

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


**5.Making Entry**

```python
import customtkinter

app = customtkinter.CTk()
app.geometry("600x500")
app.title("CTk example")


entry = customtkinter.CTkEntry(master=app, placeholder_text="CTkEntry")
entry.pack(padx=20, pady=10)

app.mainloop()
```

output:

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

If you want learn more about CustomTkinter: [Source](https://github.com/TomSchimansky/CustomTkinter)

Thank you for reading this post.

Don't forget : Like Comment Subscribe
My 2022 Retrospective
Tags: productivity, discuss
Published: 2022-12-29 09:36:22

Hi all,

I really enjoy working with agile method and on of the most important rituals for me is the retrospective.
The agile methodology can also be apply in your every day life so i start a new exercise make my 2022 retrospective. 

https://fredlagage.fr/my-2022-retrospective/

And you what are your 2022 achievement ?

Thanks for reading and happy end of the year.
flat array from the multi dimensional zig-zag array
Tags: javascript, array, webdev, programming
Published: 2022-12-29 09:15:39

To flatten a multi-dimensional zig-zag array in JavaScript, you can use a combination of loops and array manipulation techniques.

Here is an example of how you might flatten a multi-dimensional zig-zag array:

```javascript
const array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];

// Flatten the array using a loop
const flatArray = [];
for (const subArray of array) {
  flatArray.push(...subArray);
}

console.log(flatArray); // Outputs: [1, 2, 3, 4, 5, 6, 7, 8, 9]

```

In this example, the `flatArray` array is initialized as an empty array. A loop is used to iterate over the elements of the array variable, which represents the multi-dimensional zig-zag array. For each element, the spread operator `(...)` is used to add the elements of the subarray to the `flatArray` array.

This will result in a flattened array that contains all of the elements of the original array in the order they appear.

Alternatively, you can use the `Array.prototype.flat` method to flatten the array, as follows:

```javascript
const array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
const flatArray = array.flat();
console.log(flatArray); // Outputs: [1, 2, 3, 4, 5, 6, 7, 8, 9]
```

The flat method will return a new array that is one level deeper than the input array. To flatten a multi-dimensional array with more than one level of nesting, you can call the flat method multiple times or pass it a depth parameter. For example:

```javascript
const array = [[1, 2, 3], [4, [5, 6], 7], [8, 9]];
const flatArray = array.flat(2);
console.log(flatArray); // Outputs: [1, 2, 3, 4, 5, 6, 7, 8, 9]
```
This will result in a flattened array that contains all of the elements of the original array in the order they appear.
My understanding of DNS
Tags: webdev, interne, beginners
Published: 2022-12-29 09:15:17

**What is DNS**
The **Domain Name System (DNS) **is a hierarchical and decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It associates various information with domain names assigned to each of the participating entities. — Wiki.

**How does DNS work**
When the user enters the URL in the browser address bar it needs to communicate the exact web server where hosted it.

Domain Like www.facebook.com is easy to remember for human but it is not suitable for communication between computers in a network.

In the network, computers can communicate with one another with the unique IP address only.

DNS works like a phone book directory. If we know the domain name we can get the IP address of the domain name. DNS server translates domain name such as www.twitter.com into IP addresses.

![How does DNS work](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bu894oibsvh9t1p54gxz.png)


When you enter the URL in the address bar of the browser, it searches the IP address using the domain in your local file stored in our PC. If the IP address is not available in your local file then it redirected the DNS server.

When you enter the URL in the address bar of the browser, it searches the IP address using the domain in your local file stored in our PC. If the IP address is not available in your local file then it redirected the DNS server.

In the DNS server first, it directs to the Resolver. Resolver checks first its cache memory. If Resolver could not find, it redirects to the Root Server. The Root server is the top of the DNS hierarchy. The Root server directs Resolver to TLD Server (Top Level Domain server).

TLD stores the address information of Top-level domain such as .com, .net, .org, ..etc. TLD directs Resolver to Authoritative Name Server. Now Resolver asks the Authoritative Name server what is the IP address of www.twitter.com. The Authoritative Name server is the final authority. It will give the IP address of twitter.com. Finally, Resolver tells the computer of the IP address of twitter.com. And Resolver stores the IP address in its cache memory. Because not need to search again.

Thank you for reading. Have a nice day!

**Reference Link:**
https://en.wikipedia.org/wiki/Domain_Name_System
How to become css master ?
Tags: chatgpt, webdev, javascript, css
Published: 2022-12-29 09:12:00

To become a CSS master, you will need to learn and master the following skills:

HTML and CSS basics: You should be familiar with the basic syntax of HTML and CSS and how they are used to structure and style content on the web.

Responsive design: You should be able to design and build responsive websites that look and function well on a variety of devices, including desktop computers, tablets, and smartphones.

Layout techniques: You should be able to create flexible and advanced layouts using techniques such as floats, flexbox, and grid.

CSS preprocessors: You should be familiar with CSS preprocessors like Sass or Less, which allow you to write more efficient and maintainable CSS code.

CSS frameworks: You should be familiar with popular CSS frameworks like Bootstrap and Foundation, which provide a set of predefined styles and layout components that can be easily customized to fit the needs of your project.

Browser compatibility: You should be aware of browser compatibility issues and know how to troubleshoot and fix them.

Accessibility: You should be familiar with web accessibility standards and know how to create accessible websites that are usable by people with disabilities.

To develop these skills, you can start by learning online through tutorials and online courses, or by working on small projects on your own. As you gain experience and become more comfortable with CSS, you can take on more complex projects and challenges to continue improving your skills.
is Data Structures and Algorithms necessary for frontend developer ?
Tags: chatgpt, webdev, javascript, beginners
Published: 2022-12-29 09:10:09

DSA, or Data Structures and Algorithms, is not necessarily a requirement for frontend developers. However, having a strong understanding of DSA can be beneficial for frontend developers in a number of ways.

For example, DSA concepts such as searching and sorting algorithms can be useful for optimizing the performance of frontend code, particularly when working with large data sets. In addition, a deep understanding of DSA can help frontend developers design and implement more efficient and scalable solutions to problems that they may encounter in their work.

That being said, it is not necessary for all frontend developers to have a deep understanding of DSA. It really depends on the specific requirements of the job and the individual developer's interests and goals. Some frontend developers may choose to focus more on design and user experience, while others may be more interested in the technical aspects of the job and want to develop their skills in DSA and other areas of computer science.
How to become frontend developer
Tags: webdev, javascript, beginners, chatgpt
Published: 2022-12-29 09:06:42

Becoming a frontend developer typically involves learning how to build and maintain the user-facing side of websites and applications. Here are some steps you can take to start your journey towards becoming a frontend developer:

1 : Learn HTML, CSS, and JavaScript: These are the core technologies used to build the frontend of websites and applications. HTML is used to structure content on the web, CSS is used to style and layout that content, and JavaScript is used to add interactivity and dynamic behavior to web pages. There are many online resources and tutorials available for learning these languages, such as Codecademy and freeCodeCamp.

2 : Practice building web pages and applications: As you learn the core technologies, put your skills into practice by building small web pages and applications. This will give you a chance to apply what you've learned and see how the different technologies work together.

3 : Learn about modern frontend frameworks and libraries: There are many frameworks and libraries available that can help you build more complex and interactive web applications more efficiently. Some popular choices include React, Angular, and Vue.js.

3 : Stay up to date with the latest developments: The field of web development is constantly evolving, with new technologies and best practices being introduced all the time. Make an effort to stay up to date with the latest developments in the field by reading blogs, attending meetups and conferences, and following industry leaders on social media.

4 : Consider earning a degree or certification: While it's not strictly necessary to have a degree or certification to become a frontend developer, earning a formal education in computer science or a related field can help you develop a strong foundation in the underlying principles of computer science and give you a competitive edge in the job market.

5 : Build a portfolio: As you build web pages and applications, be sure to document your work and add it to a portfolio. A portfolio is a great way to demonstrate your skills and experience to potential employers and clients.

I hope this helps! If you have any other questions about becoming a frontend developer, feel free to ask.
GCP Architecture and Framework
Tags: googlecloud
Published: 2022-12-29 09:05:31

There are basic 4 principle :

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

**Operational Excellence**
Strategies:

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

Best practices:

1. Increase software development and release velocity:

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


2. Monitor System health and business health:

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

3. Design for disaster recovery:

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


**Security , Privacy and compliance**

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

Best practices:
1. Manage Authentication and authorization:

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

2. secure the network:

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

3. Implement data security:

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


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

Best practices:
1. Define reliability goals:
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sjekt0dd0ooz837d433n.png)

2. Build flexible and automated deployment capabilities:

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

**Performance and cost optimization**

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

Best practices:
1. Use auto scaling and data processing:

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u2bulvuztwc3y834owu0.png)
2. Identify apps to tunes:


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



Done!
Angular or Next Js which is Suitable for large Scale projects compensating millions of clients??
Tags: angular, nextjs
Published: 2022-12-29 08:54:55

Which one is Better? I wanted to use the front end stack for the project but am confused with these two technology stacks. I would like to know which will serve me better as my project will be having millions of clients and their subscriptions i need something that serves me better. I would like to know expert advice which is better. Currently we are going to develop the Entire system using dotnet core. i would like to know which one i will use next js or Angular. if Nextjs then why and will it create problems when project grows in size way big? will i be in trouble ? please let me know your advices. my priorities would be serving the client faster without any delay. with less load time and better performance. any suggestions would be welcome... thanks in advance ‹
Connecting Deepnote to TiDB Cloud Serverless Cluster
Tags: mysql, tidbcloud, deepnote
Published: 2022-12-29 08:50:02

Deepnote is a new kind of data notebook beyond Jupyter. While investigating how to connect Deepnote to [TiDB Cloud Serverless Tier](https://tidbcloud.com/free-trial)(a serverless MySQL-compatible cloud database and TiDB Cloud Serverless Tier enforce TLS connections), I found it's not that easy.

There are two ways connecting Deepnote notebooks to MySQL, one is using Deepnote's integrations, one is directly from code.

## Using integration

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

Deepnote provides a built-in MySQL integration, you could use it to connect to MySQL. But unfortunately, when it involves TLS, it just does not work. As you could see in the image, it says *"Connections between Deepnote and your data source are encrypted by SSL (TLS)."* but there is no place to specify server's cert. Maybe it uses the system bundled CAs to verify? If it does so, TiDB Cloud Serverless Tier uses ISRG X1 root and it could definitely work. But not :-(

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

## Connecting from code

Integration does not work, but nothing prevents us connecting directly from code. To connect to MySQL, first you need a driver. There are three popular Python MySQL drivers: 

1. mysqlclient
2. PyMySQL
3. mysql-connector-python. 

PyMySQL would be easy to install since it's pure Python, you just need to 

```
!pip install PyMySQL
```

at top of the notebook. But I used to use mysqlclient. It's not that easy to make everything work if you want to use mysqlclient.

First, simply

```
!pip install mysqlclient
``` 

won't work. mysqlclient is a Python wrapper of libmysqlclient, so you need to install libmysqlclient first. According to https://deepnote.com/docs/custom-environments#default-environment , Deepnote use Debian Buster, so the installation would be

```
!apt install -y default-libmysqlclient-dev
!pip install mysqlclient
```

Then when using mysqlclient to securely connecting to MySQL, there are also two points to notice:
1. We are in Debian Buster, the installed libmysqlclient is actually libmariadbclient. libmaradbclient's interface is not same as libmysqlclient. It leads to mysqlclient doesn't accept `ssl_mode` tls argument like in other platforms.
2. We want to connect securely, definitely we want to verify the server's cert. As I said above, TiDB Cloud Serverless Tier uses ISRG X1 root, which is commonly in system built-in CA bundle. You could specify the CA as 

```
ssl={
      "ca": "/etc/ssl/certs/ca-certificates.crt"
    }
```

For more info about connecting to TiDB Cloud Serverless Cluster securely, you could refer to https://docs.pingcap.com/tidbcloud/secure-connections-to-serverless-tier-clusters .

UPDATE on 2023-03-03: DeepNote has fixed the problem and complete a whole feature for connecting securely https://deepnote.com/docs/securing-connections.
Installing and Configuring latest PostgreSQL on Ubuntu 22.04
Published: 2022-12-29 08:40:57

---
title: Installing and Configuring latest PostgreSQL on Ubuntu 22.04
published: true
description: 
tags: 
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2022-12-29 06:55 +0000
---
To install PostgreSQL on Ubuntu 22.04, follow these steps:
Update the package manager's package list by running the following command:
```bash
sudo apt update
```
Install the PostgreSQL package by running the following command:
```bash
sudo apt install postgresql
```
After the installation is complete, start the PostgreSQL service by running the following command:
```
sudo systemctl start postgresql
```
To make sure that the PostgreSQL service starts automatically when the system boots, run the following command:
```
sudo systemctl enable postgresql
```
To check the version of PostgreSQL installed on your system, run the following command:
For Server version:
```
pg_config --version
```
For Client version:
```
psql --version
```


To log in to the PostgreSQL database as the default "postgres" user, run the following command:
```
sudo -u postgres psql
```
This will open the PostgreSQL interactive terminal. From here, you can create databases, users, and perform other tasks. For example, to create a new database called "mydb_name", run the following command:
```
postgres=# create database mydb_name;
```
To create a new user called "myuser" with the password "mypass", run the following command:
```
postgres=# create user myuser with encrypted password 'mypass';
```
To grant all privileges on the "mydb_name" database to the "myuser" user, run the following command:
```
postgres=# grant all privileges on database mydb_name to myuser;
```
If you want to log in as a different user, you can use the following command:
```
psql -U username
```
Replace "username" with the name of the user you want to log in as.
That's it! You have successfully installed and configured PostgreSQL on Ubuntu 22.04. You can now use the interactive terminal or connect to the database from your application to perform various tasks.