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
| Method 'initialize' not found for invocant of class '' | |
| current instr.: 'cardinal;Class;new' pc 2010 (src/classes/Class.pir:119) | |
| called from Sub '!new' pc 1413 (src/builtins/classes.pir:116) | |
| called from Sub 'setup' pc 2503 (src/classes/NilClass.pir:57) | |
| called from Sub 'cardinal;cardinal;Compiler;main' pc 83720 (src/gen_actions.pir:6477) |
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
| .sub '' :load :init :anon | |
| # Well need this later: | |
| .local pmc nil | |
| nil = get_hll_global 'nil' | |
| # First, we'll make the parrot classes. | |
| .local pmc obj_pclass, cls_pclass, mdl_pclass | |
| obj_pclass = newclass 'Object' |
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
| use Digest::MD5 qw(md5_hex); | |
| my $text = $ARGV[0]; | |
| my @colors = (21,23..51,63..87,99..231,246..253); | |
| my $colors = @colors; | |
| my $color = $colors[int(md5_hex($text)) % $colors]; | |
| print "[38;5;" . $color . "m$text\n" . "[0m"; |
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 handle_random(self, target, args): | |
| index = -1 | |
| total_weight = 0 | |
| current_time = time.time() | |
| for ttime in self.times: | |
| total_weight += math.log(current_time - ttime) | |
| r = self.rnd.random() * total_weight | |
| for n in range(len(self.quotes)): | |
| if index == -1: | |
| weight = math.log(current_time - self.times[n]) |
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
| require 'gtk2' | |
| dialog = Gtk::FileChooserDialog.new("Open File", | |
| nil, | |
| Gtk::FileChooser::ACTION_OPEN, | |
| nil, | |
| [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL], | |
| [Gtk::Stock::OPEN, Gtk::Dialog::RESPONSE_ACCEPT]) | |
| dialog.select_multiple = true |
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
| grammar Assembly { | |
| rule TOP { ^ <statement>+ $ } | |
| rule statement { | |
| <operator> <operand> $$ | |
| } | |
| rule operator { | |
| | lda | |
| | ldx | |
| | ldy | |
| } |
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
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| use Dancer; | |
| get '/' => sub { | |
| return "Hi!"; | |
| }; | |
| get '/bye' => sub { |
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
| token ip_address { [<octet> '.'] ** 3 <octet> } | |
| token octet { | |
| | 25<[0..5]> | |
| | 2<[0..4]><[0..9]> | |
| | 1<[0..9]><[0..9]> | |
| | <[1..9]><[0..9]> | |
| | <[0..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
| The code that actually loads this is executed from $882B | |
| LDA $045F | |
| STA $0303 | |
| INC $045F | |
| LDY $0415 ; $0415 apparently contains the conversation to be loaded | |
| LDA $8000,Y | |
| STA $00 | |
| INY | |
| LDA $8000,Y |
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
| #!/usr/bin/perl | |
| use Modern::Perl; | |
| use Coro; | |
| sub do_a_thing { | |
| my @args = @_; | |
| my $cb = pop @args; | |
| async { | |
| for my $thing (@args) { | |
| say "Thing $thing"; |