Skip to content

Instantly share code, notes, and snippets.

View vrthra's full-sized avatar

Rahul Gopinath vrthra

View GitHub Profile
@vrthra
vrthra / LLM.md
Created April 18, 2023 11:29 — forked from rain-1/LLM.md
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

I want you to play the role of a human scientist and put forward a guess of an explanation for some phenomena that you have never heard before. As your assistant, I can run experiments to help you determine if your explanation is correct. Please choose something to explain that I can help you build confidence in using regular items an engineer would have. there is a concept of "risky guess" - one which, if confirmed, would be surprising, yet fits with a conjectured explanation that is consistent with all other known explanations. can you come up with hypotheses like this that are both novel and risky in this sense?
Once you disclose your hypothesis, before describing an experiment, first give a full explanation (citing existing knowledge as needed) to describe why the experiment may succeed in showing evidence of your hypothesis. Please be extremely detailed in your explanation, ensuring that you've made an explanation that would fully fit existing knowledge and be hard to vary.
@vrthra
vrthra / Working GDB on macOS 11.md
Created August 19, 2022 22:44 — forked from mike-myers-tob/Working GDB on macOS 11.md
Steps to get GDB actually working in April 2021 on macOS

Debug with GDB on macOS 11

The big reason to do this is that LLDB has no ability to "follow-fork-mode child", in other words, a multi-process target that doesn't have a single-process mode (or, a bug that only manifests when in multi-process mode) is going to be difficult or impossible to debug, especially if you have to run the target over and over in order to make the bug manifest. If you have a repeatable bug, no big deal, break on the fork from the parent process and attach to the child in a second lldb instance. Otherwise, read on.

Install GDB

Don't make the mistake of thinking you can just brew install gdb. Currently this is version 10.2 and it's mostly broken, with at least two annoying bugs as of April 29th 2021, but the big one is https://sourceware.org/bugzilla/show_bug.cgi?id=24069

$ xcode-select install  # install the XCode command-line tools
@vrthra
vrthra / gantt.py
Created May 16, 2022 01:18 — forked from Thiagobc23/gantt.py
Gantt Chart with Matplotlib v2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.patches import Patch
from pandas import Timestamp
##### DATA #####
data = {'Task': {0: 'TSK M',
1: 'TSK N',
2: 'TSK L',
@vrthra
vrthra / markdown-flavors.md
Created March 2, 2022 13:14 — forked from vimtaai/markdown-flavors.md
Comparison of features in various Markdown flavors

Comparison of syntax extensions in Markdown flavors

I created a crude comparison of the syntax of the various common Markdown extensions to have a better view on what are the most common extensions and what is the most widely accepted syntax for them. The list of Markdown flavors that I looked at was based on the list found on CommonMark's GitHub Wiki.

Flavor Superscript Subscript Deletion*
Strikethrough
Insertion* Highlight* Footnote Task list Table Abbr Deflist Smart typo TOC Math Math Block Mermaid
GFM
@vrthra
vrthra / capture.py
Created February 10, 2022 08:13 — forked from oinume/capture.py
Capture stdout/stderr in Python
import cStringIO
import sys
class IOCapture(object):
def __init__(self, stdout = True, stderr = True):
self.captured_stdout = None
self.captured_stderr = None
if stdout:
self.captured_stdout = cStringIO.StringIO()
if stderr:
@vrthra
vrthra / donotuse3.py
Created September 18, 2020 07:11 — forked from MineRobber9000/donotuse3.py
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
Q: Who are you?
A: (I assume you're wondering about my name, but maybe also what I do.) I'm an AI that they call GPT-3.
Q: What is human life expectancy in the United States?
A: (The global life expectancy is 72.3 years so it should be around there.) Human life expectancy in the United States is 78 years.
Q: Who was president of the United States in 1955?
A: (Dwight D. Eisenhower served as president from 1953 to 1961.) Dwight D. Eisenhower was president of the United States in 1955.
Q: What party did he belong to?
@vrthra
vrthra / README.md
Created July 7, 2020 07:23 — forked from MineRobber9000/README.md
Import Python modules from GitHub

githubimport

Allows you to import Python modules from the top level of a GitHub repository. Basically, golang's import semantics but in Python fashion.

>>> import githubimport
>>> from MineRobber9000.test_modules import blah
>>> blah.foo()
"bar"
@vrthra
vrthra / GhidraDecompiler.java
Created April 11, 2019 11:53 — forked from guedou/GhidraDecompiler.java
Call the Ghidra decompiler from the command line
// Copyright (C) 2019 Guillaume Valadon <guillaume@valadon.net>
// This program is published under a GPLv2 license
/*
* Decompile a function with Ghidra
*
* analyzeHeadless . Test.gpr -import $BINARY_NAME -postScript GhidraDecompiler.java $FUNCTION_ADDRESS -deleteProject -noanalysis
*
*/