Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fafo #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed DB/assets/Screenshot 2024-03-25 232223.png
Binary file not shown.
Binary file removed DB/assets/Screenshot 2024-03-25 232336.png
Binary file not shown.
Binary file removed DB/assets/Screenshot 2024-03-25 232417.png
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-25 232223.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-25 232336.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-25 232417.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 150020.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 150111.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 150201.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 150227.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 150538.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 162027.webp
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 162111.webp
Binary file not shown.
Binary file not shown.
Binary file added DB/assets/pic/Screenshot 2024-03-27 162159.webp
Binary file not shown.
270 changes: 270 additions & 0 deletions DB/assets/terminal/mongoCompose.cast

Large diffs are not rendered by default.

262 changes: 262 additions & 0 deletions DB/assets/terminal/mongoCompose.txt

Large diffs are not rendered by default.

139 changes: 122 additions & 17 deletions DB/learn.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,35 @@

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/x-icon" href="../image/favicon.ico">
<title>Learn about Database Management Systems</title>
<meta name="description" content="Delve into the realm of generative AI models and acquire the skills to craft your own. Uncover cutting-edge techniques, essential tools, and abundant resources to ignite your imagination in artificial intelligence. Immerse yourself in our extensive collection of guides, tutorials, and materials to master the intricacies of generative AI modeling, starting from the basics.">
<meta name="keywords" content="Generative AI, AI modeling, Artificial intelligence techniques, Generative models, Machine learning, Deep learning, Neural networks, AI tutorials, AI resources, Creativity in AI, AI development, Model building techniques, AI programming, Advanced AI tools">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Explore database management systems with a focus on AuthZ vs AuthN, SQL vs NoSQL, understanding NoSQL records, JSON vs BSON, and hands-on experience with MongoDB, MariaDB, SQLite, and more. Delve into topics like indexing, transactions, data partitioning, CAP theorem, NoSQL trade-offs, scalability challenges, enterprise solutions, and database internals.">
<meta name="keywords" content="database management systems, AuthZ, AuthN, SQL, NoSQL, MongoDB, MariaDB, SQLite, BSON, JSON, indexing, transactions, isolation levels, table locks, file descriptors, CAP theorem, consistent hashing, quorums, schema, scalability, high availability, replication, sharding, key-value, document, column, graph databases, Redis, Cassandra, Aerospike, Elasticsearch, data modeling, partitioning, sharding, storage engines, caching, distributed systems, cache databases, Redis implementation.">
<link rel="stylesheet" href="style.css">
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
<!-- <script src="learn.js" defer></script> -->
<script src="./learn.js"></script>
<script src="../asciinema-player.min.js"></script>
<link rel="stylesheet" href="../asciinema-player.css">
</head>

<body>
<header>
<nav>
<div class="page-counter">
1
</div>
<div class="page-counter">
1
</div>
<div id="mySidebar" class="sidebar">
<button href="javascript:void(0)" class="closebtn" onclick="closeNav()">◀</button>
<h1>INDEX</h1>
<a target="_self" href="#1-0">Basics</a>
<a target="_self" href="#1-1">AuthZ vs AuthN</a>
<a target="_self" href="#1-2">SQL vs NoSQL</a>
<a target="_self" href="#1-3">Understanding Nosql records/documents</a>
<a target="_self" href="#1-4">JSON vs BSON https://www.mongodb.com/basics/bson</a>
<a target="_self" href="#1-5">Hands on MongoDB and Mongo-Express</a>
<a target="_self" href="#1-4">JSON vs BSON</a>
<a target="_self" href="#1-3">Understanding Nosql records/documents</a>
<a target="_self" href="#1-6">Hands on Mariadb and Adminer</a>
<a target="_self" href="#1-7">SQLite and https://sqlitebrowser.org</a>
</div>
Expand All @@ -54,25 +57,24 @@ <h3 id="probability-sample-space">Sample space</h3>
</article> -->
<article>
<h2>Introduction</h2>
<p>You can open the sidebar for index. I am learning myself so it will take a while to complete. The font used is called <a href="https://opendyslexic.org/" class="noo">opendyslexic</a>. If you find any misinformation on this website please let me know.</p>
<p>You can open the sidebar for index. I am learning myself so it will take a while to complete. The font used is called <a href="https://opendyslexic.org/" class="noo">opendyslexic</a>. The code snippets are shared using <a href="https://asciinema.org/" class="noo">asciinema</a> you can pause and copy the code from there. If you find any misinformation on this website please let me know.</p>
</article>
<article>
<h2 id="1-0">Basic</h2>
<p class="date">March 23, 2024</p>
<p>We will understand </p>
<p>We expect you to already have docker engine and WSL (for windows device) installed and set up.</p>
<h3 id="1-1">AuthZ vs AuthN </h3>
<p>
AuthN (Authentication) = it is the process of verifying the identity of a user or system. It confirms that the user or system is who they claim to be. This process typically involves presenting credentials, such as a username and password, and validating them against a database or authentication service. Authentication ensures that only authorized users gain access to resources or functionalities within an application. <br>
AuthZ (Authorization) = it is the process of determining what actions or resources a user is allowed to access within an application or system. Once a user's identity has been authenticated, authorization specifies the permissions and privileges associated with that identity. Authorization mechanisms enforce access control policies, ensuring that users can only perform actions or access resources that they are authorized to. Most common access is CRUD which stands for Create, read, Update & Delete. <br>
<a target="_blank" href="https://auth0.com/">Auth0?</a> = It is a platform that abstracts away much of the complexity of implementing authentication and authorization, offering developers ready-to-use solutions that can be easily integrated into their applications. <br>
<a target="_blank" href="https://auth0.com/intro-to-iam/what-is-authentication">AuthN (Authentication)</a> = it is the process of verifying the identity of a user or system, typically through credentials like passwords or biometrics. <br>
<a target="_blank" href="https://auth0.com/intro-to-iam/what-is-authorization">AuthZ (Authorization)</a> = it is determines what actions or resources a user is permitted to access after their identity has been authenticated, enforcing access control policies. Most common access is CRUD which stands for Create, read, Update & Delete. <br>
<a target="_blank" href="https://auth0.com/">Auth0?</a> = It is one of many authentication and authorization platform used by developers to implement secure access to their applications via features like single sign-on and multi-factor authentication. <br>

</p>
<h3 id="1-2">SQL vs NoSQL </h3>
<h3 id="1-3">Understanding Nosql records/documents </h3>
<h3 id="1-4">JSON vs BSON https://www.mongodb.com/basics/bson </h3>
<p>TL;DR: SQL (Structured Query Language) and NoSQL (Not Only SQL) are two types of database management systems. SQL databases, like MySQL and PostgreSQL, are relational databases with a structured schema (blueprint that defines the organization of data within a database), supporting ACID (atomic, consistent, isolated, durable) transactions and providing strong consistency. NoSQL databases, like MongoDB and Cassandra, are non-relational and schema-less, offering flexibility in data models and horizontal scalability preserving the fidelity of data. SQL databases are suitable for structured data and complex queries, while NoSQL databases excel in handling unstructured or semi-structured data and high-volume transactions with distributed architectures. The choice between SQL and NoSQL depends on factors like data structure, scalability needs, and the nature of the application.</p>
<h3 id="1-5">Hands on MongoDB and Mongo-Express </h3>
<p>
<a target="_blank" href="https://hub.docker.com/_/mongo">docker-compose image for MongoDB</a>
official <a target="_blank" href="https://hub.docker.com/_/mongo">docker-compose image for MongoDB</a>,
<pre>
<code># Use root/example as user/password credentials
version: '3.1'
Expand All @@ -97,7 +99,103 @@ <h3 id="1-5">Hands on MongoDB and Mongo-Express </h3>
ME_CONFIG_MONGODB_URL: mongodb://root:example@mongo:27017/
</code>
</pre>
Our edited verison,
<pre>
<code>
version: "3.1"

services:
mongo:
image: mongo
restart: always
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: arnab
MONGO_INITDB_ROOT_PASSWORD: A12345

mongo-express:
image: mongo-express
restart: always
ports:
- 8082:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: arnab
ME_CONFIG_MONGODB_ADMINPASSWORD: A12345
ME_CONFIG_MONGODB_URL: mongodb://arnab:A12345@mongo:27017/
ME_CONFIG_OPTIONS_EDITORTHEME: "ambiance"
ME_CONFIG_BASICAUTH_USERNAME: "arnab"
ME_CONFIG_BASICAUTH_PASSWORD: "A12345"
</code>
</pre>
we are changing the port, adding our username, password. We are also adding a custom theme to Mongo-Express which is a web-based MongoDB admin interface written in Node. js, Express. js, and Bootstrap3.
</p>
<p>Now to get this running follow the commands below,</p>
<div class="asciinema" id="mongoComposeplayer"></div>
<p>Opening the docker engine interface we see,</p>
<img src="./assets/pic/Screenshot 2024-03-25 232336.webp" alt="" srcset="">
<p>As it stands now we have,</p>
<code>mongo database server is running at http://localhost:27017/</code><br>
<code>mongo express running at http://localhost:8082/</code>
<p>As Mongo express is the interface we will visit that link,</p>
<img src="./assets/pic/Screenshot 2024-03-25 232223.webp" alt="" srcset="">
<p>It prompts you to input the username and password which is "arnab" and "A12345" in my case according to my configuration.</p>
<img src="./assets/pic/Screenshot 2024-03-25 232417.webp" alt="" srcset="">
<h3 id="1-4">JSON vs BSON</h3>
<p>If you wish to nerd out you should read the <a href="https://www.mongodb.com/basics/bson">MongoDB docs on BSON</a>.</p>
<p>TL;DR: JSON (JavaScript Object Notation) and BSON (Binary JSON) are both data interchange formats used primarily in web development and data storage. JSON is human-readable and lightweight, making it easy to parse and generate. However, BSON is a binary-encoded serialization of JSON-like documents, offering advantages like efficiency in storage and transmission, support for additional data types, and faster parsing. BSON is commonly used in databases like MongoDB for efficient storage and retrieval of data, especially in large-scale applications where performance is crucial.</p>
<p>Say we have a json file called arnab.json,</p>
<pre>
<code>
{
"firstName": "Arnab",
"lastName": "Goswami",

"Address": {
"City": "Malda",
"ZipPIN": "73210",
"Country": "IN"
},
"Peoms": {
"P1": "Some struggling to be seen, some to disappear.",
"P2": "Expect to lose and fear failure, desire to win and prepare for war."
}
}

</code>
</pre>
<p>Let's make a new database on our server</p>
<img src="./assets/pic/Screenshot 2024-03-27 150020.webp" alt="" srcset="">
<img src="./assets/pic/Screenshot 2024-03-27 150111.webp" alt="" srcset="">
<p>Click on view to open the db and create a new file</p>
<img src="./assets/pic/Screenshot 2024-03-27 150201.webp" alt="" srcset="">
<img src="./assets/pic/Screenshot 2024-03-27 150227.webp" alt="" srcset="">
<p>Formating the JSON for the input it would look like this,</p>
<pre>
<code>
{
"_id": ObjectId(),
"firstName": "Arnab",
"lastName": "Goswami",

"Address": {
"City": "Malda",
"ZipPIN": "73210",
"Country": "IN"
},
"Peoms": {
"P1": "Some struggling to be seen, some to disappear.",
"P2": "Expect to lose and fear failure, desire to win and prepare for war."
}
}

</code>
</pre>
<p>after we paste the code and save it shows up on the gui. You can see the data got populated by itself and no schema was required (as mongoDB is NoSQL). This data stored here is in BSON format.</p>
<img src="./assets/pic/Screenshot 2024-03-27 150538.webp" alt="" srcset="">
<h3 id="1-3">Understanding Nosql records/documents </h3>
<p>from there if we were to change some data say my last name. I can click on the field and we can edit from there.</p>
<p>As we can see unlike SQL we don't have any restrictions with the schema like how many characters a specific field can be.</p>
<h3 id="1-6">Hands on Mariadb and Adminer </h3>
<h3 id="1-7">SQLite and https://sqlitebrowser.org </h3>
</article>
Expand All @@ -110,5 +208,12 @@ <h3 id="1-7">SQLite and https://sqlitebrowser.org </h3>
<a href="http://twitter.com/arnabiscoding">Twitter</a>
</footer>
</body>

<script>
//mongocompose
AsciinemaPlayer.create(
'./assets/terminal/mongoCompose.cast',
document.getElementById('mongoComposeplayer'),
{ cols: 148, rows: 21 }
);
</script>
</html>
3 changes: 2 additions & 1 deletion DB/learn.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ function closeNav() {
document.getElementById("main").style.marginLeft= "0";
}

//link underline attempt
const headingElements = document.querySelectorAll('h1[id], h2[id], h3[id]');
const links = document.querySelectorAll('a[href^="#"]');

Expand All @@ -49,4 +50,4 @@ const headingElements = document.querySelectorAll('h1[id], h2[id], h3[id]');

headingElements.forEach((headingElement) => {
observer.observe(headingElement);
});
});
36 changes: 29 additions & 7 deletions DB/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
/* for Chrome, Safari, and Opera */
}
:root{
--primary-color: #303aea;
--primary-color: #548ce6;
--color-1: #e15524;
--color-2: #e96a3b;
--color-3: #f1825a;
--text: #202020;
--background:#f2f2f2;
--high: #87eb23;
--hov: #ff2655;
}
/* Reset and Base Styles */
* {
Expand Down Expand Up @@ -58,7 +60,7 @@ nav {
height: 100%;
width: 0;
position: fixed;
z-index: 1;
z-index: 100;
top: 0;
left: 0;
background-color: #333;
Expand Down Expand Up @@ -152,12 +154,13 @@ main {
.posts article {
margin-bottom: 2rem;
/* border: 1px solid #ccc; */
padding: 1rem;
/* padding: 1rem; */
}

.posts article img {
max-width: 100%;
height: auto;
padding: 1rem;
}

.posts article h2 {
Expand Down Expand Up @@ -194,7 +197,7 @@ h3{
background-color: #555;
} */
::selection{
background-color: #87eb23;
background-color: var(--high);
}
/* Footer Styles */
footer {
Expand All @@ -209,15 +212,34 @@ a:hover {
font-size:x-large;
color: var(--color-1);
}
main a{
color: var(--primary-color);
}
main a:hover{
font-size:initial;
color: var(--hov);
text-decoration:underline;
}

/* link underline attempt */
a.viewrn {
text-decoration: underline;
}
}
a:visited{
color: gray;
}
/* Responsive Styles */
@media (max-width: 768px) {
.openbtn{
position: fixed;
/* top: 5em; */
left: 0em;
height: 2.5%;
cursor: pointer;
background-color: #f2f2f2;
color: rgb(0, 0, 0);
/* padding: 10px 15px; */
border: none;
}
.menu {
display: none;
flex-direction: column;
Expand All @@ -236,7 +258,7 @@ a.viewrn {
}

.menu-toggle {
display: block;
display: none;
}

.menu.show {
Expand Down
2 changes: 1 addition & 1 deletion godot/learn.html → Generative AI/learn.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>getting started with gadot</title>
<title>getting started with generative AI</title>
<meta name="description" content="Delve into the realm of generative AI models and acquire the skills to craft your own. Uncover cutting-edge techniques, essential tools, and abundant resources to ignite your imagination in artificial intelligence. Immerse yourself in our extensive collection of guides, tutorials, and materials to master the intricacies of generative AI modeling, starting from the basics.">
<meta name="keywords" content="Generative AI, AI modeling, Artificial intelligence techniques, Generative models, Machine learning, Deep learning, Neural networks, AI tutorials, AI resources, Creativity in AI, AI development, Model building techniques, AI programming, Advanced AI tools">
<link rel="stylesheet" href="style.css">
Expand Down
File renamed without changes.
File renamed without changes.
Loading