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
/* | |
Example structure | |
┌─── NeuralLayer 1 ────┐ | |
│ Inputs (source data) │ | |
│ Outputs (1) │ | |
└─────vvvvvvvvvvvv─────┘ | |
┌─── NeuralLayer 2 ────┐ | |
│ Inputs = Outputs (1) │ | |
│ Outputs (2) │ | |
└─────vvvvvvvvvvvv─────┘ |
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
-- Minetest Lua mod to have a rudimentary display of the biomes in your world | |
-- CC0, Written by Krock/SmallJoker 2019 | |
-- Sample image: https://krock-works.uk.to/u/ethereal_cc57167_ASCII_map.png | |
local STEPSIZE = 32 | |
local X_RADIUS = 1000 | |
local Z_RADIUS = 1000 | |
local CHARACTERS = { | |
"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
// g++ vectortest.cpp | |
/* | |
emplace_back: 553305 ticks | |
push_back: 665359 ticks | |
resize: 437487 ticks | |
*/ | |
// g++ -O3 -ffast-math vectortest.cpp | |
/* | |
emplace_back: 165961 ticks | |
push_back: 165695 ticks |
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
Values below show absolute/relative times spend per server step by the instrumented function. | |
A total of 8885 samples were taken | |
instrumentation | min µs | max µs | avg µs | min % | max % | avg % | |
-------------------------------------------------------- | --------- | --------- | --------- | ----- | ----- | ------ | |
mesecons: | 1 | 161770 | 86 | 0.0 | 99.1 | 3.3 | |
- globalstep[1] ..................................... | 1 | 161768 | 84 | 0.0 | 99.0 | 2.5 | |
- on_placenode[1] ................................... | 17 | 25 | 21 | 2.5 | 6.3 | 4.8 | |
- on_dignode[1] ..................................... | 13 | 49 | 21 | 0.6 | 10.3 | 6.2 |
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 <cmath> | |
#include <cstdint> | |
#include <cstring> | |
#include <iostream> | |
#include <iomanip> | |
#include <chrono> | |
#include <cassert> | |
typedef uint8_t u8; | |
typedef int8_t s8; |
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
#!/bin/bash | |
# License: CC0 | |
# How to use: | |
# 1) Open the terminal in the target mod directory | |
# 2) Call the script | |
files=$(find . -name "*.lua") | |
ref_call() |
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
/* | |
Code to serialize and deserialize a world | |
Copyright (C) 2015 Krock/SmallJoker <[email protected]> | |
This library is free software; you can redistribute it and/or | |
modify it under the terms of the GNU Lesser General Public | |
License as published by the Free Software Foundation; either | |
version 2.1 of the License, or (at your option) any later version. |
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
-- collect items (based on PilzAdam's item_drop mod) | |
local ttime = 0 | |
minetest.register_globalstep(function(dtime) | |
ttime = ttime + dtime | |
if ttime < 1 then return end | |
ttime = 0 | |
for _,player in ipairs(minetest.get_connected_players()) do | |
if player:get_hp() > 0 and not player:get_player_control().LMB then |
NewerOlder