Skip to content

Instantly share code, notes, and snippets.

View vdenotaris's full-sized avatar
🏠
Safely WFH

Vincenzo De Notaris vdenotaris

🏠
Safely WFH
View GitHub Profile
@vdenotaris
vdenotaris / 00_env.py
Last active November 4, 2020 09:32
01 Financial Analysis - Basic Evaluation Metrics
# This Python 3 environment comes with many helpful analytics libraries installed
# It is defined by the kaggle/python Docker image: https://github.com/kaggle/docker-python
# For example, here's several helpful packages to load
import numpy as np # linear algebra
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)
import matplotlib.pyplot as plt # Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy
import matplotlib.patches as mpatches
import pprint # Pretty printer
@vdenotaris
vdenotaris / ssb_tbl2csv.py
Last active October 5, 2018 09:33
StarSchemaBenchmark tbl2csv converter
# Author: Vincenzo De Notaris (vdenotaris@google.com)
# aka a not so brilliant Python programmer!
# Reference: https://github.com/lemire/StarSchemaBenchmark
# Libs
import sys
import os
# Parsing function
def parseAndWrite(name, header):
import java.util.HashSet;
import java.util.Set;
class Solution {
private static int max(int[] A) {
int max = A[0];
for (int i = 1; i < A.length; i++)
if (A[i] > max)
max = A[i];
@vdenotaris
vdenotaris / Ex1_BinaryGap.java
Last active June 9, 2017 08:58
Codility: Binary Gap
class Solution {
public int solution(int N) {
String binN = Integer.toBinaryString(N);
int counter = 0;
int maxCounter = 0;
for (int i = 1; i < binN.length() - 1; i++) {
if (binN.charAt(i) == '0' && binN.charAt(i-1) == '1') {
counter = 1;
for (int j = i+1; j < binN.length(); j++) {
if (binN.charAt(j) == '0')
Param(
[string] $filePath,
[string] $thresold
)
if (-not ([System.IO.File]::Exists($filePath))) {
throw [System.IO.FileNotFoundException] "File not found."
}
Write-Host "Characters counter" -ForegroundColor Cyan
https://www.linkedin.com/pulse/20140626153605-63176935-preparing-and-passing-the-cissp-exam
@vdenotaris
vdenotaris / main.c
Last active October 3, 2015 00:57
Dynamic Matrix in C
/*
* Copyright 2014 Vincenzo De Notaris
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software