Skip to content
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
138 changes: 69 additions & 69 deletions assets/indices/contentIndex.json

Large diffs are not rendered by default.

308 changes: 0 additions & 308 deletions assets/indices/linkIndex.json

Large diffs are not rendered by default.

10 changes: 1 addition & 9 deletions content/blog/activity-selection-huffman-encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,4 @@ The following video was referenced while making this diary and is the source of
# References
These notes are old and I did not rigorously horde references back then. If some part of this content is your's or you know where it's from then do reach out to me and I'll update it.
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H
2. [Huffman Codes: An Information Theory Perspective - Reducible](https://youtu.be/B3y0RsVCyrw?si=5kFqRPa_XsGxpqBr)

---

## Related Reading

- [More Greedy Algorithms! Kruskal's & Disjoint Set Union](/blog/more-greedy-algorithms-kruskal-s-disjoint-set-union)
- [Set Cover & Approximation Algorithms](/blog/set-cover-approximation-algorithms)
- [DP as DAGs, Shortest path on DAGs & LIS in O(nlogn)](/blog/dp-as-dags-shortest-path-on-dags-lis-in-o-nlogn)
2. [Huffman Codes: An Information Theory Perspective - Reducible](https://youtu.be/B3y0RsVCyrw?si=5kFqRPa_XsGxpqBr)
9 changes: 1 addition & 8 deletions content/blog/chain-matrix-multiplication.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,4 @@ In this DP solution, we cannot simply construct a DAG structure and find the lon
Last time, we were able to reduce the space complexity of our DP by realizing that the DP only relied on the states of the DP solution exactly **one** level below the current level. However, here we realize that this is sadly not the case. The solution at some node $[i, j]$ is very much reliant on every level below it. 1D row optimization etc does not seem to be of much use here. There is also no monotonicity that can be exploited to make the linear computation at some node logarithmic similar to how we did with LIS. Hence I do not think there is a better way to solve this problem.
# References
These notes are old and I did not rigorously horde references back then. If some part of this content is your's or you know where it's from then do reach out to me and I'll update it.
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H

---

## Related Reading

- [DP as DAGs, Shortest path on DAGs & LIS in O(nlogn)](/blog/dp-as-dags-shortest-path-on-dags-lis-in-o-nlogn)
- [A Deep Dive into the Knapsack Problem](/blog/a-deep-dive-into-the-knapsack-problem)
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H
9 changes: 1 addition & 8 deletions content/blog/covered-calls-strategy.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,4 @@ The premiums received from selling call options are generally considered short-t
## Share Holding Power Reduction
If the stock price fluctuates significantly, even if it remains flat over the long term, the covered call strategy may result in a gradual reduction in the number of shares held due to the exercise of call options. This can lead to realizing losses, despite the overall position being flat.
## Risk-Adjusted Return Considerations
While some people argue that covered call strategies may offer superior risk-adjusted returns, meaning higher returns per unit of risk taken, this claim is subject to debate and may depend on the specific market conditions and underlying assets involved.

---

## Related Reading

- [Efficient-Market-Hypothesis](/blog/efficient-market-hypothesis)
- [What is the Stock Market?](/blog/what-is-the-stock-market)
While some people argue that covered call strategies may offer superior risk-adjusted returns, meaning higher returns per unit of risk taken, this claim is subject to debate and may depend on the specific market conditions and underlying assets involved.
8 changes: 0 additions & 8 deletions content/blog/derivatives-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,3 @@ The Indian National Stock Exchange (since July 2018 expiry contracts), uses phys
4. [Physical Delivery - Investopedia](https://www.investopedia.com/terms/p/physicaldelivery.asp)
5. [Policy on settlement of compulsory delivery derivative contracts — Update Oct 2019 - Zerodha](https://zerodha.com/z-connect/general/policy-on-settlement-of-compulsory-delivery-derivative-contracts-update-oct-2019)
6. [Physical delivery of stock F&O & their risks - Zerodha](https://zerodha.com/z-connect/general/physical-delivery-of-stock-fo-their-risks)


---

## Related Reading

- [Covered Calls Strategy](/blog/covered-calls-strategy)
- [Efficient-Market-Hypothesis](/blog/efficient-market-hypothesis)
10 changes: 1 addition & 9 deletions content/blog/dp-as-dags-shortest-path-on-dags-lis-in-o-nlogn.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,4 @@ int lis(int arr[], int n) {
# References
These notes are old and I did not rigorously horde references back then. If some part of this content is your's or you know where it's from then do reach out to me and I'll update it.
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H
2. [Huffman Codes: An Information Theory Perspective - Reducible](https://youtu.be/B3y0RsVCyrw?si=5kFqRPa_XsGxpqBr)

---

## Related Reading

- [Levenshtein Edit Distance](/blog/levenshtein-edit-distance)
- [Chain Matrix Multiplication](/blog/chain-matrix-multiplication)
- [A Deep Dive into the Knapsack Problem](/blog/a-deep-dive-into-the-knapsack-problem)
2. [Huffman Codes: An Information Theory Perspective - Reducible](https://youtu.be/B3y0RsVCyrw?si=5kFqRPa_XsGxpqBr)
2 changes: 1 addition & 1 deletion content/blog/getting-rid-of-short-form-content.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
author: Kishore Kumar
date: 2024-06-25 14:25:53+0530
doc: 2024-06-05 05:06:01+0530
doc: 2025-05-18 17:07:02+0530
title: Getting Rid of Short-Form Content
---
Social media platforms are universally competing to capture all our time and attention by spamming us with brain-rot short form content... and it's working. And unlike other forms of addiction, it's not even true that we get dopamine hits from consuming short form content. More often than not, we don't even realize the amount of time that was passed consuming tidbits of random brain rot. YouTube for example randomly starts on the shorts page and users don't even realize they're scrolling through shorts until much later. Below we'll quickly outline a few software fixes we can implement at the moment to try to purge short form content from our life. Needless to say, if you're an iOS user, please chuck your phone.
Expand Down
8 changes: 0 additions & 8 deletions content/blog/levenshtein-edit-distance.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,3 @@ The single row optimized dp code for calculating the Levenshtein distance betwee
These notes are old and I did not rigorously horde references back then. If some part of this content is your's or you know where it's from then do reach out to me and I'll update it.
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H
2. [How do Spell Checkers work? Levenshtein Edit Distance - Creel](https://youtu.be/Cu7Tl7FGigQ?si=pFru3JaBAeKStvtz) (Excellent channel, do check him out. Has a lot of unique amazing content!)


---

## Related Reading

- [Chain Matrix Multiplication](/blog/chain-matrix-multiplication)
- [A Deep Dive into the Knapsack Problem](/blog/a-deep-dive-into-the-knapsack-problem)
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,4 @@ Below are links to `C++` implementations of both the fully equipped Disjoint Set
# References
These notes are old and I did not rigorously horde references back then. If some part of this content is your's or you know where it's from then do reach out to me and I'll update it.
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H
2. [Disjoint Set Union - cp-algorithms](https://cp-algorithms.com/data_structures/disjoint_set_union.html)

---

## Related Reading

- [Set Cover & Approximation Algorithms](/blog/set-cover-approximation-algorithms)
- [DP as DAGs, Shortest path on DAGs & LIS in O(nlogn)](/blog/dp-as-dags-shortest-path-on-dags-lis-in-o-nlogn)
2. [Disjoint Set Union - cp-algorithms](https://cp-algorithms.com/data_structures/disjoint_set_union.html)
8 changes: 1 addition & 7 deletions content/blog/set-cover-approximation-algorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,4 @@ Note that $n_t$ is the number of elements left at the $i^{th}$ iteration. Theref
This **must** mean that the algorithm will terminate after $t=k\ ln(n)$ iterations. Our algorithm picks exactly 1 set per iteration. This also implies that if our optimal answer is $k$, our greedy strategy will pick at most $k \ ln(n)$ sets. Hence we have successfully managed to put a bound on the approximation.
# References
These notes are old and I did not rigorously horde references back then. If some part of this content is your's or you know where it's from then do reach out to me and I'll update it.
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H

---

## Related Reading

- [DP as DAGs, Shortest path on DAGs & LIS in O(nlogn)](/blog/dp-as-dags-shortest-path-on-dags-lis-in-o-nlogn)
1. Professor [Kannan Srinathan's](https://www.iiit.ac.in/people/faculty/srinathan/) course on Algorithm Analysis & Design in IIIT-H
9 changes: 0 additions & 9 deletions content/blog/what-is-the-stock-market.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,3 @@ Soon, the Dutch East India Company took this concept to the next level. Instead
2. [Explained | The Stock Market | FULL EPISODE | Netflix](https://www.youtube.com/watch?v=ZCFkWDdmXG8&t=4s)
3. [Wikipedia - Euronext Amsterdam](https://en.wikipedia.org/wiki/Euronext_Amsterdam)
4. [How The Economic Machine Works by Ray Dalio](https://www.youtube.com/watch?v=PHe0bXAIuk0)


---

## Related Reading

- [Derivatives - Options](/blog/derivatives-options)
- [Efficient-Market-Hypothesis](/blog/efficient-market-hypothesis)
- [Stock Multiples](/blog/stock-multiples)
1 change: 0 additions & 1 deletion publisher-v2/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ filters:

# Feature Flags
features:
enable_related_reading: true
optimize_images: true

# Image Optimization Settings
Expand Down
63 changes: 0 additions & 63 deletions publisher-v2/link_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ class LinkProcessor:

def __init__(self, config: Dict):
self.config = config
self.enable_related = config['features'].get('enable_related_reading', True)

def parameterize_title(self, title: str) -> str:
"""Convert note title to URL-safe slug"""
Expand Down Expand Up @@ -120,53 +119,6 @@ def process_images(self, content: str) -> Tuple[str, Set[str]]:

return processed_content, image_deps

def generate_related_section(self, frontmatter: Dict, note_slug: str, already_linked: Set[str] = None) -> str:
"""
Generate Related Reading section from frontmatter

Args:
frontmatter: Note frontmatter dict
note_slug: URL slug of current note (to avoid self-reference)
already_linked: Set of note names already linked in content (to avoid duplicates)

Returns:
Markdown string for related section
"""
if not self.enable_related:
return ""

related = frontmatter.get('related', [])
if not related:
return ""

if already_linked is None:
already_linked = set()

# Filter out self-references, already-linked notes, and convert to links
related_links = []
for item in related:
# Extract note name from wikilink format
note_name = item.strip('[]').split('|')[0]
slug = self.parameterize_title(note_name)

# Skip self-references
if slug == note_slug:
continue

# Skip notes already linked in content
if note_name in already_linked:
continue

related_links.append(f"- [{note_name}](/blog/{slug})")

if not related_links:
return ""

section = "\n\n---\n\n## Related Reading\n\n"
section += "\n".join(related_links)
section += "\n"

return section


def main():
Expand Down Expand Up @@ -206,21 +158,6 @@ def main():
print("After processing images:")
print(processed)
print(f"\nImage dependencies: {images}")
print("\n" + "="*60 + "\n")

# Test related section
frontmatter = {
'title': 'Test Note',
'related': [
'[[Another Note]]',
'[[Deep Dive into Algorithms]]',
'[[Complex Note Title]]'
]
}

related_section = processor.generate_related_section(frontmatter, 'test-note')
print("Generated related section:")
print(related_section)


if __name__ == '__main__':
Expand Down
14 changes: 5 additions & 9 deletions publisher-v2/publisher.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,6 @@ def process_note(self, note_path: Path) -> bool:
processed_content, referenced_notes = self.link_processor.process_wikilinks(content)
processed_content, image_deps = self.link_processor.process_images(processed_content)

# Add related reading section (uses original frontmatter for 'related' field)
# Pass referenced_notes to avoid duplicating links already in content
if self.config['features']['enable_related_reading']:
related_section = self.link_processor.generate_related_section(frontmatter, slug, referenced_notes)
processed_content += related_section

# Process and copy images
self._process_images(image_deps, note_path)
Expand Down Expand Up @@ -337,11 +332,12 @@ def _clean_orphaned_images(self):
# Match ![alt](/images/name.webp) pattern
matches = re.findall(r'!\[[^\]]*\]\(/images/([^)]+)\)', content)
for match in matches:
# Add both the referenced file and its base name (for .png fallback)
# Add the referenced file
referenced_images.add(match)
# Also add the .png version if .webp is referenced
if match.endswith('.webp'):
referenced_images.add(match.replace('.webp', '.png'))
# Also add all related formats (webp, png, jpg) for fallback handling
base_name = Path(match).stem
for ext in ['.webp', '.png', '.jpg', '.jpeg', '.gif']:
referenced_images.add(f"{base_name}{ext}")

# Get all images in static/images
existing_images = set()
Expand Down
Loading