Skip to content

Instantly share code, notes, and snippets.

View msaroufim's full-sized avatar
🤖
Putting the finishing touches on my robot army

Mark Saroufim msaroufim

🤖
Putting the finishing touches on my robot army
View GitHub Profile
>>> 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,
"""
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
int func4(int arg0) {
ebx = arg_0;
if (ebx > 0x1) {
esi = func4(ebx + 0xffffffff);
eax = func4(ebx + 0xfffffffe);
eax = eax + esi;
}
else {
eax = 0x1;
}
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 =
class mark(Object):
A = []
words = ['bla','bloi','bli']
return words.sorted()
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")
from bs4 import BeautifulSoup
#import requests
import csv
import csv
# leaderboard_root_url = 'http://www.dota2.com/leaderboards#'
# regions = ['americas','europe', 'se_asia', 'china']
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Map : MonoBehaviour {
//grid specifics
[SerializeField]
private int rows;
[SerializeField]
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))
document.getElementById("ember1101").outerHTML = ""