(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.
| public static String romanNumerals (int value) { | |
| String[] values = { | |
| "M", "CM", "D", "CD", "C", "XC", | |
| "L", "XL", "X", "IX", "V", "IV", "I" | |
| }; | |
| int[] correspondents = { | |
| 1000, 900, 500, 400, 100, 90, | |
| 50, 40, 10, 9, 5, 4, 1 | |
| } |
| package your-package; | |
| import org.bukkit.ChatColor; | |
| import org.bukkit.entity.Player; | |
| import java.awt.*; | |
| import java.awt.image.BufferedImage; | |
| import java.util.HashMap; | |
| /** |
| // https://github.com/Bukkit/CraftBukkit/blob/7e1ac0a77129b169704c1e222ff2deb3ab6cd2d2/src/main/java/net/minecraft/server/EntityPlayer.java#L596 | |
| //Method to open an anvil inventory to a player | |
| public static void openAnvil(Player player, Inventory inventory){ | |
| //Get our EntityPlayer | |
| EntityPlayer p = ((CraftPlayer) player).getHandle(); | |
| //Create the AnvilContainer | |
| AnvilContainer container = new AnvilContainer(p); |
(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.
| """ | |
| Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
| BSD License | |
| """ | |
| import numpy as np | |
| # data I/O | |
| data = open('input.txt', 'r').read() # should be simple plain text file | |
| chars = list(set(data)) | |
| data_size, vocab_size = len(data), len(chars) |