fix dead url for unixdict.txt
17 files changed:
! Copyright (C) 2008, 2010 Slava Pestov.
! See https://factorcode.org/license.txt for BSD license.
USING: assocs bootstrap.image checksums checksums.md5
! Copyright (C) 2008, 2010 Slava Pestov.
! See https://factorcode.org/license.txt for BSD license.
USING: assocs bootstrap.image checksums checksums.md5
-http.client io.files kernel math.parser splitting urls ;
+http.client http.download io.files kernel math.parser splitting
+urls ;
IN: bootstrap.image.download
CONSTANT: download-url URL" https://downloads.factorcode.org/images/master/"
IN: bootstrap.image.download
CONSTANT: download-url URL" https://downloads.factorcode.org/images/master/"
need-new-image? [ "Boot image corrupt" throw ] when ;
: download-image ( image -- )
need-new-image? [ "Boot image corrupt" throw ] when ;
: download-image ( image -- )
- [ download-url swap >url derive-url download ]
- [ verify-image ]
- bi ;
+ [ download-url ] dip >url derive-url
+ download verify-image ;
: maybe-download-image ( image -- ? )
dup need-new-image? [ download-image t ] [ drop f ] if ;
: maybe-download-image ( image -- ? )
dup need-new-image? [ download-image t ] [ drop f ] if ;
! See https://factorcode.org/license.txt for BSD license.
USING: arrays combinators command-line io kernel math
math.functions math.parser math.primes.pollard-rho-brent
! See https://factorcode.org/license.txt for BSD license.
USING: arrays combinators command-line io kernel math
math.functions math.parser math.primes.pollard-rho-brent
-ranges math.statistics namespaces sequences
-sequences.product sets sorting splitting ;
+math.statistics namespaces ranges sequences sequences.product
+sets sorting splitting ;
IN: math.primes.factors
: factors ( n -- seq ) pollard-rho-brent-factors ; flushable
IN: math.primes.factors
: factors ( n -- seq ) pollard-rho-brent-factors ; flushable
-USING: tools.test unicode sequences math http.client kernel
-splitting unicode.categories io.pathnames io.encodings.utf8
-io.files io.files.temp strings quotations math.parser locals ;
+USING: http.download io.encodings.utf8 io.files io.files.temp
+kernel math.parser quotations sequences splitting strings
+tools.test unicode ;
IN: unicode.breaks.tests
{ "\u001112\u001161\u0011abA\u000300a\r\r\n" }
IN: unicode.breaks.tests
{ "\u001112\u001161\u0011abA\u000300a\r\r\n" }
: grapheme-break-test ( -- filename )
"https://downloads.factorcode.org/misc/UCD/15.1.0/auxiliary/GraphemeBreakTest.txt"
: grapheme-break-test ( -- filename )
"https://downloads.factorcode.org/misc/UCD/15.1.0/auxiliary/GraphemeBreakTest.txt"
- "GraphemeBreakTest-15.1.0.txt" cache-file [ ?download-to ] keep ;
+ "GraphemeBreakTest-15.1.0.txt" cache-file download-to ;
: word-break-test ( -- filename )
"https://downloads.factorcode.org/misc/UCD/15.1.0/auxiliary/WordBreakTest.txt"
: word-break-test ( -- filename )
"https://downloads.factorcode.org/misc/UCD/15.1.0/auxiliary/WordBreakTest.txt"
- "WordBreakTest-15.1.0.txt" cache-file [ ?download-to ] keep ;
+ "WordBreakTest-15.1.0.txt" cache-file download-to ;
: parse-test-file ( file-name -- tests )
utf8 file-lines
: parse-test-file ( file-name -- tests )
utf8 file-lines
USING: arrays assocs grouping hash-sets http.client
USING: arrays assocs grouping hash-sets http.client
-io.encodings.binary io.encodings.string io.encodings.utf8
-io.files io.files.temp kernel math math.order math.parser
-sequences sets splitting strings tools.test unicode ;
+http.download io.encodings.binary io.encodings.string
+io.encodings.utf8 io.files io.files.temp kernel math math.order
+math.parser sequences sets splitting strings tools.test unicode ;
IN: unicode.collation.tests
: test-equality ( str1 str2 -- ? ? ? ? )
IN: unicode.collation.tests
: test-equality ( str1 str2 -- ? ? ? ? )
: collation-test-lines ( -- lines )
"https://downloads.factorcode.org/misc/UCA/15.1.0/CollationTest_SHIFTED.txt"
: collation-test-lines ( -- lines )
"https://downloads.factorcode.org/misc/UCA/15.1.0/CollationTest_SHIFTED.txt"
- "CollationTest_SHIFTED_15.1.0.txt" cache-file [ ?download-to ] keep
+ "CollationTest_SHIFTED_15.1.0.txt" cache-file download-to
utf8 file-lines [ "#" head? ] reject harvest ;
: parse-collation-test-shifted ( -- lines )
utf8 file-lines [ "#" head? ] reject harvest ;
: parse-collation-test-shifted ( -- lines )
! Copyright (C) 2008 Daniel Ehrenberg.
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators
! Copyright (C) 2008 Daniel Ehrenberg.
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs combinators
-combinators.short-circuit combinators.smart fry kernel make
-math math.order math.parser namespaces sequences
-simple-flat-file splitting strings unicode.data ;
+combinators.short-circuit combinators.smart kernel make math
+math.order math.parser namespaces sequences simple-flat-file
+splitting strings unicode.data ;
IN: unicode.collation
<PRIVATE
IN: unicode.collation
<PRIVATE
-USING: arrays assocs combinators combinators.short-circuit
-grouping http.client io.encodings.utf8 io.files io.files.temp
-io.streams.null kernel locals math math.parser quotations random
-sequences splitting splitting.extras strings tools.test unicode
-unicode.normalize.private ;
+USING: arrays assocs combinators.short-circuit grouping
+http.download io.encodings.utf8 io.files io.files.temp kernel
+math math.parser sequences splitting splitting.extras strings
+tools.test unicode unicode.normalize.private ;
IN: unicode.normalize.tests
{ "ab\u000323\u000302cd" } [ "ab\u000302" "\u000323cd" string-append ] unit-test
IN: unicode.normalize.tests
{ "ab\u000323\u000302cd" } [ "ab\u000302" "\u000323cd" string-append ] unit-test
! Could use simple-flat-file after some cleanup
: parse-normalization-tests ( -- tests )
"https://downloads.factorcode.org/misc/UCD/15.1.0/NormalizationTest.txt"
! Could use simple-flat-file after some cleanup
: parse-normalization-tests ( -- tests )
"https://downloads.factorcode.org/misc/UCD/15.1.0/NormalizationTest.txt"
- "NormalizationTest-15.1.0.txt" cache-file [ ?download-to ] keep
+ "NormalizationTest-15.1.0.txt" cache-file download-to
utf8 file-lines [ "#" head? ] reject
[ "@" head? ] split*-when
2 <groups> [ first2 [ first ] dip 2array ] map
utf8 file-lines [ "#" head? ] reject
[ "@" head? ] split*-when
2 <groups> [ first2 [ first ] dip 2array ] map
! Copyright (C) 2008 Daniel Ehrenberg.
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays ascii combinators
! Copyright (C) 2008 Daniel Ehrenberg.
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays ascii combinators
-combinators.short-circuit hints kernel make math
-math.order sbufs sequences sorting.insertion strings
-unicode.data vectors ;
+combinators.short-circuit hints kernel make math math.order
+sbufs sequences sorting.insertion strings unicode.data vectors ;
IN: unicode.normalize
<PRIVATE
IN: unicode.normalize
<PRIVATE
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs calendar calendar.format cli.git
combinators combinators.short-circuit continuations formatting
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs calendar calendar.format cli.git
combinators combinators.short-circuit continuations formatting
-github html.parser html.parser.analyzer http.client io
-io.directories io.encodings.string io.encodings.utf8 io.files
-io.launcher io.pathnames json kernel layouts math namespaces qw
-semver sequences sequences.extras sorting sorting.human
-sorting.specification splitting system unicode ;
+github html.parser html.parser.analyzer http.client
+http.download io io.directories io.encodings.string
+io.encodings.utf8 io.files io.launcher io.pathnames json kernel
+layouts math namespaces qw semver sequences sequences.extras
+sorting sorting.human sorting.specification splitting system
+unicode ;
IN: build-from-source
INITIALIZED-SYMBOL: use-gitlab-git-uris [ f ]
IN: build-from-source
INITIALIZED-SYMBOL: use-gitlab-git-uris [ f ]
] with-directory ; inline
: ?download ( path -- )
] with-directory ; inline
: ?download ( path -- )
- dup file-name file-exists? [ drop ] [ download ] if ; inline
+ dup file-name file-exists? [ drop ] [ download drop ] if ; inline
: with-tar-gz ( path quot -- )
'[
: with-tar-gz ( path quot -- )
'[
USING: accessors alien.c-types alien.data arrays combinators
USING: accessors alien.c-types alien.data arrays combinators
-destructors http.client io io.encodings.ascii io.files
+destructors http.download io io.encodings.ascii io.files
io.files.temp kernel math math.parser math.vectors opengl
opengl.capabilities opengl.demo-support opengl.gl sequences
specialized-arrays splitting vectors ;
io.files.temp kernel math math.parser math.vectors opengl
opengl.capabilities opengl.demo-support opengl.gl sequences
specialized-arrays splitting vectors ;
"https://downloads.factorcode.org/misc/bun_zipper.ply"
: download-bunny ( -- path )
"https://downloads.factorcode.org/misc/bun_zipper.ply"
: download-bunny ( -- path )
- model-url model-path [ ?download-to ] keep ;
+ model-url model-path download-to ;
:: (draw-triangle) ( ns vs triple -- )
triple [| elt |
:: (draw-triangle) ( ns vs triple -- )
triple [| elt |
USING: accessors alien.c-types arrays classes.struct combinators
combinators.short-circuit game.loop game.worlds gpu gpu.buffers
gpu.framebuffers gpu.render gpu.shaders gpu.state gpu.textures
USING: accessors alien.c-types arrays classes.struct combinators
combinators.short-circuit game.loop game.worlds gpu gpu.buffers
gpu.framebuffers gpu.render gpu.shaders gpu.state gpu.textures
-gpu.util gpu.util.wasd grouping http.client images images.loader
-io io.encodings.ascii io.files io.files.temp kernel literals
-math.parser math.vectors math.vectors.simd method-chains
-namespaces sequences specialized-arrays specialized-vectors
-threads ui.gadgets.worlds ui.pixel-formats ;
+gpu.util gpu.util.wasd grouping http.client http.download images
+images.loader io io.encodings.ascii io.files io.files.temp
+kernel literals math.parser math.vectors math.vectors.simd
+method-chains namespaces sequences specialized-arrays
+specialized-vectors threads ui.gadgets.worlds ui.pixel-formats ;
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
SPECIALIZED-VECTOR: uint
FROM: alien.c-types => float ;
SPECIALIZED-ARRAY: float
SPECIALIZED-VECTOR: uint
"https://downloads.factorcode.org/misc/bun_zipper.ply"
: download-bunny ( -- path )
"https://downloads.factorcode.org/misc/bun_zipper.ply"
: download-bunny ( -- path )
- bunny-model-url bunny-model-path [ ?download-to ] keep ;
+ bunny-model-url bunny-model-path download-to ;
: get-bunny-data ( bunny-state -- )
download-bunny bunny-data
: get-bunny-data ( bunny-state -- )
download-bunny bunny-data
! Copyright (C) 2010 Erik Charlebois.
! See https://factorcode.org/license.txt for BSD license.
! Copyright (C) 2010 Erik Charlebois.
! See https://factorcode.org/license.txt for BSD license.
-USING: accessors alien http.client io io.files.temp
+USING: accessors alien http.download io.files.temp
io.streams.string kernel literals macho multiline sequences
io.streams.string kernel literals macho multiline sequences
-strings system tools.test urls ;
+system tools.test urls ;
IN: macho.tests
STRING: validation-output
IN: macho.tests
STRING: validation-output
: a.macho ( -- path )
URL" https://downloads.factorcode.org/misc/a.macho"
: a.macho ( -- path )
URL" https://downloads.factorcode.org/misc/a.macho"
- "a.macho" cache-file [ ?download-to ] keep ;
+ "a.macho" cache-file download-to ;
: a2.macho ( -- path )
URL" https://downloads.factorcode.org/misc/a2.macho"
: a2.macho ( -- path )
URL" https://downloads.factorcode.org/misc/a2.macho"
- "a2.macho" cache-file [ ?download-to ] keep ;
+ "a2.macho" cache-file download-to ;
cpu ppc? [
{ $ validation-output }
cpu ppc? [
{ $ validation-output }
: wordlist ( -- seq )
"https://projecteuler.net/project/resources/p098_words.txt"
: wordlist ( -- seq )
"https://projecteuler.net/project/resources/p098_words.txt"
- "p098_words.txt" temp-file [ ?download-to ] keep
+ "p098_words.txt" temp-file download-to
utf8 file-contents "," split [ rest-slice but-last ] map ;
: squarelist ( n -- seq )
utf8 file-contents "," split [ rest-slice but-last ] map ;
: squarelist ( n -- seq )
! Copyright (c) 2012 Anonymous
! See https://factorcode.org/license.txt for BSD license.
! Copyright (c) 2012 Anonymous
! See https://factorcode.org/license.txt for BSD license.
-USING: assocs http.client io.encodings.utf8 io.files
+USING: assocs http.download io.encodings.utf8 io.files
io.files.temp kernel math math.combinatorics sequences sorting
strings urls ;
io.files.temp kernel math math.combinatorics sequences sorting
strings urls ;
! in the same position in both words.
! The task is to use the word list at
! in the same position in both words.
! The task is to use the word list at
-! https://www.puzzlers.org/pub/wordlists/unixdict.txt to find and
-! show the longest deranged anagram.
+! https://raw.githubusercontent.com/quinnj/Rosetta-Julia/master/unixdict.txt
+! to find and show show the longest deranged anagram.
: derangement? ( str1 str2 -- ? ) [ = not ] 2all? ;
: derangement? ( str1 str2 -- ? ) [ = not ] 2all? ;
deranged-anagrams [ first length ] sort-by last ;
: default-word-list ( -- path )
deranged-anagrams [ first length ] sort-by last ;
: default-word-list ( -- path )
- URL" https://puzzlers.org/pub/wordlists/unixdict.txt"
- "unixdict.txt" temp-file [ ?download-to ] keep ;
+ URL" https://raw.githubusercontent.com/quinnj/Rosetta-Julia/master/unixdict.txt"
+ "unixdict.txt" temp-file download-to ;
: longest-deranged-anagrams ( -- anagrams )
default-word-list (longest-deranged-anagrams) ;
: longest-deranged-anagrams ( -- anagrams )
default-word-list (longest-deranged-anagrams) ;
! Copyright (c) 2012 Anonymous
! See https://factorcode.org/license.txt for BSD license.
! Copyright (c) 2012 Anonymous
! See https://factorcode.org/license.txt for BSD license.
-USING: grouping http.client io io.encodings.utf8 io.files
-io.files.temp kernel math sequences sequences.extras
-unicode urls ;
+USING: grouping http.download io io.encodings.utf8 io.files
+io.files.temp math sequences sequences.extras unicode urls ;
IN: rosetta-code.ordered-words
! https://rosettacode.org/wiki/Ordered_words
IN: rosetta-code.ordered-words
! https://rosettacode.org/wiki/Ordered_words
! this page.
MEMO: word-list ( -- seq )
! this page.
MEMO: word-list ( -- seq )
- URL" https://puzzlers.org/pub/wordlists/unixdict.txt"
+ URL" https://raw.githubusercontent.com/quinnj/Rosetta-Julia/master/unixdict.txt"
- [ ?download-to ] [ utf8 file-lines ] bi ;
+ download-to utf8 file-lines ;
: ordered-word? ( word -- ? )
>lower [ <= ] monotonic? ;
: ordered-word? ( word -- ? )
>lower [ <= ] monotonic? ;
! Copyright (C) 2010 John Benediktsson
! See https://factorcode.org/license.txt for BSD license
USING: arrays ascii assocs combinators combinators.smart
! Copyright (C) 2010 John Benediktsson
! See https://factorcode.org/license.txt for BSD license
USING: arrays ascii assocs combinators combinators.smart
-http.client io.encodings.ascii io.files io.files.temp kernel
+http.download io.encodings.ascii io.files io.files.temp kernel
math math.statistics ranges sequences sequences.private sorting
splitting urls ;
IN: spelling
math math.statistics ranges sequences sequences.private sorting
splitting urls ;
IN: spelling
MEMO: default-dictionary ( -- counts )
URL" https://norvig.com/big.txt" "big.txt" temp-file
MEMO: default-dictionary ( -- counts )
URL" https://norvig.com/big.txt" "big.txt" temp-file
- [ ?download-to ] [ load-dictionary ] bi ;
+ download-to load-dictionary ;
: (correct) ( word dictionary -- word/f )
corrections ?first ;
: (correct) ( word dictionary -- word/f )
corrections ?first ;
! Copyright (C) 2021 John Benediktsson
! See https://factorcode.org/license.txt for BSD license
! Copyright (C) 2021 John Benediktsson
! See https://factorcode.org/license.txt for BSD license
-USING: assocs combinators command-line http.client io
+USING: assocs combinators command-line http.download io
io.directories io.encodings.utf8 io.files io.files.temp
io.launcher io.pathnames json kernel namespaces regexp sequences
splitting system urls wrap.strings ;
io.directories io.encodings.utf8 io.files io.files.temp
io.launcher io.pathnames json kernel namespaces regexp sequences
splitting system urls wrap.strings ;
: download-tldr ( -- )
"tldr" cache-file dup make-directory [
: download-tldr ( -- )
"tldr" cache-file dup make-directory [
- tldr-zip "tldr.zip" download-to
+ tldr-zip "tldr.zip" download-to drop
{ "unzip" "tldr.zip" } try-process
] with-directory ;
{ "unzip" "tldr.zip" } try-process
] with-directory ;
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs bootstrap.image calendar cli.git
combinators combinators.short-circuit concurrency.combinators
! See https://factorcode.org/license.txt for BSD license.
USING: accessors arrays assocs bootstrap.image calendar cli.git
combinators combinators.short-circuit concurrency.combinators
-environment formatting http.client io io.directories
-io.encodings.utf8 io.launcher io.pathnames kernel math.parser
-memory modern.paths namespaces parser.notes prettyprint
-regexp.classes sequences sequences.extras sets splitting system
-system-info threads tools.test tools.test.private vocabs
-vocabs.hierarchy vocabs.hierarchy.private vocabs.loader
-vocabs.metadata zealot ;
+environment formatting http.download io io.directories
+io.launcher io.pathnames kernel math.parser memory modern.paths
+namespaces parser.notes prettyprint regexp.classes sequences
+sequences.extras sets splitting system system-info threads
+tools.test tools.test.private vocabs vocabs.hierarchy
+vocabs.hierarchy.private vocabs.loader vocabs.metadata zealot ;
IN: zealot.factor
! XXX: Could check if it's a branch instead with a git command
IN: zealot.factor
! XXX: Could check if it's a branch instead with a git command
{ [ length 40 = ] [ [ hex-digit? ] all? ] } 1&& ;
: download-boot-checksum-branch ( path branch -- )
{ [ length 40 = ] [ [ hex-digit? ] all? ] } 1&& ;
: download-boot-checksum-branch ( path branch -- )
- '[ _ "https://downloads.factorcode.org/images/%s/checksums.txt" sprintf download ] with-directory ;
+ '[ _ "https://downloads.factorcode.org/images/%s/checksums.txt" sprintf download drop ] with-directory ;
: download-boot-checksum-git-checksum ( path checksum -- )
: download-boot-checksum-git-checksum ( path checksum -- )
- '[ _ "https://downloads.factorcode.org/images/build/checksums.txt.%s" sprintf download ] with-directory ;
+ '[ _ "https://downloads.factorcode.org/images/build/checksums.txt.%s" sprintf download drop ] with-directory ;
: download-boot-checksums ( path branch/checksum -- )
dup git-checksum?
: download-boot-checksums ( path branch/checksum -- )
dup git-checksum?
[ download-boot-checksum-branch ] if ;
: download-boot-image ( path url -- )
[ download-boot-checksum-branch ] if ;
: download-boot-image ( path url -- )
- '[ _ my-arch-name "boot.%s.image" sprintf download-to ] with-directory ;
+ '[ _ my-arch-name "boot.%s.image" sprintf download-to drop ] with-directory ;
: arch-git-boot-image-path ( arch git-id -- str )
"https://downloads.factorcode.org/images/build/boot.%s.image.%s" sprintf ;
: arch-git-boot-image-path ( arch git-id -- str )
"https://downloads.factorcode.org/images/build/boot.%s.image.%s" sprintf ;