Skip to content

Instantly share code, notes, and snippets.

View typelogic's full-sized avatar
🏹

typelogic typelogic

🏹
View GitHub Profile
tensorflow scikit-learn pytorch
| / /
| scipy /
| / / pandas
| _____/ / /
|| _________________/ /
||| ___________________/
||||
||||
#include <winscard.h>
#pragma comment(lib, "winscard.lib")
#include <iostream>
#include <map>
#include <vector>
#include <codecvt>
#include <algorithm>
std::string reader = "Identiv uTrust 4701 F CL Reader 0";
https://imgur.com/gallery/TuDHQRb

Dependencies TapLinx to use Google library versions

TapLinx library version Google analytics/firebase version:
1.4.1 com.google.android.gms:play-services-analytics:15.0.2
1.5 com.google.android.gms:play-services-analytics:16.0.3
1.6 com.google.firebase:firebase-core:16.0.7
1.7 com.google.firebase:firebase-core:17.2.2
# Mifare classic access bits
# Example: accessbits([0,0,0,1])
def accessbits(acbits):
bm=[[0,0,0],[0,0,1],[0,1,0],[0,1,1],[1,0,0],[1,0,1],[1,1,0],[1,1,1]]
invert = lambda arr: [[1,0][x] for x in arr]
def convert(arr):
s=0
for n in range(len(arr)):
s=s+arr[-1-n]*2**n
return s
import re
def permutations(s, before="", replace="O", replace_by="0"):
"""
This function will replace every occurance of a character or string with another character or string.
In every possible setup, e.g. 'xxx' as input, where 'y' replaces 'x' will be return ['yxx', 'xyx', 'xxy', 'yyx', 'yxy', ... ]
Written by Jurien Vegter in order to fix an issue where the passporteye ocr mistakes '0's for 'O's
"""
if len(s) == len(before):
result = []
elif replace in s[len(before):]:
Bit 7 6 5 4 3 2 1 0
------ ------ ------ ------ ------ ------ ------ ------
[ MB ] [ ME ] [ CF ] [ SR ] [ IL ] [ TNF ]
[ TYPE LENGTH ]
[ PAYLOAD LENGTH ]
[ ID LENGTH ]
buildscript {
}
plugins {
id 'java-library'
}
def a = 'stuff/src/main/java'
@typelogic
typelogic / Iterate days
Created January 9, 2021 14:27 — forked from CaptainJH/Iterate days
Output date string in C++
/// iterate from fromD(like "2014-04-02") to toD("2014-05-02")
std::string tpStr = fromD;
do {
//std::cout << tpStr << std::endl;
ParseIntoUserInfoDB(tpStr, root, order);
std::tm tm;
std::stringstream ss(tpStr + " 0:0:1");
ss >> std::get_time(&tm, "%Y-%m-%d %H:%M:%S");
auto tp = std::chrono::system_clock::from_time_t(std::mktime(&tm));
@typelogic
typelogic / publish-maven-central-repo-sonatype.md
Created January 6, 2021 02:46 — forked from diegopacheco/publish-maven-central-repo-sonatype.md
How to publish a JAR into Sonatype Maven Central REPO?

How to publish a jar into Sonatype central repo

Order of Operations

  1. Create gpg key
  2. Export gpg key
  3. Publish gpg key to ubuntu server
  4. Create account at Sonatype JIRA
  5. Configure $HOME/.gradle/settings.gradle user and pass and keys settings
  6. Configure gradle plugins