This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import enum | |
from PySide2 import QtCore | |
from PySide2.QtWidgets import QApplication, QWidget, QMainWindow, QLabel, QPushButton, QVBoxLayout | |
def fibo(): | |
a = 0 | |
b = 1 | |
while True: | |
c = a + b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ref: https://sjohannes.wordpress.com/tag/win32/ | |
from __future__ import print_function | |
import ctypes | |
from ctypes import windll | |
import sys | |
Win32 = windll.user32 | |
EnumWindowsProc = ctypes.WINFUNCTYPE(ctypes.c_int, ctypes.POINTER(ctypes.c_int), ctypes.POINTER(ctypes.c_int)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() | |
{ | |
char text[] = { 'U', 'N', 'I', 'X' }; | |
uint16_t* p = reinterpret_cast<uint16_t*>(text); | |
for (int i = 0; i < sizeof(text)/sizeof(uint16_t); i++) | |
{ | |
uint16_t a = *p; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{axis: [0.0,0.7078125,0.0], w: 0.70781255} | |
{axis: [0.0,-0.70922744,0.0], w: 0.7064004} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
uniform float rows; | |
uniform float cols; | |
void main() | |
{ | |
int x = int(floor(gl_TexCoord[0].x * cols)); | |
int y = int(floor(gl_TexCoord[0].y * rows)); | |
if (mod(x + y, 2) == 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PShader sh; | |
PShader f; | |
PShape square; | |
PGraphics canvas; | |
void setup() { | |
size(640, 480, P3D); | |
canvas = createGraphics(width, height, P3D); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
struct Fog { | |
float start; | |
float density; | |
vec3 color; | |
}; | |
uniform Fog fog; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// fragment shader | |
uniform sampler2D tex; | |
uniform vec2 viewport; | |
uniform vec2 origin; | |
uniform float radius; | |
uniform float attenuation; | |
uniform vec3 background_color; | |
void main() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
uniform vec3 light_direction; | |
varying vec3 vertex_normal; | |
varying vec3 vertex_color; | |
void main(void) { | |
vec3 N = normalize(vertex_normal); | |
vec3 L = normalize(light_direction); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#version 120 | |
uniform vec3 light_direction; | |
varying vec3 vertex_normal; | |
varying vec3 vertex_color; | |
void main(void) { | |
vec3 N = normalize(vertex_normal); | |
vec3 L = normalize(light_direction); |
NewerOlder