teleren/devto huggingface dataset:
MariaDB Quick-tip #2 - Randomize rows
Tags: mysql, sql, mariadb
Published: 2022-06-28 03:20:02

# MariaDB tips and tricks
This is part of a series of quick tips and tricks I have accumulated over the year, that I think can be useful for others.
If you have similar short tips and tricks please leave a comment.

## Randomize rows
Sometimes you want the returned rows of your query to be randomized. That could be when generating test data.
The trick is to use ORDER BY RAND(). The RAND() function will generate a new random number between 0 and 1 for each row and when sorted the rows will be randomized.
This is not something you should put into your production code unless you have no other way of randomizing you rows, because MariaDB has no way of optimizing this kind of query so if the trick is used on a large table it will take time and computing resources. 
This approach to randomize the rows of your query is only slightly different from how you would achieve the same result on the [SQL Server](https://dev.to/coderallan/sql-quick-tip-2-randomize-rows-487)

```sql
CREATE OR REPLACE TEMPORARY TABLE names (Name VARCHAR(50));

INSERT INTO names (Name) 
VALUES ('Joe'), ('Bob'), ('Anne'), ('Jane');

SELECT Name
  FROM names
 ORDER BY RAND() -- Ordering by RAND() will randomized the rows
```

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l1mzj89cay9ws58101fi.png)
How to mint dynamic NFTs using API3's Quantum Random Number Generator
Tags: blockchain, web3, nft, community
Published: 2022-06-28 03:12:33


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

API3 QRNG is the first-party Quantum Random Number Generator served as a public utility courtesy of the Australia National University’s Quantum Optics division. Delivered onto 13 blockchain protocols, API3 is running a series of workshops focused on API3 QRNG.

This upcoming event is a demonstration of how to use the data feed within a dynamic NFT mint.

Link to the Workshop:
https://discord.com/events/758003776174030948/989074911362433044
Discord: https://discord.com/invite/qnRrcfnm5W
How to use constraints, indexes and triggers in SQL
Tags: sql
Published: 2022-06-28 02:25:49

This article introduces several data processing features covered by SQL: constraints, indexes, and triggers. Constraints are an important part of enforcing referential integrity, indexes can improve data retrieval performance, and triggers can be used to perform pre- and post-run processing.

Link to the original article: https://www.developerastrid.com/en/sql/sql-constraints-indexes-triggers/
What is SQL Cursor, how to create and use SQL Cursor
Tags: sql
Published: 2022-06-28 02:24:58

This article describes what SQL cursors are, why they are used, and how to use them. The DBMS you use may provide some form of cursors, as well as features not mentioned here. See the specific DBMS documentation for more details.

Link to the original article: https://www.developerastrid.com/en/sql/sql-cursor/
How to use SQL COMMIT and SQL ROLLBACK statements to manage transactions
Tags: sql
Published: 2022-06-28 02:24:25

This article introduces what SQL transaction processing is and how to use COMMIT and ROLLBACK statements to clearly manage when to write data and when to undo; you also learn how to use hold points to better control fallback operations.

Link to the original article: https://www.developerastrid.com/en/sql/sql-transaction/
How to use SQL views to simplify data processing
Tags: sql
Published: 2022-06-28 02:23:15

This article describes what SQL views are, how they work, and when to use them. Views provide a level of encapsulation of SELECT statements that can be used to simplify data processing, reformatting or protecting the underlying data.

Link to the original article: https://www.developerastrid.com/en/sql/sql-view/
How I broke SonyLIV's Premium feature
Tags: security, webdev, cybersecurity, programming
Published: 2022-06-28 01:46:49

I've been planning to do a write-up about the time I found a high-level security vulnerability in SonyLIV, for quite some time now. Although this happened a couple of years ago, I feel it's still a cool vulnerability to talk about. 

[SonyLIV](https://sonyliv.com) for the uninitiated is a streaming platform where you can watch live sports, movies, and tv shows. I would mainly use it for streaming live football matches, especially the UEFA Champions League. Recently they had made a few changes and introduced premium subscriptions, but as a normal user, you were given a 2-minute trial while watching premium content. 

So here I am waiting for my favourite team's (Man Utd) match to start which was still half an hour away. As a web developer, I was curious to see how the premium feature was implemented and started poking around in the hope that I would find something interesting. I immediately ran Burp Suite and began intercepting requests to understand the flow of the app. After a few minutes, while checking how the cookies were set, I noticed something interesting in local storage.


![Untitled.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1643459789979/xsiQz2No7.png)


The default value was set to 120, meaning 2 minutes. I modified it to 9999 (~ 166 mins). To my surprise, it didn't work. After a few minutes of tinkering I realized, it only works if we modify the value before the video gets loaded. 


![InkedScreenshot 2022-01-29 181848_LI.jpg](https://cdn.hashnode.com/res/hashnode/image/upload/v1643465909795/-06VXME5S.jpeg)



I increased the time limit for the Man Utd match and watched it for free!

 
The next morning I made a POC and sent it to Sony. After a few days, Sony's security team acknowledged the bug and fixed the vulnerability.


![Screenshot 2022-01-29 183816.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1643461718722/QC2M9Wm_R.png)



![Screenshot 2022-01-29 183828.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1643461791219/F6uXHeEmU.png)


My main takeaway from this experience is that we grossly overestimate how difficult security vulnerabilities are to find and perform. In most cases, the more severe the issue, the simpler it is to reproduce!


### Thank You For Reading 👍

Check out my other articles or get to know me at [vinaybomma.github.io](https://vinaybomma.github.io)
How to use SQL UNION operator to combine multiple SELECT statements into one result set
Tags: sql
Published: 2022-06-28 01:44:45

This article describes how to use the SQL UNION operator to combine multiple SELECT statements into one result set. Using UNION can greatly simplify the complex WHERE clause and simplify retrieving data from multiple tables.

Link to the original article: https://www.developerastrid.com/en/sql/sql-union/
How to use SQL INNER JOIN to join two or more tables
Tags: sql
Published: 2022-06-28 01:43:27

This article introduces what SQL INNER JOIN joins are, why they are used, and how to write SELECT statements that use joins. It also describes some of the basics of relational database design, including the most common type of join, the equivalence join (also called an inner join).

Link to the original article: https://www.developerastrid.com/en/sql/sql-inner-join/
How to use SQL GROUP BY to group and sort data
Tags: sql
Published: 2022-06-28 01:41:35

This article describes how to use the SQL GROUP BY clause to group data in order to aggregate a subset of the table contents. This involves two new SELECT statement clauses: the GROUP BY clause and the HAVING clause.

Link to the original article: https://www.developerastrid.com/en/sql/sql-grouping-data/
How to use AVG, COUNT, MAX, MIN and SUM to aggregate data in SQL
Tags: sql
Published: 2022-06-28 01:40:49

This article describes what SQL’s aggregate functions are and how to use them to aggregate data from tables. These functions are very efficient, and they generally return results much faster than you can calculate in your own client applications.

Link to the original article: https://www.developerastrid.com/en/sql/sql-summarizing-data/
What are SQL calculated fields and how to create and use SQL calculated fields
Tags: sql
Published: 2022-06-28 01:38:52

This article describes what computed fields are, how to create them, and we use examples to illustrate their use in string splicing and arithmetic calculations. And how to refer to them from the application using aliases.

Link to the original article: https://www.developerastrid.com/en/sql/sql-calculated-fields/
Beginner To Advanced Challenge. Over 80+ web applications
Tags: beginners, tutorial, 100daysofcode, beginner2advanced
Published: 2022-06-28 01:16:28

I decided to challenge myself to create over 80 apps listed in this [repository](https://github.com/florinpop17/app-ideas) created by [Florin Pop](https://www.florin-pop.com/) and also write articles on how I implemented them using Typescript as the core programming language and any other framework, tools or language I may use in the course of doing this challenge.

## Why I decided to do this challenge

- To improve my coding skill by challenging myself. 📈
- To be able to experiment with new technology. 🔬
- To have a lot of portfolios to impress my employers/clients. 💼
- To be able to write interesting blogs you can read and learn from them. ✍🏽
- To inspire more people to take up this challenge. 💡

## The Repository Setup

I created a single repository for all the apps.
There’s nothing more complex about the repository for a start than just different folders for each project and a `tsconfig.json` file for each project.

```
| - app-ideas/
	| - node_modules/
	| - beginners/
		| - binary-to-decimal/
			| - ...
	| - intermediate/
	| - advanced/
	| - package.json
	| - tsconfig.base.json
```

Over time, I feel the repository will advance to make use of the advantages of a [monorepo](https://monorepo.tools/).

## How to Join the Challenge

This challenge is open to everyone no matter the level to learn, try out different technologies and create a nice portfolio.

I’d be making use of the hashtag `#beginner2advanced` on all social platforms so you can tag along whenever you join this challenge.

**P.S:** I selected this tag, `#beginner2advanced` because I couldn’t think of a fancier name. 🤓

Looking forward to seeing you join, share and contribute to the challenge. 

If you enjoy reading this article, you can consider me [buying me a coffee](https://www.buymeacoffee.com/kayode) to support me.
5 nifty VScode shortcuts I use regularly
Tags: webdev, javascript, vscode, programming
Published: 2022-06-28 01:11:01

In the time that I have used VScode, I have come across some cool shortcuts that have improved my workflow. Here, I have listed a few of them.


- ### Ctrl + D - Find & Replace  

This shortcut is a life saver when you want to change select or all the occurences of a word. It 
selects the word at the cursor, or the next occurence of the selected word. 

![multicursor-word.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1631902994629/l5WqbVvQD.gif)



- ### Ctrl + Shift + Z - Redo 

Many people are aware of the keyboard shortcut for undoing their work, but what about redoing it! This is one of those shortcuts that you don't think you need until you start using it. 



- ### Ctrl + ~ - Open Terminal

This keyboard sequence opens the integrated terminal of VScode. Performing the same sequence again minimizes the terminal. Use *Ctrl + Shift + ~* for opening a new terminal.



- ### Ctrl + Shift + Up Arrow - Duplicate Line

Another simple and handy shortcut for duplicating a line. Use the up arrow to duplicate the above line or vice-versa.


![duplicate_line.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1631904473261/Z9bJYRXDn.gif)



- ### Ctrl + / - Toggle line comment

This shortcut toggles comment for the current line. This works irrespective of the language you are using so you don't need to worry about the comment syntax, VScode handles all that for you.



### Thank You For Reading 👍

Check out my other articles or get to know me at [vinaybomma.github.io](https://vinaybomma.github.io)
VS Code Tip of The Week: Contextual Information on Hover while Debugging
Tags: vscode, debugging, vscodetips
Published: 2022-06-28 00:39:42

I had a busy week last week including a conference so I completely dropped the ball on last week’s tip.

Anyways, this week’s tip of the week is courtesy of Josh Goldberg. When you’re running the debugger and hover over code in the file you’re debugging you will see the value. But what if you want to see language intellisense that you normally see when not debugging? You can press the <kbd>ALT</kbd> (<kbd>Option</kbd> on macOS) while hovering and boom, you have your language intellisense information again.

{% embed https://twitter.com/joshuakgoldberg/status/1541554719033794562 %}

Thanks for the tip Josh!
Redis client-side cache with async Python
Tags: python, tutorial, programming, learntocode
Published: 2022-06-27 23:46:38

---
title: Redis client-side cache with async Python
published: true
description: We can't imagine a modern application that use cache without Redis. It helps you to make cache fast as possible with client-side caching...
tags: python, tutorial, programming, learntocode
# cover_image: https://medium.com/the-pandadoc-tech-blog/redis-client-side-cache-with-async-python-6228a0121a12
# Use a ratio of 100:42 for best results.
---
We can’t imagine a modern application that uses cache without Redis, because Redis is the most powerful and fast storage. It also supports different kinds of data structures and provides everything needed to build effective caching. Here I will highlight one feature that was released with Redis 6.0 and explain how you can use it with async python: client-side caching.

#What is client-side caching?
Imagine that you have an application that uses Redis to store cache values. To get value from Redis you should connect to a server, build command and pack it, send the data to a socket, wait a bit, receive a response, and unpack it. This is fast, but what if you want get data faster?

What if you could have a copy of some values in your application’s memory? This means that when you write to Redis or get values from it you also store the key and the value in memory. However, you need to keep a consistent copy, because typically you will have more than one copy of the application or you can have another application that can change a value in Redis storage. You need a way to know when a value has expired or someone has rewritten it.

Starting from version 6.0 Redis provides a mechanism to make this simple. The application can subscribe for changes and after that receive messages that values have mutated/expired. Two different strategies are available. You can...

Learn more: https://medium.com/the-pandadoc-tech-blog/redis-client-side-cache-with-async-python-6228a0121a12
PandaDoc R&D from the Inside: How We Work
Tags: scrum, agile, product, management
Published: 2022-06-27 23:43:43

---
title: PandaDoc R&D from the Inside: How We Work
published: true
description: At PandaDoc we have more than 40 teams working together to deliver our product to market. This article explains our structure, processes, and guidelines. 
tags: scrum, agile, product, management
# cover_image: https://medium.com/the-pandadoc-tech-blog/pandadoc-r-d-from-the-inside-how-we-work-80e62e46c7fb
# Use a ratio of 100:42 for best results.
---
At PandaDoc we have more than 40 teams working together to deliver our product to market. This article explains our structure, processes, and guidelines.

#Teams
A team is a minimum building block of the organization. PandaDoc has three types of teams: feature teams, complex subsystem teams, and functional teams.

#Feature Teams
Most (>90%) of our teams are feature teams (see Figure 1). Feature teams have the following characteristics:

* Long-lived and stable
* 5 to 6 individuals in each team
* cross-functional, with the technical know-how to contribute to any system or component
* deliver end-to-end customer value

Every feature team can deliver a potentially shippable increment alone, or for a complex feature, in concert with another team or teams.

Every feature team has a Scrum Master and an Engineering Manager, both of whom work with 2 to 3 teams.

We grow new teams by training new team members in existing teams until they become proficient. After new team members are sufficiently trained, we form a new team.

Learn more: https://medium.com/the-pandadoc-tech-blog/pandadoc-r-d-from-the-inside-how-we-work-80e62e46c7fb
Finishing gitflow release from Gitlab runners
Tags: gitflow, gitlab, productivity, programming
Published: 2022-06-27 23:39:50

---
title: Finishing gitflow release from Gitlab runners
published: true
description: Gitflow is a great old way to manage project releases, but it requires too much manual work. Here, I will show how to automate this…
tags: gitflow, gitlab, productivity, programming 
# cover_image: https://medium.com/the-pandadoc-tech-blog/finishing-gitflow-release-from-gitlab-runners-5fdc29bc8f53
# Use a ratio of 100:42 for best results.
---

Gitflow is a great old way to manage project releases. It is a Git branching model that involves the use of feature branches and multiple primary branches. By using this model, developers create a feature branch and delay merging it to the primary branch until the feature is complete. Finally, this is really just an abstract idea of a Git workflow. This means it dictates what kind of branches to set up and how to merge them together.

Usually, it leads to too much manual work, therefore it is really great to have this process automated. We are going to use AVH Edition of the git extensions to provide high-level repository operations and a repository hosted in the Gitlab environment.

Continue reading: https://medium.com/the-pandadoc-tech-blog/finishing-gitflow-release-from-gitlab-runners-5fdc29bc8f53
Interesting! Make different image parts clickable with HTML only (codepen preview)
Tags: todayilearned, html, webdev, codepen
Published: 2022-06-27 23:39:13

You can make different parts of an image clickable.

With HTML's `<map>`, you can create image maps which are images with clickable areas. These areas are defined using the `<area>` tag.

## Understanding how image maps work

The image (which would be clickable) is imported using the `<img>` tag, however an attribute, `usemap`, is added to the `<img>` tag with a specific ID which would later be used

### For example

![world map image code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/prco3p9dfxg3b18fr0n4.png) 

```HTML
<img src="worldmap.png" alt="Worldmap" usemap="#worldmap">
```

Using the `<map>` tag, the image is reference using the attribute `name` which would be the ID used in the `usemap` attribute of the `<img>` tag


![map code snippet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9drbwkkoo8ffvd1gujod.png)

```HTML
<map name="worldmap">
```

Now, nested in the `<map>` elements are several `<area>` elements which are used to define the different clickable areas

In the area element we declare:
- `shape`: The shape of the clickable area 
    - `rect` - defines a rectangular region
    - `circle` - defines a circular region
    - `poly` - defines a polygonal region
    - `default` - defines the entire region
- `coords`: The coordinates of the area
- `href`: The link to the target resource after the image is clicked


![area code snippet](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ijkp9uakpwcs2gkm8470.png)

```HTML
<area shape="rect" coords="34,24,270,350" alt="africa" href="https://africa.htm" title="Visit Africa">
```

### Example: Clickable World Map

Taking into account all explained above, this far-from-perfect example demonstrates the use of an HTML image map
 
{% codepen https://codepen.io/babi-b/pen/abYogwX %}

Thank you for reading (and liking :smile:)
God bless data trends
Tags: data
Published: 2022-06-27 23:36:32

---
title: God bless data trends
published: true
description: Discovering and utilizing data trends in software systems
tags: data
---

Visualizing data and modeling the processes are the key concepts for understanding the system you work with. You may have metrics to understand current system health (RPS, resource usage) with the possibility to look through historic data, and they are good at detecting anomalies, but it may be hard to detect trends for the upcoming months or even years.

Understanding the trends would allow you to a closer look at how you are doing, and, what is more important, how you will be doing. Such insights can help you earlier predict load, SLA, required resources, and prepare for rapid growth. It will allow building your system consciously. A deeper understanding provides greater control over it.

In this article, I would like to show you an example of how it is possible to get useful knowledge from the system I have been working with.

Learn more: https://medium.com/the-pandadoc-tech-blog/god-bless-data-trends-b1fa62a31128
Discovering and utilizing data trends in software systems
Tags: coding, tutorial, programming, productivity
Published: 2022-06-27 23:34:20

---
title: Discovering and utilizing data trends in software systems
published: true
description: How it is possible to get useful knowledge from the system I have been working with.
tags: coding, tutorial, programming, productivity
# cover_image: https://medium.com/the-pandadoc-tech-blog/god-bless-data-trends-b1fa62a31128
# Use a ratio of 100:42 for best results.
---

Visualizing data and modeling the processes are the key concepts for understanding the system you work with. You may have metrics to understand current system health (RPS, resource usage) with the possibility to look through historic data, and they are good at detecting anomalies, but it may be hard to detect trends for the upcoming months or even years.

Understanding the trends would allow you to a closer look at how you are doing, and, what is more important, how you will be doing. Such insights can help you earlier predict load, SLA, required resources, and prepare for rapid growth. It will allow building your system consciously. A deeper understanding provides greater control over it.

In this article, I would like to show you an example of how it is possible to get useful knowledge from the system I have been working with.

Learn more: https://medium.com/the-pandadoc-tech-blog/god-bless-data-trends-b1fa62a31128
Day 80: Did I do anything today?
Published: 2022-06-27 23:15:26

Hi!
had it occurred to you that you know you were busy the whole day but you can't pinpoint what you accomplished for the day? that's what's happening to me. I know I was working for the whole day but I can't see direct progress and in this case I think I'm doing a lot of research nowadays as I'm using unfamiliar technologies I have to google everything along the way, it is slow but I think it's great for learning

So day 80 huh? what a journey! I actually took some time and went back to some of the first articles it feels like they were written by another person, I can see how much I have grown from how I used to approach tasks and blockers so this will continue.... I'm now 20 day to reach the 100days milestone let's gooo....

tomorrow I plan to clean my PR including cleaning the codebase, add proper documentation and attack the following task.
that's it for today

signing off....