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
#!perl -- | |
use strict; | |
use warnings; | |
use Carp; | |
sub hexFromBytes($){ return unpack("H*",$_[0]); } | |
sub bytesFromHex($){ return pack("H*",$_[0]); } | |
sub bytesFromFloat($){ return pack('f',@_); } | |
sub intFromBytes($){ |
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
function formatFileError(err){ | |
var sb = err.toString(); | |
for( var k in err ){ | |
sb += "\n "+k+"="+err[k]; | |
if( k == "code" ){ | |
sb+=" "; | |
switch (err[k]) { | |
case FileError.QUOTA_EXCEEDED_ERR: sb += 'QUOTA_EXCEEDED_ERR'; break; | |
case FileError.NOT_FOUND_ERR: sb += 'NOT_FOUND_ERR'; break; |
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
function formatFileError(err){ | |
var sb = err.toString(); | |
for( var k in err ){ | |
sb += "\n "+k+"="+err[k]; | |
if( k == "code" ){ | |
sb+=" "; | |
switch (err[k]) { | |
case FileError.QUOTA_EXCEEDED_ERR: sb += 'QUOTA_EXCEEDED_ERR'; break; | |
case FileError.NOT_FOUND_ERR: sb += 'NOT_FOUND_ERR'; break; | |
case FileError.SECURITY_ERR: sb += 'SECURITY_ERR'; break; |
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
function formatFileError(err){ | |
var sb = err.toString(); | |
for( var k in err ){ | |
sb += "\n "+k+"="+err[k]; | |
if( k == "code" ){ | |
sb+=" "; | |
switch (err[k]) { | |
case FileError.QUOTA_EXCEEDED_ERR: sb += 'QUOTA_EXCEEDED_ERR'; break; | |
case FileError.NOT_FOUND_ERR: sb += 'NOT_FOUND_ERR'; break; | |
case FileError.SECURITY_ERR: sb += 'SECURITY_ERR'; break; |
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 <iostream> | |
#include <vector> | |
#include <boost/any.hpp> | |
void push_to_vector( std::vector<boost::any>& result ){} | |
template<typename First,typename ... Rest > void push_to_vector(std::vector<boost::any>& result ,First first ,const Rest& ... rest ){ | |
result.push_back( first ); | |
push_to_vector(result,rest ... ); | |
} |
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
package PSGI_CGI; | |
sub make_psgi_env($$$$){ | |
my($schema,$CGI_ENV,$stdin,$stderr)=@_; | |
$env = { | |
# コマンドラインから実行した場合には存在しないがPSGI的にMUSTな情報 | |
REQUEST_METHOD => 'GET' | |
,SCRIPT_NAME => '' | |
,PATH_INFO =>'' | |
,REQUEST_URI =>'' |
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
boolean f1( @NonNull String arg){ | |
return arg.contains( "foo" ); | |
} | |
String getStringOrNull(){ | |
return (System.currentTimeMillis() %1) ==0 ? null : "foo"; | |
} | |
void test(){ | |
f1(null); // 警告が出る | |
f1(getStringOrNull()); // 警告が出ない |
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
android.support.annotation の @NonNull が定数式以外に全く効果が無い件。 | |
この場合は test() の3つ目は警告を出して欲しいだろう普通 | |
boolean f1( @NonNull String arg){ | |
return arg.contains( "foo" ); | |
} | |
@NonNull String getString(){ | |
return "foo"; | |
} |
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
android.support.annotation の @NonNull が定数式以外に全く効果が無い件。 | |
この場合は test() の3つ目は警告を出して欲しいだろう普通 | |
boolean f1( @NonNull String arg){ | |
return arg.contains( "foo" ); | |
} | |
@NonNull String getString(){ | |
return "foo"; | |
} |
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
// android.support.annotation の @NonNull が定数式以外に全く効果が無い件。 | |
// この場合は test() の3つ目は警告を出して欲しいだろう普通 | |
boolean f1( @NonNull String arg){ | |
return arg.contains( "foo" ); | |
} | |
@NonNull String getString(){ | |
return "foo"; | |
} |