Skip to content

Instantly share code, notes, and snippets.

View IanCarrasco's full-sized avatar
💯

Ian Carrasco IanCarrasco

💯
View GitHub Profile
#md | DCGAN Generator
#mdi | https://miro.medium.com/max/1400/1*5ALjnfAqwcWbOsledTBXsw.png
class generator(nn.Module):
# initializers
def __init__(self, d=128):
super(generator, self).__init__()
self.deconv1 = nn.ConvTranspose2d(100, d*8, 4, 1, 0) #md | Deconvolution | sub
self.deconv1_bn = nn.BatchNorm2d(d*8) #md | Batch Normalization | sub
self.deconv2 = nn.ConvTranspose2d(d*8, d*4, 4, 2, 1)
self.deconv2_bn = nn.BatchNorm2d(d*4)
#md | Quadratic Functions
#mdi | https://i.ytimg.com/vi/PpwEsHKwmbs/maxresdefault.jpg
x = list(range(-10, 10))
quadratic = x**2
#md | Cubic Functions
cubic = x**3
@IanCarrasco
IanCarrasco / Untitled.py
Last active July 19, 2019 00:52
Stanford CS224n Scraper
import requests
from bs4 import BeautifulSoup
from PyPDF2 import PdfFileMerger, PdfFileReader
from io import BytesIO
#Parse page with beautiful soup
origin = 'https://web.stanford.edu/class/cs224n/readings/'
page = requests.get(origin)
content = BeautifulSoup(page.text)

Coiling loxodromes

Canvas version of this gif from FLRN GIF :

Original GIF

Optimisable, by caching the square roots for example.

A Pen by Bali Balo on CodePen.

READ ME - PA1 - Shopping Bags

Question 1

Pick three of the Bag implementations other than Bag0. In 150 words or less, describe the tests that differ across them, and why the implementations produce those different results. You don’t have to talk in detail about all of your tests, just the ones that usefully distinguish three implementations of your choice

  • Bag 2
    • Bag 2 utilizes a very straightforward approach *Bag 6 *Bag 10

Question 2

Some of the Bag implementations are buggy – they have clear mistakes in some situations. Others simply differ in behavior. For each implementation, indicate if you think it has a clear bug, and describe the problem, or if it’s simply an implementation choice. Give one sentence for each bag. Note that this requires exercising your own judgment, which we cannot do for you.

%matplotlib inline
from matplotlib import pyplot as plt
import numpy as np
import pandas as pd
plt.style.use('fivethirtyeight')
x = np.linspace(0, 10)
@IanCarrasco
IanCarrasco / hyperguide.md
Last active February 22, 2023 10:15
How to Create a Hyper Terminal at a Folder

How to open hyper at current directory.

1.Go to the forked cd_to github repository and download the latest release.(zipped) Download From Github.

2.Within cd_to, open the Hyper folder and drag the cd_to.app file into your Applications folder MacDown Screenshot.

3.Now open up Automator and create a new service. File>New>Service(gear icon).Be sure to save the service with an effective name like "Hyper Terminal at Folder" MacDown Screenshot

@IanCarrasco
IanCarrasco / fizzbuzz.py
Created August 1, 2017 01:07
Fizzbuzz Python Implementation
def fizzBuzz(amt):
for i in xrange(1,amt):
if i % 3 == 0 and i % 5 == 0:
print "fizzbuzz"
elif i % 3 is 0:
print "fizz"
elif i % 5 is 0:
print "buzz"
else:
print i
@IanCarrasco
IanCarrasco / him.py
Last active July 27, 2017 20:40
A list of every item shown on How Its Made
from imdb import IMDb
import json
i = IMDb()
him = i.get_movie('0835010')
i.update(him,'episodes')
him_items = []