Skip to content

Instantly share code, notes, and snippets.

Jose Cupertino Ruiz Vargas jruizvar

Block or report user

Report or block jruizvar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View quadratic_regression_hive.hql
DROP TABLE IF EXISTS
dados;
CREATE TEMPORARY TABLE
dados
(
cnpj INT,
anomes INT,
sinal FLOAT
);
@jruizvar
jruizvar / pivot_hive_table.hql
Last active May 16, 2019
Filtra empresas com historico complete, calcula o acumulado, e pivota o resultado.
View pivot_hive_table.hql
DROP TABLE IF EXISTS temp1;
CREATE TABLE temp1 (anomes INT, cnpj STRING, x DOUBLE);
INSERT INTO temp1 VALUES
(201801, 'c0', 1),
(201801, 'c1', 1),
(201801, 'c2', 3),
(201802, 'c0', 2),
(201802, 'c1', 2),
@jruizvar
jruizvar / cumulative_sum.hql
Last active May 16, 2019
Filtra empresas com historico completo, e calcula o sinal acumulado.
View cumulative_sum.hql
DROP TABLE IF EXISTS temp1;
CREATE TABLE temp1 (anomes INT, cnpj STRING, x DOUBLE);
INSERT INTO temp1 VALUES
(201801, 'c0', 1),
(201801, 'c1', 1),
(201801, 'c2', 3),
(201802, 'c0', 2),
(201802, 'c1', 2),
@jruizvar
jruizvar / remove_duplicates.hql
Last active May 5, 2019
Remove duplicated rows and add a partition in a hive table
View remove_duplicates.hql
CREATE TABLE temp1 (anomes INT, cnpj STRING, feat0 STRING, feat1 STRING);
INSERT INTO temp1 VALUES
(201901, '0', 'x', 'a'),
(201901, '0', 'y', 'b'),
(201901, '1', 'v', 'c'),
(201901, '1', 'w', 'd'),
(201902, '0', 'x', 'a'),
(201902, '0', 'x', 'a'),
(201902, '1', 'y', 'b'),
@jruizvar
jruizvar / PuttyGithub.md
Last active Mar 30, 2019
Connect to Github using Putty
View PuttyGithub.md

Setup SSH key to connect to Github with Putty

Generate SSH key

Open git bash and execute

ssh-keygen -t rsa -b 4096 -C "jruizvar@cern.ch"

This procedure generates two files: .ssh/id_rsa and .ssh/id_rsa.pub. Add public key to Github.

Setup SSH agent

@jruizvar
jruizvar / IntelPython.md
Last active Jul 2, 2017
Intel Python on Windows 10
View IntelPython.md

Python environment using the Intel package repository

Download and install Miniconda

https://conda.io/miniconda.html

Open Anaconda Prompt

conda update conda
conda config --add channels intel
@jruizvar
jruizvar / InstallOpenCV.md
Last active May 24, 2019
Building OpenCV 3.2.0 from source on macOS Sierra with Python 3 support
View InstallOpenCV.md

Building OpenCV 3.2.0 from source with Python 3 support

Install OpenCV on macOS Sierra enabling Python 3 with the following instructions:

  • Install CMake, Python 3 + Numpy in advance
  • Download latest OpenCV source code (https://github.com/opencv/opencv/releases)
  • Move the folder opencv-3.2.0 to the current directory
  • In the current directory, execute the following steps:
mkdir build
You can’t perform that action at this time.