Skip to content

Instantly share code, notes, and snippets.

View mhoangvslev's full-sized avatar
🎼
Interested in OMR, MIR

Minh-Hoang DANG mhoangvslev

🎼
Interested in OMR, MIR
View GitHub Profile
module.exports = {
kittyId: {
type: 'number',
primary: true,
},
genes: {
type: 'string',
},
generation: {
type: 'number'
import { ethers } from "ethers";
export declare interface Strategies {
DataExtractionStrategy: DataExtractionStrategies;
PersistenceStrategy: PersistenceStrategies;
}
export interface DataExtractionStrategies { [iteration: number]: DataExtractionStrategy; }
export declare interface DataExtractionStrategy {
module.exports = {
providers: {
timeout: 0,
infura: {
network: "mainnet",
projectId: "YOUR_PROJECT_ID"
},
etherscan: {
network: 'homestead',
api: 'YOUR_API'
const ethers = require("ethers");
const neo4j = require("neo4j-driver").v1;
async function des_formatID(kittyId, contractFuncs) {
return ethers.utils.bigNumberify(kittyId.toHexString()).toNumber();
}
function vs_formatAvatar(kittyId) {
return 'https://img.cryptokitties.co/0x06012c8cf97bead5deae237070f9587f8e7a266d/' + kittyId + '.png';
}
event Birth(
address owner,
uint256 kittyId,
uint256 matronId,
uint256 sireId,
uint256 genes
);
# Create a folder with shared folders
mkdir config models database strategies plugins
# Download neo4j plugins
echo "Downloading neo4j plugins"
curl -L "https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/download/3.5.0.4/apoc-3.5.0.4-all.jar" > plugins/apoc-3.5.0.4-all.jar
curl -L "https://github.com/neo4j-contrib/neo4j-graph-algorithms/releases/download/3.5.4.0/graph-algorithms-algo-3.5.4.0.jar" > plugins/graph-algorithms-algo-3.5.4.0.jar
# Download prepared elements
echo "Setting up..."
@mhoangvslev
mhoangvslev / contrib.r
Created November 5, 2019 22:27
Contribution des invidivus
# Individus
## Contribution relative
result$ind$qlt <- matrix(unlist(lapply(1:nbIndv, function(indv){
(result$ind$coords[indv, ]**2) / sum(result$ind$coords[indv, ]**2)
})), nrow = nbIndv, ncol = nbComps, byrow = TRUE);
colnames(result$ind$qlt) <- colnames(result$ind$qlt, do.NULL = FALSE, prefix = "Comp. ");
## Contribution absolue
result$ind$ctr <- matrix(unlist(lapply(1:nbComps, function(axe){
result$ind$coords[, axe]**2 / (nbIndv * eigenvalues[axe])
@prefix dbo: <http://dbpedia.org/ontology/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix voc: <https://mmisw.org/ont/~mhoangvslev/SurfaceForestiereVoc/> .
voc:Measurement rdf:type owl:Class .
voc:Country rdf:type owl:Class .
gcc -march=native -Q --help=target | grep enabled
--copt=-m128bit-long-double --copt=-m64 --copt=-m80387 --copt=-mabm --copt=-madx --copt=-maes --copt=-malign-stringops --copt=-mavx --copt=-mavx2 --copt=-mavx256-split-unaligned-load --copt=-mavx256-split-unaligned-store --copt=-mavx512bw --copt=-mavx512cd --copt=-mavx512dq --copt=-mavx512f --copt=-mavx512vl --copt=-mbmi --copt=-mbmi2 --copt=-mclflushopt --copt=-mclwb --copt=-mcx16 --copt=-mf16c --copt=-mfancy-math-387 --copt=-mfma --copt=-mfp-ret-in-387 --copt=-mfsgsbase --copt=-mfxsr --copt=-mglibc --copt=-mhard-float --copt=-mhle --copt=-mieee-fp --copt=-mlong-double-80 --copt=-mlzcnt --copt=-mmmx --copt=-mmovbe --copt=-mpclmul --copt=-mpopcnt --copt=-mprfchw --copt=-mpush-args --copt=-mrdrnd --copt=-mrdseed --copt=-mred-zone --copt=-mrtm --copt=-msahf --copt=-msse --copt=-msse2 --copt=-msse3 --copt=-msse4 --copt=-msse4.1 --copt=-msse4.2 --copt=-mssse3 --copt=-mstv --copt=-mtls-direct-seg-refs --copt=-mvzeroupper --copt=-mxsave --copt=-mxsavec --copt=-mxsav