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
#! /usr/bin/perl | |
use warnings; | |
use strict; | |
sub slurp { | |
my $filename = shift; | |
local $/; | |
open my $fh, '<', $filename | |
or die "open: $filename: $!\n"; |
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
{-# OPTIONS -Wall #-} | |
module Creepsay where | |
-- ^ This file has some random scribblings for Screeps Diplomacy | |
-- protocol discussion. Most of the things in here are not directly | |
-- of use, but might help for assembling reference examples, once we | |
-- figure out how the various layers should work. | |
-- | |
-- The 62k suffix entries are "base62k" encoding, i.e. using all of | |
-- the UCS2 space except for the 0xd800-0xdfff region historically |
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
local component = require("component") | |
local computer = require("computer") | |
function getPIDObject(kp, ki, kd, minclamp, maxclamp, inputMethod, outputMethod) | |
local retObj = {} | |
retObj.kp = kp | |
retObj.ki = ki | |
retObj.kd = kd | |
retObj.minclamp = minclamp | |
retObj.maxclamp = maxclamp |
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
{-# LANGUAGE TupleSections #-} | |
module Delaunay where | |
import qualified Data.Function as F | |
import qualified Data.List as L | |
import Data.Map.Strict (Map) | |
import qualified Data.Map.Strict as Map | |
import Data.Set (Set) | |
import qualified Data.Set as Set |
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
override fun process(inputs: Array<Double?>, deltaTime: Double): Double { | |
val error = (inputs[0] ?: 0.0) - (inputs[1] ?: 0.0) | |
val deltaError = error - lastError | |
lastError = error | |
errorIntegral += error * deltaTime | |
val result = Kp * error + Ki * errorIntegral + Kd * deltaError / deltaTime | |
if (Ki > 0 && (result > 50.0 || result < 0.0)) { | |
val clamp = Math.max(Math.min(result,50.0),0.0) | |
errorIntegral = (clamp-Kp*error-Kd*deltaError/deltaTime)/Ki | |
return clamp |
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
#! /usr/bin/python3 | |
# small helper script for bundling up factorio mods redistributable | |
# under BSD3 or MIT terms as desired | |
import json | |
import subprocess | |
with open("info.json") as info_file: | |
info = json.load(info_file) |
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
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE Haskell2010 #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
module Main where | |
import Prelude (IO, return, undefined) |
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
---- Minecraft Crash Report ---- | |
// Sorry :( | |
Time: 12/12/18 7:56 PM | |
Description: Ticking memory connection | |
cpw.mods.fml.relauncher.ReflectionHelper$UnableToFindMethodException: java.lang.NoSuchMethodException: net.minecraft.client.multiplayer.PlayerControllerMP.k() | |
at cpw.mods.fml.relauncher.ReflectionHelper.findMethod(ReflectionHelper.java:187) | |
at ru.denull.BugPatch.mod.ClientEvents.blockBreak(ClientEvents.java:33) | |
at cpw.mods.fml.common.eventhandler.ASMEventHandler_59_ClientEvents_blockBreak_BreakEvent.invoke(.dynamic) |
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
---- Minecraft Crash Report ---- | |
// Shall we play a game? | |
Time: 12/16/18 2:55 PM | |
Description: Unexpected error | |
java.lang.ArrayIndexOutOfBoundsException: 1 | |
at tconstruct.smeltery.logic.SmelteryLogic.heatItems(SmelteryLogic.java:466) | |
at tconstruct.smeltery.logic.SmelteryLogic.func_145845_h(SmelteryLogic.java:307) | |
at tconstruct.smeltery.logic.SmelteryLogic.func_70296_d(SmelteryLogic.java:705) |
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
// assumptions | |
// va - dbref of the hook object | |
// vb - dbref of the command object | |
// _posebreak - per-user attr for posebreak on/off before/after | |
// defaults to 00 (off/off) | |
// posebreak - per-user function for posebreak content | |
// defaults to %r (a blank line) | |
// posebreak - before |
OlderNewer