teleren/devto huggingface dataset:
PHP Sanitizer.
Tags: laravel, php, sanitize, webdev
Published: 2023-03-07 08:40:00

On the new year's eve, I set out to build some open source packages for [PHP](https://www.php.net/) and [Laravel ](https://laravel.com/) community which is one of the best communities you can find. The packages would consist of libraries, utils, helpers and packages and also some starters for medium and large-scale projects.

I have been working with PHP and related technologies for over a decade now and more often than not, I find myself using the same peace of code in different projects.

Up until now I used to create Libraries which I would just transfer files from one project to another and reuse the library, but I wanted something more manageable and if I wanted to change something or fix issues to easily fix it in one place.

## Backstory
In my early days in programming, I often had to create search pages using vanilla PHP. 
This means I needed to get user input, parse it, sanitize it, and prepare for the query. 
Another thing to consider was special characters for different languages for example:

```
э => e
Ë => e
Ç => c
```
For this reason I build a [PHP Sanitizer](https://github.com/erlandmuchasaj/sanitize) class to only do just that. Sanitize user input and prepare it for SQL search queries.
{% embed https://github.com/erlandmuchasaj/sanitize %}
It is very simple to use. I will do a follow up with some examples of how to use it on your projects.

Let me know in the comment section below if you ever use it in any of your projects.
Don't forget to like and comment.
Follow [me](https://twitter.com/muchasaj) for more web development tips, new packages and more.
Thanks for reading.
Pure CSS Loader Generator
Tags: webdev, css, beginners
Published: 2023-03-07 08:00:37

Hey everyone,

I've just finished a new resource I've been working on lately 🥳

It's a code generator that helps you to create simple CSS spinners. You can choose between four different types of CSS spinners and customize them by adjusting the settings.


![preview of the loader generator](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7a32h0jlja2qwwzk37dq.gif)

You can find the tool here:

[https://wweb.dev/resources/loader-generator/](wweb.dev/resources/loader-generator/)

Let me know what you think (and if everything works as expected) 😊
I might add some more loaders in the future.

Cheers,
Vincent
The evil OpenAI and ChatGPT
Tags: ai
Published: 2023-03-07 07:57:10

Open AI has blocked two of my proxy IPs.
It seems I has been the chosen one that it intends to forbidden.
Why the Open AI is so evil? What is it afraid of ?

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7o8jos0h0ouwjmgvwfos.png)
Exploratory Data Analysis(EDA)
Tags: datascience, analysis
Published: 2023-03-07 07:46:58

What is EDA ?
This is a method used by data analysts to analyze,assess and summarize datasets.
EDA is is used by data scientists to analyze and investigate data sets and summarize their main characteristics, often employing data visualization methods.

Think of EDA as the simple research or investigative measures that one does before a purchase.Things like looking at what the price is where the item can be bought at and such like  investigations.

EDA helps determine how best to manipulate data sources to get the answers you need, making it easier for data scientists to discover patterns, spot anomalies, test a hypothesis, or check through assumptions.

Tools That can Be used to Perform EDA:

<u>Scripting Languages</u>
Python and R programming languages enable analysts to analyze data better and manipulate it using libraries and packages such as Plotly, Seaborn, or Matplotlib.

<u>BI Tools(Business Intelligence)</u>
Business intelligence (BI) tools are types of application software that collect and process large amounts of unstructured data from internal and external systems, including books, journals, documents, health records, images, files, email, video, and other business sources.
Some of the tools here would be _Qlik Sense, IBM Cognos, Tableau and I would also mention PowerBI and Oracle Analytics Cloud_.
Error codes for React?
Tags: react
Published: 2023-03-07 07:46:29

As I couldn't find a tool to automate error management with error codes, we've built one: https://bit.ly/3Gfcb86. 

Now see (2min) how React could be instrumented with error codes in this 2minutes asciinema http://bit.ly/3JjnInJ . React could even have unique error codes per version, public KDB like https://bit.ly/3YYxmS5, etc.

And yet, devs, nothing to do, just run err0 open-source agent in CI/CD before release.

All feedbacks welcomed!
First release of gotimeparser
Tags: go, beginners, opensource, programming
Published: 2023-03-07 07:36:16

## Background

Many companies use service to service integration through different API porotocols.
I had the same situation in my production environment. At some point, clients of my service started to send me dates in different formats.

Some of them sent timestamps in int, some of them used ISO 8601, etc. But what was clear, these dates were valid and we could not request to change it in one day.

As a result of this issue, I implemented some solution that solved the issue and wrote a couple of articles that shared the issue and the approach:

1. [Parse timestamp formats](https://aohorodnyk.com/post/2022-05-06-parse-timestamp/)
1. [Parse time from different non timestamp formats](https://aohorodnyk.com/post/2022-05-07-parse-time-strings/)
1. [Universal time UnmarshalJSON implementation](https://aohorodnyk.com/post/2022-05-08-universal-time-unmarshaljson/)

But I did not want to create an Open Source package, because of I believe that Open Source cannot be just few lines of code. It's a right formatting of the code, some code coverage by tests, examples and the most important - is commitment to support it.

## First release

Today is a day when I decided to invest time and commit to a simplification of software development in Go.
Time parsing is a regular issue, especially in event-driven architecture and microservice arachitectures.

Feel free to use the zero-dependency library to solve all the main issues you could have with time parsing in Go.
openGauss Stored Procedures
Tags: opengauss
Published: 2023-03-07 07:29:03



A stored procedure is a set of SQL statements that can implement a specific function. You can repeatedly call the stored procedure to reduce the number of repeated SQL statements and improve work efficiency.

## Syntax
Create a stored procedure.


`CREATE PROCEDURE procedure_name
    [ ( {[ argname ] [ argmode ] argtype [ = expression ]}[,...]) ]
    { IS | AS } 
    BRGIN
      procedure_body
    END
/`
Call a stored procedure.


`CALL procedure_name ( param_expr );`
Delete a stored procedure.


`DROP PROCEDURE procedure_name ;`

## Parameter Description
procedure_name

Specifies the name of the stored procedure to be created.

argname

Specifies the parameter name.

argmode

Specifies the mode of a parameter. Value range: IN, OUT, INOUT, and VARIADIC. VARIADIC specifies parameters of array type. The default value is IN.

IN

Specifies an input parameter. The value of the parameter must be specified when the stored procedure is called. If the value of the parameter is changed in the stored procedure, the value cannot be returned.

OUT

Specifies an output parameter. The value can be changed in the stored procedure and can be returned.

INOUT

Specifies input and output parameters. The value can be specified when the stored procedure is called and can be changed and returned.

argtype

Specifies the data type of the parameter.

expression

Sets the default value.

IS, AS

Required for the syntax. One of them must be provided. They have the same function.

BRGIN, END

Required for the syntax.

procedure_body

Specifies the stored procedure content.

param_expr

Specifies the parameter list. Use commas (,) to separate parameters. Use := or => to separate parameter names and parameter values.

## Examples
`-- Create a table
openGauss=# CREATE TABLE graderecord  
(  
  number INTEGER,  
  name CHAR(20),  
  class CHAR(20),  
  grade INTEGER
);`

-- Define a stored procedure.
openGauss=# CREATE PROCEDURE insert_data  (param1 INT = 0, param2 CHAR(20),param3 CHAR(20),param4 INT = 0 ) 
IS
 BEGIN 
 INSERT INTO graderecord VALUES(param1,param2,param3,param4);  
END;
/


-- Call the stored procedure.
openGauss=# CALL  insert_data(param1:=210101,param2:='Alan',param3:='21.01',param4:=92);

-- Delete the stored procedure.
openGauss=# DROP PROCEDURE insert_data;
Convert Image to JPG Online | Convert File PNG to JPG
Tags: convertimagetojpgonline, convertimageintojpg, batchconvertpngtojpgphoto, convertfilepngtojpg
Published: 2023-03-07 07:27:08

Easy way to convert your PNG images to JPEG? [Convert Image to JPG online](https://www.png2jpgfreeonline.com/)! Our free online tool allows you to convert your images to JPG.
If you need to convert image to JPG Online, there are several ways to do it.

One of the easiest ways is to use an online conversion tool. This tool allow you to convert image files from one format to another without downloading any software.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d5ye8qponqfj55fbzoqq.png)
Introducing Glarity: The Future of Information Filtering! 🚀
Tags: chatgpt, summarize, chrome, youtube
Published: 2023-03-07 07:15:23

Hey everyone,

I'm excited to introduce Glarity, a new plugin designed to help you filter information more quickly and easily. With Glarity, you can summarize Google search results and YouTube videos in just a few seconds, making it easier to get the core information you need. 💡

What makes Glarity different from other plugins is that it provides quick and easy-to-understand summaries of search results and video content. Plus, it's customizable and supports multiple languages. And the best part? Glarity is completely free to use, with no ads or hidden fees! 😍

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

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




If you've been waiting for a tool like this, I invite you to check out Glarity and share your thoughts with the community. You can find it here: https://www.producthunt.com/products/glarity-summarize-google-and-youtube

And if you want to see Glarity in action, check out our short video that explains the product in just one minute: https://www.youtube.com/watch?v=qcw_9QLqVJ4&t=1s 🔍🎥

Thank you for your time and consideration, and I look forward to hearing your feedback! 👊

Make sure to follow the community rules on dev.to/t and engage with other users to get the most out of your post. Good luck!
Convert Image to JPG Online | Convert File PNG to JPG
Published: 2023-03-07 07:13:14

Easy way to convert your PNG images to JPEG? [Convert Image to JPG online](https://www.png2jpgfreeonline.com/)! Our free online tool allows you to convert your images to JPG.
If you need to convert image to JPG Online, there are several ways to do it.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/liborur3m0vpm71zjn66.png)
One of the easiest ways is to use an online conversion tool. This tool allow you to convert image files from one format to another without downloading any software.
Was ist Deep Learning? Wir stellen Beispiele für die KI-Nutzung vor!
Tags: webdev, deeplearning, ai, productivity
Published: 2023-03-07 07:09:03

<mark>**Artikel Quelle:** [Was ist Deep Learning?](https://octoparse.de/blog/was-ist-deep-learning)</mark>

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

KI (Künstliche Intelligenz) erregt Aufmerksamkeit als eine Technologie, die das geschäftliche und gesellschaftliche Umfeld durch neue Lernmethoden stark verändern wird. Die neue Lernmethode heißt „Machine Learning“ und „Deep Learning“. Was für eine Lernmethode ist Deep Learning? Dieses Mal erkläre ich Deep Learning, eine Lernmethode für KI. Wir werden auch Beispiele für die KI-Nutzung vorstellen, die Deep Learning anwendet. Wenn Sie darüber nachdenken, ein Unternehmen zu entwickeln, das in Zukunft KI nutzt, beziehen Sie sich bitte darauf.
If you don't choose a struggle, you will be assigned one
Tags: life, webdev, beginners, productivity
Published: 2023-03-07 07:06:47

I was doing my evening walks when I met my long friend from Primary school. We did our bro hugs and we got to the "Where are you now?" talk.

He was with a friend. All of them shaved clean. He said he joined the army.

His follow-up question for me was, "Why don't you join the army with your height?"

For a second there, I didn't want to be brutally honest with him but I told him. "I never wanted to join the army."

I asked him why he joined the army. They both laughed and said, "Tulijipata tu", in Swahili meaning, "We found ourselves."

It hit me right there. It's about choosing a struggle. You either perservere with one, or the world will assign you one.
Animation for Book Reading App
Tags: uiux, design, animation
Published: 2023-03-07 07:03:07

Today we want to share an animation about Book Reading App. We did this for our client. It has a welcome screen and a homepage that has a block with currently popular books and custom user recommendations.
For More Update **[CLICK HERE](https://www.behance.net/gallery/165391761/Animation-for-Book-Reading-App)**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/knng6bjegxf1pxgsivij.gif)
Stored Procedures
Tags: opengauss
Published: 2023-03-07 06:49:33

A stored procedure is a set of SQL statements that can implement a specific function. You can repeatedly call the stored procedure to reduce the number of repeated SQL statements and improve work efficiency.

**Syntax**


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

**·** Create a stored procedure.

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

**·** Call a stored procedure.

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

**·** Delete a stored procedure.

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

**Parameter Description**
**· procedure_name**

Specifies the name of the stored procedure to be created.

**· argname**

Specifies the parameter name.

**· argmode**

Specifies the mode of a parameter. Value range: **IN, OUT, INOUT**, and **VARIADIC**. **VARIADIC** specifies parameters of array type. The default value is **IN**.

**· IN**

Specifies an input parameter. The value of the parameter must be specified when the stored procedure is called. If the value of the parameter is changed in the stored procedure, the value cannot be returned.

**· OUT**

Specifies an output parameter. The value can be changed in the stored procedure and can be returned.

**· INOUT**

Specifies input and output parameters. The value can be specified when the stored procedure is called and can be changed and returned.

**· argtype**

Specifies the data type of the parameter.

**· expression**

Sets the default value.

**· IS, AS**

Required for the syntax. One of them must be provided. They have the same function.

**· BRGIN, END**

Required for the syntax.

**· procedure_body**

Specifies the stored procedure content.

**· param_expr**

Specifies the parameter list. Use commas (,) to separate parameters. Use := or => to separate parameter names and parameter values.

**Examples**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kycy8r3xq3zcoo51k920.png)
Triggers
Tags: opengauss
Published: 2023-03-07 06:44:45

A trigger automatically executes functions when an event occurs in a specified database.

**Syntax**
**·** Create a trigger.

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

**·** Modify a trigger.

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

**·** Delete a trigger.

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

**Parameter Description**
**· trigger_name**

Specifies the trigger name.

**· BEFORE**

Specifies that a trigger function is executed before the trigger event.

**· AFTER**

Specifies that a trigger function is executed after the trigger event.

**· INSTEAD OF**

Specifies that a trigger function directly replaces the trigger event.

**· event**

Specifies the event that will fire the trigger. Values are **INSERT**, **UPDATE**, **DELETE**, and **TRUNCATE**. Multiple events can be specified using **OR**.

**· table_name**

Specifies the name of the table corresponding to the trigger.

**· FOR EACH ROW | FOR EACH STATEMENT**

Specifies the frequency of firing the trigger.

**· FOR EACH ROW** indicates that the trigger should be fired once for every row affected by the trigger event.
**· FOR EACH STATEMENT** indicates that the trigger should be fired just once per SQL statement.
If neither is specified, the default value is **FOR EACH STATEMENT**. Constraint triggers can only be marked as **FOR EACH ROW**.

**· function_name**

Specifies a user-defined function, which must be declared as taking no parameters and returning data of trigger type. This function is executed when a trigger fires.

**· arguments**

Specifies an optional comma-separated list of parameters to be provided for the function when the trigger is executed.

**· new_trigger_name**

Specifies the new trigger name.

**Examples**

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

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/htt250v16je6kvvrlb3w.png)
Anonymous Blocks
Tags: opengauss
Published: 2023-03-07 06:38:16

An anonymous block is one of the character blocks of a stored procedure and has no name. It is generally used for scripts or activities that are not executed frequently.

**Syntax**
Figure 1 shows the syntax diagram for an anonymous block.

Figure 1 anonymous_block::=

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

Details about the syntax diagram are as follows:

**·** The execution section of an anonymous block starts with a BEGIN statement, has a break with an END statement, and ends with a semicolon (;). Type a slash (/) and press **Enter** to execute the statement.

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

**·** The declaration section includes the variable definition, type, and cursor definition.

**·** A simplest anonymous block does not execute any commands. At least one statement, even a NULL statement, must be presented in any implementation blocks.

**Parameter Description**
**· DECLARE**

Specifies an optional keyword used to begin a DECLARE statement. This keyword can be used to declare a data type, variable, or cursor. The use of this keyword depends on the context in which the block is located.

**· declaration_statements**

Specifies the declaration of a data type, variable, cursor, exception, or procedure whose scope is limited to the block. Each declaration must be terminated with a semicolon (;).

**· BEGIN**

Specifies the mandatory keyword for introducing an executable section. The section can contain one or more SQL or PL/SQL statements. A BEGIN-END block can contain nested BEGIN-END blocks.

**· execution_statements**

Specifies PL/SQL or SQL statements. Each statement must be terminated with a semicolon (;).

**· END**

Specifies the required keyword for ending a block.

**Examples**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/njfromyg1ua75vue5805.png)
Locks
Tags: opengauss
Published: 2023-03-07 06:34:50

To ensure database data consistency, you can execute the LOCK TABLE statement to prevent other users from modifying tables.

For example, an application needs to ensure that data in a table is not modified during transaction running. For this purpose, table usage can be locked. This prevents data from being concurrently modified.

The LOCK TABLE statement is useless outside a transaction block, because the lock would remain held only to the completion of the statement.

**Syntax**

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

**Parameter Description**
**· name**

Specifies the name of the table to be locked.

**· lock_mode**

Specifies the lock mode. The basic modes are as follows:

**· ACCESS EXCLUSIVE**

Guarantees that the holder is the only transaction accessing the table in any way. It is the default lock mode.

**· ACCESS SHARE**

Indicates the lock mode for reading tables without modifying them.

**Examples**
Obtains an **ACCESS EXCLUSIVE** lock on a table when going to perform a delete operation.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sgk5l112up21vvs7on3d.png)
關於proxmox & pfsense
Published: 2023-03-07 06:23:04

```
無止境的坑
```

    今天在FB瀏覽時，看到有人在問，是否需要擁有一個部落格？這本來就是見仁見智，而我看的重點並不是需不需要，而是有個傢伙提供了一個網址https://dev.te；於是上網搜尋了一下相關資料，有人解釋說，這是一個技術性質的部落格，就類似https://medium.com/這種網站。

    基本上，這幾年來資訊科技的發達，有關網路這方面的技術發展速度實在太快，有很多新的知識與技術在還沒有搞懂的狀況之下，就會有新的技術不斷地冒出來，若不是因為剛好有需求，我想，自己根本就是被蒙在鼓裡。

    這幾天因為問了大陸分公司的MIS人員，他們的防火牆是用什麼方式處理？對方也只回答一個英文字：pfsense！於是，我就掉入了這一個坑。

    我也知道防火牆不外乎就是有軟體防火牆與硬體防火牆這兩種，而市面上知名的硬體防火牆廠商，不外乎就是FortiNet與Sophos，剛好這兩種牌子的防火牆我都曾經用過，當然也不是我花錢買的，而是任職的單位所採購的，都是萬元起跳！個體戶怎麼可能會花錢買這種東西！對於凡事都會想辦法利用最省錢的方式來處理的我，當然也不可能去採買一台硬體防火牆來玩，於是，只好把心思花在不用錢的軟體防火牆，剛好大陸分公司的人說了這一套pfsense，於是就趕緊著手研究。

    上網搜尋了一下下，對！就只是搜尋了一下下而已，我又發現，怎麼又有另外一個系統的名字不斷的出現，那就是...proxmox VE！！再繼續的探勘下去，原來，proxmox VE是一套基於Debian基礎所開發出來的虛擬機平台，對比過去的我，在網路上所找到有關虛擬機平台的資訊，老早都被Oracle VirtualBox與VMware所淹沒了，殊不知Linux陣營還有這個系統平台在發展。

    目前網路上面所找到的相關資訊，都是把pfsense這個開源的軟體防火牆給架設在proxmox VE這個虛擬機上面，而pfsense是基於FreeBSD所開發出來的，而proxmox VE是基於Debian，兩者本來就來自於Linux，所以，相容性基本上就不是問題，也更勝於那些Windows Base。
__init__ and __call__ in Python - How they differ and what do they do?
Tags: python, functions, oop
Published: 2023-03-07 06:31:08

You may have encountered the methods in Python that are prefixed and suffixed with double underscores, those methods are called **"Dunder Methods"**. These methods are also called **"magic methods"**.

Dunder methods are used to overload specific methods in order to make their behaviour unique to that class.

Python has a rich collection of built-in dunder methods and a few are listed below:

**_____init_____**

**_____call_____**

**_____repr_____**

**_____str_____**

**_____len_____**

and more...

In this article, we will look at two dunder methods(_____init_____ and _____call_____) that are commonly used in Python classes. How do they differ, and when do we need to use them within the Python program?

**This article was originally published on [GeekPython](https://geekpython.in/) and you can access it by clicking on the link below.**

{% embed https://geekpython.in/init-and-call-method %}