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
mergeDict = lambda a, b: {**a, **b} | |
listaDeLetras = [chr(x) for x in range(97, 123)] | |
listaDeNumeros = [str(x) for x in range(0, 10)] | |
listaDeOperadores = ['=', '+', '-', '*', '/'] | |
listaDeSeparadores = [';'] | |
evalLetraDeclaracion = {x: 'Declaracion' for x in listaDeLetras} | |
evalNumeroDeclaracion = {n: 'Declaracion' for n in listaDeNumeros} | |
evalNumero = {n: 'Numero' for n in listaDeNumeros} |
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
# Useful content: https://stackoverflow.com/questions/4370960/what-is-attr-accessor-in-ruby | |
class MyObject | |
attr_reader :model | |
def initialize arg | |
puts "This is an object" | |
puts "Argument obtained: #{arg}" | |
@model = arg | |
end |
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
#include "cuda_runtime.h" | |
#include "device_launch_parameters.h" | |
#include <iostream> | |
#include <ctime> | |
#include <cstdlib> | |
#include <cmath> | |
using namespace std; | |
/** | |
* @author Michael Serrato |
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
#include "cuda_runtime.h" | |
#include "device_launch_parameters.h" | |
#include <iostream> | |
#include <ctime> | |
#include <cstdlib> | |
#include <cmath> | |
using namespace std; | |
/** | |
* @author Michael Serrato |
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
import socket, threading, sys, pickle | |
class Client(): | |
def __init__(self, host: str = '127.0.0.1', port: int = 5000, nickname: str = None, buffer_recv: int = 4096): | |
self.buffer_recv = buffer_recv | |
self.nickname = nickname | |
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
self.socket.connect((host, port)) |
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
#include <bits/stdc++.h> | |
using namespace std; | |
int N,K; | |
int List[100002]={0}; | |
int BIT1[100002]={0}; | |
int BIT2[100002]={0}; | |
void update(int* A, int idx, int val){ | |
while(idx<=N){ | |
A[idx]+=val; | |
idx += (idx&(-idx)); |
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
#include <bits/stdc++.h> | |
#define optimize_io ios_base::sync_with_stdio(0);cin.tie(0); | |
#define dd(x) cout << #x << ": " << x << endl; | |
#define MAXN ((int)(1e6+5)) | |
#define MOD ((int)(1e9+7)) | |
#define NOT_DEFINED -1 | |
using namespace std; | |
typedef unsigned long long int ulli; | |
typedef long long int lli; |
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
#include <bits/stdc++.h> | |
#define dd(x) cout << #x << ": " << x << endl; | |
#define MAXN 1000003 | |
#define MOD 1000000007 | |
using namespace std; | |
typedef long long int lli; | |
int N; | |
lli dp[2][MAXN]; |
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
#include<iostream> | |
#include <list> | |
#include <stack> | |
using namespace std; | |
// Class to represent a graph | |
class Graph | |
{ | |
int V; // No. of vertices' |
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
/* | |
* ALGORITHM: Dijkstra | |
* | |
* @author Michael Serrato <mikebsg01@gmail.com> | |
*/ | |
#include <iostream> | |
#include <algorithm> | |
#include <climits> | |
#include <vector> | |
#include <map> |
NewerOlder