This file contains hidden or 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 <vector> | |
#include <iostream> | |
enum KeyState { | |
UP, | |
DOWN | |
}; | |
class KeyHandler{ | |
public: |
This file contains hidden or 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
const std = @import("std"); | |
const eEnumUntyped = enum { | |
val1, | |
val2, | |
val3, | |
val4 | |
}; | |
const eEnumTyped = enum (u32) { |
This file contains hidden or 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
let len = messages.length; | |
for (let i = 0; i < len; i++) { | |
let min = i; | |
for (let j = i + 1; j < len; j++) { | |
if (messages[j].timestamp > messages[min].timestamp) { | |
min = j; | |
} | |
} | |
if (min !== i) { | |
let tmp = messages[i]; |
This file contains hidden or 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
// vector / koordinat 3 dimensi | |
typedef struct t_vec3d{ | |
float x, y, z; | |
} Vec3D | |
// struct untuk transform | |
typedef struct t_transform_matrix { | |
Vec3D rotation; | |
Vec3D translation; | |
Vec3D scale; |
This file contains hidden or 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> | |
#include <gl/glut.h> | |
#include <math.h> | |
void | |
OnDisplayRender(void) { | |
glClear(GL_COLOR_BUFFER_BIT); | |
glPointSize(15); | |
This file contains hidden or 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 <GL/glut.h> | |
#include <iostream> | |
#include <vector> | |
// DEFINITIONS // | |
template <typename T> | |
struct Vec2 { | |
T x; | |
T y; |
This file contains hidden or 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
print("".join(i.upper() if i in "aiueo" else i for i in [chr(((ord(i)-96)%26)+97) if i in "abcdefghijklmnopqrstuvwxyz" else i for i in input().lower()])) |
This file contains hidden or 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
/** | |
* Simple Snippets For Checking Operating System | |
* | |
* @param None | |
* @return "*nix" for unix Based System, "macs" for Various MacOS Based System, "wint" for Windows | |
*/ | |
private static String checkOS() | |
{ | |
String _os = System.getProperty("os.name"); |