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
/radius 0 def | |
/currentgray 1 def | |
/pagewidth currentpagedevice /PageSize get 0 get def | |
/pageheight currentpagedevice /PageSize get 1 get def | |
/incRadius { | |
/radius radius 6 add def | |
} def |
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
/radius 0 def | |
/currentgray 1 def | |
/pagewidth currentpagedevice /PageSize get 0 get def | |
/pageheight currentpagedevice /PageSize get 1 get def | |
/incRadius { | |
/radius radius 8 add def | |
} def |
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
#lang racket | |
(define width 91) | |
(define height 51) | |
(define radius 9) | |
(define test-input #<<GRID | |
......x...x....x............x............x.................................x............... | |
.........x...........x...................x.....x...........xx.............x................ | |
...........x.................x.x............x..........................x................x.. | |
......x...x.....................x.....x....x.........x......x.......x...x.................. |
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
#lang racket | |
(define (can-have-eulerian-path? adj-hash) | |
(define vertex-counts (map (λ (adjs) (length adjs)) (hash-values adj-hash))) | |
(or (andmap even? vertex-counts) | |
(= 2 (length (filter odd? vertex-counts))))) | |
(define (find-eulerian-path edges) | |
(define adj-hash (build-adj-hash edges)) | |
(if (not (can-have-eulerian-path? adj-hash)) #f |
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
#lang racket/base | |
(require racket/list) | |
(define data | |
'((a b 7) | |
(a c 9) | |
(a f 14) | |
(b c 10) | |
(b d 15) |
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
#lang racket/gui | |
;;; | |
;;; WORLD | |
;;; | |
(define-struct world (lines)) | |
(define the-world (make-world '((0 . 0) (0 . 300) (250 . 250) (150 . 176) (10 . 4) (280 . 10)))) | |
;;; |
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
let isOdd x = case x % 2 of | |
0 -> Nothing | |
_ -> Just x | |
traverse (\ x -> isOdd x) [3,5,7,9] | |
-- Just ([3,5,7,9]) | |
sequence $ map (\ x -> isOdd x) [3,5,7,9] |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title></title> | |
<style> | |
body{ | |
margin: 0 auto; | |
width: 960px; | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 requests | |
import json | |
import re | |
baseurl = "https://slack.com/api/channels.history" | |
token = "ur_token_plz" | |
channel = "C029WAA59" | |
urlregex = re.compile("<(http[s]{0,1}:\/\/.+?)>") | |
def scrapelinks(latest=""): |