(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
Making a custom render type with a custom shader requires a number of things to exist at once:
Note: The vanilla logic does not normally allow namespaces in the shader
This is a high level, non-exhaustive overview on how to migrate your mod from 1.19.4 to 1.20 using Forge.
This primer is licensed under the Creative Commons Attribution 4.0 International, so feel free to use it as a reference and leave a link so that other readers can consume the primer.
If there's any incorrect or missing information, please leave a comment below. Thanks!
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Canvas Hexagonal Map</title> | |
<style type="text/css"> | |
canvas { | |
border:0; | |
display:block; | |
margin:0 auto; |
// Pretty fast - http://jsperf.com/select-vs-natives-vs-jquery | |
/* | |
By, shortcuts for getting elements. | |
*/ | |
var By = { | |
id: function (id) { return document.getElementById(id) }, | |
tag: function (tag, context) { | |
return (context || document).getElementsByTagName(tag) | |
}, | |
"class": function (klass, context) { |
function isAnimatedGif(src, cb) { | |
var request = new XMLHttpRequest(); | |
request.open('GET', src, true); | |
request.responseType = 'arraybuffer'; | |
request.addEventListener('load', function () { | |
var arr = new Uint8Array(request.response), | |
i, len, length = arr.length, frames = 0; | |
// make sure it's a gif (GIF8) | |
if (arr[0] !== 0x47 || arr[1] !== 0x49 || |
//http://www.w3.org/TR/2011/WD-page-visibility-20110602/ | |
(function () { | |
"use strict"; | |
//no need to shim if it's already there | |
if ( 'hidden' in document && 'onvisibilitychange' in document ) { | |
return; | |
} | |
//fail silently if the browser sux |
These examples are presented in an attempt to show how each coding styles attempts to or does not attempt to isolate side-effects. There are only 2 semantic elements in a barebone "Hello World" implementation:
console.log
HELLO_WORLD
Since every coding style can abstract away data into a parameter or variable, there is no point for us to show that. All implementations assume HELLO_WORLD
is a constant that is always inlined. This way it reduces the variations we need to present. (To make an anology, if we were to implement incrementByOne
, would we need to inline the number 1
or pass it in as parameter?)
CAVEAT/LIMITATION: All implementations also assume console
is static global. In case of functional programming, console.log
is asumed to be a function that can be passed around without further modification. (This is not the case in the browser, but that can be resolved with console.log.bind(console)
)