teleren/devto huggingface dataset:
Install MariaDB from Source Code on Ubuntu
Tags: ubuntu, mariadb, apacheage, postgres
Published: 2023-02-13 22:29:07

## System Information:

```java
Distributor ID: 	Ubuntu
Description: 		Ubuntu 22.04.1 LTS
Release: 			22.04
Codename: 			jammy
```



## Get the source code

### Fork the repo

```java
git@github.com:AgeDB-Enterprise/maria-server.git
```

Keep the same name "maria-server" for your local repository.

### Let's setup project

Create a directory for the mariaDB Project

```bash
mkdir mariaDB
cd mariaDB
```
Clone your repo to your machine.

```bash
mariaDB $ git@github.com:arun-esh/maria-server.git
```

## Build the Server

### Optional if cMake is not installed

```bash
sudo apt-get install build-essential libncurses5-dev gnutls-dev bison zlib1g-dev ccache libssl-dev -y

# In case, cmake is not installed on the machine. It was the case for me.
# Get cmake
# Downloaded under ~/
wget https://github.com/Kitware/CMake/releases/download/v3.25.2/cmake-3.25.2.tar.gz


tar -xvf cmake-3.25.2.tar.gz

cd cmake-3.25.2
~/cmake-3.25.2 $ ./bootstrap
~/cmake-3.25.2 $  make
~/cmake-3.25.2 $  sudo make install

```

### Configure the build

```bash
mariaDB $ mkdir build-mariadb-server-debug
mariaDB $ cd build-mariadb-server-debug

# configure mariaDB
build-mariadb-server-debug $ cmake ../maria-server -DCMAKE_BUILD_TYPE=Debug
```

## Compile

```bash
build-mariadb-server-debug $ cmake --build . --parallel 5
```



## Starting MariaDB after build 

``` bash
# Create a directory 
mkdir data-dir

# create ~/mariadb.cnf
# The MariaDB server group

[mariadb]
datadir           = ~/mariaDB/data-dir
# path to source dir + sql/share
lc_messages_dir   = source/sql/share



# Now that you have created your own config file you can call it with flag `--defaults-file` while installing the system tables. To install the system tables call following from the build folder:
./scripts/mariadb-install-db --srcdir=../maria-server --defaults-file=~/mariadb.cnf

# Run the DB Server
sql/mariadbd --defaults-file=~/mariadb.cnf

# Run client command line
client/mariadb
```
Day 694 : RIP Plug 2
Tags: hiphop, code, coding, lifelongdev
Published: 2023-02-13 22:16:51

_liner notes_:
- Saturday : Took it pretty easy. Just prepared to do the radio show. I didn't have to drive to the station and just broadcasted from the van. Had a good time! The recording of this week's show is at https://kNOwBETTERHIPHOP.com

![Radio show episode image of a flyer promoting Shinobi Stalin's birthday party with Shinobi sitting in a chair with a crown drawn on his head with the words February 11th 2023 Wubba Wubba](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zh9mzpwcutwdnl9acym6.jpg)

- Sunday : Did the https://untilit.works cyphers and towards the end, got some pretty horrible news that Trugoy the Dove aka Plug 2 aka Dave from De La Soul had passed away. Damn. Didn't even feel real. De La played a large part in my HIPHOP journey

- Professional : I went through a bunch of GitHub repos of Web Components I created and updated dependencies, added a feature that was requested and tested to make sure they still work. Pretty productive day.

- Personal : I got the Proof of Concept for my next project working on my backup Chromebook and started refactoring some stuff out into components and added a store. I think something may have changed from using the CDN version of a library to installing it because I'm getting a weird behavior. I think the CDN version may be checking for something in the local storage that the installed version doesn't. Or it could be the way I'm implementing it. I did find an example that does do the thing that I think was missing, so that could be confirmation. At least, I know that I can make it work.

![Inside at valley in Silverton, CO, United States filled with grass, blue and while flowers, tall trees and large mountains in the distance under gray skies](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c9oeaao0wlz419if6hav.jpg)

Going to get the authentication and authorization working properly in my side project. After that, I'll probably watch the new episodes of "Trigun: Stampede" and "Vinland Saga". Damn.... R.I.P. Plug 2

Have a great night!

peace piece
Dwane / conshus
https://dwane.io / https://HIPHOPandCODE.com
{% youtube gHcmauwjQeI %}
What a dilemma!
Tags: firstpost, projectmanagement, productmanagement, techies
Published: 2023-02-13 22:07:04

Holla readers!

This is my first ever blog. I have been planning to start this a way back from my college. Anyways! it's never too late. What motivated me to write this was a conversation with one of my mentor Neha! A week ago, I had this conversation with Neha about me being confused what field to go for after my post graduate finishes. Based on my course i.e. Management of Business Information Technology, she suggested to research about 3 roles: Product management/product owner, project management, people's management. And since I was from IT background, I can anyhow go for that as well. Apart from all these, there is this role of engineering manager that requires a bit of an experience in IT field and some knowledge of finance and budgeting, sales and accounting as well. I would tell that now a days everything could be learnt online, so my process of researching for all started from youtube videos and reading technical blogs. Applying for the internship roles is the best way to gain a real experience for working in industries. Now the question arises how to do that? The simple and clear answer is LinkedIn. I think your LinkedIn profile is your online resume nowadays. We need to update it so well that it appears to the right person on right time. We need to use proper keywords while searching for the job roles and we never know, the unexpected opportunity steps at our doorstep. From that whole 40 minutes conversation with Neha taught me three lessons:
1) Networking and using LinkedIn efficiently is one of the most requisite skills for every individual.
2) Never leave learner attitude from you.
3) If you want to start doing something, do not wait! Start it from today. If you want to learn guitar, start it from today, if you want to write a blog, go for it, if you want to start investing, start it today. 

PS: Current state of mind: Nervous before hitting the "Publish" button below. But I am sure my readers will like it :)

Adios Amigos!!
How to solve bootstrap datepicker in modal
Tags: datepicker, modal
Published: 2023-02-13 21:57:08

---
title: How to solve bootstrap datepicker in modal
published: true
description: Simply wrap your datepicker code in bootstrap's modal shown event.
tags: 'datepicker, modal'
cover_image: 'https://raw.githubusercontent.com/muath-ye/dev.to-articles/main/posts/assets/BootstrapDatepickerInModal/modal-datetime-picker.png'
canonical_url: 'https://muathye.com/en/articles/add-bootstrap-datepicker-in-modal.html'
---

# How to solve bootstrap datepicker in modal

Simply wrap your datepicker code in bootstrap's modal shown event.

```js
$('#your-modal').on('shown.bs.modal', function() {
  $('.your-date-input').datepicker({});
});
```

::: tip
Here is an full example [Bootstrap DatePicker in Modal](https://codepen.io/muathye/pen/gOjadpa)
:::

```html
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.3.0/js/bootstrap-datepicker.js"></script>

<style>
    /* Optional: has to be larger than 1050 */
    .datepicker {
      z-index: 1600 !important;
    }
    /* Optional: in case your body is less than datapicker height */
    .modal-body {
        height: 200px;
    }
</style>

<div class="well">
  <button type="button" id="add">Add</button>
</div>
<div id="myModal" class="modal">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <h4></h4>
      </div>
      <div class="modal-body">
      </div>
    </div>
  </div>
</div>
```

```javascript
$('#myModal').on('shown.bs.modal', function() {
  $('.input-group.date').datepicker({
    format: "dd/mm/yyyy",
    startDate: "01-01-2015",
    endDate: "01-01-2020",
    todayBtn: "linked",
    autoclose: true,
    todayHighlight: true,
    container: '#myModal modal-body'
  });
});

$("[id=add]").click(function() {
  $("#myModal .modal-header h4").html("Request for Change");
  $("#myModal .modal-body").html('<form class="form-horizontal" role="form"><br /><br /><label class="col-sm-2 control-label">Date Required</label><div class="col-sm-3"><div class="input-group date col-sm-8"><input type="text" class="form-control" id="DateRequired"><span class="input-group-addon"><i class="glyphicon glyphicon-th"></i></span></div></div></form>');
  $("#myModal").modal("show");
});
```
Working with Nodemailer and MailHog
Tags: opensource, typescript, programming, starchart
Published: 2023-02-13 21:46:02

This week developers at Seneca College have been working hard to add more features and functionalities to Starchart. With the release of version 0.2, I got to experiment with MailHog; tool developers used to test sending and receiving emails in a development environment using a fake SMTP server. Another cool thing is you don't need an actual recipient or sender account to use Mailhog. I like Mailhog because you do not have to install it locally. Pulling the Mailhog docker image and building the container will give the developer access to a friendly UI similar to that of Google or Outlook. 


## The Fun Part
The exciting part was sending test emails using the `sendNotifications` I contributed to and having them appear in real-time in the Mailhog UI. 

## The Tough Part
The challenging part was writing unit tests for Nodemailer using Vitest/Jest API. Fetching messages sent to the recipient using the endpoint returns a deeply nested `object`. I had to end up using to `expect` functions such as `arrayContaining` and `objectContaining` in conjunction to ignore fields that were not relevant to the test suite.  

## Up Next
This week I intend on implementing functionality for [sending email notifications when a domain becomes active or errors](https://github.com/DevelopingSpace/starchart/issues/108) using BullMQ workers queues. Also, working with BullMQ may prove challenging, but I want to give it a shot, as I would gain valuable experience. Another goal is to update the Dependabot configuration to [avoid non-LTS node version updates](https://github.com/DevelopingSpace/starchart/issues/199). Also, since I am one of the Sheriffs this week, I intend to be highly available if any problems require prompt attention.
Laravel Nested Eager Loading on Polymorphic Relationships
Tags: laravel, model, polymorphic
Published: 2023-02-13 21:40:53

---
title: Laravel Nested Eager Loading on Polymorphic Relationships
published: true
description: Sometimes you need to eager load different relationships depending on the type of model on a polymorphic relationship.
tags: 'laravel, model, polymorphic'
cover_image: 'https://raw.githubusercontent.com/muath-ye/dev.to-articles/main/posts/assets/LaravelNestedEagerLoadingonPolymorphicRelationships/eager.png'
canonical_url: 'https://muathye.com/en/articles/laravel-nested-eager-loading-on-polymorphic-relationships.html'
id: 1364424
date: '2023-02-13T21:40:53Z'
---

# Laravel Nested Eager Loading on Polymorphic Relationships

Sometimes you need to eager load different relationships depending on the type of model on a polymorphic relationship.

![tip](https://raw.githubusercontent.com/muath-ye/dev.to-articles/main/posts/assets/LaravelNestedEagerLoadingonPolymorphicRelationships/nested-tip.png)

For example: you have two type of users `seller` and `buyer`, the eager load relationship for `seller` is the `product` and the eager load relationship for `buyer` is the `order`.

* First setup the Models.

```php
class Seller extends Model
{
    public function products()
    {
        return $this->hasMany(Product::class);
    }
}
```

```php
class Buyer extends Model
{
    public function orders()
    {
        return $this->hasMany(Order::class);
    }
}
```

```php
class Profile extends Model
{
    public function user()
    {
        return $this->morphTo();
    }
}
```

* Then load the relations like the following:

```php
Profile:with('user', function (MorphTo $morphTo) {
    // Eager load the products for seller.
    // Eager load the orders for buyer 👇
    $morphTo->morphWith([
        Seller::class => ['products'],
        Buyer::class => ['orders'],
    ]);
})->get();
```
Animated Hover Button Using HTML CSS only
Tags: webdev, design, html, css
Published: 2023-02-13 21:19:55


## Button with Amazing Hover Effects

In this blog, we are going to learn **“How to Create a button with hover effects Using HTML & CSS Only.”**

![Created By [Rutik Patel](https://youtu.be/N5racZCWCoY)](https://cdn-images-1.medium.com/max/2560/1*5BTB91DDFsmou08JLdyAow.png)

&nbsp;
## Points to be discussed

* Preview

* YouTube Tutorial

* HTML Code

* CSS Code

* References

&nbsp;

## Preview :

A live demo of the website can be viewed by [clicking here](https://rutikkpatel.github.io/HTML-CSS/Button%20Hover%20Sunglass%20Effect/index.html).

![Screenshot to Demonstrate](https://cdn-images-1.medium.com/max/3840/1*HBw4np5NxFd0nrIM-VgAdQ.png)

---

## YouTube Tutorial :
{% youtube J5lw_kozJGY %}

---

## HTML CODE :

index.html

```html
<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Button Hover Sunglass Effect</title>
  <link rel="stylesheet" href="style.css">
</head>

<body>
  <div class="main">
    <h1>Button Hover Sunglass Effect</h1>
    <button id="btn_1"> Hover Me !!</button>
    <button id="btn_2"> Hover Me !!</button>
    <button id="btn_3"> Hover Me !!</button>
    <button id="btn_4"> Hover Me !!</button>
  </div>
</body>

</html>
```
---

## CSS CODE :

style.css

```css
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.main {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
}

/* Common CSS Code for all buttons */
button {
  background: transparent;
  font-size: 2.5rem;
  padding: 1rem 0.5rem;
  position: relative;
  transition: all 0.5s linear;
}

button::before {
  content: '';
  position: absolute;
  background-color: rgb(245, 86, 86);
  transition: all 0.4s linear;
  z-index: -1;
}

button:hover {
  color: white;
}

/* Code According to effect */
/* btn_1 */
#btn_1::before {
  width: 0%;
  height: 100%;
  top: 0;
  left: 0;
}

#btn_1:hover::before {
  width: 100%;
}

/* btn_2 */
#btn_2::before {
  width: 0%;
  height: 100%;
  top: 0;
  right: 0;
}

#btn_2:hover::before {
  width: 100%;
}

/* btn_3 */
#btn_3::before {
  width: 100%;
  height: 0%;
  top: 0;
  right: 0;
}

#btn_3:hover::before {
  height: 100%;
}

/* btn_4 */
#btn_4::before {
  width: 100%;
  height: 0%;
  bottom: 0;
  right: 0;
}

#btn_4:hover::before {
  height: 100%;
}
```

---

## References :

**GitHub Repository**: [https://github.com/rutikkpatel/HTML-CSS/tree/main/Button%20Hover%20Sunglass%20Effect](https://github.com/rutikkpatel/HTML-CSS/tree/main/Button%20Hover%20Sunglass%20Effect)
Audience or Community?
Tags: community, devrel
Published: 2023-02-13 21:14:58

---
title: Audience or Community? 
published: true
description: If you're looking for a group of people who are simply aware of what you're doing, then an audience may be what you need. But if you're looking for true connection and a sense of belonging, then building a community is the way to go.
tags: community, devrel
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
# published_at: 2023-02-13 18:52 +0000
---

I've been a teacher most of my career. Specifically, I was a college English teacher for ten years. Recently, I've been reflecting on how my experience teaching and writing and telling stories has influenced my understanding of community. One of the biggest discussions-or sometimes arguments-I hear is whether someone wants and audience or a community. I wanted to explain the difference using a story framework. 

As humans, we're built to connect to other people. In some way, we crave connection and a sense of belonging. With the rise of community over the last couple of years, many companies think that building a community is the answer. But not everyone who claims to want a community actually wants one. In fact, what many people are looking for is an audience.

An audience is a group of people who are aware of what you're doing, but they don't necessarily engage or interact with each other. It's like a group of spectators watching a game from the sidelines. A community is made up of individuals who engage and interact with each other. They're active participants who shape the story and contribute to the group's sense of identity and purpose.

To better understand this, let's use the analogy of a story. An audience reads the story and observes the characters, while a community is the story. Members of a community create the story together, and their collective experiences shape its trajectory. Power users might guide the main ideas, while minor characters come and go, still impacting the story in meaningful ways.

It's important to remember that a community is probably much smaller than an audience. But don't underestimate its power; some of the most impactful communities are small but mighty. By building a strong community that's engaged and invested in your world, you'll be able to create a sense of belonging and connection that will attract others to your mission.

If you want to see the video that inspired this blog post, you can check it out at [https://www.youtube.com/@bekahhw](https://www.youtube.com/watch?v=sU7-SfukPT8).
Nested method in Swift
Tags: ios, swift
Published: 2023-02-13 21:13:35

 ![Nested method in Swift](https://needone.app/content/images/2022/12/nested-method-in-Swift.png)

A nested method in Swift is a method or function that is defined within another function. Nested functions have the following characteristics:

- They have access to all variables and constants of the outer function, including local variables and parameters.
- They do not have access to variables or constants in the global scope or in other functions unless these variables or constants are marked as static or global.
- They do not have an independent life cycle, and they are only accessible within the context of the outer function.

Here is an example of a nested function in Swift:

```Swift
func outerFunction(param1: Int, param2: Int) -> Int {
    var result = 0
    
    func nestedFunction() {
        result = param1 + param2
    }
    
    nestedFunction()
    return result
}

let res = outerFunction(param1: 10, param2: 20) // res is 30

```

In this example, the `nestedFunction` is defined within the `outerFunction`. The `nestedFunction` has access to the local variables and parameters of the `outerFunction`, including the `result` variable and the `param1` and `param2` parameters. The `nestedFunction` does not have access to variables or constants in the global scope or in other functions unless they are marked as static or global.

Nested functions can be useful in a variety of situations in Swift, such as:

- Encapsulating related functionality within a function: Nested functions can be used to group related functionality within a function, making it easier to organize and manage complex codebases.
- Reducing code duplication: Nested functions can be used to avoid repeating the same code in multiple places, which can make your code more concise and easier to maintain.
- Improving readability: Nested functions can help to improve the readability of your code by breaking it down into smaller, more manageable blocks of functionality.

Overall, nested functions can be a useful tool in Swift, but it is important to carefully consider the potential benefits and drawbacks of using nested functions in your code. If you have any concerns or questions about using nested functions in Swift, consult with a knowledgeable developer or refer to the Swift documentation for guidance and advice.
Revolutionize Your React Development with PrismaDB
Tags: prisma, react, typescript, webdev
Published: 2023-02-13 21:12:01

As a React developer, you're always looking for ways to improve the performance and scalability of your projects. That's where PrismaDB comes in.

Prisma is a modern database toolkit that makes it easy to interact with databases using TypeScript. Its main competitors are traditional ORMs (Object-Relational Mapping) such as Sequelize, TypeORM, and Doctrine.

The purpose of Prisma is to increase the efficiency of application developers when they are working with databases. The following are some of the ways in which Prisma accomplishes this:

* Object-based thinking instead of mapping relational data
* Queries instead of complex model objects in classes
* A unified source of truth for both database and application models
* Protective constraints to prevent common mistakes and negative practices
* An interface that makes it easy to do things correctly ("a safe haven")
* Safe database queries that can be verified before compiling
* Reduced repetitive code, allowing developers to concentrate on the crucial aspects of their application
* Code editors that offer auto-completion, removing the need to consult documentation

One of the key advantages of Prisma is improved performance. Prisma generates optimized database queries, reducing the load on your server and making your applications run faster. Another benefit of using Prisma is scalability. Prisma is designed to handle growth, so you can focus on building your application as your user base grows.


Unlike traditional ORMs, which can have a steep learning curve, Prisma provides a simple and intuitive interface for working with your database, making it easy to interact with your data without having to learn complex syntax. Whether you're performing common database operations like creating, reading, updating, and deleting records, or more advanced tasks, Prisma has you covered.

Stay ahead of the curve as a React developer by adopting Prisma. [It's a smart choice](https://www.prisma.io/docs/concepts/overview/should-you-use-prisma) that will take your projects to the next level. I'm doing that.


---
References:
[https://www.prisma.io/docs/concepts/overview/should-you-use-prisma](https://www.prisma.io/docs/concepts/overview/should-you-use-prisma)    
[https://www.prisma.io/docs/concepts/overview/why-prisma](https://www.prisma.io/docs/concepts/overview/why-prisma)
PlayerPrefs in Unity and how to use it
Tags: unity3d, unity2d, gamedev
Published: 2023-02-13 21:11:29

`PlayerPrefs` is a built-in class in Unity that provides an easy and native way to store and retrieve values. It can be used to save data such as user preferences, game progress, high scores, or any other data that you want to persist even after the game has been closed.

To be more specific, `PlayerPrefs` uses a simple key-value structure, where you can store/retrieve values by specifying a key name.

Here is an example on how to use `PlayerPrefs` in Unity:

```CSharp
// Store the high score
int highScore = 1000;
PlayerPrefs.SetInt("HighScore", highScore);

// Retrieve the high score
int storedHighScore = PlayerPrefs.GetInt("HighScore", 0);
```