Skip to content

Instantly share code, notes, and snippets.

View andrefreitas's full-sized avatar

André Freitas andrefreitas

View GitHub Profile
@andrefreitas
andrefreitas / Dockerfile
Created June 30, 2015 10:48
problem description
FROM ubuntu:14.04
RUN echo "Hello from docker" > index.html
RUN sudo apt-get install python3
RUN python3 -m http.server 80
EXPOSE 80
if [ -z "$1" ]
then
echo "usage: $0 <git repository path>"
else
touch report_$USER.txt
echo "This will take a while..."
echo "Learning with 5 commits"
schwa $1 --commits 5 -l >> report_$USER.txt
echo "Learning with 50 commits"
schwa $1 --commits 50 -l >> report_$USER.txt
FROM ubuntu:14.04
# Install Java
RUN apt-get install software-properties-common -y
RUN \
echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java7-installer && \
rm -rf /var/lib/apt/lists/* && \
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:note="http://fe.up.pt/technical-note">
<rdf:Description rdf:about="http://goo.gl/0iY8qx">
<note:title>Linked Data com JSON</note:title>
<note:author>André Freitas</note:author>
<note:theme>21</note:theme>
<note:link>http://json-ld.org/</note:link>
<note:email>[email protected]</note:email>
</rdf:Description>
</rdf:RDF>
hercules:~ andre$ rails new app
create
create README.rdoc
create Rakefile
create config.ru
create .gitignore
create Gemfile
create app
create app/assets/javascripts/application.js
create app/assets/stylesheets/application.css
/**
* Example of a strategy pattern
* We implement different behaviours for a robot
*/
class Robot {
Behaviour behaviour;
Robot(this.behaviour);
move() => print(behaviour.move());
}
<!DOCTYPE html>
<html>
<head>
<title>Olá mundo</title>
<meta charset="UTF-8">
</head>
<body>
Olá mundo
</body>
</html>
"""
Teaching a neural network to do the XOR binary operator
Artificial Intelligence - FEUP
"""
from pybrain.tools.shortcuts import buildNetwork
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers import BackpropTrainer
from pybrain import TanhLayer
""" Builds the network """
@andrefreitas
andrefreitas / gist:5562913
Created May 12, 2013 09:11
Exemplo da utilização de Maps em matlab
% Using Maps to have constant time complexity to access data
% See more at http://www.mathworks.com/help/matlab/map-containers.html
% Example here http://stackoverflow.com/questions/3591942/hash-tables-in-matlab
% Let's supose we have the following information:
table =[ [1 , 1 , 1 , 0.444 , 0.67 , 0.98];
[1 , 1 , 2 , 0.254 , 0.67 , 0.98]
];
% So to store them in an efficient way
@andrefreitas
andrefreitas / hello.py
Created May 6, 2013 16:08
helloWorldQt
import sys
from PyQt4.QtGui import QApplication
from PyQt4.QtDeclarative import QDeclarativeView
from PyQt4.QtCore import QUrl
app = QApplication(sys.argv)
view = QDeclarativeView()
view.setSource(QUrl('hello.qml'))
view.show()
view.setWindowTitle("Hello World")