This file contains hidden or 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 spacy | |
| nlp = spacy.load("en_core_web_md", disable=['parser', 'ner']) | |
| # Get w2v representation of the word 'breakfast' | |
| print (nlp('breakfast').vector.size) | |
| nlp('breakfast').vector[:10] | |
| # Find cosine similarity between w2v representations of breakfast and universe | |
| nlp('breakfast').similarity(nlp('universe')) # 0.044292555 | |
| doc1 = nlp("I like oranges that are sweet.") | |
| doc2 = nlp("I like apples that are sour.") | |
| doc1.similarity(doc2) # 0.962154245 |
This file contains hidden or 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
| {"lastUpload":"2020-07-14T18:26:56.890Z","extensionVersion":"v3.4.3"} |
This file contains hidden or 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
| def groupElems(arr): | |
| def aux(arr, acc=[]): | |
| if(len(arr) <=0): | |
| return acc | |
| n=arr[0] | |
| a=0 | |
| temp=[] | |
| for i in arr: | |
| if i == n: |
This file contains hidden or 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> | |
| <html> | |
| <body> | |
| <script src="script1.js"></script> | |
| <script src="script2.js"></script> | |
| </body> | |
| </html> |
This file contains hidden or 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
| const scraper = require('./scraper.js'); | |
| const puppeteer = require('puppeteer'); | |
| const fs = require('fs'); | |
| require('dotenv').config(); | |
| (async () => { | |
| try { | |
| //launch browser | |
| let browser = await puppeteer.launch({ headless: true }); |
This file contains hidden or 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
| /** | |
| * Scraper module | |
| * Contains the methods/functions for generic facebook search | |
| */ | |
| //base url for login | |
| const LOGIN_URL = 'https://www.facebook.com/login/device-based/regular/login/?login_attempt=1&lwv=111'; | |
| //login selectors | |
| const LOGIN_USERNAME_SELECTOR = '#email'; |
This file contains hidden or 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
| rem Use this script to compile a passed file to binary from assembly | |
| rem Pass a filepath as a command arg | |
| java -classpath %~dp0\ARCToolsv2.1.2.jar ARCTools.ARCAsm %1 |
This file contains hidden or 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
| addLine(picture, 0, getHeight(picture)-1, getWidth(picture)-1, 0, color) |
This file contains hidden or 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 threading import Thread | |
| import math | |
| #Divides a list into number of chunks | |
| def chunkList(list, numChunks): | |
| sizeChunks=int(math.floor(len(list)/numChunks)) | |
| chunks=[] | |
| for i in range(0, numChunks): | |
| if(i == numChunks-1): | |
| chunks.append(list[i*sizeChunks:len(list)]) |
This file contains hidden or 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
| def q1(): | |
| file='C:\\Users\\Christian\\Documents\\Projects\\CPS109\\resources\\mediasources\\beach.jpg' | |
| picture=makePicture(file) | |
| return getRed(getPixelAt(picture, 100, 100)) | |
| print q1() | |
| def q2(): | |
| return ord('e') |
NewerOlder