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 <uwsgi.h> | |
static int router_mkdir_func(struct wsgi_request *wsgi_req, struct uwsgi_route *ur) { | |
char **subject = (char **) (((char *)(wsgi_req))+ur->subject); | |
uint16_t *subject_len = (uint16_t *) (((char *)(wsgi_req))+ur->subject_len); | |
struct uwsgi_buffer *ub = uwsgi_routing_translate(wsgi_req, ur, *subject, *subject_len, ur->data, ur->data_len); | |
if (!ub) return UWSGI_ROUTE_BREAK; |
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
public static class PoolManager | |
{ | |
private const int initialItems = 10; | |
private static Dictionary<Type, Queue<object>> pools; | |
public static T Get<T>() where T : class, new() | |
{ | |
if (!pools.ContainsKey(typeof(T))) | |
{ | |
pools[typeof(T)] = new Queue<T>() as Queue<object>; |
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> | |
#include <stdlib.h> | |
int aiv_strlen(char *str) | |
{ | |
// 100 100 | |
char *original_ptr = str; | |
while(*str) { | |
str++; |
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
clang -o engine.exe -I glfw-3.2.1.bin.WIN64/include/ -L glfw-3.2.1.bin.WIN64/lib-vc2015/ engine.c -lglfw3dll -lopengl32 |
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 "aiv_math.h" | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
struct player | |
{ | |
int width; | |
int height; | |
char *name; |
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 "aiv_math.h" | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
struct player | |
{ | |
int width; | |
int height; | |
char *name; |
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
static void Main(string[] args) | |
{ | |
int width = 80; | |
int height = 20; | |
// iterate each y | |
for (int y = 0; y < height; y++) | |
{ | |
// iterate each x | |
for (int x = 0; x < width; x++) |
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
static void DrawChessboard(int width, int height) | |
{ | |
// iterate each y | |
for (int y = 0; y < height; y++) | |
{ | |
// iterate each x | |
for (int x = 0; x < width; x++) | |
{ | |
// on pair y, draw black odd x | |
if (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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class MoveTowards : MonoBehaviour | |
{ | |
public float speed; | |
public Transform myBase; |
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
using UnityEngine; | |
public class FindBestMineral : MonoBehaviour | |
{ | |
// Use this for initialization | |
void Start() | |
{ | |
OlderNewer