Skip to content

Instantly share code, notes, and snippets.

@MokoSan
MokoSan / StableIntervals.cs
Created September 26, 2024 19:31
Code to find stable intervals.
using System;
using System.Collections.Generic;
public class TimeSeriesStabilityFinder
{
/// <summary>
/// Finds all stable intervals in the time series based on change and volatility thresholds.
/// </summary>
/// <param name="timeSeries">The time series data as a list of doubles.</param>
/// <param name="maxChangeThreshold">The maximum allowable change between consecutive values.</param>
@MokoSan
MokoSan / youtube_video_chat.py
Created July 7, 2023 06:57
Chatting with Youtube Videos
from langchain.document_loaders import YoutubeLoader
from langchain.indexes import VectorstoreIndexCreator
loader = YoutubeLoader.from_youtube_url("https://www.youtube.com/watch?v=2v6TpRE82Ps", add_video_info=False)
index = VectorstoreIndexCreator().from_loaders([loader])
query = "What are some top spots to visit in Montepulciano?"
index.query(query)
@MokoSan
MokoSan / MemdocQuestions.md
Last active May 20, 2023 20:42
MemDocQuestions.md

What are the definitive signs of performance problems?

Performance problems are indicated by long suspensions, random long GC pauses, and most GCs occurring as full blocking GCs.

What should you do if you notice very long GC pauses?

If the long GC pauses affect the performance metrics that are important to you, you should prioritize and debug the issue. owever, if they don't affect these metrics, it may be more productive to focus on other issues.

What tool is being used to show symptoms of performance problems?

The GCStats view in PerfView is used to show the symptoms of performance problems.

How long should suspension normally take?

@MokoSan
MokoSan / Channel9Links_6.md
Created December 10, 2021 06:41
Almost All the Links for Channel9 - 4/2010 thru 4/2009
@MokoSan
MokoSan / Channel9Links_5.md
Created December 10, 2021 06:39
Almost All the Links for Channel9: 8/2012 - 4/2010
@MokoSan
MokoSan / Channel9Links_4.md
Last active April 2, 2023 15:49
Almost All the Links for Channel9 - 8/2014 - 8/2012
@MokoSan
MokoSan / Channel9Links_3.md
Last active April 2, 2023 15:48
Almost All the Links for Channel9 Up 9/2015 - 8/2014
@MokoSan
MokoSan / Channel9Links_2.md
Last active March 3, 2025 21:18
Almost All the Links for Channel9 - 2/2017 thru 10/2015
@MokoSan
MokoSan / Channel9Links_1.md
Last active April 2, 2023 15:48
Almost All the Links for Channel9 Up Until 2/2017
@MokoSan
MokoSan / HowToLieWithSmallSamples.py
Created November 7, 2021 21:19
How To Lie With Small Samples - Visually Explained.
import numpy as np
import matplotlib.pyplot as plt
np.random.seed(123) # For reproducibility
def std_normal_dist_hist(sample_size):
dataset_1 = np.random.normal(size = sample_size)
plt.hist(dataset_1, density=True, bins=30)
std_normal_dist_hist(10)