This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find topics of politicians | |
make run_all timelines=Albert_Rivera,sanchezcastejon,Pablo_Iglesias_,pablocasado_ n_topics=5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
""" | |
Linear regression using Autograd | |
""" | |
import autograd.numpy as np | |
import matplotlib.pyplot as plt | |
from autograd import elementwise_grad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
""" | |
Linear regression using Tensorflow | |
""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import tensorflow as tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ | |
/* MULTI-NODE AND PARALLEL MATRIX-MATRIX PRODUCT WITH MPI AND CUDA */ | |
/* */ | |
/* File: mmpmpicuda.cu */ | |
/* Author: Alberto Pou Quirós (Github: bertini36) */ | |
/* Description: This program performs a matrix product (A * B = C) */ | |
/* distributing the computation between multiple nodes */ | |
/* with MPI technology and parallelizing the computation in */ | |
/* every node with Nvidia CUDA technology */ | |
/* Compilation: nvcc -I/opt/mpi/bullxmpi/1.2.9.1/include */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Created by Xisco Sastre & Alberto Pou | |
*/ | |
import com.spark.streaming.StreamingLogger | |
import org.apache.spark._ | |
import org.apache.spark.streaming._ | |
import org.apache.spark.streaming.twitter._ | |
import com.datastax.spark.connector.cql.CassandraConnector |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection | |
from customers.models import Client | |
from contacts.models import Contact | |
tenant = Client.objects.get(name='Tenant 1') | |
connection.set_tenant(tenant) | |
# Ahora estamos conectados al Tenant 1. | |
# Todas las consultas a BD se realizarán sobre el esquema tenant1 | |
contacts = Contact.objects.all() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
from rest_framework import serializers | |
from rest_framework import viewsets | |
from contacts.models import Contact | |
class ContactSerializer(serializers.ModelSerializer): | |
class Meta: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tenant = Client(domain_url='tenant1.saas.com', | |
schema_name='tenant1', | |
name='Tenant1', | |
paid_until='2014-12-05', | |
on_trial=True) | |
tenant.save() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
from django.db import models | |
class Contact(models.Model): | |
name = models.CharField(max_length=64) | |
surnames = models.CharField(max_length=128) | |
email = models.EmailField() | |
phone_number = models.CharField(max_length=64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tenant = Client(domain_url='public.saas.com', | |
schema_name='public', | |
name='Public', | |
paid_until='2014-12-05', | |
on_trial=True) | |
tenant.save() |
NewerOlder