This file contains 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
=begin comment | |
Project Euler | |
Problem: 8 | |
Title: Largest product in a series | |
Description: | |
The four adjacent digits in the 1000-digit number that have the greatest product are 9 × 9 × 8 × 9 = 5832. | |
73167176531330624919225119674426574742355349194934 | |
96983520312774506326239578318016984801869478851843 | |
85861560789112949495459501737958331952853208805511 |
This file contains 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
<!doctype html> | |
<html class="no-js" lang="en" dir="ltr"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="x-ua-compatible" content="ie=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>IOTA Wallet by bitworkers</title> | |
<link rel="stylesheet" href="foundation/src/css/foundation.css"> | |
<link rel="stylesheet" href="foundation/src/css/app.css"> | |
<link rel="stylesheet" href="css/main.css"> |
This file contains 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
### client sending message async | |
use v6; | |
use lib 'lib/network'; | |
use client; | |
say "Running Test..."; | |
loop { | |
sleep-until now+2; |
This file contains 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
### So, I got this to listen to incoming requests | |
#unit package EC::Network:auth<github:bioduds>; | |
unit module EC::Network; | |
class Socket { | |
has $.listener; | |
method run { | |
loop { | |
my $conn = $!listener.accept; |
This file contains 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
my $socket = IO::Socket::Async.listen('192.168.1.106', 5000); | |
react { | |
whenever $socket.Supply -> $v { | |
say "Working"; | |
} | |
} |
This file contains 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
my $socket = IO::Socket::Async.listen('192.168.1.106', 5000); | |
react { | |
whenever $socket.Supply -> $v { | |
if $v.chars > 0 { | |
say $v; | |
} | |
} | |
} |
This file contains 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
my $socket = IO::Socket::Async.bind-udp('localhost', 5000); | |
react { | |
whenever $socket.Supply -> $v { | |
if $v.chars > 0 { | |
say $v; | |
} | |
} | |
} |
This file contains 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
##### THIS RUNS IT | |
unit package EC::Network:auth<github:bioduds>; | |
use message; | |
## register class - rule is must be readable once | |
class Reader { | |
has $.message; | |
method read { | |
say "Message Network system reading " ~ $!message; |
This file contains 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
## reusable grammars | |
grammar TIMESTAMP { | |
rule TOP { <WEEK-DAY> <MONTH> <DAY> <TIME> <PLACE> <PLACE> <YEAR> } | |
token WEEK-DAY { \S+ } | |
token MONTH { \S+ } | |
token DAY { \d+ } | |
token TIME { \d+ \: \d+ \: \d+ } | |
token PLACE { \S+ } | |
token YEAR { \d+ } | |
} |
This file contains 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
#### SO, I have this grammar | |
unit package EC::Grammars:auth<github:bioduds>; | |
grammar ADDR { | |
rule TOP { <IDENTIFIER> <TIMESTAMP> <LINKER> <ADDRESS>+ } | |
token IDENTIFIER { 'Right now, ' } | |
rule TIMESTAMP { <WEEK-DAY> <MONTH> <DAY> <TIME> <PLACE> <YEAR> } | |
token WEEK-DAY { \S+ } | |
token MONTH { \S+ } |
NewerOlder