The use of __main__.py
to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py
:
print("Hello")
/** | |
* Advanced Window Snap | |
* Snaps the Active Window to one of nine different window positions. | |
* | |
* @author Andrew Moore <[email protected]> | |
* @version 1.0 | |
*/ | |
/** | |
* SnapActiveWindow resizes and moves (snaps) the active window to a given position. |
The use of __main__.py
to create executables
myprojectfolder/
|_ __main__.py
|_ __init__.py
Being __main__.py
:
print("Hello")
'''Demonstrate the "prime number conspiracy" as described at | |
https://www.quantamagazine.org/20160313-mathematicians-discover-prime-conspiracy/ | |
"Among the first billion prime numbers, for instance, a prime ending in | |
9 is almost 65 percent more likely to be followed by a prime ending in 1 | |
than another prime ending in 9. In a paper posted online today, Kannan | |
Soundararajan and Robert Lemke Oliver of Stanford University present | |
both numerical and theoretical evidence that prime numbers repel other | |
would-be primes that end in the same digit, and have varied | |
predilections for being followed by primes ending in the other possibl |
# This is a simplified version of a more complex problem I'm trying to solve. | |
# search() seems to have the desired behavior (see docstring), but seems a bit clumsy. | |
# Is there a more pythonic way to do this? | |
def search(my_list, my_dict, search_term): | |
"""Example Output: | |
--- | |
>>> l = [1, 2, 3, 4] | |
>>> d = {1: "foo", 2: "bar", 3: "baz", 4: "baz"} | |
>>> search(l, d, "borkborkbork") |
#include "mu.h" | |
#define _CRT_SECURE_NO_WARNINGS | |
#include <malloc.h> | |
#define _USE_MATH_DEFINES | |
#include <math.h> | |
#define _NO_CRT_STDIO_INLINE | |
#include <stdio.h> | |
#include <stdarg.h> | |
#define NO_STRICT |
#define BINKGL_LIST \ | |
/* ret, name, params */ \ | |
GLE(void, LinkProgram, GLuint program) \ | |
GLE(void, GetProgramiv, GLuint program, GLenum pname, GLint *params) \ | |
GLE(GLuint, CreateShader, GLenum type) \ | |
GLE(void, ShaderSource, GLuint shader, GLsizei count, const GLchar* const *string, const GLint *length) \ | |
GLE(void, CompileShader, GLuint shader) \ | |
GLE(void, GetShaderiv, GLuint shader, GLenum pname, GLint *params) \ | |
GLE(void, GetShaderInfoLog, GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog) \ | |
GLE(void, DeleteShader, GLuint shader) \ |
#define COBJMACROS | |
#define INITGUID | |
#include <intrin.h> | |
#include <windows.h> | |
#include <d3d11.h> | |
#include <gl/GL.h> | |
#include "glext.h" // https://www.opengl.org/registry/api/GL/glext.h | |
#include "wglext.h" // https://www.opengl.org/registry/api/GL/wglext.h |
/* | |
I'm dropping this from the game in favour of a more dynamic system, but I wanted to keep this around somewhere because | |
I'll be using this 'pattern' for something similar again and didn't want to fuss with sytax. Maybe you'll find it useful | |
*/ | |
#define ANIM_LIST \ | |
/* EnumName, var_name, max */ \ | |
ALF(Invalid, invalid, 1) \ | |
ALF(Idle, idle, 4) \ | |
ALF(Spawn, spawn, 4) \ | |
ALF(Taunt, taunt, 2) \ |
LIBRARY WRITING REFERENCE LIST | |
=============================== | |
1.) Designing and Evaluating Reusable Components (Casey Muratori: http://mollyrocket.com/casey/stream_0028.html) | |
---------------------------------------------------------------------------------------------------------------- | |
_THE_ reference on API design up to this day on the internet. Nobody should write a library without having seen this. | |
I come back to this talk every N number of weeks it is that good. | |
2.) stb_howto (Sean Barrett: https://github.com/nothings/stb/blob/master/docs/stb_howto.txt) | |
-------------------------------------------------------------------------------------------- | |
Sean Barretts single header libraries (https://github.com/nothings/stb) was the first time for me that I came across |
# OBJECTIVE: Install Arch Linux with encrypted root and swap filesystems and boot from UEFI. | |
# Note this encrypted installation method, while perfectly correct and highly secure, CANNOT support encrypted /boot and | |
# also CANNOT be subsequently converted to support an encrypted /boot!!! A CLEAN INSTALL will be required! | |
# Therefore, if you want to have an encrypted /boot or will want an encrypted /boot system at some point in the future, | |
# please ONLY follow my encrypted /boot installation guide, which lives here: |