Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Alvaro Silvino alvarojoao

View GitHub Profile
@alvarojoao
alvarojoao / interview solutions 3.py
Last active Oct 30, 2017
interview solutions 3
View interview solutions 3.py
# We want to implement a feature to suggest to users the cheapest hotel that is
# more popular than the one they are looking at.
# Write a function that given an array of hotels sorted by their popularity,
# returns a map from hotel ids to hotel ids that associates each hotel with the
# cheapest hotel that is more popular than the one in question.
# If there's no hotel that is cheaper and more popular than the one with that id,
# then it shouldn't be put in the map.
@alvarojoao
alvarojoao / interviewsolutions2.py
Last active Sep 8, 2017
interview solutions 2
View interviewsolutions2.py
# Assume we have a long list of words from English dictionary, like:
# EnglishWords: ["water", "big", "banana", "york", "amsterdam", "orange", "macintosh", "bottle", "book", "apple", "watch", ...]
# And another long list of strings to process, write a function to identify "compound words" and return them:
# input:[ "paris", "applewatch", "ipod", "amsterdam", "bigbook", "orange", "waterbottle",... ]
# output: [ "applewatch", "bigbook", "waterbottle",...]
@alvarojoao
alvarojoao / interview solutions
Created Aug 26, 2017
interview solutions for b.
View interview solutions
def isAnagram(A,B):
A = A.lower()
B = B.lower()
if len(A) == 0 or len(B) ==0:
return False
dictA = {}
dictB = {}
for a in A:
if a in dictA:
dictA[a] += 1
View elm.py
# -*- coding: utf8
# Author: David C. Lambert [dcl -at- panix -dot- com]
# Copyright(c) 2013
# License: Simple BSD
"""
The :mod:`elm` module implements the
Extreme Learning Machine Classifiers and Regressors (ELMClassifier,
ELMRegressor, SimpleELMRegressor, SimpleELMClassifier).
An Extreme Learning Machine (ELM) is a single layer feedforward
View main.py
import tensorflow as tf
import numpy as np
import pandas as pd
from tensorflow.examples.tutorials.mnist import input_data
from sklearn import svm
import time
from elm import GenELMClassifier
from random_layer import MLPRandomLayer
NUMBER_OF_FEATURES = 128
View servers.sh
#!/bin/bash
# Declare variable choice and assign value -1
choice=-1
# Print to stdout
ARRAY=( 'ssh://user1@sampleserver.com'
'ssh://user2@sampleserver.com'
'ssh://user3@sampleserver.com' )
ELEMENTS=${#ARRAY[@]}
@alvarojoao
alvarojoao / rbm_after_refactor.py
Created Jun 21, 2016 — forked from blackecho/rbm_after_refactor.py
Restricted Boltzmann Machine implementation in TensorFlow, before and after code refactoring. Blog post: http://www.gabrieleangeletti.com/blog/programming/2016/02/21/refactoring-rbm-tensor-flow-implementation.html
View rbm_after_refactor.py
import tensorflow as tf
import numpy as np
import os
import zconfig
import utils
class RBM(object):
@alvarojoao
alvarojoao / .jshintrc
Created Jun 21, 2016
.jshintrc example file
View .jshintrc
{
"node": true,
"browser": true,
"esnext": true,
"bitwise": true,
"camelcase": false,
"curly": true,
"eqeqeq": true,
"immed": true,
"indent": 2,
@alvarojoao
alvarojoao / stopwords.txt
Created Feb 25, 2016 — forked from alopes/stopwords.txt
Portuguese stop words
View stopwords.txt
de
a
o
que
e
do
da
em
um
para
@alvarojoao
alvarojoao / config.rb
Created Jan 26, 2016 — forked from nathansmith/config.rb
Example config.rb file for Compass
View config.rb
preferred_syntax = :sass
http_path = '/'
css_dir = 'assets/stylesheets'
sass_dir = 'assets/sass'
images_dir = 'assets/images'
javascripts_dir = 'assets/javascripts'
relative_assets = true
line_comments = true
# output_style = :compressed
You can’t perform that action at this time.