teleren/devto huggingface dataset:
Complete Beginner Guide to Install IvorySQL (Oracle compatible PostgreSQL) on Windows 10 Pro with WSL2
Tags: postgres, windows, apacheage, database
Published: 2023-06-25 18:37:44

This guide aims to assist you in installation of IvorySQL (Orcale compatible PostgreSQL) on your Windows system. It is designed to provide a step-by-step walkthrough, ensuring a straightforward installation process. This guide aims to simplify the process further.

**Note: You must have installed _postgreSQL_ and integrated it with _Apache AGE_ before following this blog.**

> _If you haven't installed **PostgreSQL** or **Apache AGE** yet, checkout [this](https://dev.to/vkt1271/complete-beginner-guide-to-install-postgresql-apache-age-on-windows-10-pro-with-wsl2-part-1-fco)._

---------------------------------------------------------------

## A very Important step before Installing IvorySQL

Before moving forward, make sure to download the **required dependencies** by running the command `sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison` 

> Failing to do so may require you to **repeat** the process and **reinstall** IvorySQL again.

---------------------------------------------------------------

## Install IvorySQL

Now, clone the IvorySQL repository into the home directory. Therefore, I recommend to follow below steps:

**Step:1**

`git clone https://github.com/IvorySQL/IvorySQL.git`


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

**Step:2**

Now, `cd` into the cloned folder and run the command `./configure --without-icu`


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

**Step:3**

Now, to build run the command `make`


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

**Step:4**

Now, Regression Tests To test the newly built server before you install it, you can run the regression tests at this point by the command `make check` 

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

**Step:5**

Now, finally to install, run the command `sudo make install`

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

Hurrah! IvorySQL has been successfully installed in your system.

------------------------------------------------------------------

Study more about [IvorySQL](https://www.ivorysql.org/).

I hope, this blog has helped you for successful installation.
How to Secure Your MongoDB Database Against Attack
Tags: database, security, discuss, mongodb
Published: 2023-06-25 18:32:46

MongoDB is a popular NoSQL database that is used by a wide range of organizations. However, MongoDB can also be a target for attackers. In this blog post, we will discuss some best practices for securing your MongoDB database against attack.

**1. Enable authentication and authorization**

The first step to securing your MongoDB database is to enable authentication and authorization. This will prevent unauthorized users from accessing your data. You can use the built-in SCRAM-SHA authentication mechanism or an external authentication system, such as LDAP or Active Directory.

**2. Encrypt data at rest**

Even if you have enabled authentication and authorization, your data is still vulnerable if it is not encrypted at rest. This means that your data will be protected even if an attacker gains access to your database files. You can encrypt your data using the built-in encryption features in MongoDB or a third-party encryption solution.

**3. Encrypt network traffic**

In addition to encrypting data at rest, you should also encrypt network traffic to and from your MongoDB database. This will protect your data from being intercepted by attackers while it is in transit. You can use the built-in TLS/SSL encryption features in MongoDB or a third-party encryption solution.

**4. Use role-based access control (RBAC)**

Once you have enabled authentication and authorization, you can use RBAC to control who has access to different parts of your database. This will help you to limit the damage that an attacker can cause if they do gain access to your database.

**5. Monitor your database for suspicious activity**

It is important to monitor your database for suspicious activity. This will help you to detect any unauthorized access or changes to your data. You can use the built-in auditing features in MongoDB or a third-party monitoring solution.

**6. Keep your database up to date**

MongoDB releases security updates on a regular basis. It is important to keep your database up to date with the latest security patches. This will help to protect your database from known vulnerabilities.

**Conclusion**

By following these best practices, you can help to secure your MongoDB database against attack. However, it is important to remember that no security measure is perfect. You should also implement other security measures, such as a firewall and intrusion detection system, to protect your entire network.

**Additional resources:**

* MongoDB Security Checklist: https://www.mongodb.com/docs/manual/administration/security-checklist/
* MongoDB Security Best Practices: https://www.comparitech.com/net-admin/secure-mongodb/
* How to Secure MongoDB: https://www.mongodb.com/blog/post/hack-common-security-issues-fix-them
Exploring the Structure and Layout of a Database Cluster
Published: 2023-06-25 18:23:03

Before diving into the structure of database cluster, we first need to understand what database cluster is.

Database cluster is the collection of databases. This collection is managed by a server named PostgreSQL server. This server runs on a single host. Now let's discuss the its structure. 

#### Logical Structure of Database Clusters



- 
Just like database cluster is the collection of databases, database is the collection of database objects. These objects are used to store and reference the data. Some examples of database objects are tables, index, views, sequence and function.
- 
These database objects are managed in PostgreSQL by Object identifiers OIDs.

- In PostgreSQL, databases are also database objects, logically separated from eachother.


#### Physical Structure of Database Cluster

Database cluster is the base directory while database is its subdirectory. 

- 
The subdirectory of the database contains at least one file of tables and indexes and particular data or configuration files. 

#### Layout of database cluster, databases and tables
- 
The base directories (database cluster) contains some files and subdirectories. 

- 
The databases are under the base directory and their names are same as that of Object identifiers.

- 
Tables and indexes are managed by individual OIDs.

- 
Data files are managed by relfilenode variable.

#### Tablespaces
The additional data area outside the base directory is known as tablespaces. 
When you issue a command `CREATE TABLESPACE`, a tablespace is created under the provided directory.
The Art of Code Commenting
Tags: programming, productivity, beginners, discuss
Published: 2023-06-25 18:21:12

Lately, I've been reflecting a lot on my process of documenting and teaching my code to others. As a young dev 😅, I'm always looking for ways to improve. One thing I've noticed in my past work is that the code commentary often wasn't optimal. Let me tell you, returning to a project that I haven't touched for almost two years and finding only 10 comments across the entire project is hellish. So, I hope you can learn something from this article and my thoughts.

Also, make sure to keep an eye out for my upcoming article specifically focusing on **the art of code commenting in <u>.NET</u>**. You won't want to miss it! Be sure to follow me to stay up-to-date with all my latest insights and articles.

---

Comments in code are akin to leaving notes to your future self and to others who might work on the code. Why did I write this piece of code in a certain way? Why did I not choose an alternate approach? Code, by its nature, tells you "how", comments should ideally tell you "why". This is a philosophy I've come to appreciate over the years.

So based on my reflection and my past experience I think the following practices are making a lot of sense. At least to me 😅

- **Comment the Why, not the What:** I strive to write code that is self-explanatory in terms of what it does. My comments are then dedicated to providing context, explaining my decisions, or highlighting any non-obvious aspect of the code.

- **Keep Comments Relevant:** One of the things I've learned the hard way is that outdated or incorrect comments can be worse than no comments. So, every time I update my code, I make it a point to update relevant comments as well.

- **Avoid Redundant Comments:** As tempting as it might be to comment everything, I avoid commenting on the obvious. I believe that if my code is clean and clear, it should largely speak for itself.

- **Use XML Documentation Comments:** I find XML documentation comments an excellent tool to provide information about my code's classes, methods, properties, etc. Not only do they help generate a separate XML file, but they also provide IntelliSense documentation in the Visual Studio code editor, making life easier for me and my team.

- **Commented-Out Code:** Early on, I used to leave commented-out code in my source files, but soon I realized that it creates unnecessary clutter. I've come to rely on source control for remembering old code instead.

In the end, I would say that code commenting is truly an art form. When done right, it can greatly enhance the understandability of your codebase and improve productivity for both yourself and others. And always remember, your comments are a reflection of your thought process, so strive to make them as clear as possible. 

---

I'm sure there are many more insights to be gathered from the vast community of developers out there. So, I encourage you all to share your thoughts and practices you've used over the years in the comments section. Let's learn from each other!

Enjoy coding 😄
NGINX configuration for WebSocket
Tags: nginx, websocket, django, channels
Published: 2023-06-25 18:05:28

```
location /ws/websocket/ {
    proxy_pass http://localhost:8000;  # port where server is running
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "Upgrade";
    proxy_set_header Host $host;
    proxy_read_timeout 86400;
    proxy_redirect off;
}
```
SVG Image optimisations and caching from s3
Tags: svg, optimisation, react
Published: 2023-06-25 17:38:15


---
title: SVG Image optimisations and caching from s3
published: true
description: 
tags: svg, optimisation, react
cover_image: https://images.unsplash.com/photo-1594383538644-66fcb99ae1ed?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1654&q=80

---

If you have been using svg image in your projects, you might have sure observe the downside which is its huge size compared to other image formats, since svg is a go-to image format where image quality will be always be the same irrespective of the container size. 

Here are few tricks and tips to optimise svg images to be the best minimal size

####Steps 


1. **Optimisation:** After extracting svg from the figma design, optimise its size from below websites before using it in your code, these websites removes any unwanted attributes or do some conversions to reduce the image size
		[SVG Cleaner](https://www.svgcleaner.com/)
		[SVG Viewer](https://www.svgviewer.dev/)

2. **Compression:** Gzip Compress file using below methods
     Commands - gzip Command Examples in Linux – The Geek Diary 
Run this command in terminal  ( `gzip --best <filename>`)

     Online tool - GZIP decompress/compress files from your browser 

     You can also `brotli` compression which is compatible in all modern web browsers


3. Remove the .gz extension from the file name

4. **Upload to s3:** Upload the compressed svg object with metadata (System Defined, Content-Encoding: gzip)) to the s3 bucket

5. Finally you can access the image using cloudfront url, the image will be served in gzip compressed format

   
	

Tada! You're all set now!! 
Happy Learning 🌟
Day 3 : Understanding JSX
Tags: react, beginners, programming, 30daysofcode
Published: 2023-06-25 17:11:26

Today was the third day of my challenge. Continuing with the same tutorial, I finished only 1 video of React JS. I learned about JSX. I coded JSX inside "App.js" file. Whatever is typed inside the return code of "App.js", the result will be shown on "React App".
GitHub Traffic Checker
Tags: github, analytics, node, javascript
Published: 2023-06-25 17:09:18

Whenever writing blog posts or publishing video courses, I like to check in on the amount of traffic and views they are getting. It's a data point on what's interesting to readers, and sometimes suggests that I should dig deeper into a topic and write more about it.

The same is true for GitHub repos; while stars act like "bookmarks", it can be useful to see if there's anyone checking the repo and reading the source code or the documentation. It can suggest that some repos need more work to get more contributions or more usage.

Checking GitHub traffic across multiple repos was a manual process, using multiple tabs in the browser and clicking around the interface.

## `github-traffic-check`
So, I wrote a small script using the GitHub Octokit package that prints out:

* the repository name
* the number of stars it has
* the number of views
* the number of unique views

[Download `github-traffic-check` 1.0.0](https://github.com/rudolfolah/github-traffic-check/releases/tag/1.0.0)
HOW THE PROVIDER DESIGN PATTERN
Published: 2023-06-25 17:03:48

This article aims at showing you how to implement the provider design pattern. But first, you need to know what are the various design patterns used in building a react application.

There are about six design patterns commonly used when building a react application and they are;
1.Higher order component design pattern
2.State reducer design pattern
3.Render props component design pattern
4.Provider design pattern
5.Presentational and container component design pattern
6.Hooks design pattern


The most commonly used design pattern is Render props component, In some cases, we want to make data accessible to all or most application components. Even though we can use props to pass data to components, it can be hard if almost all of your application's components need access to the props' value.

When props are passed far down the component tree, we frequently experience what is known as prop drilling. It becomes nearly impossible to refactor the props-dependent code, and it is difficult to determine where particular data originates.

The Provider Pattern can be of assistance to us in this regard! We can make data available to multiple components using the Provider Pattern. We can wrap each component in a Provider rather than passing that data through props at each layer. The Context object gives us a Provider, a higher-order component. The createContext method that React provides allows us to create a Context object.

The Provider receives a value prop, which contains the data that we want to pass down. All components that are wrapped within this provider have access to the value of the value prop.

```
const DataContext = React.createContext()
 
function App() {
  const data = { ... }
 
  return (
    <div>
      <DataContext.Provider value={data}>
        <SideBar />
        <Content />
      </DataContext.Provider>
    </div>
  )
}
```

Here, we have eliminated the problem of passing data down to each component using props.

Each component can get access to the data, by using the useContext hook. This hook receives the context that data has a reference with, DataContext in this case. The useContext hook lets us read and write data to the context object.

```
function ListItem() {
  const { data } = React.useContext(DataContext);
  return <span>{data.listItem}</span>;
}
 
function Text() {
  const { data } = React.useContext(DataContext);
  return <h1>{data.text}</h1>;
}
 
function Header() {
  const { data } = React.useContext(DataContext);
  return <div>{data.title}</div>;
}
```

The Provider pattern is very useful for sharing global data. A common use case for the provider pattern is sharing a theme UI state with many components.

Thank you for reading.
Зодии по знаци
Published: 2023-06-25 16:33:47

какъв е дневния ви [хороскоп за днес и утре](https://tami.bg/%d1%85%d0%be%d1%80%d0%be%d1%81%d0%ba%d0%be%d0%bf-%d0%b7%d0%b0-%d0%b4%d0%bd%d0%b5%d1%81-%d1%83%d1%82%d1%80%d0%b5/):

Днес Утре Любовен Седмичен Месечен Годишен
Телец
Приемете само тези срещи, които сте планирали и изискват да завършите вече започнати разговори. Разрешете всички неотложни проблеми до обед. Не мислете само за кариерата си. Не прекалявайте с натоварването с чужди задачи заради добронамереност и желание да сте полезни. Сами може да стоварите неприятности на главата си, ако повярвате на любовни или парични 
Характеристики на Телец
Управляваща планетаВенера
Благоприятни партньорстваДева, Скорпион, Козирог, Риби
Неблагоприятни партньорстваЛъв, Водолей, Стрелец
Стихияземя
Качествонеподвижен
Щастливи числа2,4,6
Подходящ цвятесенно-жълто, бяло, зелено, бледо лилаво
Камъниахат, брилянт, опал, лунен камък
Цветя (растения)Момина сълза, люляк
Металжелязо, стомана
Талисманчук, златно руно
ДевизАз притежавам
Късметлийски днипонеделник, петък
Неблагоприятни днивторник
Лоши дни6, 8
Карта Таро на Телец
Карта таро - Папата
Папата – обучение, училище, благословия, ритуал, брак, артистизъм
Изберете хороскоп за друга зодия:
Овен
Телец
Близнаци
Рак
Лъв
Дева
Везни
Скорпион
Стрелец
Козирог
Водолей
Риби
Setting Up Your Next Project
Tags: webdev, beginners, css, frontend
Published: 2023-06-25 16:30:29

Looking for a guide to start your project setup? You found a right place. This blog will give you an basic idea for setting up your project and this series will help you as a beginner. I am using next but this can apply for any framework as well as vanilla.js

### Prerequisite
 

-node.js
-npm
-HTML
-CSS
 
Lets start ...
 

###1. Creating next project 
```
npx create-next-app app-name
```
 For  beginners  we can use  ESlint in the options .

###Project structure
 lets understand project structure of the current project and update it to  be more suitable structure.
   How it looks now :


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



Following steps would be followed:

####1.  Removing the api folder from pages
####2. Create component folder
####3. Create an api folder in rood directory
####4. Create an interceptor.js file and Endpoints folder
Now it looks like this
  
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/o2fnbehqhvs4sszzn40o.png)


###2. Working on CSS
  lets clear the entire global CSS ...
  Now starting fresh
#### CSS reset
 

 ```
  *{
    margin:0;
    padding:0;
    box-sizing: border-box;
   }
 ```
 This reset the CSS padding  and removes unnecessary padding, margin  that is automatically added to your HTML components.
 

#### Root Selector
     
 ```
:root{
   --white:#fff,
   --black:#000,

}
 ```
The :root selector matches the document's root element. We can
     declare our variable here , basically we can describe  font 
      color that are repetitively used in the web app.


#### Body 
   
```

body {
  background: var(--cream);
  font-family: "Playfair Display", "sans-serif";
   
}
```
The css declarations in this part  are applied through out the the web app ,we can provide with background color for out website
font-size, font-family etc can be described here.
GSoC Week 2-3 Update
Tags: gsoc
Published: 2023-06-25 16:15:57

# Brief
These weeks I refactored the `LombScargleCrossspectrum` and `LombScarglePowerspectrum` classes to accommodate the fast algorithm which went smoothly.
However when it comes to the fast algorithm. I had tunnel vision and unconsciously made the `lsft_fast` function compute the power spectrum instead of the fourier transform. Right now I am working towards isolating the algorithm to compute the fourier transform using the Press and Rybicki optimizations(https://ui.adsabs.harvard.edu/abs/1989ApJ...338..277P/abstract).

# Challenges Faced

Integrating the optimization to the existing slow algorithm is giving me a bit of trouble. I'm still figuring out how to add the optimizations. If this is done, I can move onto making the time lag, phase lag functions and then onto testing and documentation.

# Details
Added the following parameters to both the classes in order to accommodate choice between the fast and slow algorithm.

```
method : str
        The method to be used by the Lomb-Scargle Fourier Transformation function. `fast`
        and `slow` are the allowed values. Default is `fast`. fast uses the optimized Press
        and Rybicki O(n*log(n))
    
    oversampling : float, optional, default: 5
        Interpolation Oversampling Factor (for the fast algorithm)
```
For full code refer https://github.com/StingraySoftware/stingray/pull/737

Most important part of the process is the Lomb Scargle Fourier Transform.
The wrapper class is trivial, they only wrap the fast and slow lomb scargle fourier transform functions.

# Results using the slow algorithm
## On synthetic data
```
rand = np.random.default_rng(42)
    n = 100
    t = np.sort(rand.random(n)) * n
    y = np.cos(2 * np.pi * 5 * t) + 0.01 * rand.standard_normal(n)
    y -= np.min(y)
    lc1 = Lightcurve(t, y, err_dist="poisson")
    y2 = np.cos(2 * np.pi * 5.0 * (t)) + 0.01 * rand.standard_normal(n)
    y2 -= np.min(y2)
    lc2 = Lightcurve(t, y2, err_dist="poisson")
```
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xgf4z7yaxi81aoxj9dkx.png)

## On real data
### The lightcurve

https://heasarc.gsfc.nasa.gov/FTP/nicer/data/obs/2018_03//1200120106/xti/event_cl/ni1200120106_0mpu7_cl.evt.gz

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/167buf3woin2hplbo89r.png)
Software Security with Laurie Williams
Tags: security, softwareengineering
Published: 2023-06-25 16:02:47

This is a bit off-topic, but I am the coordinator and co-host of the [Fronteiras da Engenharia de Software podcast](https://fronteirases.github.io/en).

In the latest episode of this podcast, we interviewed Laurie Williams, a Distinguished University Professor at the Department of Computer Science at North Carolina State University.

{% youtube WyTOtlY3NFY %}

{% embed https://open.spotify.com/episode/0bOyUIgGKa08IZUv5w5vSd %}


You can listen to this podcast episode at your favorite audio platform: [https://podcasters.spotify.com/pod/show/fronteirases/episodes/ep-e25vn50](https://podcasters.spotify.com/pod/show/fronteirases/episodes/ep-e25vn50).



Questions we asked:

Can we trust most of the software we use every day?

What are some of the biggest challenges that software developers face in this area?

How does your research help software developers address those challenges?

What advice do you give to software engineers that want to create secure software?

You co-wrote a book on Pair Programming, and you have also written many papers related to Agile Software Development. In fact, 9 out of your 10 most cited works on Google Scholar are related to Agile. How did you get interested in Agile Software Development?

How did you get interested in Computer Science? How was your education in the area?

Did you face difficulties at school or work because you are a woman?

Do you participate in any support groups for women in Computing?

What would you say to girls or women that want to follow a career in Computing?

For you, what is the next frontier in software engineering? (it can be something that you think will happen or something you would like to see happening in our field)

Would you like to leave some final words for our audience?