Skip to content

Instantly share code, notes, and snippets.

View MagallanesFito's full-sized avatar

Adolfo Fragoso Magallanes MagallanesFito

View GitHub Profile
@MagallanesFito
MagallanesFito / add_to_db.py
Created December 9, 2018 22:55
List of most common hobbies in English and Spanish. It's used for a reccomendation system here: https://github.com/MagallanesFito/weheart
from webapp.models import Interest
'''This file loads two txt files and combines them to create a full list of hobbies.
Starts by reading the list of hobbies in spanish, each time it reads a line, process the string
for making the list as pure as possible. Finally the merged list is passed to the django database.
For full project details https://github.com/MagallanesFito/weheart.
'''
#Se cargan los hobbies en espanol
def procesar(cadena):
procesada = str(cadena).title()
resumida = procesada.split("(")[0]
@MagallanesFito
MagallanesFito / main.dart
Created November 15, 2018 19:45
Primera version MainScreen photo-draw
/*
Dependencias:
path_provider: ^0.4.1
image_picker: ^0.4.0
*/
import 'package:flutter/material.dart';
import 'package:image_picker/image_picker.dart';
import 'dart:io';
import 'dart:async';
@MagallanesFito
MagallanesFito / index.html
Created April 5, 2018 00:58
Primera version de Dashboard para sistema de horarios
<!--
Falta agregarle los iconos a cada uno de los componentes no sabía que en Bootstrap 4 no se podia agregar Glypicon :(
-->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Dashboard</title>
<!-- Bootstrap core CSS -->
@MagallanesFito
MagallanesFito / Dijkstra.cpp
Last active October 25, 2024 08:40
Dijkstra Algorithm C++
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef pair<int,int> myPair;
class Graph{
int V;
list<myPair> *adj;
public:
Graph(int V);
@MagallanesFito
MagallanesFito / Floyd-Warshall.cpp
Created May 4, 2017 07:39
Floyd-Warshall Graph Algorithm C++
#include <iostream>
#define INF 0x3f3f3f3f
#define MAX_VERTICES 4
using namespace std;
int graph[MAX_VERTICES][MAX_VERTICES] = {
{0,5,INF,10},
{INF,0,3,INF},
{INF,INF,0,1},
{INF,INF,INF,0}
@MagallanesFito
MagallanesFito / DFS.cpp
Created May 4, 2017 07:25
Depth First Search C++
#include <iostream>
#include <list>
using namespace std;
class Graph{
int V; //Numero de vertices
list<int> *adj; //arreglo de listas de adyacencia
bool *visited; //matriz de visitados.
public:
Graph(int V); //Constructor
@MagallanesFito
MagallanesFito / BFS.cpp
Created May 4, 2017 07:20
Breadth First Search C++
#include <iostream>
#include <list>
#include <algorithm>
using namespace std;
/**
Implementacion con lista de adyacencia
*/
class Graph{
int V;
@MagallanesFito
MagallanesFito / Coloring.cpp
Last active December 10, 2022 22:43
Graph coloring Backtracking
#include <iostream>
#include<list>
#include <algorithm>
#include <vector>
using namespace std;
#define MAX_COLORS 1001
vector<int> Color(MAX_COLORS,-1);
class Graph{
@MagallanesFito
MagallanesFito / BellmanFord.cpp
Last active November 5, 2022 21:30
Bellman Ford in C++
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
class Graph{
private:
int V;
//lista de aristas, con formato <peso,origen,destino>
vector<pair<int,pair<int,int> > > edges;
bool hasNegativeCycle = false;
@MagallanesFito
MagallanesFito / Prim.cpp
Created April 20, 2017 06:03
Prim's algorithm in C++ from geeksforgeeks.org
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
using namespace std;
typedef pair<int,int> iPair;
class Graph{
int V;
//lista de adyacencia con pesos
//list<int> *adj; sin pesos