Each week you will be assigned a topic related to Linux networking and security.
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
| /* jshint expr:true */ | |
| /* globals describe, it, beforeEach */ | |
| var chai = require( 'chai' ) | |
| , expect = chai.expect | |
| ; | |
| var moduleNames = ['lib/recurringDateObjects']; | |
| var moduleMethods = []; |
This is a summary of the "Learn You A Haskell" online book under http://learnyouahaskell.com/chapters.
- Haskell is a functional programming language.
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
| stepReverseSign :: (Fractional a, Ord a) => a -> a -> a | |
| stepReverseSign num step = (if num > 0 then -1 else 1) * (abs(num) + step) | |
| piCalc :: (Fractional a, Integral b, Ord a) => a -> (a, b) | |
| piCalc tolerance = piCalc' 1 0.0 tolerance 0 | |
| piCalc' :: (Ord a, Fractional a, Integral b) => a -> a -> a -> b -> (a, b) | |
| piCalc' denominator pi tolerance iterations = | |
| | abs( pi' - pi) < tolerance = ( pi', iterations ) | |
| | otherwise = piCalc' (stepReverseSign denominator) pi' tolerance (iterations + 1) |
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
| wcravens@aberforth:~/Repos/hoas/database$ pg_prove --version | |
| pg_prove 3.29 | |
| wcravens@aberforth:~/Repos/hoas/database$ ls test/* | |
| test/address.sql | |
| wcravens@aberforth:~/Repos/hoas/database$ pg_prove -d hoas_test test/*.sql | |
| test/address.sql .. ok | |
| All tests successful. | |
| Files=1, Tests=1, 0 wallclock secs ( 0.03 usr 0.01 sys + 0.03 cusr 0.00 csys = 0.07 CPU) | |
| Result: PASS | |
| wcravens@aberforth:~/Repos/hoas/database$ pg_prove -d hoas_test test/ |
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
| package MyRole; | |
| use Moo; | |
| with 'Foo'; | |
| 1; | |
| package main; | |
| use Test::More; | |
| ok my $foo = MyRole->new( bar => baz ); |
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 set_config { | |
| my $self = shift; | |
| my $config = My::Config->new; | |
| $self->app->log->debug( $config->test ); #yay | |
| $self->helper( config => sub { $config } ); | |
| $self->log->debug( $self->config->test ); # Can't call method "test" on unblessed reference | |
| } |
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/env perl | |
| use Mojolicious::Lite; | |
| get '/' => sub { shift->render('test/tab/index') }; | |
| app->start; |