- Chapter 2
- exercise 3
- Perl : 164 char
- Ruby : 125 char
- exercise 4
- Perl : 168 char
- Ruby : 166 char
- exercise 5
- Perl : 93 char
- exercise 3
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 -w | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use File::Slurp; | |
use File::Find::Rule; | |
use Digest::SHA1; | |
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 -w | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use LWP::UserAgent; | |
use XML::RSS; | |
use HTML::ResolveLink qw/extract_main_html/; | |
use experimental 'signatures'; | |
use RSS::DB; |
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 pieChart { | |
use Moose; | |
has 'label', is => 'ro', isa => 'Str'; | |
has 'data', is => 'ro', isa => 'ArrayRef'; | |
has 'pcsuccess', is => 'ro', isa => 'Int'; | |
has 'pcerror', is => 'ro', isa => 'Int'; | |
sub png { | |
use GD::Graph::pie; |
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 -w | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use experimental 'postderef'; | |
use Data::Dumper; | |
my $ref = [ { 'az' => 'er', 'ty' => 'uiop', }, | |
[ 1..12 ], |
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 strict; | |
use warnings; | |
while (<DATA>) { | |
next unless s/\bcei\b/iec/i; | |
tr/a-z/A-Z/; | |
print; | |
} | |
__DATA__ |
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 -w | |
use strict; | |
use warnings; | |
use feature 'say'; | |
use XML::LibXML; | |
use Excel::Writer::XLSX; | |
my $path = "C:/genie/perl-5.20/scripts/input_files"; |
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/ruby1.9.3 | |
# -*- coding: utf-8 -*- | |
class Humeur | |
attr_accessor :depression | |
attr_accessor :anxiete | |
attr_accessor :irritabilite | |
attr_accessor :excitation | |
attr_reader :moment | |
attr_reader :id |
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 "sinatra" | |
require "sqlite3" | |
require "json" | |
db = SQLite3::Database.new "hiragana.db" | |
set :public_folder, "." | |
###################################################################################### | |
### UI web |
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
<?php | |
class T | |
{ | |
protected $methods = array(); | |
public function addMethod($name, $closure) { | |
$this->methods[$name] = $closure->bindTo($this, __CLASS__); | |
} |