Skip to content

Instantly share code, notes, and snippets.

View tiagonbotelho's full-sized avatar
:fishsticks:
Hello

Tiago Botelho tiagonbotelho

:fishsticks:
Hello
View GitHub Profile
4374
dexindexapp.com
@tiagonbotelho
tiagonbotelho / customers.json
Created October 10, 2015 12:34
valid customers json
[
{"latitude": "52.986375", "user_id": 12, "name": "Christina McArdle", "longitude": "-6.043701"},
{"latitude": "51.92893", "user_id": 1, "name": "Alice Cahill", "longitude": "-10.27699"},
{"latitude": "51.8856167", "user_id": 2, "name": "Ian McArdle", "longitude": "-10.4240951"},
{"latitude": "52.3191841", "user_id": 3, "name": "Jack Enright", "longitude": "-8.5072391"},
{"latitude": "53.807778", "user_id": 28, "name": "Charlie Halligan", "longitude": "-7.714444"},
{"latitude": "53.4692815", "user_id": 7, "name": "Frank Kehoe", "longitude": "-9.436036"},
{"latitude": "54.0894797", "user_id": 8, "name": "Eoin Ahearn", "longitude": "-6.18671"},
{"latitude": "53.038056", "user_id": 26, "name": "Stephen McArdle", "longitude": "-7.653889"},
{"latitude": "54.1225", "user_id": 27, "name": "Enid Gallagher", "longitude": "-8.143333"},
@tiagonbotelho
tiagonbotelho / flatten.py
Created October 9, 2015 23:32
Flatten a given array
# Checks if the array is either empty or not the correct input
def check_validation_of(array):
if array == [] or not isinstance(array, list):
return False
return True
def flatten(array):
# if the item is still a list flatten it again else you can return the item
return sum(([item] if not isinstance(item, list)
else flatten(item)
@tiagonbotelho
tiagonbotelho / radius.go
Last active October 12, 2015 08:03
Radius problem to see who is in less than 100km of range from a specific point
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"math"
"os"
"sort"
"strconv"
@tiagonbotelho
tiagonbotelho / answers.txt
Last active October 9, 2015 23:35
Answers to the three problems
1. My proudest achievement has got to be my black belt in judo, I've trained my whole life for that moment and competed at a high level, it taught me so many great things that I can apply in my day to day life, it is thanks to judo that I give 200% in what I'm doing. For me getting the black belt competing required me to be very determined (I've trained with broken fingers, ruptured muscles and other types of injuries) and that's what I do now in Software Engineering, I do not stop until I find
the bug or understand a new subject that I do not fully comprehend at the time
2. I am reading two books right now, SICP which is the first book given in Computer Science at MIT, it is a great book that teaches you alot of stuff that my Univerity does not and it is really fun to read because in almost every page there is a hard coding problem to solve.
The second book that I'm reading is the biography of Elon Musk, I love what he's doing and I like to read about people who changed history, I hope that, one day I wil
import java.util.*;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
public class CSVRead {
CSVRead() {}
public ArrayList[] readCSVFile(String fileName) {
import desmoj.core.dist.LinearCongruentialRandomGenerator;
public class Exercicio1B {
public Exercicio1B(int N) {
double randomArray[];
SerialTest serialTest = new SerialTest();
for (int i = 0; i < 42; i++) {
import java.util.*;
public class Ex3b {
public static void main(String [] args) {
CSVRead csvRead = new CSVRead();
WB mle = new WB();
ArrayList[] values = csvRead.readCSVFile("./machines.csv");
mle.worker(values);
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <cstring>
#include <stdio.h>
using namespace std;
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <algorithm>
#include <cstring>
#include <stdio.h>
using namespace std;