This file contains hidden or 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
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dPDFSETTINGS=/screen -dEmbedAllFonts=true -dSubsetFonts=true -dColorImageDownsampleType=/Bicubic -dColorImageResolution=144 -dGrayImageDownsampleType=/Bicubic -dGrayImageResolution=144 -dMonoImageDownsampleType=/Bicubic -dMonoImageResolution=144 -sOutputFile=out.pdf in.pdf |
This file contains hidden or 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
<head> | |
<meta name="viewport" content="initial-scale = 1.0,maximum-scale = 1.0" /> | |
<style> | |
body { | |
margin: 0; | |
color: #444; | |
background: #000; | |
font: 300 18px/18px Roboto, sans-serif; | |
} |
This file contains hidden or 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
function parse_pre_block(id) { | |
let pre_block = document.getElementById(id) | |
if (pre_block == null || pre_block.childElementCount === 0) { | |
return null; | |
} | |
let children = pre_block.childNodes | |
let res = "" | |
for (const child of children) { | |
if (child.nodeType === 3) { // text node | |
res += child.data.replace(/\\\*.*(?=\*\\)\*\\/g, "") |
This file contains hidden or 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
import numpy as np | |
from pylfsr import LFSR | |
L = LFSR() | |
state = [1,1,1,1,1,0,0,0,0,0] | |
fpoly = [10,8,5,4] | |
L = LFSR(fpoly=fpoly,initstate =state, verbose=False) | |
L.info() | |
period=1023 |
This file contains hidden or 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
def first_digit(n): | |
from math import exp,log,pi,modf,sqrt | |
w=log((n/exp(1)),10) | |
f,i=modf(w*n) | |
l=10**f | |
p=sqrt(2*pi*n) | |
return str(p*l)[0] |
This file contains hidden or 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
protected void generateBands(long l) { | |
this.clayBands = new BlockState[64]; | |
Arrays.fill(this.clayBands, TERRACOTTA); | |
WorldgenRandom worldgenRandom = new WorldgenRandom(l); | |
this.clayBandsOffsetNoise = new PerlinSimplexNoise(worldgenRandom, (List<Integer>)ImmutableList.of((Object)0)); | |
for (int orange_bound = 0; orange_bound < 64; ++orange_bound) { | |
if ((orange_bound += worldgenRandom.nextInt(5) + 1) >= 64) continue; | |
this.clayBands[orange_bound] = ORANGE_TERRACOTTA; | |
} | |
int orange_bound = worldgenRandom.nextInt(4) + 2; |
This file contains hidden or 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
package javaECC; | |
import org.bouncycastle.crypto.generators.ElGamalParametersGenerator; | |
import org.bouncycastle.crypto.params.DHParameters; | |
import org.bouncycastle.crypto.params.ElGamalParameters; | |
import org.bouncycastle.util.BigIntegers; | |
import java.math.BigInteger; | |
import java.security.SecureRandom; | |
import java.util.Objects; |
This file contains hidden or 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
package app; | |
/* In build.gradle add those lines: | |
repositories { | |
jcenter() | |
mavenCentral() | |
maven { | |
url "https://jitpack.io" | |
} | |
} |
This file contains hidden or 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
package com.seedfinding.neil.mixin; | |
import net.minecraft.client.gui.screen.PresetsScreen; | |
import net.minecraft.text.Text; | |
import org.spongepowered.asm.mixin.Final; | |
import org.spongepowered.asm.mixin.Mixin; | |
import org.spongepowered.asm.mixin.Shadow; | |
import org.spongepowered.asm.mixin.injection.At; | |
import org.spongepowered.asm.mixin.injection.Inject; | |
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; |
This file contains hidden or 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
// [dependencies] | |
// ron = "0.6.4" | |
// serde = { version = "1.0.60", features = ["serde_derive"] } | |
use serde::{Serialize, Serializer, Deserialize, Deserializer}; | |
use std::collections::HashMap; | |
fn option_remove_serialize<S,T:Serialize>(x: &Option<T>, s: S) -> Result<S::Ok, S::Error> where S: Serializer { | |
x.as_ref().unwrap().serialize(s) | |
} |