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
#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; | |
} |
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
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 |
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
struct queue_node { | |
struct queue_node *next; | |
void *p; | |
}; | |
struct vertex { | |
/* ... */ | |
struct queue_node queue_entry; | |
}; |
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
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 |
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 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) |
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
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(""); |
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
] 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 |
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
// C++コード | |
struct Foo { | |
Foo(); | |
~Foo(); | |
}; | |
Foo *constructFoo() { | |
return new Foo(); |
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
--------------------------------------------------- | |
----- | |
----- util.vhd | |
----- | |
library IEEE; | |
use IEEE.STD_LOGIC_1164.all; | |
use IEEE.NUMERIC_STD.ALL; | |
package util is |
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
Daemons: | |
* bitcoin-netd | |
Communicates with the bitcoin P2P network, and maintains a copy of the block chain and pending txns. | |
Has functions for querying the block and txn chain. | |
No private data whatsoever. | |
API: | |
* GetStatus() - Returns current latest block ID and generation number | |
* GetPendingTransactions() - Returns transactions not yet in a block [may have filter fields of some sort] |