Skip to content

Instantly share code, notes, and snippets.

// C++コード
struct Foo {
Foo();
~Foo();
};
Foo *constructFoo() {
return new Foo();
] mx-run Haver::Server --hostname localhost --port 7575 --interface 127.0.0.1
Odd number of elements in hash assignment at /usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line 335.
Validation failed for 'MooseX::Types::Structured::Tuple[MooseX::Types::Structured::Tuple[Object],MooseX::Types::Structured::Dict[]]' failed with value [ [ Haver::Server=HASH(0x315a0d8) ], { 127.0.0.1 => undef } ], Internal Validation Error is: Validation failed for 'MooseX::Types::Structured::Dict[]' failed with value { 127.0.0.1 => undef } at /usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line 365
MooseX::Method::Signatures::Meta::Method::validate('MooseX::Method::Signatures::Meta::Method=HASH(0x318aaa0)', 'ARRAY(0x318acc8)') called at /usr/local/share/perl/5.10.0/MooseX/Method/Signatures/Meta/Method.pm line 139
Haver::Server::run('Haver::Server=HASH(0x315a0d8)', 127.0.0.1) called at /usr/local/share/perl/5.10.0/MooseX/Runnable/Invocation.pm line 159
MooseX::R
my $gs = new Getopt::String(
option_switch('help', aliases => [qw/h/]),
option_counter('verbose', aliases => [qw/v/]),
option_stop(""),
option_arg('output', aliases => [qw/o/], key => 'outfile'),
option_arg('foo', aliases => ['foo'], optional_arg => 1)
);
my ($opts, $remain) = $gs->parse("");
use Test::More qw(no_plan); #tests => 32;
BEGIN { use_ok('Getopt::String', ":all"); }
my $gs = new Getopt::String(
option_switch($help, [qw/help h/]),
option_counter($verbose, [qw/verbose v/]),
option_stop(""),
option_arg($outfile, [qw/output o/]),
option_arg($foo, 'foo', optional_arg => 1)
my $gs = Getopt::String->new({
# --
"" => sub { $_[0]->stop(); },
# --help
help => sub { print $usage; exit 1; },
# --verbose[=n]
verbose => sub {
$verbosity = $_[0]->arg("Int", 1); # moose types. Second parameter is default
},
# --output filename
struct queue_node {
struct queue_node *next;
void *p;
};
struct vertex {
/* ... */
struct queue_node queue_entry;
};
This assumes debian's uml-utilities is installed.
] cat /etc/default/uml-utilities
# Options to pass to uml_switch.
# set to "false" if you want to prevent uml_switch from
# starting with SysV scripts in /etc/init.d
# UML_SWITCH_START="false"
# For preconfigured tap setup, see
#include <limits.h>
#include <stdlib.h>
size_t tmul(int x, int y) {
long long tv = (long long)x * (long long)y;
if (tv < 0 || tv > UINT_MAX)
return -1;
return tv;
}
function KeyMap:process(key)--{{{
keybuf = keybuf .. key
local found_key, func, index, dirn = mapping:find_near(key)
if found_key == nil then
-- No keys defined??
return
end