teleren/devto huggingface dataset:
Install extensions from PGDG repo to YugabyteDB in Alma8
Published: 2023-05-16 11:43:28

In the [previous post](https://dev.to/yugabyte/install-extensions-from-pgdg-repo-to-yugabytedb-example-with-sequentialuuids-1dio), I installed the `sequential_uuids` on Centos. Here are shorter instructions, updated to run on Alma8.


I start a quick lab for the demo:
```sh
docker run -it --rm yugabytedb/yugabyte sleep infinity

cat /etc/system-release

/home/yugabyte/bin/yugabyted start --listen 0.0.0.0
until /home/yugabyte/postgres/bin/pg_isready ; do sleep 1 ; done | uniq

```


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

The packages available for YugabyteDB are in the [repo](https://yum.postgresql.org/packages/#pg11) for your OS, architecture and the PostgreSQL version YugabyteDB is compatible with.

The following downloads the extension RPM and installs it:

```sh

-- I put the name of the extension in $e and the package name for PostgreSQL 11 will be ${e}_11
e=sequential_uuids

-- the RPM will be downloaded to a temporary directory
cd /var/tmp
-- install the PGDG repo for EL8
dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm

-- install the extension 
dnf install --downloadonly -y --downloaddir=$PWD --repo pgdg11 ${e}_11
-- extract the files to the extension directory (see previous post)
mkdir -p ./usr ; ln -Ts $YB_HOME/postgres ./usr/pgsql-11 ; rpm2cpio ./${e}_11-*.rpm | cpio -idmv --no-absolute-filenames
-- test the CREATE EXTENSION
ysqlsh -ec "create extension ${e} cascade"

```


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

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


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


That's all. I recommend doing this in a lab, like the docker container here, to see if any dependency is missing or if there are any incompatibility with YugabyteDB.

If you have a multi-node cluster, you should install the same `$YB_HOME/postgres` in all nodes.

I have tested this procedure with the following extensions:

- [sequential_uuids](https://github.com/tvondra/sequential-uuids) that generates Sequential UUID
- [TopN](https://github.com/citusdata/postgresql-topn/) that returns the top values in a database according to some criteria.
- [timestamp9](https://github.com/fvannee/timestamp9) a nanosecond precision timestamp
- [tdigest](https://github.com/tvondra/tdigest) a data structure for on-line accumulation of rank-based statistics such as quantiles and trimmed means
The (Tailwind) Purge
Tags: webdev, devjournal, tailwindcss
Published: 2023-05-16 11:37:28

---
title: The (Tailwind) Purge
published: true
description: It's magic, magic baby
tags: webdev, devjournal, tailwind
series: Pain points
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-05-16 11:02 +0000
---

This is the first in a series[^1] of things I've banged my head over in daily agency work, as a full-stack body, or tbh whatever I'm employed as at the time. In agencies you tend to get sold to clients as everything from Software Architect to UX designer to DB admin depending on who's paying.

And anyone here who's ever had a conversation with me about, I don't know, chimneys or breakfast cereal or whatever, will know how I feel about Tailwind.

So say I have two pages, one of which (I'll call it "About") includes something like this:

```html
<div class="grid grid-cols-5">
  <div class="col-span-5 lg:col-span-3">
```

and the other (I'll call it, uh, "Babout") has this:

```html
<div class="grid grid-cols-5">
  <div class={`col-span-${data.image ? 5 : 3}`}>
```

The idea being that if my Babout page has an image, then that column should take up the full width, otherwise it should take up less space to make room for the upcoming cat picture. Seems fine to me. Works.

And if I unpublish the About page, the Babout page stops styling its grid _at all_.

Why's that? Well, it's because Tailwind _purges_ its CSS rules so you don't download every possible permutation of things like `lg:p:mx-5`. If you generated all of them there'd be more rules than grains of salt on a fish supper. That's because utility-class frameworks are a _really bad idea_, but I digress.

Why does purging the CSS break the poor Babout page? Because the purge is done by _scraping the source files_ for all possible rule matches. That means that if you have a blog page talking about your shiny new Mazda MX-5, hey, now Tailwind includes the `mx-5` rule regardless of whether you use it. Neato.

Other frameworks scrape the source, too, for things like annotations in comments (Symfony, anyone?). Those are also _really bad ideas_, and I'm sorry but I can't stop this digression.

More importantly, it means that because it can't find `col-span-3` or `col-span-5` in the source any more, it doesn't bother with them, and the page breaks.

The solutions are simple when you know them:

1. use `${data.image ? 'col-span-5' : 'col-span-3'}` instead
2. add `col-span-3` and `col-span-5` to tailwind's "safelist"

But they're not simple when you don't know them.

Yes, this is touched on in the Tailwind documentation, but it's buried under the sand.

It's magic, magic baby. Front-end frameworks are especially fond of magic, and users will always get tripped-up by this sort of thing. I was, and it took an hour or more of digging and trying things out for me to figure what was going on.

[^1]: Maybe. I don't have a great record for sticking to resolutions.
Resolve your routes
Tags: flutter, dart, mobile, codenewbie
Published: 2023-05-16 11:29:56


There are times when we want to work with a login feature and need to create different routes based on the user's status, redirecting them to the registration page or even identifying a user with a bonus. In these cases, we often place the code directly on the page and send the user to the appropriate route based on their state or status.

```
class AuthState {
  final bool isAuthenticated;

  AuthState(this.isAuthenticated);
}

void main() {
  final authState = AuthState(isAuthenticated: false);

  String initialRoute;
  if (authState.isAuthenticated) {
    initialRoute = '/home';
  } else {
    initialRoute = '/login';
  }

  runApp(MyApp(initialRoute: initialRoute));
}

```

However, this is not always the best solution because, depending on the number of routes, the logic in the view can become extensive and unwieldy if there is no standard or pattern in place. With this in mind, we can consider a solution to the problem, something that allows for unit testing if necessary.

We will create a simple abstraction using generic types, where we will have a method that returns the route string. The method's return can be an enum of routes or something similar, as long as we have control over it.

```
abstract class RouteResolver<T> {
  String resolveRoute(T states);
}
```
With our abstraction created, let's now implement our Resolver by module. This way, we separate the logic from the view, allowing us to inject our resolver as a dependency or, for simpler cases, instantiate it on the page where we need to use it.

```
class AuthState {
  bool isAuthenticated;

  AuthState(this.isAuthenticated);
}

class AuthRouteResolver implements RouteResolver<AuthState> {
  @override
  String resolveRoute(AuthState states) {
    if (states.isAuthenticated) {
      return '/home';
    } else {
      return '/login';
    }
  }
}
```

Instantiating our route resolver.

```
void main() {
  final authState = AuthState(isAuthenticated: true);

  final routeResolver = AuthRouteResolver();
  final initialRoute = routeResolver.resolveRoute(authState);

  runApp(MyApp(initialRoute: initialRoute));
}
```

I believe this is a simple solution to a common problem. Of course, there are other ways to work with routes. In this particular case, we are working based on a state, status, or even a class type, hence the importance of using generic types. To better understand the topic discussed here, I recommend reading about clean architecture, clean code, and code refactoring.
How to Build A Revenue-Generating NFT Marketplace By using OpenSea Clone Script
Tags: webdev, cryptocurrency, opensea, blockchain
Published: 2023-05-16 11:10:18

The world of non-fungible tokens (NFTs) has burst in demand, capturing the attention of artists, collectors, investors, etc. As NFTs make entrepreneurs and startups take a step into the productive crypto market. The powerful solution is to launch your own NFT marketplace by using the Opensea clone script. In this blog post, we will traverse how you build a revenue-generating NFT marketplace with [Opensea clone script](https://www.hivelance.com/opensea-clone-script). 



What is Opensea clone script? 

Opensea clone script is the world's top NFT Marketplace and a ready-made solution having the same features and functionalities as Opensea. It is generally built on the Ethereum blockchain network, which allows users to trade, collect, and sell cryptos and NFT assets such as music, sports, arts, cards, and collectibles. 

Techniques to generate revenue with Opensea clone script:
Transaction fees are a common and forthright revenue generation technique. Charging a small percentage of transaction fee for users while trading, buying, and selling in your own NFT Marketplace. A transaction fee is a reliable formula for generating revenue.
Another revenue stream is the Listing fee. Artists and designers who want to list their NFTs on your marketplace charge a fee for every piece item they upload.
Contributing premium features and subscriptions makes additional revenue. By providing better tools, analytics, or advertising options allowing artists and collectors to choose a premium membership.
Auctions and bidding may create interest and business competitiveness among users, promoting the value of NFTs and your revenue possibilities. You can make money by charging just a small charge for each bid or a portion of the ultimate sale price. 
Investigate partnerships and collaborations with artists, businesses, or other types of media that produce profitable money. Collaborating with well-known artists to create exclusive collections on your marketplace can enhance user engagement and income through greater transaction volume. 
Why Hivelance for Opensea clone script? 

Hivelance is the leading NFT Marketplace development company that offers ultimate solutions for creating your own NFT Marketplace like Opensea. We have 10+ years of experience in blockchain development ready to provide you with the best [Opensea clone script](https://www.hivelance.com/opensea-clone-script). Finally, the growth of the NFT Marketplace surely attracts more people. Because of its cohesive performance, the rise of NFT is continuously increasing and remodeling every field. We have skilled experts who can develop your Opensea clone script within the required timeframe by adding all features and functionalities as per your demands. Collaborate with us to bring out superficial outcomes.
PostgreSQL Query Processing
Tags: apacheage, postgresq, aged, database
Published: 2023-05-16 11:01:21

In PostgreSQL, the parallel query uses multiple background worker processes. A backend process basically handles all queries issued by the connected client. This backend consists of five subsystems, as shown below:

![Query image processing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/co1gqtk24tss3cb966d8.png)

##`1. Parser:`
The parser generates a parse tree from an SQL statement in plain text.

##`2. Analyzer:`
The analyzer/analyser carries out a semantic analysis of a parse tree and generates a query tree.

##`3. Rewriter:`
The rewriter transforms a query tree using the rules stored in the rule system if such rules exist.

##`4. Planner:`
The planner generates the plan tree that can most effectively be executed from the query tree.

##`5. Executor:`
The executor executes the query via accessing the tables and indexes in the order that was created by the plan tree.

## `✔️ References:`

1. https://age.apache.org/ 
2. https://github.com/apache/age
3. https://www.interdb.jp/pg/index.html
GPS Speed Measurement: Accurately Tracking Movement in Various Fields
Tags: gps, beginners
Published: 2023-05-16 10:59:09

Global Positioning System (GPS) technology has revolutionized the way we navigate and travel. One of the key features of GPS is its ability to accurately measure speed. In this article, we will explore how [GPS speed measurement](https://gpsspeedometeronline.com/) works and its applications in various fields.

GPS speed measurement relies on the accurate determination of the position of the GPS receiver over time. This is achieved by measuring the time it takes for signals from multiple GPS satellites to reach the receiver. By comparing the time differences between these signals, the GPS receiver can calculate its position with high accuracy. Once the receiver has determined its position, it can calculate the speed by measuring the change in position over time.

There are two types of GPS speed measurements: ground speed and airspeed. Ground speed is the speed at which an object is moving relative to the surface of the Earth. Airspeed, on the other hand, is the speed at which an aircraft is moving through the air. Both ground speed and airspeed measurements are useful in different fields.

GPS speed measurement is widely used in the aviation industry to determine airspeed. In aircraft, airspeed is crucial for maintaining safe and efficient flight. GPS speed measurement provides a reliable and accurate alternative to traditional airspeed indicators, which can be affected by factors such as altitude and air pressure.

In the automotive industry, GPS speed measurement is used in navigation systems and in-vehicle telematics systems. Navigation systems use GPS to provide real-time speed and location information to drivers. In-vehicle telematics systems use GPS to track the movement of vehicles, which is useful for fleet management, route planning, and driver behavior monitoring.

GPS speed measurement is also used in sports and fitness applications. GPS-enabled fitness trackers and sports watches can provide accurate speed and distance measurements, which is useful for tracking workouts and monitoring progress.

Despite its many applications, GPS speed measurement has some limitations. In areas with poor GPS signal reception, such as urban canyons and dense forests, GPS speed measurement may not be reliable. In addition, GPS speed measurement is not as precise as other methods, such as radar guns, which are commonly used for measuring the speed of vehicles on highways.

In conclusion, GPS speed measurement is a reliable and accurate method for measuring speed in a variety of applications, from aviation and automotive to sports and fitness. Its ability to determine speed based on position data makes it a versatile tool for tracking movement and providing real-time information to users. While it has some limitations, GPS speed measurement has become an essential technology in many fields, and its importance is only likely to increase in the future.
How to Choose the Best ICO Crowdsale Script for Your Project?
Tags: programming, discuss, webdev, typescript
Published: 2023-05-16 10:49:01


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


Are you ready to launch your own ICO, but aren't sure which crowdsale script to choose? Your search will end here! From understanding the features and functionalities of different ICO crowd sale scripts to fixing your budget and your project's needs, I’ll guide you.

In an initial coin offering (ICO), newly created tokens are issued for sale. These digital tokens are used for fundraising in a hassle-free manner. Many startups choose an ICO for raising funds as it is decentralized. Generally, launching an ICO platform is an easy and simple process when you use a pre-designed ICO crowd sale script. 

ICO crowd sale script is pre-made software that enables you quickly create your own ICO website.The main advantage of the ICO script is that you can customize some features based on your business needs. 

When choosing an ICO crowdsale script for your project, there are several factors to consider:

**Security:** The most important factor to consider is the security of the script. Ensure that the script is free from vulnerabilities and has been tested for security.

**Functionality:** The script should have all the necessary features to run a successful ICO, such as the ability to create and distribute tokens, manage contributors, and generate reports.

**Customizability:** The script should be customizable to fit your specific requirements. This includes the ability to customize the user interface and the token parameters.

**Scalability:** The script should be scalable to handle large volumes of transactions and contributors.

**Reputation:** Choose a script from a reputable provider with a proven track record in developing successful ICOs.
Support: Ensure the provider offers ongoing support and maintenance for the script.

**Cost:** Compare the cost of different script providers and choose the one that offers the best value for money.

In summary, when choosing an ICO crowdsale script, prioritize security, functionality, customizability, and cost. By carefully evaluating each of these factors, you can choose the Best [**ICO Crowdsale Script**](https://bit.ly/3BtZfHH) for your project and maximize your chances of success. So, Launch your own ICO dashboard from the top ICO script provider.
Increasing Firebase Project Limit
Tags: firebase
Published: 2023-05-16 10:42:21

Firebase এ নির্দিষ্ট সংখ্যক কিছু প্রোজেক্ট একটা gmail account থেকে create করার পর হয়ত firebase আপনাকে নতুন project create করার permission দিচ্ছে না। সেক্ষেত্রে আপনার কি কি করনীয় হতে পারে?

1. আগের create করা কোনও একটা প্রোজেক্ট এর configuration গুলো অন্য প্রোজেক্ট এ ব্যবহার করে আপনার practise এর কাজ চালাতে থাকুন।

2. চাইলে অন্য একটা gmail দিয়ে আবার নতুন firebase account করুন। তবে তখন ও কিন্তু ৯+- টা প্রোজেক্ট ই তৈরি করতে পারবেন। তারপর একই সমস্যা আবার হবে।

তাই আপনি তাদের কাছ থেকে চাইলে ৫০ তার মত প্রোজেক্ট তৈরি করার permission আপনি নিয়ে নিতে পারেন। [ নিচের ৪ টা ছবিতে step by step details দেখান হল। ]

তবে তাদের কাছে এই request করার পর আপনার ধৈর্য নিয়ে minimum 10 min থেকে maximum 2/3 days অপেক্ষা করতে হবে permission পাবার জন্য। এই সময়ের মধ্যে google cloud platform আপনাকে একটা email করে আপনি নতুন প্রোজেক্ট তৈরি করার permission পেয়েছেন কিনা সেটা confirm করে দিবে। 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0b9r0ms4in8h02o8sk0b.jpg)

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

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/61gu8dezkhf8n4ahxytx.jpg)

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

~ Happy Coding!
Digital payment Solution to check fraud
Published: 2023-05-16 10:37:34

Implementing effective strategies to mitigate fraud in digital payment solutions is crucial. Consider the following measures:

Multi-factor authentication (MFA) adds an extra layer of security by requiring users to provide multiple forms of identification. This could include something the user knows (password), something they have (smartphone or token), or something they are (biometric data).

Utilize advanced fraud detection systems that can analyze transaction patterns and identify any suspicious or unusual activity in real time. Real-time transaction monitoring allows for immediate intervention or blocking of potentially fraudulent transactions.

Implement tokenization and encryption to protect sensitive payment data. Tokenization replaces actual payment data with unique identification symbols (tokens), ensuring that sensitive information is not stored or transmitted during transactions. Encryption should also be employed to protect data transmission between users and payment systems.

Adhere to Strong Customer Authentication (SCA) standards, requiring customers to provide multiple forms of authentication for certain high-risk transactions. Two-factor authentication (2FA) or biometric authentication, such as fingerprint or facial recognition, can be used.

Regularly update software and systems with the latest security patches to address vulnerabilities. Maintain firewalls, antivirus software, and intrusion detection systems to ensure a secure environment.

Implement machine learning algorithms to analyze historical transaction data and identify patterns and anomalies associated with fraudulent activity. These algorithms can continuously learn and adapt to new fraud trends.

Educate customers about common fraud techniques and best practices for protecting their digital payment information. Encourage them to regularly review their transaction history and report any suspicious activity immediately.

Utilize strong encryption protocols, such as Secure Sockets Layer (SSL) or Transport Layer Security (TLS), to protect data transmission over the internet. This ensures that sensitive information remains encrypted and secure during transit.

Conduct regular security audits and assessments to identify vulnerabilities in the payment system and take appropriate measures to address them promptly.

Collaborate with industry organizations, financial institutions, and payment processors to share information and best practices for fraud prevention. Sharing knowledge and experiences can help identify emerging threats and develop effective countermeasures.

Implementing a combination of these measures can significantly reduce the risk of fraud and create a more secure digital payment solution. Remember that no system is completely immune to fraud, but with proper precautions, the risk can be greatly minimized.

See: [pay by text message](https://invoicecloud.net/blog/)