Say I want to make a text board using this script How would I go about making more boards in customizing the index to my liking
I did run extensive benchmarks for every web servers in Scheme, old and news. I was planning to publish them but I don't have them right now.
It's a simple honeypot for spambots, better than captchas and other annoyances and good enough for a small textboard. I don't know how you can remove them with emacs, CSS rules do that for web browsers.
grep and other tools could do it on the webpage so you can probably hide these honeypot fields with emacs. I'd be interested in a solution.
New anon here. Cool stuff. I've (somewhat) gotten it working on my local server. Sorry for the stupid question, but is nginx all I would need to make this public-facing?
Nevermind, answered my own question. Pretty much works now. Once I've gotten a more permanent setup I'll post a link.
One of my main confusions as of now is the hash file. The file needs to exist fot posts to be made, and its value is present in the html for the input field.I just made a file called hash and gave it arbitrary contents and things started working, but I'm guessing the value is supposed to be changed dynamically (once per post, maybe)? So, what purpose does the file serve?
The hash file is read by get-form-hash in bbs.scm. It is called for the value of the ornamentum field by make-post-form and make-thread-form in templates.scm. The ornamentum field is read by validate-form in bbs.scm as the hash of the let. Validate-form then proceeds to do precisely nothing with the hash value. After the size checks it only cares that the message and name fields are empty. Therefore it appears that the hash/ornamentum is intended as another antispam measure that is yet to be implemented, and is currently a no-op.
This is the type of thread that you can write in every time you visit the site! You can do anything from use this as a personal log for your project, to sharing what you're hacking on at the moment, or to critique something some else did in the thread. I'm looking forward to hearing what you guys are up to!
Personally I've been working on a radix tree implementation in R7RS, it seems moderately efficient and not too bad to use, although I haven't finished many of the operations, and I'm not sure I will due to the awareness of a better way to do it if I only had the primitives (or even just a standardised FFI). Anyway thought I'd share it just because it's something to talk about. Due to the file limit I'm only posting the introduction, imports, exports, and type here, but a link to the full source can be found here: http://ix.io/1wB1.
; This is a implementation of a radix tree in the style of Clojure or ; Scala, meaning a not particularly good implementation. Ideally this ; would be a adaptive radix tree as described in the following paper: ; http://www-db.in.tum.de/~leis/papers/ART.pdf ; additionally it'd be nice to be able to have a variant for using SIMD ; functions on unboxed values if possible. Regardless scheme does not ; have the necessary primitives for implementing a adaptive radix tree ; to its full potential, namely access or abstractions of SIMD functions ; for the search function. ; much of this library may seem unidiomatic, this is simply because I'm ; trying quite hard to A) avoid allocations and B) factor out functions ; when they can be used in multiple situations, even if this means adding ; a bit of complexity. ; one of the goals of this library was to be exceedinly standard compliant, ; it's written entirely in R7RS small with SRFI 1 & 60. That being said ; this doesn't actually make this a particularly portable library due to ; the lack of upto date compliance with the standard and implementation ; of SRFI 60. To my knowledge the following implementations would likely ; be able to run this library: Foment, Gauche, Larceny, & Sagittarius. (define-library (data radix) (export radix-ref radix-set radix->list radix->vector vector->radix list->radix radix radix-append radix-data radix-length radix-depth)) (import (scheme base) (srfi 1) ; append! in radix->list (srfi 60)) ; bitwise operations (define-record-type radix #t #f data length depth)
Oh man! Looks like I've got a programming day in my future! The past two days what I did was start to clean up my init.el, read some about literate programming, and to implemented a little program to convert between hsl rgb & to measure contrast between two rgb colors: http://ix.io/1Brq I might look into generating little color swashes at some point. The goal with these random programs is to help me make a psuedo-scientific (knowledge of rods/cones & some studies) color pallet to avoid eye strain.
Past few days I've only been doing 'dev ops' (I really hate this kinda thing), doing some research on type design, and researching color proccessing further:
;; Primarily based off of doi:10.1167/11.5.8 and the meta analysis done there ;; on the state of the art. They come to the conclusion that .2 degrees is the ;; critical point for fonts, that is to say the smallest size at which the ;; majority of readers can read at maximum speed. In addition to this they ;; reviewed the fonts of print publications discovering the majority to lie ;; within the .22 to .25 range. ;; Programmers have several unique considerations when it comes to typography. ;; Due to the nature of programming having more context on screen at a time ;; reduces the amount of scrolling and searching neccessary to understand any ;; particular function. For this reason many programmers prefer smaller type ;; faces than they use in their other applications. Smaller typefaces are more ;; ledgeable when they have larger x-height ratios, this is something ;; programmers also tend to like even though they don't neccessarily recognise ;; it. Programmers also tend to use Monospace fonts, these fonts make the ;; structure of programs more clear. ;; The last thing of note is the history of digital type design, and a ;; associated complaint. Digital type design was historically done on raster ;; grid unlike its free flowing print cousin. This was done due to the ;; resolution of the screens and the physical capabilities of computers. Even ;; vector fonts designed for digital useage, so called 'web safe fonts', such ;; as Verdana, Arial, & Georgia were done in this way. Additionally, and likely ;; for this same reason digital types, even those being used for body text, ;; tend to be sans-serif. This is likely for the same reason, on older displays ;; the restrictions on the resolution of the font. That being said many ;; programmers today still prefer fonts designed in this style and even bitmap ;; fonts due to the increased clarity they offer, and the reduction in ;; anti-aliasing which some individuals get eye-strain from. (define (ideal-font-size x-height-ratio inches-from-screen software-dpi physical-dpi) (let* ((ideal-x-height-radians (/ 3.141592 900)) ; .2 degrees (ppi-scaling (/ software-dpi physical-dpi)) (points-from-screen (* inches-from-screen 72))) (/ (* ideal-x-height-radians points-from-screen) ppi-scaling x-height-ratio)))
I finished up my typographic research hoping to be able to make more small functions like in my previous post, unfortunately the studies I found were flaky and imprecise. I'll either conduct a little bit of my own research or I'll start trying to implement the functions necessary to generate the color scheme as I mentioned was my original intention: http://ix.io/1BS2
Most of my computer time has unfortunately been spent getting ready to migrate operating systems and reconfiguring things, but I have managed to get a few things done. I made a corrected contrast function: http://ix.io/1zKq and decided on abstractly the hues and contrast levels I want, but haven't picked specifics. The theory of color I had before was a bit absurd so that went out the window. I've also been reading 'Computers & Typesetting, Volume C' (The Metafont Book) with hopes of perhaps making a typeface but haven't made a dramatic amount of progress.
I've completed The Metafont Book, and made a exceedingly poor implementation of my Emacs theme, but other than this I don't believe I've done anything even computationally related.
Is anyone here using it? I've only recently heard about this.
Reminds of luakit, but with Lisp.
i bookmarked that link to look @ later
installed it from the aur and started using it yesterday
literally crashes all the time and when it doesn't its just slow
such a shame, it uses lisp, is keyboard driven, and has emacs bindings: it should be better and I hope they fix the browser
The curve of her breasts drove her mad. As her lover sprawled out across the bed, her hair splashing over the pillow like a dark, lifeless sea, she could appreciate nothing more than the sheer beauty that was Alyssa. Eva smiled softly before leaning over her classmate's body and gently brushing her warm lips across her collarbones. The skin she tasted was soft and always sweet. Yet as much as this spot's attentions made Alyssa moan in delight, it wasn't nearly as delicious as other places on the girl's body. Eva hungered for them, more now than she usually did. The ache for Alyssa was always there, of course. Ever since she'd had her first taste, Eva was addicted. It was something at the forefront of her mind, like an itch she couldn't scratch. Meeting her in the Computer Lounge would sate her desires, but never for long enough.
Alyssa's eyes fluttered closed, cherishing the feeling of Eva's smooth lips dancing over her. She could feel her skin ablaze with heat even though she was lying naked on the bed during wintertime. In her own room she would be freezing, no matter how she were dressed and burrowed underneath the covers. Eva was enough to incite a raging fire within her, one that roared when she was close, and had kindled embers when she wasn't near.
Her lips trailed over Alyssa's skin, tongue daring to flick gently every so often. Further down she went, past the collarbones, over the plain, and to the gentle peaks she sought. Eva gave a delighted gasp, cupping her lover's breasts gently in her hands. Alyssa moaned appreciatively, locking a loving gaze with Eva before the latter closed her eyes and wrapped her lips softly around her nipple. She sucked softly, shivering with delight at the sweetness she tasted in her mouth. There was only one other place on Alyssa's body which tasted more blissful than what she was cradling with her tongue now.
Moaning, Alyssa arched her back a little. Short gasps escaped her lips as she ran her fingers through Eva's hair, daring to wrap her fingers around a few strands and give an appreciative pull. Eva moaned in reply, sending beautiful vibrations through Alyssa. Her tongue moved so fast that Alyssa felt a dizziness spreading over her. "Eva..." Alyssa called in a heavy whisper.
Eva looked up, smiling at the sound of her lover's calls. "Alyssa..." She returned, before making a long, warm trail down the girl's stomach with her soft tongue. Eva could feel Alyssa shivering with delight as she went lower, heading towards what each of them desired now more than all else. Taking each of her thighs gently in her hands, Eva parted Alyssa's legs, smiling appreciatively at what she saw. The brown thatch of hair that drove her wild with hunger... and what lay beneath it.
The pair took their places silently, Eva kneeling on the floor gratefully, Alyssa laying on the edge of the bed before her. With only a look between them to prepare her, Eva leaned close and began to softly flick her tongue across that which haunted her every moment. In response, Alyssa arched her back, moaning softly at first, until Eva's tongue quickened its pace. The heat was rising within her, like waves. It was slow at first, until it became so prominent that Alyssa writhed and began clawing at the sheets behind her. Eva's eyes wandered up over Alyssa's body, seeing her breasts gently swaying while she called out to her, moaning her name amongst incomprehensible sounds of delight. Alyssa's gasps were growing more urgent, letting Eva know her lover was about to come.
Alyssa felt the warmth inside her building, causing her to clutch the sheets within her hands with all her might. As she was overtaken, Eva still licking her warmest, softest spot with feverish delight, Alyssa let out a scream of release, hips jerking. Eva's eyes flashed as she was greeted with the nectar that she could never drink enough of. It was sweet and blissfully tart all at the same time. Eva drank until there was no more. Alyssa went limp, body continuing to spasm delightfully. She closed her eyes, unable to move. From beside her, Eva crawled up onto the bed and took her body in her arms. The warmth between them made both the girls smile.
"I love you, Alyssa..." Eva whispered, wrapping her arms around Alyssa and pulling her as close to her body as she could.
"I love you too, Eva..." Alyssa breathed in reply before giving a soft smile of contentment and snuggling close.
It's crazy how much work people put into this.
how much work
The fic is less than five thousand characters. The Scheme code for this site is over a quarter of a million.
$ wget -O 28.html 'https://textboard.org/prog/28' $ sed -r -e 'H;$!d;x; s#^.*(\[1/2\].*snuggling close\.).*$#\1#' 28.html | wc 12 779 4629
$ cd schemebbs $ expr $(find . -name '*.scm' -printf '%s ' | sed -r -e 's/( [[:digit:]])/ +\1/g') 252484
Reportedly, the author of the GPL licensed text-mode casino game "GPC-Slots 2" has rescinded the license from the "Geek feminist" collective.
The original author, after years of silence, notes that the "Geek Feminist" changed a bunch of if-then statements which were preceded by a loop waiting for string input to a switch statement. The author reportedly noted that to use a switch statement in such an instance is no more preformant than the if-thens. Switch statements should be used where the input to the switch statement is numerical, and of a successive nature, for most efficient use of the jump table that is generated from said code.
The author reportedly was offended, after quiet observation of the group, that the "Geek Feminists" mocked his code, mocked his existence as a male, and never did any work on the code afterwards and never updated to include new slot machines added to the original code by author subsequently.
The author notes that he neither sought nor received any compensation for the granted license, that is was a gratuitous license, and that there never was any refutation of his default right to rescind given. (A right founded in the property law of licenses.)
The copyright owner has reportedly watched quietly as each year the "Geek Feminists" published a recount of their heroic efforts regarding his code. Presumably he has now had enough of it all...
The author notes that the SF Conservancy attempts to construe a particular clause in the GPL version 2 license text as a "no revocation by grantor clause", however that clause states that if a licensee suffers and automatic-revocation by operation of the license, that licensees down stream from him do not suffer the same fate. The author of "GPC-Slots 2" reportedly notes that said clause does only what it claims to do: clarifies that a downstream licensee, through no fault of his own, is not penalized by the automatic revocation suffered by a licensee he gained a "sub-license" from (for lack of a better term.)
The author reportedly notes that version 3 of the GPL did not exist when he published the code, additionally the author notes that even if there was a clause not to revoke, he was paid no consideration for such a forbearance of a legal right of his and thus said clause is not operative against him, the grantor, should it exist at all.
(Editor's note: GPL version 3 contains an explicit "no-revocation-by-grantor" clause, in addition to a term-of-years that the license is granted for. Both absent in version 2 of the GPL)
The author reportedly has mulled an option to register his copyright and then to seek damages from the "Geek Feminists" if they choose to violate his copyright post-hence.
(Editors note: Statutory damages for willful copyright infringement can amount to $150,000 plus attorney's fees for post registration violations of a differing nature to pre-registration violations.)
GPC-Slots 2 is a text console mode casino game available for linux with various slot machines, table games, and stock market tokens for the player to test his luck. For the unlucky there is a Russian Roulette function.
[Notice: the revocation of the "Geek Feminists" license /just/ occurred. 2019. January.]
Keep this garbage on 8chan.
The Scheme BBS, an anonymous textboard entirely written in
Right now it's still a bit rough around the edges but should be usable.
Anyway, let's test it!
Can't believe how I managed to be a hobo and have this place survived. Thanks for all the posts.
A cheap VPS is cheaper than a pack of cigarettes nowadays.
chipshandon is gay
Can somebody please implement a function which computes the cartesian product of any number of lists/sets???
To compute the cartesian product A1x...xAn:
- if n is 0 return empty
- if n is 1 map over A1 with list
- otherwise n >= 2
-- if A1 is empty return empty
-- compute P2 as A2x...xAn
-- if P2 is empty return empty
-- combine A1 with P2 and return the result
To combine A and B, map over A with a map over B with consing A_elem with B_elem, then flatten the result with e.g. append. After this simple version works, this step can be optimized a bit.
op, fuck these guys, just google it
nobody has time to implement when you can just copy somebody else's solutions
The following is a reasonably performant implementation, but it still makes many repeat calls to the same function with the same values meaning that it would benefit massively from memoization. I have to make a sufficiently general version of memoize for this but I'll consider posting it when complete. I'm using the curried function here to avoid any sort of reverse or append of the lists.
(define (cartesian-product . An) (let cartesian-product-iter ((values (lambda (x) x)) (An An)) (if (null? An) (values '()) (map (lambda (x) (cartesian-product-iter (lambda (y) (values (cons x y))) (cdr An))) (car An)))))
Interestingly memoizing this function actually resulted in identical performance on all tested implementations. This must be due to some common code transformation shifting previous loop values within scope or some such thing (I've not looked into these transformations to know for sure). Needless to say this is actually exceedingly fast, I was able to calculate the cartesian product of a 5000 dimension 2000 wide set of non-repeating data on my x220 in 15 seconds in Gauche, and around 50 seconds in Chibi. Just for the sake of it I'll go ahead and post the memoized version here, but there is really no reason to use it, it's uglier, requires a helper, and depends on outside libraries. I hope these functions solve your problem sufficiently anon, I'm sorry I wasn't able to respond in a more timely manner.
(import (scheme base) (scheme hash-table) (scheme comparator)) (define (memo-cartesian-product . An) (define table (make-hash-table (make-default-comparator))) (define cartesian-product-iter (memoize (lambda (values An) (if (null? An) (values '()) (map (lambda (x) (cartesian-product-iter (lambda (y) (values (cons x y))) (cdr An))) (car An)))) (lambda (x) (cadr x)) table)) (cartesian-product-iter (lambda (x) x) An)) ; a generalised memoize function based off of SICP exercise 3.27 (define (memoize function convertor table) (lambda x (let* ((hashable-x (convertor x)) (memoized-value (hash-table-ref table hashable-x (lambda () #f)))) (or memoized-value (let ((result (apply function x))) (hash-table-set! table hashable-x result) result)))))
This function is actually broken because I'm memoizing the result of evaluating the curried function as the result for every call to a sublist of An, this means it's returning the first all of the memoizing for every recomputation. The point is thus even more clear the function is of equivilent performance, ugly, wrong, and dependent on libraries, interesting stuff. (gotta look into what's actually happening here)
Got any ideas to extend the language you're working in or willing to describe your ideal language? This is the thread for you.
If you've been in the 'What are you working on?' thread you've no doubt heard that I'm working on a radix-tree library in scheme. I've been trying to think of the applications of this feature at a PLT level, and a few things have come to mind. The first is that because you can express all other abstract collections in variations of this datastructure with immutable vectors, HAMTs, & conc lists you can actually write universals on all the derivative abstractions. So you could have a generic map function which applies to sets, vectors, & lists extremely simply, and this allows you to develop a large number of predefined functions on these data structures like in Pico Lisp, & APL without losing the express power of having many different collection types. The second is that if you implemented the Adaptive variant of the core library you could have a very functional vector programming language without sacrificing memory, or the expressiveness of vector programming languages (although you are less efficient than a typical vector programming language for append, insert, and delete because I don't think you can actually have a relaxed adaptive radix-tree). Third you can pretty easily integrate a system of reference counting into the core data structure such that any node will be removed if there are zero references to it. If you're willing to give up assignment similar to Linear Lisp you can use this reference count to frequently get in place updates on your data structures and to have a programming language with deterministic garbage collection and effectively zero over head from it without having any sort of explicit memory management or the consequences of state. If all of these things were implemented the result would effectively be a performant variant of Backus's function-level programming languages although not quite. What are /prog/'s thoughts on this?
Finding this page (and linked slides) very helpful. Includes good examples showing more advanced macro/continuation usage.
Does anyone know of any cool applications of advanced use of continuations? Some code I could try to read?
Continuations seem to be used for either insane abstractions like threading, tail call optimisation, & exceptions or exceeding simple things like returning multiple arguments, or return statements. I've unfortunately only ever used them for the latter like in the following function:
#!/usr/local/bin/guile -s !# (define (screen-file return) (define (screen-file-iter number) (define file-name (string-append (passwd:dir (getpwuid (getuid))) "/screen" (number->string number) ".png")) (catch 'system-error (lambda () (open file-name (logior O_CREAT O_EXCL))) (lambda response (if (= (system-error-errno response) EEXIST) (screen-file-iter (+ number 1)) (begin (display response) (exit))))) (return file-name)) (screen-file-iter 1)) (system* "ffmpeg" "-loglevel" "-8" "-f" "x11grab" "-video_size" "1366x768" "-i" ":0" "-vframes" "1" "-y" (call/cc screen-file))
P.S. If you started looking up continuations based off the 'what are you working on?' thread keep in mind that the anon who's using a continuation there (me) isn't actually, it's just a mutually recursive higher order function with a poorly named parameter, this thread reminded me to rename that.