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 string | |
from random import * | |
characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" | |
password = "".join(choice(characters) for x in range(randint(8, 10))) | |
#print password | |
for x in range (151): | |
i = "".join(choice(characters) for x in range(randint(8, 10))) | |
with open("passwords.txt","a") as outfile: | |
outfile.write(i+"\n") |
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
L = [[1,2,[3]],4] | |
#test_list = [1, 2, 3,[[4]],[[[5]]],[6],[[7]]] | |
model = 9 | |
empty = [] | |
def get_numbers(mod,L): | |
global empty | |
#For each item in the list | |
for item in L: | |
#If the type of the model is the same as the item: |
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 cmath | |
#https://www.youtube.com/watch?v=eaYX0Ee0Kcg | |
#This is my solution to the problem he provided. | |
points = [(-2,4),(0,-2),(-1,0),(2,5),(-2,-3),(3,2)] | |
orign = (0,0) | |
print(points) | |
def get_distance_between(P1,P2): | |
distance = cmath.sqrt((P2[1]-P1[1])**2+(P2[0]-P1[0])**2) | |
return distance |
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
var intro = "Remove multiline comments to run the code therein" | |
var __version__ = "0.1" | |
document.write("Version:" +__version__) | |
function capitalize(s) | |
{ | |
return s[0].toUpperCase() + s.slice(1); | |
} | |
function title1(name=""){ |
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
from pymongo import MongoClient | |
#pip3 install pymongo | |
if __name__ == "__main__": | |
client = MongoClient() | |
db = client.test_database | |
people = db.people | |
people.insert_one({'name':'Mike','food':'cheese'}) | |
people.insert_one({'name':'John','food':'ham','location':'UK'}) |
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
""" | |
Problem Statement | |
================= | |
Given two strings str1 and str2, find the minimum number of edits (edit one character to another, delete char from str1 | |
or delete char from str2) to change str1 to str2. | |
Video | |
----- | |
* https://youtu.be/We3YDTzNXEk | |
Analysis | |
-------- |
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
# -*- coding: utf -*- | |
intro = '''Remove tripple quotes around the sections to run the code therein\n''' | |
__version__ = "0.2" | |
__py_version__ = "2.7x" | |
print "Version: "+__version__+'\nPython: '+__py_version__+'\n' | |
print intro | |
def title1(name=''): | |
print '\n' + name.upper() + ':' | |
print '-'*65 |
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
# A decorator is a function that takes a function as an argument and adds a bow tie on top of it. | |
def decorator(func): | |
return func | |
#This "decorator" doesn't really decorate the input function. It just returns the input function. | |
@decorator | |
def aFunc(): | |
print('hello\n') | |
aFunc() |
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
# -*- coding: utf -*- | |
# add to soft dev/examples | |
# By the Tutorial Doctor | |
# Sep 2, 2015 | |
# Procedural Level Generation | |
#-------------------------------------------------- | |
# THE CODE |
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
<!DOCTYPE html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> |