Skip to content

Instantly share code, notes, and snippets.

View QuantumNovice's full-sized avatar
🎯
Reinventing

Haseeb / 하시브 QuantumNovice

🎯
Reinventing
View GitHub Profile
@QuantumNovice
QuantumNovice / Villengard's Algorithm.py
Created May 22, 2024 01:41
The Villengard Algorithm was an artificial intelligence and set of rules implemented across multiple different kinds of technology such as weapons, designed in the Villengard Weapon Factories. The purpose of this algorithm was maintaining an "acceptable casualty rate" in order to keep conflict going, and therefore increase profits through sales …
import random
import time
class VillengardAlgorithm:
def __init__(self):
self.weapons_sold = 0
self.casualty_rate = 0.01 # Initial minimal casualty rate
self.war = False
def check_for_war(self):
$$\begin{equation} \nabla^2 u + k^2 u = 0 \end{equation}$$
@QuantumNovice
QuantumNovice / Boore-Atkinson GMPE.py
Created October 31, 2023 07:52
Boore-Atkinson GMPE calculation simple python
from math import log,exp
# Define site-specific parameters
#(e.g., soil type, location)
site_class = "A" # Site class: A, B, C, D, or E
latitude = 34.05 # Latitude of the site (in degrees)
longitude = -118.24 # Longitude of the site (in degrees)
return_period = 475 # Return period in years
# Define the GMPE coefficients for your chosen GMPE model
# These coefficients would be specific to the GMPE you are using
@QuantumNovice
QuantumNovice / png to jpg using ffmpeg.
Created June 15, 2023 02:10
Powershell command to convert pngs in a folder to jpgs using ffmpeg.
ForEach($x in (Get-ChildItem -Filter *.png)){ffmpeg -i $x "jpg/$($x.Basename).jpg" }
@QuantumNovice
QuantumNovice / ToggleNotificationAreaIcons.ahk
Created February 12, 2023 09:31
Autohotkey script to toggle notification area icons in windows (tested with windows 10)
#Requires AutoHotkey v2.0-a
Run A_ComSpec ' /c "%windir%\explorer.exe shell:::{05d7b0f4-2121-4eff-bf6b-ed3f69b894d9}"'
Sleep 2000
if WinExist("Notification Area Icons")
WinActivate ; Use the window found by WinExist.
ControlClick "Button3", "Notification Area Icons"
WinClose "Notification Area Icons"
import argostranslate.package
import argostranslate.translate
from argostranslate.translate import translate, get_installed_languages
from_code = "en"
to_code = "es"
en, es = get_installed_languages() # [LanguageModel_English, LanguageModel_Spanish]
translator = es.get_translation(en)
import argostranslate.package
import argostranslate.translate
from_code = "en"
to_code = "es"
# Download and install Argos Translate package
argostranslate.package.update_package_index()
available_packages = argostranslate.package.get_available_packages()
package_to_install = next(
@echo off
For /f "tokens=2-4 delims=/ " %%a in ('date /t') do (set mydate=%%c-%%a-%%b)
For /f "tokens=1-2 delims=/:" %%a in ('time /t') do (set mytime=%%a%%b)
git add .
git commit -m "Autocommit %mydate%_%mytime%'
git push origin main
using CSiAPIv1;
using System;
using static Globals;
namespace ETABSPlugin
{
public class cPlugin
{
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.