Skip to content

Instantly share code, notes, and snippets.

View thetooth's full-sized avatar

Jeff Jenner thetooth

View GitHub Profile
#include "level.h"
void level::load(const char* mapFilename){
// Open level file and parse json
std::ifstream mapDataFile(mapFilename);
json::Value mapJson;
json::read(mapDataFile, mapJson);
width = mapJson.GetIntMember("width");
height = mapJson.GetIntMember("height");
#pragma once
#include <kami.h>
class Dialog {
public:
float time, duration;
std::wstring buffer, target;
klib::Point<int> pos;
klib::Font font;
void Path::Follow(AI &ai){
float nx, ny;
if (!ai.casual && index < nodeList.size() && index < 4){
auto node = (int)nodeList[index];
ny = node / solver->mapWidth;
nx = node - ny * solver->mapWidth;
nx *= PATH_DIVISOR;
## Last changed: 2014-08-11 18:41:38 EST
version 12.1X46-D20.5;
groups {
wiz_PPPoE_0 {
system {
services {
dhcp {
propagate-ppp-settings pp0.0;
}
}
@thetooth
thetooth / spictl.vhd
Last active August 29, 2015 14:22
Controller FSM
library ieee;
use ieee.std_logic_1164.all;
library MACHXO2;
use MACHXO2.components.all;
-- Opcode Size Description CMD Access
------------------------------------------------------------------------------------------
-- Operation codes for SPI FSM
------------------------------------------------------------------------------------------
-- INJMDR 16 Injector main delta 0xA0 Write
2015/08/25 01:55:58 Starting worker 1
2015/08/25 01:55:58 Starting worker 2
2015/08/25 01:55:58 Server listening on port 9072
2015/08/25 01:56:04 Received work requeust
2015/08/25 01:56:04 Dispatching work request
2015/08/25 01:56:04 Worker 1: Received work request for M:/Development/Web/Plusmore/RenderJobs/data/AGDG_Logo 2_2.mp4
2015/08/25 01:56:34 Received work requeust
2015/08/25 01:56:34 Dispatching work request
2015/08/25 01:56:34 Worker 2: Received work request for M:/Development/Web/Plusmore/RenderJobs/data/1337 haxor needs more time.mp4
2015/08/25 01:57:18 Worker 1: Render job for M:/Development/Web/Plusmore/RenderJobs/data/AGDG_Logo 2_2.mp4 completed successfuly
M:\Development\Web\Plusmore\RenderJobs>go test src\dispatch\worker_test.go -v
=== RUN TestRenderJob
2015/09/12 23:16:46 Starting worker 1
2015/09/12 23:16:46 Starting worker 2
2015/09/12 23:16:46 Starting worker 3
2015/09/12 23:16:46 Starting worker 4
2015/09/12 23:16:46 Received work requeust
2015/09/12 23:16:46 Received work requeust
2015/09/12 23:16:46 Dispatching work request
2015/09/12 23:16:46 Worker 2: Received work request
// local ram 0x100-1FF, external 0x200-2FF
__xdata Stack openList; // Stack is allocated on the stack at 0x108
initStack(&openList); // doesn't work because it expects an ext ram address but has local
__xdata Stack* openList; // Stack is referenced on the heap at 0x200
initStack(openList); // works???
Total: connections 10000 requests 9999 replies 9999 test-duration 10.017 s
Connection rate: 998.3 conn/s (1.0 ms/conn, <=154 concurrent connections)
Connection time [ms]: min 0.9 avg 4.9 max 458.1 median 1.5 stddev 21.1
Connection time [ms]: connect 1.4
Connection length [replies/conn]: 1.000
Request rate: 998.2 req/s (1.0 ms/req)
Request size [B]: 83.0
proxy:
image: jwilder/nginx-proxy
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
ports:
- "80:80"
redis:
image: redis