Skip to content

Instantly share code, notes, and snippets.

View csm10495's full-sized avatar

Charles Machalow csm10495

View GitHub Profile
@csm10495
csm10495 / enumToPyDict.py
Created May 8, 2016 06:41
Script to make a Python dictionary from C++ enum
"""
Brief:
This file can be used to make a Python dict from a c++ enum.
Simply copy-paste the enum from typedef to end as input and
out.txt will be created with it as a Python dict.
Author:
Charles Machalow
"""
@csm10495
csm10495 / structToPython.py
Last active May 8, 2016 06:42
Script to make a ctypes Structure from C++ enum
"""
Brief:
This file can be used to make a ctypes Structure from a c++ struct.
Simply copy-paste the structure from typedef to end as input and
out.txt will be created with it as a Structure
You may need to make some type fixes...
Author:
Charles Machalow
"""
@csm10495
csm10495 / enumToString.py
Created January 4, 2016 06:00
Python Script to make a function to get a std::string for a given C++ enum's values.
"""
Brief:
This file can be used to convert C++ enum code into a function to get a std::string from enum value.
To use: Copy and paste the entire enum code (from MSDN) as input to the script.
Output goes to an 'out.txt' file.
Author:
Charles Machalow
"""
lowCaseFirstLetter = lambda s: s[:1].lower() + s[1:] if s else ''
@csm10495
csm10495 / bdm241.py
Created October 18, 2015 17:29
Bomb Defusal Helper
"""
bdm241.py - Bomb Defusal Manual Version 1. Verification Code 241.
This file contains functions to solve various challenges faster than using the guide for 'Keep Talking and Nobody Explodes'
(C) - Charles Machalow - MIT License
"""
import itertools
words = ["about", "after", "again", "below", "could", "every", "first", "found", "great", "house", "large", "learn", "never", "other", "place", "plant", "point", "right", "small", "sound", "spell", "still", "study", "their", "there", "these", "thing", "think", "three", "water", "where", "which", "world", "would", "write"]
morse_seqs = {
"""
iseq.py - A script for comparing the speed of is, ==, and neither with boolean values
csm10495 - Charles Machalow - MIT License
Hint: Usually == is slowest. Neither is fastest
"""
import timeit
def testN(n=1000):
"""