Skip to content

Instantly share code, notes, and snippets.

import java.util.*;
public class AdditionUnderXOR {
static final int SS = 1000000;
enum Ore {
COAL(60005),
IRON(60006),
@Drovolon
Drovolon / 1.14.x-chunk-loading-final.md
Created August 11, 2019 14:36
An overview of chunk loading mechanics in Minecraft 1.14, tested empirically in 1.14.4.

1.14.x Chunk Loading

Chunk loading operates differently in 1.14 than in previous Minecraft versions. This document is intended to be an overview of the 1.14 system.

In 1.14, chunk loading starts with tickets. A ticket is:

  • a ticket type
  • a load level
  • optionally, a time-to-live
@unix-junkie
unix-junkie / Font Antialiasing Test.html
Last active June 11, 2021 10:36
Grayscale vs subpixel font antialiasing
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Font Antialiasing Test</title>
</head>
<body alink="#000088" link="#0000FF" vlink="#FF0000">
<ul style="color: #000000; background: #ffffff;">
<li style="-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;">This text uses grayscale antialiasing</li>
<li style="-webkit-font-smoothing: subpixel-antialiased; -moz-osx-font-smoothing: auto;">This text uses subpixel antialiasing if available (i.e. if "LCD font smoothing" is enabled in <i>Mac OS X</i> preferences)</li>
@xsleonard
xsleonard / gist:7341172
Created November 6, 2013 18:10
hex string to byte array, C
unsigned char* hexstr_to_char(const char* hexstr)
{
size_t len = strlen(hexstr);
IF_ASSERT(len % 2 != 0)
return NULL;
size_t final_len = len / 2;
unsigned char* chrs = (unsigned char*)malloc((final_len+1) * sizeof(*chrs));
for (size_t i=0, j=0; j<final_len; i+=2, j++)
chrs[j] = (hexstr[i] % 32 + 9) % 25 * 16 + (hexstr[i+1] % 32 + 9) % 25;
chrs[final_len] = '\0';