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 tensorflow as tf | |
import numpy as np | |
class SpecNorm(object): | |
def build(self, input_shape): | |
self.indim = input_shape[-1] * np.array(self.kernel_size).prod() | |
self.outdim = self.filters | |
self.u = self.add_variable(name='u', shape=(1, self.indim), trainable=False) | |
self.v = self.add_variable(name='v', shape=(self.outdim, 1), trainable=False) | |
super().build(input_shape) |
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
[n.global] | |
output = sfml | |
[n.include] | |
/usr/local/include/SFML/ | |
[Window/VideoMode.h] | |
preprocess = true | |
defines = true |
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
SherjilOzair:build sherjilozair$ examples/05_triangle | |
Initialized SDL: '' | |
[2018-05-04 20:20:01.819393][Error] Error in OpenGL call: | |
Location: /Users/sherjilozair/gf/library/Window.cc:111 | |
Expression: glEnable(GL_BLEND) | |
Error: GL_INVALID_ENUM | |
Description: An unacceptable value is specified for an enumerated argument. | |
Gamedev Framework (gf) example #05: Triangle | |
This example prints the hello world triangle of OpenGL. | |
You can click on the screen to see the screen coordinates and world coordinates. |
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 "animal.h" | |
void Animal::inc(int i){ | |
this->counter += i; | |
} | |
void Animal::say(){ | |
std::cout << this->counter << std::endl; | |
} |
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 <SDL2/SDL.h> | |
#ifdef __APPLE__ | |
#include <OpenGL/gl3.h> | |
#include <OpenGL/gl3ext.h> | |
#else | |
#include <GL/gl.h> | |
#endif | |
#include <stdbool.h> | |
#define CODE(...) #__VA_ARGS__ |
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 <stdio.h> | |
typedef struct Color{ | |
int r, g, b, a | |
} Color; | |
typedef struct Vertex{ | |
float x, y, z; | |
Color color; | |
} Vertex; |
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 <OpenGL/gl3.h> | |
#include <SDL2/SDL.h> | |
#define SOKOL_IMPL | |
#define SOKOL_GLCORE33 | |
#include <sokol_gfx.h> | |
#define STB_IMAGE_IMPLEMENTATION | |
#include <stb_image.h> | |
#define CODE(...) #__VA_ARGS__ |
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
/* | |
* Nuklear - 1.32.0 - public domain | |
* no warrenty implied; use at your own risk. | |
* authored from 2015-2016 by Micha Mettke | |
*/ | |
/* | |
* ============================================================== | |
* | |
* API | |
* |
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
-- ~celeste~ | |
-- matt thorson + noel berry | |
-- globals -- | |
------------- | |
room = { x=0, y=0 } | |
objects = {} | |
types = {} | |
freeze=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
import numpy as np | |
import itertools | |
import gym | |
import random | |
env = gym.make("BowlingNoFrameskip-v4") | |
def enact(step, partitions, actions): | |
step = step % partitions[-1] | |
for p, a in zip(partitions, actions): | |
if step < p: |