teleren/devto huggingface dataset:
Create Slides Using Markdowns!
Tags: markdown, marp, tutorial
Published: 2022-12-21 13:05:47

# What is Marp?
Marp (a.k.a Markdown Presentation Ecosystem)  is a new and open-source tool which can be used to easily create PowerPoint like slides using the markdown syntax as well as CSS type attributes.

## Getting Started
There are currently 4 ways you can use Marp:
[Marp for VS Code](https://marketplace.visualstudio.com/items?itemName=marp-team.marp-vscode) 
[Marp as a CLI](https://github.com/marp-team/marp-cli)
[Marp Core tool](https://github.com/marp-team/marp-core)
And a smaller version:
[Marpit Frameword](https://marpit.marp.app/)

## Creating Your First Slide!
Go ahead and create a file with the ``.md`` extension.
Declare a file which uses Marp by writing:
```md
---
marp:true
---

```
In Marp, you create and separate slides by using 3 ``-`` (which is also called as horizontal ruler)
```md
---

# Slide Title

Slide body
etc.
It uses the normal markdown syntax

---
^^ first slide ends here 

# This is the second slide
behaves just like the previous one
---
```


## Themes
As of writing this tutorial, Marp supports 3 CSS themes:
default
gaia
uncover

```md
---
theme: gaia
---
```
There are also the backgroundColor and backgroundImage attributes:

```md
---
backgroundColor: #fff
backgroundImage: url('Some url of image or svg file')
---
```
And much more!

## Plugin-Type System
Because Marp is built on the marpit framework which makes HTML/CSS slide, you can easily create your own plugins!

## Export to other formats
Marp also allows you to export your slides to HTMl/CSS and PowerPoint Presentations.

Anyway, Marp seems like a really fun to tool to experiment with. You might as well give it a try.

## Links
[Marp Official Website](https://marp.app/)
[Marpit Framework Website](https://marpit.marp.app/)
[Marp GitHub](https://github.com/marp-team/marp)
Wednesday Links - Edition 2022-12-21 🎁🎄🎅
Tags: java, jvm, performance, jfr
Published: 2022-12-21 12:53:53

Running and Building Gradle with Different JDKs - Sip of Java (2 min)🔀
https://inside.java/2022/12/12/sip073/

Call for Discussion: New Project: Galahad (2 min)⚔️
https://mail.openjdk.org/pipermail/discuss/2022-December/006164.html

Auto-vectorization: How to get beaten by compiler optimization — Java JIT! (10 min)🥊
https://itnext.io/auto-vectorization-how-to-get-beaten-by-compiler-optimization-java-jit-vector-api-92c72b97fba3

JFR Event Collection (3 min)🧲
https://foojay.io/today/jfr-event-collection/

Using JFR and JMC to root cause a performance bug in JMC caused by a typo in JFR (5 min)🐢
https://richardstartin.github.io/posts/jmc-hanging

Async-profiler - manual by use cases (1 h)📖
https://krzysztofslusarski.github.io/2022/12/12/async-manual.html

Maven, What Are You Waiting For?! (1 m)🐌
https://www.morling.dev/blog/maven-what-are-you-waiting-for/

Java Card I/O framework (4 min)💳
https://blogs.oracle.com/java/post/io-and-trusted-peripherals

Java Usage Keeps Climbing, According to New Survey (2 min)📈
https://thenewstack.io/java-usage-keeps-climbing-according-to-new-survey

How I got rid of YAML in GitHub's CI (10 min)🚮
https://www.javaadvent.com/2022/12/how-i-got-rid-of-yaml-in-githubs-ci.html

An immutable Mastodon handle (3 min)🪨
https://blog.frankel.ch/immutable-mastodon-handle/

What's Not To Like About This Code? An Experiment. (5 min)🫣
https://blog.thecodewhisperer.com/permalink/whats-not-to-like-about-this-code-1

Little Languages Are The Future Of Programming (11 min)🤖
https://chreke.com/little-languages.html
How to make a 3D slider effect with HTML CSS & JavaScript from Scratch
Tags: html, css, javascript, tutorial
Published: 2022-12-21 12:44:19

{% youtube q6qtYca8cOM&t=2301s %}

Hi guys, today we want to show How to make a 3D slider effect with HTML CSS & JavaScript from Scratch
Please, if you love it, support us with Like & Subscribe.🙏🙏❤️❤️

Let's be friends and connect
📩 Subscribe:https://shorturl.at/BCTV8
📷 Instagram: https://www.instagram.com/soudemy/
📱 Behance: https://www.behance.net/soudemy
🐦 Twitter: https://twitter.com/SoudemyAcademy

In the comments, you can say what design you want so that we can prepare the video for you.
Custom hooks in React.js
Published: 2022-12-21 12:42:11

In React, a hook is a function that allows you to "hook into" React features from a function component. There are several built-in hooks provided by React, such as `useState` and `useEffect`.

Custom hooks are a way for you to extract component logic into reusable functions. They allow you to abstract logic that can be shared between multiple components into a single, reusable function.

Here is an example of a custom hook that manages a form input state:

```
import { useState } from 'react';

function useInput(initialValue) {
  const [value, setValue] = useState(initialValue);

  function handleChange(event) {
    setValue(event.target.value);
  }

  return {
    value,
    onChange: handleChange
  };
}

export default useInput;

```

This custom hook can be used in a form component like this:


```
import React from 'react';
import useInput from './useInput';

function Form() {
  const email = useInput('');
  const password = useInput('');

  return (
    <form>
      <input type="email" {...email} />
      <input type="password" {...password} />
      <button type="submit">Submit</button>
    </form>
  );
}

```

The useInput hook manages the state for the email and password inputs, and the `handleChange` function updates the value of the input when the user types in it. The `...email` and `...password` syntax is the object spread operator, which spreads the properties of the `email` and `password` objects as props for the corresponding input elements.
List of coordinates to an image use Canvas Html
Tags: codepen, html, javascript
Published: 2022-12-21 12:34:43


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

{% codepen https://codepen.io/suharyadi2112/pen/bGjNvxW %}
Typescript: Type guards with zod
Tags: typescript, javascript, programming, webdev
Published: 2022-12-21 12:26:28

[In our previous post](https://dev.to/sachitsac/typescript-type-guards-9m1), we discussed how we can use User defined type guards and their advantages. 

In this post, i'd like to show the same concept but with a popular typescript library called [Zod](https://zod.dev/). Zod is a very powerful library that gives runtime safety to applications written in typescript.

Lets start by looking at an example of user guard written in plain typescript.

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

So lets break it down as to what is happening:
- We have a user interface with 3 string properties and 1 boolean.
- We have a type guard that validates if an object passed is a typeof User.
- The type guard is checking each mandatory fields.

So i can already think of few issues with the type guard.

- We could just validate a property against its primitive type, e.g. `typeof obj.email === 'string'` and we can pass any value.
- We can pass any valid string to the uuid but is it really a uuid ?
- Same can be said about the email, we can pass any valid string and it'll satisfy the guard.
- We could also add mandatory properties to the user interface later and completely forget to add them to the type guard.

Now lets rewrite the above but this time using [Zod](https://zod.dev/)

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

[Zod](https://zod.dev/) allows you to write your schemas for objects and its validations in the same place. e.g. uuid and email are defined as

```
uuid: z.string().uuid()
email: z.string().email()
```

Not only is it much cleaner, less code and more useful, it also future proofs the code as we can add more properties to the schema without needing to update the type guard.

Please checkout [Zod](https://zod.dev/) library as to me, it is one of the must have in your codebase if you care about runtime stability and experience of your applications.

Until next time, happy Zoding!

PS: You can find the code in the [Gist here](https://gist.github.com/sachitsac/33caed8e063cfc7fe522c0b4ce9ad5e9)
C++
Tags: programming, cpp
Published: 2022-12-21 12:20:28


> C++
 ko'dalarni o'z ichiga oladi

`replit` yordamida ko'dlarni yozamiz
Masalan;

```cpp
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int eni, boyi;
  cout << "Area is ";
  cin >> eni >> boyi;
  cout << setprecision(2) << fixed << eni * boyi << (".") ;
return 0;
}
```

`#include <iostream>` bu kutubxona .
bu kutubxonada bizga kerakli bo'lgan buyrular mavjud.
Masalan; 


std

`std` shu ko'rinishda ishlatilinadi

```cpp
 std :: cout << "salom do'stlar";
```
`std` buyrug'ini ishlatmasa ham buyruq bersa bo'ladi uning nomi
`using namespace std ;`

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

int main() {

 cout << "Hala Madrid";

  return 0;

}
```

`int main (){} `shu ko'rinishda bo'ladi.
int main- main so'zi "Asosiy funksiya" degani hamma ko'dlarni buni ichiga yozamiz 

```cpp

int main() {

 cout << 4-5 ;

```
`replit ` da hamma so'lar qo'shtirnoq ichida yoziladi.

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

int main() {

 cout << "bugun og'ir kun bo'ldi";

  return 0;

}
```

`data tip nom - qiymat` ya'ni o'zgaruvchilarning turlari
uning ichiga 
`int` ya'ni faqat butun son saqlaydi 

```

int a = 45 ;
 cout << 50 - a ;

  return 0;

}
```
`string` faqat textlar uchun .

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

int main() {


string a = "Abror" ;
 cout << "Salom " << a ;

  return 0;

}
```
`char` faqat bitta belgi saqlash uchun .
`float` faqat kasr sonlar uchun.

@dawroun
22 Programming Lessons Learned in 2022
Tags: programming, career, beginners, codenewbie
Published: 2022-12-21 12:17:21

While on a vacation I got opportunity to reflect on 2022. As a result, I penned down my best programming lessons with *elite* clarity.

These 22 lessons will teach you early what I learned late about programming.

Let's go! :rocket:

1. Programming is not hard. Consistency is.

2. Knowing when to ask for help is an underrated developer skill.

3. Programming is about solving problems. Not learning syntax.

4. Staying away from the computer while planning code helps.

5. You can learn any programming language once you understand programming.

6. Programming is not a ‘rare’ skill anymore. Make efforts to stand out.

7. Be comfortable failing. A lot. Until you figure it out.

8. Open source has made programming a social activity.

9. You can’t write right code with wrong thinking.

10. Whiteboard > Keyboard, when solving a programming problem.

11. You learn less by trying to learn all at once.

12. Improve googling skills. You don’t need to build what you can search for.

13. Failure is cheap in programming. So learn by doing.

14. In programming, you get good by being bad.

15. Learn to temporarily ignore the difficult parts of the problem and approach them later.

16. Don’t stop at working solution. Learn other ways of solving the problem.

17. Failure is feedback in programming. It just tells you what NOT to do. 

18. Pair programming improves coding and communication skills.

19. Don’t expect things to work on the first try. Give it time.

20. Programming is easy when you focus on fundamentals, not hacks.

21. Taking a walk is the most underrated way to debug code.

22. It takes time to learn programming. But it’s worth every effort.

That's it!

I hope you find these lessons helpful.

If you liked this post, follow me for more of these 🙂
C ++ DA RAQAMLARNI BOLISH KOPAYTIRISH VA FOIZINI CHIQARISH!
Tags: beginners, cpp
Published: 2022-12-21 12:08:01

```cpp




#include <iostream>
#include <iomanip>
using namespace std;
int main() {
int N;
 cin >> N;
  cout << "Sun Mon Tue Wed Thu Fri Sat" << endl;
cout << setw (3)<< N;
N=N % 31+1;
cout << setw (4)<< N;
N=N % 31 + 1;
cout << setw (4)<< N;
N =N % 31 + 1;
cout << setw (4)<< N;
N=N % 31 + 1;
cout << setw (4)<< N;
N=N % 31 + 1;
cout << setw (4)<< N;
N=N % 31 + 1;
std::cout << setw (4)<< N;
   return 0;
  }


```
   
biz bugun c++ da sonlarni kopaytirish bolish va foizini chiqarishni organdik.
hop endi c++ dagi aperatorlar maktabda oqitiladigan matematikadagi aperatorlar (+,/,*,-) lar bilan bir hil.
% - byu sonning boluvdagi yo kopaytiruvdagi javobning ortib qolishi.
masalan: 10 % 3 = 1 
KASR SONLAR - yani bu (10) bu notogri kasr!
                      (--)
                       (3)
agar shu kasr sonning teskarisi bolganida bu togri kars bolardi!


@dawrounn
Alternatives for REDIS
Tags: redis, programming, caching, database
Published: 2022-12-21 12:05:39

There are several alternatives to Redis that you can use depending on your specific needs and requirements. Some popular alternatives to Redis include:

- **Apache Cassandra**: A distributed, scalable, and highly available NoSQL database that is designed to handle large amounts of data across multiple servers.
- **Apache HBase**: A distributed, column-oriented database built on top of the Apache Hadoop ecosystem that provides fast, random access to large datasets.
- **MongoDB**: A popular open-source document-oriented database that is designed to be easy to use and scale.
- **CouchDB**: A distributed database that is designed to be simple, scalable, and flexible. It uses a document-oriented data model and supports features such as offline synchronization and conflict resolution.
- **Memcached**: A distributed in-memory caching system that is used to speed up dynamic web applications by reducing the amount of time required to access data from a database or other persistent storage.

Ultimately, the best alternative to Redis will depend on your specific needs and requirements, so it's important to carefully evaluate the different options available to find the one that is best suited for your use case.

{% embed https://youtu.be/R4V_yKf0Qds %}
dbForge Products Won Awards in Q2-Q4 2022
Published: 2022-12-21 12:03:03

---
title: dbForge Products Won Awards in Q2-Q4 2022
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-21 12:01 +0000
---


*Devart has been awarded GetApp Leaders 2022, Software Advice FrontRunners 2022, Crozdesk Awards 2022, and G2 Awards, and got into the Capterra Shortlist 2022.* 

The dbForge Studio product line along with dbForge [SQL Complete](https://www.devart.com/dbforge/sql/sqlcomplete/?utm_source=guest+article&utm_medium=referral&utm_content=dbforge+products+won+awards+in+q2-q4+2022) was shortlisted by Capterra 2022 according to user feedback and monthly search volumes for relevant keywords. All dbForge Studios consistently rank among the top database solutions on Capterra. In particular, dbForge [Studio](https://www.devart.com/dbforge/sql/studio/?utm_source=guest+article&utm_medium=referral&utm_content=dbforge+products+won+awards+in+q2-q4+2022) for SQL Server is ranked in the top 10 free database software and in the top 9 open-source database software.

dbForge Studios have been recognized as the GetApp 2022 Leader in the Database category according to end-users’ ratings. dbForge Studios and SQL Complete also received the FrontRunners 2022 Software Advice Award, which is based on published user feedback on usability and satisfaction.

All four Studios received Crozdesk Awards 2022 — Crozdesk Happiest Users 2022, Crozdesk Trusted Vendor 2022, and Crozdesk Quality Choice 2022. 

In G2 awards, the champion is dbForge Studio for MySQL which received 10 awards. dbForge Studio for Oracle won two awards — High Performer Fall 2022 and Best To Do Business With Fall 2022. SQL Complete was recognized as the High Performer Fall 2022 according to the G2 score.

About Devart

Devart is one of the leading developers of database software that offer the following functionality: 

* advanced tools for database development and administration
* ALM solutions
* data providers for database servers
* solutions for data integration and backup.

The company also implements Web and Mobile development projects.

Learn more about Devart at https://www.devart.com
How To Capture image & sent it to backend (Express) in react js
Tags: react
Published: 2022-12-21 11:51:07

import React, { useState } from 'react';
import Grid from '@material-ui/core/Grid';
import Box from '@material-ui/core/Box';
import { IconButton } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import PhotoCameraRoundedIcon from "@material-ui/icons/PhotoCameraRounded";

const useStyles = makeStyles((theme) => ({

    root: {
        height: "100%",
        textAlign: 'center',
    },
    imgBox: {
        maxWidth: "80%",
        maxHeight: "80%",
        margin: "10px"
    },
    img: {
        height: "inherit",
        maxWidth: "inherit",
    },
    input: {
        display: "none"
    }
}));

function PwaWebcam() {

    const classes = useStyles();

    const [source, setSource] = useState("");

    const handleCapture = (target) => {

        if (target.files) {

            if (target.files.length !== 0) {

                const file = target.files[0];
                const newUrl = URL.createObjectURL(file);
                setSource(newUrl);
            }
        }
    };

    const handleSave = () => {
        const screenCaptureSource = source;
        const downloadLink = document.createElement('a');
        const fileName = 'react-screen-capture.png';

        downloadLink.href = screenCaptureSource;
        downloadLink.download = fileName;
        downloadLink.click();
    };

    return (

        <div className={classes.root}>
            <Grid container>
                <Grid item xs={12}>
                    <h5>Capture your image</h5>

                    {
                        source &&
                        <Box display="flex" justifyContent="center" border={1} className={classes.imgBox}>
                            <img src={source} alt={"snap"} className={classes.img}></img>
                        </Box>
                    }

                    <input
                        accept="image/*"
                        className={classes.input}
                        id="icon-button-file"
                        type="file"
                        capture="environment"
                        onChange={(e) => handleCapture(e.target)}
                    />

                    <label htmlFor="icon-button-file">
                        <IconButton
                            color="primary"
                            aria-label="upload picture"
                            component="span"
                        >
                            <PhotoCameraRoundedIcon fontSize="large" color="primary" />
                        </IconButton>
                    </label>
                    <div>
                        <center>

                            <p>
                                <div><button onClick={handleSave}>Download</button></div>
                                <br /><br />

                            </p>
                        </center>
                    </div>
                </Grid>
            </Grid>
        </div>
    );
}
export default PwaWebcam;
Quick IPFS
Tags: web3, ipfs, blockchain, opensource
Published: 2022-12-21 11:46:59

## Concepts

- IPFS ! = Blockchain
  - Blockchain serves on-chain data
  - IPFS serves off-chain data
  - IPFS provides an option of saving big volume datas for blockchain.
- IPFS ! = Filecoin
  - IPFS focuses on addressing, which means it can find the location the content, but it can't guarantee that content is available.
  - Filecoin which focuses on storage is similar to a decentralized cloud drive.
  - They are complementary.
- Contents on public IPFS are always accessible as long as you can get the addresses.
  - Setting up a private IPFS is possible, but meaningless.
- How to use:
  1. `add` file, a cid will be returned
  1. use the cid to access the file
- Typical scenarios
  - NFT Metadata
  - Off-Chain data

## Content Addressing

- IPFS addresses are derived from file content hashes (CIDs), so they are automatically de-duplicated.
- Two formats:
  - IPFS: `ipfs://<hash>`
  - IPNS: `ipns://<domain>`
- With the help of HTTP Gateways, contents can be shown in browsers, examples:
  - `https://ipfs.io/ipfs/QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco/wiki/`
  - `https://ipfs.io/ipns/ipfs.io/`
- Common HTTP Gateways:
  - https://cloudflare-ipfs.com
  - https://ipfs.io
- [Public HTTP Gateway Checker](https://ipfs.github.io/public-gateway-checker/)
- [HTTP Gateway speed ranking](https://www.reddit.com/r/ipfs/comments/lvwn4o/ipfs_http_gateways_ranked_by_performance/)

## Pinning Services

- "pin" is "save" , happening on one or more nodes.
- Files that not pinned are only in cache and will be removed in future.
- It is impossible to force a third party node to perform a "pin".
- In addition to your own nodes, third party services are also available.
- Typical pinning services:
  - paid
     - infura
     - pinata
     - morails
  - free
     - nft.storage

### References

- [Cloudflare IPFS Gateway](https://developers.cloudflare.com/distributed-web/ipfs-gateway)
- [An Introduction to IPFS](https://blog.infura.io/an-introduction-to-ipfs/)
- [IPFS Official Website](https://docs.ipfs.io/)
- [NFT Storage](https://nft.storage/)
- [Storage: Free Decentralized Storage for NFTs](https://filecoin.io/blog/posts/introducing-nft.storage-free-decentralized-storage-for-nfts/)
- [Pinata Docs](https://docs.pinata.cloud/)
- [Morails IPFS](https://docs.moralis.io/moralis-server/files/ipfs)
- [Infura IPFS Documentation (1.0.0)](https://infura.io/docs/ipfs)
Best SQL IDEs or SQL Writing Tools
Tags: sql
Published: 2022-12-21 11:46:26

Some of the best SQL IDEs (integrated development environments) include:

    SQL Server Management Studio (SSMS): This is a free and powerful IDE developed by Microsoft for working with SQL Server databases. It includes features like syntax highlighting, code completion, and debugging tools, as well as a graphical user interface for managing database objects and data.

    MySQL Workbench: This is a popular and powerful IDE for working with MySQL databases. It includes features like SQL syntax highlighting, code completion, and a visual query builder, as well as support for database design, administration, and migration.

    Oracle SQL Developer: This is a free IDE developed by Oracle for working with Oracle databases. It includes features like SQL syntax highlighting, code completion, and debugging tools, as well as support for database design, administration, and performance optimization.

Read full:
https://thedbadmin.com/best-sql-ides-or-sql-writing-tools/
Docker PostgreSQL Backup
Tags: postgres, backup
Published: 2022-12-21 11:37:13

To perform a backup of a PostgreSQL database running in a Docker container, you can use the pg_dump command to export the database to a SQL script file, and then use the docker cp command to copy the file from the container to your local machine.

For example, assuming that your PostgreSQL container is named “my-Postgres”, you could use the following pg_dump command to export the contents of the “mydb” database to a file named “mydb.sql”:

docker exec my-postgres pg_dump mydb > mydb.sql
This will create a file named “mydb.sql” in the current directory on the host machine, containing the SQL commands needed to recreate the “mydb” database.

read full: https://thedbadmin.com/docker-postgresql-backup
How to Check Running status of PostgreSQL on Windows ?
Tags: postgres
Published: 2022-12-21 11:42:37



To check the status of the PostgreSQL server on a Windows machine, you can use the sc command. This command is used to manage and query the status of system services, including the PostgreSQL server. To check the status of the PostgreSQL server, you can use the following sc command:

sc query postgresql

read full: https://thedbadmin.com/how-to-check-running-status-of-postgresql-on-windows/