Skip to content

Instantly share code, notes, and snippets.

View evanxg852000's full-sized avatar
πŸ’­
Awesomeness πŸ‘Œ

Evance Soumaoro evanxg852000

πŸ’­
Awesomeness πŸ‘Œ
View GitHub Profile
class Client():
def __init__(self, evt_loop):
self.event_loop = evt_loop
self.reader = None
self.writer = None
async def execute(self, cmd):
if self.reader == None:
if cmd.startswith('.connect'):
cmd = cmd.replace('.connect', '').strip()
import asyncio
from resp import Client
async def main_client(prompt, evt_loop):
print(f'{prompt} Welcome to pyRedis')
running = True
cl = Client(evt_loop)
while running:
cmd = input(f'{prompt} ')

output

extern crate image;
extern crate rand;

use rand::Rng;
use std::fs::File;
use std::path::Path;
/*
Given a linked list where each node has two pointers, one to the next node and one to a random node in the list, clone the linked list.
1 -> 2 -> 3 -> 4 -> null
| | | |
v v v v
3 1 3 2
*/
// Private node class
private static class Node {
@evanxg852000
evanxg852000 / systemdesign.md
Created April 5, 2019 09:00
[System Design] #systemdesign
@evanxg852000
evanxg852000 / buble_sort.py
Last active April 3, 2019 09:06
[sorts] #algorithms #sorting
# https://www.geeksforgeeks.org/bubble-sort
def bubbleSort(arr):
n = len(arr)
# Traverse through all array elements
for i in range(n) :
# Last i elements are already in place
for j in range(0, n-i-1) :
# traverse the array from 0 to n-i-1
# Swap if the element found is greater than the next element
@evanxg852000
evanxg852000 / binarytree.py
Last active April 22, 2019 08:46
[Data Structure] #datastructure
from queue import Queue
class Node(object):
def __init__(self, data = None, left = None, right = None):
self.data = data
self.left = left
self.right = right
class BinaryTree(object):
def __init__(self, data=None):
@evanxg852000
evanxg852000 / StringAlgo.java
Last active April 20, 2019 08:54
[misc] #algorithms
public static void removeChars(StringBuilder str, String remove){
boolean flags[] = new boolean[128];
int src, dst = 0;
for(char c : remove.toCharArray()){
flag[c] = true;
}
for(src=0; src<str.length(); ++src){
char c = str.charAt(src);
@evanxg852000
evanxg852000 / project-based-learning.md
Created February 6, 2019 13:53
Project Based Learning

Project Based Learning

A list of programming tutorials in which learners build an application from scratch. These tutorials are divided into different primary programming languages. Some have intermixed technologies and languages.

To get started, simply fork this repo. Please refer to CONTRIBUTING.md for contribution guidelines.

Table of Contents:

@evanxg852000
evanxg852000 / project-based-tutorials-in-c.md
Last active February 6, 2019 13:54
Project Based Tutorials in C