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
| # Scraping http://salsahackers.com/dj-pick/ | |
| open System | |
| open System.Text.RegularExpressions | |
| open FSharp.Data | |
| open FSharp.Data | |
| let Show x = x.Dump(); x | |
| let domain = "http://salsahackers.com" |
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
| # Scraping http://salsahackers.com/dj-pick/ | |
| open System | |
| open System.Text.RegularExpressions | |
| open FSharp.Data | |
| open FSharp.Data | |
| let Show x = x.Dump(); x | |
| let domain = "http://salsahackers.com" |
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
| open System.Net | |
| open System.IO | |
| open System.Threading | |
| open System.Text.RegularExpressions | |
| let limit = 50 | |
| let linkPat = "href=\s*\"[^\"h]*(http://[^&\"]*)\"" | |
| let getLinks (txt : string) = | |
| [ for m in Regex.Matches(txt, linkPat) -> m.Groups.Item(1).Value ] |
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
| library simple_reloader; | |
| import 'dart:async'; | |
| import 'dart:core'; | |
| import 'dart:html'; | |
| final RegExp paramPat = new RegExp(r'(\&|\?)_cacheOverride=\d+'); | |
| final RegExp queryPat = new RegExp(r'\?'); | |
| reloadStylesheets() { |
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 'dart:html'; | |
| import 'dart:math'; | |
| var text = ''' | |
| William Shakespeare (/ˈʃeɪkspɪər/;[1] 26 April 1564 (baptised) – 23 April 1616)[nb 1] was an English poet, playwright, and actor, widely regarded as the greatest writer in the English language and the world's pre-eminent dramatist.[2] He is often called England's national poet, and the "Bard of Avon".[3][nb 2] His extant works, including collaborations, consist of approximately 38 plays,[nb 3] 154 sonnets, two long narrative poems, and a few other verses, some of uncertain authorship. His plays have been translated into every major living language and are performed more often than those of any other playwright.[4] | |
| Shakespeare was born and brought up in Stratford-upon-Avon, Warwickshire. At the age of 18, he married Anne Hathaway, with whom he had three children: Susanna, and twins Hamnet and Judith. Sometime between 1585 and 1592, he began a successful career in London as an actor, writer, and part-owner of a playing company called the Lord Chamberlain's |
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 A { | |
| String f1, f2, f3; | |
| A({this.f1, this.f2, this.f3}); | |
| @override | |
| String toString() => 'A: $f1 $f2 $f3'; | |
| } | |
| class B { | |
| String f1, f2, f3; | |
| B({this.f1, this.f2, this.f3}); |
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 A(String f1 = "a1", String f2 = "a2", String f3 = "a3") { | |
| shared default String str => "A: ``f1``, ``f2``, ``f3``"; | |
| } | |
| class B(String f1 = "b1", String f2 = "b2", String f3 = "b3") { | |
| shared default String str => "B: ``f1``, ``f2``, ``f3``"; | |
| } | |
| class Base(String base1 = "base1", String base2 = "base2", String base3 = "base3") { | |
| shared actual default String string = "Base: ``base1``, ``base2``, ``base3``"; |
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 | |
| (require 2htdp/universe) | |
| (require 2htdp/image) | |
| ;; The onMouse function takes a world and mouse event parameters, and returns a new world if a click | |
| ;; happened, or the same world if some other event happened (e.g. mouse move) | |
| (define (onMouse world x y ev) | |
| (if (equal? ev "button-down") | |
| (cond |
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 plai | |
| (((λ (newbox) | |
| (λ (setbox) | |
| ((λ (_) newbox) (setbox newbox)))) | |
| (box 'dummy)) | |
| (λ (box) (set-box! box box))) | |
| ; b now refers to itself. |
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 | |
| ; Desugaring sequencing (begin ...) over lambdas. | |
| (define (h _) (print "hello")) | |
| (define (w _) (print "world")) | |
| (define (seq x) | |
| (λ (y) | |
| (y (x null)))) |