Skip to content

Commit 4a36473

Browse files
committed
sync: include index.md in sync and optimize workflow, update notes
1 parent 7652cc4 commit 4a36473

256 files changed

Lines changed: 13563 additions & 6376 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/sync-logseq-content.yml

Lines changed: 15 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ on:
55
branches:
66
- Admin
77
paths:
8-
- "pages/**" # runs when notes in pages/ change
8+
- "pages/**"
99

10-
workflow_dispatch: # allows manual trigger from GitHub Actions UI
10+
workflow_dispatch:
1111

1212
jobs:
1313
sync:
@@ -16,60 +16,35 @@ jobs:
1616
contents: write
1717

1818
steps:
19-
- name: Checkout Admin branch (Logseq source)
19+
- name: Checkout Admin (Logseq source)
2020
uses: actions/checkout@v4
2121
with:
2222
ref: Admin
2323
path: logseq-source
24+
fetch-depth: 1
2425

25-
- name: Checkout Web-live branch (Quartz site)
26+
- name: Checkout Web-live (Quartz site)
2627
uses: actions/checkout@v4
2728
with:
2829
ref: Web-live
2930
path: quartz-site
3031
token: ${{ secrets.GITHUB_TOKEN }}
32+
fetch-depth: 1
3133

32-
- name: Sync pages/ → content/
33-
id: sync
34+
- name: Sync and Deploy
3435
run: |
35-
SOURCE="logseq-source/pages"
36-
DEST="quartz-site/content"
36+
# Sync pages/ to content/ (including index.md)
37+
rsync -av --delete logseq-source/pages/ quartz-site/content/
3738
38-
# Use rsync to sync files, deleting removed files, but excluding index.md
39-
rsync -av --delete --exclude="index.md" "$SOURCE"/ "$DEST"/
40-
41-
- name: Check for changes in content/
42-
id: changes
43-
run: |
44-
cd quartz-site
45-
git add content/
46-
if git diff --staged --quiet; then
47-
echo "has_changes=false" >> $GITHUB_OUTPUT
48-
echo "No changes detected — skipping deploy."
49-
else
50-
changed=$(git diff --staged --name-only | wc -l)
51-
echo "has_changes=true" >> $GITHUB_OUTPUT
52-
echo "changed_count=$changed" >> $GITHUB_OUTPUT
53-
fi
54-
55-
- name: Commit and push changes to Web-live
56-
if: steps.changes.outputs.has_changes == 'true'
57-
run: |
5839
cd quartz-site
5940
git config user.name "github-actions[bot]"
6041
git config user.email "github-actions[bot]@users.noreply.github.com"
61-
COMMIT_SHA=$(cd ../logseq-source && git rev-parse --short HEAD)
62-
63-
git commit -m "sync: ${{ steps.changes.outputs.changed_count }} file(s) updated from Logseq (Admin@$COMMIT_SHA)"
64-
git push origin Web-live
42+
git add content/
6543
66-
- name: Summary
67-
run: |
68-
if [ "${{ steps.changes.outputs.has_changes }}" == "true" ]; then
69-
echo "### ✅ Sync complete" >> $GITHUB_STEP_SUMMARY
70-
echo "- **Changed files:** ${{ steps.changes.outputs.changed_count }}" >> $GITHUB_STEP_SUMMARY
71-
echo "- Content pushed to **Web-live**. Hosting provider will trigger build." >> $GITHUB_STEP_SUMMARY
44+
if ! git diff --staged --quiet; then
45+
COMMIT_SHA=$(cd ../logseq-source && git rev-parse --short HEAD)
46+
git commit -m "sync: updated from Logseq (Admin@$COMMIT_SHA)"
47+
git push origin Web-live
7248
else
73-
echo "### ⏭️ No changes" >> $GITHUB_STEP_SUMMARY
74-
echo "Content was already up to date — no commit made." >> $GITHUB_STEP_SUMMARY
49+
echo "No changes detected — skipping deploy."
7550
fi

CONTRIBUTING.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ Every page **must** start with SEO frontmatter:
3434

3535
seoTitle: <Page Name> Complete Guide – <Short Description>
3636
description: "Comprehensive <topic> reference covering <key topics>."
37-
keywords: "<keyword1>, <keyword2>, ..., VR-Rathod, Code-Note, code note vr, vr book , <You'r name / your code tags>"
37+
keywords: "<keyword1>, <keyword2>, ..., VR-Rathod, Code-Note,Vaibhav Rathod, vaibhav, Vaibhav, VR, code note vr, vr book , <You'r name / your code tags>"
3838
displayTitle: Better Title # This is title of page (not required for all page)
3939
`seoTitle` — Keep under 60 characters. Format: `Topic Name – Subtitle`
4040
`description` — 1-2 sentences, 120-160 characters. Mention key subtopics.
4141
`keywords` — Comma-separated. Always end with the standard author tags.
4242
comments: false/true (For Enabling or disable comments)
43+
treeTitle: main page - sub page - sub page
4344
```
4445
4546
### For Single Writer

pages/A Search Algorithm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ seoTitle: A* Search Algorithm – Heuristic Pathfinding Algorithm Guide
33
description: "Comprehensive guide to the A* Search algorithm. Explains the f(n) = g(n) + h(n) evaluation, admissibility, consistency, distance metrics, and complete grid-based pathfinding in Python, C++, JavaScript, Java, and C."
44
keywords: "A* search algorithm, A* pathfinding, heuristic search, shortest path, grid pathfinding, Dijkstra vs A*, Manhattan distance, Euclidean distance, time complexity, space complexity, VR-Rathod, Code-Note, Vaibhav Rathod , A Search Algorithm"
55
displayTitle: A* Search Algorithm
6+
treeTitle: DSA - Sorting & Searching - A Search Algorithm
67
---
78

89
> [!info] What is A* Search?

pages/AA Tree.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,23 @@
22
seoTitle: AA Tree Explained – Self-Balancing BST with C++ and Python
33
description: "Learn AA Trees, a simplified Red-Black Tree variant using levels instead of colors. Detailed skew, split, insert, delete operations in C++ and Python."
44
keywords: "AA tree, balanced BST, self-balancing tree, skew, split, C++, Python, data structures, algorithms, binary search tree, tree rotation, VR-Rathod, Code-Note, code note vr, vr book"
5+
treeTitle: DSA - Trees - AA Tree
56
---
67

78
> [!info] What is an AA Tree?
89
> An **AA Tree** (Arne Andersson Tree) is a self-balancing binary search tree that simplifies the classic Red-Black Tree.
910
> It enforces balance using node **levels** (integers) rather than colors, significantly reducing the number of rotation cases needed during insertions and deletions.
1011
1112
- # Explanation
12-
- An **AA Tree** is a variant of the Red-Black Tree that eliminates half of the restructuring cases by requiring that **only right children** can be at the same level as their parent.
13+
- An **AA Tree** is a variant of the Red-Black Tree that eliminates half of the restructuring cases by requiring that **only right children** can be at the same level as their parent.
1314
- Instead of colors (Red/Black), every node is tagged with an integer **level** representing the black height of the node.
1415
-
1516
- ## Real-World Analogy
1617
collapsed:: true
1718
- Think of a **corporate hierarchy** where employees are assigned strict grade levels.
18-
- You can have a peer (at your same grade level) working directly under you, but to avoid structural confusion, they **must sit on your right**.
19-
- No peers are allowed to sit on your left (left-child same level).
20-
- You can have at most one peer reporting to you; if a second peer joins them, it triggers a promotion (level increment) to rebalance the team.
19+
- You can have a peer (at your same grade level) working directly under you, but to avoid structural confusion, they **must sit on your right**.
20+
- No peers are allowed to sit on your left (left-child same level).
21+
- You can have at most one peer reporting to you; if a second peer joins them, it triggers a promotion (level increment) to rebalance the team.
2122
-
2223
- ## Why AA Tree Over Red-Black Tree?
2324
collapsed:: true

pages/Abstract Classes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ seoTitle: Abstract Classes in OOP – Complete In-Depth Guide | Abstract Methods
33
description: "Deep dive into Abstract Classes in OOP. Covers what abstract classes are, abstract vs concrete methods, abstract class vs interface, the template method pattern, and examples in Python, C++, Java, JavaScript, and C#."
44
keywords: "abstract class, OOP, abstract method, ABC, template method, Python abstract class, Java abstract class, C++ pure virtual, interface vs abstract class, VR-Rathod, Code-Note"
55
displayTitle: Abstract Classes
6+
treeTitle: DSA - OOP - Abstract Classes
67
---
78

89
> [!info] What is an Abstract Class?
@@ -49,7 +50,6 @@ displayTitle: Abstract Classes
4950
def analyze(self, data: list) -> dict: # concrete default
5051
return {"count": len(data)}
5152
```
52-
5353
- # Implementation
5454
collapsed:: true
5555
- > [!note] A `Shape` abstract class hierarchy + a `DataExporter` template method pattern.
@@ -350,15 +350,13 @@ displayTitle: Abstract Classes
350350
```
351351
352352
:::
353-
354353
- # Key Takeaways
355354
collapsed:: true
356355
- **Abstract class** = template for subclasses — defines what must be done, may show how common parts work.
357356
- **Cannot be instantiated** — attempting to do so throws a `TypeError` (Python), compile error (Java/C#/C++).
358357
- Mix of **abstract methods** (must override) and **concrete methods** (optional to override).
359358
- Prefer **abstract class** when: related classes share code + state. Prefer **interface** when: unrelated classes share capability.
360359
- Enables **Template Method Pattern** — define algorithm skeleton in base, defer variable steps to subclasses.
361-
362360
- # More Learn
363361
collapsed:: true
364362
- ## GitHub & Webs

pages/Abstraction.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ seoTitle: Abstraction in OOP – Complete In-Depth Guide | Data Hiding, Abstract
33
description: "Deep dive into Abstraction in OOP. Covers data abstraction, procedural abstraction, abstract classes, interfaces, and when to apply abstraction with examples in Python, C++, Java, JavaScript, and C#."
44
keywords: "abstraction, OOP, abstract class, interface, data hiding, Python abstraction, Java abstraction, C++ abstract class, JavaScript abstraction, CSharp abstraction, design principles, VR-Rathod, Code-Note"
55
displayTitle: Abstraction
6+
treeTitle: DSA - OOP - Abstraction
67
---
78

89
- # Introduction

pages/Ackermann Function.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
seoTitle: Ackermann Function – Computability, Up-Arrows & Inverse Ackermann Guide
33
description: "An exhaustive master-level guide to the Ackermann Function. Covers Computability Theory, Primitive Recursive vs General Recursive functions, Knuth's Up-Arrow notation, recursive trace trees, and the Inverse Ackermann complexity bounds in Disjoint Set Union."
44
keywords: "Ackermann function, recursion, primitive recursive, computability theory, Knuth up-arrow, inverse Ackermann, Union-Find complexity, tetration, stack overflow, DSA"
5+
treeTitle: DSA - Math & Geometry - Ackermann Function
56
---
67

78
> [!info] What is the Ackermann Function?
@@ -121,7 +122,7 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
121122
> Languages: [[Python]] · [[Cpp]] · [[Java Script]] · [[Java]]
122123
-
123124
- :::code-tabs
124-
125+
125126
```python
126127
# 1. Basic Recursive
127128
def ackermann_recursive(m: int, n: int) -> int:
@@ -130,7 +131,7 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
130131
if n == 0:
131132
return ackermann_recursive(m - 1, 1)
132133
return ackermann_recursive(m - 1, ackermann_recursive(m, n - 1))
133-
134+
134135
# 2. Memoized (to handle slightly larger values)
135136
memo = {}
136137
def ackermann_memo(m: int, n: int) -> int:
@@ -145,7 +146,7 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
145146
res = ackermann_memo(m - 1, ackermann_memo(m, n - 1))
146147
memo[key] = res
147148
return res
148-
149+
149150
# 3. Iterative with Explicit Stack (prevents stack overflow)
150151
def ackermann_iterative(m: int, n: int) -> int:
151152
stack = [m]
@@ -161,25 +162,25 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
161162
stack.append(m_val)
162163
n = n - 1
163164
return n
164-
165+
165166
# Example usage
166167
print("A(2, 1) =", ackermann_recursive(2, 1)) # 5
167168
print("A(3, 4) =", ackermann_memo(3, 4)) # 125
168169
print("A(3, 7) =", ackermann_iterative(3, 7)) # 4093
169170
```
170-
171+
171172
```c++
172173
#include <iostream>
173174
#include <map>
174175
#include <stack>
175-
176+
176177
// 1. Basic Recursive
177178
long long ackermann_recursive(long long m, long long n) {
178179
if (m == 0) return n + 1;
179180
if (n == 0) return ackermann_recursive(m - 1, 1);
180181
return ackermann_recursive(m - 1, ackermann_recursive(m, n - 1));
181182
}
182-
183+
183184
// 2. Memoized
184185
std::map<std::pair<long long, long long>, long long> memo;
185186
long long ackermann_memo(long long m, long long n) {
@@ -197,7 +198,7 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
197198
memo[key] = res;
198199
return res;
199200
}
200-
201+
201202
// 3. Iterative with Explicit Stack
202203
long long ackermann_iterative(long long m, long long n) {
203204
std::stack<long long> stk;
@@ -217,23 +218,23 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
217218
}
218219
return n;
219220
}
220-
221+
221222
int main() {
222223
std::cout << "A(2, 1) = " << ackermann_recursive(2, 1) << "\n"; // 5
223224
std::cout << "A(3, 4) = " << ackermann_memo(3, 4) << "\n"; // 125
224225
std::cout << "A(3, 7) = " << ackermann_iterative(3, 7) << "\n"; // 4093
225226
return 0;
226227
}
227228
```
228-
229+
229230
```javascript
230231
// 1. Basic Recursive
231232
function ackermannRecursive(m, n) {
232233
if (m === 0) return n + 1;
233234
if (n === 0) return ackermannRecursive(m - 1, 1);
234235
return ackermannRecursive(m - 1, ackermannRecursive(m, n - 1));
235236
}
236-
237+
237238
// 2. Memoized
238239
const memo = new Map();
239240
function ackermannMemo(m, n) {
@@ -250,7 +251,7 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
250251
memo.set(key, res);
251252
return res;
252253
}
253-
254+
254255
// 3. Iterative with Explicit Stack
255256
function ackermannIterative(m, n) {
256257
const stack = [m];
@@ -269,15 +270,15 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
269270
}
270271
return n;
271272
}
272-
273+
273274
console.log("A(2, 1) =", ackermannRecursive(2, 1));
274275
console.log("A(3, 4) =", ackermannMemo(3, 4));
275276
console.log("A(3, 7) =", ackermannIterative(3, 7));
276277
```
277-
278+
278279
```java
279280
import java.util.*;
280-
281+
281282
public class Ackermann {
282283
283284
// 1. Basic Recursive
@@ -286,7 +287,7 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
286287
if (n == 0) return ackermannRecursive(m - 1, 1);
287288
return ackermannRecursive(m - 1, ackermannRecursive(m, n - 1));
288289
}
289-
290+
290291
// 2. Memoized
291292
private static Map<String, Long> memo = new HashMap<>();
292293
public static long ackermannMemo(long m, long n) {
@@ -303,7 +304,7 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
303304
memo.put(key, res);
304305
return res;
305306
}
306-
307+
307308
// 3. Iterative with Explicit Stack
308309
public static long ackermannIterative(long m, long n) {
309310
Stack<Long> stack = new Stack<>();
@@ -323,15 +324,15 @@ keywords: "Ackermann function, recursion, primitive recursive, computability the
323324
}
324325
return n;
325326
}
326-
327+
327328
public static void main(String[] args) {
328329
System.out.println("A(2, 1) = " + ackermannRecursive(2, 1));
329330
System.out.println("A(3, 4) = " + ackermannMemo(3, 4));
330331
System.out.println("A(3, 7) = " + ackermannIterative(3, 7));
331332
}
332333
}
333334
```
334-
335+
335336
:::
336337
-
337338
- # Key Takeaways

pages/Activity Selection Problem.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ seoTitle: Activity Selection Problem – Greedy Interval Scheduling Algorithm Gu
33
description: "Master the Activity Selection Problem using greedy interval scheduling. Covers earliest finish time strategy, exchange argument proof, weighted variant with DP, and full implementations in Python, C++, JavaScript, and Java."
44
keywords: "activity selection problem, interval scheduling, greedy algorithm, earliest finish time, non-overlapping intervals, weighted job scheduling, DP, Python, C++, Java, JavaScript, DSA"
55
displayTitle: Activity Selection Problem
6+
treeTitle: DSA - DP & Greedy - Activity Selection Problem
67
---
78

89
> [!info] What is the Activity Selection Problem?

pages/Aggregation.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ seoTitle: Aggregation in OOP – Complete In-Depth Guide | HAS-A Weak Ownership,
33
description: "Deep dive into Aggregation in OOP. Covers weak HAS-A relationships, independent child lifecycle, differences from Composition and Association, UML notation, and examples in Python, C++, Java, JavaScript, and C#."
44
keywords: "aggregation, OOP, has-a relationship, weak ownership, aggregation vs composition, independent lifecycle, Python aggregation, Java aggregation, C++ aggregation, UML diamond, VR-Rathod, Code-Note"
55
displayTitle: Aggregation
6+
treeTitle: DSA - OOP - Aggregation
67
---
78

89
> [!info] What is Aggregation?
@@ -30,7 +31,6 @@ displayTitle: Aggregation
3031
| Child lifecycle | Independent | **Independent** | Tied to parent |
3132
| UML | Simple line | ◇ empty diamond | ◆ filled diamond |
3233
| Example | Doctor–Patient | Team–Player | Car–Engine |
33-
3434
- # Implementation
3535
collapsed:: true
3636
- > [!note] A `Library` with `Books` and a `University` with `Departments` — books and departments can exist independently of their containers.
@@ -300,17 +300,15 @@ displayTitle: Aggregation
300300
```
301301
302302
:::
303-
304303
- # Key Takeaways
305304
collapsed:: true
306305
- **Aggregation = HAS-A with weak ownership** — child objects survive parent destruction.
307306
- Represented with **raw pointers** (C++) or **references** (Java/Python/C#/JS) — not embedded instances.
308307
- A child can be shared between multiple parents (same Book in two Libraries).
309308
- Weaker than [[Composition]] (strong ownership), stronger than pure [[Association]] (no ownership).
310309
- Use aggregation when the child has meaning/utility **outside the containing object**.
311-
312310
- # More Learn
313311
collapsed:: true
314312
- ## GitHub & Webs
315313
- [GeeksforGeeks — Aggregation vs Composition](https://www.geeksforgeeks.org/association-composition-aggregation-in-java/)
316-
- [UML Aggregation — IBM](https://developer.ibm.com/articles/the-class-diagram/)
314+
- [UML Aggregation — IBM](https://developer.ibm.com/articles/the-class-diagram/)

pages/Aho Corasick Algorithm.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
seoTitle: Aho Corasick Algorithm – Efficient Multi-Pattern String Matching
33
description: "Comprehensive guide to the Aho Corasick Algorithm. Explains trie-based multi-pattern matching, failure links, dictionary links, and full implementations in 5 languages."
44
keywords: "Aho-Corasick, multi-pattern search, trie, failure link, dictionary link, string matching, algorithm, C++, Python, Java, JavaScript, C, VR-Rathod, Code-Note, Vaibhav Rathod"
5+
treeTitle: DSA - String Algorithms - Aho Corasick Algorithm
56
---
67

78
> [!info] What is the Aho Corasick Algorithm?

0 commit comments

Comments
 (0)