Skip to content

Instantly share code, notes, and snippets.

View TheBlackPlague's full-sized avatar
💭
I'm working on two big projects.

Shaheryar Sohail TheBlackPlague

💭
I'm working on two big projects.
  • Pittsburgh, US
View GitHub Profile
template<Side Side>
void MakeMove(const Move<> move)
{
assert(this->Info.SideToMove() == Side, "Provided side to move does not align with position info");
this->Info.FlipSideToMove();
this->Zobrist = ZobristHash(this->Zobrist);
const Square origin = move.Origin();
const Square target = move.Target();
std::__1::array<int, 1ul> MantaRay::ActivateFlattenAndForward<&MantaRay::ClippedReLU<short, (short)0, (short)255>::Activate(short), short, int, 256ul, 1ul>(std::__1::array<short, 256ul> const&, std::__1::array<short, 256ul> const&, std::__1::array<short, 256ul * 2 * 1ul> const&, std::__1::array<short, 1ul> const&):
sub sp, sp, #128
stp d9, d8, [sp, #16]
stp x28, x27, [sp, #32]
stp x26, x25, [sp, #48]
stp x24, x23, [sp, #64]
stp x22, x21, [sp, #80]
stp x20, x19, [sp, #96]
stp x29, x30, [sp, #112]
str x3, [sp, #8]
@TheBlackPlague
TheBlackPlague / grover_algorithm.py
Created May 2, 2025 09:05
A naive implementation of Grover's Algorithm, configured to run on IBM's Quantum Computer (you may change the backend to Aer for simulation purposes).
# ---- IBM [START]
from os import environ
from qiskit_ibm_runtime import QiskitRuntimeService, IBMBackend, SamplerV2 as Sampler, SamplerOptions
from qiskit_ibm_runtime.options import DynamicalDecouplingOptions
SERVICE: QiskitRuntimeService = QiskitRuntimeService(channel="ibm_quantum", token=environ["IBM_QUANTUM_TOKEN"])
def get_backend(n: int) -> IBMBackend:
//
// Copyright (c) 2023 StockDory authors. See the list of authors for more details.
// Licensed under LGPL-3.0.
//
#ifndef STOCKDORY_PERFTRUNNER_H
#define STOCKDORY_PERFTRUNNER_H
#include <chrono>
#include <iostream>
//
// Copyright (c) 2025 Keplerium authors. See the list of authors for more details.
// Licensed under MIT.
//
#ifndef VECTOR_H
#define VECTOR_H
#include <array>
@TheBlackPlague
TheBlackPlague / StockDory Assembly.x86asm
Last active March 22, 2025 23:11
x86 Linux Assembly of StockDory for RE purposes
This file has been truncated, but you can view the full file.
; Licensed under https://github.com/TheBlackPlague/StockDory/blob/master/LICENSE - Compiled on EPYC 7B with Clang 20
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string<std::allocator<char> >(char const*, std::allocator<char> const&):
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
leaq 16(%rdi), %r12
movq %r12, (%rdi)
This file has been truncated, but you can view the full file.
; Licensed under https://github.com/TheBlackPlague/StockDory/blob/master/LICENSE
___cxx_global_var_init:
sub sp, sp, #288
stp x28, x27, [sp, #240]
stp x20, x19, [sp, #256]
stp x29, x30, [sp, #272]
add x29, sp, #272
Lloh0:
adrp x8, ___stack_chk_guard@GOTPAGE
@TheBlackPlague
TheBlackPlague / copy_settings.ps1
Last active January 18, 2025 23:44
Copy EVE Online Settings across accounts and characters.
$main_user = ""
$main_char = ""
$settings = "$env:LOCALAPPDATA\CCP\EVE\g_ccp_eve_tq_tranquility\settings_Default"
$backup_settings = "$settings\backup_settings"
Set-Location -Path $settings
Robocopy $settings $backup_settings /XC /XN /XO
Copy-Item -Path "core_user_$main_user.dat" -Destination "main_user.dat" -Force
@TheBlackPlague
TheBlackPlague / killmail_data_loader.py
Created October 5, 2024 01:05
Loads killmails from EVERef style data folder.
import os
import pickle
import tarfile
import json
from types import SimpleNamespace
from tqdm import tqdm
def parse_killmail(json_string, restriction_callback=None) -> SimpleNamespace or None:
result = json.loads(json_string, object_hook=lambda d: SimpleNamespace(**d))
import java.util.Scanner;
public class GradeCalculator {
public static void main(String[] args) {
try (Scanner input = new Scanner(System.in)) {
while (true) {
System.out.print("Please enter your grade: ");
double grade = input.nextDouble();