Skip to content

Instantly share code, notes, and snippets.

View misterpoloy's full-sized avatar
👽
Software Engineer

Juan Pablo misterpoloy

👽
Software Engineer
View GitHub Profile
@misterpoloy
misterpoloy / countries_jp.js
Created October 1, 2017 22:15
JSON en español e ingles de listado de paises con codigo de pais
[
{
"nombre": "Afganistán",
"name": "Afghanistan",
"nom": "Afghanistan",
"iso2": "AF",
"iso3": "AFG",
"phone_code": 93
},
{
@misterpoloy
misterpoloy / index.js
Created December 26, 2018 22:37
coding exercise 1 created by misterpoloy - https://repl.it/@misterpoloy/coding-exercise-1
function solution(given, T) {
let target = []
// generate target array
for (let x = 0; x < T.length; x++) {
target.push(T.charAt(x))
}
// target vs given indexes to compare
let target_index = 0;
let given_index = 0;
process.stdin.resume();
process.stdin.setEncoding("ascii");
var input = "";
process.stdin.on("data", function (chunk) {
input += chunk;
});
process.stdin.on("end", function () {
// now we can read/parse input
let response = false;
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 4 columns, instead of 2. in line 3.
Question Answer Source Metadata
¿Qué es bot y cómo funciona? Imagínate enviando un mensaje de texto a un número para ordenar una pizza y hacer que te la entreguen sin ni siquiera tener que hablar con un humano; eso es lo que hacen los bots. Específicamente, un bot es una aplicación que ejecuta una tarea automatizada, tal como activar una alarma, darte el parte del clima o hacer una búsqueda online. bbd2283a-aa19-4d1d-aafc-9b9346743369-KB.tsv
¿Que es un bot? Imagínate enviando un mensaje de texto a un número para ordenar una pizza y hacer que te la entreguen sin ni siquiera tener que hablar con un humano; eso es lo que hacen los bots. Específicamente, un bot es una aplicación que ejecuta una tarea automatizada, tal como activar una alarma, darte el parte del clima o hacer una búsqueda online. bbd2283a-aa19-4d1d-aafc-9b9346743369-KB.tsv
Necesito más información sobre el bot Imagínate enviando un mensaje de texto a un número para ordenar una pizza y hacer que te la entreguen sin ni siquiera tener que hablar co
@misterpoloy
misterpoloy / euclidsAlgorithm.cpp
Last active January 10, 2020 19:34
GCD using Euclid's algorithm (mcd) in c++
// https://www.youtube.com/watch?v=7HCd074v8g8&list=PL2_aWCzGMAwLL-mEB4ef20f3iqWMGWa25&index=8&t=0s
#include <iostream>
#include <list>
#include <cmath>
int brutDivision(int a, int b) {
int gcd = 1;
std::list<int> factors;
for (int i = 2; i < sqrt(a); i++) {
@misterpoloy
misterpoloy / BalancedParentheses.cpp
Created January 10, 2020 19:29
Check for balanced parentheses using stack = () true ([)] false
// https://www.youtube.com/watch?v=QZOLb0xHB_Q&list=PL2_aWCzGMAwI3W_JlcBbtYTwiQSsOTa6P&index=18
#include <iostream>
#include <stack>
#include <string>
bool testBalance(std::string str) {
std::stack<char> expressions;
for (int i = 0; i < str.size(); i++) {
char current = str[i];
@misterpoloy
misterpoloy / polyArea.cpp
Created January 10, 2020 19:55
Area of a Polygon using cross product
// https://www.youtube.com/watch?v=WAyPIMme3Yw&list=PL2_aWCzGMAwLL-mEB4ef20f3iqWMGWa25&index=8
#include <iostream>
#include <cmath>
struct Point {
double x;
double y;
Point(double a, double b):
x(a), y(b)
@misterpoloy
misterpoloy / CasinoRandomCtime.cpp
Created January 10, 2020 20:00
Casino game exercise (Math random and srand) with <ctime>
#include <iostream>
#include <ctime>
struct Player {
int cash = 10;
};
class Game {
public:
void Play(Player* player) {
@misterpoloy
misterpoloy / DecimalToBinary.cpp
Created January 10, 2020 20:05
Decimal to binary
#include <iostream>
#include <list>
std::list <int> decimalToBinary(int n) {
std::list <int> binary;
int remainder;
int number = n;
while (number > 0) {
int quotient = number / 2;
@misterpoloy
misterpoloy / DirectionLeftRightPoints.cpp
Created January 10, 2020 20:11
Direction of a point from a line segment
// https://www.youtube.com/watch?v=VMVuKpj_RQQ&list=PL2_aWCzGMAwLL-mEB4ef20f3iqWMGWa25&index=9
#include <iostream>
struct Point {
double x, y;
Point(double x, double y)
: x(x), y(y)
{
};