Skip to content

Instantly share code, notes, and snippets.

@SafeteeWoW
SafeteeWoW / crc32.lua
Last active January 7, 2022 14:58
Pure Lua CRC32 without dependency
local LibDeflate = {}
local string_byte = string.byte
-- Calculate xor for two unsigned 8bit numbers (0 <= a,b <= 255)
local function Xor8(a, b)
local ret = 0
local fact = 128
while fact > a and fact > b do
fact = fact / 2
end
@SafeteeWoW
SafeteeWoW / mkl_signed_int8_conv_test.cpp
Created January 3, 2019 07:04
Try to test signed int8 convolution on Intel MKL.
#include <iostream>
#include <cstdint>
#include <numeric>
#include "mkldnn.hpp"
using namespace mkldnn;
using namespace std;
std::vector<int32_t> run_int8_conv(memory::data_type src_data_type) {
auto cpu_engine = engine(engine::cpu, 0);
RCLootCouncilDB = {
["namespaces"] = {
["EPGP"] = {
["global"] = {
["tocVersion"] = "2.2.2",
["version"] = "2.2.2",
["testTocVersion"] = "",
},
["profiles"] = {
local libS = LibStub:GetLibrary("AceSerializer-3.0")
local libR = LibStub:GetLibrary("RCSerializer-3.0")
local libC = LibStub:GetLibrary("LibCompress")
local libCE = libC:GetAddonEncodeTable()
local t = RCLootCouncil.db.profile
local s1 = libS:Serialize(t)
local c1 = libCE:Encode(libC:Compress(s1))
print("AceSerializer", s1:len())
local requestTime = {}
local frame = _G.TestGetItemInfo or CreateFrame("Frame", "TestGetItemInfo")
frame:RegisterEvent("GET_ITEM_INFO_RECEIVED")
frame:SetScript("OnEvent", function(self, event, id)
if requestTime[id] then
print(format("%d", (GetTime()-requestTime[id])*1000) .. " ms", " ", id) --Time between request and receive"
end
end)
local id = 0
while not GetItemInfoInstant(id) do
id = math.random(1, 200000)
end
local frame = _G.TestGetItemInfo or CreateFrame("Frame", "TestGetItemInfo")
frame:RegisterEvent("GET_ITEM_INFO_RECEIVED")
frame:SetScript("OnEvent", function(self, event, id)
print(GetTime(), event, id)
print("-----")
local NH_1st_boss_links = {
[1]="|cffa335ee|Hitem:140840::::::::110:103::5:1:3524:::|h[Chittering Mandible]|h|r",
[2]="|cffa335ee|Hitem:140815::::::::110:103::5:1:3524:::|h[Infused Chitin Fragment]|h|r",
[3]="|cffa335ee|Hitem:140827::::::::110:103::5:1:3524:::|h[Manatoxin Gland]|h|r",
[4]="|cffa335ee|Hitem:140901::::::::110:103::5:1:3524:::|h[Vintage Suramar Nobility Hat]|h|r",
[5]="|cffa335ee|Hitem:140898::::::::110:103::5:1:3524:::|h[Radiant String of Scorpid Eyes]|h|r",
[6]="|cffa335ee|Hitem:140875::::::::110:103::5:1:3524:::|h[Arcanochitin Hauberk]|h|r",
[7]="|cffa335ee|Hitem:140902::::::::110:103::5:1:3524:::|h[Jagged Carapace Wristclamps]|h|r",
[8]="|cffa335ee|Hitem:140876::::::::110:103::5:1:3524:::|h[Stinger Resistant Bracers]|h|r",
[9]="|cffa335ee|Hitem:140888::::::::110:103::5:1:3524:::|h[Scorpid Handler's Gloves]|h|r",
local manyLinks = {
"|cffa335ee|Hitem:152816::::::::110:264::3:1:3524:::|h[Antoran Charhound]|h|r",
"|cffa335ee|Hitem:152035::::::::110:264::3:1:3524:::|h[Blazing Dreadsteed Horseshoe]|h|r",
"|cffa335ee|Hitem:155853::::::::110:264::3:1:3524:::|h[Conch of the Thunderer]|h|r",
"|cffa335ee|Hitem:155848::::::::110:264::3:1:3524:::|h[Condensed Blight Orb]|h|r",
"|cffa335ee|Hitem:152056::::::::110:264::3:1:3524:::|h[Corrupting Dewclaw]|h|r",
"|cffa335ee|Hitem:152046::::::::110:264::3:1:3524:::|h[Coven Prayer Bead]|h|r",
"|cffa335ee|Hitem:152057::::::::110:264::3:1:3524:::|h[Crepuscular Skitterer Egg]|h|r",
"|cffa335ee|Hitem:155847::::::::110:264::3:1:3524:::|h[Cruor of the Avenger]|h|r",
"|cffa335ee|Hitem:152048::::::::110:264::3:1:3524:::|h[Decimator Crankshaft]|h|r",
RCLootCouncilDB = {
["namespaces"] = {
["EPGP"] = {
["global"] = {
["tocVersion"] = "2.2.1",
["version"] = "2.2.1",
["testTocVersion"] = "",
},
["profiles"] = {