Skip to content

Instantly share code, notes, and snippets.

// ==== AVX2 decompressor for Q4_0 and Q4_1 compressed blocks ====
#include <array>
#include <immintrin.h>
#include <assert.h>
#include <float.h>
// Unpack 32 4-bit fields into 32 bytes
// The output vector contains 32 bytes, each one in [ 0 .. 15 ] interval
inline __m256i bytesFromNibbles( const uint8_t* rsi )
{
@liquiddandruff
liquiddandruff / StringFormatTest.java
Created March 13, 2016 11:56 — forked from huljas/StringFormatTest.java
Most common formats for String.format(..)
import org.junit.Test;
import java.util.Date;
import static org.junit.Assert.assertEquals;
public class StringFormatTest {
@Test public void basicInteger() {
assertEquals("123456", String.format("%d", 123456));
}
@liquiddandruff
liquiddandruff / batchFileRenamer
Last active December 21, 2015 10:39
Little script that renames all files in the script's current directory to a base string and file type.
import msvcrt
import os
import sys
import string
currentDirectory = os.path.split(sys.argv[0])[0]
fileNames = [ f for f in os.listdir(currentDirectory) if os.path.isfile(os.path.join(currentDirectory,f)) ]
# Don't include the script
@liquiddandruff
liquiddandruff / fileNameFormatter
Last active December 21, 2015 10:29
Little script that tries to beautify and clean the names of messily named files in its current directory.
import msvcrt
import os
import sys
import string
currentDirectory = os.path.split(sys.argv[0])[0]
fileNames = [ f for f in os.listdir(currentDirectory) if os.path.isfile(os.path.join(currentDirectory,f)) ]
# Don't include the script