Skip to content

Instantly share code, notes, and snippets.

View felipe-araujo's full-sized avatar

Felipe Araújo felipe-araujo

  • Fortaleza, Ceará, Brazil
  • 00:05 (UTC -03:00)
View GitHub Profile
import java.time.*;
import java.time.format.*;
import java.time.temporal.ChronoField;
public class YearWeek {
public static void main(String[] args){
for(int week = 1; week < 53; week++){
dbYearWeekToDateRange("2023%02d".formatted(week));
}
}
@felipe-araujo
felipe-araujo / LearningResources.md
Last active May 24, 2020 12:42
Learning Resources
@felipe-araujo
felipe-araujo / console.ex
Created March 12, 2020 14:50
Read from stdio until reach EOF in Elixir(for HackerRank)
defmodule Console do
def read_until_eof() do
read_until_eof([])
end
def read_until_eof(acc) do
case IO.read(:stdio, :line) do
:eof ->
acc
@felipe-araujo
felipe-araujo / javaee_code.md
Last active May 7, 2019 14:25
Java EE with VS Code
@felipe-araujo
felipe-araujo / merge.py
Last active December 27, 2019 11:18
Merge several gpx files into one
import gpxpy.parser as parser
import gpxpy.gpx as gpx
import os
import math
import datetime
## functions
def min_max_timestamp(parsed):
min_ts = parsed.tracks[0].segments[0].points[0].time
max_ts = parsed.tracks[0].segments[0].points[0].time
@felipe-araujo
felipe-araujo / spatial-filtering
Created October 16, 2011 00:49
Spatial filtering with OpenCV(C++)
Mat in, out;
Mat kern = ( Mat_<char>(3,3) << 1, 1, 1,
1, -8, 1,
1, 1, 1);
in = imread("DRIVE/training/images/21_training.tif");
filter2D(in, out, in.depth(), kern, Point(-1,-1), 5.0, BORDER_REPLICATE);
@felipe-araujo
felipe-araujo / RBG_image_channel_splitting
Created October 8, 2011 17:40
OpenCV RBG image channel splitting(C++)
VideoCapture cap(0);
if(!cap.isOpened()) exit(0);
cap.set(CV_CAP_PROP_FRAME_WIDTH, 250);
cap.set(CV_CAP_PROP_FRAME_HEIGHT, 250);
cout << "Frame width: " << cap.get(CV_CAP_PROP_FRAME_WIDTH) << endl;
cout << "Frame height: " << cap.get(CV_CAP_PROP_FRAME_HEIGHT) << endl;
@felipe-araujo
felipe-araujo / opencvutil
Created October 8, 2011 16:07
OpenCV 2.1 utilities (C++)
// convert between colorspaces
Mat in, out
cvtColor(in, out, CV_RGB2GRAY);
// threshold
threshold(in, out, 20, 256, THRESH_BINARY);
threshold(in, out, 20, 256, THRESH_BINARY_INV);