Skip to content

Instantly share code, notes, and snippets.

import asyncio
class UDPUplinkProtocol:
def connection_made(self, transport):
self.transport = transport
def datagram_received(self, data, addr):
# message = data.decode()
print('Up Received %r from %s' % (len(data), addr))
# The task:
# Write a function that accepts 2 arrays.
# The arrays contain numbers and each input array is already sorted in increasing order.
# The function should create and return another array which contains all of the numbers that are in the 2 input arrays.
# The numbers in the returned array should also be sorted in increasing order.
# The goal is to write code that executes as fast as possible for large arrays.
# Implement without using any third party libraries.
# For example if the input arrays are [1,2,5] and [2,3] then the result should be [1,2,2,3,5]
# straightforward way - concat and sort:
@appetito
appetito / centos_python_env_setup
Created March 23, 2016 12:29 — forked from iDevPy/centos_python_env_setup
CentOS 7: Install Python 3.5.1, pip, virtualenv, and virtualenvwrapper on CentOS. Run this script as "root (sudo su -)" without sudo.
#!/bin/bash
#####################################################################
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
# Copyright (C) 2015 Ivan Rivera
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.