Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View xboard's full-sized avatar
🏠
Working from home

Flavio xboard

🏠
Working from home
View GitHub Profile
@xboard
xboard / .clang-tidy
Last active November 22, 2020 17:34
A clang-tidy config file based on CLions defaults.
Checks: '-*,
abseil-duration-addition,
abseil-duration-comparison,
abseil-duration-conversion-cast,
abseil-duration-division,
abseil-duration-factory-float,
abseil-duration-factory-scale,
abseil-duration-subtraction,
abseil-duration-unnecessary-conversion,
abseil-faster-strsplit-delimiter,
@xboard
xboard / compiler_definitions.c
Last active July 12, 2019 16:13
Macros for checking C/C++ compiler in use.
#ifdef __clang__
/*code specific to clang compiler*/
#elif __GNUC__
/*code for GNU C compiler */
#elif _MSC_VER
/*usually has the version number in _MSC_VER*/
/*code specific to MSVC compiler*/
#elif __BORLANDC__
/*code specific to borland compilers*/
#elif __MINGW32__
@xboard
xboard / CMakeLists.txt
Created June 16, 2019 16:57
CMake project configuration to use wxWidget static libraries in MinGW.
cmake_minimum_required(VERSION 3.14)
project(HelloWorld)
set(wxWidgets_ROOT_DIR D:\\Projetos\\MinGW_Projects\\wxWidgets-3.0.4)
set(wxWidgets_LIB_DIR D:\\Projetos\\MinGW_Projects\\wxWidgets-3.0.4\\lib\\gcc_lib)
find_package(wxWidgets REQUIRED COMPONENTS net core base)
include(${wxWidgets_USE_FILE})
set(CMAKE_CXX_STANDARD 17)
@xboard
xboard / Self Signed Certificate using (Java) keytool
Last active May 22, 2018 13:51
Java keytool self signate certificate generation - 10 years validity
C:\Users\xboard>"%JAVA_HOME%\bin\keytool" -genkey -alias tomcat -keyalg RSA
-keystore d:\Apps\apache-tomcat-7.0.68\certs\keystore.jks -validity 3650 -keysize 2048
# Run the following OpenSSL command to generate your private key and public certificate. Answer the questions and enter the Common Name when prompted.
openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem
# Review the created certificate:
openssl x509 -text -noout -in certificate.pem
# Combine your key and certificate in a PKCS#12 (P12) bundle:
openssl pkcs12 -inkey key.pem -in certificate.pem -export -out certificate.p12
# Validate your P12 file.
@xboard
xboard / ISMCTS.py
Created September 26, 2017 21:41 — forked from kjlubick/ISMCTS.py
An example of Information Set Monte Carlo Tree Search from http://www.aifactory.co.uk/newsletter/2013_01_reduce_burden.htm
# This is a very simple Python 2.7 implementation of the Information Set Monte Carlo Tree Search algorithm.
# The function ISMCTS(rootstate, itermax, verbose = False) is towards the bottom of the code.
# It aims to have the clearest and simplest possible code, and for the sake of clarity, the code
# is orders of magnitude less efficient than it could be made, particularly by using a
# state.GetRandomMove() or state.DoRandomRollout() function.
#
# An example GameState classes for Knockout Whist is included to give some idea of how you
# can write your own GameState to use ISMCTS in your hidden information game.
#
# Written by Peter Cowling, Edward Powley, Daniel Whitehouse (University of York, UK) September 2012 - August 2013.
@xboard
xboard / univariate_pmm.py
Created July 20, 2017 19:26
Univariate Poisson Mixture Model
import numpy as np
import random as rand
from scipy.stats import poisson
SEED = 42
N = 100
def generate():
import matplotlib.pyplot as plt
@xboard
xboard / naive_latent_svm.py
Last active July 20, 2017 19:19
Naive implementation of a Latent SVM classifier.
#
# This is a experiment in developing a LATENT SVM classifier.
#
#
import matplotlib.pyplot as plt
import numpy as np
# Import datasets, classifiers and performance metrics
from sklearn import datasets, svm, metrics, preprocessing
@xboard
xboard / gist:17fba1df570cf1cc87e99eb0e9280f96
Last active February 9, 2017 16:50
Apache Axis - print SOAP XML sent/received
String requestXML = _call.getMessageContext().getRequestMessage().getSOAPPartAsString();
String responseXML = _call.getMessageContext().getResponseMessage().getSOAPPartAsString();
System.out.println("====================================================");
System.out.println("REQUEST");
System.out.println(requestXML);
System.out.println("====================================================");
System.out.println("RESPONSE");
System.out.println(responseXML);
System.out.println("====================================================");
Verifying that +xboard is my blockchain ID. https://onename.com/xboard