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
| text | | |
[ | |
EpMonitor current disable. | |
Metacello new | |
baseline: 'Bloc'; | |
repository: 'github://feenkcom/Bloc/src'; | |
load: 'Bloc-Text-Rope' | |
] ensure: [ EpMonitor current enable ]. |
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
Object subclass: #Artist | |
instanceVariableNames: 'tracks' | |
methods for: 'initialising' | |
initialize | |
tracks := OrderedCollection new. | |
^self | |
methods for: 'checking' | |
invariant | |
^(tracks isMemberOf: OrderedCollection) and: [ |
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
| seq | | |
seq := OrderedCollection with: 1 with: 1. | |
1 to: 1000 do: [ :n | | |
seq add: (seq last * ((4 * n) + 2)) / (n + 2)]. | |
seq |
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
myColl := 1 to: 20. | |
[ :job | | |
myColl | |
do: [ :e | | |
job | |
progress: e / myColl size; | |
title: 'waiting ' , e asString. | |
(Delay forSeconds: 0.5) wait ] ] asJob run |
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
Transcript clear; cr; show: 'Updating Zinc...'; cr. | |
Metacello new | |
repository: 'github://svenvc/zinc/repository'; | |
baseline: 'ZincHTTPComponents'; | |
load. | |
Transcript cr; show: 'Installing Seaside...'; cr. | |
Metacello new |
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
def Account(balance): | |
ret = None | |
while True: | |
# receive message | |
selector, *args = yield ret | |
# dispatch | |
if selector == 'withdraw': |
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 entropy # pip install entropy | |
from collections import namedtuple | |
MIN_ENTROPY = 0.5 | |
MIN_LENGTH = 140 | |
S = namedtuple('S', 'text entropy') | |
def read_entropic(prompt='', min_entropy=MIN_ENTROPY, min_length=MIN_LENGTH): | |
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
# flake8: noqa | |
import regex | |
import collections | |
from typing import NamedTuple | |
class OrderedClassMembers(type): | |
@classmethod |
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
; -*- mode: lisp; mode: paredit -*- | |
(defmacro defattrs [klass-name | |
&optional [super-klasses []] [options []] [attrs []] | |
&rest body] | |
`(do | |
(import attr) | |
(with-decorator ~(if options `(attr.s ~@options) 'attr.s) | |
(defclass ~klass-name ~super-klasses | |
~(list (interleave |
NewerOlder