Skip to content

Instantly share code, notes, and snippets.

View ExpHP's full-sized avatar

Michael Lamparski ExpHP

View GitHub Profile
@ExpHP
ExpHP / gpaw-on-cci.md
Last active April 10, 2022 23:53
GPAW on CCI (AiMOS)

GPAW on CCI

First, you will need to get a CCI account. Most of the information you need to get your account set up on AiMOS is here:

Notice that access currently requires 2FA through Google Authenticator.

The purpose of this document is to help you with setting up GPAW on the cluster, after you have an account, as there are numerous issues you are bound to run into that you will likely not have previously encountered on other clusters at RPI. It will assume you are already familiar with ssh, linux, and slurm.

(important: the next couple of things are all from the CCI Wiki (https://secure.cci.rpi.edu/wiki/) and are copied here mostly only to help point out which specific bits of information are important. I will link to the specific pages where each item is found; Please check those pages to verify that this information is up to date.)

@ExpHP
ExpHP / running-unfold.md
Last active June 3, 2021 23:33
running unfold.py
@ExpHP
ExpHP / ast.rs
Created February 6, 2021 21:20
ast
use bstr::{BString};
use crate::meta;
use crate::var::{VarId};
use crate::ident::Ident;
use crate::pos::{Sp, Span};
use crate::error::CompileError;
use crate::type_system::{self, NameId};
// =============================================================================
@ExpHP
ExpHP / gvs.ts
Last active August 27, 2020 18:23
GridViewScroll performance rewrite
/*
* GridViewScroll performance rewrite
* Copyright (c) 2020 Michael Lamparski
* Based on GridViewScroll
* Copyright (c) 2017 Likol Lee
* Both are released under the MIT license:
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
@ExpHP
ExpHP / totally-random-thre-notes.md
Last active June 22, 2020 16:04
totally-random-thre-notes

Completely random Touhou reversing notes

This is a wide variety of completely random stuff that I eventually wanted to put on webpages once they got fleshed out enough, but don't have the time to continue working on atm so I'm just dumping it all here

Most notably this has complete lists of on_tick priorities for almost every STG (just missing a few of the point titles like GFW and ISC)... not that there's much you can do with that information.

Early reversing:

(this section is just personal notes describing what to do early on, because I still need to do this for ISC and GFW)

#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.cm as cm
import matplotlib as mpl
x = np.linspace(0, 10, 500)
y = np.cos(x)
value = 10 * np.cos(x / 3)
alpha = y**2
@ExpHP
ExpHP / anm-manager.md
Last active July 6, 2022 11:21
AnmManager and TH17 1.00b

The ANM manager

TH16 can crash when a large number of enemies and bullets/lasers are destroyed, ruining some score runs. Notably, TH17 1.00a can also crash, but the bug was finally fixed in 1.00b.

Motivated by wanting to understand this crash and perhaps repair it for TH16, I made my best effort to look into the changes between TH17 1.00a and 1.00b. I have not yet figured out the true cause of the crash, but my efforts to discover the cause have forced me to understand even more about how ANMs work.
(Edit 2020/10/07: The reason for the crash is now known!)

Thanks to this, I have now mapped out a significant portion of AnmManager, the single largest struct ever allocated by the game.

The AnmManager structure

@ExpHP
ExpHP / timings.md
Last active April 18, 2020 22:15
1st spell timing data

Time to capture for first spell in TH16 versus TH17

Data collected to determine scaling of DPS between these games.

Fair warning: This was done pretty sloppily. Only one trial per data point. The spells are ones where the boss can move; I chased them down as well as I could. (also played on Easy to make dodging easier).

TH16 timings on first spell at 3 season level (spell has 1700 life)

Char Spring Summer Fall Winter
# This file as a whole is distributed under the GPL v3.
# https://www.gnu.org/licenses/gpl-3.0.en.html
from gpaw import GPAW, PW
from ase import Atoms
from phonopy import Phonopy
from phonopy.structure.atoms import PhonopyAtoms
from phonopy.phonon.band_structure import get_band_qpoints_and_path_connections
from ase.io.vasp import read_vasp
import phonopy
@ExpHP
ExpHP / 0_announcement.md
Last active August 17, 2023 05:22
anm parser info

Announcement regarding this gist

Much of the information here is old and outdated!

Visit my new site at exphp.github.io/thpages.