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
| class mark(Object): | |
| A = [] | |
| words = ['bla','bloi','bli'] | |
| return words.sorted() |
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
| >>> range(3, 6) # normal call with separate arguments | |
| [3, 4, 5] | |
| >>> args = [3, 6] | |
| >>> range(*args) # call with arguments unpacked from a list | |
| [3, 4, 5] | |
| In the same fashion, dictionaries can deliver keyword arguments with the **-operator: | |
| >>> | |
| >>> def parrot(voltage, state='a stiff', action='voom'): | |
| ... print "-- This parrot wouldn't", action, |
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
| """ | |
| A simple command line utility that takes in a list of target url's | |
| and downloads all pdf links contained on the page | |
| Potentially look into using scrapy to build a full fledged crawler instead | |
| """ | |
| import requests | |
| import sys | |
| import re |
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
| int func4(int arg0) { | |
| ebx = arg_0; | |
| if (ebx > 0x1) { | |
| esi = func4(ebx + 0xffffffff); | |
| eax = func4(ebx + 0xfffffffe); | |
| eax = eax + esi; | |
| } | |
| else { | |
| eax = 0x1; | |
| } |
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 Data.List | |
| import qualified Data.List.Key as K | |
| import Data.Map ((!), fromList, fromListWith, adjust, keys, Map) | |
| buildGraph :: Ord a => [(a, a, Float)] -> Map a [(a, Float)] | |
| buildGraph g = fromListWith (++) $ g >>= | |
| \(a,b,d) -> [(a,[(b,d)]), (b,[(a,d)])] | |
| dijkstra :: Ord a => a -> Map a [(a, Float)] -> Map a (Float, Maybe a) | |
| dijkstra source graph = |
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 bs4 import BeautifulSoup | |
| import requests | |
| import csv | |
| leaderboard_root_url = 'http://www.dota2.com/leaderboards#' | |
| regions = ['americas','europe', 'se_asia', 'china'] | |
| for region in regions: | |
| page = requests.get(leaderboard_root_url + region).content | |
| soup = BeautifulSoup(page, "html5lib") |
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 bs4 import BeautifulSoup | |
| #import requests | |
| import csv | |
| import csv | |
| # leaderboard_root_url = 'http://www.dota2.com/leaderboards#' | |
| # regions = ['americas','europe', 'se_asia', 'china'] | |
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
| using System.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| public class Map : MonoBehaviour { | |
| //grid specifics | |
| [SerializeField] | |
| private int rows; | |
| [SerializeField] |
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
| class NeuralNetwork: | |
| def __init__(self, x, y): | |
| self.input = x | |
| self.weights1 = np.random.rand(self.input.shape[1],4) | |
| self.weights2 = np.random.rand(4,1) | |
| self.y = y | |
| self.output = np.zeros(self.y.shape) | |
| def feedforward(self): | |
| self.layer1 = sigmoid(np.dot(self.input, self.weights1)) |
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
| document.getElementById("ember1101").outerHTML = "" |
OlderNewer