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
[15:01:42] root@localhost:~/.rakudobrew[master] **]#> strace -o logfile.txt ./perl6-m tools/build | |
strace: Test for PTRACE_O_TRACESYSGOOD failed, giving up using this feature. | |
strace: Can't stat './perl6-m': No such file or directory |
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
./perl6-m tools/build/install-core-dist.pl /root/rakudo/rakudo-star-2016.04/install/share/perl6 | |
Unhandled exception: Failed to write string to stream: bad file descriptor | |
at <unknown>:1 (././CORE.setting.moarvm:print_exception) | |
from gen/moar/m-CORE.setting:21425 (././CORE.setting.moarvm:<anon>) | |
from gen/moar/stage2/NQPHLL.nqp:1636 (/root/rakudo/rakudo-star-2016.04/install/share/nqp/lib/NQPHLL.moarvm:command_eval) | |
from src/Perl6/Compiler.nqp:29 (./blib/Perl6/Compiler.moarvm:command_eval) | |
from gen/moar/stage2/NQPHLL.nqp:1576 (/root/rakudo/rakudo-star-2016.04/install/share/nqp/lib/NQPHLL.moarvm:command_line) | |
from gen/moar/m-main.nqp:37 (/root/rakudo/rakudo-star-2016.04/rakudo/perl6.moarvm:MAIN) | |
from gen/moar/m-main.nqp:33 (/root/rakudo/rakudo-star-2016.04/rakudo/perl6.moarvm:<mainline>) | |
from <unknown>:1 (/root/rakudo/rakudo-star-2016.04/rakudo/perl6.moarvm:<main>) |
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
Rust is ready to roll. | |
[01:35:09] root@HOTEL-BASE:~ **]#> mkdir rustproj | |
[01:42:24] root@HOTEL-BASE:~ **]#> cd rustproj/ | |
[01:42:36] root@HOTEL-BASE:~/rustproj **]#> mkdir hello_world | |
[01:42:43] root@HOTEL-BASE:~/rustproj **]#> cd hello_world/ | |
[01:42:47] root@HOTEL-BASE:~/rustproj/hello_world **]#> vi main.rs | |
[01:43:32] root@HOTEL-BASE:~/rustproj/hello_world **]#> rustc main.rs | |
Segmentation fault (core dumped) |
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
use v6; | |
my $CRLF = "\x0d\x0a"; | |
my $listen = IO::Socket::INET.new(:listen, :localport(8080)); | |
loop { | |
my $conn = $listen.accept; | |
say $conn.recv(1024); | |
$conn.print("HTTP/1.1 200 OK$CRLF"); | |
$conn.print("Hello World!"); | |
$conn.close; |
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
class LocalServer { | |
my $.request-queue-size = 1; | |
my $.sock; | |
has $.server-addr; | |
has $.server-port; | |
method new(:$server-addr, :$server-port = 8080) { | |
self.bless(:$server-addr :$server-port); | |
$.sock = IO::Socket::INET.new(:listen, :localport($!server-port)) | |
} | |
} |
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
sub get-env { | |
%env = {}; | |
%env<REQUEST_METHOD> = $.request-method; | |
%env<REQUEST_URI> = $.request-uri; | |
%env<SERVER_PROTOCOL> = $.request-version; | |
%env<SERVER_PORT> = $.server-port.Str; | |
%env<p6w.version> = Version.new('v0.7.Draft'); | |
%env<p6w.url-scheme> = 'http'; | |
%env<p6w.input> = $.input-supply; | |
%env<p6w.errors> = $.error-supplier; |
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
use v6; | |
my constant CRLF = "\r\n"; | |
my $listen = IO::Socket::INET.new(:listen, :localport(8080)); | |
loop { | |
my $conn = $listen.accept; | |
say $conn.recv(1024); | |
$conn.print("HTTP/1.1 200 OK{CRLF}{CRLF}"); | |
$conn.print('<h1>Hello World!</h1>'); | |
$conn.close; |
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><head><style>body { margin: 0; }</style></head><body><script language="javascript"><!-- | |
document.write('<scr'+'ipt language="javascript1.1" src="http://adserver.adtechus.com/addyn/3.0/9936.1/3462819/0/170/ADTECH;loc=100;target=_blank;key=key1+key2+key3+key4;grp=[group];misc='+new Date().getTime()+'"></scri'+'pt>'); | |
//--> | |
</script><noscript><a href="http://adserver.adtechus.com/adlink/3.0/9936.1/3462819/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" target="_blank"><img src="http://adserver.adtechus.com/adserv/3.0/9936.1/3462819/0/170/ADTECH;loc=300;key=key1+key2+key3+key4;grp=[group]" border="0" width="300" height="250"></a></noscript></body></html> |
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
// sanitize inputs | |
import "regexp" | |
func main() { | |
r := regexp.MustCompile(`[^a-zA-Z\s]`) | |
s := r.ReplaceAllString("input with emoji or non alphanumeric characters", "") | |
} |
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
#include <stdint.h> | |
#include <stdio.h> | |
#define ENONE -999 | |
typedef int Err; | |
// TODO: this isn't so much an optional type as it is a Result type, like in Rust. rename accordingly (e.g. Result->Value/Type; | |
// Option->Result) | |
typedef union { | |
int8_t i8; | |
int16_t i16; |